@leaflow/sdk 0.31.0 → 0.32.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.
- package/dist/billing/v1/index.d.ts +3 -3
- package/dist/billing/v1/schema.d.ts +40 -20
- package/package.json +65 -65
|
@@ -38,10 +38,10 @@ export type CancelSubscriptionResult = operations["cancel-subscription"]["respon
|
|
|
38
38
|
export type CancelSubscriptionQuery = operations["cancel-subscription"]["parameters"]["query"];
|
|
39
39
|
/** `GET /account/v1/billing-accounts/{accountKey}/top-ups/{paymentId}` 成功时的响应体。 */
|
|
40
40
|
export type ReadTopUpResult = operations["read-top-up"]["responses"][200]["content"]["application/json"];
|
|
41
|
-
/** `GET /account/v1/billing-accounts/{accountKey}/
|
|
41
|
+
/** `GET /account/v1/billing-accounts/{accountKey}/payment-method` 成功时的响应体。 */
|
|
42
42
|
export type ReadPaymentMethodResult = operations["read-payment-method"]["responses"][200]["content"]["application/json"];
|
|
43
|
-
/** `POST /account/v1/billing-accounts/{accountKey}/
|
|
44
|
-
export type
|
|
43
|
+
/** `POST /account/v1/billing-accounts/{accountKey}/payment-method` 成功时的响应体。 */
|
|
44
|
+
export type StartPaymentMethodSetupResult = operations["start-payment-method-setup"]["responses"][200]["content"]["application/json"];
|
|
45
45
|
/** `POST /account/v1/billing-accounts/{accountKey}/billing-portal` 成功时的响应体。 */
|
|
46
46
|
export type StartBillingPortalResult = operations["start-billing-portal"]["responses"][200]["content"]["application/json"];
|
|
47
47
|
/** `GET /account/v1/billing-accounts/{accountKey}/offers` 成功时的响应体。 */
|
|
@@ -363,7 +363,7 @@ export interface paths {
|
|
|
363
363
|
patch?: never;
|
|
364
364
|
trace?: never;
|
|
365
365
|
};
|
|
366
|
-
"/account/v1/billing-accounts/{accountKey}/
|
|
366
|
+
"/account/v1/billing-accounts/{accountKey}/payment-method": {
|
|
367
367
|
parameters: {
|
|
368
368
|
query?: never;
|
|
369
369
|
header?: never;
|
|
@@ -372,46 +372,58 @@ export interface paths {
|
|
|
372
372
|
};
|
|
373
373
|
/**
|
|
374
374
|
* Whether this account can be charged
|
|
375
|
-
* @description Answers whether a
|
|
375
|
+
* @description Answers whether a payment method is on file, and nothing else.
|
|
376
|
+
*
|
|
377
|
+
* ## It is a payment method, not a card
|
|
378
|
+
*
|
|
379
|
+
* A card is one kind. Direct debit and the recurring-payment mandates offered by regional
|
|
380
|
+
* wallets are others, and they occupy the same slot: something the provider can charge later
|
|
381
|
+
* without the account holder present. Naming the slot after cards would put an assumption
|
|
382
|
+
* into the contract that stops being true the day a second kind is accepted.
|
|
376
383
|
*
|
|
377
384
|
* ## Why there is no brand, no last four digits, no expiry
|
|
378
385
|
*
|
|
379
386
|
* Those would have to be read from the payment provider, and the two answers can disagree: a
|
|
380
|
-
*
|
|
387
|
+
* method present at the provider that the billing engine has not recorded as the default is
|
|
381
388
|
* exactly the state in which money cannot be collected — while a page built on the provider's
|
|
382
|
-
* answer would be showing
|
|
389
|
+
* answer would be showing one. What matters here is whether the party that will run the
|
|
383
390
|
* charge believes it can, so the answer comes from that party alone.
|
|
384
391
|
*
|
|
385
|
-
* To see
|
|
392
|
+
* To see it, replace it, or remove it, open the billing portal.
|
|
386
393
|
*
|
|
387
394
|
* ## Read this before offering a paid plan, not after
|
|
388
395
|
*
|
|
389
396
|
* `ready` being false is why the engine refuses to start a paid subscription. Discovering it
|
|
390
|
-
* at purchase time turns a missing
|
|
391
|
-
* else entirely.
|
|
397
|
+
* at purchase time turns a missing payment method into a rejection whose wording is about
|
|
398
|
+
* something else entirely.
|
|
392
399
|
*
|
|
393
|
-
* An account that has never had
|
|
400
|
+
* An account that has never had one returns `ready: false`. That is the normal state of a
|
|
394
401
|
* new account, not an error.
|
|
395
402
|
*/
|
|
396
403
|
get: operations["read-payment-method"];
|
|
397
404
|
put?: never;
|
|
398
405
|
/**
|
|
399
|
-
* Add or replace the
|
|
400
|
-
* @description Begins adding a
|
|
401
|
-
* payment provider's own page, and **no card data ever reaches this
|
|
406
|
+
* Add or replace the payment method on file
|
|
407
|
+
* @description Begins adding a payment method. Returns a URL to send the browser to; the details are
|
|
408
|
+
* entered there, on the payment provider's own page, and **no card data ever reaches this
|
|
409
|
+
* platform**.
|
|
410
|
+
*
|
|
411
|
+
* Which kinds are offered is the provider's decision, not this API's — a card today, a
|
|
412
|
+
* wallet mandate or a direct debit wherever the provider supports charging one later without
|
|
413
|
+
* the account holder present.
|
|
402
414
|
*
|
|
403
415
|
* ## This is a prerequisite for buying a plan, not a convenience
|
|
404
416
|
*
|
|
405
|
-
* A plan is charged by invoice, and the invoice is collected from the
|
|
406
|
-
*
|
|
417
|
+
* A plan is charged by invoice, and the invoice is collected from the method on file. A
|
|
418
|
+
* subscription cannot start for an account that has none — so "add a payment method, then
|
|
407
419
|
* buy" is the order the system requires, not a flow that was chosen.
|
|
408
420
|
*
|
|
409
421
|
* It is *not* a prerequisite for topping up: a top-up collects the money there and then.
|
|
410
422
|
*
|
|
411
|
-
* Replacing
|
|
412
|
-
*
|
|
423
|
+
* Replacing uses the same operation. The new method becomes the default and the old one stops
|
|
424
|
+
* being used; nothing else about the account changes.
|
|
413
425
|
*/
|
|
414
|
-
post: operations["start-
|
|
426
|
+
post: operations["start-payment-method-setup"];
|
|
415
427
|
delete?: never;
|
|
416
428
|
options?: never;
|
|
417
429
|
head?: never;
|
|
@@ -790,7 +802,7 @@ export interface components {
|
|
|
790
802
|
*/
|
|
791
803
|
offer_key?: string;
|
|
792
804
|
};
|
|
793
|
-
|
|
805
|
+
PaymentMethodSetupSession: {
|
|
794
806
|
/**
|
|
795
807
|
* Format: uri
|
|
796
808
|
* @description Send the browser here. It expires, so do not store it
|
|
@@ -804,7 +816,12 @@ export interface components {
|
|
|
804
816
|
*/
|
|
805
817
|
url: string;
|
|
806
818
|
};
|
|
807
|
-
/**
|
|
819
|
+
/**
|
|
820
|
+
* @description Whether money can be collected from this account later, without the account holder present.
|
|
821
|
+
*
|
|
822
|
+
* Deliberately not called a card: a card is one kind of payment method, and direct debit and
|
|
823
|
+
* the recurring mandates offered by regional wallets occupy the same slot.
|
|
824
|
+
*/
|
|
808
825
|
PaymentMethod: {
|
|
809
826
|
/**
|
|
810
827
|
* @description True when the billing engine holds a default payment method for this account and can
|
|
@@ -814,6 +831,9 @@ export interface components {
|
|
|
814
831
|
* subscription is refused, and the refusal is about billing setup rather than about the
|
|
815
832
|
* plan — so check this first and say what is actually missing.
|
|
816
833
|
*
|
|
834
|
+
* It says nothing about which kind is on file. To show or change that, send the account
|
|
835
|
+
* holder to the billing portal.
|
|
836
|
+
*
|
|
817
837
|
* A free plan does not require it, which is what allows a new account to be placed on the
|
|
818
838
|
* default tier before anyone has entered a card.
|
|
819
839
|
*/
|
|
@@ -1556,7 +1576,7 @@ export interface operations {
|
|
|
1556
1576
|
};
|
|
1557
1577
|
};
|
|
1558
1578
|
};
|
|
1559
|
-
"start-
|
|
1579
|
+
"start-payment-method-setup": {
|
|
1560
1580
|
parameters: {
|
|
1561
1581
|
query?: never;
|
|
1562
1582
|
header?: never;
|
|
@@ -1577,7 +1597,7 @@ export interface operations {
|
|
|
1577
1597
|
[name: string]: unknown;
|
|
1578
1598
|
};
|
|
1579
1599
|
content: {
|
|
1580
|
-
"application/json": components["schemas"]["
|
|
1600
|
+
"application/json": components["schemas"]["PaymentMethodSetupSession"];
|
|
1581
1601
|
};
|
|
1582
1602
|
};
|
|
1583
1603
|
/** @description Error */
|
package/package.json
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"name": "@leaflow/sdk",
|
|
3
|
+
"version": "0.32.0",
|
|
4
|
+
"description": "Leaflow 平台 API 的 TypeScript SDK",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/leaflowapis/leaflow-ts.git"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
9
17
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"default": "./dist/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./account/v1": {
|
|
19
|
-
"types": "./dist/account/v1/index.d.ts",
|
|
20
|
-
"default": "./dist/account/v1/index.js"
|
|
21
|
-
},
|
|
22
|
-
"./assistant/v1": {
|
|
23
|
-
"types": "./dist/assistant/v1/index.d.ts",
|
|
24
|
-
"default": "./dist/assistant/v1/index.js"
|
|
25
|
-
},
|
|
26
|
-
"./canopy/v1": {
|
|
27
|
-
"types": "./dist/canopy/v1/index.d.ts",
|
|
28
|
-
"default": "./dist/canopy/v1/index.js"
|
|
29
|
-
},
|
|
30
|
-
"./compute/v1": {
|
|
31
|
-
"types": "./dist/compute/v1/index.d.ts",
|
|
32
|
-
"default": "./dist/compute/v1/index.js"
|
|
33
|
-
},
|
|
34
|
-
"./iam/v1": {
|
|
35
|
-
"types": "./dist/iam/v1/index.d.ts",
|
|
36
|
-
"default": "./dist/iam/v1/index.js"
|
|
37
|
-
},
|
|
38
|
-
"./monitoring/v1": {
|
|
39
|
-
"types": "./dist/monitoring/v1/index.d.ts",
|
|
40
|
-
"default": "./dist/monitoring/v1/index.js"
|
|
41
|
-
},
|
|
42
|
-
"./tunnel/v1": {
|
|
43
|
-
"types": "./dist/tunnel/v1/index.d.ts",
|
|
44
|
-
"default": "./dist/tunnel/v1/index.js"
|
|
45
|
-
}
|
|
18
|
+
"./account/v1": {
|
|
19
|
+
"types": "./dist/account/v1/index.d.ts",
|
|
20
|
+
"default": "./dist/account/v1/index.js"
|
|
46
21
|
},
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"sideEffects": false,
|
|
51
|
-
"scripts": {
|
|
52
|
-
"generate": "node scripts/generate.mjs",
|
|
53
|
-
"build": "tsc -p tsconfig.build.json",
|
|
54
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
55
|
-
"prepublishOnly": "npm run build"
|
|
22
|
+
"./assistant/v1": {
|
|
23
|
+
"types": "./dist/assistant/v1/index.d.ts",
|
|
24
|
+
"default": "./dist/assistant/v1/index.js"
|
|
56
25
|
},
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"openapi-fetch": "^0.17.0",
|
|
61
|
-
"yaml": "^2.8.1"
|
|
26
|
+
"./canopy/v1": {
|
|
27
|
+
"types": "./dist/canopy/v1/index.d.ts",
|
|
28
|
+
"default": "./dist/canopy/v1/index.js"
|
|
62
29
|
},
|
|
63
|
-
"
|
|
64
|
-
|
|
30
|
+
"./compute/v1": {
|
|
31
|
+
"types": "./dist/compute/v1/index.d.ts",
|
|
32
|
+
"default": "./dist/compute/v1/index.js"
|
|
65
33
|
},
|
|
66
|
-
"
|
|
67
|
-
|
|
34
|
+
"./iam/v1": {
|
|
35
|
+
"types": "./dist/iam/v1/index.d.ts",
|
|
36
|
+
"default": "./dist/iam/v1/index.js"
|
|
68
37
|
},
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
38
|
+
"./monitoring/v1": {
|
|
39
|
+
"types": "./dist/monitoring/v1/index.d.ts",
|
|
40
|
+
"default": "./dist/monitoring/v1/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./tunnel/v1": {
|
|
43
|
+
"types": "./dist/tunnel/v1/index.d.ts",
|
|
44
|
+
"default": "./dist/tunnel/v1/index.js"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"dist"
|
|
49
|
+
],
|
|
50
|
+
"sideEffects": false,
|
|
51
|
+
"scripts": {
|
|
52
|
+
"generate": "node scripts/generate.mjs",
|
|
53
|
+
"build": "tsc -p tsconfig.build.json",
|
|
54
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
55
|
+
"prepublishOnly": "npm run build"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"openapi-typescript": "7.13.0",
|
|
59
|
+
"typescript": "^5.9.3",
|
|
60
|
+
"openapi-fetch": "^0.17.0",
|
|
61
|
+
"yaml": "^2.8.1"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"openapi-fetch": ">=0.14"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"openapi-fetch": {
|
|
71
|
+
"optional": true
|
|
73
72
|
}
|
|
73
|
+
}
|
|
74
74
|
}
|