@stigg/js-client-sdk 3.85.1 → 3.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/EdgeApiClient.d.ts +1 -1
- package/dist/api/MockPaywallApi.d.ts +1 -1
- package/dist/api/PaywallApi.d.ts +1 -1
- package/dist/api/SubscriptionsApi.d.ts +2 -2
- package/dist/api/initApolloClient.d.ts +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +101 -101
- package/dist/services/eventEmitter.d.ts +1 -1
- package/dist/utils/dateUtils.d.ts +1 -1
- package/dist/utils/fetch.d.ts +1 -2
- package/dist/utils/isMetered.d.ts +1 -1
- package/dist/utils/mapGetEntitlementsFallback.d.ts +5 -5
- package/dist/utils/withErrorHandling.d.ts +2 -2
- package/package.json +15 -16
- package/dist/src/api/ApiGateway.d.ts +0 -28
- package/dist/src/api/AutomaticRechargeApi.d.ts +0 -23
- package/dist/src/api/CheckoutApi.d.ts +0 -8
- package/dist/src/api/CouponsApi.d.ts +0 -8
- package/dist/src/api/CreditsApi.d.ts +0 -11
- package/dist/src/api/CustomersApi.d.ts +0 -16
- package/dist/src/api/EdgeApiClient.d.ts +0 -21
- package/dist/src/api/EntitlementsApi.d.ts +0 -10
- package/dist/src/api/MockPaywallApi.d.ts +0 -10
- package/dist/src/api/PaywallApi.d.ts +0 -18
- package/dist/src/api/SdkConfigurationApi.d.ts +0 -10
- package/dist/src/api/SubscriptionEstimationsApi.d.ts +0 -12
- package/dist/src/api/SubscriptionsApi.d.ts +0 -22
- package/dist/src/api/UsageHistoryApi.d.ts +0 -7
- package/dist/src/api/initApolloClient.d.ts +0 -11
- package/dist/src/client.d.ts +0 -312
- package/dist/src/clients.d.ts +0 -2
- package/dist/src/configuration.d.ts +0 -28
- package/dist/src/index.d.ts +0 -6
- package/dist/src/models.d.ts +0 -670
- package/dist/src/offlineClient.d.ts +0 -46
- package/dist/src/services/cacheService.d.ts +0 -14
- package/dist/src/services/cachedEntitlement.d.ts +0 -45
- package/dist/src/services/entitlementDecisionService.d.ts +0 -10
- package/dist/src/services/entitlementsService.d.ts +0 -34
- package/dist/src/services/eventEmitter.d.ts +0 -11
- package/dist/src/services/inMemoryCacheService.d.ts +0 -22
- package/dist/src/services/initializationStateTracker.d.ts +0 -16
- package/dist/src/services/loggerService.d.ts +0 -23
- package/dist/src/services/sentryService.d.ts +0 -3
- package/dist/src/utils/ModelMapper.d.ts +0 -58
- package/dist/src/utils/calculateUsagePeriod.d.ts +0 -5
- package/dist/src/utils/dateUtils.d.ts +0 -1
- package/dist/src/utils/fetch.d.ts +0 -3
- package/dist/src/utils/isMetered.d.ts +0 -7
- package/dist/src/utils/mapGetEntitlementsFallback.d.ts +0 -35
- package/dist/src/utils/withErrorHandling.d.ts +0 -23
package/dist/models.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from '@stigg/api-client-js/src/generated/sdk';
|
|
|
3
3
|
interface Metadata {
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type EntitlementFeature = {
|
|
7
7
|
id: string;
|
|
8
8
|
featureType: FeatureType;
|
|
9
9
|
displayName: string;
|
|
@@ -14,7 +14,7 @@ export declare type EntitlementFeature = {
|
|
|
14
14
|
isMetered?: boolean;
|
|
15
15
|
metadata?: Record<string, string>;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type BaseEntitlement = {
|
|
18
18
|
hasAccess: boolean;
|
|
19
19
|
isFallback: boolean;
|
|
20
20
|
accessDeniedReason?: AccessDeniedReason;
|
|
@@ -31,7 +31,7 @@ export interface NumericEntitlement extends BaseEntitlement {
|
|
|
31
31
|
isUnlimited: boolean;
|
|
32
32
|
}
|
|
33
33
|
/** @deprecated - fields were moved into {@link MeteredEntitlement} */
|
|
34
|
-
export
|
|
34
|
+
export type ResetSettings = {
|
|
35
35
|
/** @deprecated - renamed to {@link MeteredEntitlement.usagePeriodEnd} */
|
|
36
36
|
nextResetDate: Date;
|
|
37
37
|
/** @deprecated - renamed to {@link MeteredEntitlement.resetPeriod} */
|
|
@@ -52,8 +52,8 @@ export interface MeteredEntitlement extends BaseEntitlement {
|
|
|
52
52
|
/** @deprecated fields were moved into {@link MeteredEntitlement} */
|
|
53
53
|
resetSettings?: ResetSettings;
|
|
54
54
|
}
|
|
55
|
-
export
|
|
56
|
-
export
|
|
55
|
+
export type Entitlement = BooleanEntitlement | NumericEntitlement | MeteredEntitlement;
|
|
56
|
+
export type EntitlementsState = {
|
|
57
57
|
entitlements: Entitlement[];
|
|
58
58
|
accessDeniedReason: EntitlementsStateAccessDeniedReason | null;
|
|
59
59
|
};
|
|
@@ -79,20 +79,20 @@ export interface CreditEntitlement {
|
|
|
79
79
|
}
|
|
80
80
|
/** @internal */
|
|
81
81
|
export declare const CREDIT_DEFAULT_FALLBACK_ENTITLEMENT: CreditEntitlement;
|
|
82
|
-
export
|
|
82
|
+
export type GetCreditEntitlement = {
|
|
83
83
|
currencyId: string;
|
|
84
84
|
resourceId?: string;
|
|
85
85
|
options?: CreditEntitlementOptions;
|
|
86
86
|
};
|
|
87
|
-
export
|
|
87
|
+
export type CreditEntitlementOptions = {
|
|
88
88
|
fallback?: CreditEntitlementFallback;
|
|
89
89
|
};
|
|
90
|
-
export
|
|
90
|
+
export type CreditEntitlementFallback = {
|
|
91
91
|
hasAccess?: boolean;
|
|
92
92
|
usageLimit?: number;
|
|
93
93
|
currentUsage?: number;
|
|
94
94
|
};
|
|
95
|
-
export
|
|
95
|
+
export type PackageEntitlement = {
|
|
96
96
|
usageLimit: number;
|
|
97
97
|
feature?: EntitlementFeature;
|
|
98
98
|
isCustom?: boolean;
|
|
@@ -103,7 +103,7 @@ export declare type PackageEntitlement = {
|
|
|
103
103
|
enumValues?: string[] | null;
|
|
104
104
|
isGranted: PackageEntitlementFragment['isGranted'];
|
|
105
105
|
};
|
|
106
|
-
export
|
|
106
|
+
export type PromotionalEntitlement = {
|
|
107
107
|
usageLimit: number;
|
|
108
108
|
feature: EntitlementFeature;
|
|
109
109
|
hasUnlimitedUsage?: boolean | null;
|
|
@@ -112,7 +112,7 @@ export declare type PromotionalEntitlement = {
|
|
|
112
112
|
hasExpirationDate: boolean;
|
|
113
113
|
isVisible: boolean;
|
|
114
114
|
};
|
|
115
|
-
export
|
|
115
|
+
export type Price = {
|
|
116
116
|
pricingModel: BillingModel;
|
|
117
117
|
billingPeriod: BillingPeriod;
|
|
118
118
|
billingId?: string | null;
|
|
@@ -136,14 +136,14 @@ export declare type Price = {
|
|
|
136
136
|
} | null;
|
|
137
137
|
blockSize?: number | null;
|
|
138
138
|
};
|
|
139
|
-
export
|
|
139
|
+
export type SubscriptionPrice = Price & {
|
|
140
140
|
grossAmount: number;
|
|
141
141
|
};
|
|
142
|
-
export
|
|
142
|
+
export type BasePlan = {
|
|
143
143
|
displayName: string;
|
|
144
144
|
id: string;
|
|
145
145
|
};
|
|
146
|
-
export
|
|
146
|
+
export type Plan = {
|
|
147
147
|
id: string;
|
|
148
148
|
displayName: string;
|
|
149
149
|
description?: string | null;
|
|
@@ -164,7 +164,7 @@ export declare type Plan = {
|
|
|
164
164
|
product: Product;
|
|
165
165
|
metadata?: Metadata | null;
|
|
166
166
|
};
|
|
167
|
-
export
|
|
167
|
+
export type Coupon = {
|
|
168
168
|
id: string;
|
|
169
169
|
name: string;
|
|
170
170
|
description?: string | null;
|
|
@@ -173,48 +173,48 @@ export declare type Coupon = {
|
|
|
173
173
|
amountsOff?: Money[] | null;
|
|
174
174
|
metadata?: Metadata | null;
|
|
175
175
|
};
|
|
176
|
-
export
|
|
176
|
+
export type Product = {
|
|
177
177
|
id: string;
|
|
178
178
|
displayName?: string | null;
|
|
179
179
|
description?: string | null;
|
|
180
180
|
metadata?: Metadata | null;
|
|
181
181
|
};
|
|
182
|
-
export
|
|
182
|
+
export type DefaultTrialConfig = {
|
|
183
183
|
duration: number;
|
|
184
184
|
units: TrialPeriodUnits;
|
|
185
185
|
budget?: {
|
|
186
186
|
limit: BudgetConfigurationInput['limit'];
|
|
187
187
|
};
|
|
188
188
|
};
|
|
189
|
-
export
|
|
189
|
+
export type GetBooleanEntitlement = {
|
|
190
190
|
featureId: string;
|
|
191
191
|
options?: BooleanEntitlementOptions;
|
|
192
192
|
resourceId?: string;
|
|
193
193
|
};
|
|
194
|
-
export
|
|
194
|
+
export type GetNumericEntitlement = {
|
|
195
195
|
featureId: string;
|
|
196
196
|
options?: NumericEntitlementOptions;
|
|
197
197
|
resourceId?: string;
|
|
198
198
|
};
|
|
199
|
-
export
|
|
199
|
+
export type GetMeteredEntitlement = {
|
|
200
200
|
featureId: string;
|
|
201
201
|
options?: MeteredEntitlementOptions;
|
|
202
202
|
resourceId?: string;
|
|
203
203
|
};
|
|
204
|
-
export
|
|
204
|
+
export type GetEnumEntitlement = {
|
|
205
205
|
featureId: string;
|
|
206
206
|
resourceId?: string;
|
|
207
207
|
options?: EnumEntitlementOptions;
|
|
208
208
|
};
|
|
209
|
-
export
|
|
209
|
+
export type PaginatedResult<T> = {
|
|
210
210
|
data: T[];
|
|
211
211
|
pageInfo: PageInfoFragment;
|
|
212
212
|
totalCount?: number;
|
|
213
213
|
};
|
|
214
|
-
export
|
|
215
|
-
export
|
|
216
|
-
export
|
|
217
|
-
export
|
|
214
|
+
export type GetSubscriptionsResult = PaginatedResult<SubscriptionQueryFragment>;
|
|
215
|
+
export type GetCreditGrantsResult = PaginatedResult<CreditGrantFragment>;
|
|
216
|
+
export type GetCreditLedgerResult = PaginatedResult<CreditLedgerFragment>;
|
|
217
|
+
export type GetSubscriptionsParams = {
|
|
218
218
|
customerId?: string;
|
|
219
219
|
resourceId?: string | string[];
|
|
220
220
|
status?: SubscriptionStatus | SubscriptionStatus[];
|
|
@@ -225,33 +225,33 @@ export declare type GetSubscriptionsParams = {
|
|
|
225
225
|
endingBefore?: string;
|
|
226
226
|
};
|
|
227
227
|
};
|
|
228
|
-
export
|
|
228
|
+
export type GetPaywall = {
|
|
229
229
|
productId?: string;
|
|
230
230
|
resourceId?: string;
|
|
231
231
|
context?: WidgetType;
|
|
232
232
|
billingCountryCode?: string;
|
|
233
233
|
includeHiddenPlans?: boolean;
|
|
234
234
|
};
|
|
235
|
-
export
|
|
235
|
+
export type GetSubscription = {
|
|
236
236
|
subscriptionId: string;
|
|
237
237
|
};
|
|
238
|
-
export
|
|
238
|
+
export type GetActiveSubscriptions = {
|
|
239
239
|
resourceId?: string | string[];
|
|
240
240
|
};
|
|
241
|
-
export
|
|
241
|
+
export type GetCustomerPortal = {
|
|
242
242
|
resourceId?: string;
|
|
243
243
|
productId?: string;
|
|
244
244
|
};
|
|
245
|
-
export
|
|
245
|
+
export type GetCheckoutState = {
|
|
246
246
|
planId: string;
|
|
247
247
|
billingCountryCode?: string;
|
|
248
248
|
resourceId?: string | null;
|
|
249
249
|
};
|
|
250
|
-
export
|
|
250
|
+
export type CheckoutAddon = {
|
|
251
251
|
addonId: string;
|
|
252
252
|
quantity?: number;
|
|
253
253
|
};
|
|
254
|
-
export
|
|
254
|
+
export type ApplySubscription = {
|
|
255
255
|
planId: string;
|
|
256
256
|
paymentMethodId?: string;
|
|
257
257
|
payingCustomerId?: string;
|
|
@@ -269,11 +269,11 @@ export declare type ApplySubscription = {
|
|
|
269
269
|
billingCountryCode?: string;
|
|
270
270
|
scheduleStrategy?: ScheduleStrategy;
|
|
271
271
|
};
|
|
272
|
-
export
|
|
272
|
+
export type TaxId = {
|
|
273
273
|
type: string;
|
|
274
274
|
value: string;
|
|
275
275
|
};
|
|
276
|
-
export
|
|
276
|
+
export type SubscriptionBillingInfo = {
|
|
277
277
|
taxRateIds?: string[];
|
|
278
278
|
taxIds?: TaxId[];
|
|
279
279
|
taxPercentage?: number;
|
|
@@ -281,67 +281,67 @@ export declare type SubscriptionBillingInfo = {
|
|
|
281
281
|
integrationId?: string;
|
|
282
282
|
prorationBehavior?: SubscriptionProrationBehavior;
|
|
283
283
|
};
|
|
284
|
-
export
|
|
284
|
+
export type ApplySubscriptionResults = {
|
|
285
285
|
subscription?: Subscription;
|
|
286
286
|
};
|
|
287
|
-
export
|
|
287
|
+
export type EntitlementsFallback = {
|
|
288
288
|
[featureId: string]: BooleanEntitlementFallback | NumericEntitlementFallback | MeteredEntitlementFallback | EnumEntitlementFallback;
|
|
289
289
|
};
|
|
290
|
-
export
|
|
290
|
+
export type BooleanEntitlementFallback = {
|
|
291
291
|
hasAccess: boolean;
|
|
292
292
|
};
|
|
293
|
-
export
|
|
293
|
+
export type BooleanEntitlementOptions = {
|
|
294
294
|
/** @deprecated not in use anymore */
|
|
295
295
|
shouldTrack?: boolean;
|
|
296
296
|
fallback?: BooleanEntitlementFallback;
|
|
297
297
|
};
|
|
298
|
-
export
|
|
298
|
+
export type NumericEntitlementFallback = {
|
|
299
299
|
hasAccess: boolean;
|
|
300
300
|
value?: number;
|
|
301
301
|
isUnlimited?: boolean;
|
|
302
302
|
};
|
|
303
|
-
export
|
|
303
|
+
export type NumericEntitlementOptions = {
|
|
304
304
|
/** @deprecated not in use anymore */
|
|
305
305
|
shouldTrack?: boolean;
|
|
306
306
|
fallback?: NumericEntitlementFallback;
|
|
307
307
|
};
|
|
308
|
-
export
|
|
308
|
+
export type MeteredEntitlementFallback = {
|
|
309
309
|
hasAccess: boolean;
|
|
310
310
|
usageLimit?: number;
|
|
311
311
|
isUnlimited?: boolean;
|
|
312
312
|
};
|
|
313
|
-
export
|
|
313
|
+
export type EnumEntitlementFallback = {
|
|
314
314
|
hasAccess: boolean;
|
|
315
315
|
enumValues?: string[];
|
|
316
316
|
};
|
|
317
|
-
export
|
|
317
|
+
export type EnumEntitlementOptions = {
|
|
318
318
|
requestedValues?: string[];
|
|
319
319
|
/** @deprecated not in use anymore */
|
|
320
320
|
shouldTrack?: boolean;
|
|
321
321
|
fallback?: EnumEntitlementFallback;
|
|
322
322
|
};
|
|
323
|
-
export
|
|
323
|
+
export type MeteredEntitlementOptions = {
|
|
324
324
|
requestedUsage?: number;
|
|
325
325
|
/** @deprecated not in use anymore */
|
|
326
326
|
shouldTrack?: boolean;
|
|
327
327
|
fallback?: MeteredEntitlementFallback;
|
|
328
328
|
};
|
|
329
|
-
export
|
|
329
|
+
export type CompatiblePackageGroupOptions = {
|
|
330
330
|
minItems?: number;
|
|
331
331
|
freeItems?: number;
|
|
332
332
|
};
|
|
333
|
-
export
|
|
333
|
+
export type CompatiblePackageGroup = {
|
|
334
334
|
packageGroupId: string;
|
|
335
335
|
displayName: string;
|
|
336
336
|
addons: Addon[];
|
|
337
337
|
options?: CompatiblePackageGroupOptions;
|
|
338
338
|
};
|
|
339
|
-
export
|
|
339
|
+
export type DependencyAddon = {
|
|
340
340
|
refId: string;
|
|
341
341
|
displayName: string;
|
|
342
342
|
description?: string;
|
|
343
343
|
};
|
|
344
|
-
export
|
|
344
|
+
export type Addon = {
|
|
345
345
|
id: string;
|
|
346
346
|
displayName: string;
|
|
347
347
|
description: string;
|
|
@@ -356,17 +356,17 @@ export declare type Addon = {
|
|
|
356
356
|
hiddenFromWidgets?: PackageEntitlementFragment['hiddenFromWidgets'];
|
|
357
357
|
maxQuantity?: number;
|
|
358
358
|
};
|
|
359
|
-
export
|
|
359
|
+
export type SubscriptionAddon = {
|
|
360
360
|
quantity: number;
|
|
361
361
|
addon: Addon;
|
|
362
362
|
};
|
|
363
|
-
export
|
|
363
|
+
export type ExperimentInfo = {
|
|
364
364
|
id: string;
|
|
365
365
|
name: string;
|
|
366
366
|
groupName: string;
|
|
367
367
|
groupType?: ExperimentGroupType | null;
|
|
368
368
|
};
|
|
369
|
-
export
|
|
369
|
+
export type Subscription = {
|
|
370
370
|
id: string;
|
|
371
371
|
status: SubscriptionStatus;
|
|
372
372
|
resourceId?: string;
|
|
@@ -399,13 +399,13 @@ export declare type Subscription = {
|
|
|
399
399
|
paymentCollection: PaymentCollection;
|
|
400
400
|
paymentCollectionMethod?: PaymentCollectionMethod;
|
|
401
401
|
};
|
|
402
|
-
export
|
|
403
|
-
export
|
|
404
|
-
export
|
|
405
|
-
export
|
|
406
|
-
export
|
|
407
|
-
export
|
|
408
|
-
export
|
|
402
|
+
export type CustomerPortalBillingInformation = Omit<CustomerPortalBillingInformationFragment, '__typename'>;
|
|
403
|
+
export type CustomerPortalSubscriptionAddon = Omit<CustomerPortalSubscriptionAddonFragment, '__typename'>;
|
|
404
|
+
export type CustomerPortalSubscription = Omit<CustomerPortalSubscriptionFragment, '__typename'>;
|
|
405
|
+
export type CustomerPortalEntitlement = Omit<CustomerPortalEntitlementFragment, '__typename'>;
|
|
406
|
+
export type CustomerPortalPromotionalEntitlement = Omit<CustomerPortalPromotionalEntitlementFragment, '__typename'>;
|
|
407
|
+
export type CustomerPortalConfiguration = Omit<CustomerPortalConfigurationFragment, '__typename'>;
|
|
408
|
+
export type CustomerPortal = {
|
|
409
409
|
subscriptions: CustomerPortalSubscription[];
|
|
410
410
|
entitlements: CustomerPortalEntitlement[];
|
|
411
411
|
promotionalEntitlements: CustomerPortalPromotionalEntitlement[];
|
|
@@ -417,8 +417,8 @@ export declare type CustomerPortal = {
|
|
|
417
417
|
/** @deprecated This field has been moved to SDK configuration */
|
|
418
418
|
showWatermark?: boolean;
|
|
419
419
|
};
|
|
420
|
-
export
|
|
421
|
-
export
|
|
420
|
+
export type CheckoutStatePlan = Plan & Pick<PlanFragment, 'prices'>;
|
|
421
|
+
export type CheckoutBillingIntegration = {
|
|
422
422
|
billingIdentifier: BillingVendorIdentifier;
|
|
423
423
|
billingCredentials: StripeCheckoutCredentialsFragment | ZuoraCheckoutCredentialsFragment;
|
|
424
424
|
credentials: {
|
|
@@ -426,10 +426,10 @@ export declare type CheckoutBillingIntegration = {
|
|
|
426
426
|
publicKey?: string | null;
|
|
427
427
|
};
|
|
428
428
|
};
|
|
429
|
-
export
|
|
430
|
-
export
|
|
431
|
-
export
|
|
432
|
-
export
|
|
429
|
+
export type CreatePaymentSessionInput = Omit<PaymentSessionInput, 'customerId'>;
|
|
430
|
+
export type TypographyConfiguration = Omit<TypographyConfigurationFragment, '__typename'>;
|
|
431
|
+
export type CheckoutConfiguration = Omit<CheckoutConfigurationFragment, '__typename'>;
|
|
432
|
+
export type GetCheckoutStateResults = {
|
|
433
433
|
configuration?: CheckoutConfiguration | null;
|
|
434
434
|
setupSecret: string;
|
|
435
435
|
plan: CheckoutStatePlan;
|
|
@@ -438,10 +438,10 @@ export declare type GetCheckoutStateResults = {
|
|
|
438
438
|
activeSubscription?: Subscription | null;
|
|
439
439
|
billingIntegration: CheckoutBillingIntegration;
|
|
440
440
|
};
|
|
441
|
-
export
|
|
442
|
-
export
|
|
443
|
-
export
|
|
444
|
-
export
|
|
441
|
+
export type PaywallConfiguration = Omit<PaywallConfigurationFragment, '__typename'>;
|
|
442
|
+
export type PaywallCurrency = Omit<PaywallCurrencyFragment, '__typename'>;
|
|
443
|
+
export type PaywallCalculatedPricePoint = Omit<PaywallCalculatedPricePointsFragment, '__typename'>;
|
|
444
|
+
export type Paywall = {
|
|
445
445
|
plans: Plan[];
|
|
446
446
|
configuration?: PaywallConfiguration | null;
|
|
447
447
|
customer: Customer | null;
|
|
@@ -450,10 +450,10 @@ export declare type Paywall = {
|
|
|
450
450
|
currency: PaywallCurrency;
|
|
451
451
|
paywallCalculatedPricePoints?: PaywallCalculatedPricePoint[] | null;
|
|
452
452
|
};
|
|
453
|
-
export
|
|
453
|
+
export type CustomerResource = {
|
|
454
454
|
id: string;
|
|
455
455
|
};
|
|
456
|
-
export
|
|
456
|
+
export type Customer = {
|
|
457
457
|
id: string;
|
|
458
458
|
name?: string;
|
|
459
459
|
email?: string;
|
|
@@ -474,7 +474,7 @@ export declare type Customer = {
|
|
|
474
474
|
/** @deprecated use {@link StiggClient.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.InTrial} */
|
|
475
475
|
getActiveTrials(): Subscription[];
|
|
476
476
|
};
|
|
477
|
-
export
|
|
477
|
+
export type SlimCustomer = {
|
|
478
478
|
id: string;
|
|
479
479
|
name?: string;
|
|
480
480
|
email?: string;
|
|
@@ -484,44 +484,44 @@ export declare type SlimCustomer = {
|
|
|
484
484
|
metadata?: Metadata | null;
|
|
485
485
|
awsMarketplaceCustomerId?: string | null;
|
|
486
486
|
};
|
|
487
|
-
export
|
|
488
|
-
export
|
|
487
|
+
export type CustomerState = Omit<Customer, 'getActiveSubscriptions' | 'getActivePromotionalEntitlements' | 'getActiveTrials'>;
|
|
488
|
+
export type TrialedPlan = {
|
|
489
489
|
productId?: string | null;
|
|
490
490
|
planId?: string | null;
|
|
491
491
|
};
|
|
492
|
-
export
|
|
492
|
+
export type EligibleForTrial = {
|
|
493
493
|
productId?: string | null;
|
|
494
494
|
eligible: boolean;
|
|
495
495
|
};
|
|
496
|
-
export
|
|
496
|
+
export type WaitForCheckoutCompleted = {
|
|
497
497
|
timeoutMs?: number;
|
|
498
498
|
refreshOnComplete?: boolean;
|
|
499
499
|
};
|
|
500
|
-
export
|
|
500
|
+
export type PaymentMethodDetails = {
|
|
501
501
|
expirationMonth?: number | null;
|
|
502
502
|
expirationYear?: number | null;
|
|
503
503
|
last4Digits?: string | null;
|
|
504
504
|
};
|
|
505
|
-
export
|
|
505
|
+
export type SubscriptionEstimationAddon = {
|
|
506
506
|
addonId: string;
|
|
507
507
|
quantity?: number;
|
|
508
508
|
};
|
|
509
|
-
export
|
|
509
|
+
export type DateRange = {
|
|
510
510
|
start?: Date;
|
|
511
511
|
end?: Date;
|
|
512
512
|
};
|
|
513
|
-
export
|
|
513
|
+
export type Money = {
|
|
514
514
|
amount: number;
|
|
515
515
|
currency: string;
|
|
516
516
|
};
|
|
517
|
-
export
|
|
517
|
+
export type SubscriptionPreviewProration = {
|
|
518
518
|
prorationDate: Date;
|
|
519
519
|
credit: Money;
|
|
520
520
|
debit: Money;
|
|
521
521
|
netAmount: Money;
|
|
522
522
|
hasProrations?: boolean;
|
|
523
523
|
};
|
|
524
|
-
export
|
|
524
|
+
export type SubscriptionPricePreview = {
|
|
525
525
|
subTotal: Money;
|
|
526
526
|
totalExcludingTax: Money;
|
|
527
527
|
total: Money;
|
|
@@ -530,7 +530,7 @@ export declare type SubscriptionPricePreview = {
|
|
|
530
530
|
taxDetails?: SubscriptionPreviewTaxDetails;
|
|
531
531
|
discount?: SubscriptionPreviewDiscount;
|
|
532
532
|
};
|
|
533
|
-
export
|
|
533
|
+
export type SubscriptionPreviewInvoice = {
|
|
534
534
|
total: Money;
|
|
535
535
|
subTotal: Money;
|
|
536
536
|
totalExcludingTax: Money;
|
|
@@ -539,23 +539,23 @@ export declare type SubscriptionPreviewInvoice = {
|
|
|
539
539
|
taxDetails?: SubscriptionPreviewTaxDetails;
|
|
540
540
|
discountDetails?: SubscriptionPreviewDiscount;
|
|
541
541
|
};
|
|
542
|
-
export
|
|
542
|
+
export type ImmediateSubscriptionPreviewInvoice = SubscriptionPreviewInvoice & {
|
|
543
543
|
proration?: SubscriptionPreviewProration;
|
|
544
544
|
credits?: SubscriptionPreviewCredits;
|
|
545
545
|
};
|
|
546
|
-
export
|
|
546
|
+
export type SubscriptionPreviewDiscount = {
|
|
547
547
|
name?: string | null;
|
|
548
548
|
type: DiscountType;
|
|
549
549
|
value: number;
|
|
550
550
|
durationType: DiscountDurationType;
|
|
551
551
|
durationInMonths?: number;
|
|
552
552
|
};
|
|
553
|
-
export
|
|
553
|
+
export type SubscriptionPreviewTaxDetails = {
|
|
554
554
|
displayName: string;
|
|
555
555
|
percentage: number;
|
|
556
556
|
inclusive: boolean;
|
|
557
557
|
};
|
|
558
|
-
export
|
|
558
|
+
export type SubscriptionPreviewCredits = {
|
|
559
559
|
initial: Money;
|
|
560
560
|
used: Money;
|
|
561
561
|
remaining: Money;
|
|
@@ -590,7 +590,7 @@ export interface SubscriptionPreviewV2 {
|
|
|
590
590
|
isPlanDowngrade?: boolean;
|
|
591
591
|
hasScheduledUpdates?: boolean;
|
|
592
592
|
}
|
|
593
|
-
export
|
|
593
|
+
export type EstimateSubscription = {
|
|
594
594
|
customerId: string;
|
|
595
595
|
payingCustomerId?: string;
|
|
596
596
|
resourceId?: string;
|
|
@@ -605,17 +605,17 @@ export declare type EstimateSubscription = {
|
|
|
605
605
|
promotionCode?: string;
|
|
606
606
|
skipTrial?: boolean;
|
|
607
607
|
};
|
|
608
|
-
export
|
|
608
|
+
export type EstimateSubscriptionUpdate = {
|
|
609
609
|
subscriptionId: string;
|
|
610
610
|
unitQuantity?: number;
|
|
611
611
|
billableFeatures?: BillableFeature[];
|
|
612
612
|
addons?: SubscriptionEstimationAddon[];
|
|
613
613
|
promotionCode?: string;
|
|
614
614
|
};
|
|
615
|
-
export
|
|
615
|
+
export type PreviewNextInvoice = {
|
|
616
616
|
subscriptionId: string;
|
|
617
617
|
};
|
|
618
|
-
export
|
|
618
|
+
export type PreviewSubscription = {
|
|
619
619
|
customerId: string;
|
|
620
620
|
payingCustomerId?: string;
|
|
621
621
|
planId: string;
|
|
@@ -630,29 +630,29 @@ export declare type PreviewSubscription = {
|
|
|
630
630
|
promotionCode?: string;
|
|
631
631
|
scheduleStrategy?: ScheduleStrategy;
|
|
632
632
|
};
|
|
633
|
-
export
|
|
633
|
+
export type FetchUsageHistory = {
|
|
634
634
|
customerId: string;
|
|
635
635
|
resourceId?: string;
|
|
636
636
|
featureId: string;
|
|
637
637
|
startDate: Date;
|
|
638
638
|
endDate?: Date;
|
|
639
639
|
};
|
|
640
|
-
export
|
|
640
|
+
export type UsageHistoryPoint = {
|
|
641
641
|
date: Date;
|
|
642
642
|
value: number;
|
|
643
643
|
isResetPoint: boolean;
|
|
644
644
|
};
|
|
645
|
-
export
|
|
645
|
+
export type BillableFeature = {
|
|
646
646
|
featureId: string;
|
|
647
647
|
quantity: number;
|
|
648
648
|
};
|
|
649
|
-
export
|
|
650
|
-
export
|
|
651
|
-
export
|
|
652
|
-
export
|
|
653
|
-
export
|
|
654
|
-
export
|
|
655
|
-
export
|
|
649
|
+
export type GetCreditUsageInput = Omit<CreditUsageInput, 'customerId' | 'resourceId'>;
|
|
650
|
+
export type GetCreditBalanceInput = Omit<CreditBalanceSummaryInput, 'customerId' | 'resourceId'>;
|
|
651
|
+
export type GetCreditGrantsInput = Omit<GetCreditGrantsInputGenerated, 'customerId' | 'resourceId'>;
|
|
652
|
+
export type GetCreditLedgerInput = Omit<CreditLedgerInput, 'customerId' | 'resourceId'>;
|
|
653
|
+
export type AutomaticRechargeConfiguration = AutoRechargeSettingsFragment;
|
|
654
|
+
export type GetAutomaticRechargeConfigurationInput = GetAutoRechargeSettingsInput;
|
|
655
|
+
export type SaveAutomaticRechargeConfigurationInput = SaveAutoRechargeSettingsInput;
|
|
656
656
|
/** @hidden */
|
|
657
657
|
export declare class CustomerModel implements Customer {
|
|
658
658
|
id: string;
|
|
@@ -5,7 +5,7 @@ export interface Events {
|
|
|
5
5
|
initializeFailed: (err: any) => void;
|
|
6
6
|
entitlementsUpdated: (data: Map<string, CachedEntitlement>) => void;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type EventNames = keyof Events;
|
|
9
9
|
export declare class TypedEventEmitter extends TypedEmitter<Events> {
|
|
10
10
|
constructor();
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const mapDate: (date?: string | number | null
|
|
1
|
+
export declare const mapDate: (date?: string | number | null) => Date | undefined;
|
package/dist/utils/fetch.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="fetch-retry" />
|
|
2
1
|
import 'cross-fetch/polyfill';
|
|
3
2
|
export declare const plainFetch: typeof fetch;
|
|
4
|
-
export declare const fetchWithRetry: (input:
|
|
3
|
+
export declare const fetchWithRetry: (input: Parameters<typeof fetch>[0], init?: import("fetch-retry").RequestInitWithRetry) => Promise<Response>;
|
|
@@ -8,8 +8,8 @@ export declare function mapGetEntitlementsFallback(entitlementsFallback?: Entitl
|
|
|
8
8
|
};
|
|
9
9
|
} | {
|
|
10
10
|
hasAccess: boolean;
|
|
11
|
-
value?: number
|
|
12
|
-
isUnlimited?: boolean
|
|
11
|
+
value?: number;
|
|
12
|
+
isUnlimited?: boolean;
|
|
13
13
|
isFallback: boolean;
|
|
14
14
|
accessDeniedReason: AccessDeniedReason;
|
|
15
15
|
feature: {
|
|
@@ -17,8 +17,8 @@ export declare function mapGetEntitlementsFallback(entitlementsFallback?: Entitl
|
|
|
17
17
|
};
|
|
18
18
|
} | {
|
|
19
19
|
hasAccess: boolean;
|
|
20
|
-
usageLimit?: number
|
|
21
|
-
isUnlimited?: boolean
|
|
20
|
+
usageLimit?: number;
|
|
21
|
+
isUnlimited?: boolean;
|
|
22
22
|
isFallback: boolean;
|
|
23
23
|
accessDeniedReason: AccessDeniedReason;
|
|
24
24
|
feature: {
|
|
@@ -26,7 +26,7 @@ export declare function mapGetEntitlementsFallback(entitlementsFallback?: Entitl
|
|
|
26
26
|
};
|
|
27
27
|
} | {
|
|
28
28
|
hasAccess: boolean;
|
|
29
|
-
enumValues?: string[]
|
|
29
|
+
enumValues?: string[];
|
|
30
30
|
isFallback: boolean;
|
|
31
31
|
accessDeniedReason: AccessDeniedReason;
|
|
32
32
|
feature: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClientConfiguration } from '../configuration';
|
|
2
2
|
import { LoggerService } from '../services/loggerService';
|
|
3
|
-
|
|
3
|
+
type WithErrorHandlingProps = {
|
|
4
4
|
loggerService: LoggerService;
|
|
5
5
|
sdkConfiguration?: Required<ClientConfiguration>;
|
|
6
6
|
errorMessage?: (err: any) => string;
|
|
@@ -13,7 +13,7 @@ export declare function withErrorHandlingAsync<T>(func: () => Promise<T>, params
|
|
|
13
13
|
export declare function withErrorHandlingAsync<T>(func: () => Promise<T>, params: WithErrorHandlingProps & {
|
|
14
14
|
rethrowError: false;
|
|
15
15
|
}): Promise<T | undefined>;
|
|
16
|
-
|
|
16
|
+
type NotPromise<T> = T extends Promise<unknown> ? never : T;
|
|
17
17
|
export declare function withErrorHandling<T>(func: () => NotPromise<T>, params: WithErrorHandlingProps & {
|
|
18
18
|
rethrowError: true;
|
|
19
19
|
}): T;
|