@leaflow/sdk 0.109.0 → 0.111.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.
Files changed (39) hide show
  1. package/dist/billing/v1/generated/functions.d.ts +172 -12
  2. package/dist/billing/v1/generated/functions.js +210 -11
  3. package/dist/billing/v1/generated/models.d.ts +115 -3
  4. package/dist/billing/v1/generated/models.js +5 -0
  5. package/dist/billing/v1/generated/schemas.zod.d.ts +116 -10
  6. package/dist/billing/v1/generated/schemas.zod.js +130 -10
  7. package/dist/billing/v1/generated/validators/cancelSubscriptionRequest.zod.d.ts +21 -0
  8. package/dist/billing/v1/generated/validators/cancelSubscriptionRequest.zod.js +21 -0
  9. package/dist/billing/v1/generated/validators/cancellationCreate.zod.js +1 -1
  10. package/dist/billing/v1/generated/validators/creditNote.zod.d.ts +24 -0
  11. package/dist/billing/v1/generated/validators/creditNote.zod.js +28 -0
  12. package/dist/billing/v1/generated/validators/creditNoteItem.zod.d.ts +17 -0
  13. package/dist/billing/v1/generated/validators/creditNoteItem.zod.js +16 -0
  14. package/dist/billing/v1/generated/validators/creditNoteItemList.zod.d.ts +24 -0
  15. package/dist/billing/v1/generated/validators/creditNoteItemList.zod.js +14 -0
  16. package/dist/billing/v1/generated/validators/creditNoteList.zod.d.ts +31 -0
  17. package/dist/billing/v1/generated/validators/creditNoteList.zod.js +14 -0
  18. package/dist/billing/v1/generated/validators/invoice.zod.d.ts +2 -0
  19. package/dist/billing/v1/generated/validators/invoice.zod.js +3 -1
  20. package/dist/billing/v1/generated/validators/invoiceList.zod.d.ts +2 -0
  21. package/dist/billing/v1/generated/validators/invoiceSummary.zod.d.ts +2 -0
  22. package/dist/billing/v1/generated/validators/invoiceSummary.zod.js +4 -1
  23. package/dist/billing/v1/generated/validators/listCreditNoteItemsParams.zod.d.ts +18 -0
  24. package/dist/billing/v1/generated/validators/listCreditNoteItemsParams.zod.js +24 -0
  25. package/dist/billing/v1/generated/validators/listCreditNotesParams.zod.d.ts +20 -0
  26. package/dist/billing/v1/generated/validators/listCreditNotesParams.zod.js +26 -0
  27. package/dist/billing/v1/generated/validators/order.zod.d.ts +2 -1
  28. package/dist/billing/v1/generated/validators/order.zod.js +0 -1
  29. package/dist/billing/v1/generated/validators/orderCancel.zod.d.ts +14 -0
  30. package/dist/billing/v1/generated/validators/orderCancel.zod.js +17 -0
  31. package/dist/billing/v1/generated/validators/orderList.zod.d.ts +2 -1
  32. package/dist/billing/v1/generated/validators/subscription.zod.d.ts +1 -0
  33. package/dist/billing/v1/generated/validators/subscription.zod.js +1 -1
  34. package/dist/billing/v1/generated/validators/subscriptionList.zod.d.ts +1 -0
  35. package/dist/billing/v1/generated/validators/terminateSubscriptionRequest.zod.d.ts +15 -0
  36. package/dist/billing/v1/generated/validators/terminateSubscriptionRequest.zod.js +16 -0
  37. package/dist/routes.d.ts +48 -0
  38. package/dist/routes.js +54 -0
  39. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const listCreditNoteItemsParamsPageDefault = 1;
10
+ export declare const listCreditNoteItemsParamsPageMax = 2147483647;
11
+ export declare const listCreditNoteItemsParamsPageSizeDefault = 50;
12
+ export declare const listCreditNoteItemsParamsPageSizeMax = 200;
13
+ export declare const ListCreditNoteItemsParams: zod.ZodObject<{
14
+ page: zod.ZodDefault<zod.ZodInt>;
15
+ page_size: zod.ZodDefault<zod.ZodInt>;
16
+ }, zod.z.core.$strict>;
17
+ export type ListCreditNoteItemsParams = zod.input<typeof ListCreditNoteItemsParams>;
18
+ export type ListCreditNoteItemsParamsOutput = zod.output<typeof ListCreditNoteItemsParams>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export const listCreditNoteItemsParamsPageDefault = 1;
10
+ export const listCreditNoteItemsParamsPageMax = 2147483647;
11
+ export const listCreditNoteItemsParamsPageSizeDefault = 50;
12
+ export const listCreditNoteItemsParamsPageSizeMax = 200;
13
+ export const ListCreditNoteItemsParams = zod.strictObject({
14
+ page: zod
15
+ .int()
16
+ .min(1)
17
+ .max(listCreditNoteItemsParamsPageMax)
18
+ .default(listCreditNoteItemsParamsPageDefault),
19
+ page_size: zod
20
+ .int()
21
+ .min(1)
22
+ .max(listCreditNoteItemsParamsPageSizeMax)
23
+ .default(listCreditNoteItemsParamsPageSizeDefault),
24
+ });
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const listCreditNotesParamsPageDefault = 1;
10
+ export declare const listCreditNotesParamsPageMax = 2147483647;
11
+ export declare const listCreditNotesParamsPageSizeDefault = 50;
12
+ export declare const listCreditNotesParamsPageSizeMax = 200;
13
+ export declare const ListCreditNotesParams: zod.ZodObject<{
14
+ page: zod.ZodDefault<zod.ZodInt>;
15
+ page_size: zod.ZodDefault<zod.ZodInt>;
16
+ billing_account_id: zod.ZodOptional<zod.ZodInt>;
17
+ invoice_id: zod.ZodOptional<zod.ZodUUID>;
18
+ }, zod.z.core.$strict>;
19
+ export type ListCreditNotesParams = zod.input<typeof ListCreditNotesParams>;
20
+ export type ListCreditNotesParamsOutput = zod.output<typeof ListCreditNotesParams>;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export const listCreditNotesParamsPageDefault = 1;
10
+ export const listCreditNotesParamsPageMax = 2147483647;
11
+ export const listCreditNotesParamsPageSizeDefault = 50;
12
+ export const listCreditNotesParamsPageSizeMax = 200;
13
+ export const ListCreditNotesParams = zod.strictObject({
14
+ page: zod
15
+ .int()
16
+ .min(1)
17
+ .max(listCreditNotesParamsPageMax)
18
+ .default(listCreditNotesParamsPageDefault),
19
+ page_size: zod
20
+ .int()
21
+ .min(1)
22
+ .max(listCreditNotesParamsPageSizeMax)
23
+ .default(listCreditNotesParamsPageSizeDefault),
24
+ billing_account_id: zod.int().optional(),
25
+ invoice_id: zod.uuid().optional(),
26
+ });
@@ -32,6 +32,8 @@ export declare const Order: zod.ZodObject<{
32
32
  tax_amount: zod.ZodString;
33
33
  total: zod.ZodString;
34
34
  amount_paid: zod.ZodString;
35
+ unpaid_credit_notes_amount: zod.ZodString;
36
+ paid_credit_notes_amount: zod.ZodString;
35
37
  amount_due: zod.ZodString;
36
38
  amount_refunded: zod.ZodString;
37
39
  due_at: zod.ZodOptional<zod.z.ZodISODateTime>;
@@ -48,7 +50,6 @@ export declare const Order: zod.ZodObject<{
48
50
  name: zod.ZodString;
49
51
  currency: zod.ZodString;
50
52
  }, zod.z.core.$strict>>;
51
- cancel_reason: zod.ZodOptional<zod.ZodString>;
52
53
  change_effective_at: zod.ZodOptional<zod.z.ZodISODateTime>;
53
54
  id: zod.ZodUUID;
54
55
  project_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
@@ -25,7 +25,6 @@ export const Order = zod
25
25
  invoice: InvoiceSummary.optional(),
26
26
  paid_with: PaidWith.optional().describe("How the order was paid. Absent until it is paid."),
27
27
  account: AccountIdentity.optional(),
28
- cancel_reason: zod.string().optional(),
29
28
  change_effective_at: zod.iso.datetime({ offset: true }).optional(),
30
29
  id: zod.uuid(),
31
30
  project_id: zod
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const orderCancelOrderItemIdsMax = 100;
10
+ export declare const OrderCancel: zod.ZodObject<{
11
+ order_item_ids: zod.ZodOptional<zod.ZodArray<zod.ZodUUID>>;
12
+ }, zod.z.core.$strict>;
13
+ export type OrderCancel = zod.input<typeof OrderCancel>;
14
+ export type OrderCancelOutput = zod.output<typeof OrderCancel>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export const orderCancelOrderItemIdsMax = 100;
10
+ export const OrderCancel = zod.strictObject({
11
+ order_item_ids: zod
12
+ .array(zod.uuid())
13
+ .min(1)
14
+ .max(orderCancelOrderItemIdsMax)
15
+ .optional()
16
+ .describe("Omit to select all still-pending items. Explicit selections name one or more items of this order; successful items cannot be reversed here."),
17
+ });
@@ -33,6 +33,8 @@ export declare const OrderList: zod.ZodObject<{
33
33
  tax_amount: zod.ZodString;
34
34
  total: zod.ZodString;
35
35
  amount_paid: zod.ZodString;
36
+ unpaid_credit_notes_amount: zod.ZodString;
37
+ paid_credit_notes_amount: zod.ZodString;
36
38
  amount_due: zod.ZodString;
37
39
  amount_refunded: zod.ZodString;
38
40
  due_at: zod.ZodOptional<zod.z.ZodISODateTime>;
@@ -49,7 +51,6 @@ export declare const OrderList: zod.ZodObject<{
49
51
  name: zod.ZodString;
50
52
  currency: zod.ZodString;
51
53
  }, zod.z.core.$strict>>;
52
- cancel_reason: zod.ZodOptional<zod.ZodString>;
53
54
  change_effective_at: zod.ZodOptional<zod.z.ZodISODateTime>;
54
55
  id: zod.ZodUUID;
55
56
  project_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
@@ -104,6 +104,7 @@ export declare const Subscription: zod.ZodObject<{
104
104
  pending: "pending";
105
105
  active: "active";
106
106
  suspended: "suspended";
107
+ deleted: "deleted";
107
108
  canceled: "canceled";
108
109
  provisioning: "provisioning";
109
110
  terminated: "terminated";
@@ -69,7 +69,7 @@ export const Subscription = zod
69
69
  .describe("End of the prepaid service already activated. Null until a new subscription becomes active,\neven when its purchase has been paid, and for postpaid subscriptions with no prepaid end date."),
70
70
  auto_renew: zod.boolean(),
71
71
  status: zod
72
- .enum(["pending", "provisioning", "active", "suspended", "canceled", "terminated"])
72
+ .enum(["pending", "provisioning", "active", "suspended", "canceled", "terminated", "deleted"])
73
73
  .describe("pending means the purchase relationship exists but its order has not been accepted.\nprovisioning means the service accepted the order and is delivering. For a service-owned\npurchase, only confirmed delivery moves it to active; paying alone does not."),
74
74
  started_at: zod.iso
75
75
  .datetime({ offset: true })
@@ -104,6 +104,7 @@ export declare const SubscriptionList: zod.ZodObject<{
104
104
  pending: "pending";
105
105
  active: "active";
106
106
  suspended: "suspended";
107
+ deleted: "deleted";
107
108
  canceled: "canceled";
108
109
  provisioning: "provisioning";
109
110
  terminated: "terminated";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const terminateSubscriptionRequestReasonMin = 8;
10
+ export declare const terminateSubscriptionRequestReasonMax = 1024;
11
+ export declare const TerminateSubscriptionRequest: zod.ZodObject<{
12
+ reason: zod.ZodString;
13
+ }, zod.z.core.$strict>;
14
+ export type TerminateSubscriptionRequest = zod.input<typeof TerminateSubscriptionRequest>;
15
+ export type TerminateSubscriptionRequestOutput = zod.output<typeof TerminateSubscriptionRequest>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export const terminateSubscriptionRequestReasonMin = 8;
10
+ export const terminateSubscriptionRequestReasonMax = 1024;
11
+ export const TerminateSubscriptionRequest = zod.strictObject({
12
+ reason: zod
13
+ .string()
14
+ .min(terminateSubscriptionRequestReasonMin)
15
+ .max(terminateSubscriptionRequestReasonMax),
16
+ });
package/dist/routes.d.ts CHANGED
@@ -1,4 +1,28 @@
1
1
  export declare const routes: readonly [{
2
+ readonly service: "billing";
3
+ readonly contract: "billing";
4
+ readonly method: "GET";
5
+ readonly path: "/api/v1/credit-notes";
6
+ readonly operationId: "list-credit-notes";
7
+ readonly securityScheme: "AccessToken";
8
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
9
+ }, {
10
+ readonly service: "billing";
11
+ readonly contract: "billing";
12
+ readonly method: "GET";
13
+ readonly path: "/api/v1/credit-notes/{creditNoteId}";
14
+ readonly operationId: "get-credit-note";
15
+ readonly securityScheme: "AccessToken";
16
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
17
+ }, {
18
+ readonly service: "billing";
19
+ readonly contract: "billing";
20
+ readonly method: "GET";
21
+ readonly path: "/api/v1/credit-notes/{creditNoteId}/items";
22
+ readonly operationId: "list-credit-note-items";
23
+ readonly securityScheme: "AccessToken";
24
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
25
+ }, {
2
26
  readonly service: "account";
3
27
  readonly contract: "account";
4
28
  readonly method: "GET";
@@ -3246,5 +3270,29 @@ export declare const routes: readonly [{
3246
3270
  readonly operationId: "rotate-l4-tunnel-subscription";
3247
3271
  readonly securityScheme: "ScopedToken";
3248
3272
  readonly upstreamUrl: "https://tunnel.leaflow.cloud";
3273
+ }, {
3274
+ readonly service: "billing";
3275
+ readonly contract: "billing";
3276
+ readonly method: "DELETE";
3277
+ readonly path: "/api/v1/subscriptions/{subscriptionId}";
3278
+ readonly operationId: "delete-subscription";
3279
+ readonly securityScheme: "AccessToken";
3280
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
3281
+ }, {
3282
+ readonly service: "billing";
3283
+ readonly contract: "billing";
3284
+ readonly method: "POST";
3285
+ readonly path: "/api/v1/subscriptions/{subscriptionId}/cancel";
3286
+ readonly operationId: "cancel-subscription";
3287
+ readonly securityScheme: "AccessToken";
3288
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
3289
+ }, {
3290
+ readonly service: "billing";
3291
+ readonly contract: "billing";
3292
+ readonly method: "POST";
3293
+ readonly path: "/api/v1/subscriptions/{subscriptionId}/terminate";
3294
+ readonly operationId: "terminate-subscription";
3295
+ readonly securityScheme: "AccessToken";
3296
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
3249
3297
  }];
3250
3298
  export type Route = (typeof routes)[number];
package/dist/routes.js CHANGED
@@ -1,5 +1,32 @@
1
1
  // Static contract routing and authentication facts for frontend gateways.
2
2
  export const routes = [
3
+ {
4
+ service: "billing",
5
+ contract: "billing",
6
+ method: "GET",
7
+ path: "/api/v1/credit-notes",
8
+ operationId: "list-credit-notes",
9
+ securityScheme: "AccessToken",
10
+ upstreamUrl: "https://billing.leaflow.cloud",
11
+ },
12
+ {
13
+ service: "billing",
14
+ contract: "billing",
15
+ method: "GET",
16
+ path: "/api/v1/credit-notes/{creditNoteId}",
17
+ operationId: "get-credit-note",
18
+ securityScheme: "AccessToken",
19
+ upstreamUrl: "https://billing.leaflow.cloud",
20
+ },
21
+ {
22
+ service: "billing",
23
+ contract: "billing",
24
+ method: "GET",
25
+ path: "/api/v1/credit-notes/{creditNoteId}/items",
26
+ operationId: "list-credit-note-items",
27
+ securityScheme: "AccessToken",
28
+ upstreamUrl: "https://billing.leaflow.cloud",
29
+ },
3
30
  {
4
31
  service: "account",
5
32
  contract: "account",
@@ -3654,4 +3681,31 @@ export const routes = [
3654
3681
  securityScheme: "ScopedToken",
3655
3682
  upstreamUrl: "https://tunnel.leaflow.cloud",
3656
3683
  },
3684
+ {
3685
+ service: "billing",
3686
+ contract: "billing",
3687
+ method: "DELETE",
3688
+ path: "/api/v1/subscriptions/{subscriptionId}",
3689
+ operationId: "delete-subscription",
3690
+ securityScheme: "AccessToken",
3691
+ upstreamUrl: "https://billing.leaflow.cloud",
3692
+ },
3693
+ {
3694
+ service: "billing",
3695
+ contract: "billing",
3696
+ method: "POST",
3697
+ path: "/api/v1/subscriptions/{subscriptionId}/cancel",
3698
+ operationId: "cancel-subscription",
3699
+ securityScheme: "AccessToken",
3700
+ upstreamUrl: "https://billing.leaflow.cloud",
3701
+ },
3702
+ {
3703
+ service: "billing",
3704
+ contract: "billing",
3705
+ method: "POST",
3706
+ path: "/api/v1/subscriptions/{subscriptionId}/terminate",
3707
+ operationId: "terminate-subscription",
3708
+ securityScheme: "AccessToken",
3709
+ upstreamUrl: "https://billing.leaflow.cloud",
3710
+ },
3657
3711
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.109.0",
3
+ "version": "0.111.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {