@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.
Files changed (55) hide show
  1. package/dist/api/EdgeApiClient.d.ts +1 -1
  2. package/dist/api/MockPaywallApi.d.ts +1 -1
  3. package/dist/api/PaywallApi.d.ts +1 -1
  4. package/dist/api/SubscriptionsApi.d.ts +2 -2
  5. package/dist/api/initApolloClient.d.ts +1 -1
  6. package/dist/configuration.d.ts +1 -1
  7. package/dist/index.esm.js +2 -2
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/index.js +2 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/models.d.ts +101 -101
  12. package/dist/services/eventEmitter.d.ts +1 -1
  13. package/dist/utils/dateUtils.d.ts +1 -1
  14. package/dist/utils/fetch.d.ts +1 -2
  15. package/dist/utils/isMetered.d.ts +1 -1
  16. package/dist/utils/mapGetEntitlementsFallback.d.ts +5 -5
  17. package/dist/utils/withErrorHandling.d.ts +2 -2
  18. package/package.json +15 -16
  19. package/dist/src/api/ApiGateway.d.ts +0 -28
  20. package/dist/src/api/AutomaticRechargeApi.d.ts +0 -23
  21. package/dist/src/api/CheckoutApi.d.ts +0 -8
  22. package/dist/src/api/CouponsApi.d.ts +0 -8
  23. package/dist/src/api/CreditsApi.d.ts +0 -11
  24. package/dist/src/api/CustomersApi.d.ts +0 -16
  25. package/dist/src/api/EdgeApiClient.d.ts +0 -21
  26. package/dist/src/api/EntitlementsApi.d.ts +0 -10
  27. package/dist/src/api/MockPaywallApi.d.ts +0 -10
  28. package/dist/src/api/PaywallApi.d.ts +0 -18
  29. package/dist/src/api/SdkConfigurationApi.d.ts +0 -10
  30. package/dist/src/api/SubscriptionEstimationsApi.d.ts +0 -12
  31. package/dist/src/api/SubscriptionsApi.d.ts +0 -22
  32. package/dist/src/api/UsageHistoryApi.d.ts +0 -7
  33. package/dist/src/api/initApolloClient.d.ts +0 -11
  34. package/dist/src/client.d.ts +0 -312
  35. package/dist/src/clients.d.ts +0 -2
  36. package/dist/src/configuration.d.ts +0 -28
  37. package/dist/src/index.d.ts +0 -6
  38. package/dist/src/models.d.ts +0 -670
  39. package/dist/src/offlineClient.d.ts +0 -46
  40. package/dist/src/services/cacheService.d.ts +0 -14
  41. package/dist/src/services/cachedEntitlement.d.ts +0 -45
  42. package/dist/src/services/entitlementDecisionService.d.ts +0 -10
  43. package/dist/src/services/entitlementsService.d.ts +0 -34
  44. package/dist/src/services/eventEmitter.d.ts +0 -11
  45. package/dist/src/services/inMemoryCacheService.d.ts +0 -22
  46. package/dist/src/services/initializationStateTracker.d.ts +0 -16
  47. package/dist/src/services/loggerService.d.ts +0 -23
  48. package/dist/src/services/sentryService.d.ts +0 -3
  49. package/dist/src/utils/ModelMapper.d.ts +0 -58
  50. package/dist/src/utils/calculateUsagePeriod.d.ts +0 -5
  51. package/dist/src/utils/dateUtils.d.ts +0 -1
  52. package/dist/src/utils/fetch.d.ts +0 -3
  53. package/dist/src/utils/isMetered.d.ts +0 -7
  54. package/dist/src/utils/mapGetEntitlementsFallback.d.ts +0 -35
  55. package/dist/src/utils/withErrorHandling.d.ts +0 -23
@@ -1,28 +0,0 @@
1
- import { SourceType } from '@stigg/api-client-js/src/generated/sdk';
2
- import { EntitlementsFallback } from './models';
3
- import { LogConfiguration, LoggerService } from './services/loggerService';
4
- export declare const SDK_SOURCE_TYPE = SourceType.JsClientSdk;
5
- export declare const SDK_NAME = "js-client-sdk";
6
- export declare type ClientConfiguration = {
7
- apiKey: string;
8
- baseUri?: string;
9
- baseEdgeUri?: string;
10
- customerId?: string | null;
11
- resourceId?: string | null;
12
- customerToken?: string | null;
13
- /** @deprecated not longer in use */
14
- entitlementPollingInterval?: number;
15
- /** @deprecated not longer in use */
16
- useEntitlementPolling?: boolean;
17
- cacheTtlMs?: number;
18
- logConfiguration?: LogConfiguration;
19
- lazyLoad?: boolean;
20
- enableEdge?: boolean;
21
- entitlementsFallback?: EntitlementsFallback;
22
- clientName?: string;
23
- clientVersion?: string;
24
- offline?: boolean;
25
- };
26
- export declare function validateConfiguration(configuration: ClientConfiguration, loggerService: LoggerService): void;
27
- export declare function getConfiguration(configuration: ClientConfiguration): Required<ClientConfiguration>;
28
- export declare function ensureCustomerRefIdExists({ customerId }: ClientConfiguration): string;
@@ -1,6 +0,0 @@
1
- export { ClientConfiguration } from './configuration';
2
- export { StiggClient } from './client';
3
- export { LogLevel, LogConfiguration, Logger } from './services/loggerService';
4
- export * from './models';
5
- export { OfflineStigg } from './offlineClient';
6
- export { Stigg as default } from './client';
@@ -1,670 +0,0 @@
1
- import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, SubscriptionQueryFragment, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment, WidgetType, CustomerPortalSubscriptionScheduledUpdateDataFragment, DiscountType, DiscountDurationType, PackageEntitlementFragment, PageInfoFragment, PaywallCurrencyFragment, FeatureType, MeterType, EntitlementResetPeriod, AccessDeniedReason, PaywallCalculatedPricePointsFragment, SubscriptionInvoiceFragment, PaymentCollection, PlanFragment, BillingVendorIdentifier, TiersMode, SubscriptionFutureUpdateDataFragment, PriceTierFragment, TotalPriceFragment, CheckoutConfigurationFragment, TypographyConfigurationFragment, BillingAddress, ScheduleStrategy, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionProrationBehavior, PaymentSessionInput, CreditBalanceSummaryInput, StripeCheckoutCredentialsFragment, ZuoraCheckoutCredentialsFragment, GetCreditGrantsInput as GetCreditGrantsInputGenerated, CreditLedgerInput, CreditUsageInput, CreditGrantFragment, CreditLedgerFragment, EntitlementsStateAccessDeniedReason, AutoRechargeSettingsFragment, GetAutoRechargeSettingsInput, SaveAutoRechargeSettingsInput, PackageEntitlementUnionFragment } from '@stigg/api-client-js/src/generated/sdk';
2
- export * from '@stigg/api-client-js/src/generated/sdk';
3
- interface Metadata {
4
- [key: string]: string;
5
- }
6
- export declare type EntitlementFeature = {
7
- id: string;
8
- featureType: FeatureType;
9
- displayName: string;
10
- description?: string;
11
- units?: string;
12
- unitsPlural?: string;
13
- meterType?: MeterType.Fluctuating | MeterType.Incremental | MeterType.None;
14
- isMetered?: boolean;
15
- metadata?: Record<string, string>;
16
- };
17
- export declare type BaseEntitlement = {
18
- hasAccess: boolean;
19
- isFallback: boolean;
20
- accessDeniedReason?: AccessDeniedReason;
21
- feature?: EntitlementFeature;
22
- };
23
- export interface BooleanEntitlement extends BaseEntitlement {
24
- }
25
- export interface EnumEntitlement extends BaseEntitlement {
26
- enumValues: string[];
27
- requestedValues?: string[];
28
- }
29
- export interface NumericEntitlement extends BaseEntitlement {
30
- value?: number;
31
- isUnlimited: boolean;
32
- }
33
- /** @deprecated - fields were moved into {@link MeteredEntitlement} */
34
- export declare type ResetSettings = {
35
- /** @deprecated - renamed to {@link MeteredEntitlement.usagePeriodEnd} */
36
- nextResetDate: Date;
37
- /** @deprecated - renamed to {@link MeteredEntitlement.resetPeriod} */
38
- resetPeriod: EntitlementResetPeriod;
39
- };
40
- export interface MeteredEntitlement extends BaseEntitlement {
41
- usageLimit?: number;
42
- isUnlimited: boolean;
43
- currentUsage: number;
44
- requestedUsage: number;
45
- resetPeriod?: EntitlementResetPeriod;
46
- /** The anchor for calculating the usage period for metered entitlements with a reset period configured */
47
- usagePeriodAnchor?: Date;
48
- /** The start date of the usage period for metered entitlements with a reset period configured */
49
- usagePeriodStart?: Date;
50
- /** The end date of the usage period for metered entitlements with a reset period configured */
51
- usagePeriodEnd?: Date;
52
- /** @deprecated fields were moved into {@link MeteredEntitlement} */
53
- resetSettings?: ResetSettings;
54
- }
55
- export declare type Entitlement = BooleanEntitlement | NumericEntitlement | MeteredEntitlement;
56
- export declare type EntitlementsState = {
57
- entitlements: Entitlement[];
58
- accessDeniedReason: EntitlementsStateAccessDeniedReason | null;
59
- };
60
- /** @internal */
61
- export declare const BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT: BooleanEntitlement;
62
- /** @internal */
63
- export declare const NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT: NumericEntitlement;
64
- /** @internal */
65
- export declare const METERED_DEFAULT_FALLBACK_ENTITLEMENT: MeteredEntitlement;
66
- /** @internal */
67
- export declare const ENUM_DEFAULT_FALLBACK_ENTITLEMENT: EnumEntitlement;
68
- export interface CreditEntitlement {
69
- hasAccess: boolean;
70
- isFallback: boolean;
71
- accessDeniedReason?: AccessDeniedReason;
72
- currency: {
73
- currencyId: string;
74
- };
75
- usageLimit: number;
76
- currentUsage: number;
77
- remaining: number;
78
- usagePeriodEnd?: Date;
79
- }
80
- /** @internal */
81
- export declare const CREDIT_DEFAULT_FALLBACK_ENTITLEMENT: CreditEntitlement;
82
- export declare type GetCreditEntitlement = {
83
- currencyId: string;
84
- resourceId?: string;
85
- options?: CreditEntitlementOptions;
86
- };
87
- export declare type CreditEntitlementOptions = {
88
- fallback?: CreditEntitlementFallback;
89
- };
90
- export declare type CreditEntitlementFallback = {
91
- hasAccess?: boolean;
92
- usageLimit?: number;
93
- currentUsage?: number;
94
- };
95
- export declare type PackageEntitlement = {
96
- usageLimit: number;
97
- feature?: EntitlementFeature;
98
- isCustom?: boolean;
99
- hasUnlimitedUsage?: boolean | null;
100
- resetPeriod?: EntitlementResetPeriod | null;
101
- hiddenFromWidgets?: PackageEntitlementFragment['hiddenFromWidgets'];
102
- displayNameOverride?: PackageEntitlementFragment['displayNameOverride'];
103
- enumValues?: string[] | null;
104
- isGranted: PackageEntitlementFragment['isGranted'];
105
- };
106
- export declare type PromotionalEntitlement = {
107
- usageLimit: number;
108
- feature: EntitlementFeature;
109
- hasUnlimitedUsage?: boolean | null;
110
- status: PromotionalEntitlementStatus;
111
- expiresAt?: Date;
112
- hasExpirationDate: boolean;
113
- isVisible: boolean;
114
- };
115
- export declare type Price = {
116
- pricingModel: BillingModel;
117
- billingPeriod: BillingPeriod;
118
- billingId?: string | null;
119
- amount?: number | null;
120
- currency: Currency;
121
- creditRate?: {
122
- amount: number;
123
- } | null;
124
- tiers?: PriceTierFragment[] | null | undefined;
125
- tiersMode: TiersMode | null | undefined;
126
- isTieredPrice: boolean;
127
- minUnitQuantity?: number | null | undefined;
128
- maxUnitQuantity?: number | null | undefined;
129
- billingCountryCode?: string | null | undefined;
130
- feature?: {
131
- featureId: string;
132
- units?: string | null | undefined;
133
- unitsPlural?: string | null | undefined;
134
- unitQuantity?: number | null;
135
- displayName: string;
136
- } | null;
137
- blockSize?: number | null;
138
- };
139
- export declare type SubscriptionPrice = Price & {
140
- grossAmount: number;
141
- };
142
- export declare type BasePlan = {
143
- displayName: string;
144
- id: string;
145
- };
146
- export declare type Plan = {
147
- id: string;
148
- displayName: string;
149
- description?: string | null;
150
- billingId?: string | null;
151
- order: number;
152
- basePlan?: BasePlan;
153
- /** @deprecated Use {@link packageEntitlements} instead to retrieve both feature and credit entitlements. */
154
- entitlements: PackageEntitlement[];
155
- /** @deprecated Use {@link inheritedPackageEntitlements} instead to retrieve both feature and credit entitlements. */
156
- inheritedEntitlements: PackageEntitlement[];
157
- packageEntitlements?: PackageEntitlementUnionFragment[] | null;
158
- inheritedPackageEntitlements?: PackageEntitlementUnionFragment[] | null;
159
- pricePoints: Price[];
160
- pricingType?: PricingType | null;
161
- defaultTrialConfig?: DefaultTrialConfig | null;
162
- compatibleAddons: Addon[];
163
- compatiblePackageGroups: CompatiblePackageGroup[];
164
- product: Product;
165
- metadata?: Metadata | null;
166
- };
167
- export declare type Coupon = {
168
- id: string;
169
- name: string;
170
- description?: string | null;
171
- discountValue: number;
172
- percentOff?: number | null;
173
- amountsOff?: Money[] | null;
174
- metadata?: Metadata | null;
175
- };
176
- export declare type Product = {
177
- id: string;
178
- displayName?: string | null;
179
- description?: string | null;
180
- metadata?: Metadata | null;
181
- };
182
- export declare type DefaultTrialConfig = {
183
- duration: number;
184
- units: TrialPeriodUnits;
185
- budget?: {
186
- limit: BudgetConfigurationInput['limit'];
187
- };
188
- };
189
- export declare type GetBooleanEntitlement = {
190
- featureId: string;
191
- options?: BooleanEntitlementOptions;
192
- resourceId?: string;
193
- };
194
- export declare type GetNumericEntitlement = {
195
- featureId: string;
196
- options?: NumericEntitlementOptions;
197
- resourceId?: string;
198
- };
199
- export declare type GetMeteredEntitlement = {
200
- featureId: string;
201
- options?: MeteredEntitlementOptions;
202
- resourceId?: string;
203
- };
204
- export declare type GetEnumEntitlement = {
205
- featureId: string;
206
- resourceId?: string;
207
- options?: EnumEntitlementOptions;
208
- };
209
- export declare type PaginatedResult<T> = {
210
- data: T[];
211
- pageInfo: PageInfoFragment;
212
- totalCount?: number;
213
- };
214
- export declare type GetSubscriptionsResult = PaginatedResult<SubscriptionQueryFragment>;
215
- export declare type GetCreditGrantsResult = PaginatedResult<CreditGrantFragment>;
216
- export declare type GetCreditLedgerResult = PaginatedResult<CreditLedgerFragment>;
217
- export declare type GetSubscriptionsParams = {
218
- customerId?: string;
219
- resourceId?: string | string[];
220
- status?: SubscriptionStatus | SubscriptionStatus[];
221
- productId?: string | string[];
222
- pagination?: {
223
- limit?: number;
224
- startingAfter?: string;
225
- endingBefore?: string;
226
- };
227
- };
228
- export declare type GetPaywall = {
229
- productId?: string;
230
- resourceId?: string;
231
- context?: WidgetType;
232
- billingCountryCode?: string;
233
- includeHiddenPlans?: boolean;
234
- };
235
- export declare type GetSubscription = {
236
- subscriptionId: string;
237
- };
238
- export declare type GetActiveSubscriptions = {
239
- resourceId?: string | string[];
240
- };
241
- export declare type GetCustomerPortal = {
242
- resourceId?: string;
243
- productId?: string;
244
- };
245
- export declare type GetCheckoutState = {
246
- planId: string;
247
- billingCountryCode?: string;
248
- resourceId?: string | null;
249
- };
250
- export declare type CheckoutAddon = {
251
- addonId: string;
252
- quantity?: number;
253
- };
254
- export declare type ApplySubscription = {
255
- planId: string;
256
- paymentMethodId?: string;
257
- payingCustomerId?: string;
258
- resourceId?: string;
259
- addons?: CheckoutAddon[];
260
- startDate?: Date;
261
- billingId?: string;
262
- billingPeriod?: BillingPeriod;
263
- skipTrial?: boolean;
264
- unitQuantity?: number;
265
- billableFeatures?: BillableFeature[];
266
- metadata?: Metadata | null;
267
- promotionCode?: string;
268
- billingInformation?: Omit<SubscriptionBillingInfo, 'taxPercentage'>;
269
- billingCountryCode?: string;
270
- scheduleStrategy?: ScheduleStrategy;
271
- };
272
- export declare type TaxId = {
273
- type: string;
274
- value: string;
275
- };
276
- export declare type SubscriptionBillingInfo = {
277
- taxRateIds?: string[];
278
- taxIds?: TaxId[];
279
- taxPercentage?: number;
280
- billingAddress?: BillingAddress;
281
- integrationId?: string;
282
- prorationBehavior?: SubscriptionProrationBehavior;
283
- };
284
- export declare type ApplySubscriptionResults = {
285
- subscription?: Subscription;
286
- };
287
- export declare type EntitlementsFallback = {
288
- [featureId: string]: BooleanEntitlementFallback | NumericEntitlementFallback | MeteredEntitlementFallback | EnumEntitlementFallback;
289
- };
290
- export declare type BooleanEntitlementFallback = {
291
- hasAccess: boolean;
292
- };
293
- export declare type BooleanEntitlementOptions = {
294
- /** @deprecated not in use anymore */
295
- shouldTrack?: boolean;
296
- fallback?: BooleanEntitlementFallback;
297
- };
298
- export declare type NumericEntitlementFallback = {
299
- hasAccess: boolean;
300
- value?: number;
301
- isUnlimited?: boolean;
302
- };
303
- export declare type NumericEntitlementOptions = {
304
- /** @deprecated not in use anymore */
305
- shouldTrack?: boolean;
306
- fallback?: NumericEntitlementFallback;
307
- };
308
- export declare type MeteredEntitlementFallback = {
309
- hasAccess: boolean;
310
- usageLimit?: number;
311
- isUnlimited?: boolean;
312
- };
313
- export declare type EnumEntitlementFallback = {
314
- hasAccess: boolean;
315
- enumValues?: string[];
316
- };
317
- export declare type EnumEntitlementOptions = {
318
- requestedValues?: string[];
319
- /** @deprecated not in use anymore */
320
- shouldTrack?: boolean;
321
- fallback?: EnumEntitlementFallback;
322
- };
323
- export declare type MeteredEntitlementOptions = {
324
- requestedUsage?: number;
325
- /** @deprecated not in use anymore */
326
- shouldTrack?: boolean;
327
- fallback?: MeteredEntitlementFallback;
328
- };
329
- export declare type CompatiblePackageGroupOptions = {
330
- minItems?: number;
331
- freeItems?: number;
332
- };
333
- export declare type CompatiblePackageGroup = {
334
- packageGroupId: string;
335
- displayName: string;
336
- addons: Addon[];
337
- options?: CompatiblePackageGroupOptions;
338
- };
339
- export declare type DependencyAddon = {
340
- refId: string;
341
- displayName: string;
342
- description?: string;
343
- };
344
- export declare type Addon = {
345
- id: string;
346
- displayName: string;
347
- description: string;
348
- billingId?: string | null;
349
- /** @deprecated Use {@link packageEntitlements} instead to retrieve both feature and credit entitlements. */
350
- entitlements: PackageEntitlement[];
351
- packageEntitlements?: PackageEntitlementUnionFragment[] | null;
352
- pricePoints: Price[];
353
- pricingType?: PricingType | null;
354
- dependencies?: DependencyAddon[];
355
- metadata?: Metadata | null;
356
- hiddenFromWidgets?: PackageEntitlementFragment['hiddenFromWidgets'];
357
- maxQuantity?: number;
358
- };
359
- export declare type SubscriptionAddon = {
360
- quantity: number;
361
- addon: Addon;
362
- };
363
- export declare type ExperimentInfo = {
364
- id: string;
365
- name: string;
366
- groupName: string;
367
- groupType?: ExperimentGroupType | null;
368
- };
369
- export declare type Subscription = {
370
- id: string;
371
- status: SubscriptionStatus;
372
- resourceId?: string;
373
- payingCustomer?: SlimCustomer | null;
374
- plan: Plan;
375
- /** @deprecated use {@link prices} instead with {@link totalPrice} */
376
- price: SubscriptionPrice | null;
377
- prices: Price[];
378
- totalPrice: TotalPriceFragment | null | undefined;
379
- pricingType: PricingType;
380
- addons: SubscriptionAddon[];
381
- billingId?: string;
382
- crmId?: string;
383
- startDate: Date;
384
- currentBillingPeriodEnd?: Date;
385
- /**
386
- * The calculated end date after which the subscription will be canceled, which takes trial expiration and scheduled cancellations into consideration
387
- */
388
- effectiveEndDate?: Date;
389
- endDate?: Date;
390
- trialEndDate?: Date;
391
- cancellationDate?: Date;
392
- metadata?: Metadata | null;
393
- experimentInfo?: ExperimentInfo | null;
394
- /** @deprecated use {@link futureUpdates} instead with filter for {@link SubscriptionScheduleStatus.Scheduled} */
395
- scheduledUpdates?: CustomerPortalSubscriptionScheduledUpdateDataFragment[];
396
- /** Future updates can be of 2 types {@link SubscriptionScheduleStatus.Scheduled} or {@link SubscriptionScheduleStatus.PendingPayment} */
397
- futureUpdates: SubscriptionFutureUpdateDataFragment[];
398
- latestInvoice?: SubscriptionInvoiceFragment;
399
- paymentCollection: PaymentCollection;
400
- paymentCollectionMethod?: PaymentCollectionMethod;
401
- };
402
- export declare type CustomerPortalBillingInformation = Omit<CustomerPortalBillingInformationFragment, '__typename'>;
403
- export declare type CustomerPortalSubscriptionAddon = Omit<CustomerPortalSubscriptionAddonFragment, '__typename'>;
404
- export declare type CustomerPortalSubscription = Omit<CustomerPortalSubscriptionFragment, '__typename'>;
405
- export declare type CustomerPortalEntitlement = Omit<CustomerPortalEntitlementFragment, '__typename'>;
406
- export declare type CustomerPortalPromotionalEntitlement = Omit<CustomerPortalPromotionalEntitlementFragment, '__typename'>;
407
- export declare type CustomerPortalConfiguration = Omit<CustomerPortalConfigurationFragment, '__typename'>;
408
- export declare type CustomerPortal = {
409
- subscriptions: CustomerPortalSubscription[];
410
- entitlements: CustomerPortalEntitlement[];
411
- promotionalEntitlements: CustomerPortalPromotionalEntitlement[];
412
- billingInformation: CustomerPortalBillingInformation;
413
- canUpgradeSubscription: boolean;
414
- billingPortalUrl?: string | null;
415
- configuration?: CustomerPortalConfiguration | null;
416
- resource: CustomerResource | null;
417
- /** @deprecated This field has been moved to SDK configuration */
418
- showWatermark?: boolean;
419
- };
420
- export declare type CheckoutStatePlan = Plan & Pick<PlanFragment, 'prices'>;
421
- export declare type CheckoutBillingIntegration = {
422
- billingIdentifier: BillingVendorIdentifier;
423
- billingCredentials: StripeCheckoutCredentialsFragment | ZuoraCheckoutCredentialsFragment;
424
- credentials: {
425
- accountId?: string | null;
426
- publicKey?: string | null;
427
- };
428
- };
429
- export declare type CreatePaymentSessionInput = Omit<PaymentSessionInput, 'customerId'>;
430
- export declare type TypographyConfiguration = Omit<TypographyConfigurationFragment, '__typename'>;
431
- export declare type CheckoutConfiguration = Omit<CheckoutConfigurationFragment, '__typename'>;
432
- export declare type GetCheckoutStateResults = {
433
- configuration?: CheckoutConfiguration | null;
434
- setupSecret: string;
435
- plan: CheckoutStatePlan;
436
- customer: Customer;
437
- resource: CustomerResource | null;
438
- activeSubscription?: Subscription | null;
439
- billingIntegration: CheckoutBillingIntegration;
440
- };
441
- export declare type PaywallConfiguration = Omit<PaywallConfigurationFragment, '__typename'>;
442
- export declare type PaywallCurrency = Omit<PaywallCurrencyFragment, '__typename'>;
443
- export declare type PaywallCalculatedPricePoint = Omit<PaywallCalculatedPricePointsFragment, '__typename'>;
444
- export declare type Paywall = {
445
- plans: Plan[];
446
- configuration?: PaywallConfiguration | null;
447
- customer: Customer | null;
448
- resource: CustomerResource | null;
449
- activeSubscriptions: Subscription[] | null;
450
- currency: PaywallCurrency;
451
- paywallCalculatedPricePoints?: PaywallCalculatedPricePoint[] | null;
452
- };
453
- export declare type CustomerResource = {
454
- id: string;
455
- };
456
- export declare type Customer = {
457
- id: string;
458
- name?: string;
459
- email?: string;
460
- billingId?: string;
461
- createdAt: Date;
462
- updatedAt: Date;
463
- subscriptions: Subscription[];
464
- promotionalEntitlements: PromotionalEntitlement[];
465
- hasPaymentMethod: boolean;
466
- paymentMethodDetails?: PaymentMethodDetails;
467
- metadata?: Metadata | null;
468
- trialedPlans?: TrialedPlan[] | null;
469
- eligibleForTrial?: EligibleForTrial[] | null;
470
- experimentInfo?: ExperimentInfo | null;
471
- getActivePromotionalEntitlements(): PromotionalEntitlement[];
472
- /** @deprecated use {@link StiggClient.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.Active} */
473
- getActiveSubscriptions(): Subscription[];
474
- /** @deprecated use {@link StiggClient.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.InTrial} */
475
- getActiveTrials(): Subscription[];
476
- };
477
- export declare type SlimCustomer = {
478
- id: string;
479
- name?: string;
480
- email?: string;
481
- createdAt: Date;
482
- updatedAt: Date;
483
- billingId?: string;
484
- metadata?: Metadata | null;
485
- awsMarketplaceCustomerId?: string | null;
486
- };
487
- export declare type CustomerState = Omit<Customer, 'getActiveSubscriptions' | 'getActivePromotionalEntitlements' | 'getActiveTrials'>;
488
- export declare type TrialedPlan = {
489
- productId?: string | null;
490
- planId?: string | null;
491
- };
492
- export declare type EligibleForTrial = {
493
- productId?: string | null;
494
- eligible: boolean;
495
- };
496
- export declare type WaitForCheckoutCompleted = {
497
- timeoutMs?: number;
498
- refreshOnComplete?: boolean;
499
- };
500
- export declare type PaymentMethodDetails = {
501
- expirationMonth?: number | null;
502
- expirationYear?: number | null;
503
- last4Digits?: string | null;
504
- };
505
- export declare type SubscriptionEstimationAddon = {
506
- addonId: string;
507
- quantity?: number;
508
- };
509
- export declare type DateRange = {
510
- start?: Date;
511
- end?: Date;
512
- };
513
- export declare type Money = {
514
- amount: number;
515
- currency: string;
516
- };
517
- export declare type SubscriptionPreviewProration = {
518
- prorationDate: Date;
519
- credit: Money;
520
- debit: Money;
521
- netAmount: Money;
522
- hasProrations?: boolean;
523
- };
524
- export declare type SubscriptionPricePreview = {
525
- subTotal: Money;
526
- totalExcludingTax: Money;
527
- total: Money;
528
- tax?: Money;
529
- discountAmount?: Money;
530
- taxDetails?: SubscriptionPreviewTaxDetails;
531
- discount?: SubscriptionPreviewDiscount;
532
- };
533
- export declare type SubscriptionPreviewInvoice = {
534
- total: Money;
535
- subTotal: Money;
536
- totalExcludingTax: Money;
537
- tax?: Money;
538
- discount?: Money;
539
- taxDetails?: SubscriptionPreviewTaxDetails;
540
- discountDetails?: SubscriptionPreviewDiscount;
541
- };
542
- export declare type ImmediateSubscriptionPreviewInvoice = SubscriptionPreviewInvoice & {
543
- proration?: SubscriptionPreviewProration;
544
- credits?: SubscriptionPreviewCredits;
545
- };
546
- export declare type SubscriptionPreviewDiscount = {
547
- name?: string | null;
548
- type: DiscountType;
549
- value: number;
550
- durationType: DiscountDurationType;
551
- durationInMonths?: number;
552
- };
553
- export declare type SubscriptionPreviewTaxDetails = {
554
- displayName: string;
555
- percentage: number;
556
- inclusive: boolean;
557
- };
558
- export declare type SubscriptionPreviewCredits = {
559
- initial: Money;
560
- used: Money;
561
- remaining: Money;
562
- };
563
- export interface SubscriptionPreview {
564
- subTotal: Money;
565
- totalExcludingTax: Money;
566
- total: Money;
567
- tax?: Money;
568
- discountAmount?: Money;
569
- taxDetails?: SubscriptionPreviewTaxDetails;
570
- discount?: SubscriptionPreviewDiscount;
571
- billingPeriodRange: DateRange;
572
- proration?: SubscriptionPreviewProration;
573
- subscription?: SubscriptionPricePreview;
574
- isPlanDowngrade?: boolean;
575
- hasScheduledUpdates?: boolean;
576
- credits?: SubscriptionPreviewCredits;
577
- }
578
- export interface SubscriptionPreviewV2 {
579
- /**
580
- * The immediate invoice prices that will be generated for the subscription
581
- * for the previewed subscription \ changes
582
- */
583
- immediateInvoice: ImmediateSubscriptionPreviewInvoice;
584
- /**
585
- * The recurring invoice prices that will be generated for the subscription
586
- * for the previewed subscription \ changes, starting from the next billing period
587
- */
588
- recurringInvoice?: SubscriptionPreviewInvoice;
589
- billingPeriodRange: DateRange;
590
- isPlanDowngrade?: boolean;
591
- hasScheduledUpdates?: boolean;
592
- }
593
- export declare type EstimateSubscription = {
594
- customerId: string;
595
- payingCustomerId?: string;
596
- resourceId?: string;
597
- planId: string;
598
- addons?: SubscriptionEstimationAddon[];
599
- startDate?: Date;
600
- billingPeriod?: BillingPeriod;
601
- billingCountryCode?: string;
602
- unitQuantity?: number;
603
- billableFeatures?: BillableFeature[];
604
- billingInformation?: SubscriptionBillingInfo;
605
- promotionCode?: string;
606
- skipTrial?: boolean;
607
- };
608
- export declare type EstimateSubscriptionUpdate = {
609
- subscriptionId: string;
610
- unitQuantity?: number;
611
- billableFeatures?: BillableFeature[];
612
- addons?: SubscriptionEstimationAddon[];
613
- promotionCode?: string;
614
- };
615
- export declare type PreviewNextInvoice = {
616
- subscriptionId: string;
617
- };
618
- export declare type PreviewSubscription = {
619
- customerId: string;
620
- payingCustomerId?: string;
621
- planId: string;
622
- resourceId?: string;
623
- addons?: SubscriptionEstimationAddon[];
624
- startDate?: Date;
625
- billingPeriod?: BillingPeriod;
626
- billingCountryCode?: string;
627
- unitQuantity?: number;
628
- billableFeatures?: BillableFeature[];
629
- billingInformation?: SubscriptionBillingInfo;
630
- promotionCode?: string;
631
- scheduleStrategy?: ScheduleStrategy;
632
- };
633
- export declare type FetchUsageHistory = {
634
- customerId: string;
635
- resourceId?: string;
636
- featureId: string;
637
- startDate: Date;
638
- endDate?: Date;
639
- };
640
- export declare type UsageHistoryPoint = {
641
- date: Date;
642
- value: number;
643
- isResetPoint: boolean;
644
- };
645
- export declare type BillableFeature = {
646
- featureId: string;
647
- quantity: number;
648
- };
649
- export declare type GetCreditUsageInput = Omit<CreditUsageInput, 'customerId' | 'resourceId'>;
650
- export declare type GetCreditBalanceInput = Omit<CreditBalanceSummaryInput, 'customerId' | 'resourceId'>;
651
- export declare type GetCreditGrantsInput = Omit<GetCreditGrantsInputGenerated, 'customerId' | 'resourceId'>;
652
- export declare type GetCreditLedgerInput = Omit<CreditLedgerInput, 'customerId' | 'resourceId'>;
653
- export declare type AutomaticRechargeConfiguration = AutoRechargeSettingsFragment;
654
- export declare type GetAutomaticRechargeConfigurationInput = GetAutoRechargeSettingsInput;
655
- export declare type SaveAutomaticRechargeConfigurationInput = SaveAutoRechargeSettingsInput;
656
- /** @hidden */
657
- export declare class CustomerModel implements Customer {
658
- id: string;
659
- createdAt: Date;
660
- updatedAt: Date;
661
- subscriptions: Subscription[];
662
- promotionalEntitlements: PromotionalEntitlement[];
663
- hasPaymentMethod: boolean;
664
- metadata?: Metadata | null;
665
- paymentMethodDetails?: PaymentMethodDetails;
666
- constructor(state: CustomerState);
667
- getActiveSubscriptions(): Subscription[];
668
- getActiveTrials(): Subscription[];
669
- getActivePromotionalEntitlements(): PromotionalEntitlement[];
670
- }