@stigg/js-client-sdk 1.34.0 → 1.36.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/models.d.ts CHANGED
@@ -340,7 +340,9 @@ export declare type SubscriptionPreviewProration = {
340
340
  };
341
341
  export declare type SubscriptionPricePreview = {
342
342
  subTotal: Money;
343
+ totalExcludingTax: Money;
343
344
  total: Money;
345
+ tax: Money;
344
346
  };
345
347
  export declare type SubscriptionPreviewDiscount = {
346
348
  type: DiscountType;
@@ -348,9 +350,17 @@ export declare type SubscriptionPreviewDiscount = {
348
350
  durationType: DiscountDurationType;
349
351
  durationInMonths?: number;
350
352
  };
353
+ export declare type SubscriptionPreviewTaxDetails = {
354
+ displayName: string;
355
+ percentage: number;
356
+ inclusive: boolean;
357
+ };
351
358
  export interface SubscriptionPreview {
352
359
  subTotal: Money;
360
+ totalExcludingTax: Money;
353
361
  total: Money;
362
+ tax?: Money;
363
+ taxDetails?: SubscriptionPreviewTaxDetails;
354
364
  discount?: SubscriptionPreviewDiscount;
355
365
  billingPeriodRange: DateRange;
356
366
  proration?: SubscriptionPreviewProration;
@@ -358,6 +368,7 @@ export interface SubscriptionPreview {
358
368
  }
359
369
  export declare type EstimateSubscription = {
360
370
  customerId: string;
371
+ resourceId?: string;
361
372
  planId: string;
362
373
  addons?: SubscriptionEstimationAddon[];
363
374
  startDate?: Date;
@@ -149,7 +149,7 @@ export declare class Stigg implements StiggClient {
149
149
  *
150
150
  * @returns {Promise<Entitlement[]>}
151
151
  */
152
- getEntitlements(): Promise<Entitlement[]>;
152
+ getEntitlements(resourceId?: string): Promise<Entitlement[]>;
153
153
  /**
154
154
  * Estimate subscription
155
155
  * @return {Promise<SubscriptionPreview>} Preview of the subscription.
@@ -340,7 +340,9 @@ export declare type SubscriptionPreviewProration = {
340
340
  };
341
341
  export declare type SubscriptionPricePreview = {
342
342
  subTotal: Money;
343
+ totalExcludingTax: Money;
343
344
  total: Money;
345
+ tax: Money;
344
346
  };
345
347
  export declare type SubscriptionPreviewDiscount = {
346
348
  type: DiscountType;
@@ -348,9 +350,17 @@ export declare type SubscriptionPreviewDiscount = {
348
350
  durationType: DiscountDurationType;
349
351
  durationInMonths?: number;
350
352
  };
353
+ export declare type SubscriptionPreviewTaxDetails = {
354
+ displayName: string;
355
+ percentage: number;
356
+ inclusive: boolean;
357
+ };
351
358
  export interface SubscriptionPreview {
352
359
  subTotal: Money;
360
+ totalExcludingTax: Money;
353
361
  total: Money;
362
+ tax?: Money;
363
+ taxDetails?: SubscriptionPreviewTaxDetails;
354
364
  discount?: SubscriptionPreviewDiscount;
355
365
  billingPeriodRange: DateRange;
356
366
  proration?: SubscriptionPreviewProration;
@@ -358,6 +368,7 @@ export interface SubscriptionPreview {
358
368
  }
359
369
  export declare type EstimateSubscription = {
360
370
  customerId: string;
371
+ resourceId?: string;
361
372
  planId: string;
362
373
  addons?: SubscriptionEstimationAddon[];
363
374
  startDate?: Date;
@@ -35,6 +35,7 @@ export declare class ModelMapper {
35
35
  mapFallbackNumericEntitlementResult(entitlement: NumericEntitlementFallback, decision: Decision): EntitlementCheckResult;
36
36
  mapEntitlementResult(decision: Decision, entitlement?: CachedEntitlement, requestedUsage?: number): EntitlementCheckResult;
37
37
  mapFallbackMeteredEntitlementResult(entitlement: MeteredEntitlementFallback, decision: Decision, requestedUsage?: number): EntitlementCheckResult;
38
+ mapTaxFields(fragment: SubscriptionPreviewFragment): Pick<SubscriptionPreview, 'tax' | 'taxDetails'>;
38
39
  mapSubscriptionPreview(fragment: SubscriptionPreviewFragment): SubscriptionPreview;
39
40
  mapDiscount(discount: NonNullable<SubscriptionPreviewFragment['discount']>): SubscriptionPreviewDiscount;
40
41
  mapMoney(fragment: {
@@ -24,4 +24,4 @@ export declare function mapGetEntitlementsFallback(entitlementsFallback?: Entitl
24
24
  feature: {
25
25
  id: string;
26
26
  };
27
- })[] | undefined;
27
+ })[];
@@ -35,6 +35,7 @@ export declare class ModelMapper {
35
35
  mapFallbackNumericEntitlementResult(entitlement: NumericEntitlementFallback, decision: Decision): EntitlementCheckResult;
36
36
  mapEntitlementResult(decision: Decision, entitlement?: CachedEntitlement, requestedUsage?: number): EntitlementCheckResult;
37
37
  mapFallbackMeteredEntitlementResult(entitlement: MeteredEntitlementFallback, decision: Decision, requestedUsage?: number): EntitlementCheckResult;
38
+ mapTaxFields(fragment: SubscriptionPreviewFragment): Pick<SubscriptionPreview, 'tax' | 'taxDetails'>;
38
39
  mapSubscriptionPreview(fragment: SubscriptionPreviewFragment): SubscriptionPreview;
39
40
  mapDiscount(discount: NonNullable<SubscriptionPreviewFragment['discount']>): SubscriptionPreviewDiscount;
40
41
  mapMoney(fragment: {
@@ -24,4 +24,4 @@ export declare function mapGetEntitlementsFallback(entitlementsFallback?: Entitl
24
24
  feature: {
25
25
  id: string;
26
26
  };
27
- })[] | undefined;
27
+ })[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigg/js-client-sdk",
3
- "version": "1.34.0",
3
+ "version": "1.36.0",
4
4
  "description": "Stigg client-side SDK for Browser",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@apollo/client": "^3.4.17",
30
30
  "@sentry/browser": "^7.11.1",
31
- "@stigg/api-client-js": "0.421.0",
31
+ "@stigg/api-client-js": "0.423.0",
32
32
  "axios": "^1.2.2",
33
33
  "cross-fetch": "^3.1.4",
34
34
  "husky": "^7.0.4",