@stigg/js-client-sdk 0.34.2 → 0.37.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.
@@ -1,9 +1,11 @@
1
1
  import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
2
2
  import PaywallApi from './PaywallApi';
3
3
  import CustomersApi from './CustomersApi';
4
+ import CouponsApi from './CouponsApi';
4
5
  declare class ApiGateway {
5
6
  paywall: PaywallApi;
6
7
  customers: CustomersApi;
8
+ coupons: CouponsApi;
7
9
  constructor(client: ApolloClient<NormalizedCacheObject>);
8
10
  }
9
11
  export default ApiGateway;
@@ -0,0 +1,8 @@
1
+ import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
2
+ import { FetchCouponsQuery } from './generated/types';
3
+ declare class CouponsApi {
4
+ private readonly client;
5
+ constructor(client: ApolloClient<NormalizedCacheObject>);
6
+ getCoupons(): Promise<import("@apollo/client/core").ApolloQueryResult<FetchCouponsQuery>>;
7
+ }
8
+ export default CouponsApi;
@@ -22,6 +22,8 @@ export declare type Scalars = {
22
22
  ConnectionCursor: any;
23
23
  /** A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. */
24
24
  DateTime: any;
25
+ /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
26
+ JSON: any;
25
27
  };
26
28
  /** DenyReason of get access policy */
27
29
  export declare enum AccessDeniedReason {
@@ -39,6 +41,7 @@ export declare type AddCompatibleAddonsToPlanInput = {
39
41
  relationIds: Array<Scalars['String']>;
40
42
  };
41
43
  export declare type AddonCreateInput = {
44
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
42
45
  billingId?: InputMaybe<Scalars['String']>;
43
46
  description?: InputMaybe<Scalars['String']>;
44
47
  displayName: Scalars['String'];
@@ -85,6 +88,7 @@ export declare enum AddonSortFields {
85
88
  VersionNumber = "versionNumber"
86
89
  }
87
90
  export declare type AddonUpdateInput = {
91
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
88
92
  billingId?: InputMaybe<Scalars['String']>;
89
93
  description?: InputMaybe<Scalars['String']>;
90
94
  displayName: Scalars['String'];
@@ -117,10 +121,20 @@ export declare enum ApiKeyType {
117
121
  Client = "CLIENT",
118
122
  Server = "SERVER"
119
123
  }
124
+ export declare type ArchiveCouponInput = {
125
+ environmentId?: InputMaybe<Scalars['String']>;
126
+ refId: Scalars['String'];
127
+ };
120
128
  export declare type ArchivePlanInput = {
121
129
  environmentId: Scalars['String'];
122
130
  id: Scalars['String'];
123
131
  };
132
+ export declare type AttachCustomerPaymentMethodInput = {
133
+ environmentId?: InputMaybe<Scalars['String']>;
134
+ paymentMethodId: Scalars['String'];
135
+ refId: Scalars['String'];
136
+ vendorIdentifier: VendorIdentifier;
137
+ };
124
138
  /** Billing model. */
125
139
  export declare enum BillingModel {
126
140
  FlatFee = "FLAT_FEE",
@@ -173,9 +187,103 @@ export declare enum ChangeType {
173
187
  Deleted = "DELETED",
174
188
  Modified = "MODIFIED"
175
189
  }
176
- export declare type CheckoutAddonInput = {
177
- addonId: Scalars['String'];
178
- quantity?: InputMaybe<Scalars['Int']>;
190
+ export declare type CouponFilter = {
191
+ and?: InputMaybe<Array<CouponFilter>>;
192
+ billingId?: InputMaybe<StringFieldComparison>;
193
+ createdAt?: InputMaybe<DateFieldComparison>;
194
+ customers?: InputMaybe<CouponFilterCustomerFilter>;
195
+ description?: InputMaybe<StringFieldComparison>;
196
+ environmentId?: InputMaybe<StringFieldComparison>;
197
+ id?: InputMaybe<StringFieldComparison>;
198
+ name?: InputMaybe<StringFieldComparison>;
199
+ or?: InputMaybe<Array<CouponFilter>>;
200
+ refId?: InputMaybe<StringFieldComparison>;
201
+ status?: InputMaybe<CouponStatusFilterComparison>;
202
+ type?: InputMaybe<CouponTypeFilterComparison>;
203
+ updatedAt?: InputMaybe<DateFieldComparison>;
204
+ };
205
+ export declare type CouponFilterCustomerFilter = {
206
+ and?: InputMaybe<Array<CouponFilterCustomerFilter>>;
207
+ billingId?: InputMaybe<StringFieldComparison>;
208
+ createdAt?: InputMaybe<DateFieldComparison>;
209
+ crmHubspotCompanyId?: InputMaybe<StringFieldComparison>;
210
+ crmHubspotCompanyUrl?: InputMaybe<StringFieldComparison>;
211
+ crmId?: InputMaybe<StringFieldComparison>;
212
+ email?: InputMaybe<StringFieldComparison>;
213
+ environmentId?: InputMaybe<StringFieldComparison>;
214
+ id?: InputMaybe<StringFieldComparison>;
215
+ name?: InputMaybe<StringFieldComparison>;
216
+ or?: InputMaybe<Array<CouponFilterCustomerFilter>>;
217
+ refId?: InputMaybe<StringFieldComparison>;
218
+ updatedAt?: InputMaybe<DateFieldComparison>;
219
+ };
220
+ export declare type CouponSort = {
221
+ direction: SortDirection;
222
+ field: CouponSortFields;
223
+ nulls?: InputMaybe<SortNulls>;
224
+ };
225
+ export declare enum CouponSortFields {
226
+ BillingId = "billingId",
227
+ CreatedAt = "createdAt",
228
+ Description = "description",
229
+ EnvironmentId = "environmentId",
230
+ Id = "id",
231
+ Name = "name",
232
+ RefId = "refId",
233
+ Status = "status",
234
+ Type = "type",
235
+ UpdatedAt = "updatedAt"
236
+ }
237
+ /** The status of the coupon */
238
+ export declare enum CouponStatus {
239
+ Active = "ACTIVE",
240
+ Archived = "ARCHIVED"
241
+ }
242
+ export declare type CouponStatusFilterComparison = {
243
+ eq?: InputMaybe<CouponStatus>;
244
+ gt?: InputMaybe<CouponStatus>;
245
+ gte?: InputMaybe<CouponStatus>;
246
+ iLike?: InputMaybe<CouponStatus>;
247
+ in?: InputMaybe<Array<CouponStatus>>;
248
+ is?: InputMaybe<Scalars['Boolean']>;
249
+ isNot?: InputMaybe<Scalars['Boolean']>;
250
+ like?: InputMaybe<CouponStatus>;
251
+ lt?: InputMaybe<CouponStatus>;
252
+ lte?: InputMaybe<CouponStatus>;
253
+ neq?: InputMaybe<CouponStatus>;
254
+ notILike?: InputMaybe<CouponStatus>;
255
+ notIn?: InputMaybe<Array<CouponStatus>>;
256
+ notLike?: InputMaybe<CouponStatus>;
257
+ };
258
+ /** The type of the coupon */
259
+ export declare enum CouponType {
260
+ Fixed = "FIXED",
261
+ Percentage = "PERCENTAGE"
262
+ }
263
+ export declare type CouponTypeFilterComparison = {
264
+ eq?: InputMaybe<CouponType>;
265
+ gt?: InputMaybe<CouponType>;
266
+ gte?: InputMaybe<CouponType>;
267
+ iLike?: InputMaybe<CouponType>;
268
+ in?: InputMaybe<Array<CouponType>>;
269
+ is?: InputMaybe<Scalars['Boolean']>;
270
+ isNot?: InputMaybe<Scalars['Boolean']>;
271
+ like?: InputMaybe<CouponType>;
272
+ lt?: InputMaybe<CouponType>;
273
+ lte?: InputMaybe<CouponType>;
274
+ neq?: InputMaybe<CouponType>;
275
+ notILike?: InputMaybe<CouponType>;
276
+ notIn?: InputMaybe<Array<CouponType>>;
277
+ notLike?: InputMaybe<CouponType>;
278
+ };
279
+ export declare type CreateCouponInput = {
280
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
281
+ description?: InputMaybe<Scalars['String']>;
282
+ discountValue: Scalars['Float'];
283
+ environmentId: Scalars['String'];
284
+ name: Scalars['String'];
285
+ refId: Scalars['String'];
286
+ type: CouponType;
179
287
  };
180
288
  export declare type CreateEnvironment = {
181
289
  createdAt?: InputMaybe<Scalars['DateTime']>;
@@ -297,8 +405,10 @@ export declare type CustomerFilterPromotionalEntitlementFilter = {
297
405
  updatedAt?: InputMaybe<DateFieldComparison>;
298
406
  };
299
407
  export declare type CustomerInput = {
408
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
300
409
  billingId?: InputMaybe<Scalars['String']>;
301
410
  billingInformation?: InputMaybe<CustomerBillingInfo>;
411
+ couponRefId?: InputMaybe<Scalars['String']>;
302
412
  crmId?: InputMaybe<Scalars['String']>;
303
413
  email?: InputMaybe<Scalars['String']>;
304
414
  environmentId?: InputMaybe<Scalars['String']>;
@@ -498,6 +608,10 @@ export declare enum EntitlementResetPeriod {
498
608
  Month = "MONTH",
499
609
  Week = "WEEK"
500
610
  }
611
+ export declare enum EntitySelectionMode {
612
+ BlackList = "BLACK_LIST",
613
+ WhiteList = "WHITE_LIST"
614
+ }
501
615
  export declare type EnvironmentFilter = {
502
616
  and?: InputMaybe<Array<EnvironmentFilter>>;
503
617
  createdAt?: InputMaybe<DateFieldComparison>;
@@ -519,11 +633,15 @@ export declare enum EnvironmentSortFields {
519
633
  }
520
634
  /** error codes */
521
635
  export declare enum ErrorCode {
636
+ AddonHasToHavePriceError = "AddonHasToHavePriceError",
522
637
  AddonNotFound = "AddonNotFound",
638
+ ArchivedCouponCantBeApplied = "ArchivedCouponCantBeApplied",
523
639
  BadUserInput = "BadUserInput",
524
640
  BillingPeriodMissingError = "BillingPeriodMissingError",
525
641
  CheckoutIsNotSupported = "CheckoutIsNotSupported",
642
+ CouponNotFound = "CouponNotFound",
526
643
  CustomerHasNoPaymentMethod = "CustomerHasNoPaymentMethod",
644
+ CustomerNoBillingId = "CustomerNoBillingId",
527
645
  CustomerNotFound = "CustomerNotFound",
528
646
  DraftPlanCantBeArchived = "DraftPlanCantBeArchived",
529
647
  DuplicatedEntityNotAllowed = "DuplicatedEntityNotAllowed",
@@ -532,12 +650,16 @@ export declare enum ErrorCode {
532
650
  FailedToImportCustomer = "FailedToImportCustomer",
533
651
  FeatureNotFound = "FeatureNotFound",
534
652
  IdentityForbidden = "IdentityForbidden",
653
+ ImportAlreadyInProgress = "ImportAlreadyInProgress",
654
+ InitStripePaymentMethodError = "InitStripePaymentMethodError",
655
+ IntegrationNotFound = "IntegrationNotFound",
535
656
  IntegrityViolation = "IntegrityViolation",
536
657
  InvalidAddressError = "InvalidAddressError",
537
658
  InvalidArgumentError = "InvalidArgumentError",
538
659
  InvalidCancellationDate = "InvalidCancellationDate",
539
660
  InvalidEntitlementResetPeriod = "InvalidEntitlementResetPeriod",
540
661
  InvalidMemberDelete = "InvalidMemberDelete",
662
+ InvalidQuantity = "InvalidQuantity",
541
663
  InvalidSubscriptionStatus = "InvalidSubscriptionStatus",
542
664
  InvalidUsageValueForIncrementalFeatureError = "InvalidUsageValueForIncrementalFeatureError",
543
665
  MemberInvitationError = "MemberInvitationError",
@@ -552,7 +674,11 @@ export declare enum ErrorCode {
552
674
  PlansCircularDependencyError = "PlansCircularDependencyError",
553
675
  PriceNotFound = "PriceNotFound",
554
676
  RateLimitExceeded = "RateLimitExceeded",
677
+ ResyncAlreadyInProgress = "ResyncAlreadyInProgress",
678
+ SelectedBillingModelDoesntMatchImportedItemError = "SelectedBillingModelDoesntMatchImportedItemError",
679
+ StripeCustomerIsDeleted = "StripeCustomerIsDeleted",
555
680
  SubscriptionAlreadyCanceledOrExpired = "SubscriptionAlreadyCanceledOrExpired",
681
+ SubscriptionMustHaveSinglePlanError = "SubscriptionMustHaveSinglePlanError",
556
682
  SubscriptionNotFound = "SubscriptionNotFound",
557
683
  TrialMinDateError = "TrialMinDateError",
558
684
  TrialMustBeCancelledImmediately = "TrialMustBeCancelledImmediately",
@@ -569,6 +695,9 @@ export declare enum EventLogType {
569
695
  AddonCreated = "ADDON_CREATED",
570
696
  AddonDeleted = "ADDON_DELETED",
571
697
  AddonUpdated = "ADDON_UPDATED",
698
+ CouponArchived = "COUPON_ARCHIVED",
699
+ CouponCreated = "COUPON_CREATED",
700
+ CouponUpdated = "COUPON_UPDATED",
572
701
  CustomerCreated = "CUSTOMER_CREATED",
573
702
  CustomerDeleted = "CUSTOMER_DELETED",
574
703
  CustomerUpdated = "CUSTOMER_UPDATED",
@@ -579,6 +708,8 @@ export declare enum EventLogType {
579
708
  FeatureCreated = "FEATURE_CREATED",
580
709
  FeatureDeleted = "FEATURE_DELETED",
581
710
  FeatureUpdated = "FEATURE_UPDATED",
711
+ ImportIntegrationCatalogTriggered = "IMPORT_INTEGRATION_CATALOG_TRIGGERED",
712
+ ImportIntegrationCustomersTriggered = "IMPORT_INTEGRATION_CUSTOMERS_TRIGGERED",
582
713
  MeasurementReported = "MEASUREMENT_REPORTED",
583
714
  PackagePublished = "PACKAGE_PUBLISHED",
584
715
  PlanCreated = "PLAN_CREATED",
@@ -588,6 +719,7 @@ export declare enum EventLogType {
588
719
  PromotionalEntitlementGranted = "PROMOTIONAL_ENTITLEMENT_GRANTED",
589
720
  PromotionalEntitlementRevoked = "PROMOTIONAL_ENTITLEMENT_REVOKED",
590
721
  PromotionalEntitlementUpdated = "PROMOTIONAL_ENTITLEMENT_UPDATED",
722
+ ResyncIntegrationTriggered = "RESYNC_INTEGRATION_TRIGGERED",
591
723
  SubscriptionCanceled = "SUBSCRIPTION_CANCELED",
592
724
  SubscriptionCreated = "SUBSCRIPTION_CREATED",
593
725
  SubscriptionExpired = "SUBSCRIPTION_EXPIRED",
@@ -595,7 +727,8 @@ export declare enum EventLogType {
595
727
  SubscriptionTrialEndsSoon = "SUBSCRIPTION_TRIAL_ENDS_SOON",
596
728
  SubscriptionTrialExpired = "SUBSCRIPTION_TRIAL_EXPIRED",
597
729
  SubscriptionTrialStarted = "SUBSCRIPTION_TRIAL_STARTED",
598
- SubscriptionUpdated = "SUBSCRIPTION_UPDATED"
730
+ SubscriptionUpdated = "SUBSCRIPTION_UPDATED",
731
+ SubscriptionUsageUpdated = "SUBSCRIPTION_USAGE_UPDATED"
599
732
  }
600
733
  export declare type FeatureFilter = {
601
734
  and?: InputMaybe<Array<FeatureFilter>>;
@@ -750,8 +883,53 @@ export declare type ImportCustomerInput = {
750
883
  name?: InputMaybe<Scalars['String']>;
751
884
  refId: Scalars['String'];
752
885
  };
886
+ export declare type ImportIntegrationCatalogInput = {
887
+ billingModel?: InputMaybe<BillingModel>;
888
+ entitySelectionMode: EntitySelectionMode;
889
+ environmentId: Scalars['String'];
890
+ featureUnitName?: InputMaybe<Scalars['String']>;
891
+ featureUnitPluralName?: InputMaybe<Scalars['String']>;
892
+ plansSelectionBlacklist?: InputMaybe<Array<Scalars['String']>>;
893
+ plansSelectionWhitelist?: InputMaybe<Array<Scalars['String']>>;
894
+ productId: Scalars['String'];
895
+ selectedAddonBillingIds: Array<Scalars['String']>;
896
+ vendorIdentifier: VendorIdentifier;
897
+ };
898
+ export declare type ImportIntegrationCustomersInput = {
899
+ customersSelectionBlacklist?: InputMaybe<Array<Scalars['String']>>;
900
+ customersSelectionWhitelist?: InputMaybe<Array<Scalars['String']>>;
901
+ entitySelectionMode: EntitySelectionMode;
902
+ environmentId: Scalars['String'];
903
+ productId: Scalars['String'];
904
+ vendorIdentifier: VendorIdentifier;
905
+ };
906
+ export declare type ImportIntegrationTaskFilter = {
907
+ and?: InputMaybe<Array<ImportIntegrationTaskFilter>>;
908
+ createdAt?: InputMaybe<DateFieldComparison>;
909
+ environmentId?: InputMaybe<StringFieldComparison>;
910
+ id?: InputMaybe<StringFieldComparison>;
911
+ or?: InputMaybe<Array<ImportIntegrationTaskFilter>>;
912
+ status?: InputMaybe<TaskStatusFilterComparison>;
913
+ taskType?: InputMaybe<TaskTypeFilterComparison>;
914
+ };
915
+ export declare type ImportIntegrationTaskSort = {
916
+ direction: SortDirection;
917
+ field: ImportIntegrationTaskSortFields;
918
+ nulls?: InputMaybe<SortNulls>;
919
+ };
920
+ export declare enum ImportIntegrationTaskSortFields {
921
+ CreatedAt = "createdAt",
922
+ EnvironmentId = "environmentId",
923
+ Id = "id",
924
+ Status = "status",
925
+ TaskType = "taskType"
926
+ }
927
+ export declare type InitAddStripeCustomerPaymentMethodInput = {
928
+ customerRefId: Scalars['String'];
929
+ environmentId?: InputMaybe<Scalars['String']>;
930
+ };
753
931
  export declare type InitiateCheckoutInput = {
754
- addons?: InputMaybe<Array<CheckoutAddonInput>>;
932
+ addons?: InputMaybe<Array<SubscriptionAddonInput>>;
755
933
  billingPeriod: BillingPeriod;
756
934
  cancelUrl: Scalars['String'];
757
935
  customerId: Scalars['String'];
@@ -1010,7 +1188,13 @@ export declare type PackageStatusFilterComparison = {
1010
1188
  notIn?: InputMaybe<Array<PackageStatus>>;
1011
1189
  notLike?: InputMaybe<PackageStatus>;
1012
1190
  };
1191
+ /** Type of a payment method */
1192
+ export declare enum PaymentMethodType {
1193
+ Bank = "BANK",
1194
+ Card = "CARD"
1195
+ }
1013
1196
  export declare type PlanCreateInput = {
1197
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
1014
1198
  billingId?: InputMaybe<Scalars['String']>;
1015
1199
  description?: InputMaybe<Scalars['String']>;
1016
1200
  displayName: Scalars['String'];
@@ -1089,6 +1273,7 @@ export declare enum PlanSortFields {
1089
1273
  VersionNumber = "versionNumber"
1090
1274
  }
1091
1275
  export declare type PlanUpdateInput = {
1276
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
1092
1277
  billingId?: InputMaybe<Scalars['String']>;
1093
1278
  defaultTrialConfig?: InputMaybe<DefaultTrialConfigInputDto>;
1094
1279
  description?: InputMaybe<Scalars['String']>;
@@ -1166,6 +1351,7 @@ export declare type PricingTypeFilterComparison = {
1166
1351
  notLike?: InputMaybe<PricingType>;
1167
1352
  };
1168
1353
  export declare type ProductCreateInput = {
1354
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
1169
1355
  description?: InputMaybe<Scalars['String']>;
1170
1356
  displayName?: InputMaybe<Scalars['String']>;
1171
1357
  environmentId: Scalars['String'];
@@ -1204,6 +1390,7 @@ export declare enum ProductSortFields {
1204
1390
  UpdatedAt = "updatedAt"
1205
1391
  }
1206
1392
  export declare type ProductUpdateInput = {
1393
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
1207
1394
  description?: InputMaybe<Scalars['String']>;
1208
1395
  displayName?: InputMaybe<Scalars['String']>;
1209
1396
  productSettings?: InputMaybe<ProductSettingsInput>;
@@ -1302,6 +1489,16 @@ export declare type RemoveCompatibleAddonsFromPlanInput = {
1302
1489
  /** The ids of the relations. */
1303
1490
  relationIds: Array<Scalars['String']>;
1304
1491
  };
1492
+ export declare type RemoveCouponFromCustomerInput = {
1493
+ /** The id of the record. */
1494
+ id: Scalars['String'];
1495
+ /** The id of relation. */
1496
+ relationId: Scalars['String'];
1497
+ };
1498
+ export declare type ResyncIntegrationInput = {
1499
+ environmentId: Scalars['String'];
1500
+ vendorIdentifier: VendorIdentifier;
1501
+ };
1305
1502
  export declare type SetBasePlanOnPlanInput = {
1306
1503
  /** The id of the record. */
1307
1504
  id: Scalars['String'];
@@ -1314,6 +1511,12 @@ export declare type SetCompatibleAddonsOnPlanInput = {
1314
1511
  /** The ids of the relations. */
1315
1512
  relationIds: Array<Scalars['String']>;
1316
1513
  };
1514
+ export declare type SetCouponOnCustomerInput = {
1515
+ /** The id of the record. */
1516
+ id: Scalars['String'];
1517
+ /** The id of relation. */
1518
+ relationId: Scalars['String'];
1519
+ };
1317
1520
  /** Sort Directions */
1318
1521
  export declare enum SortDirection {
1319
1522
  Asc = "ASC",
@@ -1345,6 +1548,20 @@ export declare type StripeCredentialsInput = {
1345
1548
  authorizationCode: Scalars['String'];
1346
1549
  isTestMode: Scalars['Boolean'];
1347
1550
  };
1551
+ export declare type StripeCustomerSearchInput = {
1552
+ customerName?: InputMaybe<Scalars['String']>;
1553
+ environmentId: Scalars['String'];
1554
+ nextPage?: InputMaybe<Scalars['String']>;
1555
+ };
1556
+ export declare type StripeProductSearchInput = {
1557
+ environmentId: Scalars['String'];
1558
+ nextPage?: InputMaybe<Scalars['String']>;
1559
+ productName?: InputMaybe<Scalars['String']>;
1560
+ };
1561
+ export declare type StripeSubscriptionSearchInput = {
1562
+ environmentId: Scalars['String'];
1563
+ nextPage?: InputMaybe<Scalars['String']>;
1564
+ };
1348
1565
  export declare type SubscriptionAddonFilter = {
1349
1566
  addon?: InputMaybe<SubscriptionAddonFilterAddonFilter>;
1350
1567
  and?: InputMaybe<Array<SubscriptionAddonFilter>>;
@@ -1465,7 +1682,9 @@ export declare enum SubscriptionEndSetup {
1465
1682
  DowngradeToFree = "DOWNGRADE_TO_FREE"
1466
1683
  }
1467
1684
  export declare type SubscriptionInput = {
1685
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
1468
1686
  addons?: InputMaybe<Array<SubscriptionAddonInput>>;
1687
+ awaitPaymentConfirmation?: InputMaybe<Scalars['Boolean']>;
1469
1688
  billingId?: InputMaybe<Scalars['String']>;
1470
1689
  billingPeriod?: InputMaybe<BillingPeriod>;
1471
1690
  crmId?: InputMaybe<Scalars['String']>;
@@ -1578,11 +1797,18 @@ export declare type SubscriptionStatusFilterComparison = {
1578
1797
  notIn?: InputMaybe<Array<SubscriptionStatus>>;
1579
1798
  notLike?: InputMaybe<SubscriptionStatus>;
1580
1799
  };
1800
+ /** Status of the integration sync */
1801
+ export declare enum SyncStatus {
1802
+ Error = "ERROR",
1803
+ NoSyncRequired = "NO_SYNC_REQUIRED",
1804
+ Pending = "PENDING",
1805
+ Success = "SUCCESS"
1806
+ }
1581
1807
  export declare enum TaskStatus {
1582
1808
  Completed = "COMPLETED",
1583
1809
  Failed = "FAILED",
1584
1810
  InProgress = "IN_PROGRESS",
1585
- PartiallyCompleted = "PARTIALLY_COMPLETED",
1811
+ PartiallyFailed = "PARTIALLY_FAILED",
1586
1812
  Pending = "PENDING"
1587
1813
  }
1588
1814
  export declare type TaskStatusFilterComparison = {
@@ -1602,6 +1828,9 @@ export declare type TaskStatusFilterComparison = {
1602
1828
  notLike?: InputMaybe<TaskStatus>;
1603
1829
  };
1604
1830
  export declare enum TaskType {
1831
+ ImportIntegrationCatalog = "IMPORT_INTEGRATION_CATALOG",
1832
+ ImportIntegrationCustomers = "IMPORT_INTEGRATION_CUSTOMERS",
1833
+ ResyncIntegration = "RESYNC_INTEGRATION",
1605
1834
  SubscriptionMigration = "SUBSCRIPTION_MIGRATION"
1606
1835
  }
1607
1836
  export declare type TaskTypeFilterComparison = {
@@ -1633,9 +1862,23 @@ export declare enum TrialPeriodUnits {
1633
1862
  Day = "DAY",
1634
1863
  Month = "MONTH"
1635
1864
  }
1865
+ export declare type UpdateAccountInput = {
1866
+ displayName: Scalars['String'];
1867
+ id: Scalars['String'];
1868
+ timezone?: InputMaybe<Scalars['String']>;
1869
+ };
1870
+ export declare type UpdateCouponInput = {
1871
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
1872
+ description?: InputMaybe<Scalars['String']>;
1873
+ environmentId?: InputMaybe<Scalars['String']>;
1874
+ name: Scalars['String'];
1875
+ refId: Scalars['String'];
1876
+ };
1636
1877
  export declare type UpdateCustomerInput = {
1878
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
1637
1879
  billingId?: InputMaybe<Scalars['String']>;
1638
1880
  billingInformation?: InputMaybe<CustomerBillingInfo>;
1881
+ couponRefId?: InputMaybe<Scalars['String']>;
1639
1882
  crmId?: InputMaybe<Scalars['String']>;
1640
1883
  email?: InputMaybe<Scalars['String']>;
1641
1884
  environmentId?: InputMaybe<Scalars['String']>;
@@ -1720,6 +1963,11 @@ export declare type UpdateOnePromotionalEntitlementInput = {
1720
1963
  /** The update to apply. */
1721
1964
  update: PromotionalEntitlementUpdateInput;
1722
1965
  };
1966
+ export declare type UpdateSubscriptionInput = {
1967
+ additionalMetaData?: InputMaybe<Scalars['JSON']>;
1968
+ environmentId?: InputMaybe<Scalars['String']>;
1969
+ refId: Scalars['String'];
1970
+ };
1723
1971
  export declare type UsageHistoryInput = {
1724
1972
  customerRefId: Scalars['String'];
1725
1973
  endDate?: InputMaybe<Scalars['DateTime']>;
@@ -1825,6 +2073,60 @@ export declare type ZuoraCredentialsInput = {
1825
2073
  clientId: Scalars['String'];
1826
2074
  clientSecret: Scalars['String'];
1827
2075
  };
2076
+ export declare type CouponFragment = {
2077
+ __typename?: 'Coupon';
2078
+ id: string;
2079
+ discountValue: number;
2080
+ type: CouponType;
2081
+ additionalMetaData?: any | null | undefined;
2082
+ refId: string;
2083
+ name: string;
2084
+ description?: string | null | undefined;
2085
+ createdAt: any;
2086
+ updatedAt: any;
2087
+ billingId?: string | null | undefined;
2088
+ billingLinkUrl?: string | null | undefined;
2089
+ status: CouponStatus;
2090
+ syncStates?: Array<{
2091
+ __typename?: 'SyncState';
2092
+ vendorIdentifier: VendorIdentifier;
2093
+ status: SyncStatus;
2094
+ }> | null | undefined;
2095
+ customers?: Array<{
2096
+ __typename?: 'Customer';
2097
+ id: string;
2098
+ }> | null | undefined;
2099
+ };
2100
+ export declare type FetchCouponsQueryVariables = Exact<{
2101
+ filter?: Maybe<CouponFilter>;
2102
+ sorting?: Maybe<Array<CouponSort> | CouponSort>;
2103
+ paging?: Maybe<CursorPaging>;
2104
+ }>;
2105
+ export declare type FetchCouponsQuery = {
2106
+ __typename?: 'Query';
2107
+ coupons: {
2108
+ __typename?: 'CouponConnection';
2109
+ edges: Array<{
2110
+ __typename?: 'CouponEdge';
2111
+ node: {
2112
+ __typename?: 'Coupon';
2113
+ } & CouponFragment;
2114
+ }>;
2115
+ };
2116
+ };
2117
+ export declare type TotalPriceFragment = {
2118
+ __typename?: 'CustomerSubscriptionTotalPrice';
2119
+ subTotal: {
2120
+ __typename?: 'Money';
2121
+ amount: number;
2122
+ currency: Currency;
2123
+ };
2124
+ total: {
2125
+ __typename?: 'Money';
2126
+ amount: number;
2127
+ currency: Currency;
2128
+ };
2129
+ };
1828
2130
  export declare type SubscriptionFragment = {
1829
2131
  __typename?: 'CustomerSubscription';
1830
2132
  id: string;
@@ -1836,6 +2138,7 @@ export declare type SubscriptionFragment = {
1836
2138
  status: SubscriptionStatus;
1837
2139
  refId: string;
1838
2140
  currentBillingPeriodEnd?: any | null | undefined;
2141
+ additionalMetaData?: any | null | undefined;
1839
2142
  pricingType: PricingType;
1840
2143
  prices?: Array<{
1841
2144
  __typename?: 'SubscriptionPrice';
@@ -1844,12 +2147,16 @@ export declare type SubscriptionFragment = {
1844
2147
  __typename?: 'Price';
1845
2148
  } & PriceFragment;
1846
2149
  }> | null | undefined;
2150
+ totalPrice?: ({
2151
+ __typename?: 'CustomerSubscriptionTotalPrice';
2152
+ } & TotalPriceFragment) | null | undefined;
1847
2153
  plan: {
1848
2154
  __typename?: 'Plan';
1849
2155
  id: string;
1850
2156
  refId: string;
1851
2157
  displayName: string;
1852
2158
  description?: string | null | undefined;
2159
+ additionalMetaData?: any | null | undefined;
1853
2160
  product: {
1854
2161
  __typename?: 'Product';
1855
2162
  refId: string;
@@ -1905,6 +2212,7 @@ export declare type SubscriptionFragment = {
1905
2212
  refId: string;
1906
2213
  displayName: string;
1907
2214
  description?: string | null | undefined;
2215
+ additionalMetaData?: any | null | undefined;
1908
2216
  entitlements?: Array<{
1909
2217
  __typename?: 'PackageEntitlement';
1910
2218
  usageLimit?: number | null | undefined;
@@ -1953,6 +2261,14 @@ export declare type CustomerFragment = {
1953
2261
  updatedAt: any;
1954
2262
  hasPaymentMethod: boolean;
1955
2263
  refId: string;
2264
+ additionalMetaData?: any | null | undefined;
2265
+ trialedPlans?: Array<{
2266
+ __typename?: 'TrialedPlan';
2267
+ productId?: string | null | undefined;
2268
+ productRefId?: string | null | undefined;
2269
+ planRefId?: string | null | undefined;
2270
+ planId?: string | null | undefined;
2271
+ }> | null | undefined;
1956
2272
  promotionalEntitlements: Array<{
1957
2273
  __typename?: 'PromotionalEntitlement';
1958
2274
  } & PromotionalEntitlementFragment>;
@@ -2058,6 +2374,7 @@ export declare type AddonFragment = {
2058
2374
  refId: string;
2059
2375
  displayName: string;
2060
2376
  description?: string | null | undefined;
2377
+ additionalMetaData?: any | null | undefined;
2061
2378
  pricingType?: PricingType | null | undefined;
2062
2379
  entitlements?: Array<{
2063
2380
  __typename?: 'PackageEntitlement';
@@ -2072,12 +2389,14 @@ export declare type PlanFragment = {
2072
2389
  refId: string;
2073
2390
  description?: string | null | undefined;
2074
2391
  displayName: string;
2392
+ additionalMetaData?: any | null | undefined;
2075
2393
  pricingType?: PricingType | null | undefined;
2076
2394
  product: {
2077
2395
  __typename?: 'Product';
2078
2396
  refId: string;
2079
2397
  displayName?: string | null | undefined;
2080
2398
  description?: string | null | undefined;
2399
+ additionalMetaData?: any | null | undefined;
2081
2400
  };
2082
2401
  basePlan?: {
2083
2402
  __typename?: 'Plan';
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Customer, Entitlement, Plan, BooleanEntitlement, NumericEntitlement, MeteredEntitlement, GetBooleanEntitlement, GetNumericEntitlement, GetMeteredEntitlement, GetPaywall } from './models';
1
+ import { Customer, Entitlement, Plan, BooleanEntitlement, NumericEntitlement, MeteredEntitlement, GetBooleanEntitlement, GetNumericEntitlement, GetMeteredEntitlement, GetPaywall, Coupon } from './models';
2
2
  import { ClientConfiguration } from './configuration';
3
3
  export interface StiggClient {
4
4
  getBooleanEntitlement: (params: GetBooleanEntitlement) => BooleanEntitlement;
@@ -60,6 +60,12 @@ export declare class Stigg implements StiggClient {
60
60
  * @returns {Promise<Plan[]>}
61
61
  */
62
62
  getPaywall({ productId }?: GetPaywall): Promise<Plan[]>;
63
+ /**
64
+ * Get a list of coupons
65
+ *
66
+ * @returns {Promise<Coupon[]>}
67
+ */
68
+ getCoupons(): Promise<Coupon[]>;
63
69
  /**
64
70
  * Get a customer
65
71
  *