@openmeter/client 1.0.0-beta-11f3e12b6611 → 1.0.0-beta-4066e5bf7b6a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -18
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/schemas.d.ts +64 -32
- package/dist/models/schemas.js +12 -8
- package/dist/models/types.d.ts +41 -5
- package/dist/sdk/internal.d.ts +16 -1
- package/dist/sdk/internal.js +18 -1
- package/dist/sdk/subscriptions.d.ts +1 -16
- package/dist/sdk/subscriptions.js +1 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -312,19 +312,18 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
312
312
|
|
|
313
313
|
### Subscriptions
|
|
314
314
|
|
|
315
|
-
| Method | HTTP | Description
|
|
316
|
-
| -------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
317
|
-
| `client.subscriptions.create` | `POST /openmeter/subscriptions` | Create subscription
|
|
318
|
-
| `client.subscriptions.list` | `GET /openmeter/subscriptions` | List subscriptions
|
|
319
|
-
| `client.subscriptions.get` | `GET /openmeter/subscriptions/{subscriptionId}` | Get subscription
|
|
320
|
-
| `client.subscriptions.cancel` | `POST /openmeter/subscriptions/{subscriptionId}/cancel` | Cancels the subscription. Will result in a scheduling conflict if there are other subscriptions scheduled to start after the cancelation time.
|
|
321
|
-
| `client.subscriptions.unscheduleCancelation` | `POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation` | Unschedules the subscription cancelation.
|
|
322
|
-
| `client.subscriptions.change` | `POST /openmeter/subscriptions/{subscriptionId}/change` | Closes a running subscription and starts a new one according to the specification. Can be used for upgrades, downgrades, and plan changes.
|
|
323
|
-
| `client.subscriptions.
|
|
324
|
-
| `client.subscriptions.
|
|
325
|
-
| `client.subscriptions.
|
|
326
|
-
| `client.subscriptions.
|
|
327
|
-
| `client.subscriptions.getAddon` | `GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}` | Get an add-on association for a subscription. |
|
|
315
|
+
| Method | HTTP | Description |
|
|
316
|
+
| -------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
317
|
+
| `client.subscriptions.create` | `POST /openmeter/subscriptions` | Create subscription |
|
|
318
|
+
| `client.subscriptions.list` | `GET /openmeter/subscriptions` | List subscriptions |
|
|
319
|
+
| `client.subscriptions.get` | `GET /openmeter/subscriptions/{subscriptionId}` | Get subscription |
|
|
320
|
+
| `client.subscriptions.cancel` | `POST /openmeter/subscriptions/{subscriptionId}/cancel` | Cancels the subscription. Will result in a scheduling conflict if there are other subscriptions scheduled to start after the cancelation time. |
|
|
321
|
+
| `client.subscriptions.unscheduleCancelation` | `POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation` | Unschedules the subscription cancelation. |
|
|
322
|
+
| `client.subscriptions.change` | `POST /openmeter/subscriptions/{subscriptionId}/change` | Closes a running subscription and starts a new one according to the specification. Can be used for upgrades, downgrades, and plan changes. |
|
|
323
|
+
| `client.subscriptions.edit` | `POST /openmeter/subscriptions/{subscriptionId}/edit` | Edits a running subscription by applying an ordered batch of customizations (adding or removing items, adding, removing, or stretching phases, or unscheduling a pending edit). The changes may take effect immediately or at the next billing cycle. Subscriptions that have add-ons cannot be edited. |
|
|
324
|
+
| `client.subscriptions.createAddon` | `POST /openmeter/subscriptions/{subscriptionId}/addons` | Add add-on to a subscription. |
|
|
325
|
+
| `client.subscriptions.listAddons` | `GET /openmeter/subscriptions/{subscriptionId}/addons` | List the add-ons of a subscription. |
|
|
326
|
+
| `client.subscriptions.getAddon` | `GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}` | Get an add-on association for a subscription. |
|
|
328
327
|
|
|
329
328
|
### Apps
|
|
330
329
|
|
|
@@ -430,11 +429,12 @@ they can change or be removed without notice or semver consideration.
|
|
|
430
429
|
|
|
431
430
|
### Internal Subscriptions
|
|
432
431
|
|
|
433
|
-
| Method | HTTP | Description
|
|
434
|
-
| ------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
435
|
-
| `client.internal.subscriptions.unschedule` | `POST /openmeter/subscriptions/{subscriptionId}/unschedule` | Deletes a scheduled subscription that has not yet become active, removing it and resolving any scheduling conflict it was holding. This is distinct from canceling: cancel ends a running subscription, whereas unscheduling removes a not-yet-active one. Only scheduled subscriptions can be unscheduled; unscheduling an active or already-started subscription is rejected.
|
|
436
|
-
| `client.internal.subscriptions.restore` | `POST /openmeter/subscriptions/{subscriptionId}/restore` | Restores the subscription by deleting any later-scheduled successor subscriptions and continuing this one indefinitely. This is the inverse of a future-dated change, which schedules a successor. Restore is not available when multi-subscription is enabled.
|
|
437
|
-
| `client.internal.subscriptions.
|
|
432
|
+
| Method | HTTP | Description |
|
|
433
|
+
| ------------------------------------------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
434
|
+
| `client.internal.subscriptions.unschedule` | `POST /openmeter/subscriptions/{subscriptionId}/unschedule` | Deletes a scheduled subscription that has not yet become active, removing it and resolving any scheduling conflict it was holding. This is distinct from canceling: cancel ends a running subscription, whereas unscheduling removes a not-yet-active one. Only scheduled subscriptions can be unscheduled; unscheduling an active or already-started subscription is rejected. |
|
|
435
|
+
| `client.internal.subscriptions.restore` | `POST /openmeter/subscriptions/{subscriptionId}/restore` | Restores the subscription by deleting any later-scheduled successor subscriptions and continuing this one indefinitely. This is the inverse of a future-dated change, which schedules a successor. Restore is not available when multi-subscription is enabled. |
|
|
436
|
+
| `client.internal.subscriptions.migrate` | `POST /openmeter/subscriptions/{subscriptionId}/migrate` | Migrates to a later version of the current plan. With starting_phase omitted and billing_anchor omitted or unchanged, migration amends the subscription in place: unchanged items retain their service periods and both response entries have the same ID. Existing addons must remain compatible with the target plan. Incompatible phase timelines or billing settings return an error. Providing starting_phase or a different billing_anchor explicitly requests replacement, which resets the phase timeline, may produce billing adjustments, and does not transfer addons. Custom subscriptions cannot be migrated. |
|
|
437
|
+
| `client.internal.subscriptions.updateAddon` | `PATCH /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}` | Update a subscription add-on. Only the quantity is mutable; the timing controls when the new quantity takes effect. A new entry is appended to the add-on's timeline. |
|
|
438
438
|
|
|
439
439
|
### Internal Apps
|
|
440
440
|
|
package/dist/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.0-beta-
|
|
1
|
+
export declare const SDK_VERSION = "1.0.0-beta-4066e5bf7b6a";
|
package/dist/lib/version.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// The committed value is a dev placeholder. The publish flow
|
|
3
3
|
// (`make -C api/spec publish-aip-sdk`) stamps the real release version here
|
|
4
4
|
// before `pnpm publish`, after `pnpm version` updates package.json.
|
|
5
|
-
export const SDK_VERSION = '1.0.0-beta-
|
|
5
|
+
export const SDK_VERSION = '1.0.0-beta-4066e5bf7b6a';
|
package/dist/models/schemas.d.ts
CHANGED
|
@@ -9068,10 +9068,10 @@ export declare const plan: z.ZodObject<{
|
|
|
9068
9068
|
}, z.core.$strip>], "type">>;
|
|
9069
9069
|
}, z.core.$strip>>;
|
|
9070
9070
|
}, z.core.$strip>>;
|
|
9071
|
-
settlementMode: z.
|
|
9071
|
+
settlementMode: z.ZodEnum<{
|
|
9072
9072
|
credit_only: "credit_only";
|
|
9073
9073
|
credit_then_invoice: "credit_then_invoice";
|
|
9074
|
-
}
|
|
9074
|
+
}>;
|
|
9075
9075
|
validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9076
9076
|
code: z.ZodString;
|
|
9077
9077
|
message: z.ZodString;
|
|
@@ -9184,6 +9184,10 @@ export declare const createPlanRequest: z.ZodObject<{
|
|
|
9184
9184
|
}, z.core.$strip>], "type">>;
|
|
9185
9185
|
}, z.core.$strip>>;
|
|
9186
9186
|
}, z.core.$strip>>;
|
|
9187
|
+
settlementMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
9188
|
+
credit_only: "credit_only";
|
|
9189
|
+
credit_then_invoice: "credit_then_invoice";
|
|
9190
|
+
}>>>;
|
|
9187
9191
|
}, z.core.$strip>;
|
|
9188
9192
|
export declare const upsertPlanRequest: z.ZodObject<{
|
|
9189
9193
|
name: z.ZodString;
|
|
@@ -9287,6 +9291,10 @@ export declare const upsertPlanRequest: z.ZodObject<{
|
|
|
9287
9291
|
}, z.core.$strip>], "type">>;
|
|
9288
9292
|
}, z.core.$strip>>;
|
|
9289
9293
|
}, z.core.$strip>>;
|
|
9294
|
+
settlementMode: z.ZodOptional<z.ZodEnum<{
|
|
9295
|
+
credit_only: "credit_only";
|
|
9296
|
+
credit_then_invoice: "credit_then_invoice";
|
|
9297
|
+
}>>;
|
|
9290
9298
|
}, z.core.$strip>;
|
|
9291
9299
|
export declare const subscriptionEditOperation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
9292
9300
|
type: z.ZodLiteral<"add_item">;
|
|
@@ -10559,10 +10567,10 @@ export declare const planPagePaginatedResponse: z.ZodObject<{
|
|
|
10559
10567
|
}, z.core.$strip>], "type">>;
|
|
10560
10568
|
}, z.core.$strip>>;
|
|
10561
10569
|
}, z.core.$strip>>;
|
|
10562
|
-
settlementMode: z.
|
|
10570
|
+
settlementMode: z.ZodEnum<{
|
|
10563
10571
|
credit_only: "credit_only";
|
|
10564
10572
|
credit_then_invoice: "credit_then_invoice";
|
|
10565
|
-
}
|
|
10573
|
+
}>;
|
|
10566
10574
|
validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10567
10575
|
code: z.ZodString;
|
|
10568
10576
|
message: z.ZodString;
|
|
@@ -30525,10 +30533,10 @@ export declare const listPlansResponse: z.ZodObject<{
|
|
|
30525
30533
|
}, z.core.$strip>], "type">>;
|
|
30526
30534
|
}, z.core.$strip>>;
|
|
30527
30535
|
}, z.core.$strip>>;
|
|
30528
|
-
settlementMode: z.
|
|
30536
|
+
settlementMode: z.ZodEnum<{
|
|
30529
30537
|
credit_only: "credit_only";
|
|
30530
30538
|
credit_then_invoice: "credit_then_invoice";
|
|
30531
|
-
}
|
|
30539
|
+
}>;
|
|
30532
30540
|
validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30533
30541
|
code: z.ZodString;
|
|
30534
30542
|
message: z.ZodString;
|
|
@@ -30649,6 +30657,10 @@ export declare const createPlanBody: z.ZodObject<{
|
|
|
30649
30657
|
}, z.core.$strip>], "type">>;
|
|
30650
30658
|
}, z.core.$strip>>;
|
|
30651
30659
|
}, z.core.$strip>>;
|
|
30660
|
+
settlementMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
30661
|
+
credit_only: "credit_only";
|
|
30662
|
+
credit_then_invoice: "credit_then_invoice";
|
|
30663
|
+
}>>>;
|
|
30652
30664
|
}, z.core.$strip>;
|
|
30653
30665
|
export declare const createPlanResponse: z.ZodObject<{
|
|
30654
30666
|
id: z.ZodString;
|
|
@@ -30768,10 +30780,10 @@ export declare const createPlanResponse: z.ZodObject<{
|
|
|
30768
30780
|
}, z.core.$strip>], "type">>;
|
|
30769
30781
|
}, z.core.$strip>>;
|
|
30770
30782
|
}, z.core.$strip>>;
|
|
30771
|
-
settlementMode: z.
|
|
30783
|
+
settlementMode: z.ZodEnum<{
|
|
30772
30784
|
credit_only: "credit_only";
|
|
30773
30785
|
credit_then_invoice: "credit_then_invoice";
|
|
30774
|
-
}
|
|
30786
|
+
}>;
|
|
30775
30787
|
validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30776
30788
|
code: z.ZodString;
|
|
30777
30789
|
message: z.ZodString;
|
|
@@ -30884,6 +30896,10 @@ export declare const updatePlanBody: z.ZodObject<{
|
|
|
30884
30896
|
}, z.core.$strip>], "type">>;
|
|
30885
30897
|
}, z.core.$strip>>;
|
|
30886
30898
|
}, z.core.$strip>>;
|
|
30899
|
+
settlementMode: z.ZodOptional<z.ZodEnum<{
|
|
30900
|
+
credit_only: "credit_only";
|
|
30901
|
+
credit_then_invoice: "credit_then_invoice";
|
|
30902
|
+
}>>;
|
|
30887
30903
|
}, z.core.$strip>;
|
|
30888
30904
|
export declare const updatePlanResponse: z.ZodObject<{
|
|
30889
30905
|
id: z.ZodString;
|
|
@@ -31003,10 +31019,10 @@ export declare const updatePlanResponse: z.ZodObject<{
|
|
|
31003
31019
|
}, z.core.$strip>], "type">>;
|
|
31004
31020
|
}, z.core.$strip>>;
|
|
31005
31021
|
}, z.core.$strip>>;
|
|
31006
|
-
settlementMode: z.
|
|
31022
|
+
settlementMode: z.ZodEnum<{
|
|
31007
31023
|
credit_only: "credit_only";
|
|
31008
31024
|
credit_then_invoice: "credit_then_invoice";
|
|
31009
|
-
}
|
|
31025
|
+
}>;
|
|
31010
31026
|
validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31011
31027
|
code: z.ZodString;
|
|
31012
31028
|
message: z.ZodString;
|
|
@@ -31135,10 +31151,10 @@ export declare const getPlanResponse: z.ZodObject<{
|
|
|
31135
31151
|
}, z.core.$strip>], "type">>;
|
|
31136
31152
|
}, z.core.$strip>>;
|
|
31137
31153
|
}, z.core.$strip>>;
|
|
31138
|
-
settlementMode: z.
|
|
31154
|
+
settlementMode: z.ZodEnum<{
|
|
31139
31155
|
credit_only: "credit_only";
|
|
31140
31156
|
credit_then_invoice: "credit_then_invoice";
|
|
31141
|
-
}
|
|
31157
|
+
}>;
|
|
31142
31158
|
validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31143
31159
|
code: z.ZodString;
|
|
31144
31160
|
message: z.ZodString;
|
|
@@ -31270,10 +31286,10 @@ export declare const archivePlanResponse: z.ZodObject<{
|
|
|
31270
31286
|
}, z.core.$strip>], "type">>;
|
|
31271
31287
|
}, z.core.$strip>>;
|
|
31272
31288
|
}, z.core.$strip>>;
|
|
31273
|
-
settlementMode: z.
|
|
31289
|
+
settlementMode: z.ZodEnum<{
|
|
31274
31290
|
credit_only: "credit_only";
|
|
31275
31291
|
credit_then_invoice: "credit_then_invoice";
|
|
31276
|
-
}
|
|
31292
|
+
}>;
|
|
31277
31293
|
validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31278
31294
|
code: z.ZodString;
|
|
31279
31295
|
message: z.ZodString;
|
|
@@ -31402,10 +31418,10 @@ export declare const publishPlanResponse: z.ZodObject<{
|
|
|
31402
31418
|
}, z.core.$strip>], "type">>;
|
|
31403
31419
|
}, z.core.$strip>>;
|
|
31404
31420
|
}, z.core.$strip>>;
|
|
31405
|
-
settlementMode: z.
|
|
31421
|
+
settlementMode: z.ZodEnum<{
|
|
31406
31422
|
credit_only: "credit_only";
|
|
31407
31423
|
credit_then_invoice: "credit_then_invoice";
|
|
31408
|
-
}
|
|
31424
|
+
}>;
|
|
31409
31425
|
validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31410
31426
|
code: z.ZodString;
|
|
31411
31427
|
message: z.ZodString;
|
|
@@ -41771,10 +41787,10 @@ export declare const planWire: z.ZodObject<{
|
|
|
41771
41787
|
}, z.core.$strict>], "type">>;
|
|
41772
41788
|
}, z.core.$strict>>;
|
|
41773
41789
|
}, z.core.$strict>>;
|
|
41774
|
-
settlement_mode: z.
|
|
41790
|
+
settlement_mode: z.ZodEnum<{
|
|
41775
41791
|
credit_only: "credit_only";
|
|
41776
41792
|
credit_then_invoice: "credit_then_invoice";
|
|
41777
|
-
}
|
|
41793
|
+
}>;
|
|
41778
41794
|
validation_errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
41779
41795
|
code: z.ZodString;
|
|
41780
41796
|
message: z.ZodString;
|
|
@@ -41887,6 +41903,10 @@ export declare const createPlanRequestWire: z.ZodObject<{
|
|
|
41887
41903
|
}, z.core.$strict>], "type">>;
|
|
41888
41904
|
}, z.core.$strict>>;
|
|
41889
41905
|
}, z.core.$strict>>;
|
|
41906
|
+
settlement_mode: z.ZodOptional<z.ZodEnum<{
|
|
41907
|
+
credit_only: "credit_only";
|
|
41908
|
+
credit_then_invoice: "credit_then_invoice";
|
|
41909
|
+
}>>;
|
|
41890
41910
|
}, z.core.$strict>;
|
|
41891
41911
|
export declare const upsertPlanRequestWire: z.ZodObject<{
|
|
41892
41912
|
name: z.ZodString;
|
|
@@ -41990,6 +42010,10 @@ export declare const upsertPlanRequestWire: z.ZodObject<{
|
|
|
41990
42010
|
}, z.core.$strict>], "type">>;
|
|
41991
42011
|
}, z.core.$strict>>;
|
|
41992
42012
|
}, z.core.$strict>>;
|
|
42013
|
+
settlement_mode: z.ZodOptional<z.ZodEnum<{
|
|
42014
|
+
credit_only: "credit_only";
|
|
42015
|
+
credit_then_invoice: "credit_then_invoice";
|
|
42016
|
+
}>>;
|
|
41993
42017
|
}, z.core.$strict>;
|
|
41994
42018
|
export declare const subscriptionEditOperationWire: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
41995
42019
|
type: z.ZodLiteral<"add_item">;
|
|
@@ -43262,10 +43286,10 @@ export declare const planPagePaginatedResponseWire: z.ZodObject<{
|
|
|
43262
43286
|
}, z.core.$strict>], "type">>;
|
|
43263
43287
|
}, z.core.$strict>>;
|
|
43264
43288
|
}, z.core.$strict>>;
|
|
43265
|
-
settlement_mode: z.
|
|
43289
|
+
settlement_mode: z.ZodEnum<{
|
|
43266
43290
|
credit_only: "credit_only";
|
|
43267
43291
|
credit_then_invoice: "credit_then_invoice";
|
|
43268
|
-
}
|
|
43292
|
+
}>;
|
|
43269
43293
|
validation_errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
43270
43294
|
code: z.ZodString;
|
|
43271
43295
|
message: z.ZodString;
|
|
@@ -63186,10 +63210,10 @@ export declare const listPlansResponseWire: z.ZodObject<{
|
|
|
63186
63210
|
}, z.core.$strict>], "type">>;
|
|
63187
63211
|
}, z.core.$strict>>;
|
|
63188
63212
|
}, z.core.$strict>>;
|
|
63189
|
-
settlement_mode: z.
|
|
63213
|
+
settlement_mode: z.ZodEnum<{
|
|
63190
63214
|
credit_only: "credit_only";
|
|
63191
63215
|
credit_then_invoice: "credit_then_invoice";
|
|
63192
|
-
}
|
|
63216
|
+
}>;
|
|
63193
63217
|
validation_errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63194
63218
|
code: z.ZodString;
|
|
63195
63219
|
message: z.ZodString;
|
|
@@ -63310,6 +63334,10 @@ export declare const createPlanBodyWire: z.ZodObject<{
|
|
|
63310
63334
|
}, z.core.$strict>], "type">>;
|
|
63311
63335
|
}, z.core.$strict>>;
|
|
63312
63336
|
}, z.core.$strict>>;
|
|
63337
|
+
settlement_mode: z.ZodOptional<z.ZodEnum<{
|
|
63338
|
+
credit_only: "credit_only";
|
|
63339
|
+
credit_then_invoice: "credit_then_invoice";
|
|
63340
|
+
}>>;
|
|
63313
63341
|
}, z.core.$strict>;
|
|
63314
63342
|
export declare const createPlanResponseWire: z.ZodObject<{
|
|
63315
63343
|
id: z.ZodString;
|
|
@@ -63429,10 +63457,10 @@ export declare const createPlanResponseWire: z.ZodObject<{
|
|
|
63429
63457
|
}, z.core.$strict>], "type">>;
|
|
63430
63458
|
}, z.core.$strict>>;
|
|
63431
63459
|
}, z.core.$strict>>;
|
|
63432
|
-
settlement_mode: z.
|
|
63460
|
+
settlement_mode: z.ZodEnum<{
|
|
63433
63461
|
credit_only: "credit_only";
|
|
63434
63462
|
credit_then_invoice: "credit_then_invoice";
|
|
63435
|
-
}
|
|
63463
|
+
}>;
|
|
63436
63464
|
validation_errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63437
63465
|
code: z.ZodString;
|
|
63438
63466
|
message: z.ZodString;
|
|
@@ -63545,6 +63573,10 @@ export declare const updatePlanBodyWire: z.ZodObject<{
|
|
|
63545
63573
|
}, z.core.$strict>], "type">>;
|
|
63546
63574
|
}, z.core.$strict>>;
|
|
63547
63575
|
}, z.core.$strict>>;
|
|
63576
|
+
settlement_mode: z.ZodOptional<z.ZodEnum<{
|
|
63577
|
+
credit_only: "credit_only";
|
|
63578
|
+
credit_then_invoice: "credit_then_invoice";
|
|
63579
|
+
}>>;
|
|
63548
63580
|
}, z.core.$strict>;
|
|
63549
63581
|
export declare const updatePlanResponseWire: z.ZodObject<{
|
|
63550
63582
|
id: z.ZodString;
|
|
@@ -63664,10 +63696,10 @@ export declare const updatePlanResponseWire: z.ZodObject<{
|
|
|
63664
63696
|
}, z.core.$strict>], "type">>;
|
|
63665
63697
|
}, z.core.$strict>>;
|
|
63666
63698
|
}, z.core.$strict>>;
|
|
63667
|
-
settlement_mode: z.
|
|
63699
|
+
settlement_mode: z.ZodEnum<{
|
|
63668
63700
|
credit_only: "credit_only";
|
|
63669
63701
|
credit_then_invoice: "credit_then_invoice";
|
|
63670
|
-
}
|
|
63702
|
+
}>;
|
|
63671
63703
|
validation_errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63672
63704
|
code: z.ZodString;
|
|
63673
63705
|
message: z.ZodString;
|
|
@@ -63796,10 +63828,10 @@ export declare const getPlanResponseWire: z.ZodObject<{
|
|
|
63796
63828
|
}, z.core.$strict>], "type">>;
|
|
63797
63829
|
}, z.core.$strict>>;
|
|
63798
63830
|
}, z.core.$strict>>;
|
|
63799
|
-
settlement_mode: z.
|
|
63831
|
+
settlement_mode: z.ZodEnum<{
|
|
63800
63832
|
credit_only: "credit_only";
|
|
63801
63833
|
credit_then_invoice: "credit_then_invoice";
|
|
63802
|
-
}
|
|
63834
|
+
}>;
|
|
63803
63835
|
validation_errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63804
63836
|
code: z.ZodString;
|
|
63805
63837
|
message: z.ZodString;
|
|
@@ -63931,10 +63963,10 @@ export declare const archivePlanResponseWire: z.ZodObject<{
|
|
|
63931
63963
|
}, z.core.$strict>], "type">>;
|
|
63932
63964
|
}, z.core.$strict>>;
|
|
63933
63965
|
}, z.core.$strict>>;
|
|
63934
|
-
settlement_mode: z.
|
|
63966
|
+
settlement_mode: z.ZodEnum<{
|
|
63935
63967
|
credit_only: "credit_only";
|
|
63936
63968
|
credit_then_invoice: "credit_then_invoice";
|
|
63937
|
-
}
|
|
63969
|
+
}>;
|
|
63938
63970
|
validation_errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63939
63971
|
code: z.ZodString;
|
|
63940
63972
|
message: z.ZodString;
|
|
@@ -64063,10 +64095,10 @@ export declare const publishPlanResponseWire: z.ZodObject<{
|
|
|
64063
64095
|
}, z.core.$strict>], "type">>;
|
|
64064
64096
|
}, z.core.$strict>>;
|
|
64065
64097
|
}, z.core.$strict>>;
|
|
64066
|
-
settlement_mode: z.
|
|
64098
|
+
settlement_mode: z.ZodEnum<{
|
|
64067
64099
|
credit_only: "credit_only";
|
|
64068
64100
|
credit_then_invoice: "credit_then_invoice";
|
|
64069
|
-
}
|
|
64101
|
+
}>;
|
|
64070
64102
|
validation_errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
64071
64103
|
code: z.ZodString;
|
|
64072
64104
|
message: z.ZodString;
|
package/dist/models/schemas.js
CHANGED
|
@@ -4687,7 +4687,7 @@ export const subscriptionCustomPlan = z
|
|
|
4687
4687
|
.min(1)
|
|
4688
4688
|
.describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
|
|
4689
4689
|
})
|
|
4690
|
-
.describe('An inline (custom) plan definition used to create or change a subscription without referencing a published plan. Mirrors the plan create shape without a key or version, since a custom plan is not persisted or versioned on its own.');
|
|
4690
|
+
.describe('An inline (custom) plan definition used to create or change a subscription without referencing a published plan. Mirrors the plan create shape without a key or version, since a custom plan is not persisted or versioned on its own. `settlement_mode` is also omitted: it is a subscription-level concern set via the `settlement_mode` field on the create/change request, not on the inline plan.');
|
|
4691
4691
|
export const plan = z
|
|
4692
4692
|
.object({
|
|
4693
4693
|
id: ulid,
|
|
@@ -4726,7 +4726,7 @@ export const plan = z
|
|
|
4726
4726
|
.array(planPhase)
|
|
4727
4727
|
.min(1)
|
|
4728
4728
|
.describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
|
|
4729
|
-
settlementMode: settlementMode
|
|
4729
|
+
settlementMode: settlementMode,
|
|
4730
4730
|
validationErrors: z
|
|
4731
4731
|
.array(productCatalogValidationError)
|
|
4732
4732
|
.optional()
|
|
@@ -4758,8 +4758,9 @@ export const createPlanRequest = z
|
|
|
4758
4758
|
.array(planPhase)
|
|
4759
4759
|
.min(1)
|
|
4760
4760
|
.describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
|
|
4761
|
+
settlementMode: settlementMode.optional().default('credit_then_invoice'),
|
|
4761
4762
|
})
|
|
4762
|
-
.describe('Plan create request.');
|
|
4763
|
+
.describe('Plan create request. `settlement_mode` is re-declared as optional with a `credit_then_invoice` default, applied only on create.');
|
|
4763
4764
|
export const upsertPlanRequest = z
|
|
4764
4765
|
.object({
|
|
4765
4766
|
name: z
|
|
@@ -4782,8 +4783,9 @@ export const upsertPlanRequest = z
|
|
|
4782
4783
|
.array(planPhase)
|
|
4783
4784
|
.min(1)
|
|
4784
4785
|
.describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
|
|
4786
|
+
settlementMode: settlementMode.optional(),
|
|
4785
4787
|
})
|
|
4786
|
-
.describe(
|
|
4788
|
+
.describe("Plan upsert (update) request. `settlement_mode` is re-declared as optional with no default, so an omitted value leaves the plan's existing settlement mode unchanged.");
|
|
4787
4789
|
export const subscriptionEditOperation = z
|
|
4788
4790
|
.discriminatedUnion('type', [
|
|
4789
4791
|
subscriptionEditAddItem,
|
|
@@ -10613,7 +10615,7 @@ export const subscriptionCustomPlanWire = z
|
|
|
10613
10615
|
.min(1)
|
|
10614
10616
|
.describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
|
|
10615
10617
|
})
|
|
10616
|
-
.describe('An inline (custom) plan definition used to create or change a subscription without referencing a published plan. Mirrors the plan create shape without a key or version, since a custom plan is not persisted or versioned on its own.');
|
|
10618
|
+
.describe('An inline (custom) plan definition used to create or change a subscription without referencing a published plan. Mirrors the plan create shape without a key or version, since a custom plan is not persisted or versioned on its own. `settlement_mode` is also omitted: it is a subscription-level concern set via the `settlement_mode` field on the create/change request, not on the inline plan.');
|
|
10617
10619
|
export const planWire = z
|
|
10618
10620
|
.strictObject({
|
|
10619
10621
|
id: ulidWire,
|
|
@@ -10650,7 +10652,7 @@ export const planWire = z
|
|
|
10650
10652
|
.array(planPhaseWire)
|
|
10651
10653
|
.min(1)
|
|
10652
10654
|
.describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
|
|
10653
|
-
settlement_mode: settlementModeWire
|
|
10655
|
+
settlement_mode: settlementModeWire,
|
|
10654
10656
|
validation_errors: z
|
|
10655
10657
|
.array(productCatalogValidationErrorWire)
|
|
10656
10658
|
.optional()
|
|
@@ -10681,8 +10683,9 @@ export const createPlanRequestWire = z
|
|
|
10681
10683
|
.array(planPhaseWire)
|
|
10682
10684
|
.min(1)
|
|
10683
10685
|
.describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
|
|
10686
|
+
settlement_mode: settlementModeWire.optional(),
|
|
10684
10687
|
})
|
|
10685
|
-
.describe('Plan create request.');
|
|
10688
|
+
.describe('Plan create request. `settlement_mode` is re-declared as optional with a `credit_then_invoice` default, applied only on create.');
|
|
10686
10689
|
export const upsertPlanRequestWire = z
|
|
10687
10690
|
.strictObject({
|
|
10688
10691
|
name: z
|
|
@@ -10704,8 +10707,9 @@ export const upsertPlanRequestWire = z
|
|
|
10704
10707
|
.array(planPhaseWire)
|
|
10705
10708
|
.min(1)
|
|
10706
10709
|
.describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
|
|
10710
|
+
settlement_mode: settlementModeWire.optional(),
|
|
10707
10711
|
})
|
|
10708
|
-
.describe(
|
|
10712
|
+
.describe("Plan upsert (update) request. `settlement_mode` is re-declared as optional with no default, so an omitted value leaves the plan's existing settlement mode unchanged.");
|
|
10709
10713
|
export const subscriptionEditOperationWire = z
|
|
10710
10714
|
.discriminatedUnion('type', [
|
|
10711
10715
|
subscriptionEditAddItemWire,
|
package/dist/models/types.d.ts
CHANGED
|
@@ -5444,6 +5444,10 @@ export interface SubscriptionPhase {
|
|
|
5444
5444
|
* An inline (custom) plan definition used to create or change a subscription
|
|
5445
5445
|
* without referencing a published plan. Mirrors the plan create shape without a
|
|
5446
5446
|
* key or version, since a custom plan is not persisted or versioned on its own.
|
|
5447
|
+
*
|
|
5448
|
+
* `settlement_mode` is also omitted: it is a subscription-level concern set via
|
|
5449
|
+
* the `settlement_mode` field on the create/change request, not on the inline
|
|
5450
|
+
* plan.
|
|
5447
5451
|
*/
|
|
5448
5452
|
export interface SubscriptionCustomPlan {
|
|
5449
5453
|
/**
|
|
@@ -5551,7 +5555,10 @@ export interface Plan {
|
|
|
5551
5555
|
*/
|
|
5552
5556
|
validationErrors?: ProductCatalogValidationError[];
|
|
5553
5557
|
}
|
|
5554
|
-
/**
|
|
5558
|
+
/**
|
|
5559
|
+
* Plan create request. `settlement_mode` is re-declared as optional with a
|
|
5560
|
+
* `credit_then_invoice` default, applied only on create.
|
|
5561
|
+
*/
|
|
5555
5562
|
export interface CreatePlanRequest {
|
|
5556
5563
|
/**
|
|
5557
5564
|
* Display name of the resource.
|
|
@@ -5583,8 +5590,14 @@ export interface CreatePlanRequest {
|
|
|
5583
5590
|
* occurs only at the end of a billing period. At least one phase is required.
|
|
5584
5591
|
*/
|
|
5585
5592
|
phases: PlanPhase[];
|
|
5593
|
+
/** Settlement mode for the plan. Defaults to `credit_then_invoice` when omitted. */
|
|
5594
|
+
settlementMode: 'credit_then_invoice' | 'credit_only';
|
|
5586
5595
|
}
|
|
5587
|
-
/**
|
|
5596
|
+
/**
|
|
5597
|
+
* Plan upsert (update) request. `settlement_mode` is re-declared as optional with
|
|
5598
|
+
* no default, so an omitted value leaves the plan's existing settlement mode
|
|
5599
|
+
* unchanged.
|
|
5600
|
+
*/
|
|
5588
5601
|
export interface UpsertPlanRequest {
|
|
5589
5602
|
/**
|
|
5590
5603
|
* Display name of the resource.
|
|
@@ -5606,6 +5619,11 @@ export interface UpsertPlanRequest {
|
|
|
5606
5619
|
* occurs only at the end of a billing period. At least one phase is required.
|
|
5607
5620
|
*/
|
|
5608
5621
|
phases: PlanPhase[];
|
|
5622
|
+
/**
|
|
5623
|
+
* Settlement mode for the plan. When omitted, the existing settlement mode is
|
|
5624
|
+
* preserved.
|
|
5625
|
+
*/
|
|
5626
|
+
settlementMode?: 'credit_then_invoice' | 'credit_only';
|
|
5609
5627
|
}
|
|
5610
5628
|
/** Addon purchased with a subscription. */
|
|
5611
5629
|
export interface SubscriptionAddon {
|
|
@@ -8096,6 +8114,10 @@ export interface SubscriptionPhaseInput {
|
|
|
8096
8114
|
* An inline (custom) plan definition used to create or change a subscription
|
|
8097
8115
|
* without referencing a published plan. Mirrors the plan create shape without a
|
|
8098
8116
|
* key or version, since a custom plan is not persisted or versioned on its own.
|
|
8117
|
+
*
|
|
8118
|
+
* `settlement_mode` is also omitted: it is a subscription-level concern set via
|
|
8119
|
+
* the `settlement_mode` field on the create/change request, not on the inline
|
|
8120
|
+
* plan.
|
|
8099
8121
|
*/
|
|
8100
8122
|
export interface SubscriptionCustomPlanInput {
|
|
8101
8123
|
/**
|
|
@@ -8196,14 +8218,17 @@ export interface PlanInput {
|
|
|
8196
8218
|
* invoiced.
|
|
8197
8219
|
* - `credit_only`: Usage is settled exclusively against credits.
|
|
8198
8220
|
*/
|
|
8199
|
-
settlementMode
|
|
8221
|
+
settlementMode: 'credit_then_invoice' | 'credit_only';
|
|
8200
8222
|
/**
|
|
8201
8223
|
* List of validation errors in `draft` state that prevent the plan from being
|
|
8202
8224
|
* published.
|
|
8203
8225
|
*/
|
|
8204
8226
|
validationErrors?: ProductCatalogValidationError[];
|
|
8205
8227
|
}
|
|
8206
|
-
/**
|
|
8228
|
+
/**
|
|
8229
|
+
* Plan create request. `settlement_mode` is re-declared as optional with a
|
|
8230
|
+
* `credit_then_invoice` default, applied only on create.
|
|
8231
|
+
*/
|
|
8207
8232
|
export interface CreatePlanRequestInput {
|
|
8208
8233
|
/**
|
|
8209
8234
|
* Display name of the resource.
|
|
@@ -8235,8 +8260,14 @@ export interface CreatePlanRequestInput {
|
|
|
8235
8260
|
* occurs only at the end of a billing period. At least one phase is required.
|
|
8236
8261
|
*/
|
|
8237
8262
|
phases: PlanPhaseInput[];
|
|
8263
|
+
/** Settlement mode for the plan. Defaults to `credit_then_invoice` when omitted. */
|
|
8264
|
+
settlementMode?: 'credit_then_invoice' | 'credit_only';
|
|
8238
8265
|
}
|
|
8239
|
-
/**
|
|
8266
|
+
/**
|
|
8267
|
+
* Plan upsert (update) request. `settlement_mode` is re-declared as optional with
|
|
8268
|
+
* no default, so an omitted value leaves the plan's existing settlement mode
|
|
8269
|
+
* unchanged.
|
|
8270
|
+
*/
|
|
8240
8271
|
export interface UpsertPlanRequestInput {
|
|
8241
8272
|
/**
|
|
8242
8273
|
* Display name of the resource.
|
|
@@ -8258,6 +8289,11 @@ export interface UpsertPlanRequestInput {
|
|
|
8258
8289
|
* occurs only at the end of a billing period. At least one phase is required.
|
|
8259
8290
|
*/
|
|
8260
8291
|
phases: PlanPhaseInput[];
|
|
8292
|
+
/**
|
|
8293
|
+
* Settlement mode for the plan. When omitted, the existing settlement mode is
|
|
8294
|
+
* preserved.
|
|
8295
|
+
*/
|
|
8296
|
+
settlementMode?: 'credit_then_invoice' | 'credit_only';
|
|
8261
8297
|
}
|
|
8262
8298
|
/** Addon purchased with a subscription. */
|
|
8263
8299
|
export interface SubscriptionAddonInput {
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { VoidCreditGrantRequest, VoidCreditGrantResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
|
-
import type { UnscheduleSubscriptionRequest, UnscheduleSubscriptionResponse, RestoreSubscriptionRequest, RestoreSubscriptionResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
4
|
+
import type { UnscheduleSubscriptionRequest, UnscheduleSubscriptionResponse, RestoreSubscriptionRequest, RestoreSubscriptionResponse, MigrateSubscriptionRequest, MigrateSubscriptionResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
5
5
|
import type { ListAppsRequest, ListAppsResponse, UninstallAppRequest, UninstallAppResponse, UpdateAppRequest, UpdateAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
|
|
6
6
|
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse, AdvanceInvoiceRequest, AdvanceInvoiceResponse, ApproveInvoiceRequest, ApproveInvoiceResponse, RetryInvoiceRequest, RetryInvoiceResponse, SnapshotQuantitiesInvoiceRequest, SnapshotQuantitiesInvoiceResponse } from '../models/operations/invoices.js';
|
|
7
7
|
import type { ListChargesRequest, ListChargesResponse } from '../models/operations/charges.js';
|
|
@@ -130,6 +130,21 @@ export declare class InternalSubscriptions {
|
|
|
130
130
|
* POST /openmeter/subscriptions/{subscriptionId}/restore
|
|
131
131
|
*/
|
|
132
132
|
restore(request: RestoreSubscriptionRequest, options?: RequestOptions): Promise<RestoreSubscriptionResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* Migrate subscription
|
|
135
|
+
*
|
|
136
|
+
* Migrates to a later version of the current plan. With starting_phase omitted and
|
|
137
|
+
* billing_anchor omitted or unchanged, migration amends the subscription in place:
|
|
138
|
+
* unchanged items retain their service periods and both response entries have the
|
|
139
|
+
* same ID. Existing addons must remain compatible with the target plan.
|
|
140
|
+
* Incompatible phase timelines or billing settings return an error. Providing
|
|
141
|
+
* starting_phase or a different billing_anchor explicitly requests replacement,
|
|
142
|
+
* which resets the phase timeline, may produce billing adjustments, and does not
|
|
143
|
+
* transfer addons. Custom subscriptions cannot be migrated.
|
|
144
|
+
*
|
|
145
|
+
* POST /openmeter/subscriptions/{subscriptionId}/migrate
|
|
146
|
+
*/
|
|
147
|
+
migrate(request: MigrateSubscriptionRequest, options?: RequestOptions): Promise<MigrateSubscriptionResponse>;
|
|
133
148
|
/**
|
|
134
149
|
* Update subscription addon
|
|
135
150
|
*
|
package/dist/sdk/internal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
4
|
import { voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
5
|
-
import { unscheduleSubscription, restoreSubscription, updateSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
5
|
+
import { unscheduleSubscription, restoreSubscription, migrateSubscription, updateSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
6
6
|
import { listApps, uninstallApp, updateApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
7
7
|
import { listInvoices, getInvoice, updateInvoice, deleteInvoice, advanceInvoice, approveInvoice, retryInvoice, snapshotQuantitiesInvoice, } from '../funcs/invoices.js';
|
|
8
8
|
import { listCharges } from '../funcs/charges.js';
|
|
@@ -176,6 +176,23 @@ export class InternalSubscriptions {
|
|
|
176
176
|
async restore(request, options) {
|
|
177
177
|
return unwrap(await restoreSubscription(this._client, request, options));
|
|
178
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Migrate subscription
|
|
181
|
+
*
|
|
182
|
+
* Migrates to a later version of the current plan. With starting_phase omitted and
|
|
183
|
+
* billing_anchor omitted or unchanged, migration amends the subscription in place:
|
|
184
|
+
* unchanged items retain their service periods and both response entries have the
|
|
185
|
+
* same ID. Existing addons must remain compatible with the target plan.
|
|
186
|
+
* Incompatible phase timelines or billing settings return an error. Providing
|
|
187
|
+
* starting_phase or a different billing_anchor explicitly requests replacement,
|
|
188
|
+
* which resets the phase timeline, may produce billing adjustments, and does not
|
|
189
|
+
* transfer addons. Custom subscriptions cannot be migrated.
|
|
190
|
+
*
|
|
191
|
+
* POST /openmeter/subscriptions/{subscriptionId}/migrate
|
|
192
|
+
*/
|
|
193
|
+
async migrate(request, options) {
|
|
194
|
+
return unwrap(await migrateSubscription(this._client, request, options));
|
|
195
|
+
}
|
|
179
196
|
/**
|
|
180
197
|
* Update subscription addon
|
|
181
198
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse,
|
|
3
|
+
import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, EditSubscriptionRequest, EditSubscriptionResponse, CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
4
4
|
import type { Subscription, SubscriptionAddon } from '../models/types.js';
|
|
5
5
|
export declare class Subscriptions {
|
|
6
6
|
private readonly _client;
|
|
@@ -57,21 +57,6 @@ export declare class Subscriptions {
|
|
|
57
57
|
* POST /openmeter/subscriptions/{subscriptionId}/change
|
|
58
58
|
*/
|
|
59
59
|
change(request: ChangeSubscriptionRequest, options?: RequestOptions): Promise<ChangeSubscriptionResponse>;
|
|
60
|
-
/**
|
|
61
|
-
* Migrate subscription
|
|
62
|
-
*
|
|
63
|
-
* Migrates to a later version of the current plan. With starting_phase omitted and
|
|
64
|
-
* billing_anchor omitted or unchanged, migration amends the subscription in place:
|
|
65
|
-
* unchanged items retain their service periods and both response entries have the
|
|
66
|
-
* same ID. Existing addons must remain compatible with the target plan.
|
|
67
|
-
* Incompatible phase timelines or billing settings return an error. Providing
|
|
68
|
-
* starting_phase or a different billing_anchor explicitly requests replacement,
|
|
69
|
-
* which resets the phase timeline, may produce billing adjustments, and does not
|
|
70
|
-
* transfer addons. Custom subscriptions cannot be migrated.
|
|
71
|
-
*
|
|
72
|
-
* POST /openmeter/subscriptions/{subscriptionId}/migrate
|
|
73
|
-
*/
|
|
74
|
-
migrate(request: MigrateSubscriptionRequest, options?: RequestOptions): Promise<MigrateSubscriptionResponse>;
|
|
75
60
|
/**
|
|
76
61
|
* Edit subscription
|
|
77
62
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
|
-
import { createSubscription, listSubscriptions, getSubscription, cancelSubscription, unscheduleCancelation, changeSubscription,
|
|
4
|
+
import { createSubscription, listSubscriptions, getSubscription, cancelSubscription, unscheduleCancelation, changeSubscription, editSubscription, createSubscriptionAddon, listSubscriptionAddons, getSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
5
5
|
export class Subscriptions {
|
|
6
6
|
_client;
|
|
7
7
|
constructor(_client) {
|
|
@@ -73,23 +73,6 @@ export class Subscriptions {
|
|
|
73
73
|
async change(request, options) {
|
|
74
74
|
return unwrap(await changeSubscription(this._client, request, options));
|
|
75
75
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Migrate subscription
|
|
78
|
-
*
|
|
79
|
-
* Migrates to a later version of the current plan. With starting_phase omitted and
|
|
80
|
-
* billing_anchor omitted or unchanged, migration amends the subscription in place:
|
|
81
|
-
* unchanged items retain their service periods and both response entries have the
|
|
82
|
-
* same ID. Existing addons must remain compatible with the target plan.
|
|
83
|
-
* Incompatible phase timelines or billing settings return an error. Providing
|
|
84
|
-
* starting_phase or a different billing_anchor explicitly requests replacement,
|
|
85
|
-
* which resets the phase timeline, may produce billing adjustments, and does not
|
|
86
|
-
* transfer addons. Custom subscriptions cannot be migrated.
|
|
87
|
-
*
|
|
88
|
-
* POST /openmeter/subscriptions/{subscriptionId}/migrate
|
|
89
|
-
*/
|
|
90
|
-
async migrate(request, options) {
|
|
91
|
-
return unwrap(await migrateSubscription(this._client, request, options));
|
|
92
|
-
}
|
|
93
76
|
/**
|
|
94
77
|
* Edit subscription
|
|
95
78
|
*
|