@leaflow/sdk 0.0.0-dev.240.gecb1b07 → 0.0.0-dev.244.g3e062f3

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.
@@ -95,16 +95,6 @@ export type ListSubscriptionsResult = operations["list-subscriptions"]["response
95
95
  export type ListSubscriptionsQuery = operations["list-subscriptions"]["parameters"]["query"];
96
96
  /** The success response body of `GET /account/v1/subscriptions/{subscriptionId}`. */
97
97
  export type GetSubscriptionResult = operations["get-subscription"]["responses"][200]["content"]["application/json"];
98
- /** The success response body of `GET /account/v1/subscriptions/{subscriptionId}/cancellation-preview`. */
99
- export type PreviewCancellationResult = operations["preview-cancellation"]["responses"][200]["content"]["application/json"];
100
- /** The success response body of `POST /account/v1/subscriptions/{subscriptionId}/cancellation-requests`. */
101
- export type CreateCancellationRequestResult = operations["create-cancellation-request"]["responses"][201]["content"]["application/json"];
102
- /** The request body of `POST /account/v1/subscriptions/{subscriptionId}/cancellation-requests`. */
103
- export type CreateCancellationRequestBody = NonNullable<operations["create-cancellation-request"]["requestBody"]>["content"]["application/json"];
104
- /** The success response body of `GET /account/v1/cancellation-requests/{cancellationRequestId}`. */
105
- export type GetCancellationRequestResult = operations["get-cancellation-request"]["responses"][200]["content"]["application/json"];
106
- /** The success response body of `POST /account/v1/cancellation-requests/{cancellationRequestId}/cancel`. */
107
- export type CancelCancellationRequestResult = operations["cancel-cancellation-request"]["responses"][200]["content"]["application/json"];
108
98
  /** The success response body of `POST /account/v1/quotes`. */
109
99
  export type CreateQuoteResult = operations["create-quote"]["responses"][200]["content"]["application/json"];
110
100
  /** The request body of `POST /account/v1/quotes`. */
@@ -683,104 +683,6 @@ export interface paths {
683
683
  patch?: never;
684
684
  trace?: never;
685
685
  };
686
- "/account/v1/subscriptions/{subscriptionId}/cancellation-preview": {
687
- parameters: {
688
- query?: never;
689
- header?: never;
690
- path: {
691
- subscriptionId: components["parameters"]["SubscriptionId"];
692
- };
693
- cookie?: never;
694
- };
695
- /**
696
- * Preview cancellation
697
- * @deprecated
698
- * @description Reads confirmed terms and paid-period value without recording a request or locking a refund amount.
699
- *
700
- * Use create-quote with a `cancellation`, which quotes the subscriptions released together.
701
- */
702
- get: operations["preview-cancellation"];
703
- put?: never;
704
- post?: never;
705
- delete?: never;
706
- options?: never;
707
- head?: never;
708
- patch?: never;
709
- trace?: never;
710
- };
711
- "/account/v1/subscriptions/{subscriptionId}/cancellation-requests": {
712
- parameters: {
713
- query?: never;
714
- header?: never;
715
- path: {
716
- subscriptionId: components["parameters"]["SubscriptionId"];
717
- };
718
- cookie?: never;
719
- };
720
- get?: never;
721
- put?: never;
722
- /**
723
- * Request subscription cancellation
724
- * @deprecated
725
- * @description Ends the whole subscription under confirmed terms. The request does not itself stop service; actual end is confirmed by the owning service. Refund processing is separate.
726
- *
727
- * Use create-cancellation, which ends the subscriptions released together and checks the refund.
728
- */
729
- post: operations["create-cancellation-request"];
730
- delete?: never;
731
- options?: never;
732
- head?: never;
733
- patch?: never;
734
- trace?: never;
735
- };
736
- "/account/v1/cancellation-requests/{cancellationRequestId}": {
737
- parameters: {
738
- query?: never;
739
- header?: never;
740
- path: {
741
- cancellationRequestId: components["parameters"]["CancellationRequestId"];
742
- };
743
- cookie?: never;
744
- };
745
- /**
746
- * Get cancellation request
747
- * @deprecated
748
- * @description Use get-cancellation.
749
- */
750
- get: operations["get-cancellation-request"];
751
- put?: never;
752
- post?: never;
753
- delete?: never;
754
- options?: never;
755
- head?: never;
756
- patch?: never;
757
- trace?: never;
758
- };
759
- "/account/v1/cancellation-requests/{cancellationRequestId}/cancel": {
760
- parameters: {
761
- query?: never;
762
- header?: never;
763
- path: {
764
- cancellationRequestId: components["parameters"]["CancellationRequestId"];
765
- };
766
- cookie?: never;
767
- };
768
- get?: never;
769
- put?: never;
770
- /**
771
- * Cancel a cancellation request
772
- * @deprecated
773
- * @description Allowed only before release starts. Does not resume a previously suspended subscription.
774
- *
775
- * Use withdraw-cancellation, which withdraws the whole cancellation.
776
- */
777
- post: operations["cancel-cancellation-request"];
778
- delete?: never;
779
- options?: never;
780
- head?: never;
781
- patch?: never;
782
- trace?: never;
783
- };
784
686
  "/account/v1/quotes": {
785
687
  parameters: {
786
688
  query?: never;
@@ -870,7 +772,8 @@ export interface paths {
870
772
  *
871
773
  * Sending the same request again, for the same subscriptions, mode and amount while that
872
774
  * cancellation is still open, returns it with 200 rather than creating another. Renewal orders
873
- * still waiting for payment are canceled along with it.
775
+ * still waiting for payment are canceled along with it, and automatic renewal is turned off for
776
+ * every subscription in the set, for `period_end` as well as `immediate`.
874
777
  */
875
778
  post: operations["create-cancellation"];
876
779
  delete?: never;
@@ -912,8 +815,10 @@ export interface paths {
912
815
  /**
913
816
  * Withdraw a cancellation
914
817
  * @description Withdraws the whole cancellation while none of its resources has begun to be released; the
915
- * subscriptions continue as before. After that it is refused with 409
916
- * `BILLING_CANCELLATION_CONFLICT`. Withdrawing one that is already withdrawn returns it unchanged.
818
+ * subscriptions continue as before, except that automatic renewal, turned off when the
819
+ * cancellation was created, stays off until it is turned on again. After that it is refused with
820
+ * 409 `BILLING_CANCELLATION_CONFLICT`. Withdrawing one that is already withdrawn returns it
821
+ * unchanged.
917
822
  */
918
823
  post: operations["withdraw-cancellation"];
919
824
  delete?: never;
@@ -1017,7 +922,12 @@ export interface paths {
1017
922
  get?: never;
1018
923
  /**
1019
924
  * Set auto renew
1020
- * @description Controls automatic prepaid renewal. Disabling it does not shorten paid_until and still permits manual renewal. Postpaid subscriptions do not renew and keep this false.
925
+ * @description Controls automatic prepaid renewal. Disabling it does not shorten paid_until and still permits
926
+ * manual renewal. Postpaid subscriptions do not renew and keep this false.
927
+ *
928
+ * While the subscription has an open cancellation, turning it on or off is refused with 409
929
+ * `BILLING_SUBSCRIPTION_OPERATION_PENDING` and `meta.cancellation_id`: creating the cancellation
930
+ * turned it off, and withdrawing the cancellation does not turn it back on.
1021
931
  */
1022
932
  put: operations["set-auto-renew"];
1023
933
  post?: never;
@@ -1336,6 +1246,12 @@ export interface components {
1336
1246
  project?: components["schemas"]["NamedIdentity"] | null;
1337
1247
  /** @enum {string} */
1338
1248
  billing_type: "postpaid" | "prepaid" | "one_time";
1249
+ /**
1250
+ * @description Whether automatic renewal is on now. Creating the cancellation turns it off, and withdrawing
1251
+ * the cancellation does not turn it back on. Always false for a subscription that is not
1252
+ * `prepaid`.
1253
+ */
1254
+ auto_renew: boolean;
1339
1255
  unused_amount: components["schemas"]["Money"];
1340
1256
  refundable_amount: components["schemas"]["Money"];
1341
1257
  refund_amount: components["schemas"]["Money"];
@@ -1387,6 +1303,12 @@ export interface components {
1387
1303
  * @enum {string}
1388
1304
  */
1389
1305
  origin: "customer" | "operator" | "project_deletion";
1306
+ /**
1307
+ * Format: int64
1308
+ * @description The billing account that paid for these subscriptions when the cancellation was created: the
1309
+ * account of an account-level purchase, or the account the project was linked to.
1310
+ */
1311
+ billing_account_id: number;
1390
1312
  currency: string;
1391
1313
  /** @description The refund confirmed when it was created. Absent when the platform created it. */
1392
1314
  expected_refundable_amount?: components["schemas"]["Money"];
@@ -1415,6 +1337,12 @@ export interface components {
1415
1337
  /** Format: uuid */
1416
1338
  plan_id: string;
1417
1339
  plan_name: string;
1340
+ /**
1341
+ * @description How the subscription is paid for. Only a `prepaid` subscription renews automatically; creating
1342
+ * the cancellation turned that off, and withdrawing the cancellation leaves it off.
1343
+ * @enum {string}
1344
+ */
1345
+ billing_type: "postpaid" | "prepaid" | "one_time";
1418
1346
  /** @enum {string} */
1419
1347
  status: "requested" | "scheduled" | "releasing" | "completed" | "canceled" | "failed";
1420
1348
  /** Format: date-time */
@@ -1436,21 +1364,6 @@ export interface components {
1436
1364
  /** Format: int64 */
1437
1365
  total_count?: number;
1438
1366
  };
1439
- CancellationPreview: {
1440
- /** Format: uuid */
1441
- subscription_id: string;
1442
- mode: components["schemas"]["TerminationPolicy"];
1443
- /** Format: date-time */
1444
- scheduled_at?: string;
1445
- refundable_amount: string;
1446
- currency: string;
1447
- };
1448
- CancellationRequestCreate: {
1449
- mode?: components["schemas"]["TerminationPolicy"];
1450
- /** @default false */
1451
- forfeit_remaining_value?: boolean;
1452
- reason: string;
1453
- };
1454
1367
  /** @description A cancellation request for the original purchase. scheduled_at is the intended time; effective_at is the confirmed end of service. The request alone does not stop metering or issue a refund. */
1455
1368
  CancellationRequest: {
1456
1369
  reason?: string;
@@ -3090,7 +3003,6 @@ export interface components {
3090
3003
  InvoiceId: string;
3091
3004
  OrderId: string;
3092
3005
  CancellationId: string;
3093
- CancellationRequestId: string;
3094
3006
  SubscriptionId: string;
3095
3007
  PaymentMethodId: string;
3096
3008
  };
@@ -3995,102 +3907,6 @@ export interface operations {
3995
3907
  default: components["responses"]["Error"];
3996
3908
  };
3997
3909
  };
3998
- "preview-cancellation": {
3999
- parameters: {
4000
- query?: never;
4001
- header?: never;
4002
- path: {
4003
- subscriptionId: components["parameters"]["SubscriptionId"];
4004
- };
4005
- cookie?: never;
4006
- };
4007
- requestBody?: never;
4008
- responses: {
4009
- /** @description Cancellation estimate */
4010
- 200: {
4011
- headers: {
4012
- [name: string]: unknown;
4013
- };
4014
- content: {
4015
- "application/json": components["schemas"]["CancellationPreview"];
4016
- };
4017
- };
4018
- default: components["responses"]["Error"];
4019
- };
4020
- };
4021
- "create-cancellation-request": {
4022
- parameters: {
4023
- query?: never;
4024
- header?: never;
4025
- path: {
4026
- subscriptionId: components["parameters"]["SubscriptionId"];
4027
- };
4028
- cookie?: never;
4029
- };
4030
- requestBody: {
4031
- content: {
4032
- "application/json": components["schemas"]["CancellationRequestCreate"];
4033
- };
4034
- };
4035
- responses: {
4036
- /** @description Cancellation requested */
4037
- 201: {
4038
- headers: {
4039
- [name: string]: unknown;
4040
- };
4041
- content: {
4042
- "application/json": components["schemas"]["CancellationRequest"];
4043
- };
4044
- };
4045
- default: components["responses"]["Error"];
4046
- };
4047
- };
4048
- "get-cancellation-request": {
4049
- parameters: {
4050
- query?: never;
4051
- header?: never;
4052
- path: {
4053
- cancellationRequestId: components["parameters"]["CancellationRequestId"];
4054
- };
4055
- cookie?: never;
4056
- };
4057
- requestBody?: never;
4058
- responses: {
4059
- /** @description Request and actual end receipt */
4060
- 200: {
4061
- headers: {
4062
- [name: string]: unknown;
4063
- };
4064
- content: {
4065
- "application/json": components["schemas"]["CancellationRequest"];
4066
- };
4067
- };
4068
- default: components["responses"]["Error"];
4069
- };
4070
- };
4071
- "cancel-cancellation-request": {
4072
- parameters: {
4073
- query?: never;
4074
- header?: never;
4075
- path: {
4076
- cancellationRequestId: components["parameters"]["CancellationRequestId"];
4077
- };
4078
- cookie?: never;
4079
- };
4080
- requestBody?: never;
4081
- responses: {
4082
- /** @description Canceled request */
4083
- 200: {
4084
- headers: {
4085
- [name: string]: unknown;
4086
- };
4087
- content: {
4088
- "application/json": components["schemas"]["CancellationRequest"];
4089
- };
4090
- };
4091
- default: components["responses"]["Error"];
4092
- };
4093
- };
4094
3910
  "create-quote": {
4095
3911
  parameters: {
4096
3912
  query?: never;
@@ -112,6 +112,10 @@ export interface paths {
112
112
  * Set project auto renew
113
113
  * @description Automatic renewal draws on the project billing account's balance, which a project member may
114
114
  * commit. Paying by card requires the account owner and is done from the billing centre.
115
+ *
116
+ * While the subscription has an open cancellation, turning it on or off is refused with 409
117
+ * `BILLING_SUBSCRIPTION_OPERATION_PENDING` and `meta.cancellation_id`: creating the cancellation
118
+ * turned it off, and withdrawing the cancellation does not turn it back on.
115
119
  */
116
120
  put: operations["set-project-auto-renew"];
117
121
  post?: never;
@@ -175,7 +179,8 @@ export interface paths {
175
179
  *
176
180
  * Sending the same request again, for the same subscriptions, mode and amount while that
177
181
  * cancellation is still open, returns it with 200 rather than creating another. Renewal orders
178
- * still waiting for payment are canceled along with it.
182
+ * still waiting for payment are canceled along with it, and automatic renewal is turned off for
183
+ * every subscription in the set, for `period_end` as well as `immediate`.
179
184
  */
180
185
  post: operations["create-project-cancellation"];
181
186
  delete?: never;
@@ -219,8 +224,10 @@ export interface paths {
219
224
  /**
220
225
  * Withdraw a cancellation
221
226
  * @description Withdraws the whole cancellation while none of its resources has begun to be released; the
222
- * subscriptions continue as before. After that it is refused with 409
223
- * `BILLING_CANCELLATION_CONFLICT`. Withdrawing one that is already withdrawn returns it unchanged.
227
+ * subscriptions continue as before, except that automatic renewal, turned off when the
228
+ * cancellation was created, stays off until it is turned on again. After that it is refused with
229
+ * 409 `BILLING_CANCELLATION_CONFLICT`. Withdrawing one that is already withdrawn returns it
230
+ * unchanged.
224
231
  */
225
232
  post: operations["withdraw-project-cancellation"];
226
233
  delete?: never;
@@ -474,6 +481,12 @@ export interface components {
474
481
  project?: components["schemas"]["NamedIdentity"] | null;
475
482
  /** @enum {string} */
476
483
  billing_type: "postpaid" | "prepaid" | "one_time";
484
+ /**
485
+ * @description Whether automatic renewal is on now. Creating the cancellation turns it off, and withdrawing
486
+ * the cancellation does not turn it back on. Always false for a subscription that is not
487
+ * `prepaid`.
488
+ */
489
+ auto_renew: boolean;
477
490
  unused_amount: components["schemas"]["Money"];
478
491
  refundable_amount: components["schemas"]["Money"];
479
492
  refund_amount: components["schemas"]["Money"];
@@ -525,6 +538,12 @@ export interface components {
525
538
  * @enum {string}
526
539
  */
527
540
  origin: "customer" | "operator" | "project_deletion";
541
+ /**
542
+ * Format: int64
543
+ * @description The billing account that paid for these subscriptions when the cancellation was created: the
544
+ * account of an account-level purchase, or the account the project was linked to.
545
+ */
546
+ billing_account_id: number;
528
547
  currency: string;
529
548
  /** @description The refund confirmed when it was created. Absent when the platform created it. */
530
549
  expected_refundable_amount?: components["schemas"]["Money"];
@@ -553,6 +572,12 @@ export interface components {
553
572
  /** Format: uuid */
554
573
  plan_id: string;
555
574
  plan_name: string;
575
+ /**
576
+ * @description How the subscription is paid for. Only a `prepaid` subscription renews automatically; creating
577
+ * the cancellation turned that off, and withdrawing the cancellation leaves it off.
578
+ * @enum {string}
579
+ */
580
+ billing_type: "postpaid" | "prepaid" | "one_time";
556
581
  /** @enum {string} */
557
582
  status: "requested" | "scheduled" | "releasing" | "completed" | "canceled" | "failed";
558
583
  /** Format: date-time */
@@ -753,6 +753,8 @@ export interface paths {
753
753
  /**
754
754
  * Detach a disk
755
755
  * @description Unmount the device inside the instance before calling this endpoint. Forcibly detaching a file system that is being written to corrupts data.
756
+ *
757
+ * The disk the instance boots from cannot be detached, whether it is the system disk bought with the instance or a disk the instance was created from with `boot_disk_id`. Such a request is refused with `INSTANCE_BOOT_DISK_LOCKED` and creates no task; releasing the instance is what frees that disk.
756
758
  */
757
759
  delete: operations["detach-disk"];
758
760
  options?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.0.0-dev.240.gecb1b07",
3
+ "version": "0.0.0-dev.244.g3e062f3",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {