@stigg/api-client-js 0.2.0 → 0.3.1

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,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubscriptionCancelReason = exports.SubscriptionAddonSortFields = exports.SourceType = exports.SortNulls = exports.SortDirection = exports.PublishMigrationType = exports.PromotionalEntitlementStatus = exports.PromotionalEntitlementSortFields = exports.PromotionalEntitlementPeriod = exports.ProductSortFields = exports.PricingType = exports.PriceSortFields = exports.PlanSortFields = exports.PaymentMethodType = exports.PackageStatus = exports.PackageEntitlementSortFields = exports.PackageDtoSortFields = exports.MonthlyAccordingTo = exports.MeterType = exports.MemberStatus = exports.MemberSortFields = exports.IntegrationSortFields = exports.ImportIntegrationTaskSortFields = exports.HookStatus = exports.HookSortFields = exports.FeatureType = exports.FeatureStatus = exports.FeatureSortFields = exports.ExperimentStatus = exports.ExperimentSortFields = exports.ExperimentGroup = exports.EventLogType = exports.ErrorCode = exports.EnvironmentSortFields = exports.EntitySelectionMode = exports.EntitlementResetPeriod = exports.CustomerSubscriptionSortFields = exports.CustomerSortFields = exports.Currency = exports.CouponType = exports.CouponStatus = exports.CouponSortFields = exports.ChangeType = exports.BillingPeriod = exports.BillingModel = exports.BillingAnchor = exports.ApiKeyType = exports.ApiKeySortFields = exports.AddonSortFields = exports.AccessDeniedReason = void 0;
4
- exports.getSdk = exports.GetCouponsDocument = exports.GetCustomerByIdDocument = exports.InitiateCheckoutDocument = exports.CancelSubscriptionDocument = exports.CreateSubscriptionDocument = exports.UpdateSubscriptionDocument = exports.UpdateCustomerDocument = exports.ImportCustomerDocument = exports.ProvisionCustomerDocument = exports.CreateCustomerDocument = exports.PaywallAddonFragmentDoc = exports.PaywallPlanFragmentDoc = exports.PaywallPriceFragmentDoc = exports.PaywallPackageEntitlementFragmentDoc = exports.SlimSubscriptionFragmentDoc = exports.CustomerFragmentDoc = exports.CouponFragmentDoc = exports.PromotionalEntitlementFragmentDoc = exports.SubscriptionFragmentDoc = exports.PlanFragmentDoc = exports.AddonFragmentDoc = exports.PackageEntitlementFragmentDoc = exports.TotalPriceFragmentDoc = exports.PriceFragmentDoc = exports.FeatureFragmentDoc = exports.WeeklyAccordingTo = exports.VendorIdentifier = exports.UsageMeasurementSortFields = exports.TrialPeriodUnits = exports.TaskType = exports.TaskStatus = exports.SyncStatus = exports.SubscriptionStrategyDecision = exports.SubscriptionStatus = exports.SubscriptionStartSetup = exports.SubscriptionPriceSortFields = exports.SubscriptionMigrationTaskSortFields = exports.SubscriptionEndSetup = exports.SubscriptionCancellationTime = void 0;
3
+ exports.PublishMigrationType = exports.ProvisionSubscriptionStatus = exports.ProrationBehavior = exports.PromotionalEntitlementStatus = exports.PromotionalEntitlementSortFields = exports.PromotionalEntitlementPeriod = exports.ProductSortFields = exports.PricingType = exports.PriceSortFields = exports.PlanSortFields = exports.PaymentMethodType = exports.PackageStatus = exports.PackageEntitlementSortFields = exports.PackageDtoSortFields = exports.MonthlyAccordingTo = exports.MeterType = exports.MemberStatus = exports.MemberSortFields = exports.IntegrationSortFields = exports.ImportIntegrationTaskSortFields = exports.HookStatus = exports.HookSortFields = exports.FontWeight = exports.FeatureType = exports.FeatureStatus = exports.FeatureSortFields = exports.ExperimentStatus = exports.ExperimentSortFields = exports.EventLogType = exports.ErrorCode = exports.EnvironmentSortFields = exports.EnvironmentProvisionStatus = exports.EntitySelectionMode = exports.EntitlementResetPeriod = exports.CustomerSubscriptionSortFields = exports.CustomerSortFields = exports.Currency = exports.CouponType = exports.CouponStatus = exports.CouponSortFields = exports.ChangeType = exports.BillingPeriod = exports.BillingModel = exports.BillingAnchor = exports.ApiKeyType = exports.ApiKeySortFields = exports.Alignment = exports.AddonSortFields = exports.AccountStatus = exports.AccessDeniedReason = void 0;
4
+ exports.ImportCustomerDocument = exports.ProvisionCustomerDocument = exports.PaywallConfigurationFragmentDoc = exports.LayoutConfigurationFragmentDoc = exports.TypographyConfigurationFragmentDoc = exports.FontVariantFragmentDoc = exports.PaywallPlanFragmentDoc = exports.PaywallAddonFragmentDoc = exports.PaywallPackageEntitlementFragmentDoc = exports.EntitlementFragmentDoc = exports.FeatureFragmentDoc = exports.ResetPeriodConfigurationFragmentDoc = exports.WeeklyResetPeriodConfigFragmentDoc = exports.MonthlyResetPeriodConfigFragmentDoc = exports.SubscriptionPreviewFragmentDoc = exports.CustomerFragmentDoc = exports.SubscriptionFragmentDoc = exports.SubscriptionScheduledUpdateDataFragmentDoc = exports.PlanFragmentDoc = exports.AddonFragmentDoc = exports.PackageEntitlementFragmentDoc = exports.PromotionalEntitlementFragmentDoc = exports.CouponFragmentDoc = exports.SlimSubscriptionFragmentDoc = exports.TotalPriceFragmentDoc = exports.PriceFragmentDoc = exports.ExperimentGroupType = exports.WidgetType = exports.WeeklyAccordingTo = exports.VendorIdentifier = exports.UsageMeasurementSortFields = exports.TrialPeriodUnits = exports.TaskType = exports.TaskStatus = exports.SyncStatus = exports.SubscriptionStatus = exports.SubscriptionStartSetup = exports.SubscriptionScheduleType = exports.SubscriptionScheduleStatus = exports.SubscriptionPriceSortFields = exports.SubscriptionMigrationTaskSortFields = exports.SubscriptionEntitlementSortFields = exports.SubscriptionEndSetup = exports.SubscriptionDecisionStrategy = exports.SubscriptionCancellationTime = exports.SubscriptionCancelReason = exports.SubscriptionAddonSortFields = exports.SourceType = exports.SortNulls = exports.SortDirection = void 0;
5
+ exports.getSdk = exports.GetEntitlementDocument = exports.GetEntitlementsDocument = exports.GetPaywallDocument = exports.GetCouponsDocument = exports.GetCustomerByIdDocument = exports.ReportUsageDocument = exports.EstimateSubscriptionUpdateDocument = exports.EstimateSubscriptionDocument = exports.InitiateCheckoutDocument = exports.CancelSubscriptionDocument = exports.UpdateSubscriptionDocument = exports.ProvisionSubscriptionDocument = exports.UpdateCustomerDocument = void 0;
5
6
  const graphql_tag_1 = require("graphql-tag");
6
7
  /** DenyReason of get access policy */
7
8
  var AccessDeniedReason;
@@ -13,6 +14,11 @@ var AccessDeniedReason;
13
14
  AccessDeniedReason["RequestedUsageExceedingLimit"] = "RequestedUsageExceedingLimit";
14
15
  AccessDeniedReason["Unknown"] = "Unknown";
15
16
  })(AccessDeniedReason = exports.AccessDeniedReason || (exports.AccessDeniedReason = {}));
17
+ var AccountStatus;
18
+ (function (AccountStatus) {
19
+ AccountStatus["Active"] = "ACTIVE";
20
+ AccountStatus["Blocked"] = "BLOCKED";
21
+ })(AccountStatus = exports.AccountStatus || (exports.AccountStatus = {}));
16
22
  var AddonSortFields;
17
23
  (function (AddonSortFields) {
18
24
  AddonSortFields["BillingId"] = "billingId";
@@ -29,6 +35,13 @@ var AddonSortFields;
29
35
  AddonSortFields["UpdatedAt"] = "updatedAt";
30
36
  AddonSortFields["VersionNumber"] = "versionNumber";
31
37
  })(AddonSortFields = exports.AddonSortFields || (exports.AddonSortFields = {}));
38
+ /** Alignment */
39
+ var Alignment;
40
+ (function (Alignment) {
41
+ Alignment["Center"] = "CENTER";
42
+ Alignment["Left"] = "LEFT";
43
+ Alignment["Right"] = "RIGHT";
44
+ })(Alignment = exports.Alignment || (exports.Alignment = {}));
32
45
  var ApiKeySortFields;
33
46
  (function (ApiKeySortFields) {
34
47
  ApiKeySortFields["Id"] = "id";
@@ -61,6 +74,7 @@ var ChangeType;
61
74
  ChangeType["Added"] = "ADDED";
62
75
  ChangeType["Deleted"] = "DELETED";
63
76
  ChangeType["Modified"] = "MODIFIED";
77
+ ChangeType["Reordered"] = "REORDERED";
64
78
  })(ChangeType = exports.ChangeType || (exports.ChangeType = {}));
65
79
  var CouponSortFields;
66
80
  (function (CouponSortFields) {
@@ -90,7 +104,121 @@ var CouponType;
90
104
  /** Currency */
91
105
  var Currency;
92
106
  (function (Currency) {
107
+ Currency["Aed"] = "AED";
108
+ Currency["All"] = "ALL";
109
+ Currency["Amd"] = "AMD";
110
+ Currency["Ang"] = "ANG";
111
+ Currency["Aud"] = "AUD";
112
+ Currency["Awg"] = "AWG";
113
+ Currency["Azn"] = "AZN";
114
+ Currency["Bam"] = "BAM";
115
+ Currency["Bbd"] = "BBD";
116
+ Currency["Bdt"] = "BDT";
117
+ Currency["Bgn"] = "BGN";
118
+ Currency["Bif"] = "BIF";
119
+ Currency["Bmd"] = "BMD";
120
+ Currency["Bnd"] = "BND";
121
+ Currency["Bsd"] = "BSD";
122
+ Currency["Bwp"] = "BWP";
123
+ Currency["Byn"] = "BYN";
124
+ Currency["Bzd"] = "BZD";
125
+ Currency["Cad"] = "CAD";
126
+ Currency["Cdf"] = "CDF";
127
+ Currency["Chf"] = "CHF";
128
+ Currency["Clp"] = "CLP";
129
+ Currency["Cny"] = "CNY";
130
+ Currency["Czk"] = "CZK";
131
+ Currency["Djf"] = "DJF";
132
+ Currency["Dkk"] = "DKK";
133
+ Currency["Dop"] = "DOP";
134
+ Currency["Dzd"] = "DZD";
135
+ Currency["Egp"] = "EGP";
136
+ Currency["Etb"] = "ETB";
137
+ Currency["Eur"] = "EUR";
138
+ Currency["Fjd"] = "FJD";
139
+ Currency["Gbp"] = "GBP";
140
+ Currency["Gel"] = "GEL";
141
+ Currency["Gip"] = "GIP";
142
+ Currency["Gmd"] = "GMD";
143
+ Currency["Gnf"] = "GNF";
144
+ Currency["Gyd"] = "GYD";
145
+ Currency["Hkd"] = "HKD";
146
+ Currency["Hrk"] = "HRK";
147
+ Currency["Htg"] = "HTG";
148
+ Currency["Idr"] = "IDR";
149
+ Currency["Ils"] = "ILS";
150
+ Currency["Inr"] = "INR";
151
+ Currency["Isk"] = "ISK";
152
+ Currency["Jmd"] = "JMD";
153
+ Currency["Jpy"] = "JPY";
154
+ Currency["Kes"] = "KES";
155
+ Currency["Kgs"] = "KGS";
156
+ Currency["Khr"] = "KHR";
157
+ Currency["Kmf"] = "KMF";
158
+ Currency["Krw"] = "KRW";
159
+ Currency["Kyd"] = "KYD";
160
+ Currency["Kzt"] = "KZT";
161
+ Currency["Lbp"] = "LBP";
162
+ Currency["Lkr"] = "LKR";
163
+ Currency["Lrd"] = "LRD";
164
+ Currency["Lsl"] = "LSL";
165
+ Currency["Mad"] = "MAD";
166
+ Currency["Mdl"] = "MDL";
167
+ Currency["Mga"] = "MGA";
168
+ Currency["Mkd"] = "MKD";
169
+ Currency["Mmk"] = "MMK";
170
+ Currency["Mnt"] = "MNT";
171
+ Currency["Mop"] = "MOP";
172
+ Currency["Mro"] = "MRO";
173
+ Currency["Mvr"] = "MVR";
174
+ Currency["Mwk"] = "MWK";
175
+ Currency["Mxn"] = "MXN";
176
+ Currency["Myr"] = "MYR";
177
+ Currency["Mzn"] = "MZN";
178
+ Currency["Nad"] = "NAD";
179
+ Currency["Ngn"] = "NGN";
180
+ Currency["Nok"] = "NOK";
181
+ Currency["Npr"] = "NPR";
182
+ Currency["Nzd"] = "NZD";
183
+ Currency["Pgk"] = "PGK";
184
+ Currency["Php"] = "PHP";
185
+ Currency["Pkr"] = "PKR";
186
+ Currency["Pln"] = "PLN";
187
+ Currency["Pyg"] = "PYG";
188
+ Currency["Qar"] = "QAR";
189
+ Currency["Ron"] = "RON";
190
+ Currency["Rsd"] = "RSD";
191
+ Currency["Rub"] = "RUB";
192
+ Currency["Rwf"] = "RWF";
193
+ Currency["Sar"] = "SAR";
194
+ Currency["Sbd"] = "SBD";
195
+ Currency["Scr"] = "SCR";
196
+ Currency["Sek"] = "SEK";
197
+ Currency["Sgd"] = "SGD";
198
+ Currency["Sle"] = "SLE";
199
+ Currency["Sll"] = "SLL";
200
+ Currency["Sos"] = "SOS";
201
+ Currency["Szl"] = "SZL";
202
+ Currency["Thb"] = "THB";
203
+ Currency["Tjs"] = "TJS";
204
+ Currency["Top"] = "TOP";
205
+ Currency["Try"] = "TRY";
206
+ Currency["Ttd"] = "TTD";
207
+ Currency["Tzs"] = "TZS";
208
+ Currency["Uah"] = "UAH";
209
+ Currency["Ugx"] = "UGX";
93
210
  Currency["Usd"] = "USD";
211
+ Currency["Uzs"] = "UZS";
212
+ Currency["Vnd"] = "VND";
213
+ Currency["Vuv"] = "VUV";
214
+ Currency["Wst"] = "WST";
215
+ Currency["Xaf"] = "XAF";
216
+ Currency["Xcd"] = "XCD";
217
+ Currency["Xof"] = "XOF";
218
+ Currency["Xpf"] = "XPF";
219
+ Currency["Yer"] = "YER";
220
+ Currency["Zar"] = "ZAR";
221
+ Currency["Zmw"] = "ZMW";
94
222
  })(Currency = exports.Currency || (exports.Currency = {}));
95
223
  var CustomerSortFields;
96
224
  (function (CustomerSortFields) {
@@ -99,9 +227,9 @@ var CustomerSortFields;
99
227
  CustomerSortFields["CrmHubspotCompanyId"] = "crmHubspotCompanyId";
100
228
  CustomerSortFields["CrmHubspotCompanyUrl"] = "crmHubspotCompanyUrl";
101
229
  CustomerSortFields["CrmId"] = "crmId";
230
+ CustomerSortFields["CustomerId"] = "customerId";
102
231
  CustomerSortFields["Email"] = "email";
103
232
  CustomerSortFields["EnvironmentId"] = "environmentId";
104
- CustomerSortFields["ExperimentGroup"] = "experimentGroup";
105
233
  CustomerSortFields["Id"] = "id";
106
234
  CustomerSortFields["Name"] = "name";
107
235
  CustomerSortFields["RefId"] = "refId";
@@ -118,12 +246,13 @@ var CustomerSubscriptionSortFields;
118
246
  CustomerSubscriptionSortFields["EffectiveEndDate"] = "effectiveEndDate";
119
247
  CustomerSubscriptionSortFields["EndDate"] = "endDate";
120
248
  CustomerSubscriptionSortFields["EnvironmentId"] = "environmentId";
121
- CustomerSubscriptionSortFields["ExperimentGroup"] = "experimentGroup";
122
249
  CustomerSubscriptionSortFields["Id"] = "id";
250
+ CustomerSubscriptionSortFields["OldBillingId"] = "oldBillingId";
123
251
  CustomerSubscriptionSortFields["PricingType"] = "pricingType";
124
252
  CustomerSubscriptionSortFields["RefId"] = "refId";
125
253
  CustomerSubscriptionSortFields["StartDate"] = "startDate";
126
254
  CustomerSubscriptionSortFields["Status"] = "status";
255
+ CustomerSubscriptionSortFields["SubscriptionId"] = "subscriptionId";
127
256
  CustomerSubscriptionSortFields["TrialEndDate"] = "trialEndDate";
128
257
  })(CustomerSubscriptionSortFields = exports.CustomerSubscriptionSortFields || (exports.CustomerSubscriptionSortFields = {}));
129
258
  /** Entitlement reset period. */
@@ -139,6 +268,14 @@ var EntitySelectionMode;
139
268
  EntitySelectionMode["BlackList"] = "BLACK_LIST";
140
269
  EntitySelectionMode["WhiteList"] = "WHITE_LIST";
141
270
  })(EntitySelectionMode = exports.EntitySelectionMode || (exports.EntitySelectionMode = {}));
271
+ /** EnvironmentProvisionStatus. */
272
+ var EnvironmentProvisionStatus;
273
+ (function (EnvironmentProvisionStatus) {
274
+ EnvironmentProvisionStatus["Done"] = "DONE";
275
+ EnvironmentProvisionStatus["Failed"] = "FAILED";
276
+ EnvironmentProvisionStatus["InProgress"] = "IN_PROGRESS";
277
+ EnvironmentProvisionStatus["NotProvisioned"] = "NOT_PROVISIONED";
278
+ })(EnvironmentProvisionStatus = exports.EnvironmentProvisionStatus || (exports.EnvironmentProvisionStatus = {}));
142
279
  var EnvironmentSortFields;
143
280
  (function (EnvironmentSortFields) {
144
281
  EnvironmentSortFields["CreatedAt"] = "createdAt";
@@ -153,22 +290,31 @@ var ErrorCode;
153
290
  ErrorCode["AddonHasToHavePriceError"] = "AddonHasToHavePriceError";
154
291
  ErrorCode["AddonNotFound"] = "AddonNotFound";
155
292
  ErrorCode["ArchivedCouponCantBeApplied"] = "ArchivedCouponCantBeApplied";
293
+ ErrorCode["AuthCustomerMismatch"] = "AuthCustomerMismatch";
156
294
  ErrorCode["BadUserInput"] = "BadUserInput";
157
295
  ErrorCode["BillingPeriodMissingError"] = "BillingPeriodMissingError";
158
296
  ErrorCode["CannotDeleteCustomerError"] = "CannotDeleteCustomerError";
159
297
  ErrorCode["CannotDeleteFeatureError"] = "CannotDeleteFeatureError";
160
- ErrorCode["CantCreateExperiment"] = "CantCreateExperiment";
298
+ ErrorCode["CannotEditPackageInNonDraftMode"] = "CannotEditPackageInNonDraftMode";
161
299
  ErrorCode["CheckoutIsNotSupported"] = "CheckoutIsNotSupported";
300
+ ErrorCode["CheckoutOptionsMissing"] = "CheckoutOptionsMissing";
162
301
  ErrorCode["CouponNotFound"] = "CouponNotFound";
302
+ ErrorCode["CustomerAlreadyHaveCustomerCoupon"] = "CustomerAlreadyHaveCustomerCoupon";
303
+ ErrorCode["CustomerAlreadyUsesCoupon"] = "CustomerAlreadyUsesCoupon";
163
304
  ErrorCode["CustomerHasNoPaymentMethod"] = "CustomerHasNoPaymentMethod";
164
305
  ErrorCode["CustomerNoBillingId"] = "CustomerNoBillingId";
165
306
  ErrorCode["CustomerNotFound"] = "CustomerNotFound";
307
+ ErrorCode["DowngradeBillingPeriodNotSupportedError"] = "DowngradeBillingPeriodNotSupportedError";
166
308
  ErrorCode["DraftPlanCantBeArchived"] = "DraftPlanCantBeArchived";
167
309
  ErrorCode["DuplicatedEntityNotAllowed"] = "DuplicatedEntityNotAllowed";
168
310
  ErrorCode["EditAllowedOnDraftPackageOnlyError"] = "EditAllowedOnDraftPackageOnlyError";
311
+ ErrorCode["EntitlementsMustBelongToSamePackage"] = "EntitlementsMustBelongToSamePackage";
312
+ ErrorCode["EntityIdDifferentFromRefIdError"] = "EntityIdDifferentFromRefIdError";
169
313
  ErrorCode["EnvironmentMissing"] = "EnvironmentMissing";
314
+ ErrorCode["ExperimentAlreadyRunning"] = "ExperimentAlreadyRunning";
170
315
  ErrorCode["ExperimentNotFoundError"] = "ExperimentNotFoundError";
171
316
  ErrorCode["ExperimentStatusError"] = "ExperimentStatusError";
317
+ ErrorCode["FailedToCreateCheckoutSessionError"] = "FailedToCreateCheckoutSessionError";
172
318
  ErrorCode["FailedToImportCustomer"] = "FailedToImportCustomer";
173
319
  ErrorCode["FeatureNotFound"] = "FeatureNotFound";
174
320
  ErrorCode["IdentityForbidden"] = "IdentityForbidden";
@@ -188,16 +334,26 @@ var ErrorCode;
188
334
  ErrorCode["MemberInvitationError"] = "MemberInvitationError";
189
335
  ErrorCode["MemberNotFound"] = "MemberNotFound";
190
336
  ErrorCode["MeteringNotAvailableForFeatureType"] = "MeteringNotAvailableForFeatureType";
337
+ ErrorCode["MissingEntityIdError"] = "MissingEntityIdError";
191
338
  ErrorCode["NoFeatureEntitlementInSubscription"] = "NoFeatureEntitlementInSubscription";
339
+ ErrorCode["NoProductsAvailable"] = "NoProductsAvailable";
340
+ ErrorCode["OperationNotAllowedDuringInProgressExperiment"] = "OperationNotAllowedDuringInProgressExperiment";
192
341
  ErrorCode["PackageAlreadyPublished"] = "PackageAlreadyPublished";
193
342
  ErrorCode["PackagePricingTypeNotSet"] = "PackagePricingTypeNotSet";
194
343
  ErrorCode["PlanAlreadyExtended"] = "PlanAlreadyExtended";
344
+ ErrorCode["PlanCannotBePublishWhenBasePlanIsDraft"] = "PlanCannotBePublishWhenBasePlanIsDraft";
195
345
  ErrorCode["PlanIsUsedAsDefaultStartPlan"] = "PlanIsUsedAsDefaultStartPlan";
196
346
  ErrorCode["PlanIsUsedAsDowngradePlan"] = "PlanIsUsedAsDowngradePlan";
197
347
  ErrorCode["PlanNotFound"] = "PlanNotFound";
198
348
  ErrorCode["PlanWithChildCantBeDeleted"] = "PlanWithChildCantBeDeleted";
199
349
  ErrorCode["PlansCircularDependencyError"] = "PlansCircularDependencyError";
200
350
  ErrorCode["PriceNotFound"] = "PriceNotFound";
351
+ ErrorCode["PromotionCodeCustomerNotFirstPurchase"] = "PromotionCodeCustomerNotFirstPurchase";
352
+ ErrorCode["PromotionCodeMaxRedemptionsReached"] = "PromotionCodeMaxRedemptionsReached";
353
+ ErrorCode["PromotionCodeMinimumAmountNotReached"] = "PromotionCodeMinimumAmountNotReached";
354
+ ErrorCode["PromotionCodeNotActive"] = "PromotionCodeNotActive";
355
+ ErrorCode["PromotionCodeNotForCustomer"] = "PromotionCodeNotForCustomer";
356
+ ErrorCode["PromotionCodeNotFound"] = "PromotionCodeNotFound";
201
357
  ErrorCode["RateLimitExceeded"] = "RateLimitExceeded";
202
358
  ErrorCode["ResyncAlreadyInProgress"] = "ResyncAlreadyInProgress";
203
359
  ErrorCode["SelectedBillingModelDoesntMatchImportedItemError"] = "SelectedBillingModelDoesntMatchImportedItemError";
@@ -212,6 +368,7 @@ var ErrorCode;
212
368
  ErrorCode["UncompatibleSubscriptionAddon"] = "UncompatibleSubscriptionAddon";
213
369
  ErrorCode["UnexpectedError"] = "UnexpectedError";
214
370
  ErrorCode["UnsupportedFeatureType"] = "UnsupportedFeatureType";
371
+ ErrorCode["UnsupportedSubscriptionScheduleType"] = "UnsupportedSubscriptionScheduleType";
215
372
  ErrorCode["UnsupportedVendorIdentifier"] = "UnsupportedVendorIdentifier";
216
373
  })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
217
374
  /** EventLogType */
@@ -228,10 +385,12 @@ var EventLogType;
228
385
  EventLogType["CustomerDeleted"] = "CUSTOMER_DELETED";
229
386
  EventLogType["CustomerPaymentFailed"] = "CUSTOMER_PAYMENT_FAILED";
230
387
  EventLogType["CustomerUpdated"] = "CUSTOMER_UPDATED";
388
+ EventLogType["EdgeApiDataResync"] = "EDGE_API_DATA_RESYNC";
231
389
  EventLogType["EntitlementsUpdated"] = "ENTITLEMENTS_UPDATED";
232
390
  EventLogType["EntitlementDenied"] = "ENTITLEMENT_DENIED";
233
391
  EventLogType["EntitlementGranted"] = "ENTITLEMENT_GRANTED";
234
392
  EventLogType["EntitlementRequested"] = "ENTITLEMENT_REQUESTED";
393
+ EventLogType["EnvironmentDeleted"] = "ENVIRONMENT_DELETED";
235
394
  EventLogType["FeatureCreated"] = "FEATURE_CREATED";
236
395
  EventLogType["FeatureDeleted"] = "FEATURE_DELETED";
237
396
  EventLogType["FeatureUpdated"] = "FEATURE_UPDATED";
@@ -242,6 +401,9 @@ var EventLogType;
242
401
  EventLogType["PlanCreated"] = "PLAN_CREATED";
243
402
  EventLogType["PlanDeleted"] = "PLAN_DELETED";
244
403
  EventLogType["PlanUpdated"] = "PLAN_UPDATED";
404
+ EventLogType["ProductCreated"] = "PRODUCT_CREATED";
405
+ EventLogType["ProductDeleted"] = "PRODUCT_DELETED";
406
+ EventLogType["ProductUpdated"] = "PRODUCT_UPDATED";
245
407
  EventLogType["PromotionalEntitlementExpired"] = "PROMOTIONAL_ENTITLEMENT_EXPIRED";
246
408
  EventLogType["PromotionalEntitlementGranted"] = "PROMOTIONAL_ENTITLEMENT_GRANTED";
247
409
  EventLogType["PromotionalEntitlementRevoked"] = "PROMOTIONAL_ENTITLEMENT_REVOKED";
@@ -257,13 +419,8 @@ var EventLogType;
257
419
  EventLogType["SubscriptionUpdated"] = "SUBSCRIPTION_UPDATED";
258
420
  EventLogType["SubscriptionUsageUpdated"] = "SUBSCRIPTION_USAGE_UPDATED";
259
421
  EventLogType["SyncFailed"] = "SYNC_FAILED";
422
+ EventLogType["WidgetConfigurationUpdated"] = "WIDGET_CONFIGURATION_UPDATED";
260
423
  })(EventLogType = exports.EventLogType || (exports.EventLogType = {}));
261
- /** The group of the experiment */
262
- var ExperimentGroup;
263
- (function (ExperimentGroup) {
264
- ExperimentGroup["Control"] = "CONTROL";
265
- ExperimentGroup["Variant"] = "VARIANT";
266
- })(ExperimentGroup = exports.ExperimentGroup || (exports.ExperimentGroup = {}));
267
424
  var ExperimentSortFields;
268
425
  (function (ExperimentSortFields) {
269
426
  ExperimentSortFields["CreatedAt"] = "createdAt";
@@ -307,6 +464,12 @@ var FeatureType;
307
464
  FeatureType["Boolean"] = "BOOLEAN";
308
465
  FeatureType["Number"] = "NUMBER";
309
466
  })(FeatureType = exports.FeatureType || (exports.FeatureType = {}));
467
+ /** Font weight */
468
+ var FontWeight;
469
+ (function (FontWeight) {
470
+ FontWeight["Bold"] = "BOLD";
471
+ FontWeight["Normal"] = "NORMAL";
472
+ })(FontWeight = exports.FontWeight || (exports.FontWeight = {}));
310
473
  var HookSortFields;
311
474
  (function (HookSortFields) {
312
475
  HookSortFields["CreatedAt"] = "createdAt";
@@ -415,6 +578,7 @@ var PlanSortFields;
415
578
  })(PlanSortFields = exports.PlanSortFields || (exports.PlanSortFields = {}));
416
579
  var PriceSortFields;
417
580
  (function (PriceSortFields) {
581
+ PriceSortFields["BillingId"] = "billingId";
418
582
  PriceSortFields["BillingModel"] = "billingModel";
419
583
  PriceSortFields["BillingPeriod"] = "billingPeriod";
420
584
  PriceSortFields["CreatedAt"] = "createdAt";
@@ -463,6 +627,17 @@ var PromotionalEntitlementStatus;
463
627
  PromotionalEntitlementStatus["Expired"] = "Expired";
464
628
  PromotionalEntitlementStatus["Paused"] = "Paused";
465
629
  })(PromotionalEntitlementStatus = exports.PromotionalEntitlementStatus || (exports.PromotionalEntitlementStatus = {}));
630
+ var ProrationBehavior;
631
+ (function (ProrationBehavior) {
632
+ ProrationBehavior["CreateProrations"] = "CREATE_PRORATIONS";
633
+ ProrationBehavior["InvoiceImmediately"] = "INVOICE_IMMEDIATELY";
634
+ })(ProrationBehavior = exports.ProrationBehavior || (exports.ProrationBehavior = {}));
635
+ /** Provision subscription status */
636
+ var ProvisionSubscriptionStatus;
637
+ (function (ProvisionSubscriptionStatus) {
638
+ ProvisionSubscriptionStatus["PaymentRequired"] = "PAYMENT_REQUIRED";
639
+ ProvisionSubscriptionStatus["Success"] = "SUCCESS";
640
+ })(ProvisionSubscriptionStatus = exports.ProvisionSubscriptionStatus || (exports.ProvisionSubscriptionStatus = {}));
466
641
  /** PublishMigrationType */
467
642
  var PublishMigrationType;
468
643
  (function (PublishMigrationType) {
@@ -512,11 +687,27 @@ var SubscriptionCancellationTime;
512
687
  SubscriptionCancellationTime["Immediate"] = "IMMEDIATE";
513
688
  SubscriptionCancellationTime["SpecificDate"] = "SPECIFIC_DATE";
514
689
  })(SubscriptionCancellationTime = exports.SubscriptionCancellationTime || (exports.SubscriptionCancellationTime = {}));
690
+ /** Subscription decision strategy */
691
+ var SubscriptionDecisionStrategy;
692
+ (function (SubscriptionDecisionStrategy) {
693
+ SubscriptionDecisionStrategy["PredefinedFreePlan"] = "PREDEFINED_FREE_PLAN";
694
+ SubscriptionDecisionStrategy["PredefinedTrialPlan"] = "PREDEFINED_TRIAL_PLAN";
695
+ SubscriptionDecisionStrategy["RequestedPlan"] = "REQUESTED_PLAN";
696
+ SubscriptionDecisionStrategy["SkippedSubscriptionCreation"] = "SKIPPED_SUBSCRIPTION_CREATION";
697
+ })(SubscriptionDecisionStrategy = exports.SubscriptionDecisionStrategy || (exports.SubscriptionDecisionStrategy = {}));
515
698
  var SubscriptionEndSetup;
516
699
  (function (SubscriptionEndSetup) {
517
700
  SubscriptionEndSetup["CancelSubscription"] = "CANCEL_SUBSCRIPTION";
518
701
  SubscriptionEndSetup["DowngradeToFree"] = "DOWNGRADE_TO_FREE";
519
702
  })(SubscriptionEndSetup = exports.SubscriptionEndSetup || (exports.SubscriptionEndSetup = {}));
703
+ var SubscriptionEntitlementSortFields;
704
+ (function (SubscriptionEntitlementSortFields) {
705
+ SubscriptionEntitlementSortFields["CreatedAt"] = "createdAt";
706
+ SubscriptionEntitlementSortFields["EnvironmentId"] = "environmentId";
707
+ SubscriptionEntitlementSortFields["Id"] = "id";
708
+ SubscriptionEntitlementSortFields["SubscriptionId"] = "subscriptionId";
709
+ SubscriptionEntitlementSortFields["UpdatedAt"] = "updatedAt";
710
+ })(SubscriptionEntitlementSortFields = exports.SubscriptionEntitlementSortFields || (exports.SubscriptionEntitlementSortFields = {}));
520
711
  var SubscriptionMigrationTaskSortFields;
521
712
  (function (SubscriptionMigrationTaskSortFields) {
522
713
  SubscriptionMigrationTaskSortFields["CreatedAt"] = "createdAt";
@@ -532,6 +723,21 @@ var SubscriptionPriceSortFields;
532
723
  SubscriptionPriceSortFields["UpdatedAt"] = "updatedAt";
533
724
  SubscriptionPriceSortFields["UsageLimit"] = "usageLimit";
534
725
  })(SubscriptionPriceSortFields = exports.SubscriptionPriceSortFields || (exports.SubscriptionPriceSortFields = {}));
726
+ /** Subscription scheduled schedule status */
727
+ var SubscriptionScheduleStatus;
728
+ (function (SubscriptionScheduleStatus) {
729
+ SubscriptionScheduleStatus["Canceled"] = "Canceled";
730
+ SubscriptionScheduleStatus["Done"] = "Done";
731
+ SubscriptionScheduleStatus["Failed"] = "Failed";
732
+ SubscriptionScheduleStatus["Scheduled"] = "Scheduled";
733
+ })(SubscriptionScheduleStatus = exports.SubscriptionScheduleStatus || (exports.SubscriptionScheduleStatus = {}));
734
+ /** Subscription scheduled schedule type */
735
+ var SubscriptionScheduleType;
736
+ (function (SubscriptionScheduleType) {
737
+ SubscriptionScheduleType["BillingPeriod"] = "BillingPeriod";
738
+ SubscriptionScheduleType["Downgrade"] = "Downgrade";
739
+ SubscriptionScheduleType["UnitAmount"] = "UnitAmount";
740
+ })(SubscriptionScheduleType = exports.SubscriptionScheduleType || (exports.SubscriptionScheduleType = {}));
535
741
  var SubscriptionStartSetup;
536
742
  (function (SubscriptionStartSetup) {
537
743
  SubscriptionStartSetup["FreePlan"] = "FREE_PLAN";
@@ -548,14 +754,6 @@ var SubscriptionStatus;
548
754
  SubscriptionStatus["NotStarted"] = "NOT_STARTED";
549
755
  SubscriptionStatus["PaymentPending"] = "PAYMENT_PENDING";
550
756
  })(SubscriptionStatus = exports.SubscriptionStatus || (exports.SubscriptionStatus = {}));
551
- /** Subscription strategy decision */
552
- var SubscriptionStrategyDecision;
553
- (function (SubscriptionStrategyDecision) {
554
- SubscriptionStrategyDecision["PredefinedFreePlan"] = "PREDEFINED_FREE_PLAN";
555
- SubscriptionStrategyDecision["PredefinedTrialPlan"] = "PREDEFINED_TRIAL_PLAN";
556
- SubscriptionStrategyDecision["RequestedPlan"] = "REQUESTED_PLAN";
557
- SubscriptionStrategyDecision["SkippedSubscriptionCreation"] = "SKIPPED_SUBSCRIPTION_CREATION";
558
- })(SubscriptionStrategyDecision = exports.SubscriptionStrategyDecision || (exports.SubscriptionStrategyDecision = {}));
559
757
  /** Status of the integration sync */
560
758
  var SyncStatus;
561
759
  (function (SyncStatus) {
@@ -609,30 +807,36 @@ var WeeklyAccordingTo;
609
807
  WeeklyAccordingTo["EveryWednesday"] = "EveryWednesday";
610
808
  WeeklyAccordingTo["SubscriptionStart"] = "SubscriptionStart";
611
809
  })(WeeklyAccordingTo = exports.WeeklyAccordingTo || (exports.WeeklyAccordingTo = {}));
612
- exports.FeatureFragmentDoc = (0, graphql_tag_1.default) `
613
- fragment FeatureFragment on Feature {
614
- id: refId
615
- featureType
616
- meterType
617
- featureUnits
618
- featureUnitsPlural
619
- displayName
620
- description
621
- }
622
- `;
810
+ /** The widget type */
811
+ var WidgetType;
812
+ (function (WidgetType) {
813
+ WidgetType["CustomerPortal"] = "CUSTOMER_PORTAL";
814
+ WidgetType["Paywall"] = "PAYWALL";
815
+ })(WidgetType = exports.WidgetType || (exports.WidgetType = {}));
816
+ /** The group of the experiment */
817
+ var ExperimentGroupType;
818
+ (function (ExperimentGroupType) {
819
+ ExperimentGroupType["Control"] = "CONTROL";
820
+ ExperimentGroupType["Variant"] = "VARIANT";
821
+ })(ExperimentGroupType = exports.ExperimentGroupType || (exports.ExperimentGroupType = {}));
623
822
  exports.PriceFragmentDoc = (0, graphql_tag_1.default) `
624
823
  fragment PriceFragment on Price {
625
824
  billingModel
626
825
  billingPeriod
826
+ billingId
827
+ minUnitQuantity
828
+ maxUnitQuantity
627
829
  price {
628
830
  amount
629
831
  currency
630
832
  }
631
833
  feature {
632
- ...FeatureFragment
834
+ featureUnits
835
+ featureUnitsPlural
836
+ displayName
633
837
  }
634
838
  }
635
- ${exports.FeatureFragmentDoc}`;
839
+ `;
636
840
  exports.TotalPriceFragmentDoc = (0, graphql_tag_1.default) `
637
841
  fragment TotalPriceFragment on CustomerSubscriptionTotalPrice {
638
842
  subTotal {
@@ -645,42 +849,156 @@ exports.TotalPriceFragmentDoc = (0, graphql_tag_1.default) `
645
849
  }
646
850
  }
647
851
  `;
852
+ exports.SlimSubscriptionFragmentDoc = (0, graphql_tag_1.default) `
853
+ fragment SlimSubscriptionFragment on CustomerSubscription {
854
+ id
855
+ refId
856
+ status
857
+ additionalMetaData
858
+ billingId
859
+ billingLinkUrl
860
+ effectiveEndDate
861
+ currentBillingPeriodEnd
862
+ pricingType
863
+ experimentInfo {
864
+ name
865
+ id
866
+ groupName
867
+ groupType
868
+ }
869
+ prices {
870
+ usageLimit
871
+ price {
872
+ ...PriceFragment
873
+ }
874
+ }
875
+ totalPrice {
876
+ ...TotalPriceFragment
877
+ }
878
+ plan {
879
+ id
880
+ refId
881
+ }
882
+ addons {
883
+ quantity
884
+ addon {
885
+ id
886
+ refId
887
+ }
888
+ }
889
+ customer {
890
+ id
891
+ refId
892
+ }
893
+ }
894
+ ${exports.PriceFragmentDoc}
895
+ ${exports.TotalPriceFragmentDoc}`;
896
+ exports.CouponFragmentDoc = (0, graphql_tag_1.default) `
897
+ fragment CouponFragment on Coupon {
898
+ id
899
+ discountValue
900
+ type
901
+ additionalMetaData
902
+ refId
903
+ name
904
+ description
905
+ createdAt
906
+ updatedAt
907
+ billingId
908
+ billingLinkUrl
909
+ type
910
+ status
911
+ syncStates {
912
+ vendorIdentifier
913
+ status
914
+ }
915
+ customers {
916
+ id
917
+ }
918
+ }
919
+ `;
920
+ exports.PromotionalEntitlementFragmentDoc = (0, graphql_tag_1.default) `
921
+ fragment PromotionalEntitlementFragment on PromotionalEntitlement {
922
+ status
923
+ usageLimit
924
+ featureId
925
+ hasUnlimitedUsage
926
+ resetPeriod
927
+ endDate
928
+ isVisible
929
+ feature {
930
+ featureType
931
+ meterType
932
+ featureUnits
933
+ featureUnitsPlural
934
+ displayName
935
+ description
936
+ refId
937
+ additionalMetaData
938
+ }
939
+ }
940
+ `;
648
941
  exports.PackageEntitlementFragmentDoc = (0, graphql_tag_1.default) `
649
942
  fragment PackageEntitlementFragment on PackageEntitlement {
650
943
  usageLimit
651
944
  hasUnlimitedUsage
652
945
  featureId
653
946
  resetPeriod
947
+ hiddenFromWidgets
948
+ isCustom
949
+ displayNameOverride
654
950
  feature {
655
- ...FeatureFragment
951
+ featureType
952
+ meterType
953
+ featureUnits
954
+ featureUnitsPlural
955
+ displayName
956
+ description
957
+ refId
958
+ additionalMetaData
656
959
  }
657
960
  }
658
- ${exports.FeatureFragmentDoc}`;
961
+ `;
659
962
  exports.AddonFragmentDoc = (0, graphql_tag_1.default) `
660
963
  fragment AddonFragment on Addon {
661
- id: refId
964
+ id
965
+ refId
966
+ billingId
662
967
  displayName
663
968
  description
664
- metadata: additionalMetaData
969
+ additionalMetaData
665
970
  entitlements {
666
971
  ...PackageEntitlementFragment
667
972
  }
973
+ prices {
974
+ ...PriceFragment
975
+ }
668
976
  pricingType
669
977
  }
670
- ${exports.PackageEntitlementFragmentDoc}`;
978
+ ${exports.PackageEntitlementFragmentDoc}
979
+ ${exports.PriceFragmentDoc}`;
671
980
  exports.PlanFragmentDoc = (0, graphql_tag_1.default) `
672
981
  fragment PlanFragment on Plan {
673
- id: refId
982
+ id
983
+ refId
674
984
  displayName
675
985
  description
676
- metadata: additionalMetaData
986
+ billingId
987
+ additionalMetaData
677
988
  product {
678
- id: refId
989
+ refId
679
990
  displayName
680
991
  description
992
+ additionalMetaData
993
+ productSettings {
994
+ downgradePlan {
995
+ refId
996
+ displayName
997
+ }
998
+ }
681
999
  }
682
1000
  basePlan {
683
- id: refId
1001
+ refId
684
1002
  displayName
685
1003
  }
686
1004
  entitlements {
@@ -704,19 +1022,51 @@ exports.PlanFragmentDoc = (0, graphql_tag_1.default) `
704
1022
  ${exports.PackageEntitlementFragmentDoc}
705
1023
  ${exports.AddonFragmentDoc}
706
1024
  ${exports.PriceFragmentDoc}`;
1025
+ exports.SubscriptionScheduledUpdateDataFragmentDoc = (0, graphql_tag_1.default) `
1026
+ fragment SubscriptionScheduledUpdateData on SubscriptionScheduledUpdate {
1027
+ subscriptionScheduleType
1028
+ scheduleStatus
1029
+ scheduledExecutionTime
1030
+ targetPackage {
1031
+ id
1032
+ refId
1033
+ displayName
1034
+ }
1035
+ scheduleVariables {
1036
+ ... on DowngradeChangeVariables {
1037
+ addonRefIds
1038
+ billingPeriod
1039
+ downgradePlanRefId
1040
+ }
1041
+ ... on BillingPeriodChangeVariables {
1042
+ billingPeriod
1043
+ }
1044
+ ... on UnitAmountChangeVariables {
1045
+ newUnitAmount
1046
+ }
1047
+ }
1048
+ }
1049
+ `;
707
1050
  exports.SubscriptionFragmentDoc = (0, graphql_tag_1.default) `
708
1051
  fragment SubscriptionFragment on CustomerSubscription {
709
- id: refId
710
- status
1052
+ id
711
1053
  startDate
712
1054
  endDate
713
1055
  trialEndDate
714
1056
  cancellationDate
715
1057
  effectiveEndDate
1058
+ status
1059
+ refId
716
1060
  currentBillingPeriodEnd
717
- metadata: additionalMetaData
1061
+ additionalMetaData
718
1062
  billingId
719
1063
  billingLinkUrl
1064
+ experimentInfo {
1065
+ name
1066
+ groupType
1067
+ groupName
1068
+ id
1069
+ }
720
1070
  prices {
721
1071
  usageLimit
722
1072
  price {
@@ -737,98 +1087,141 @@ exports.SubscriptionFragmentDoc = (0, graphql_tag_1.default) `
737
1087
  ...AddonFragment
738
1088
  }
739
1089
  }
1090
+ scheduledUpdates {
1091
+ ...SubscriptionScheduledUpdateData
1092
+ }
740
1093
  }
741
1094
  ${exports.PriceFragmentDoc}
742
1095
  ${exports.TotalPriceFragmentDoc}
743
1096
  ${exports.PlanFragmentDoc}
744
- ${exports.AddonFragmentDoc}`;
745
- exports.PromotionalEntitlementFragmentDoc = (0, graphql_tag_1.default) `
746
- fragment PromotionalEntitlementFragment on PromotionalEntitlement {
747
- status
748
- usageLimit
749
- featureId
750
- hasUnlimitedUsage
751
- resetPeriod
752
- endDate
753
- isVisible
754
- feature {
755
- ...FeatureFragment
756
- }
757
- }
758
- ${exports.FeatureFragmentDoc}`;
759
- exports.CouponFragmentDoc = (0, graphql_tag_1.default) `
760
- fragment CouponFragment on Coupon {
761
- id: refId
762
- name
763
- description
764
- type
765
- discountValue
766
- metadata: additionalMetaData
767
- createdAt
768
- updatedAt
769
- billingId
770
- billingLinkUrl
771
- status
772
- }
773
- `;
1097
+ ${exports.AddonFragmentDoc}
1098
+ ${exports.SubscriptionScheduledUpdateDataFragmentDoc}`;
774
1099
  exports.CustomerFragmentDoc = (0, graphql_tag_1.default) `
775
1100
  fragment CustomerFragment on Customer {
776
- customerId
1101
+ id
777
1102
  name
778
1103
  email
779
1104
  createdAt
780
1105
  updatedAt
781
- subscriptions {
782
- ...SubscriptionFragment
1106
+ hasPaymentMethod
1107
+ refId
1108
+ billingId
1109
+ defaultPaymentExpirationMonth
1110
+ defaultPaymentExpirationYear
1111
+ defaultPaymentMethodLast4Digits
1112
+ additionalMetaData
1113
+ trialedPlans {
1114
+ productId
1115
+ productRefId
1116
+ planRefId
1117
+ planId
783
1118
  }
784
- promotionalEntitlements {
785
- ...PromotionalEntitlementFragment
1119
+ experimentInfo {
1120
+ groupType
1121
+ groupName
1122
+ id
1123
+ name
786
1124
  }
787
- hasPaymentMethod
788
1125
  coupon {
789
1126
  ...CouponFragment
790
1127
  }
791
- billingId
792
- metadata: additionalMetaData
793
- email2: email
1128
+ eligibleForTrial {
1129
+ productId
1130
+ productRefId
1131
+ eligible
1132
+ }
1133
+ promotionalEntitlements {
1134
+ ...PromotionalEntitlementFragment
1135
+ }
1136
+ subscriptions {
1137
+ ...SubscriptionFragment
1138
+ }
794
1139
  }
795
- ${exports.SubscriptionFragmentDoc}
1140
+ ${exports.CouponFragmentDoc}
796
1141
  ${exports.PromotionalEntitlementFragmentDoc}
797
- ${exports.CouponFragmentDoc}`;
798
- exports.SlimSubscriptionFragmentDoc = (0, graphql_tag_1.default) `
799
- fragment SlimSubscriptionFragment on CustomerSubscription {
800
- id: refId
801
- status
802
- metadata: additionalMetaData
803
- billingId
804
- billingLinkUrl
805
- effectiveEndDate
806
- currentBillingPeriodEnd
807
- pricingType
808
- prices {
809
- usageLimit
810
- price {
811
- ...PriceFragment
812
- }
1142
+ ${exports.SubscriptionFragmentDoc}`;
1143
+ exports.SubscriptionPreviewFragmentDoc = (0, graphql_tag_1.default) `
1144
+ fragment SubscriptionPreviewFragment on SubscriptionPreview {
1145
+ subTotal {
1146
+ amount
1147
+ currency
813
1148
  }
814
- totalPrice {
815
- ...TotalPriceFragment
1149
+ total {
1150
+ amount
1151
+ currency
816
1152
  }
817
- plan {
818
- id: refId
1153
+ billingPeriodRange {
1154
+ start
1155
+ end
819
1156
  }
820
- addons {
821
- quantity
822
- addon {
823
- id: refId
1157
+ proration {
1158
+ prorationDate
1159
+ credit {
1160
+ amount
1161
+ currency
1162
+ }
1163
+ debit {
1164
+ amount
1165
+ currency
824
1166
  }
825
1167
  }
826
- customer {
827
- id: refId
1168
+ }
1169
+ `;
1170
+ exports.MonthlyResetPeriodConfigFragmentDoc = (0, graphql_tag_1.default) `
1171
+ fragment MonthlyResetPeriodConfigFragment on MonthlyResetPeriodConfig {
1172
+ monthlyAccordingTo
1173
+ }
1174
+ `;
1175
+ exports.WeeklyResetPeriodConfigFragmentDoc = (0, graphql_tag_1.default) `
1176
+ fragment WeeklyResetPeriodConfigFragment on WeeklyResetPeriodConfig {
1177
+ weeklyAccordingTo
1178
+ }
1179
+ `;
1180
+ exports.ResetPeriodConfigurationFragmentDoc = (0, graphql_tag_1.default) `
1181
+ fragment ResetPeriodConfigurationFragment on ResetPeriodConfiguration {
1182
+ __typename
1183
+ ... on MonthlyResetPeriodConfig {
1184
+ ...MonthlyResetPeriodConfigFragment
1185
+ }
1186
+ ... on WeeklyResetPeriodConfig {
1187
+ ...WeeklyResetPeriodConfigFragment
828
1188
  }
829
1189
  }
830
- ${exports.PriceFragmentDoc}
831
- ${exports.TotalPriceFragmentDoc}`;
1190
+ ${exports.MonthlyResetPeriodConfigFragmentDoc}
1191
+ ${exports.WeeklyResetPeriodConfigFragmentDoc}`;
1192
+ exports.FeatureFragmentDoc = (0, graphql_tag_1.default) `
1193
+ fragment FeatureFragment on EntitlementFeature {
1194
+ featureType
1195
+ meterType
1196
+ featureUnits
1197
+ featureUnitsPlural
1198
+ description
1199
+ displayName
1200
+ refId
1201
+ }
1202
+ `;
1203
+ exports.EntitlementFragmentDoc = (0, graphql_tag_1.default) `
1204
+ fragment EntitlementFragment on Entitlement {
1205
+ isGranted
1206
+ accessDeniedReason
1207
+ customerId
1208
+ usageLimit
1209
+ hasUnlimitedUsage
1210
+ currentUsage
1211
+ requestedUsage
1212
+ entitlementUpdatedAt
1213
+ usageUpdatedAt
1214
+ nextResetDate
1215
+ resetPeriod
1216
+ resetPeriodConfiguration {
1217
+ ...ResetPeriodConfigurationFragment
1218
+ }
1219
+ feature {
1220
+ ...FeatureFragment
1221
+ }
1222
+ }
1223
+ ${exports.ResetPeriodConfigurationFragmentDoc}
1224
+ ${exports.FeatureFragmentDoc}`;
832
1225
  exports.PaywallPackageEntitlementFragmentDoc = (0, graphql_tag_1.default) `
833
1226
  fragment PaywallPackageEntitlementFragment on PackageEntitlement {
834
1227
  usageLimit
@@ -836,89 +1229,135 @@ exports.PaywallPackageEntitlementFragmentDoc = (0, graphql_tag_1.default) `
836
1229
  featureId
837
1230
  resetPeriod
838
1231
  feature {
839
- ...FeatureFragment
1232
+ featureType
1233
+ meterType
1234
+ featureUnits
1235
+ featureUnitsPlural
1236
+ displayName
1237
+ description
1238
+ refId
840
1239
  }
841
1240
  }
842
- ${exports.FeatureFragmentDoc}`;
843
- exports.PaywallPriceFragmentDoc = (0, graphql_tag_1.default) `
844
- fragment PaywallPriceFragment on Price {
845
- billingModel
846
- billingPeriod
847
- price {
848
- amount
849
- currency
1241
+ `;
1242
+ exports.PaywallAddonFragmentDoc = (0, graphql_tag_1.default) `
1243
+ fragment PaywallAddonFragment on Addon {
1244
+ id
1245
+ refId
1246
+ billingId
1247
+ displayName
1248
+ description
1249
+ entitlements {
1250
+ ...PaywallPackageEntitlementFragment
850
1251
  }
851
- feature {
852
- ...FeatureFragment
1252
+ prices {
1253
+ ...PriceFragment
853
1254
  }
1255
+ additionalMetaData
1256
+ pricingType
854
1257
  }
855
- ${exports.FeatureFragmentDoc}`;
1258
+ ${exports.PaywallPackageEntitlementFragmentDoc}
1259
+ ${exports.PriceFragmentDoc}`;
856
1260
  exports.PaywallPlanFragmentDoc = (0, graphql_tag_1.default) `
857
1261
  fragment PaywallPlanFragment on Plan {
858
- id: refId
1262
+ id
1263
+ refId
859
1264
  description
860
1265
  displayName
1266
+ billingId
861
1267
  product {
862
- id: refId
1268
+ refId
863
1269
  displayName
864
1270
  description
1271
+ additionalMetaData
1272
+ productSettings {
1273
+ downgradePlan {
1274
+ refId
1275
+ displayName
1276
+ }
1277
+ }
865
1278
  }
866
1279
  basePlan {
867
- id: refId
1280
+ refId
868
1281
  displayName
869
1282
  }
870
1283
  entitlements {
871
1284
  ...PaywallPackageEntitlementFragment
872
1285
  }
873
- metadata: additionalMetaData
1286
+ additionalMetaData
874
1287
  inheritedEntitlements {
875
1288
  ...PaywallPackageEntitlementFragment
876
1289
  }
877
1290
  prices {
878
- ...PaywallPriceFragment
1291
+ ...PriceFragment
879
1292
  }
880
1293
  pricingType
881
1294
  defaultTrialConfig {
882
1295
  duration
883
1296
  units
884
1297
  }
1298
+ compatibleAddons {
1299
+ ...PaywallAddonFragment
1300
+ }
885
1301
  }
886
1302
  ${exports.PaywallPackageEntitlementFragmentDoc}
887
- ${exports.PaywallPriceFragmentDoc}`;
888
- exports.PaywallAddonFragmentDoc = (0, graphql_tag_1.default) `
889
- fragment PaywallAddonFragment on Addon {
890
- id: refId
891
- displayName
892
- description
893
- entitlements {
894
- ...PaywallPackageEntitlementFragment
1303
+ ${exports.PriceFragmentDoc}
1304
+ ${exports.PaywallAddonFragmentDoc}`;
1305
+ exports.FontVariantFragmentDoc = (0, graphql_tag_1.default) `
1306
+ fragment FontVariantFragment on FontVariant {
1307
+ fontSize
1308
+ fontWeight
1309
+ }
1310
+ `;
1311
+ exports.TypographyConfigurationFragmentDoc = (0, graphql_tag_1.default) `
1312
+ fragment TypographyConfigurationFragment on TypographyConfiguration {
1313
+ fontFamily
1314
+ h1 {
1315
+ ...FontVariantFragment
895
1316
  }
896
- prices {
897
- ...PaywallPriceFragment
1317
+ h2 {
1318
+ ...FontVariantFragment
1319
+ }
1320
+ h3 {
1321
+ ...FontVariantFragment
1322
+ }
1323
+ body {
1324
+ ...FontVariantFragment
898
1325
  }
899
- metadata: additionalMetaData
900
- pricingType
901
1326
  }
902
- ${exports.PaywallPackageEntitlementFragmentDoc}
903
- ${exports.PaywallPriceFragmentDoc}`;
904
- exports.CreateCustomerDocument = (0, graphql_tag_1.default) `
905
- mutation createCustomer($customerId: String!, $email: String, $name: String, $billingInfo: CustomerBillingInfo, $metadata: JSON, $couponId: String, $shouldSyncFree: Boolean) {
906
- createCustomer: createOneCustomer(
907
- input: {refId: $customerId, additionalMetaData: $metadata, billingInformation: $billingInfo, couponRefId: $couponId, email: $email, name: $name, shouldSyncFree: $shouldSyncFree}
908
- ) {
909
- ...CustomerFragment
1327
+ ${exports.FontVariantFragmentDoc}`;
1328
+ exports.LayoutConfigurationFragmentDoc = (0, graphql_tag_1.default) `
1329
+ fragment LayoutConfigurationFragment on PaywallLayoutConfiguration {
1330
+ alignment
1331
+ planWidth
1332
+ planMargin
1333
+ planPadding
1334
+ }
1335
+ `;
1336
+ exports.PaywallConfigurationFragmentDoc = (0, graphql_tag_1.default) `
1337
+ fragment PaywallConfigurationFragment on PaywallConfiguration {
1338
+ palette {
1339
+ primary
1340
+ textColor
1341
+ backgroundColor
1342
+ borderColor
1343
+ currentPlanBackground
1344
+ }
1345
+ typography {
1346
+ ...TypographyConfigurationFragment
1347
+ }
1348
+ layout {
1349
+ ...LayoutConfigurationFragment
910
1350
  }
911
1351
  }
912
- ${exports.CustomerFragmentDoc}`;
1352
+ ${exports.TypographyConfigurationFragmentDoc}
1353
+ ${exports.LayoutConfigurationFragmentDoc}`;
913
1354
  exports.ProvisionCustomerDocument = (0, graphql_tag_1.default) `
914
- mutation provisionCustomer($customerId: String!, $email: String, $name: String, $billingInfo: CustomerBillingInfo, $metadata: JSON, $couponId: String, $shouldSyncFree: Boolean, $subscriptionParams: SubscriptionBaseInput) {
915
- provisionCustomer(
916
- input: {refId: $customerId, additionalMetaData: $metadata, billingInformation: $billingInfo, couponRefId: $couponId, email: $email, name: $name, shouldSyncFree: $shouldSyncFree, subscriptionParams: $subscriptionParams}
917
- ) {
1355
+ mutation provisionCustomer($input: ProvisionCustomerInput!) {
1356
+ provisionCustomer(input: $input) {
918
1357
  customer {
919
1358
  ...CustomerFragment
920
1359
  }
921
- subscriptionStrategyDecision
1360
+ subscriptionDecisionStrategy
922
1361
  subscription {
923
1362
  ...SlimSubscriptionFragment
924
1363
  }
@@ -927,69 +1366,77 @@ exports.ProvisionCustomerDocument = (0, graphql_tag_1.default) `
927
1366
  ${exports.CustomerFragmentDoc}
928
1367
  ${exports.SlimSubscriptionFragmentDoc}`;
929
1368
  exports.ImportCustomerDocument = (0, graphql_tag_1.default) `
930
- mutation importCustomer($customerId: String!, $billingId: String!, $email: String, $name: String) {
931
- importCustomer: importOneCustomer(
932
- input: {refId: $customerId, billingId: $billingId, email: $email, name: $name}
933
- ) {
1369
+ mutation importCustomer($input: ImportCustomerInput!) {
1370
+ importCustomer: importOneCustomer(input: $input) {
934
1371
  ...CustomerFragment
935
1372
  }
936
1373
  }
937
1374
  ${exports.CustomerFragmentDoc}`;
938
1375
  exports.UpdateCustomerDocument = (0, graphql_tag_1.default) `
939
- mutation updateCustomer($metadata: JSON, $billingInfo: CustomerBillingInfo, $couponId: String, $email: String, $name: String, $customerId: String!) {
940
- updateCustomer: updateOneCustomer(
941
- input: {refId: $customerId, name: $name, email: $email, couponRefId: $couponId, billingInformation: $billingInfo, additionalMetaData: $metadata}
942
- ) {
1376
+ mutation updateCustomer($input: UpdateCustomerInput!) {
1377
+ updateCustomer: updateOneCustomer(input: $input) {
943
1378
  ...CustomerFragment
944
1379
  }
945
1380
  }
946
1381
  ${exports.CustomerFragmentDoc}`;
947
- exports.UpdateSubscriptionDocument = (0, graphql_tag_1.default) `
948
- mutation updateSubscription($metadata: JSON, $subscriptionId: String!, $unitQuantity: Float) {
949
- updateSubscription: updateOneSubscription(
950
- input: {additionalMetaData: $metadata, refId: $subscriptionId, unitQuantity: $unitQuantity}
951
- ) {
952
- ...SlimSubscriptionFragment
1382
+ exports.ProvisionSubscriptionDocument = (0, graphql_tag_1.default) `
1383
+ mutation provisionSubscription($input: ProvisionSubscriptionInput!) {
1384
+ provisionSubscriptionV2(input: $input) {
1385
+ checkoutUrl
1386
+ status
1387
+ subscription {
1388
+ ...SlimSubscriptionFragment
1389
+ }
953
1390
  }
954
1391
  }
955
1392
  ${exports.SlimSubscriptionFragmentDoc}`;
956
- exports.CreateSubscriptionDocument = (0, graphql_tag_1.default) `
957
- mutation createSubscription($metadata: JSON, $addons: [SubscriptionAddonInput!], $awaitPaymentConfirmation: Boolean, $billingId: String, $billingInfo: SubscriptionBillingInfo, $billingPeriod: BillingPeriod, $customerId: String!, $isTrial: Boolean, $isOverridingTrialConfig: Boolean, $planId: String, $unitQuantity: Float, $subscriptionId: String, $startDate: DateTime) {
958
- createSubscription(
959
- subscription: {refId: $subscriptionId, additionalMetaData: $metadata, billingInformation: $billingInfo, billingId: $billingId, addons: $addons, customerId: $customerId, awaitPaymentConfirmation: $awaitPaymentConfirmation, billingPeriod: $billingPeriod, isTrial: $isTrial, isOverridingTrialConfig: $isOverridingTrialConfig, planId: $planId, priceUnitAmount: $unitQuantity, startDate: $startDate}
960
- ) {
1393
+ exports.UpdateSubscriptionDocument = (0, graphql_tag_1.default) `
1394
+ mutation updateSubscription($input: UpdateSubscriptionInput!) {
1395
+ updateSubscription: updateOneSubscription(input: $input) {
961
1396
  ...SlimSubscriptionFragment
962
1397
  }
963
1398
  }
964
1399
  ${exports.SlimSubscriptionFragmentDoc}`;
965
1400
  exports.CancelSubscriptionDocument = (0, graphql_tag_1.default) `
966
- mutation cancelSubscription($endDate: DateTime, $cancellationTime: SubscriptionCancellationTime, $subscriptionId: String!) {
967
- cancelSubscription(
968
- input: {subscriptionRefId: $subscriptionId, subscriptionCancellationTime: $cancellationTime, endDate: $endDate}
969
- ) {
1401
+ mutation cancelSubscription($input: SubscriptionCancellationInput!) {
1402
+ cancelSubscription(input: $input) {
970
1403
  ...SlimSubscriptionFragment
971
1404
  }
972
1405
  }
973
1406
  ${exports.SlimSubscriptionFragmentDoc}`;
974
1407
  exports.InitiateCheckoutDocument = (0, graphql_tag_1.default) `
975
- mutation initiateCheckout($addons: [SubscriptionAddonInput!], $billingPeriod: BillingPeriod!, $cancelUrl: String!, $customerId: String!, $planId: String!, $successUrl: String!, $unitQuantity: Int) {
976
- initiateCheckout(
977
- input: {planId: $planId, billingPeriod: $billingPeriod, cancelUrl: $cancelUrl, customerId: $customerId, addons: $addons, unitQuantity: $unitQuantity, successUrl: $successUrl}
978
- ) {
979
- id
1408
+ mutation initiateCheckout($input: InitiateCheckoutInput!) {
1409
+ initiateCheckout(input: $input) {
980
1410
  checkoutUrl
981
1411
  checkoutBillingId
982
1412
  }
983
1413
  }
984
1414
  `;
1415
+ exports.EstimateSubscriptionDocument = (0, graphql_tag_1.default) `
1416
+ mutation estimateSubscription($input: EstimateSubscriptionInput!) {
1417
+ estimateSubscription(input: $input) {
1418
+ ...SubscriptionPreviewFragment
1419
+ }
1420
+ }
1421
+ ${exports.SubscriptionPreviewFragmentDoc}`;
1422
+ exports.EstimateSubscriptionUpdateDocument = (0, graphql_tag_1.default) `
1423
+ mutation estimateSubscriptionUpdate($input: EstimateSubscriptionUpdateInput!) {
1424
+ estimateSubscriptionUpdate(input: $input) {
1425
+ ...SubscriptionPreviewFragment
1426
+ }
1427
+ }
1428
+ ${exports.SubscriptionPreviewFragmentDoc}`;
1429
+ exports.ReportUsageDocument = (0, graphql_tag_1.default) `
1430
+ mutation reportUsage($input: UsageMeasurementCreateInput!) {
1431
+ createUsageMeasurement(usageMeasurement: $input) {
1432
+ id
1433
+ }
1434
+ }
1435
+ `;
985
1436
  exports.GetCustomerByIdDocument = (0, graphql_tag_1.default) `
986
- query getCustomerById($customerId: String) {
987
- customers(filter: {refId: {eq: $customerId}}) {
988
- edges {
989
- node {
990
- ...CustomerFragment
991
- }
992
- }
1437
+ query getCustomerById($input: GetCustomerByRefIdInput!) {
1438
+ getCustomerByRefId(input: $input) {
1439
+ ...CustomerFragment
993
1440
  }
994
1441
  }
995
1442
  ${exports.CustomerFragmentDoc}`;
@@ -1004,12 +1451,40 @@ exports.GetCouponsDocument = (0, graphql_tag_1.default) `
1004
1451
  }
1005
1452
  }
1006
1453
  ${exports.CouponFragmentDoc}`;
1454
+ exports.GetPaywallDocument = (0, graphql_tag_1.default) `
1455
+ query getPaywall($input: GetPaywallInput!) {
1456
+ paywall(input: $input) {
1457
+ plans {
1458
+ ...PlanFragment
1459
+ }
1460
+ configuration {
1461
+ ...PaywallConfigurationFragment
1462
+ }
1463
+ customer {
1464
+ ...CustomerFragment
1465
+ }
1466
+ }
1467
+ }
1468
+ ${exports.PlanFragmentDoc}
1469
+ ${exports.PaywallConfigurationFragmentDoc}
1470
+ ${exports.CustomerFragmentDoc}`;
1471
+ exports.GetEntitlementsDocument = (0, graphql_tag_1.default) `
1472
+ query getEntitlements($query: FetchEntitlementsQuery!) {
1473
+ entitlements: cachedEntitlements(query: $query) {
1474
+ ...EntitlementFragment
1475
+ }
1476
+ }
1477
+ ${exports.EntitlementFragmentDoc}`;
1478
+ exports.GetEntitlementDocument = (0, graphql_tag_1.default) `
1479
+ query getEntitlement($query: FetchEntitlementQuery!) {
1480
+ entitlement(query: $query) {
1481
+ ...EntitlementFragment
1482
+ }
1483
+ }
1484
+ ${exports.EntitlementFragmentDoc}`;
1007
1485
  const defaultWrapper = (action, _operationName, _operationType) => action();
1008
1486
  function getSdk(client, withWrapper = defaultWrapper) {
1009
1487
  return {
1010
- createCustomer(variables, requestHeaders) {
1011
- return withWrapper((wrappedRequestHeaders) => client.request(exports.CreateCustomerDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createCustomer', 'mutation');
1012
- },
1013
1488
  provisionCustomer(variables, requestHeaders) {
1014
1489
  return withWrapper((wrappedRequestHeaders) => client.request(exports.ProvisionCustomerDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'provisionCustomer', 'mutation');
1015
1490
  },
@@ -1019,23 +1494,41 @@ function getSdk(client, withWrapper = defaultWrapper) {
1019
1494
  updateCustomer(variables, requestHeaders) {
1020
1495
  return withWrapper((wrappedRequestHeaders) => client.request(exports.UpdateCustomerDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'updateCustomer', 'mutation');
1021
1496
  },
1497
+ provisionSubscription(variables, requestHeaders) {
1498
+ return withWrapper((wrappedRequestHeaders) => client.request(exports.ProvisionSubscriptionDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'provisionSubscription', 'mutation');
1499
+ },
1022
1500
  updateSubscription(variables, requestHeaders) {
1023
1501
  return withWrapper((wrappedRequestHeaders) => client.request(exports.UpdateSubscriptionDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'updateSubscription', 'mutation');
1024
1502
  },
1025
- createSubscription(variables, requestHeaders) {
1026
- return withWrapper((wrappedRequestHeaders) => client.request(exports.CreateSubscriptionDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createSubscription', 'mutation');
1027
- },
1028
1503
  cancelSubscription(variables, requestHeaders) {
1029
1504
  return withWrapper((wrappedRequestHeaders) => client.request(exports.CancelSubscriptionDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'cancelSubscription', 'mutation');
1030
1505
  },
1031
1506
  initiateCheckout(variables, requestHeaders) {
1032
1507
  return withWrapper((wrappedRequestHeaders) => client.request(exports.InitiateCheckoutDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'initiateCheckout', 'mutation');
1033
1508
  },
1509
+ estimateSubscription(variables, requestHeaders) {
1510
+ return withWrapper((wrappedRequestHeaders) => client.request(exports.EstimateSubscriptionDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'estimateSubscription', 'mutation');
1511
+ },
1512
+ estimateSubscriptionUpdate(variables, requestHeaders) {
1513
+ return withWrapper((wrappedRequestHeaders) => client.request(exports.EstimateSubscriptionUpdateDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'estimateSubscriptionUpdate', 'mutation');
1514
+ },
1515
+ reportUsage(variables, requestHeaders) {
1516
+ return withWrapper((wrappedRequestHeaders) => client.request(exports.ReportUsageDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'reportUsage', 'mutation');
1517
+ },
1034
1518
  getCustomerById(variables, requestHeaders) {
1035
1519
  return withWrapper((wrappedRequestHeaders) => client.request(exports.GetCustomerByIdDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getCustomerById', 'query');
1036
1520
  },
1037
1521
  getCoupons(variables, requestHeaders) {
1038
1522
  return withWrapper((wrappedRequestHeaders) => client.request(exports.GetCouponsDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getCoupons', 'query');
1523
+ },
1524
+ getPaywall(variables, requestHeaders) {
1525
+ return withWrapper((wrappedRequestHeaders) => client.request(exports.GetPaywallDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getPaywall', 'query');
1526
+ },
1527
+ getEntitlements(variables, requestHeaders) {
1528
+ return withWrapper((wrappedRequestHeaders) => client.request(exports.GetEntitlementsDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getEntitlements', 'query');
1529
+ },
1530
+ getEntitlement(variables, requestHeaders) {
1531
+ return withWrapper((wrappedRequestHeaders) => client.request(exports.GetEntitlementDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getEntitlement', 'query');
1039
1532
  }
1040
1533
  };
1041
1534
  }