@stigg/node-server-sdk 4.36.0 → 4.38.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/entitlements/entitlementsApi.d.ts +1 -1
- package/dist/api/managementApi.d.ts +1 -1
- package/dist/client.d.ts +1 -2
- package/dist/client.js +19 -23
- package/dist/clientInitialization.js +5 -4
- package/dist/configuration.d.ts +1 -1
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +33 -0
- package/dist/services/LegacyEventPayloadMapper.js +3 -3
- package/dist/services/entitlementsService.d.ts +6 -3
- package/dist/services/entitlementsService.js +26 -91
- package/dist/services/identifiers.d.ts +0 -1
- package/dist/services/identifiers.js +1 -6
- package/dist/services/inMemoryEntitlementsService.d.ts +2 -1
- package/dist/services/inMemoryEntitlementsService.js +1 -1
- package/dist/services/inMemoryLruCacheService.d.ts +6 -0
- package/dist/services/inMemoryLruCacheService.js +20 -0
- package/dist/services/redisEntitlementsService.d.ts +1 -1
- package/dist/services/redisEntitlementsService.js +1 -1
- package/package.json +5 -4
- package/dist/models.d.ts +0 -946
- package/dist/models.js +0 -80
- package/dist/services/entitlementDecisionService.d.ts +0 -20
- package/dist/services/entitlementDecisionService.js +0 -80
- package/dist/utils/ModelMapper.d.ts +0 -61
- package/dist/utils/ModelMapper.js +0 -623
- package/dist/utils/entitlementFallbackUtils.d.ts +0 -23
- package/dist/utils/entitlementFallbackUtils.js +0 -66
- package/dist/utils/entitlementTypeGuards.d.ts +0 -6
- package/dist/utils/entitlementTypeGuards.js +0 -11
- package/dist/utils/mapGetEntitlementsFallback.d.ts +0 -2
- package/dist/utils/mapGetEntitlementsFallback.js +0 -14
package/dist/models.d.ts
DELETED
|
@@ -1,946 +0,0 @@
|
|
|
1
|
-
import { PackageEntitlementFragment, PaymentCollection, PaywallConfigurationFragment, SubscriptionQueryFragment, PaywallCurrencyFragment, PageInfoFragment, SubscriptionCancellationAction, SubscriptionFutureUpdateDataFragment, SubscriptionInvoiceFragment, SubscriptionMigrationTime, SubscriptionScheduleStatus, BillingPeriod, SubscriptionCancellationTime, PromotionalEntitlementStatus, SubscriptionStatus, TrialPeriodUnits, BillingModel, PricingType, SubscriptionDecisionStrategy, ExperimentGroupType, Currency, DiscountType, DiscountDurationType, UsageUpdateBehavior, EntitlementResetPeriod, AccessDeniedReason, FeatureType, MeterType, ProvisionSubscriptionStatus, TiersMode, PriceTierFragment, TotalPriceFragment, BillingAddress, MonthlyAccordingTo, WeeklyAccordingTo, CustomerStatisticsFragment, TrialOverrideConfigurationInput, ScheduleStrategy, BillingCadence, ImportSubscriptionInput, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionCouponInput, PriceOverrideInput, SubscriptionProrationBehavior, SubscriptionBillingCycleAnchor, CreditGrantFragment, CreditLedgerFragment, ChargeInput, PackageEntitlementUnionFragment, CreditCadence } from '@stigg/api-client-js';
|
|
2
|
-
export * from '@stigg/api-client-js';
|
|
3
|
-
export interface Metadata {
|
|
4
|
-
[key: string]: string;
|
|
5
|
-
}
|
|
6
|
-
import { EntitlementFeature as CacheEntitlementFeature, UnitTransformation } from '@stigg/cache-core';
|
|
7
|
-
export { UnitTransformation };
|
|
8
|
-
export type EntitlementFeature = CacheEntitlementFeature & {
|
|
9
|
-
isMetered?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export type FullEntitlementFeature = {
|
|
12
|
-
id: string;
|
|
13
|
-
featureType: FeatureType;
|
|
14
|
-
displayName: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
units?: string;
|
|
17
|
-
unitsPlural?: string;
|
|
18
|
-
meterType?: MeterType.Fluctuating | MeterType.Incremental | MeterType.None;
|
|
19
|
-
isMetered?: boolean;
|
|
20
|
-
metadata?: Record<string, string>;
|
|
21
|
-
};
|
|
22
|
-
export type BaseEntitlement = {
|
|
23
|
-
hasAccess: boolean;
|
|
24
|
-
isFallback: boolean;
|
|
25
|
-
accessDeniedReason?: AccessDeniedReason;
|
|
26
|
-
feature?: EntitlementFeature;
|
|
27
|
-
};
|
|
28
|
-
export interface BooleanEntitlement extends BaseEntitlement {
|
|
29
|
-
type: 'BOOLEAN';
|
|
30
|
-
}
|
|
31
|
-
export interface EnumEntitlement extends BaseEntitlement {
|
|
32
|
-
type: 'ENUM';
|
|
33
|
-
enumValues: string[];
|
|
34
|
-
requestedValues?: string[];
|
|
35
|
-
}
|
|
36
|
-
export interface NumericEntitlement extends BaseEntitlement {
|
|
37
|
-
type: 'NUMERIC';
|
|
38
|
-
value?: number;
|
|
39
|
-
isUnlimited: boolean;
|
|
40
|
-
}
|
|
41
|
-
export interface MeteredEntitlement extends BaseEntitlement {
|
|
42
|
-
type: 'METERED';
|
|
43
|
-
usageLimit?: number;
|
|
44
|
-
isUnlimited: boolean;
|
|
45
|
-
hasSoftLimit: boolean;
|
|
46
|
-
currentUsage: number;
|
|
47
|
-
requestedUsage: number;
|
|
48
|
-
resetPeriod?: EntitlementResetPeriod;
|
|
49
|
-
/** The anchor for calculating the usage period for metered entitlements with a reset period configured */
|
|
50
|
-
usagePeriodAnchor?: Date;
|
|
51
|
-
/** The start date of the usage period for metered entitlements with a reset period configured */
|
|
52
|
-
usagePeriodStart?: Date;
|
|
53
|
-
/** The end date of the usage period for metered entitlements with a reset period configured */
|
|
54
|
-
usagePeriodEnd?: Date;
|
|
55
|
-
/** @deprecated renamed to {@link usagePeriodEnd} */
|
|
56
|
-
nextResetDate?: Date;
|
|
57
|
-
}
|
|
58
|
-
export interface CreditEntitlement {
|
|
59
|
-
hasAccess: boolean;
|
|
60
|
-
isFallback: boolean;
|
|
61
|
-
accessDeniedReason?: AccessDeniedReason;
|
|
62
|
-
currency: {
|
|
63
|
-
currencyId: string;
|
|
64
|
-
displayName?: string;
|
|
65
|
-
description?: string;
|
|
66
|
-
unitSingular?: string;
|
|
67
|
-
unitPlural?: string;
|
|
68
|
-
additionalMetaData?: Record<string, unknown>;
|
|
69
|
-
};
|
|
70
|
-
usageLimit: number;
|
|
71
|
-
currentUsage: number;
|
|
72
|
-
remaining: number;
|
|
73
|
-
usagePeriodEnd?: Date;
|
|
74
|
-
}
|
|
75
|
-
/** Feature-only entitlement (excludes CreditEntitlement). Use Entitlement for polymorphic APIs. */
|
|
76
|
-
export type Entitlement = BooleanEntitlement | NumericEntitlement | MeteredEntitlement | EnumEntitlement;
|
|
77
|
-
export type EntitlementV2 = Entitlement | CreditEntitlement;
|
|
78
|
-
export type CustomerEntitlementsResult = {
|
|
79
|
-
entitlements: Entitlement[];
|
|
80
|
-
accessDeniedReason: AccessDeniedReason | null;
|
|
81
|
-
};
|
|
82
|
-
export type CustomerEntitlementsResultV2 = {
|
|
83
|
-
entitlements: EntitlementV2[];
|
|
84
|
-
accessDeniedReason: AccessDeniedReason | null;
|
|
85
|
-
};
|
|
86
|
-
/** @internal */
|
|
87
|
-
export declare const BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT: BooleanEntitlement;
|
|
88
|
-
/** @internal */
|
|
89
|
-
export declare const NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT: NumericEntitlement;
|
|
90
|
-
/** @internal */
|
|
91
|
-
export declare const METERED_DEFAULT_FALLBACK_ENTITLEMENT: MeteredEntitlement;
|
|
92
|
-
/** @internal */
|
|
93
|
-
export declare const ENUM_DEFAULT_FALLBACK_ENTITLEMENT: EnumEntitlement;
|
|
94
|
-
/** @internal */
|
|
95
|
-
export declare const CREDIT_DEFAULT_FALLBACK_ENTITLEMENT: CreditEntitlement;
|
|
96
|
-
export type DependencyAddon = {
|
|
97
|
-
refId: string;
|
|
98
|
-
displayName: string;
|
|
99
|
-
description?: string;
|
|
100
|
-
};
|
|
101
|
-
export type Addon = {
|
|
102
|
-
id: string;
|
|
103
|
-
displayName: string;
|
|
104
|
-
billingId?: string | null;
|
|
105
|
-
description: string;
|
|
106
|
-
/** @deprecated Use {@link packageEntitlements} instead to retrieve both feature and credit entitlements. */
|
|
107
|
-
entitlements: PackageEntitlement[];
|
|
108
|
-
packageEntitlements: PackageEntitlementUnionFragment[];
|
|
109
|
-
pricePoints: Price[];
|
|
110
|
-
pricingType?: PricingType | null;
|
|
111
|
-
metadata?: Metadata | null;
|
|
112
|
-
maxQuantity?: number;
|
|
113
|
-
dependencies?: DependencyAddon[];
|
|
114
|
-
};
|
|
115
|
-
export type FullSubscriptionAddon = {
|
|
116
|
-
quantity: number;
|
|
117
|
-
addon: Addon;
|
|
118
|
-
};
|
|
119
|
-
export type FullSubscription = {
|
|
120
|
-
id: string;
|
|
121
|
-
resource: CustomerResource | null;
|
|
122
|
-
payingCustomer: SlimCustomer | null;
|
|
123
|
-
status: SubscriptionStatus;
|
|
124
|
-
plan: Plan;
|
|
125
|
-
/** @deprecated use {@link prices} instead with {@link totalPrice} */
|
|
126
|
-
price: SubscriptionPrice | null;
|
|
127
|
-
prices: Price[];
|
|
128
|
-
totalPrice: TotalPriceFragment | null | undefined;
|
|
129
|
-
pricingType: PricingType;
|
|
130
|
-
addons: FullSubscriptionAddon[];
|
|
131
|
-
billingId?: string;
|
|
132
|
-
billingLinkUrl?: string;
|
|
133
|
-
crmId?: string;
|
|
134
|
-
startDate: Date;
|
|
135
|
-
endDate?: Date;
|
|
136
|
-
trialEndDate?: Date;
|
|
137
|
-
/**
|
|
138
|
-
* The calculated end date after which the subscription will be canceled, which takes trial expiration and scheduled cancellations into consideration
|
|
139
|
-
*/
|
|
140
|
-
effectiveEndDate?: Date;
|
|
141
|
-
cancellationDate?: Date;
|
|
142
|
-
currentBillingPeriodEnd?: Date;
|
|
143
|
-
metadata?: Metadata | null;
|
|
144
|
-
experimentInfo?: ExperimentInfo | null;
|
|
145
|
-
latestInvoice?: SubscriptionInvoiceFragment;
|
|
146
|
-
paymentCollection: PaymentCollection;
|
|
147
|
-
paymentCollectionMethod?: PaymentCollectionMethod;
|
|
148
|
-
billingSyncError?: string;
|
|
149
|
-
/** Future updates can be of 2 types {@link SubscriptionScheduleStatus.Scheduled} or {@link SubscriptionScheduleStatus.PendingPayment} */
|
|
150
|
-
futureUpdates: SubscriptionFutureUpdateDataFragment[];
|
|
151
|
-
};
|
|
152
|
-
export type Subscription = {
|
|
153
|
-
id: string;
|
|
154
|
-
resource: CustomerResource | null;
|
|
155
|
-
status: SubscriptionStatus;
|
|
156
|
-
customerId: string;
|
|
157
|
-
planId: string;
|
|
158
|
-
addonIds: string[];
|
|
159
|
-
addons: SubscriptionAddon[];
|
|
160
|
-
metadata?: Metadata | null;
|
|
161
|
-
billingId?: string;
|
|
162
|
-
billingLinkUrl?: string;
|
|
163
|
-
pricingType: PricingType;
|
|
164
|
-
effectiveEndDate?: Date;
|
|
165
|
-
/** @deprecated use {@link prices} instead with {@link totalPrice} */
|
|
166
|
-
price: SubscriptionPrice | null;
|
|
167
|
-
prices: Price[];
|
|
168
|
-
totalPrice: TotalPriceFragment | null | undefined;
|
|
169
|
-
experimentInfo?: ExperimentInfo | null;
|
|
170
|
-
latestInvoice?: SubscriptionInvoiceFragment;
|
|
171
|
-
paymentCollection: PaymentCollection;
|
|
172
|
-
billingSyncError?: string;
|
|
173
|
-
};
|
|
174
|
-
export type SubscriptionAddon = {
|
|
175
|
-
addonId: string;
|
|
176
|
-
quantity?: number;
|
|
177
|
-
};
|
|
178
|
-
export type UpdateSubscription = {
|
|
179
|
-
subscriptionId: string;
|
|
180
|
-
unitQuantity?: number;
|
|
181
|
-
billableFeatures?: BillableFeature[];
|
|
182
|
-
charges?: ChargeInput[];
|
|
183
|
-
metadata?: Metadata | null;
|
|
184
|
-
addons?: SubscriptionAddon[];
|
|
185
|
-
billingPeriod?: BillingPeriod;
|
|
186
|
-
awaitPaymentConfirmation?: boolean;
|
|
187
|
-
billingInformation?: SubscriptionBillingInfo;
|
|
188
|
-
/** @deprecated Use {@link entitlements} instead to support both feature and credit entitlements. */
|
|
189
|
-
subscriptionEntitlements?: SubscriptionEntitlement[];
|
|
190
|
-
entitlements?: SubscriptionEntitlementV2[];
|
|
191
|
-
trialEndDate?: Date;
|
|
192
|
-
scheduleStrategy?: ScheduleStrategy;
|
|
193
|
-
appliedCoupon?: SubscriptionCouponInput;
|
|
194
|
-
priceOverrides?: PriceOverrideInput[];
|
|
195
|
-
billingCycleAnchor?: SubscriptionBillingCycleAnchor;
|
|
196
|
-
};
|
|
197
|
-
export type CreateSubscription = CreateSubscriptionParams & {
|
|
198
|
-
customerId: string;
|
|
199
|
-
};
|
|
200
|
-
export type CreateSubscriptionParams = {
|
|
201
|
-
resourceId?: string;
|
|
202
|
-
planId: string;
|
|
203
|
-
addons?: SubscriptionAddon[];
|
|
204
|
-
startDate?: Date;
|
|
205
|
-
id?: string;
|
|
206
|
-
billingPeriod?: BillingPeriod;
|
|
207
|
-
unitQuantity?: number;
|
|
208
|
-
billableFeatures?: BillableFeature[];
|
|
209
|
-
skipTrial?: boolean;
|
|
210
|
-
metadata?: Metadata | null;
|
|
211
|
-
awaitPaymentConfirmation?: boolean;
|
|
212
|
-
billingInformation?: SubscriptionBillingInfo;
|
|
213
|
-
promotionCode?: string;
|
|
214
|
-
appliedCoupon?: SubscriptionCouponInput;
|
|
215
|
-
trialOverrideConfiguration?: TrialOverrideConfigurationInput;
|
|
216
|
-
priceOverrides?: PriceOverrideInput[];
|
|
217
|
-
entitlements?: SubscriptionEntitlementV2[];
|
|
218
|
-
};
|
|
219
|
-
export type Money = {
|
|
220
|
-
amount: number;
|
|
221
|
-
currency: string;
|
|
222
|
-
};
|
|
223
|
-
export type DateRange = {
|
|
224
|
-
start?: Date;
|
|
225
|
-
end?: Date;
|
|
226
|
-
};
|
|
227
|
-
export type SubscriptionPreviewProration = {
|
|
228
|
-
prorationDate: Date;
|
|
229
|
-
credit: Money;
|
|
230
|
-
debit: Money;
|
|
231
|
-
netAmount: Money;
|
|
232
|
-
hasProrations?: boolean;
|
|
233
|
-
};
|
|
234
|
-
export type SubscriptionPreviewInvoice = {
|
|
235
|
-
total: Money;
|
|
236
|
-
subTotal: Money;
|
|
237
|
-
totalExcludingTax: Money;
|
|
238
|
-
tax?: Money;
|
|
239
|
-
discount?: Money;
|
|
240
|
-
taxDetails?: SubscriptionPreviewTaxDetails;
|
|
241
|
-
discountDetails?: SubscriptionPreviewDiscount;
|
|
242
|
-
};
|
|
243
|
-
export type ImmediateSubscriptionPreviewInvoice = SubscriptionPreviewInvoice & {
|
|
244
|
-
proration?: SubscriptionPreviewProration;
|
|
245
|
-
credits?: SubscriptionPreviewCredits;
|
|
246
|
-
};
|
|
247
|
-
export type SubscriptionPreviewCredits = {
|
|
248
|
-
initial: Money;
|
|
249
|
-
used: Money;
|
|
250
|
-
remaining: Money;
|
|
251
|
-
};
|
|
252
|
-
export type SubscriptionPricePreview = {
|
|
253
|
-
subTotal: Money;
|
|
254
|
-
totalExcludingTax: Money;
|
|
255
|
-
total: Money;
|
|
256
|
-
tax: Money;
|
|
257
|
-
};
|
|
258
|
-
export type SubscriptionPreviewDiscount = {
|
|
259
|
-
type: DiscountType;
|
|
260
|
-
value: number;
|
|
261
|
-
durationType: DiscountDurationType;
|
|
262
|
-
durationInMonths?: number;
|
|
263
|
-
};
|
|
264
|
-
export type SubscriptionPreviewTaxDetails = {
|
|
265
|
-
displayName: string;
|
|
266
|
-
percentage: number;
|
|
267
|
-
inclusive: boolean;
|
|
268
|
-
};
|
|
269
|
-
export interface SubscriptionPreview {
|
|
270
|
-
subTotal: Money;
|
|
271
|
-
totalExcludingTax: Money;
|
|
272
|
-
total: Money;
|
|
273
|
-
tax?: Money;
|
|
274
|
-
taxDetails?: SubscriptionPreviewTaxDetails;
|
|
275
|
-
discount?: SubscriptionPreviewDiscount;
|
|
276
|
-
billingPeriodRange: DateRange;
|
|
277
|
-
proration?: SubscriptionPreviewProration;
|
|
278
|
-
subscription?: SubscriptionPricePreview;
|
|
279
|
-
}
|
|
280
|
-
export interface SubscriptionPreviewV2 {
|
|
281
|
-
/**
|
|
282
|
-
* The immediate invoice prices that will be generated for the subscription
|
|
283
|
-
* for the previewed subscription \ changes
|
|
284
|
-
*/
|
|
285
|
-
immediateInvoice: ImmediateSubscriptionPreviewInvoice;
|
|
286
|
-
/**
|
|
287
|
-
* The recurring invoice prices that will be generated for the subscription
|
|
288
|
-
* for the previewed subscription \ changes, starting from the next billing period
|
|
289
|
-
*/
|
|
290
|
-
recurringInvoice?: SubscriptionPreviewInvoice;
|
|
291
|
-
billingPeriodRange: DateRange;
|
|
292
|
-
isPlanDowngrade?: boolean;
|
|
293
|
-
hasScheduledUpdates?: boolean;
|
|
294
|
-
}
|
|
295
|
-
export type EstimateSubscription = {
|
|
296
|
-
customerId: string;
|
|
297
|
-
payingCustomerId?: string;
|
|
298
|
-
resourceId?: string;
|
|
299
|
-
planId: string;
|
|
300
|
-
billingCountryCode?: string;
|
|
301
|
-
addons?: SubscriptionAddon[];
|
|
302
|
-
startDate?: Date;
|
|
303
|
-
billingPeriod?: BillingPeriod;
|
|
304
|
-
unitQuantity?: number;
|
|
305
|
-
billableFeatures?: BillableFeature[];
|
|
306
|
-
charges?: ChargeInput[];
|
|
307
|
-
billingInformation?: SubscriptionBillingInfo;
|
|
308
|
-
promotionCode?: string;
|
|
309
|
-
appliedCoupon?: SubscriptionCouponInput;
|
|
310
|
-
skipTrial?: boolean;
|
|
311
|
-
};
|
|
312
|
-
export type EstimateSubscriptionUpdate = {
|
|
313
|
-
subscriptionId: string;
|
|
314
|
-
unitQuantity?: number;
|
|
315
|
-
billableFeatures?: BillableFeature[];
|
|
316
|
-
charges?: ChargeInput[];
|
|
317
|
-
addons?: SubscriptionAddon[];
|
|
318
|
-
promotionCode?: string;
|
|
319
|
-
appliedCoupon?: SubscriptionCouponInput;
|
|
320
|
-
};
|
|
321
|
-
export type PreviewSubscription = {
|
|
322
|
-
customerId: string;
|
|
323
|
-
payingCustomerId?: string;
|
|
324
|
-
planId: string;
|
|
325
|
-
resourceId?: string;
|
|
326
|
-
addons?: SubscriptionAddon[];
|
|
327
|
-
startDate?: Date;
|
|
328
|
-
billingPeriod?: BillingPeriod;
|
|
329
|
-
billingCountryCode?: string;
|
|
330
|
-
unitQuantity?: number;
|
|
331
|
-
billableFeatures?: BillableFeature[];
|
|
332
|
-
charges?: ChargeInput[];
|
|
333
|
-
billingInformation?: SubscriptionBillingInfo;
|
|
334
|
-
promotionCode?: string;
|
|
335
|
-
appliedCoupon?: SubscriptionCouponInput;
|
|
336
|
-
scheduleStrategy?: ScheduleStrategy;
|
|
337
|
-
billingCycleAnchor?: SubscriptionBillingCycleAnchor;
|
|
338
|
-
};
|
|
339
|
-
export type PreviewNextInvoice = {
|
|
340
|
-
subscriptionId: string;
|
|
341
|
-
};
|
|
342
|
-
export type CancelSubscriptionScheduledUpdates = {
|
|
343
|
-
subscriptionId: string;
|
|
344
|
-
status?: SubscriptionScheduleStatus.Scheduled | SubscriptionScheduleStatus.PendingPayment;
|
|
345
|
-
};
|
|
346
|
-
export type MigrateSubscriptionToLatest = {
|
|
347
|
-
subscriptionId: string;
|
|
348
|
-
subscriptionMigrationTime?: SubscriptionMigrationTime;
|
|
349
|
-
};
|
|
350
|
-
export type ProvisionedCustomer = {
|
|
351
|
-
customer: Customer;
|
|
352
|
-
subscriptionDecisionStrategy: SubscriptionDecisionStrategy;
|
|
353
|
-
subscription?: Subscription;
|
|
354
|
-
};
|
|
355
|
-
export type ProvisionCustomer = CreateCustomer & {
|
|
356
|
-
subscriptionParams: CreateSubscriptionParams | null;
|
|
357
|
-
};
|
|
358
|
-
export type ProvisionSubscriptionResult = {
|
|
359
|
-
provisionStatus: ProvisionSubscriptionStatus;
|
|
360
|
-
subscription?: Subscription;
|
|
361
|
-
checkoutUrl?: string | null;
|
|
362
|
-
};
|
|
363
|
-
export type CheckoutOptions = {
|
|
364
|
-
successUrl: string;
|
|
365
|
-
cancelUrl: string;
|
|
366
|
-
allowPromoCodes?: boolean;
|
|
367
|
-
allowTaxIdCollection?: boolean;
|
|
368
|
-
collectBillingAddress?: boolean;
|
|
369
|
-
referenceId?: string;
|
|
370
|
-
collectPhoneNumber?: boolean;
|
|
371
|
-
};
|
|
372
|
-
export type ApplySubscription = {
|
|
373
|
-
customerId: string;
|
|
374
|
-
planId: string;
|
|
375
|
-
paymentMethodId?: string;
|
|
376
|
-
payingCustomerId?: string;
|
|
377
|
-
resourceId?: string;
|
|
378
|
-
addons?: SubscriptionAddon[];
|
|
379
|
-
startDate?: Date;
|
|
380
|
-
billingId?: string;
|
|
381
|
-
billingPeriod?: BillingPeriod;
|
|
382
|
-
skipTrial?: boolean;
|
|
383
|
-
unitQuantity?: number;
|
|
384
|
-
billableFeatures?: BillableFeature[];
|
|
385
|
-
metadata?: Metadata | null;
|
|
386
|
-
billingInformation?: SubscriptionBillingInfo;
|
|
387
|
-
promotionCode?: string;
|
|
388
|
-
appliedCoupon?: SubscriptionCouponInput;
|
|
389
|
-
billingCountryCode?: string;
|
|
390
|
-
trialOverrideConfiguration?: TrialOverrideConfigurationInput;
|
|
391
|
-
scheduleStrategy?: ScheduleStrategy;
|
|
392
|
-
paymentCollectionMethod?: PaymentCollectionMethod;
|
|
393
|
-
priceOverrides?: PriceOverrideInput[];
|
|
394
|
-
charges?: ChargeInput[];
|
|
395
|
-
billingCycleAnchor?: SubscriptionBillingCycleAnchor;
|
|
396
|
-
entitlements?: SubscriptionEntitlementV2[];
|
|
397
|
-
};
|
|
398
|
-
export type ApplySubscriptionResults = {
|
|
399
|
-
subscription?: Subscription;
|
|
400
|
-
};
|
|
401
|
-
export type ImportSubscriptionBulk = {
|
|
402
|
-
subscriptions: ImportSubscription[];
|
|
403
|
-
integrationId?: string;
|
|
404
|
-
};
|
|
405
|
-
export type ImportSubscription = Omit<ImportSubscriptionInput, 'additionalMetaData'> & {
|
|
406
|
-
metadata?: Metadata;
|
|
407
|
-
};
|
|
408
|
-
export type BillableFeature = {
|
|
409
|
-
featureId: string;
|
|
410
|
-
quantity: number;
|
|
411
|
-
};
|
|
412
|
-
export type SubscriptionEntitlement = {
|
|
413
|
-
featureId: string;
|
|
414
|
-
hasUnlimitedUsage?: boolean;
|
|
415
|
-
hasSoftLimit?: boolean;
|
|
416
|
-
usageLimit?: number;
|
|
417
|
-
resetPeriod?: EntitlementResetPeriod;
|
|
418
|
-
monthlyResetPeriodConfiguration?: {
|
|
419
|
-
accordingTo: MonthlyAccordingTo;
|
|
420
|
-
};
|
|
421
|
-
weeklyResetPeriodConfiguration?: {
|
|
422
|
-
accordingTo: WeeklyAccordingTo;
|
|
423
|
-
};
|
|
424
|
-
};
|
|
425
|
-
export type SubscriptionFeatureEntitlement = SubscriptionEntitlement;
|
|
426
|
-
export type SubscriptionCreditEntitlement = {
|
|
427
|
-
customCurrencyId: string;
|
|
428
|
-
amount: number;
|
|
429
|
-
cadence: CreditCadence;
|
|
430
|
-
};
|
|
431
|
-
export type SubscriptionEntitlementV2 = {
|
|
432
|
-
feature?: SubscriptionFeatureEntitlement;
|
|
433
|
-
credit?: SubscriptionCreditEntitlement;
|
|
434
|
-
};
|
|
435
|
-
export type ProvisionSubscription = {
|
|
436
|
-
customerId: string;
|
|
437
|
-
payingCustomerId?: string;
|
|
438
|
-
resourceId?: string;
|
|
439
|
-
planId: string;
|
|
440
|
-
addons?: SubscriptionAddon[];
|
|
441
|
-
startDate?: Date;
|
|
442
|
-
id?: string;
|
|
443
|
-
billingId?: string;
|
|
444
|
-
salesforceId?: string;
|
|
445
|
-
billingPeriod?: BillingPeriod;
|
|
446
|
-
skipTrial?: boolean;
|
|
447
|
-
unitQuantity?: number;
|
|
448
|
-
billableFeatures?: BillableFeature[];
|
|
449
|
-
charges?: ChargeInput[];
|
|
450
|
-
metadata?: Metadata | null;
|
|
451
|
-
awaitPaymentConfirmation?: boolean;
|
|
452
|
-
billingInformation?: SubscriptionBillingInfo;
|
|
453
|
-
checkoutOptions?: CheckoutOptions;
|
|
454
|
-
promotionCode?: string;
|
|
455
|
-
appliedCoupon?: SubscriptionCouponInput;
|
|
456
|
-
billingCountryCode?: string;
|
|
457
|
-
/** @deprecated Use {@link entitlements} instead to support both feature and credit entitlements. */
|
|
458
|
-
subscriptionEntitlements?: SubscriptionEntitlement[];
|
|
459
|
-
entitlements?: SubscriptionEntitlementV2[];
|
|
460
|
-
trialOverrideConfiguration?: TrialOverrideConfigurationInput;
|
|
461
|
-
scheduleStrategy?: ScheduleStrategy;
|
|
462
|
-
paymentCollectionMethod?: PaymentCollectionMethod;
|
|
463
|
-
priceOverrides?: PriceOverrideInput[];
|
|
464
|
-
billingCycleAnchor?: SubscriptionBillingCycleAnchor;
|
|
465
|
-
};
|
|
466
|
-
export type SubscriptionBillingInfo = {
|
|
467
|
-
taxRateIds?: string[];
|
|
468
|
-
taxPercentage?: number;
|
|
469
|
-
billingAddress?: BillingAddress;
|
|
470
|
-
metadata?: Metadata | null;
|
|
471
|
-
chargeOnBehalfOfAccount?: string;
|
|
472
|
-
couponId?: string;
|
|
473
|
-
isInvoicePaid?: boolean;
|
|
474
|
-
isBackdated?: boolean;
|
|
475
|
-
invoiceDaysUntilDue?: number;
|
|
476
|
-
integrationId?: string;
|
|
477
|
-
prorationBehavior?: SubscriptionProrationBehavior;
|
|
478
|
-
};
|
|
479
|
-
export type CancelSubscription = {
|
|
480
|
-
subscriptionId: string;
|
|
481
|
-
endDate?: Date;
|
|
482
|
-
subscriptionCancellationTime?: SubscriptionCancellationTime;
|
|
483
|
-
subscriptionCancellationAction?: SubscriptionCancellationAction;
|
|
484
|
-
prorate?: boolean;
|
|
485
|
-
awaitSubscriptionCancellation?: boolean;
|
|
486
|
-
};
|
|
487
|
-
export type GetBooleanEntitlement = {
|
|
488
|
-
customerId: string;
|
|
489
|
-
featureId: string;
|
|
490
|
-
resourceId?: string;
|
|
491
|
-
options?: BooleanEntitlementOptions;
|
|
492
|
-
};
|
|
493
|
-
export type GetNumericEntitlement = {
|
|
494
|
-
customerId: string;
|
|
495
|
-
featureId: string;
|
|
496
|
-
resourceId?: string;
|
|
497
|
-
options?: NumericEntitlementOptions;
|
|
498
|
-
};
|
|
499
|
-
export type GetMeteredEntitlement = {
|
|
500
|
-
customerId: string;
|
|
501
|
-
featureId: string;
|
|
502
|
-
resourceId?: string;
|
|
503
|
-
options?: MeteredEntitlementOptions;
|
|
504
|
-
};
|
|
505
|
-
export type GetEnumEntitlement = {
|
|
506
|
-
customerId: string;
|
|
507
|
-
featureId: string;
|
|
508
|
-
resourceId?: string;
|
|
509
|
-
options?: EnumEntitlementOptions;
|
|
510
|
-
};
|
|
511
|
-
export type GetCreditEntitlement = {
|
|
512
|
-
customerId: string;
|
|
513
|
-
currencyId: string;
|
|
514
|
-
resourceId?: string;
|
|
515
|
-
options?: CreditEntitlementOptions;
|
|
516
|
-
};
|
|
517
|
-
export type GetEntitlement = {
|
|
518
|
-
customerId: string;
|
|
519
|
-
featureId: string;
|
|
520
|
-
resourceId?: string;
|
|
521
|
-
options?: EntitlementOptions;
|
|
522
|
-
};
|
|
523
|
-
type GetEntitlementV2CommonParams = {
|
|
524
|
-
customerId: string;
|
|
525
|
-
resourceId?: string;
|
|
526
|
-
options?: EntitlementOptionsV2;
|
|
527
|
-
};
|
|
528
|
-
/** For feature entitlements. */
|
|
529
|
-
type GetEntitlementV2FeatureParams = GetEntitlementV2CommonParams & {
|
|
530
|
-
featureId: string;
|
|
531
|
-
currencyId?: never;
|
|
532
|
-
};
|
|
533
|
-
/** For credit entitlements (custom currency id). */
|
|
534
|
-
type GetEntitlementV2CreditParams = GetEntitlementV2CommonParams & {
|
|
535
|
-
currencyId: string;
|
|
536
|
-
featureId?: never;
|
|
537
|
-
};
|
|
538
|
-
/** Exactly one of featureId or currencyId must be set. */
|
|
539
|
-
export type GetEntitlementV2Params = GetEntitlementV2FeatureParams | GetEntitlementV2CreditParams;
|
|
540
|
-
export type EntitlementOptions = BooleanEntitlementOptions | NumericEntitlementOptions | MeteredEntitlementOptions | EnumEntitlementOptions;
|
|
541
|
-
export type EntitlementOptionsV2 = EntitlementOptions | CreditEntitlementOptions;
|
|
542
|
-
export type ReportUsage = {
|
|
543
|
-
customerId: string;
|
|
544
|
-
resourceId?: string;
|
|
545
|
-
featureId: string;
|
|
546
|
-
value: number;
|
|
547
|
-
updateBehavior?: UsageUpdateBehavior;
|
|
548
|
-
createdAt?: Date;
|
|
549
|
-
dimensions?: Record<string, EventDimensionValue>;
|
|
550
|
-
};
|
|
551
|
-
export type ReportUsageBulk = {
|
|
552
|
-
usages: ReportUsage[];
|
|
553
|
-
};
|
|
554
|
-
export type EventDimensionValue = string | number | boolean;
|
|
555
|
-
export type ReportEvent = {
|
|
556
|
-
eventName: string;
|
|
557
|
-
customerId: string;
|
|
558
|
-
idempotencyKey: string;
|
|
559
|
-
resourceId?: string;
|
|
560
|
-
dimensions?: Record<string, EventDimensionValue>;
|
|
561
|
-
timestamp?: Date;
|
|
562
|
-
};
|
|
563
|
-
export type ReportUsageAck = {
|
|
564
|
-
measurementId: string;
|
|
565
|
-
featureId: string;
|
|
566
|
-
customerId: string;
|
|
567
|
-
resourceId?: string;
|
|
568
|
-
currentUsage?: number;
|
|
569
|
-
usagePeriodStart?: Date;
|
|
570
|
-
usagePeriodEnd?: Date;
|
|
571
|
-
/** @deprecated renamed to {@link usagePeriodEnd} */
|
|
572
|
-
nextResetDate?: Date;
|
|
573
|
-
};
|
|
574
|
-
export type ImportCustomerBulk = {
|
|
575
|
-
customers: ImportCustomer[];
|
|
576
|
-
integrationId?: string;
|
|
577
|
-
};
|
|
578
|
-
export type ImportCustomer = {
|
|
579
|
-
billingId?: string;
|
|
580
|
-
customerId?: string;
|
|
581
|
-
name?: string;
|
|
582
|
-
email?: string;
|
|
583
|
-
paymentMethodId?: string;
|
|
584
|
-
metadata?: Metadata | null;
|
|
585
|
-
updatedAt?: Date;
|
|
586
|
-
};
|
|
587
|
-
export type CreateCustomer = {
|
|
588
|
-
customerId?: string;
|
|
589
|
-
name?: string;
|
|
590
|
-
email?: string;
|
|
591
|
-
billingId?: string;
|
|
592
|
-
salesforceId?: string;
|
|
593
|
-
billingInfo?: BillingInfo;
|
|
594
|
-
couponId?: string;
|
|
595
|
-
metadata?: Metadata | null;
|
|
596
|
-
/** @deprecated not in use anymore - will be removed in future release */
|
|
597
|
-
shouldSyncFree?: boolean;
|
|
598
|
-
excludeFromExperiment?: boolean;
|
|
599
|
-
awsMarketplaceCustomerId?: string;
|
|
600
|
-
};
|
|
601
|
-
export type GetSubscription = {
|
|
602
|
-
subscriptionId: string;
|
|
603
|
-
};
|
|
604
|
-
export type GetActiveSubscriptions = {
|
|
605
|
-
customerId: string;
|
|
606
|
-
resourceId?: string | string[];
|
|
607
|
-
};
|
|
608
|
-
export type PaginatedResult<T> = {
|
|
609
|
-
data: T[];
|
|
610
|
-
pageInfo: PageInfoFragment;
|
|
611
|
-
totalCount?: number;
|
|
612
|
-
};
|
|
613
|
-
export type GetSubscriptionsResult = PaginatedResult<SubscriptionQueryFragment>;
|
|
614
|
-
export type GetCreditGrantsResult = PaginatedResult<CreditGrantFragment>;
|
|
615
|
-
export type GetCreditLedgerResult = PaginatedResult<CreditLedgerFragment>;
|
|
616
|
-
export type GetSubscriptionsParams = {
|
|
617
|
-
customerId?: string;
|
|
618
|
-
resourceId?: string | string[];
|
|
619
|
-
status?: SubscriptionStatus | SubscriptionStatus[];
|
|
620
|
-
productId?: string | string[];
|
|
621
|
-
pagination?: {
|
|
622
|
-
limit?: number;
|
|
623
|
-
startingAfter?: string;
|
|
624
|
-
endingBefore?: string;
|
|
625
|
-
};
|
|
626
|
-
};
|
|
627
|
-
export type UpdateCustomer = {
|
|
628
|
-
customerId: string;
|
|
629
|
-
name?: string;
|
|
630
|
-
email?: string;
|
|
631
|
-
couponId?: string | null;
|
|
632
|
-
billingId?: string;
|
|
633
|
-
salesforceId?: string;
|
|
634
|
-
billingInfo?: BillingInfo;
|
|
635
|
-
metadata?: Metadata | null;
|
|
636
|
-
shouldWaitSync?: boolean;
|
|
637
|
-
integrationId?: string;
|
|
638
|
-
awsMarketplaceCustomerId?: string;
|
|
639
|
-
};
|
|
640
|
-
export type BillingInfo = {
|
|
641
|
-
billingAddress?: Address;
|
|
642
|
-
shippingAddress?: Address;
|
|
643
|
-
currency?: Currency;
|
|
644
|
-
timezone?: string;
|
|
645
|
-
language?: string;
|
|
646
|
-
taxIds?: TaxExempt[];
|
|
647
|
-
invoiceCustomFields?: Record<string, string>;
|
|
648
|
-
paymentMethodId?: string;
|
|
649
|
-
customerName?: string;
|
|
650
|
-
metadata?: Metadata | null;
|
|
651
|
-
integrationId?: string;
|
|
652
|
-
};
|
|
653
|
-
/**
|
|
654
|
-
* @param country - optional country of the address - in a valid ISO 3166-1 alpha-2 format
|
|
655
|
-
*/
|
|
656
|
-
export type Address = {
|
|
657
|
-
country?: string;
|
|
658
|
-
state?: string;
|
|
659
|
-
addressLine1?: string;
|
|
660
|
-
addressLine2?: string;
|
|
661
|
-
city?: string;
|
|
662
|
-
postalCode?: string;
|
|
663
|
-
phoneNumber?: string;
|
|
664
|
-
};
|
|
665
|
-
export type TaxExempt = {
|
|
666
|
-
type: string;
|
|
667
|
-
value: string;
|
|
668
|
-
};
|
|
669
|
-
export type EntitlementsFallback = {
|
|
670
|
-
[featureId: string]: BooleanEntitlementFallback | NumericEntitlementFallback | MeteredEntitlementFallback | EnumEntitlementFallback;
|
|
671
|
-
};
|
|
672
|
-
export type CreditEntitlementsFallback = {
|
|
673
|
-
[currencyId: string]: CreditEntitlementFallback;
|
|
674
|
-
};
|
|
675
|
-
export type BooleanEntitlementFallback = {
|
|
676
|
-
hasAccess: boolean;
|
|
677
|
-
};
|
|
678
|
-
export type BooleanEntitlementOptions = {
|
|
679
|
-
/** @deprecated not in use anymore */
|
|
680
|
-
shouldTrack?: boolean;
|
|
681
|
-
fallback?: BooleanEntitlementFallback;
|
|
682
|
-
};
|
|
683
|
-
export type NumericEntitlementFallback = {
|
|
684
|
-
hasAccess: boolean;
|
|
685
|
-
value?: number;
|
|
686
|
-
isUnlimited?: boolean;
|
|
687
|
-
};
|
|
688
|
-
export type NumericEntitlementOptions = {
|
|
689
|
-
/** @deprecated not in use anymore */
|
|
690
|
-
shouldTrack?: boolean;
|
|
691
|
-
fallback?: NumericEntitlementFallback;
|
|
692
|
-
};
|
|
693
|
-
export type MeteredEntitlementFallback = {
|
|
694
|
-
hasAccess: boolean;
|
|
695
|
-
usageLimit?: number;
|
|
696
|
-
isUnlimited?: boolean;
|
|
697
|
-
};
|
|
698
|
-
export type MeteredEntitlementOptions = {
|
|
699
|
-
requestedUsage?: number;
|
|
700
|
-
/** @deprecated not in use anymore */
|
|
701
|
-
shouldTrack?: boolean;
|
|
702
|
-
fallback?: MeteredEntitlementFallback;
|
|
703
|
-
};
|
|
704
|
-
export type EnumEntitlementFallback = {
|
|
705
|
-
hasAccess: boolean;
|
|
706
|
-
enumValues?: string[];
|
|
707
|
-
};
|
|
708
|
-
export type EnumEntitlementOptions = {
|
|
709
|
-
requestedValues?: string[];
|
|
710
|
-
shouldTrack?: boolean;
|
|
711
|
-
fallback?: EnumEntitlementFallback;
|
|
712
|
-
};
|
|
713
|
-
export type CreditEntitlementFallback = {
|
|
714
|
-
hasAccess: boolean;
|
|
715
|
-
usageLimit?: number;
|
|
716
|
-
currentUsage?: number;
|
|
717
|
-
};
|
|
718
|
-
export type CreditEntitlementOptions = {
|
|
719
|
-
fallback?: CreditEntitlementFallback;
|
|
720
|
-
};
|
|
721
|
-
export type CreateUsageMeasurement = {
|
|
722
|
-
customerId: string;
|
|
723
|
-
resourceId?: string;
|
|
724
|
-
featureId: string;
|
|
725
|
-
value: number;
|
|
726
|
-
updateBehavior?: UsageUpdateBehavior;
|
|
727
|
-
createdAt?: Date;
|
|
728
|
-
dimensions?: Record<string, EventDimensionValue>;
|
|
729
|
-
};
|
|
730
|
-
export type FullPromotionalEntitlement = {
|
|
731
|
-
usageLimit: number;
|
|
732
|
-
feature: EntitlementFeature;
|
|
733
|
-
hasUnlimitedUsage?: boolean | null;
|
|
734
|
-
hasSoftLimit?: boolean | null;
|
|
735
|
-
status: PromotionalEntitlementStatus;
|
|
736
|
-
expiresAt?: Date;
|
|
737
|
-
hasExpirationDate: boolean;
|
|
738
|
-
isVisible: boolean;
|
|
739
|
-
};
|
|
740
|
-
export type PaymentMethodDetails = {
|
|
741
|
-
expirationMonth?: number | null;
|
|
742
|
-
expirationYear?: number | null;
|
|
743
|
-
last4Digits?: string | null;
|
|
744
|
-
};
|
|
745
|
-
export type CustomerResource = {
|
|
746
|
-
id: string;
|
|
747
|
-
};
|
|
748
|
-
export type SlimCustomer = {
|
|
749
|
-
id: string;
|
|
750
|
-
name?: string;
|
|
751
|
-
email?: string;
|
|
752
|
-
createdAt: Date;
|
|
753
|
-
updatedAt: Date;
|
|
754
|
-
billingId?: string;
|
|
755
|
-
metadata?: Metadata | null;
|
|
756
|
-
awsMarketplaceCustomerId?: string | null;
|
|
757
|
-
};
|
|
758
|
-
export type Customer = SlimCustomer;
|
|
759
|
-
export type FullCustomer = SlimCustomer & {
|
|
760
|
-
hasPaymentMethod: boolean;
|
|
761
|
-
paymentMethodDetails?: PaymentMethodDetails;
|
|
762
|
-
subscriptions: FullSubscription[];
|
|
763
|
-
promotionalEntitlements: PromotionalEntitlement[];
|
|
764
|
-
coupon?: Coupon;
|
|
765
|
-
experimentInfo?: ExperimentInfo | null;
|
|
766
|
-
alreadyTrialPlans: TrialedPlan[];
|
|
767
|
-
getActivePromotionalEntitlements(): FullPromotionalEntitlement[];
|
|
768
|
-
/** @deprecated use {@link StiggManagementAPI.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.Active} */
|
|
769
|
-
getActiveSubscriptions(): FullSubscription[];
|
|
770
|
-
/** @deprecated use {@link StiggManagementAPI.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.InTrial} */
|
|
771
|
-
getActiveTrials(): FullSubscription[];
|
|
772
|
-
};
|
|
773
|
-
export type CustomerState = Omit<FullCustomer, 'getActiveSubscriptions' | 'getActivePromotionalEntitlements' | 'getActiveTrials'>;
|
|
774
|
-
export type CustomerStatisticsModel = {
|
|
775
|
-
statistics: CustomerStatisticsFragment['statistics'];
|
|
776
|
-
};
|
|
777
|
-
export type PackageEntitlement = {
|
|
778
|
-
usageLimit: number;
|
|
779
|
-
feature: FullEntitlementFeature;
|
|
780
|
-
hasUnlimitedUsage?: boolean | null;
|
|
781
|
-
hasSoftLimit?: boolean | null;
|
|
782
|
-
resetPeriod?: EntitlementResetPeriod | null;
|
|
783
|
-
hiddenFromWidgets?: PackageEntitlementFragment['hiddenFromWidgets'];
|
|
784
|
-
displayNameOverride?: PackageEntitlementFragment['displayNameOverride'];
|
|
785
|
-
isGranted: PackageEntitlementFragment['isGranted'];
|
|
786
|
-
};
|
|
787
|
-
export type PromotionalEntitlement = {
|
|
788
|
-
usageLimit: number;
|
|
789
|
-
feature: FullEntitlementFeature;
|
|
790
|
-
hasUnlimitedUsage?: boolean | null;
|
|
791
|
-
hasSoftLimit?: boolean | null;
|
|
792
|
-
status: PromotionalEntitlementStatus;
|
|
793
|
-
expiresAt?: Date;
|
|
794
|
-
hasExpirationDate: boolean;
|
|
795
|
-
isVisible: boolean;
|
|
796
|
-
};
|
|
797
|
-
export type Price = {
|
|
798
|
-
pricingModel: BillingModel;
|
|
799
|
-
billingPeriod: BillingPeriod;
|
|
800
|
-
billingCadence?: BillingCadence;
|
|
801
|
-
billingId?: string | null;
|
|
802
|
-
amount?: number | null;
|
|
803
|
-
tiers?: PriceTierFragment[] | null | undefined;
|
|
804
|
-
tiersMode: TiersMode | null | undefined;
|
|
805
|
-
currency: Currency;
|
|
806
|
-
minUnitQuantity?: number | null | undefined;
|
|
807
|
-
maxUnitQuantity?: number | null | undefined;
|
|
808
|
-
billingCountryCode?: string | null | undefined;
|
|
809
|
-
creditRate?: {
|
|
810
|
-
amount: number;
|
|
811
|
-
} | null;
|
|
812
|
-
feature?: {
|
|
813
|
-
featureId: string;
|
|
814
|
-
units?: string | null | undefined;
|
|
815
|
-
unitsPlural?: string | null | undefined;
|
|
816
|
-
unitQuantity?: number | null;
|
|
817
|
-
displayName: string;
|
|
818
|
-
description?: string | null;
|
|
819
|
-
} | null;
|
|
820
|
-
blockSize?: number | null;
|
|
821
|
-
topUpCustomCurrencyId?: string | null;
|
|
822
|
-
customCurrency?: {
|
|
823
|
-
displayName: string;
|
|
824
|
-
units?: {
|
|
825
|
-
singular?: string | null;
|
|
826
|
-
plural?: string | null;
|
|
827
|
-
} | null;
|
|
828
|
-
} | null;
|
|
829
|
-
};
|
|
830
|
-
export type SubscriptionPrice = Price & {
|
|
831
|
-
grossAmount: number;
|
|
832
|
-
};
|
|
833
|
-
export type BasePlan = {
|
|
834
|
-
displayName: string;
|
|
835
|
-
id: string;
|
|
836
|
-
};
|
|
837
|
-
export type CompatiblePackageGroupOptions = {
|
|
838
|
-
minItems?: number;
|
|
839
|
-
freeItems?: number;
|
|
840
|
-
};
|
|
841
|
-
export type CompatiblePackageGroup = {
|
|
842
|
-
packageGroupId: string;
|
|
843
|
-
displayName: string;
|
|
844
|
-
addons: Addon[];
|
|
845
|
-
options?: CompatiblePackageGroupOptions;
|
|
846
|
-
};
|
|
847
|
-
export type Plan = {
|
|
848
|
-
id: string;
|
|
849
|
-
displayName: string;
|
|
850
|
-
billingId?: string | null;
|
|
851
|
-
description?: string | null;
|
|
852
|
-
order: number;
|
|
853
|
-
basePlan?: BasePlan;
|
|
854
|
-
/** @deprecated Use {@link packageEntitlements} instead to retrieve both feature and credit entitlements. */
|
|
855
|
-
entitlements: PackageEntitlement[];
|
|
856
|
-
/** @deprecated Use {@link inheritedPackageEntitlements} instead to retrieve both feature and credit entitlements. */
|
|
857
|
-
inheritedEntitlements: PackageEntitlement[];
|
|
858
|
-
packageEntitlements: PackageEntitlementUnionFragment[];
|
|
859
|
-
inheritedPackageEntitlements: PackageEntitlementUnionFragment[];
|
|
860
|
-
pricePoints: Price[];
|
|
861
|
-
pricingType?: PricingType | null;
|
|
862
|
-
defaultTrialConfig?: DefaultTrialConfig | null;
|
|
863
|
-
compatibleAddons: Addon[];
|
|
864
|
-
compatiblePackageGroups: CompatiblePackageGroup[];
|
|
865
|
-
product: Product;
|
|
866
|
-
metadata?: Metadata | null;
|
|
867
|
-
awsMarketplacePlanDimension?: string | null;
|
|
868
|
-
};
|
|
869
|
-
export type Coupon = {
|
|
870
|
-
id: string;
|
|
871
|
-
name: string;
|
|
872
|
-
description?: string | null;
|
|
873
|
-
discountValue: number;
|
|
874
|
-
percentOff?: number | null;
|
|
875
|
-
amountsOff?: Money[] | null;
|
|
876
|
-
metadata?: Metadata | null;
|
|
877
|
-
};
|
|
878
|
-
export type Product = {
|
|
879
|
-
id: string;
|
|
880
|
-
displayName?: string | null;
|
|
881
|
-
description?: string | null;
|
|
882
|
-
metadata?: Metadata | null;
|
|
883
|
-
awsMarketplaceProductId?: string | null;
|
|
884
|
-
downgradePlan?: Pick<Plan, 'id' | 'displayName'>;
|
|
885
|
-
};
|
|
886
|
-
export type DefaultTrialConfig = {
|
|
887
|
-
duration: number;
|
|
888
|
-
units: TrialPeriodUnits;
|
|
889
|
-
budget?: {
|
|
890
|
-
limit: BudgetConfigurationInput['limit'];
|
|
891
|
-
};
|
|
892
|
-
};
|
|
893
|
-
export type GetPaywall = {
|
|
894
|
-
productId?: string;
|
|
895
|
-
customerId?: string;
|
|
896
|
-
resourceId?: string;
|
|
897
|
-
billingCountryCode?: string;
|
|
898
|
-
fetchAllCountriesPrices?: boolean;
|
|
899
|
-
includeHiddenPlans?: boolean;
|
|
900
|
-
};
|
|
901
|
-
export type PaywallConfiguration = Omit<PaywallConfigurationFragment, '__typename'>;
|
|
902
|
-
export type PaywallCurrency = Omit<PaywallCurrencyFragment, '__typename'>;
|
|
903
|
-
export type Paywall = {
|
|
904
|
-
plans: Plan[];
|
|
905
|
-
configuration?: PaywallConfiguration | null;
|
|
906
|
-
customer: Customer | null;
|
|
907
|
-
resource: CustomerResource | null;
|
|
908
|
-
activeSubscriptions: FullSubscription[] | null;
|
|
909
|
-
currency: PaywallCurrency;
|
|
910
|
-
};
|
|
911
|
-
export type ExperimentInfo = {
|
|
912
|
-
id: string;
|
|
913
|
-
name: string;
|
|
914
|
-
groupName: string;
|
|
915
|
-
groupType?: ExperimentGroupType | null;
|
|
916
|
-
};
|
|
917
|
-
export type TrialedPlan = {
|
|
918
|
-
planId: string;
|
|
919
|
-
productId: string;
|
|
920
|
-
};
|
|
921
|
-
export type FetchUsageHistory = {
|
|
922
|
-
customerId: string;
|
|
923
|
-
resourceId?: string;
|
|
924
|
-
featureId: string;
|
|
925
|
-
startDate: Date;
|
|
926
|
-
endDate?: Date;
|
|
927
|
-
};
|
|
928
|
-
export type UsageHistoryPoint = {
|
|
929
|
-
date: Date;
|
|
930
|
-
value: number;
|
|
931
|
-
isResetPoint: boolean;
|
|
932
|
-
};
|
|
933
|
-
/** @hidden */
|
|
934
|
-
export declare class CustomerModel implements FullCustomer {
|
|
935
|
-
id: string;
|
|
936
|
-
createdAt: Date;
|
|
937
|
-
updatedAt: Date;
|
|
938
|
-
subscriptions: FullSubscription[];
|
|
939
|
-
promotionalEntitlements: PromotionalEntitlement[];
|
|
940
|
-
hasPaymentMethod: boolean;
|
|
941
|
-
alreadyTrialPlans: TrialedPlan[];
|
|
942
|
-
constructor(state: CustomerState);
|
|
943
|
-
getActiveSubscriptions(): FullSubscription[];
|
|
944
|
-
getActiveTrials(): FullSubscription[];
|
|
945
|
-
getActivePromotionalEntitlements(): PromotionalEntitlement[];
|
|
946
|
-
}
|