@schematichq/schematic-components 2.24.0 → 2.25.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.
@@ -51,6 +51,17 @@ declare interface AvailablePlanOptions {
51
51
  useSelectedPeriod?: boolean;
52
52
  }
53
53
 
54
+ /**
55
+ *
56
+ * @export
57
+ */
58
+ declare const BillingCollectionMethod: {
59
+ readonly ChargeAutomatically: "charge_automatically";
60
+ readonly SendInvoice: "send_invoice";
61
+ };
62
+
63
+ declare type BillingCollectionMethod = (typeof BillingCollectionMethod)[keyof typeof BillingCollectionMethod];
64
+
54
65
  /**
55
66
  *
56
67
  * @export
@@ -3710,6 +3721,98 @@ export declare interface ColumnProps extends React.HTMLProps<HTMLDivElement> {
3710
3721
  basis?: string;
3711
3722
  }
3712
3723
 
3724
+ /**
3725
+ *
3726
+ * @export
3727
+ * @interface CompanyBillingProfileResponseData
3728
+ */
3729
+ declare interface CompanyBillingProfileResponseData {
3730
+ /**
3731
+ *
3732
+ * @type {string}
3733
+ * @memberof CompanyBillingProfileResponseData
3734
+ */
3735
+ accountId: string;
3736
+ /**
3737
+ *
3738
+ * @type {string}
3739
+ * @memberof CompanyBillingProfileResponseData
3740
+ */
3741
+ billingCustomerId?: string | null;
3742
+ /**
3743
+ *
3744
+ * @type {BillingCollectionMethod}
3745
+ * @memberof CompanyBillingProfileResponseData
3746
+ */
3747
+ collectionMethod: BillingCollectionMethod;
3748
+ /**
3749
+ *
3750
+ * @type {string}
3751
+ * @memberof CompanyBillingProfileResponseData
3752
+ */
3753
+ companyId: string;
3754
+ /**
3755
+ *
3756
+ * @type {Date}
3757
+ * @memberof CompanyBillingProfileResponseData
3758
+ */
3759
+ createdAt: Date;
3760
+ /**
3761
+ *
3762
+ * @type {number}
3763
+ * @memberof CompanyBillingProfileResponseData
3764
+ */
3765
+ daysUntilDue?: number | null;
3766
+ /**
3767
+ *
3768
+ * @type {string}
3769
+ * @memberof CompanyBillingProfileResponseData
3770
+ */
3771
+ environmentId: string;
3772
+ /**
3773
+ *
3774
+ * @type {string}
3775
+ * @memberof CompanyBillingProfileResponseData
3776
+ */
3777
+ id: string;
3778
+ /**
3779
+ *
3780
+ * @type {boolean}
3781
+ * @memberof CompanyBillingProfileResponseData
3782
+ */
3783
+ isDefault: boolean;
3784
+ /**
3785
+ *
3786
+ * @type {string}
3787
+ * @memberof CompanyBillingProfileResponseData
3788
+ */
3789
+ name?: string | null;
3790
+ /**
3791
+ *
3792
+ * @type {string}
3793
+ * @memberof CompanyBillingProfileResponseData
3794
+ */
3795
+ paymentMethodId?: string | null;
3796
+ /**
3797
+ *
3798
+ * @type {ProrationBehavior}
3799
+ * @memberof CompanyBillingProfileResponseData
3800
+ */
3801
+ prorationBehavior?: ProrationBehavior | null;
3802
+ /**
3803
+ *
3804
+ * @type {BillingProviderType}
3805
+ * @memberof CompanyBillingProfileResponseData
3806
+ */
3807
+ providerType: BillingProviderType;
3808
+ /**
3809
+ *
3810
+ * @type {Date}
3811
+ * @memberof CompanyBillingProfileResponseData
3812
+ */
3813
+ updatedAt: Date;
3814
+ }
3815
+
3713
3816
  /**
3714
3817
  *
3715
3818
  * @export
@@ -3744,6 +3847,18 @@ declare interface CompanyDetailResponseData {
3744
3847
  billingCreditBalances?: {
3745
3848
  [key: string]: number;
3746
3849
  } | null;
3850
+ /**
3851
+ *
3852
+ * @type {CompanyBillingProfileResponseData}
3853
+ * @memberof CompanyDetailResponseData
3854
+ */
3855
+ billingProfile?: CompanyBillingProfileResponseData;
3856
+ /**
3857
+ *
3858
+ * @type {Array<CompanyBillingProfileResponseData>}
3859
+ * @memberof CompanyDetailResponseData
3860
+ */
3861
+ billingProfiles?: Array<CompanyBillingProfileResponseData> | null;
3747
3862
  /**
3748
3863
  *
3749
3864
  * @type {BillingSubscriptionView}
@@ -3834,6 +3949,12 @@ declare interface CompanyDetailResponseData {
3834
3949
  * @memberof CompanyDetailResponseData
3835
3950
  */
3836
3951
  paymentMethods: Array<PaymentMethodResponseData>;
3952
+ /**
3953
+ *
3954
+ * @type {PendingMigrationResponseData}
3955
+ * @memberof CompanyDetailResponseData
3956
+ */
3957
+ pendingMigration?: PendingMigrationResponseData;
3837
3958
  /**
3838
3959
  *
3839
3960
  * @type {CompanyPlanWithBillingSubView}
@@ -4109,6 +4230,18 @@ declare interface CompanyOverrideResponseData {
4109
4230
  * @memberof CompanyOverrideResponseData
4110
4231
  */
4111
4232
  valueBool?: boolean | null;
4233
+ /**
4234
+ *
4235
+ * @type {BillingCreditResponseData}
4236
+ * @memberof CompanyOverrideResponseData
4237
+ */
4238
+ valueCredit?: BillingCreditResponseData;
4239
+ /**
4240
+ *
4241
+ * @type {string}
4242
+ * @memberof CompanyOverrideResponseData
4243
+ */
4244
+ valueCreditId?: string | null;
4112
4245
  /**
4113
4246
  *
4114
4247
  * @type {number}
@@ -5392,10 +5525,10 @@ declare interface ComponentHydrateResponseData {
5392
5525
  trialPaymentMethodRequired?: boolean | null;
5393
5526
  /**
5394
5527
  *
5395
- * @type {InvoiceResponseData}
5528
+ * @type {UpcomingInvoiceResponseData}
5396
5529
  * @memberof ComponentHydrateResponseData
5397
5530
  */
5398
- upcomingInvoice?: InvoiceResponseData;
5531
+ upcomingInvoice?: UpcomingInvoiceResponseData;
5399
5532
  }
5400
5533
 
5401
5534
  declare interface ComponentProps extends TransientCSSProperties {
@@ -6265,6 +6398,12 @@ declare interface CustomPlanBillingResponseData {
6265
6398
  * @memberof CustomPlanBillingResponseData
6266
6399
  */
6267
6400
  planId: string;
6401
+ /**
6402
+ * Whether the shortened period the renewal date created was billed pro rata when the subscription started. False means that period is free and the first invoice is the one raised on the renewal date.
6403
+ * @type {boolean}
6404
+ * @memberof CustomPlanBillingResponseData
6405
+ */
6406
+ prorateFirstPeriod?: boolean | null;
6268
6407
  /**
6269
6408
  *
6270
6409
  * @type {Date}
@@ -6701,7 +6840,7 @@ declare interface ElementProps {
6701
6840
 
6702
6841
  export declare const EmbedContext: Context<EmbedContextProps>;
6703
6842
 
6704
- export declare interface EmbedContextProps extends EmbedState {
6843
+ export declare interface EmbedContextProps extends Omit<EmbedState, SettingsLayer> {
6705
6844
  hydratePublic: () => DebouncedApiPromise<PublicPlansResponseData>;
6706
6845
  hydrate: () => DebouncedApiPromise<HydrateDataWithCompanyContext>;
6707
6846
  hydrateComponent: (id: string) => DebouncedApiPromise<HydrateDataWithCompanyContext>;
@@ -6727,9 +6866,22 @@ export declare interface EmbedContextProps extends EmbedState {
6727
6866
  initializeWithPlan: (config: string | BypassConfig) => void;
6728
6867
  requestUnsubscribe: () => void;
6729
6868
  setData: (data: HydrateDataWithCompanyContext) => void;
6869
+ /**
6870
+ * Apply settings from the consuming app. These take precedence over the design
6871
+ * stored in the dashboard regardless of which arrives first, and survive the
6872
+ * re-hydration that follows a checkout or unsubscribe. Pass `{ update: true }`
6873
+ * to merge into the current values rather than replace them.
6874
+ */
6730
6875
  updateSettings: (settings: DeepPartial<EmbedSettings>, options?: {
6731
6876
  update?: boolean;
6732
6877
  }) => void;
6878
+ /**
6879
+ * Apply the design authored in the dashboard. Internal: `SchematicEmbed` calls
6880
+ * this with the settings inflated from the component AST. Anything supplied via
6881
+ * {@link EmbedContextProps.updateSettings} or the provider's `settings` prop
6882
+ * wins over it.
6883
+ */
6884
+ setBuilderSettings: (settings: DeepPartial<EmbedSettings>) => void;
6733
6885
  debug: (message: string, ...args: unknown[]) => void;
6734
6886
  }
6735
6887
 
@@ -6780,7 +6932,17 @@ export declare interface EmbedState {
6780
6932
  accessToken?: string;
6781
6933
  data?: HydrateDataWithCompanyContext;
6782
6934
  error?: Error;
6935
+ /**
6936
+ * The effective settings, derived from the layers below. Read this; write to
6937
+ * the layers via an `UPDATE_SETTINGS` action.
6938
+ */
6783
6939
  settings: EmbedSettings;
6940
+ /** Lowest-precedence layer: settings applied without an explicit source. */
6941
+ baseSettings: DeepPartial<EmbedSettings>;
6942
+ /** The design stored in the dashboard, applied once the component hydrates. */
6943
+ builderSettings: DeepPartial<EmbedSettings>;
6944
+ /** Runtime settings from the consuming app; these win over the stored design. */
6945
+ settingsOverrides: DeepPartial<EmbedSettings>;
6784
6946
  layout: EmbedLayout;
6785
6947
  checkoutState?: CheckoutState;
6786
6948
  currencyFilter?: string[];
@@ -8604,10 +8766,10 @@ declare type HydrateDataWithCompanyContext = ComponentHydrateResponseData;
8604
8766
  declare interface HydrateUpcomingInvoiceResponse {
8605
8767
  /**
8606
8768
  *
8607
- * @type {InvoiceResponseData}
8769
+ * @type {UpcomingInvoiceResponseData}
8608
8770
  * @memberof HydrateUpcomingInvoiceResponse
8609
8771
  */
8610
- data: InvoiceResponseData;
8772
+ data: UpcomingInvoiceResponseData;
8611
8773
  /**
8612
8774
  * Input parameters
8613
8775
  * @type {object}
@@ -8661,6 +8823,7 @@ export declare const initialContext: {
8661
8823
  requestUnsubscribe: () => never;
8662
8824
  setData: () => never;
8663
8825
  updateSettings: () => never;
8826
+ setBuilderSettings: () => never;
8664
8827
  debug: () => never;
8665
8828
  finishCheckout: () => never;
8666
8829
  isPending: boolean;
@@ -8669,6 +8832,9 @@ export declare const initialContext: {
8669
8832
  data?: HydrateDataWithCompanyContext;
8670
8833
  error?: Error;
8671
8834
  settings: EmbedSettings;
8835
+ baseSettings: DeepPartial<EmbedSettings>;
8836
+ builderSettings: DeepPartial<EmbedSettings>;
8837
+ settingsOverrides: DeepPartial<EmbedSettings>;
8672
8838
  layout: EmbedLayout;
8673
8839
  checkoutState?: CheckoutState;
8674
8840
  currencyFilter?: string[];
@@ -9146,11 +9312,70 @@ declare interface PaymentMethodResponseData {
9146
9312
  updatedAt: Date;
9147
9313
  }
9148
9314
 
9315
+ /**
9316
+ * Schematic API
9317
+ * Schematic API
9318
+ *
9319
+ * The version of the OpenAPI document: 0.1
9320
+ *
9321
+ *
9322
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9323
+ * https://openapi-generator.tech
9324
+ * Do not edit the class manually.
9325
+ */
9326
+ /**
9327
+ *
9328
+ * @export
9329
+ * @interface PendingMigrationResponseData
9330
+ */
9331
+ declare interface PendingMigrationResponseData {
9332
+ /**
9333
+ *
9334
+ * @type {string}
9335
+ * @memberof PendingMigrationResponseData
9336
+ */
9337
+ migrationId: string;
9338
+ /**
9339
+ *
9340
+ * @type {Date}
9341
+ * @memberof PendingMigrationResponseData
9342
+ */
9343
+ scheduledFor?: Date | null;
9344
+ /**
9345
+ *
9346
+ * @type {string}
9347
+ * @memberof PendingMigrationResponseData
9348
+ */
9349
+ toPlanId: string;
9350
+ /**
9351
+ *
9352
+ * @type {string}
9353
+ * @memberof PendingMigrationResponseData
9354
+ */
9355
+ toPlanName: string;
9356
+ /**
9357
+ *
9358
+ * @type {string}
9359
+ * @memberof PendingMigrationResponseData
9360
+ */
9361
+ toPlanVersionId: string;
9362
+ /**
9363
+ *
9364
+ * @type {number}
9365
+ * @memberof PendingMigrationResponseData
9366
+ */
9367
+ toPlanVersionNumber?: number | null;
9368
+ }
9369
+
9149
9370
  declare interface PerLicenseCreditGrant {
9150
9371
  /** credits granted per unit of the license */
9151
9372
  amount: number;
9152
- /** the license whose quantity scales the grant */
9153
- licenseId: string;
9373
+ /**
9374
+ * The license whose quantity scales the grant. Undefined when the grant
9375
+ * declares per-license scaling without naming a license: the per-unit copy
9376
+ * still holds, but no effective total can be resolved from it.
9377
+ */
9378
+ licenseId?: string;
9154
9379
  }
9155
9380
 
9156
9381
  export declare const Plan: ({ portal, isLoading, plans, selectedPlan, period, selectPlan, shouldTrial, currency, }: PlanProps) => JSX.Element;
@@ -11524,6 +11749,12 @@ declare interface PreviewSubscriptionFinanceResponseData {
11524
11749
  * @memberof PreviewSubscriptionFinanceResponseData
11525
11750
  */
11526
11751
  proration: number;
11752
+ /**
11753
+ *
11754
+ * @type {Date}
11755
+ * @memberof PreviewSubscriptionFinanceResponseData
11756
+ */
11757
+ prorationBilledAt?: Date | null;
11527
11758
  /**
11528
11759
  *
11529
11760
  * @type {number}
@@ -11738,6 +11969,9 @@ declare type RequestState<TData> = {
11738
11969
 
11739
11970
  export declare const ResetStyle: RuleSet<object>;
11740
11971
 
11972
+ /** Collapse the settings layers into the effective settings. */
11973
+ export declare const resolveSettings: (layers: Pick<EmbedState, SettingsLayer>) => EmbedSettings;
11974
+
11741
11975
  declare interface ResponseContext {
11742
11976
  fetch: FetchAPI;
11743
11977
  url: string;
@@ -11904,6 +12138,12 @@ declare interface RuleConditionDetailResponseData {
11904
12138
  * @memberof RuleConditionDetailResponseData
11905
12139
  */
11906
12140
  operator: ComparableOperator;
12141
+ /**
12142
+ *
12143
+ * @type {Array<RuleConditionPlanVersionResponseData>}
12144
+ * @memberof RuleConditionDetailResponseData
12145
+ */
12146
+ planVersions?: Array<RuleConditionPlanVersionResponseData>;
11907
12147
  /**
11908
12148
  *
11909
12149
  * @type {Array<string>}
@@ -12038,6 +12278,12 @@ declare interface RuleConditionDetailResponseData_2 {
12038
12278
  * @memberof RuleConditionDetailResponseData
12039
12279
  */
12040
12280
  operator: ComparableOperator_2;
12281
+ /**
12282
+ *
12283
+ * @type {Array<RuleConditionPlanVersionResponseData>}
12284
+ * @memberof RuleConditionDetailResponseData
12285
+ */
12286
+ planVersions?: Array<RuleConditionPlanVersionResponseData_2>;
12041
12287
  /**
12042
12288
  *
12043
12289
  * @type {Array<string>}
@@ -12188,6 +12434,70 @@ declare interface RuleConditionGroupDetailResponseData_2 {
12188
12434
  updatedAt: Date;
12189
12435
  }
12190
12436
 
12437
+ /**
12438
+ *
12439
+ * @export
12440
+ * @interface RuleConditionPlanVersionResponseData
12441
+ */
12442
+ declare interface RuleConditionPlanVersionResponseData {
12443
+ /**
12444
+ *
12445
+ * @type {string}
12446
+ * @memberof RuleConditionPlanVersionResponseData
12447
+ */
12448
+ id: string;
12449
+ /**
12450
+ *
12451
+ * @type {string}
12452
+ * @memberof RuleConditionPlanVersionResponseData
12453
+ */
12454
+ name: string;
12455
+ /**
12456
+ *
12457
+ * @type {PlanVersionStatus}
12458
+ * @memberof RuleConditionPlanVersionResponseData
12459
+ */
12460
+ status: PlanVersionStatus;
12461
+ /**
12462
+ *
12463
+ * @type {number}
12464
+ * @memberof RuleConditionPlanVersionResponseData
12465
+ */
12466
+ version: number;
12467
+ }
12468
+
12469
+ /**
12470
+ *
12471
+ * @export
12472
+ * @interface RuleConditionPlanVersionResponseData
12473
+ */
12474
+ declare interface RuleConditionPlanVersionResponseData_2 {
12475
+ /**
12476
+ *
12477
+ * @type {string}
12478
+ * @memberof RuleConditionPlanVersionResponseData
12479
+ */
12480
+ id: string;
12481
+ /**
12482
+ *
12483
+ * @type {string}
12484
+ * @memberof RuleConditionPlanVersionResponseData
12485
+ */
12486
+ name: string;
12487
+ /**
12488
+ *
12489
+ * @type {PlanVersionStatus}
12490
+ * @memberof RuleConditionPlanVersionResponseData
12491
+ */
12492
+ status: PlanVersionStatus_2;
12493
+ /**
12494
+ *
12495
+ * @type {number}
12496
+ * @memberof RuleConditionPlanVersionResponseData
12497
+ */
12498
+ version: number;
12499
+ }
12500
+
12191
12501
  /**
12192
12502
  *
12193
12503
  * @export
@@ -12477,6 +12787,34 @@ export declare interface SelectedProps {
12477
12787
  isTrial?: boolean;
12478
12788
  }
12479
12789
 
12790
+ export declare const SETTINGS_LAYER_BY_SOURCE: Record<SettingsSource, SettingsLayer>;
12791
+
12792
+ /**
12793
+ * The settings layers in ascending order of precedence. `settings` is derived
12794
+ * from these by {@link resolveSettings}; nothing should assign to it directly.
12795
+ */
12796
+ export declare const SETTINGS_LAYERS: readonly ["baseSettings", "builderSettings", "settingsOverrides"];
12797
+
12798
+ export declare type SettingsLayer = (typeof SETTINGS_LAYERS)[number];
12799
+
12800
+ /**
12801
+ * Where a settings update came from. Settings are layered rather than
12802
+ * last-writer-wins, because the two producers arrive in a fixed and unhelpful
12803
+ * order: the consuming app supplies its theme on mount, while the design stored
12804
+ * in the dashboard is only known once the component has hydrated. Layering lets
12805
+ * a runtime theme survive hydration (and every re-hydration after a checkout).
12806
+ *
12807
+ * - `builder`: the design authored in the Schematic dashboard, inflated from the
12808
+ * component AST.
12809
+ * - `consumer`: the `settings` prop on `EmbedProvider` and `updateSettings()`
12810
+ * calls made by the consuming app. Wins over the stored design.
12811
+ *
12812
+ * An update with no source lands in the lowest layer; it is how the provider's
12813
+ * `prefers-color-scheme` listener contributes a default without overriding
12814
+ * either of the above.
12815
+ */
12816
+ export declare type SettingsSource = "builder" | "consumer";
12817
+
12480
12818
  /**
12481
12819
  * Schematic API
12482
12820
  * Schematic API
@@ -12849,6 +13187,134 @@ export declare const UpcomingBill: ForwardRefExoticComponent<ElementProps & Deep
12849
13187
 
12850
13188
  export declare type UpcomingBillProps = DesignProps_10;
12851
13189
 
13190
+ /**
13191
+ *
13192
+ * @export
13193
+ * @interface UpcomingInvoiceResponseData
13194
+ */
13195
+ declare interface UpcomingInvoiceResponseData {
13196
+ /**
13197
+ *
13198
+ * @type {number}
13199
+ * @memberof UpcomingInvoiceResponseData
13200
+ */
13201
+ amountDue: number;
13202
+ /**
13203
+ *
13204
+ * @type {number}
13205
+ * @memberof UpcomingInvoiceResponseData
13206
+ */
13207
+ amountPaid: number;
13208
+ /**
13209
+ *
13210
+ * @type {number}
13211
+ * @memberof UpcomingInvoiceResponseData
13212
+ */
13213
+ amountRemaining: number;
13214
+ /**
13215
+ *
13216
+ * @type {string}
13217
+ * @memberof UpcomingInvoiceResponseData
13218
+ */
13219
+ collectionMethod: string;
13220
+ /**
13221
+ *
13222
+ * @type {string}
13223
+ * @memberof UpcomingInvoiceResponseData
13224
+ */
13225
+ companyId?: string | null;
13226
+ /**
13227
+ *
13228
+ * @type {Date}
13229
+ * @memberof UpcomingInvoiceResponseData
13230
+ */
13231
+ createdAt: Date;
13232
+ /**
13233
+ *
13234
+ * @type {string}
13235
+ * @memberof UpcomingInvoiceResponseData
13236
+ */
13237
+ currency: string;
13238
+ /**
13239
+ *
13240
+ * @type {string}
13241
+ * @memberof UpcomingInvoiceResponseData
13242
+ */
13243
+ customerExternalId: string;
13244
+ /**
13245
+ *
13246
+ * @type {Date}
13247
+ * @memberof UpcomingInvoiceResponseData
13248
+ */
13249
+ dueDate?: Date | null;
13250
+ /**
13251
+ *
13252
+ * @type {number}
13253
+ * @memberof UpcomingInvoiceResponseData
13254
+ */
13255
+ endingBalance: number;
13256
+ /**
13257
+ *
13258
+ * @type {string}
13259
+ * @memberof UpcomingInvoiceResponseData
13260
+ */
13261
+ environmentId: string;
13262
+ /**
13263
+ *
13264
+ * @type {string}
13265
+ * @memberof UpcomingInvoiceResponseData
13266
+ */
13267
+ externalId?: string | null;
13268
+ /**
13269
+ *
13270
+ * @type {string}
13271
+ * @memberof UpcomingInvoiceResponseData
13272
+ */
13273
+ paymentMethodExternalId?: string | null;
13274
+ /**
13275
+ *
13276
+ * @type {BillingProviderType}
13277
+ * @memberof UpcomingInvoiceResponseData
13278
+ */
13279
+ providerType: BillingProviderType;
13280
+ /**
13281
+ *
13282
+ * @type {number}
13283
+ * @memberof UpcomingInvoiceResponseData
13284
+ */
13285
+ startingBalance: number;
13286
+ /**
13287
+ *
13288
+ * @type {InvoiceStatus}
13289
+ * @memberof UpcomingInvoiceResponseData
13290
+ */
13291
+ status?: InvoiceStatus | null;
13292
+ /**
13293
+ *
13294
+ * @type {string}
13295
+ * @memberof UpcomingInvoiceResponseData
13296
+ */
13297
+ subscriptionExternalId?: string | null;
13298
+ /**
13299
+ *
13300
+ * @type {number}
13301
+ * @memberof UpcomingInvoiceResponseData
13302
+ */
13303
+ subtotal: number;
13304
+ /**
13305
+ *
13306
+ * @type {Date}
13307
+ * @memberof UpcomingInvoiceResponseData
13308
+ */
13309
+ updatedAt: Date;
13310
+ /**
13311
+ *
13312
+ * @type {string}
13313
+ * @memberof UpcomingInvoiceResponseData
13314
+ */
13315
+ url?: string | null;
13316
+ }
13317
+
12852
13318
  /**
12853
13319
  * Schematic API
12854
13320
  * Schematic API