@stigg/node-server-sdk 4.4.0 → 4.7.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/apollo/TimeoutLink.d.ts +0 -1
- package/dist/api/apollo/WebSocketLink.d.ts +0 -1
- package/dist/api/apollo/WebSocketLink.js +2 -2
- package/dist/api/apollo/initApolloClient.js +5 -3
- package/dist/api/apollo/types.d.ts +1 -1
- package/dist/api/entitlements/entitlementsApi.d.ts +7 -8
- package/dist/api/managementApi.d.ts +45 -45
- package/dist/client.js +2 -5
- package/dist/configuration.d.ts +3 -3
- package/dist/index.js +6 -2
- package/dist/models.d.ts +103 -103
- package/dist/models.js +6 -2
- package/dist/services/EdgeApiClient.d.ts +1 -1
- package/dist/services/EdgeApiClient.js +6 -2
- package/dist/services/cache/RedisSingleExecutionService/RedisSingleExecution.js +1 -1
- package/dist/services/cache/RedisSingleExecutionService/RedisSingleExecution.utils.d.ts +4 -4
- package/dist/services/cache/cacheService.d.ts +2 -2
- package/dist/services/cache/inMemoryCacheService.d.ts +1 -1
- package/dist/services/cache/redis/distributedLocks.js +6 -2
- package/dist/services/entitlementsService.d.ts +2 -1
- package/dist/services/entitlementsService.js +5 -4
- package/dist/services/entitlementsService.utils.d.ts +10 -10
- package/dist/services/eventEmitter.d.ts +2 -2
- package/dist/services/inMemoryEntitlementsService.js +11 -5
- package/dist/services/loggerService.d.ts +1 -1
- package/dist/services/redisEntitlementsService.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/apiErrorHandling.d.ts +1 -1
- package/dist/utils/dateUtils.d.ts +1 -1
- package/dist/utils/decorators/ReuseOngoingExecution.d.ts +1 -1
- package/dist/utils/featureTypes.d.ts +1 -1
- package/package.json +5 -5
package/dist/models.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from '@stigg/api-client-js/src/generated/sdk';
|
|
|
3
3
|
export 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
|
units?: string;
|
|
@@ -11,7 +11,7 @@ export declare type EntitlementFeature = {
|
|
|
11
11
|
meterType?: MeterType.Fluctuating | MeterType.Incremental | MeterType.None;
|
|
12
12
|
isMetered?: boolean;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type FullEntitlementFeature = {
|
|
15
15
|
id: string;
|
|
16
16
|
featureType: FeatureType;
|
|
17
17
|
displayName: string;
|
|
@@ -22,7 +22,7 @@ export declare type FullEntitlementFeature = {
|
|
|
22
22
|
isMetered?: boolean;
|
|
23
23
|
metadata?: Record<string, string>;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type BaseEntitlement = {
|
|
26
26
|
hasAccess: boolean;
|
|
27
27
|
isFallback: boolean;
|
|
28
28
|
accessDeniedReason?: AccessDeniedReason;
|
|
@@ -58,7 +58,7 @@ export interface MeteredEntitlement extends BaseEntitlement {
|
|
|
58
58
|
/** @deprecated renamed to {@link usagePeriodEnd} */
|
|
59
59
|
nextResetDate?: Date;
|
|
60
60
|
}
|
|
61
|
-
export
|
|
61
|
+
export type Entitlement = BooleanEntitlement | NumericEntitlement | MeteredEntitlement | EnumEntitlement;
|
|
62
62
|
/** @internal */
|
|
63
63
|
export declare const BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT: BooleanEntitlement;
|
|
64
64
|
/** @internal */
|
|
@@ -67,12 +67,12 @@ export declare const NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT: NumericEntitlement;
|
|
|
67
67
|
export declare const METERED_DEFAULT_FALLBACK_ENTITLEMENT: MeteredEntitlement;
|
|
68
68
|
/** @internal */
|
|
69
69
|
export declare const ENUM_DEFAULT_FALLBACK_ENTITLEMENT: EnumEntitlement;
|
|
70
|
-
export
|
|
70
|
+
export type DependencyAddon = {
|
|
71
71
|
refId: string;
|
|
72
72
|
displayName: string;
|
|
73
73
|
description?: string;
|
|
74
74
|
};
|
|
75
|
-
export
|
|
75
|
+
export type Addon = {
|
|
76
76
|
id: string;
|
|
77
77
|
displayName: string;
|
|
78
78
|
billingId?: string | null;
|
|
@@ -84,11 +84,11 @@ export declare type Addon = {
|
|
|
84
84
|
maxQuantity?: number;
|
|
85
85
|
dependencies?: DependencyAddon[];
|
|
86
86
|
};
|
|
87
|
-
export
|
|
87
|
+
export type FullSubscriptionAddon = {
|
|
88
88
|
quantity: number;
|
|
89
89
|
addon: Addon;
|
|
90
90
|
};
|
|
91
|
-
export
|
|
91
|
+
export type FullSubscription = {
|
|
92
92
|
id: string;
|
|
93
93
|
resource: CustomerResource | null;
|
|
94
94
|
payingCustomer: SlimCustomer | null;
|
|
@@ -121,7 +121,7 @@ export declare type FullSubscription = {
|
|
|
121
121
|
/** Future updates can be of 2 types {@link SubscriptionScheduleStatus.Scheduled} or {@link SubscriptionScheduleStatus.PendingPayment} */
|
|
122
122
|
futureUpdates: SubscriptionFutureUpdateDataFragment[];
|
|
123
123
|
};
|
|
124
|
-
export
|
|
124
|
+
export type Subscription = {
|
|
125
125
|
id: string;
|
|
126
126
|
resource: CustomerResource | null;
|
|
127
127
|
status: SubscriptionStatus;
|
|
@@ -143,11 +143,11 @@ export declare type Subscription = {
|
|
|
143
143
|
paymentCollection: PaymentCollection;
|
|
144
144
|
billingSyncError?: string;
|
|
145
145
|
};
|
|
146
|
-
export
|
|
146
|
+
export type SubscriptionAddon = {
|
|
147
147
|
addonId: string;
|
|
148
148
|
quantity?: number;
|
|
149
149
|
};
|
|
150
|
-
export
|
|
150
|
+
export type UpdateSubscription = {
|
|
151
151
|
subscriptionId: string;
|
|
152
152
|
unitQuantity?: number;
|
|
153
153
|
billableFeatures?: BillableFeature[];
|
|
@@ -162,10 +162,10 @@ export declare type UpdateSubscription = {
|
|
|
162
162
|
appliedCoupon?: SubscriptionCouponInput;
|
|
163
163
|
priceOverrides?: PriceOverrideInput[];
|
|
164
164
|
};
|
|
165
|
-
export
|
|
165
|
+
export type CreateSubscription = CreateSubscriptionParams & {
|
|
166
166
|
customerId: string;
|
|
167
167
|
};
|
|
168
|
-
export
|
|
168
|
+
export type CreateSubscriptionParams = {
|
|
169
169
|
resourceId?: string;
|
|
170
170
|
planId: string;
|
|
171
171
|
addons?: SubscriptionAddon[];
|
|
@@ -183,22 +183,22 @@ export declare type CreateSubscriptionParams = {
|
|
|
183
183
|
trialOverrideConfiguration?: TrialOverrideConfigurationInput;
|
|
184
184
|
priceOverrides?: PriceOverrideInput[];
|
|
185
185
|
};
|
|
186
|
-
export
|
|
186
|
+
export type Money = {
|
|
187
187
|
amount: number;
|
|
188
188
|
currency: string;
|
|
189
189
|
};
|
|
190
|
-
export
|
|
190
|
+
export type DateRange = {
|
|
191
191
|
start?: Date;
|
|
192
192
|
end?: Date;
|
|
193
193
|
};
|
|
194
|
-
export
|
|
194
|
+
export type SubscriptionPreviewProration = {
|
|
195
195
|
prorationDate: Date;
|
|
196
196
|
credit: Money;
|
|
197
197
|
debit: Money;
|
|
198
198
|
netAmount: Money;
|
|
199
199
|
hasProrations?: boolean;
|
|
200
200
|
};
|
|
201
|
-
export
|
|
201
|
+
export type SubscriptionPreviewInvoice = {
|
|
202
202
|
total: Money;
|
|
203
203
|
subTotal: Money;
|
|
204
204
|
totalExcludingTax: Money;
|
|
@@ -207,28 +207,28 @@ export declare type SubscriptionPreviewInvoice = {
|
|
|
207
207
|
taxDetails?: SubscriptionPreviewTaxDetails;
|
|
208
208
|
discountDetails?: SubscriptionPreviewDiscount;
|
|
209
209
|
};
|
|
210
|
-
export
|
|
210
|
+
export type ImmediateSubscriptionPreviewInvoice = SubscriptionPreviewInvoice & {
|
|
211
211
|
proration?: SubscriptionPreviewProration;
|
|
212
212
|
credits?: SubscriptionPreviewCredits;
|
|
213
213
|
};
|
|
214
|
-
export
|
|
214
|
+
export type SubscriptionPreviewCredits = {
|
|
215
215
|
initial: Money;
|
|
216
216
|
used: Money;
|
|
217
217
|
remaining: Money;
|
|
218
218
|
};
|
|
219
|
-
export
|
|
219
|
+
export type SubscriptionPricePreview = {
|
|
220
220
|
subTotal: Money;
|
|
221
221
|
totalExcludingTax: Money;
|
|
222
222
|
total: Money;
|
|
223
223
|
tax: Money;
|
|
224
224
|
};
|
|
225
|
-
export
|
|
225
|
+
export type SubscriptionPreviewDiscount = {
|
|
226
226
|
type: DiscountType;
|
|
227
227
|
value: number;
|
|
228
228
|
durationType: DiscountDurationType;
|
|
229
229
|
durationInMonths?: number;
|
|
230
230
|
};
|
|
231
|
-
export
|
|
231
|
+
export type SubscriptionPreviewTaxDetails = {
|
|
232
232
|
displayName: string;
|
|
233
233
|
percentage: number;
|
|
234
234
|
inclusive: boolean;
|
|
@@ -259,7 +259,7 @@ export interface SubscriptionPreviewV2 {
|
|
|
259
259
|
isPlanDowngrade?: boolean;
|
|
260
260
|
hasScheduledUpdates?: boolean;
|
|
261
261
|
}
|
|
262
|
-
export
|
|
262
|
+
export type EstimateSubscription = {
|
|
263
263
|
customerId: string;
|
|
264
264
|
payingCustomerId?: string;
|
|
265
265
|
resourceId?: string;
|
|
@@ -275,7 +275,7 @@ export declare type EstimateSubscription = {
|
|
|
275
275
|
appliedCoupon?: SubscriptionCouponInput;
|
|
276
276
|
skipTrial?: boolean;
|
|
277
277
|
};
|
|
278
|
-
export
|
|
278
|
+
export type EstimateSubscriptionUpdate = {
|
|
279
279
|
subscriptionId: string;
|
|
280
280
|
unitQuantity?: number;
|
|
281
281
|
billableFeatures?: BillableFeature[];
|
|
@@ -283,7 +283,7 @@ export declare type EstimateSubscriptionUpdate = {
|
|
|
283
283
|
promotionCode?: string;
|
|
284
284
|
appliedCoupon?: SubscriptionCouponInput;
|
|
285
285
|
};
|
|
286
|
-
export
|
|
286
|
+
export type PreviewSubscription = {
|
|
287
287
|
customerId: string;
|
|
288
288
|
payingCustomerId?: string;
|
|
289
289
|
planId: string;
|
|
@@ -299,31 +299,31 @@ export declare type PreviewSubscription = {
|
|
|
299
299
|
appliedCoupon?: SubscriptionCouponInput;
|
|
300
300
|
scheduleStrategy?: ScheduleStrategy;
|
|
301
301
|
};
|
|
302
|
-
export
|
|
302
|
+
export type PreviewNextInvoice = {
|
|
303
303
|
subscriptionId: string;
|
|
304
304
|
};
|
|
305
|
-
export
|
|
305
|
+
export type CancelSubscriptionScheduledUpdates = {
|
|
306
306
|
subscriptionId: string;
|
|
307
307
|
status?: SubscriptionScheduleStatus.Scheduled | SubscriptionScheduleStatus.PendingPayment;
|
|
308
308
|
};
|
|
309
|
-
export
|
|
309
|
+
export type MigrateSubscriptionToLatest = {
|
|
310
310
|
subscriptionId: string;
|
|
311
311
|
subscriptionMigrationTime?: SubscriptionMigrationTime;
|
|
312
312
|
};
|
|
313
|
-
export
|
|
313
|
+
export type ProvisionedCustomer = {
|
|
314
314
|
customer: Customer;
|
|
315
315
|
subscriptionDecisionStrategy: SubscriptionDecisionStrategy;
|
|
316
316
|
subscription?: Subscription;
|
|
317
317
|
};
|
|
318
|
-
export
|
|
318
|
+
export type ProvisionCustomer = CreateCustomer & {
|
|
319
319
|
subscriptionParams: CreateSubscriptionParams | null;
|
|
320
320
|
};
|
|
321
|
-
export
|
|
321
|
+
export type ProvisionSubscriptionResult = {
|
|
322
322
|
provisionStatus: ProvisionSubscriptionStatus;
|
|
323
323
|
subscription?: Subscription;
|
|
324
324
|
checkoutUrl?: string | null;
|
|
325
325
|
};
|
|
326
|
-
export
|
|
326
|
+
export type CheckoutOptions = {
|
|
327
327
|
successUrl: string;
|
|
328
328
|
cancelUrl: string;
|
|
329
329
|
allowPromoCodes?: boolean;
|
|
@@ -332,7 +332,7 @@ export declare type CheckoutOptions = {
|
|
|
332
332
|
referenceId?: string;
|
|
333
333
|
collectPhoneNumber?: boolean;
|
|
334
334
|
};
|
|
335
|
-
export
|
|
335
|
+
export type ApplySubscription = {
|
|
336
336
|
customerId: string;
|
|
337
337
|
planId: string;
|
|
338
338
|
paymentMethodId?: string;
|
|
@@ -355,20 +355,20 @@ export declare type ApplySubscription = {
|
|
|
355
355
|
paymentCollectionMethod?: PaymentCollectionMethod;
|
|
356
356
|
priceOverrides?: PriceOverrideInput[];
|
|
357
357
|
};
|
|
358
|
-
export
|
|
358
|
+
export type ApplySubscriptionResults = {
|
|
359
359
|
subscription?: Subscription;
|
|
360
360
|
};
|
|
361
|
-
export
|
|
361
|
+
export type ImportSubscriptionBulk = {
|
|
362
362
|
subscriptions: ImportSubscription[];
|
|
363
363
|
};
|
|
364
|
-
export
|
|
364
|
+
export type ImportSubscription = Omit<ImportSubscriptionInput, 'additionalMetaData'> & {
|
|
365
365
|
metadata?: Metadata;
|
|
366
366
|
};
|
|
367
|
-
export
|
|
367
|
+
export type BillableFeature = {
|
|
368
368
|
featureId: string;
|
|
369
369
|
quantity: number;
|
|
370
370
|
};
|
|
371
|
-
export
|
|
371
|
+
export type SubscriptionEntitlement = {
|
|
372
372
|
featureId: string;
|
|
373
373
|
hasUnlimitedUsage?: boolean;
|
|
374
374
|
hasSoftLimit?: boolean;
|
|
@@ -381,7 +381,7 @@ export declare type SubscriptionEntitlement = {
|
|
|
381
381
|
accordingTo: WeeklyAccordingTo;
|
|
382
382
|
};
|
|
383
383
|
};
|
|
384
|
-
export
|
|
384
|
+
export type ProvisionSubscription = {
|
|
385
385
|
customerId: string;
|
|
386
386
|
payingCustomerId?: string;
|
|
387
387
|
resourceId?: string;
|
|
@@ -408,7 +408,7 @@ export declare type ProvisionSubscription = {
|
|
|
408
408
|
paymentCollectionMethod?: PaymentCollectionMethod;
|
|
409
409
|
priceOverrides?: PriceOverrideInput[];
|
|
410
410
|
};
|
|
411
|
-
export
|
|
411
|
+
export type SubscriptionBillingInfo = {
|
|
412
412
|
taxRateIds?: string[];
|
|
413
413
|
taxPercentage?: number;
|
|
414
414
|
billingAddress?: BillingAddress;
|
|
@@ -420,7 +420,7 @@ export declare type SubscriptionBillingInfo = {
|
|
|
420
420
|
integrationId?: string;
|
|
421
421
|
prorationBehavior?: SubscriptionProrationBehavior;
|
|
422
422
|
};
|
|
423
|
-
export
|
|
423
|
+
export type CancelSubscription = {
|
|
424
424
|
subscriptionId: string;
|
|
425
425
|
endDate?: Date;
|
|
426
426
|
subscriptionCancellationTime?: SubscriptionCancellationTime;
|
|
@@ -428,38 +428,38 @@ export declare type CancelSubscription = {
|
|
|
428
428
|
prorate?: boolean;
|
|
429
429
|
awaitSubscriptionCancellation?: boolean;
|
|
430
430
|
};
|
|
431
|
-
export
|
|
431
|
+
export type GetBooleanEntitlement = {
|
|
432
432
|
customerId: string;
|
|
433
433
|
featureId: string;
|
|
434
434
|
resourceId?: string;
|
|
435
435
|
options?: BooleanEntitlementOptions;
|
|
436
436
|
};
|
|
437
|
-
export
|
|
437
|
+
export type GetNumericEntitlement = {
|
|
438
438
|
customerId: string;
|
|
439
439
|
featureId: string;
|
|
440
440
|
resourceId?: string;
|
|
441
441
|
options?: NumericEntitlementOptions;
|
|
442
442
|
};
|
|
443
|
-
export
|
|
443
|
+
export type GetMeteredEntitlement = {
|
|
444
444
|
customerId: string;
|
|
445
445
|
featureId: string;
|
|
446
446
|
resourceId?: string;
|
|
447
447
|
options?: MeteredEntitlementOptions;
|
|
448
448
|
};
|
|
449
|
-
export
|
|
449
|
+
export type GetEnumEntitlement = {
|
|
450
450
|
customerId: string;
|
|
451
451
|
featureId: string;
|
|
452
452
|
resourceId?: string;
|
|
453
453
|
options?: EnumEntitlementOptions;
|
|
454
454
|
};
|
|
455
|
-
export
|
|
455
|
+
export type GetEntitlement = {
|
|
456
456
|
customerId: string;
|
|
457
457
|
featureId: string;
|
|
458
458
|
resourceId?: string;
|
|
459
459
|
options?: EntitlementOptions;
|
|
460
460
|
};
|
|
461
|
-
export
|
|
462
|
-
export
|
|
461
|
+
export type EntitlementOptions = BooleanEntitlementOptions | NumericEntitlementOptions | MeteredEntitlementOptions | EnumEntitlementOptions;
|
|
462
|
+
export type ReportUsage = {
|
|
463
463
|
customerId: string;
|
|
464
464
|
resourceId?: string;
|
|
465
465
|
featureId: string;
|
|
@@ -468,11 +468,11 @@ export declare type ReportUsage = {
|
|
|
468
468
|
createdAt?: Date;
|
|
469
469
|
dimensions?: Record<string, EventDimensionValue>;
|
|
470
470
|
};
|
|
471
|
-
export
|
|
471
|
+
export type ReportUsageBulk = {
|
|
472
472
|
usages: ReportUsage[];
|
|
473
473
|
};
|
|
474
|
-
export
|
|
475
|
-
export
|
|
474
|
+
export type EventDimensionValue = string | number | boolean;
|
|
475
|
+
export type ReportEvent = {
|
|
476
476
|
eventName: string;
|
|
477
477
|
customerId: string;
|
|
478
478
|
idempotencyKey: string;
|
|
@@ -480,7 +480,7 @@ export declare type ReportEvent = {
|
|
|
480
480
|
dimensions?: Record<string, EventDimensionValue>;
|
|
481
481
|
timestamp?: Date;
|
|
482
482
|
};
|
|
483
|
-
export
|
|
483
|
+
export type ReportUsageAck = {
|
|
484
484
|
measurementId: string;
|
|
485
485
|
featureId: string;
|
|
486
486
|
customerId: string;
|
|
@@ -491,10 +491,10 @@ export declare type ReportUsageAck = {
|
|
|
491
491
|
/** @deprecated renamed to {@link usagePeriodEnd} */
|
|
492
492
|
nextResetDate?: Date;
|
|
493
493
|
};
|
|
494
|
-
export
|
|
494
|
+
export type ImportCustomerBulk = {
|
|
495
495
|
customers: ImportCustomer[];
|
|
496
496
|
};
|
|
497
|
-
export
|
|
497
|
+
export type ImportCustomer = {
|
|
498
498
|
billingId?: string;
|
|
499
499
|
customerId?: string;
|
|
500
500
|
name?: string;
|
|
@@ -503,7 +503,7 @@ export declare type ImportCustomer = {
|
|
|
503
503
|
metadata?: Metadata | null;
|
|
504
504
|
updatedAt?: Date;
|
|
505
505
|
};
|
|
506
|
-
export
|
|
506
|
+
export type CreateCustomer = {
|
|
507
507
|
customerId?: string;
|
|
508
508
|
name?: string;
|
|
509
509
|
email?: string;
|
|
@@ -517,22 +517,22 @@ export declare type CreateCustomer = {
|
|
|
517
517
|
excludeFromExperiment?: boolean;
|
|
518
518
|
awsMarketplaceCustomerId?: string;
|
|
519
519
|
};
|
|
520
|
-
export
|
|
520
|
+
export type GetSubscription = {
|
|
521
521
|
subscriptionId: string;
|
|
522
522
|
};
|
|
523
|
-
export
|
|
523
|
+
export type GetActiveSubscriptions = {
|
|
524
524
|
customerId: string;
|
|
525
525
|
resourceId?: string | string[];
|
|
526
526
|
};
|
|
527
|
-
export
|
|
527
|
+
export type PaginatedResult<T> = {
|
|
528
528
|
data: T[];
|
|
529
529
|
pageInfo: PageInfoFragment;
|
|
530
530
|
totalCount?: number;
|
|
531
531
|
};
|
|
532
|
-
export
|
|
533
|
-
export
|
|
534
|
-
export
|
|
535
|
-
export
|
|
532
|
+
export type GetSubscriptionsResult = PaginatedResult<SubscriptionQueryFragment>;
|
|
533
|
+
export type GetCreditGrantsResult = PaginatedResult<CreditGrantFragment>;
|
|
534
|
+
export type GetCreditLedgerResult = PaginatedResult<CreditLedgerFragment>;
|
|
535
|
+
export type GetSubscriptionsParams = {
|
|
536
536
|
customerId?: string;
|
|
537
537
|
resourceId?: string | string[];
|
|
538
538
|
status?: SubscriptionStatus | SubscriptionStatus[];
|
|
@@ -543,7 +543,7 @@ export declare type GetSubscriptionsParams = {
|
|
|
543
543
|
endingBefore?: string;
|
|
544
544
|
};
|
|
545
545
|
};
|
|
546
|
-
export
|
|
546
|
+
export type UpdateCustomer = {
|
|
547
547
|
customerId: string;
|
|
548
548
|
name?: string;
|
|
549
549
|
email?: string;
|
|
@@ -556,7 +556,7 @@ export declare type UpdateCustomer = {
|
|
|
556
556
|
integrationId?: string;
|
|
557
557
|
awsMarketplaceCustomerId?: string;
|
|
558
558
|
};
|
|
559
|
-
export
|
|
559
|
+
export type BillingInfo = {
|
|
560
560
|
billingAddress?: Address;
|
|
561
561
|
shippingAddress?: Address;
|
|
562
562
|
currency?: Currency;
|
|
@@ -572,7 +572,7 @@ export declare type BillingInfo = {
|
|
|
572
572
|
/**
|
|
573
573
|
* @param country - optional country of the address - in a valid ISO 3166-1 alpha-2 format
|
|
574
574
|
*/
|
|
575
|
-
export
|
|
575
|
+
export type Address = {
|
|
576
576
|
country?: string;
|
|
577
577
|
state?: string;
|
|
578
578
|
addressLine1?: string;
|
|
@@ -581,52 +581,52 @@ export declare type Address = {
|
|
|
581
581
|
postalCode?: string;
|
|
582
582
|
phoneNumber?: string;
|
|
583
583
|
};
|
|
584
|
-
export
|
|
584
|
+
export type TaxExempt = {
|
|
585
585
|
type: string;
|
|
586
586
|
value: string;
|
|
587
587
|
};
|
|
588
|
-
export
|
|
588
|
+
export type EntitlementsFallback = {
|
|
589
589
|
[featureId: string]: BooleanEntitlementFallback | NumericEntitlementFallback | MeteredEntitlementFallback | EnumEntitlementFallback;
|
|
590
590
|
};
|
|
591
|
-
export
|
|
591
|
+
export type BooleanEntitlementFallback = {
|
|
592
592
|
hasAccess: boolean;
|
|
593
593
|
};
|
|
594
|
-
export
|
|
594
|
+
export type BooleanEntitlementOptions = {
|
|
595
595
|
/** @deprecated not in use anymore */
|
|
596
596
|
shouldTrack?: boolean;
|
|
597
597
|
fallback?: BooleanEntitlementFallback;
|
|
598
598
|
};
|
|
599
|
-
export
|
|
599
|
+
export type NumericEntitlementFallback = {
|
|
600
600
|
hasAccess: boolean;
|
|
601
601
|
value?: number;
|
|
602
602
|
isUnlimited?: boolean;
|
|
603
603
|
};
|
|
604
|
-
export
|
|
604
|
+
export type NumericEntitlementOptions = {
|
|
605
605
|
/** @deprecated not in use anymore */
|
|
606
606
|
shouldTrack?: boolean;
|
|
607
607
|
fallback?: NumericEntitlementFallback;
|
|
608
608
|
};
|
|
609
|
-
export
|
|
609
|
+
export type MeteredEntitlementFallback = {
|
|
610
610
|
hasAccess: boolean;
|
|
611
611
|
usageLimit?: number;
|
|
612
612
|
isUnlimited?: boolean;
|
|
613
613
|
};
|
|
614
|
-
export
|
|
614
|
+
export type MeteredEntitlementOptions = {
|
|
615
615
|
requestedUsage?: number;
|
|
616
616
|
/** @deprecated not in use anymore */
|
|
617
617
|
shouldTrack?: boolean;
|
|
618
618
|
fallback?: MeteredEntitlementFallback;
|
|
619
619
|
};
|
|
620
|
-
export
|
|
620
|
+
export type EnumEntitlementFallback = {
|
|
621
621
|
hasAccess: boolean;
|
|
622
622
|
enumValues?: string[];
|
|
623
623
|
};
|
|
624
|
-
export
|
|
624
|
+
export type EnumEntitlementOptions = {
|
|
625
625
|
requestedValues?: string[];
|
|
626
626
|
shouldTrack?: boolean;
|
|
627
627
|
fallback?: EnumEntitlementFallback;
|
|
628
628
|
};
|
|
629
|
-
export
|
|
629
|
+
export type CreateUsageMeasurement = {
|
|
630
630
|
customerId: string;
|
|
631
631
|
resourceId?: string;
|
|
632
632
|
featureId: string;
|
|
@@ -635,7 +635,7 @@ export declare type CreateUsageMeasurement = {
|
|
|
635
635
|
createdAt?: Date;
|
|
636
636
|
dimensions?: Record<string, EventDimensionValue>;
|
|
637
637
|
};
|
|
638
|
-
export
|
|
638
|
+
export type FullPromotionalEntitlement = {
|
|
639
639
|
usageLimit: number;
|
|
640
640
|
feature: EntitlementFeature;
|
|
641
641
|
hasUnlimitedUsage?: boolean | null;
|
|
@@ -645,15 +645,15 @@ export declare type FullPromotionalEntitlement = {
|
|
|
645
645
|
hasExpirationDate: boolean;
|
|
646
646
|
isVisible: boolean;
|
|
647
647
|
};
|
|
648
|
-
export
|
|
648
|
+
export type PaymentMethodDetails = {
|
|
649
649
|
expirationMonth?: number | null;
|
|
650
650
|
expirationYear?: number | null;
|
|
651
651
|
last4Digits?: string | null;
|
|
652
652
|
};
|
|
653
|
-
export
|
|
653
|
+
export type CustomerResource = {
|
|
654
654
|
id: string;
|
|
655
655
|
};
|
|
656
|
-
export
|
|
656
|
+
export type SlimCustomer = {
|
|
657
657
|
id: string;
|
|
658
658
|
name?: string;
|
|
659
659
|
email?: string;
|
|
@@ -663,8 +663,8 @@ export declare type SlimCustomer = {
|
|
|
663
663
|
metadata?: Metadata | null;
|
|
664
664
|
awsMarketplaceCustomerId?: string | null;
|
|
665
665
|
};
|
|
666
|
-
export
|
|
667
|
-
export
|
|
666
|
+
export type Customer = SlimCustomer;
|
|
667
|
+
export type FullCustomer = SlimCustomer & {
|
|
668
668
|
hasPaymentMethod: boolean;
|
|
669
669
|
paymentMethodDetails?: PaymentMethodDetails;
|
|
670
670
|
subscriptions: FullSubscription[];
|
|
@@ -678,11 +678,11 @@ export declare type FullCustomer = SlimCustomer & {
|
|
|
678
678
|
/** @deprecated use {@link StiggManagementAPI.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.InTrial} */
|
|
679
679
|
getActiveTrials(): FullSubscription[];
|
|
680
680
|
};
|
|
681
|
-
export
|
|
682
|
-
export
|
|
681
|
+
export type CustomerState = Omit<FullCustomer, 'getActiveSubscriptions' | 'getActivePromotionalEntitlements' | 'getActiveTrials'>;
|
|
682
|
+
export type CustomerStatisticsModel = {
|
|
683
683
|
statistics: CustomerStatisticsFragment['statistics'];
|
|
684
684
|
};
|
|
685
|
-
export
|
|
685
|
+
export type PackageEntitlement = {
|
|
686
686
|
usageLimit: number;
|
|
687
687
|
feature: FullEntitlementFeature;
|
|
688
688
|
hasUnlimitedUsage?: boolean | null;
|
|
@@ -692,7 +692,7 @@ export declare type PackageEntitlement = {
|
|
|
692
692
|
displayNameOverride?: PackageEntitlementFragment['displayNameOverride'];
|
|
693
693
|
isGranted: PackageEntitlementFragment['isGranted'];
|
|
694
694
|
};
|
|
695
|
-
export
|
|
695
|
+
export type PromotionalEntitlement = {
|
|
696
696
|
usageLimit: number;
|
|
697
697
|
feature: FullEntitlementFeature;
|
|
698
698
|
hasUnlimitedUsage?: boolean | null;
|
|
@@ -702,7 +702,7 @@ export declare type PromotionalEntitlement = {
|
|
|
702
702
|
hasExpirationDate: boolean;
|
|
703
703
|
isVisible: boolean;
|
|
704
704
|
};
|
|
705
|
-
export
|
|
705
|
+
export type Price = {
|
|
706
706
|
pricingModel: BillingModel;
|
|
707
707
|
billingPeriod: BillingPeriod;
|
|
708
708
|
billingCadence?: BillingCadence;
|
|
@@ -727,24 +727,24 @@ export declare type Price = {
|
|
|
727
727
|
} | null;
|
|
728
728
|
blockSize?: number | null;
|
|
729
729
|
};
|
|
730
|
-
export
|
|
730
|
+
export type SubscriptionPrice = Price & {
|
|
731
731
|
grossAmount: number;
|
|
732
732
|
};
|
|
733
|
-
export
|
|
733
|
+
export type BasePlan = {
|
|
734
734
|
displayName: string;
|
|
735
735
|
id: string;
|
|
736
736
|
};
|
|
737
|
-
export
|
|
737
|
+
export type CompatiblePackageGroupOptions = {
|
|
738
738
|
minItems?: number;
|
|
739
739
|
freeItems?: number;
|
|
740
740
|
};
|
|
741
|
-
export
|
|
741
|
+
export type CompatiblePackageGroup = {
|
|
742
742
|
packageGroupId: string;
|
|
743
743
|
displayName: string;
|
|
744
744
|
addons: Addon[];
|
|
745
745
|
options?: CompatiblePackageGroupOptions;
|
|
746
746
|
};
|
|
747
|
-
export
|
|
747
|
+
export type Plan = {
|
|
748
748
|
id: string;
|
|
749
749
|
displayName: string;
|
|
750
750
|
billingId?: string | null;
|
|
@@ -762,7 +762,7 @@ export declare type Plan = {
|
|
|
762
762
|
metadata?: Metadata | null;
|
|
763
763
|
awsMarketplacePlanDimension?: string | null;
|
|
764
764
|
};
|
|
765
|
-
export
|
|
765
|
+
export type Coupon = {
|
|
766
766
|
id: string;
|
|
767
767
|
name: string;
|
|
768
768
|
description?: string | null;
|
|
@@ -771,7 +771,7 @@ export declare type Coupon = {
|
|
|
771
771
|
amountsOff?: Money[] | null;
|
|
772
772
|
metadata?: Metadata | null;
|
|
773
773
|
};
|
|
774
|
-
export
|
|
774
|
+
export type Product = {
|
|
775
775
|
id: string;
|
|
776
776
|
displayName?: string | null;
|
|
777
777
|
description?: string | null;
|
|
@@ -779,14 +779,14 @@ export declare type Product = {
|
|
|
779
779
|
awsMarketplaceProductId?: string | null;
|
|
780
780
|
downgradePlan?: Pick<Plan, 'id' | 'displayName'>;
|
|
781
781
|
};
|
|
782
|
-
export
|
|
782
|
+
export type DefaultTrialConfig = {
|
|
783
783
|
duration: number;
|
|
784
784
|
units: TrialPeriodUnits;
|
|
785
785
|
budget?: {
|
|
786
786
|
limit: BudgetConfigurationInput['limit'];
|
|
787
787
|
};
|
|
788
788
|
};
|
|
789
|
-
export
|
|
789
|
+
export type GetPaywall = {
|
|
790
790
|
productId?: string;
|
|
791
791
|
customerId?: string;
|
|
792
792
|
resourceId?: string;
|
|
@@ -794,9 +794,9 @@ export declare type GetPaywall = {
|
|
|
794
794
|
fetchAllCountriesPrices?: boolean;
|
|
795
795
|
includeHiddenPlans?: boolean;
|
|
796
796
|
};
|
|
797
|
-
export
|
|
798
|
-
export
|
|
799
|
-
export
|
|
797
|
+
export type PaywallConfiguration = Omit<PaywallConfigurationFragment, '__typename'>;
|
|
798
|
+
export type PaywallCurrency = Omit<PaywallCurrencyFragment, '__typename'>;
|
|
799
|
+
export type Paywall = {
|
|
800
800
|
plans: Plan[];
|
|
801
801
|
configuration?: PaywallConfiguration | null;
|
|
802
802
|
customer: Customer | null;
|
|
@@ -804,24 +804,24 @@ export declare type Paywall = {
|
|
|
804
804
|
activeSubscriptions: FullSubscription[] | null;
|
|
805
805
|
currency: PaywallCurrency;
|
|
806
806
|
};
|
|
807
|
-
export
|
|
807
|
+
export type ExperimentInfo = {
|
|
808
808
|
id: string;
|
|
809
809
|
name: string;
|
|
810
810
|
groupName: string;
|
|
811
811
|
groupType?: ExperimentGroupType | null;
|
|
812
812
|
};
|
|
813
|
-
export
|
|
813
|
+
export type TrialedPlan = {
|
|
814
814
|
planId: string;
|
|
815
815
|
productId: string;
|
|
816
816
|
};
|
|
817
|
-
export
|
|
817
|
+
export type FetchUsageHistory = {
|
|
818
818
|
customerId: string;
|
|
819
819
|
resourceId?: string;
|
|
820
820
|
featureId: string;
|
|
821
821
|
startDate: Date;
|
|
822
822
|
endDate?: Date;
|
|
823
823
|
};
|
|
824
|
-
export
|
|
824
|
+
export type UsageHistoryPoint = {
|
|
825
825
|
date: Date;
|
|
826
826
|
value: number;
|
|
827
827
|
isResetPoint: boolean;
|
package/dist/models.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -63,4 +67,4 @@ class CustomerModel {
|
|
|
63
67
|
}
|
|
64
68
|
}
|
|
65
69
|
exports.CustomerModel = CustomerModel;
|
|
66
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
70
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kZWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL21vZGVscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLGdFQWdEZ0Q7QUFFaEQseUVBQXVEO0FBd0V2RCxnQkFBZ0I7QUFDSCxRQUFBLG9DQUFvQyxHQUF1QjtJQUN0RSxJQUFJLEVBQUUsU0FBUztJQUNmLFVBQVUsRUFBRSxJQUFJO0lBQ2hCLFNBQVMsRUFBRSxLQUFLO0lBQ2hCLGtCQUFrQixFQUFFLHdCQUFrQixDQUFDLE9BQU87Q0FDL0MsQ0FBQztBQUVGLGdCQUFnQjtBQUNILFFBQUEsb0NBQW9DLEdBQXVCO0lBQ3RFLElBQUksRUFBRSxTQUFTO0lBQ2YsVUFBVSxFQUFFLElBQUk7SUFDaEIsU0FBUyxFQUFFLEtBQUs7SUFDaEIsV0FBVyxFQUFFLEtBQUs7SUFDbEIsa0JBQWtCLEVBQUUsd0JBQWtCLENBQUMsT0FBTztDQUMvQyxDQUFDO0FBRUYsZ0JBQWdCO0FBQ0gsUUFBQSxvQ0FBb0MsR0FBdUI7SUFDdEUsSUFBSSxFQUFFLFNBQVM7SUFDZixVQUFVLEVBQUUsSUFBSTtJQUNoQixTQUFTLEVBQUUsS0FBSztJQUNoQixXQUFXLEVBQUUsS0FBSztJQUNsQixZQUFZLEVBQUUsS0FBSztJQUNuQixZQUFZLEVBQUUsQ0FBQztJQUNmLGNBQWMsRUFBRSxDQUFDO0lBQ2pCLGtCQUFrQixFQUFFLHdCQUFrQixDQUFDLE9BQU87Q0FDL0MsQ0FBQztBQUVGLGdCQUFnQjtBQUNILFFBQUEsaUNBQWlDLEdBQW9CO0lBQ2hFLElBQUksRUFBRSxNQUFNO0lBQ1osVUFBVSxFQUFFLElBQUk7SUFDaEIsU0FBUyxFQUFFLEtBQUs7SUFDaEIsVUFBVSxFQUFFLEVBQUU7SUFDZCxrQkFBa0IsRUFBRSx3QkFBa0IsQ0FBQyxPQUFPO0NBQy9DLENBQUM7QUFnM0JGLGNBQWM7QUFDZCxNQUFhLGFBQWE7SUFTeEIsWUFBWSxLQUFvQjtRQUM5QixNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxLQUFLLENBQUMsQ0FBQztJQUM3QixDQUFDO0lBRUQsc0JBQXNCO1FBQ3BCLE9BQU8sSUFBSSxDQUFDLGFBQWEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxNQUFNLEtBQUssd0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDbEYsQ0FBQztJQUVELGVBQWU7UUFDYixPQUFPLElBQUksQ0FBQyxhQUFhLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxLQUFLLHdCQUFrQixDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ25GLENBQUM7SUFFRCxnQ0FBZ0M7UUFDOUIsT0FBTyxJQUFJLENBQUMsdUJBQXVCLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxLQUFLLGtDQUE0QixDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQ3RHLENBQUM7Q0FDRjtBQXhCRCxzQ0F3QkMifQ==
|