|
| 1 | +export interface ValueProp { |
| 2 | + // Heading of a value proposition. |
| 3 | + header: string; |
| 4 | + // Body of a value proposition. |
| 5 | + body: string; |
| 6 | +} |
| 7 | +export interface UpdateProviderBody { |
| 8 | + team_id?: string; |
| 9 | + label?: string; |
| 10 | + name?: string; |
| 11 | + logo_url?: string; |
| 12 | + support_email?: string; |
| 13 | + documentation_url?: string; |
| 14 | +} |
| 15 | +export interface UpdateProvider { |
| 16 | + id: string; |
| 17 | + body: UpdateProviderBody; |
| 18 | +} |
| 19 | +export interface UpdateProductBody { |
| 20 | + name?: string; |
| 21 | + logo_url?: string; |
| 22 | + listing?: ProductListing; |
| 23 | + // 140 character sentence positioning the product. |
| 24 | + tagline?: string; |
| 25 | + // A list of value propositions of the product. |
| 26 | + value_props?: ValueProp[]; |
| 27 | + images?: string[]; |
| 28 | + support_email?: string; |
| 29 | + documentation_url?: string; |
| 30 | + // URL to this Product's Terms of Service. If provided is true, then |
| 31 | + // a url must be set. Otherwise, provided is false. |
| 32 | + terms_url?: string; |
| 33 | + feature_types?: FeatureType[]; |
| 34 | + integration?: UpdateProductBodyIntegration; |
| 35 | + tags?: string[]; |
| 36 | +} |
| 37 | +export interface UpdateProductBodyIntegration { |
| 38 | + provisioning?: string; |
| 39 | + base_url?: string; |
| 40 | + sso_url?: string; |
| 41 | + version?: 'v1'; |
| 42 | + features?: ProductIntegrationFeatures; |
| 43 | +} |
| 44 | +export interface UpdateProduct { |
| 45 | + id: string; |
| 46 | + body: UpdateProductBody; |
| 47 | +} |
| 48 | +export interface UpdatePlanBody { |
| 49 | + name?: string; |
| 50 | + label?: string; |
| 51 | + state?: string; |
| 52 | + // Used in conjuction with resizable_to to set or unset the list |
| 53 | + has_resize_constraints?: boolean; |
| 54 | + resizable_to?: string[]; |
| 55 | + // Array of Region IDs |
| 56 | + regions?: string[]; |
| 57 | + // Array of Feature Values |
| 58 | + features?: FeatureValue[]; |
| 59 | + // The number of days a user gets as a free trial when subscribing to |
| 60 | + // this plan. Trials are valid only once per product; changing plans |
| 61 | + // or adding an additional subscription will not start a new trial. |
| 62 | + trial_days?: number; |
| 63 | + // Dollar value in cents |
| 64 | + cost?: number; |
| 65 | +} |
| 66 | +export interface UpdatePlan { |
| 67 | + id: string; |
| 68 | + body: UpdatePlanBody; |
| 69 | +} |
| 70 | +export interface RegionBody { |
| 71 | + platform: string; |
| 72 | + location: string; |
| 73 | + name: string; |
| 74 | + priority: number; |
| 75 | +} |
| 76 | +export interface Region { |
| 77 | + id: string; |
| 78 | + type: 'region'; |
| 79 | + version: 1; |
| 80 | + body: RegionBody; |
| 81 | +} |
| 82 | +export interface ProviderBody { |
| 83 | + team_id: string; |
| 84 | + label: string; |
| 85 | + name: string; |
| 86 | + logo_url?: string; |
| 87 | + support_email?: string; |
| 88 | + documentation_url?: string; |
| 89 | +} |
| 90 | +export interface Provider { |
| 91 | + id: string; |
| 92 | + version: 1; |
| 93 | + type: 'provider'; |
| 94 | + body: ProviderBody; |
| 95 | +} |
| 96 | +export interface ProductListing { |
| 97 | + // When true, everyone can see the product when requested. When false it will |
| 98 | + // not be visible to anyone except those on the provider team. |
| 99 | + public?: boolean; |
| 100 | + // When true, the product will be displayed in product listings alongside |
| 101 | + // other products. When false the product will be excluded from listings, |
| 102 | + // but can still be provisioned directly if it's label is known. |
| 103 | + // Any pages that display information about the product when not listed, |
| 104 | + // should indicate to webcrawlers that the content should not be indexed. |
| 105 | + listed?: boolean; |
| 106 | + // Object to hold various flags for marketing purposes only. These are values |
| 107 | + // that need to be stored, but should not affect decision making in code. If |
| 108 | + // we find ourselves in a position where we think they should, we should |
| 109 | + // consider refactoring our listing definition. |
| 110 | + marketing?: ProductListingMarketing; |
| 111 | +} |
| 112 | +export interface ProductListingMarketing { |
| 113 | + // Indicates whether or not the product is in `Beta` and should be |
| 114 | + // advertised as such. This does not have any impact on who can access the |
| 115 | + // product, it is just used to inform consumers through our clients. |
| 116 | + beta?: boolean; |
| 117 | + // Indicates whether or not the product is in `New` and should be |
| 118 | + // advertised as such. This does not have any impact on who can access the |
| 119 | + // product, it is just used to inform consumers through our clients. |
| 120 | + new?: boolean; |
| 121 | + // Indicates whether or not the product is in `New` and should be |
| 122 | + // advertised as such. This does not have any impact on who can access the |
| 123 | + // product, it is just used to inform consumers through our clients. |
| 124 | + featured?: boolean; |
| 125 | +} |
| 126 | +export interface ProductIntegrationFeatures { |
| 127 | + // Indicates whether or not this product supports resource transitions to |
| 128 | + // manifold by access_code. |
| 129 | + access_code?: boolean; |
| 130 | + // Represents whether or not this product supports Single |
| 131 | + // Sign On |
| 132 | + sso?: boolean; |
| 133 | + // Represents whether or not this product supports changing |
| 134 | + // the plan of a resource. |
| 135 | + plan_change?: boolean; |
| 136 | + // Describes how the region for a resource is specified, if |
| 137 | + // unspecified, then regions have no impact on this |
| 138 | + // resource. |
| 139 | + region?: 'user-specified' | 'unspecified'; |
| 140 | +} |
| 141 | +export interface ProductBody { |
| 142 | + provider_id: string; |
| 143 | + // Product labels are globally unique and contain the provider name. |
| 144 | + label: string; |
| 145 | + name: string; |
| 146 | + state: string; |
| 147 | + listing: ProductListing; |
| 148 | + logo_url: string; |
| 149 | + // 140 character sentence positioning the product. |
| 150 | + tagline: string; |
| 151 | + // A list of value propositions of the product. |
| 152 | + value_props: ValueProp[]; |
| 153 | + images: string[]; |
| 154 | + support_email: string; |
| 155 | + documentation_url: string; |
| 156 | + // URL to this Product's Terms of Service. If provided is true, then |
| 157 | + // a url must be set. Otherwise, provided is false. |
| 158 | + terms: ProductBodyTerms; |
| 159 | + feature_types: FeatureType[]; |
| 160 | + billing: ProductBodyBilling; |
| 161 | + integration: ProductBodyIntegration; |
| 162 | + tags?: string[]; |
| 163 | +} |
| 164 | +export interface ProductBodyIntegration { |
| 165 | + provisioning: string; |
| 166 | + base_url: string; |
| 167 | + sso_url?: string; |
| 168 | + version: 'v1'; |
| 169 | + features: ProductIntegrationFeatures; |
| 170 | +} |
| 171 | +export interface ProductBodyBilling { |
| 172 | + type: 'monthly-prorated' | 'monthly-anniversary' | 'annual-anniversary'; |
| 173 | + currency: 'usd'; |
| 174 | +} |
| 175 | +export interface ProductBodyTerms { |
| 176 | + url?: string; |
| 177 | + provided: boolean; |
| 178 | +} |
| 179 | +export interface Product { |
| 180 | + id: string; |
| 181 | + version: 1; |
| 182 | + type: 'product'; |
| 183 | + body: ProductBody; |
| 184 | +} |
| 185 | +export interface PlanBody { |
| 186 | + provider_id: string; |
| 187 | + product_id: string; |
| 188 | + name: string; |
| 189 | + label: string; |
| 190 | + state: string; |
| 191 | + resizable_to?: string[]; |
| 192 | + // Array of Region IDs |
| 193 | + regions: string[]; |
| 194 | + // Array of Feature Values |
| 195 | + features: FeatureValue[]; |
| 196 | + // The number of days a user gets as a free trial when subscribing to |
| 197 | + // this plan. Trials are valid only once per product; changing plans |
| 198 | + // or adding an additional subscription will not start a new trial. |
| 199 | + trial_days?: number; |
| 200 | + // Dollar value in cents. |
| 201 | + cost: number; |
| 202 | +} |
| 203 | +export interface Plan { |
| 204 | + id: string; |
| 205 | + version: 1; |
| 206 | + type: 'plan'; |
| 207 | + body: PlanBody; |
| 208 | +} |
| 209 | +export interface FeatureValueDetails { |
| 210 | + label: string; |
| 211 | + name: string; |
| 212 | + // The cost that will be added to the monthly plan cost when this value |
| 213 | + // is selected or is default for the plan. |
| 214 | + // Cost is deprecated in favor of the `price.cost` field. |
| 215 | + cost?: number; |
| 216 | + // Price describes the cost of a feature. It should be preferred over |
| 217 | + // the `cost` property. |
| 218 | + price?: FeatureValueDetailsPrice; |
| 219 | + numeric_details?: FeatureNumericDetails; |
| 220 | +} |
| 221 | +export interface FeatureValueDetailsPrice { |
| 222 | + // Cost is the price in cents that will be added to plan's base cost |
| 223 | + // when this value is selected or is default for the plan. |
| 224 | + // Number features should use the cost range instead. |
| 225 | + cost?: number; |
| 226 | + // When a feature is used to multiply the cost of the plan or of |
| 227 | + // another feature, multiply factor is used for calculation. |
| 228 | + // A feature cannot have both a cost and a multiply factor. |
| 229 | + multiply_factor?: number; |
| 230 | + // Price describes how the feature cost should be calculated. |
| 231 | + formula?: string; |
| 232 | + // Description explains how a feature is calculated to the user. |
| 233 | + description?: string; |
| 234 | +} |
| 235 | +export interface FeatureValue { |
| 236 | + feature: string; |
| 237 | + value: string; |
| 238 | +} |
| 239 | +export interface FeatureType { |
| 240 | + label: string; |
| 241 | + name: string; |
| 242 | + type: 'boolean' | 'string' | 'number'; |
| 243 | + // This sets whether or not the feature can be customized by a consumer. |
| 244 | + customizable?: boolean; |
| 245 | + // This sets whether or not the feature can be upgraded by the consumer after the |
| 246 | + // resource has provisioned. Upgrading means setting a higher value or selecting a |
| 247 | + // higher element in the list. |
| 248 | + upgradable?: boolean; |
| 249 | + // This sets whether or not the feature can be downgraded by the consumer after the |
| 250 | + // resource has provisioned. Downgrading means setting a lower value or selecting a |
| 251 | + // lower element in the list. |
| 252 | + downgradable?: boolean; |
| 253 | + // Sets if this feature’s value is trackable from the provider, |
| 254 | + // this only really affects numeric constraints. |
| 255 | + measurable?: boolean; |
| 256 | + values?: FeatureValueDetails[]; |
| 257 | +} |
| 258 | +export interface FeatureNumericRange { |
| 259 | + // Defines the end of the range ( inclusive ), from the previous, or 0; |
| 260 | + // where the cost_multiple starts taking effect. If set to -1 this defines the |
| 261 | + // range to infinity, or the maximum integer the system can handle |
| 262 | + // ( whichever comes first ). |
| 263 | + limit?: number; |
| 264 | + // An integer in 10,000,000ths of cents, will be multiplied by the |
| 265 | + // numeric value set in the feature to determine the cost. |
| 266 | + cost_multiple?: number; |
| 267 | +} |
| 268 | +export interface FeatureNumericDetails { |
| 269 | + // Sets the increment at which numbers can be selected if customizable, by |
| 270 | + // default this is 1; for example, setting this to 8 would only allow integers |
| 271 | + // in increments of 8 ( 0, 8, 16, ... ). This property is not used if the |
| 272 | + // feature is measurable; except if it is set to 0, setting the increment to 0 |
| 273 | + // means this numeric details has no scale, and will not be or customizable. |
| 274 | + // Some plans may not have a measureable or customizable feature. |
| 275 | + increment?: number; |
| 276 | + // Minimum value that can be set by a user if customizable |
| 277 | + min?: number; |
| 278 | + // Maximum value that can be set by a user if customizable |
| 279 | + max?: number; |
| 280 | + // Applied to the end of the number for display, for example the ‘GB’ in ‘20 GB’. |
| 281 | + suffix?: string; |
| 282 | + cost_ranges?: FeatureNumericRange[]; |
| 283 | +} |
| 284 | +export interface FeatureMap { |
| 285 | + [name: string]: any; |
| 286 | +} |
| 287 | +export interface ExpandedProduct { |
| 288 | + id: string; |
| 289 | + version: 1; |
| 290 | + type: 'product'; |
| 291 | + body: ProductBody; |
| 292 | + plans?: ExpandedPlan[]; |
| 293 | + provider: Provider; |
| 294 | +} |
| 295 | +export interface ExpandedPlanBody extends PlanBody { |
| 296 | + // An array of feature definitions for the plan, as defined on the Product. |
| 297 | + expanded_features?: ExpandedFeature[]; |
| 298 | + // A boolean flag that indicates if a plan is free or not based on it's cost and features. |
| 299 | + free?: boolean; |
| 300 | + // Plan cost using its default features plus base cost. |
| 301 | + defaultCost?: number; |
| 302 | + // A boolean flag that indicates if a plan has customizable features. |
| 303 | + customizable?: boolean; |
| 304 | +} |
| 305 | +export interface ExpandedPlan { |
| 306 | + id: string; |
| 307 | + version: 1; |
| 308 | + type: 'plan'; |
| 309 | + body: ExpandedPlanBody; |
| 310 | +} |
| 311 | +export interface ExpandedFeature extends FeatureType { |
| 312 | + // The string value set for the feature on the plan, this should only be used if the value property is null. |
| 313 | + value_string?: string; |
| 314 | + value?: FeatureValueDetails; |
| 315 | +} |
| 316 | +export interface Error { |
| 317 | + // The error type |
| 318 | + type: string; |
| 319 | + // Explanation of the errors |
| 320 | + message: string[]; |
| 321 | +} |
| 322 | +export interface Credentials { |
| 323 | + [name: string]: string; |
| 324 | +} |
| 325 | +export interface CreateRegion { |
| 326 | + body: RegionBody; |
| 327 | +} |
| 328 | +export interface CreateProvider { |
| 329 | + body: ProviderBody; |
| 330 | +} |
| 331 | +export interface CreateProduct { |
| 332 | + body: ProductBody; |
| 333 | +} |
| 334 | +export interface CreatePlan { |
| 335 | + body: PlanBody; |
| 336 | +} |
0 commit comments