run402 3.2.0 → 3.3.1
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/lib/admin.mjs +5 -5
- package/lib/allowance.mjs +1 -1
- package/lib/billing.mjs +3 -3
- package/lib/operator.mjs +1 -1
- package/lib/projects.mjs +2 -2
- package/lib/transfer.mjs +70 -77
- package/package.json +1 -1
- package/sdk/dist/namespaces/admin.d.ts +1 -1
- package/sdk/dist/namespaces/admin.d.ts.map +1 -1
- package/sdk/dist/namespaces/billing.d.ts +7 -7
- package/sdk/dist/namespaces/billing.d.ts.map +1 -1
- package/sdk/dist/namespaces/billing.js +8 -8
- package/sdk/dist/namespaces/billing.js.map +1 -1
- package/sdk/dist/namespaces/org.types.d.ts +1 -1
- package/sdk/dist/namespaces/projects.d.ts +1 -1
- package/sdk/dist/namespaces/projects.js +1 -1
- package/sdk/dist/namespaces/projects.types.d.ts +2 -2
- package/sdk/dist/namespaces/projects.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/tier.d.ts +1 -1
- package/sdk/dist/namespaces/tier.d.ts.map +1 -1
- package/sdk/dist/namespaces/transfers.d.ts +160 -128
- package/sdk/dist/namespaces/transfers.d.ts.map +1 -1
- package/sdk/dist/namespaces/transfers.js +99 -88
- package/sdk/dist/namespaces/transfers.js.map +1 -1
package/lib/admin.mjs
CHANGED
|
@@ -8,7 +8,7 @@ Usage:
|
|
|
8
8
|
run402 admin <subcommand> [args...]
|
|
9
9
|
|
|
10
10
|
Subcommands:
|
|
11
|
-
lease-perpetual <
|
|
11
|
+
lease-perpetual <org_id> (--enable | --disable)
|
|
12
12
|
Toggle the organization-level escape hatch.
|
|
13
13
|
When enabled, the organization never advances
|
|
14
14
|
past 'active' regardless of lease expiry.
|
|
@@ -46,7 +46,7 @@ const SUB_HELP = {
|
|
|
46
46
|
"lease-perpetual": `run402 admin lease-perpetual — Toggle the organization-level escape hatch
|
|
47
47
|
|
|
48
48
|
Usage:
|
|
49
|
-
run402 admin lease-perpetual <
|
|
49
|
+
run402 admin lease-perpetual <org_id> (--enable | --disable)
|
|
50
50
|
|
|
51
51
|
Options:
|
|
52
52
|
--enable Set lease_perpetual = true (pins every project on the account)
|
|
@@ -116,15 +116,15 @@ async function leasePerpetual(args) {
|
|
|
116
116
|
if (!organizationId) {
|
|
117
117
|
fail({
|
|
118
118
|
code: "BAD_USAGE",
|
|
119
|
-
message: "Missing <
|
|
120
|
-
hint: "run402 admin lease-perpetual <
|
|
119
|
+
message: "Missing <org_id>.",
|
|
120
|
+
hint: "run402 admin lease-perpetual <org_id> --enable | --disable",
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
if (enable === disable) {
|
|
124
124
|
fail({
|
|
125
125
|
code: "BAD_USAGE",
|
|
126
126
|
message: "Pass exactly one of --enable / --disable.",
|
|
127
|
-
hint: "run402 admin lease-perpetual <
|
|
127
|
+
hint: "run402 admin lease-perpetual <org_id> --enable | --disable",
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
try {
|
package/lib/allowance.mjs
CHANGED
|
@@ -281,7 +281,7 @@ async function checkout(args) {
|
|
|
281
281
|
const amount = parseIntegerFlag("--amount", amountRaw, { min: 1 });
|
|
282
282
|
try {
|
|
283
283
|
const org = await getSdk().billing.lookupOrganization(w.address);
|
|
284
|
-
const data = await getSdk().billing.createCheckout(org.
|
|
284
|
+
const data = await getSdk().billing.createCheckout(org.org_id, {
|
|
285
285
|
product: "balance_topup",
|
|
286
286
|
amountUsdMicros: amount,
|
|
287
287
|
});
|
package/lib/billing.mjs
CHANGED
|
@@ -199,7 +199,7 @@ async function checkout(args) {
|
|
|
199
199
|
}
|
|
200
200
|
try {
|
|
201
201
|
const org = await getSdk().billing.lookupOrganization(identifier);
|
|
202
|
-
const data = await getSdk().billing.createCheckout(org.
|
|
202
|
+
const data = await getSdk().billing.createCheckout(org.org_id, checkoutRequest);
|
|
203
203
|
console.log(JSON.stringify(data, null, 2));
|
|
204
204
|
} catch (err) {
|
|
205
205
|
reportSdkError(err);
|
|
@@ -249,7 +249,7 @@ async function linkWallet(args) {
|
|
|
249
249
|
const data = await getSdk().billing.linkWallet(organizationId, wallet);
|
|
250
250
|
const output = {
|
|
251
251
|
status: data?.status ?? "ok",
|
|
252
|
-
|
|
252
|
+
org_id: data?.org_id ?? organizationId,
|
|
253
253
|
wallet: data?.wallet ?? wallet.toLowerCase(),
|
|
254
254
|
...(data?.pool_implications ? { pool_implications: data.pool_implications } : {}),
|
|
255
255
|
};
|
|
@@ -286,7 +286,7 @@ async function autoRecharge(args) {
|
|
|
286
286
|
enabled: state === "on",
|
|
287
287
|
threshold,
|
|
288
288
|
});
|
|
289
|
-
console.log(JSON.stringify({
|
|
289
|
+
console.log(JSON.stringify({ org_id: organizationId, enabled: state === "on", updated: true }));
|
|
290
290
|
} catch (err) {
|
|
291
291
|
reportSdkError(err);
|
|
292
292
|
}
|
package/lib/operator.mjs
CHANGED
|
@@ -324,7 +324,7 @@ async function loopbackLogin(args, { stepUp }) {
|
|
|
324
324
|
if (memberships.length) {
|
|
325
325
|
process.stderr.write(
|
|
326
326
|
`Member of ${memberships.length} org(s):\n` +
|
|
327
|
-
memberships.map((m) => ` - ${m.display_name || m.org_id || m.
|
|
327
|
+
memberships.map((m) => ` - ${m.display_name || m.org_id || m.org_id || "unknown"} (${m.role}, ${m.status})`).join("\n") +
|
|
328
328
|
"\n",
|
|
329
329
|
);
|
|
330
330
|
}
|
package/lib/projects.mjs
CHANGED
|
@@ -485,7 +485,7 @@ async function list(args = []) {
|
|
|
485
485
|
active: p.id === activeId,
|
|
486
486
|
site_url: p.site_url ?? null,
|
|
487
487
|
custom_domains: p.custom_domains ?? [],
|
|
488
|
-
org_id: p.
|
|
488
|
+
org_id: p.org_id ?? null,
|
|
489
489
|
status: p.status ?? p.effective_status ?? null,
|
|
490
490
|
}));
|
|
491
491
|
const out = { projects: rows };
|
|
@@ -756,7 +756,7 @@ export async function run(sub, args) {
|
|
|
756
756
|
fail({
|
|
757
757
|
code: "REMOVED_COMMAND",
|
|
758
758
|
message: "`run402 projects pin` was removed in v1.57.",
|
|
759
|
-
hint: "Per-project pin is superseded by the organization-level escape hatch. Use `run402 admin lease-perpetual <
|
|
759
|
+
hint: "Per-project pin is superseded by the organization-level escape hatch. Use `run402 admin lease-perpetual <org_id> --enable` (platform-admin only).",
|
|
760
760
|
});
|
|
761
761
|
}
|
|
762
762
|
args = normalizeArgv(args);
|
package/lib/transfer.mjs
CHANGED
|
@@ -10,30 +10,30 @@ import {
|
|
|
10
10
|
positionalArgs,
|
|
11
11
|
} from "./argparse.mjs";
|
|
12
12
|
|
|
13
|
-
const HELP = `run402 transfer —
|
|
13
|
+
const HELP = `run402 transfer — Project transfer, one noun for both recipient kinds (v1.93+)
|
|
14
14
|
|
|
15
15
|
Usage:
|
|
16
16
|
run402 transfer init --to <wallet|email> [--project <id>] [--billing-policy migrate] [--message <text>] [--kysigned <record_id>] [--retain-collaborator developer]
|
|
17
17
|
run402 transfer preview <transfer_id>
|
|
18
18
|
run402 transfer list [--incoming | --outgoing] [--limit N] [--offset N]
|
|
19
19
|
run402 transfer accept <transfer_id>
|
|
20
|
-
run402 transfer claim <transfer_id> [--into <
|
|
21
|
-
run402 transfer cancel <transfer_id> [--reason <text>]
|
|
20
|
+
run402 transfer claim <transfer_id> [--into <org_id>] [--accept-retained-collaborator]
|
|
21
|
+
run402 transfer cancel <transfer_id> [--reason <text>]
|
|
22
22
|
|
|
23
23
|
Subcommands:
|
|
24
|
-
init Initiate ownership change. --to <wallet> = two-party wallet transfer
|
|
25
|
-
--to <email> = email->org
|
|
26
|
-
preview Fetch the safe review document (
|
|
27
|
-
list List pending transfers (incoming default, --outgoing,
|
|
28
|
-
accept Accept an incoming
|
|
29
|
-
claim Claim an incoming
|
|
30
|
-
cancel Cancel a pending transfer
|
|
24
|
+
init Initiate ownership change. --to <wallet> = two-party wallet transfer
|
|
25
|
+
(completed by 'accept'); --to <email> = email->org transfer (completed by 'claim').
|
|
26
|
+
preview Fetch the safe review document (wallet or email — kind-agnostic)
|
|
27
|
+
list List pending transfers (incoming default, or --outgoing) — both kinds, unioned
|
|
28
|
+
accept Accept an incoming WALLET transfer (your wallet must be the to_wallet)
|
|
29
|
+
claim Claim an incoming EMAIL transfer into an org (--into <id>; omit = new org)
|
|
30
|
+
cancel Cancel a pending transfer of either kind
|
|
31
31
|
|
|
32
32
|
Notes:
|
|
33
33
|
- Owner-side mutations on a project with a pending transfer return 409
|
|
34
34
|
PROJECT_HAS_PENDING_TRANSFER. Cancel the transfer or wait 72h for expiry.
|
|
35
35
|
- Phase 1A supports only billing_policy=migrate (default).
|
|
36
|
-
- Secret VALUES are inherited by the recipient on
|
|
36
|
+
- Secret VALUES are inherited by the recipient on completion; rotation is advised.
|
|
37
37
|
- GitHub repo ownership is NOT transferred — handle that out of band.
|
|
38
38
|
`;
|
|
39
39
|
|
|
@@ -45,17 +45,18 @@ Usage:
|
|
|
45
45
|
|
|
46
46
|
Options:
|
|
47
47
|
--project <id> Project id (defaults to the active project)
|
|
48
|
-
--to <wallet>
|
|
49
|
-
|
|
48
|
+
--to <wallet|email> Recipient (required). A wallet uses the two-party rail (completed by
|
|
49
|
+
'accept'); an email uses the email->org rail (completed by 'claim').
|
|
50
|
+
--billing-policy <p> Billing policy (wallet rail). Phase 1A only allows 'migrate' (default).
|
|
50
51
|
--message <text> Optional note shown to the recipient in preview + emails.
|
|
51
|
-
--kysigned <record_id> Optional KySigned record id (Phase 1A: informational only).
|
|
52
|
-
--retain-collaborator <role> Email
|
|
53
|
-
the recipient's org after
|
|
52
|
+
--kysigned <record_id> Optional KySigned record id (wallet rail; Phase 1A: informational only).
|
|
53
|
+
--retain-collaborator <role> Email recipients only (v1.91): keep a 'developer' membership in
|
|
54
|
+
the recipient's org after the transfer. The recipient must accept it at
|
|
54
55
|
claim (--accept-retained-collaborator); omit for full severance.
|
|
55
56
|
|
|
56
57
|
Notes:
|
|
57
|
-
- Caller's wallet must currently own the project (gateway re-checks fresh DB).
|
|
58
|
-
- Owner-side mutations on the project are frozen until accept/cancel/expiry.
|
|
58
|
+
- Caller's wallet/session must currently own or admin the project (gateway re-checks fresh DB).
|
|
59
|
+
- Owner-side mutations on the project are frozen until accept/claim/cancel/expiry.
|
|
59
60
|
- The project lease stays with your organization; it is NOT refunded.
|
|
60
61
|
`,
|
|
61
62
|
preview: `run402 transfer preview — Fetch the preview document
|
|
@@ -64,21 +65,25 @@ Usage:
|
|
|
64
65
|
run402 transfer preview <transfer_id>
|
|
65
66
|
|
|
66
67
|
Returns project name, custom domains, subdomains, function names, secret NAMES
|
|
67
|
-
(values are never returned), CI bindings that will be revoked on
|
|
68
|
-
billing implications.
|
|
68
|
+
(values are never returned), CI bindings that will be revoked on completion, and
|
|
69
|
+
billing implications. Works for both wallet- and email-addressed transfers; any
|
|
70
|
+
party to the transfer may preview.
|
|
69
71
|
`,
|
|
70
72
|
list: `run402 transfer list — List pending transfers
|
|
71
73
|
|
|
72
74
|
Usage:
|
|
73
75
|
run402 transfer list [--incoming | --outgoing] [--limit N] [--offset N]
|
|
74
76
|
|
|
77
|
+
Lists both wallet- and email-addressed transfers, unioned; each row carries
|
|
78
|
+
recipient_kind.
|
|
79
|
+
|
|
75
80
|
Options:
|
|
76
|
-
--incoming List transfers OFFERED TO
|
|
77
|
-
--outgoing List transfers INITIATED BY
|
|
81
|
+
--incoming List transfers OFFERED TO you (default).
|
|
82
|
+
--outgoing List transfers INITIATED BY you.
|
|
78
83
|
--limit N Page size (default 50).
|
|
79
84
|
--offset N Pagination offset (default 0).
|
|
80
85
|
`,
|
|
81
|
-
accept: `run402 transfer accept — Accept an incoming transfer
|
|
86
|
+
accept: `run402 transfer accept — Accept an incoming WALLET transfer
|
|
82
87
|
|
|
83
88
|
Usage:
|
|
84
89
|
run402 transfer accept <transfer_id>
|
|
@@ -86,27 +91,29 @@ Usage:
|
|
|
86
91
|
Your wallet must equal the transfer's to_wallet. The accept transaction
|
|
87
92
|
atomically: flips ownership, revokes the previous owner's CI bindings on the
|
|
88
93
|
project, enqueues notifications to both parties, and stamps a
|
|
89
|
-
'secrets_rotation_advised' advisory on the project.
|
|
94
|
+
'secrets_rotation_advised' advisory on the project. (Email transfers complete
|
|
95
|
+
via 'claim', not 'accept'.)
|
|
90
96
|
`,
|
|
91
97
|
cancel: `run402 transfer cancel — Cancel a pending transfer
|
|
92
98
|
|
|
93
99
|
Usage:
|
|
94
|
-
run402 transfer cancel <transfer_id> [--reason <text>]
|
|
100
|
+
run402 transfer cancel <transfer_id> [--reason <text>]
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
email
|
|
102
|
+
Cancels a pending transfer of either kind. You must be authorized for the row's
|
|
103
|
+
kind (a wallet signing party, or an owner/admin of the offering org / the
|
|
104
|
+
addressed-email principal). Already-processed transfers return 409
|
|
105
|
+
TRANSFER_ALREADY_PROCESSED.
|
|
99
106
|
`,
|
|
100
|
-
claim: `run402 transfer claim — Claim an incoming
|
|
107
|
+
claim: `run402 transfer claim — Claim an incoming EMAIL transfer
|
|
101
108
|
|
|
102
109
|
Usage:
|
|
103
|
-
run402 transfer claim <transfer_id> [--into <
|
|
110
|
+
run402 transfer claim <transfer_id> [--into <org_id>] [--accept-retained-collaborator]
|
|
104
111
|
|
|
105
|
-
Claims
|
|
106
|
-
|
|
112
|
+
Claims an email-addressed transfer into an org you own. Omit --into to claim into
|
|
113
|
+
a brand-new org. This is the email analog of 'accept'.
|
|
107
114
|
|
|
108
115
|
Options:
|
|
109
|
-
--into <
|
|
116
|
+
--into <org_id> Org to claim into (omit = brand-new org).
|
|
110
117
|
--accept-retained-collaborator Accept the sender's v1.91 retained-developer-membership offer
|
|
111
118
|
(see 'transfer preview' retain_collaborator). Omit = full severance.
|
|
112
119
|
`,
|
|
@@ -123,9 +130,9 @@ async function init(args) {
|
|
|
123
130
|
if (extra.length > 0) {
|
|
124
131
|
fail({ code: "BAD_USAGE", message: `Unexpected argument for transfer init: ${extra[0]}` });
|
|
125
132
|
}
|
|
126
|
-
const
|
|
127
|
-
if (!
|
|
128
|
-
fail({ code: "BAD_USAGE", message: "Missing --to <wallet>" });
|
|
133
|
+
const to = flagValue(parsedArgs, "--to");
|
|
134
|
+
if (!to) {
|
|
135
|
+
fail({ code: "BAD_USAGE", message: "Missing --to <wallet|email>" });
|
|
129
136
|
}
|
|
130
137
|
const projectFlag = flagValue(parsedArgs, "--project");
|
|
131
138
|
const projectId = await resolveProjectId(projectFlag);
|
|
@@ -144,17 +151,18 @@ async function init(args) {
|
|
|
144
151
|
const kysigned = flagValue(parsedArgs, "--kysigned");
|
|
145
152
|
const retainCollaborator = flagValue(parsedArgs, "--retain-collaborator");
|
|
146
153
|
|
|
147
|
-
// One noun, two rails: an email recipient routes to the email->org
|
|
148
|
-
// a wallet recipient routes to the two-party wallet
|
|
149
|
-
|
|
154
|
+
// One noun, two rails: an email recipient routes to the email->org completion
|
|
155
|
+
// ('claim'); a wallet recipient routes to the two-party wallet completion
|
|
156
|
+
// ('accept'). Both initiate on the SAME endpoint, discriminated by the body.
|
|
157
|
+
const isEmail = to.includes("@");
|
|
150
158
|
|
|
151
|
-
// --retain-collaborator (v1.91) is
|
|
159
|
+
// --retain-collaborator (v1.91) is an email-only opt-in: the sender keeps a
|
|
152
160
|
// developer membership in the recipient's org (recipient must accept at claim).
|
|
153
161
|
if (retainCollaborator !== null) {
|
|
154
162
|
if (!isEmail) {
|
|
155
163
|
fail({
|
|
156
164
|
code: "BAD_FLAG",
|
|
157
|
-
message: "--retain-collaborator applies only to email
|
|
165
|
+
message: "--retain-collaborator applies only to email recipients; a wallet --to uses the two-party transfer rail.",
|
|
158
166
|
details: { flag: "--retain-collaborator" },
|
|
159
167
|
});
|
|
160
168
|
}
|
|
@@ -167,21 +175,20 @@ async function init(args) {
|
|
|
167
175
|
}
|
|
168
176
|
}
|
|
169
177
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
);
|
|
178
|
+
// Both kinds initiate on the unified transfer endpoint — sign that path.
|
|
179
|
+
allowanceAuthHeaders(`/projects/v1/${projectId}/transfers`);
|
|
173
180
|
|
|
174
181
|
try {
|
|
175
182
|
const res = isEmail
|
|
176
|
-
? await getSdk().admin.transfers.
|
|
183
|
+
? await getSdk().admin.transfers.initiate({
|
|
177
184
|
projectId,
|
|
178
|
-
toEmail:
|
|
185
|
+
toEmail: to,
|
|
179
186
|
message: message ?? undefined,
|
|
180
187
|
retainCollaborator: retainCollaborator ? { role: retainCollaborator } : undefined,
|
|
181
188
|
})
|
|
182
189
|
: await getSdk().admin.transfers.initiate({
|
|
183
190
|
projectId,
|
|
184
|
-
toWallet,
|
|
191
|
+
toWallet: to,
|
|
185
192
|
billingPolicy: billingPolicy ?? undefined,
|
|
186
193
|
message: message ?? undefined,
|
|
187
194
|
kysignedRecordId: kysigned ?? undefined,
|
|
@@ -194,19 +201,17 @@ async function init(args) {
|
|
|
194
201
|
|
|
195
202
|
async function preview(args) {
|
|
196
203
|
const parsedArgs = normalizeArgv(args);
|
|
197
|
-
assertKnownFlags(parsedArgs, ["--
|
|
204
|
+
assertKnownFlags(parsedArgs, ["--help", "-h"]);
|
|
198
205
|
const positionals = positionalArgs(parsedArgs);
|
|
199
206
|
if (positionals.length !== 1) {
|
|
200
|
-
fail({ code: "BAD_USAGE", message: "Usage: run402 transfer preview <transfer_id>
|
|
207
|
+
fail({ code: "BAD_USAGE", message: "Usage: run402 transfer preview <transfer_id>" });
|
|
201
208
|
}
|
|
202
209
|
const transferId = positionals[0];
|
|
203
|
-
|
|
204
|
-
allowanceAuthHeaders(`/agent/v1
|
|
210
|
+
// Preview is kind-agnostic — one route serves wallet and email transfers.
|
|
211
|
+
allowanceAuthHeaders(`/agent/v1/transfers/${transferId}`);
|
|
205
212
|
|
|
206
213
|
try {
|
|
207
|
-
const data =
|
|
208
|
-
? await getSdk().admin.transfers.previewHandoff(transferId)
|
|
209
|
-
: await getSdk().admin.transfers.preview(transferId);
|
|
214
|
+
const data = await getSdk().admin.transfers.preview(transferId);
|
|
210
215
|
console.log(JSON.stringify(data, null, 2));
|
|
211
216
|
} catch (err) {
|
|
212
217
|
reportSdkError(err);
|
|
@@ -216,24 +221,12 @@ async function preview(args) {
|
|
|
216
221
|
async function list(args) {
|
|
217
222
|
const parsedArgs = normalizeArgv(args);
|
|
218
223
|
const valueFlags = ["--limit", "--offset"];
|
|
219
|
-
assertKnownFlags(parsedArgs, [...valueFlags, "--incoming", "--outgoing", "--
|
|
224
|
+
assertKnownFlags(parsedArgs, [...valueFlags, "--incoming", "--outgoing", "--help", "-h"], valueFlags);
|
|
220
225
|
const extra = positionalArgs(parsedArgs, valueFlags);
|
|
221
226
|
if (extra.length > 0) {
|
|
222
227
|
fail({ code: "BAD_USAGE", message: `Unexpected argument for transfer list: ${extra[0]}` });
|
|
223
228
|
}
|
|
224
229
|
|
|
225
|
-
// Email->org handoffs ride the same rail but have their own incoming inbox.
|
|
226
|
-
if (parsedArgs.includes("--handoffs")) {
|
|
227
|
-
allowanceAuthHeaders("/agent/v1/handoffs/incoming");
|
|
228
|
-
try {
|
|
229
|
-
const handoffs = await getSdk().admin.transfers.listIncomingHandoffs();
|
|
230
|
-
console.log(JSON.stringify({ kind: "handoffs", handoffs }, null, 2));
|
|
231
|
-
} catch (err) {
|
|
232
|
-
reportSdkError(err);
|
|
233
|
-
}
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
230
|
const incoming = parsedArgs.includes("--incoming");
|
|
238
231
|
const outgoing = parsedArgs.includes("--outgoing");
|
|
239
232
|
if (incoming && outgoing) {
|
|
@@ -252,6 +245,8 @@ async function list(args) {
|
|
|
252
245
|
? undefined
|
|
253
246
|
: parseIntegerFlag("--offset", offsetFlag, { min: 0 });
|
|
254
247
|
|
|
248
|
+
// Incoming/outgoing are kind-agnostic — each returns the union of wallet- and
|
|
249
|
+
// email-addressed rows, tagged with recipient_kind.
|
|
255
250
|
allowanceAuthHeaders(`/agent/v1/transfers/${direction}`);
|
|
256
251
|
|
|
257
252
|
try {
|
|
@@ -286,20 +281,18 @@ async function accept(args) {
|
|
|
286
281
|
async function cancel(args) {
|
|
287
282
|
const parsedArgs = normalizeArgv(args);
|
|
288
283
|
const valueFlags = ["--reason"];
|
|
289
|
-
assertKnownFlags(parsedArgs, [...valueFlags, "--
|
|
284
|
+
assertKnownFlags(parsedArgs, [...valueFlags, "--help", "-h"], valueFlags);
|
|
290
285
|
const positionals = positionalArgs(parsedArgs, valueFlags);
|
|
291
286
|
if (positionals.length !== 1) {
|
|
292
|
-
fail({ code: "BAD_USAGE", message: "Usage: run402 transfer cancel <transfer_id> [--reason <text>]
|
|
287
|
+
fail({ code: "BAD_USAGE", message: "Usage: run402 transfer cancel <transfer_id> [--reason <text>]" });
|
|
293
288
|
}
|
|
294
289
|
const transferId = positionals[0];
|
|
295
290
|
const reason = flagValue(parsedArgs, "--reason");
|
|
296
|
-
|
|
297
|
-
allowanceAuthHeaders(`/agent/v1
|
|
291
|
+
// Cancel is kind-agnostic — one route serves wallet and email transfers.
|
|
292
|
+
allowanceAuthHeaders(`/agent/v1/transfers/${transferId}/cancel`);
|
|
298
293
|
|
|
299
294
|
try {
|
|
300
|
-
const data =
|
|
301
|
-
? await getSdk().admin.transfers.cancelHandoff(transferId)
|
|
302
|
-
: await getSdk().admin.transfers.cancel(transferId, reason ?? undefined);
|
|
295
|
+
const data = await getSdk().admin.transfers.cancel(transferId, reason ?? undefined);
|
|
303
296
|
console.log(JSON.stringify(data, null, 2));
|
|
304
297
|
} catch (err) {
|
|
305
298
|
reportSdkError(err);
|
|
@@ -312,17 +305,17 @@ async function claim(args) {
|
|
|
312
305
|
assertKnownFlags(parsedArgs, [...valueFlags, "--accept-retained-collaborator", "--help", "-h"], valueFlags);
|
|
313
306
|
const positionals = positionalArgs(parsedArgs, valueFlags);
|
|
314
307
|
if (positionals.length !== 1) {
|
|
315
|
-
fail({ code: "BAD_USAGE", message: "Usage: run402 transfer claim <transfer_id> [--into <
|
|
308
|
+
fail({ code: "BAD_USAGE", message: "Usage: run402 transfer claim <transfer_id> [--into <org_id>] [--accept-retained-collaborator]" });
|
|
316
309
|
}
|
|
317
310
|
const transferId = positionals[0];
|
|
318
311
|
const into = flagValue(parsedArgs, "--into");
|
|
319
312
|
// v1.91: accept the sender's retained-developer-membership offer (see the
|
|
320
313
|
// preview's `retain_collaborator` block). Absent = full severance (default).
|
|
321
314
|
const acceptRetain = parsedArgs.includes("--accept-retained-collaborator");
|
|
322
|
-
allowanceAuthHeaders(`/agent/v1/
|
|
315
|
+
allowanceAuthHeaders(`/agent/v1/transfers/${transferId}/claim`);
|
|
323
316
|
|
|
324
317
|
try {
|
|
325
|
-
const data = await getSdk().admin.transfers.
|
|
318
|
+
const data = await getSdk().admin.transfers.claim(transferId, {
|
|
326
319
|
organizationId: into ?? undefined,
|
|
327
320
|
acceptRetainedCollaborator: acceptRetain || undefined,
|
|
328
321
|
});
|
package/package.json
CHANGED
|
@@ -141,7 +141,7 @@ export interface RotateWebhookSecretResult {
|
|
|
141
141
|
}
|
|
142
142
|
export interface SetLeasePerpetualResult {
|
|
143
143
|
status: "ok";
|
|
144
|
-
|
|
144
|
+
org_id: string;
|
|
145
145
|
lease_perpetual: boolean;
|
|
146
146
|
/**
|
|
147
147
|
* `true` when the toggle was `lease_perpetual: true` AND the account was in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/namespaces/admin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC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;IACpE,0BAA0B,CAC9B,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,uBAAuB,CAAC;IAWnC;;;;OAIG;IACG,gBAAgB,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAOzD;;;;OAIG;IACG,mBAAmB,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAO/D,qEAAqE;IAC/D,iBAAiB,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAOxD;;;;;;;;OAQG;IACG,iBAAiB,CACrB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,0BAA+B,GACpC,OAAO,CAAC,yBAAyB,CAAC;IAyBrC;;;;;;;;;OASG;IACG,iBAAiB,CACrB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,uBAAuB,CAAC;IAYnC;;;;;;OAMG;IACG,cAAc,CAClB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,qBAA0B,GAC/B,OAAO,CAAC,oBAAoB,CAAC;IAchC;;;;;;;OAOG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAU7E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `billing` namespace — organizations and Stripe checkouts.
|
|
3
3
|
*
|
|
4
|
-
* Organizations are addressed by their canonical `
|
|
4
|
+
* Organizations are addressed by their canonical `org_id` (UUID). A
|
|
5
5
|
* wallet or email is resolved to that id through the
|
|
6
6
|
* `GET /orgs/v1/lookup?wallet=|?email=` lookup; `getOrganization` / `history`
|
|
7
7
|
* accept any of the three identifier forms and resolve internally. Organization
|
|
@@ -14,7 +14,7 @@ import type { Client } from "../kernel.js";
|
|
|
14
14
|
import type { ProjectTier } from "./projects.types.js";
|
|
15
15
|
export interface OrganizationDetail {
|
|
16
16
|
/** Canonical organization id (UUID). */
|
|
17
|
-
|
|
17
|
+
org_id: string;
|
|
18
18
|
available_usd_micros: number;
|
|
19
19
|
/** Held/reserved portion of the balance; absent on gateways that predate the field. */
|
|
20
20
|
held_usd_micros?: number;
|
|
@@ -38,11 +38,11 @@ export interface BillingHistoryEntry {
|
|
|
38
38
|
}
|
|
39
39
|
export interface BillingHistoryResult {
|
|
40
40
|
/** Canonical organization id (UUID) the entries belong to. */
|
|
41
|
-
|
|
41
|
+
org_id: string;
|
|
42
42
|
entries: BillingHistoryEntry[];
|
|
43
43
|
}
|
|
44
44
|
export interface CreateCheckoutResult {
|
|
45
|
-
|
|
45
|
+
org_id: string;
|
|
46
46
|
product: CheckoutProduct;
|
|
47
47
|
checkout_url: string;
|
|
48
48
|
topup_id: string;
|
|
@@ -71,7 +71,7 @@ export interface LinkWalletPoolImplications {
|
|
|
71
71
|
}
|
|
72
72
|
export interface LinkWalletResult {
|
|
73
73
|
status: string;
|
|
74
|
-
|
|
74
|
+
org_id: string;
|
|
75
75
|
wallet: string;
|
|
76
76
|
/** Present on v1.46+ gateways; undefined when the gateway predates the field. */
|
|
77
77
|
pool_implications?: LinkWalletPoolImplications;
|
|
@@ -117,7 +117,7 @@ export declare class Billing {
|
|
|
117
117
|
getOrganization(identifier: OrganizationIdentifier): Promise<OrganizationDetail>;
|
|
118
118
|
/**
|
|
119
119
|
* Resolve a wallet or email to its organization detail — including the
|
|
120
|
-
* canonical `
|
|
120
|
+
* canonical `org_id` — via `GET /orgs/v1/lookup?wallet=|?email=`.
|
|
121
121
|
* An org-id (UUID) argument is read directly instead. SIWX must match the
|
|
122
122
|
* `?wallet`; email lookups are admin-only.
|
|
123
123
|
*/
|
|
@@ -138,7 +138,7 @@ export declare class Billing {
|
|
|
138
138
|
/**
|
|
139
139
|
* Link a wallet to an existing email organization to enable hybrid
|
|
140
140
|
* Stripe + x402 payments. `organizationId` is the canonical
|
|
141
|
-
* `
|
|
141
|
+
* `org_id` (UUID) returned by `createEmailOrganization` /
|
|
142
142
|
* `lookupOrganization`; the gateway addresses the route as
|
|
143
143
|
* `POST /orgs/v1/:org_id/wallets`. Returns the gateway
|
|
144
144
|
* response; v1.46+ gateways include a {@link LinkWalletPoolImplications}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../src/namespaces/billing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAS3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,
|
|
1
|
+
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../src/namespaces/billing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAS3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,EAAE,MAAM,CAAC;IAChC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ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EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkBnG,wDAAwD;IAClD,cAAc,CAClB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC,oBAAoB,CAAC;IAUhC,iFAAiF;IAC3E,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAUxE;;;;;;;;;OASG;IACG,UAAU,CACd,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC;IAa5B,+CAA+C;IACzC,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;CAgBhE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `billing` namespace — organizations and Stripe checkouts.
|
|
3
3
|
*
|
|
4
|
-
* Organizations are addressed by their canonical `
|
|
4
|
+
* Organizations are addressed by their canonical `org_id` (UUID). A
|
|
5
5
|
* wallet or email is resolved to that id through the
|
|
6
6
|
* `GET /orgs/v1/lookup?wallet=|?email=` lookup; `getOrganization` / `history`
|
|
7
7
|
* accept any of the three identifier forms and resolve internally. Organization
|
|
@@ -22,7 +22,7 @@ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
|
|
|
22
22
|
function classifyBillingIdentifier(identifier, context) {
|
|
23
23
|
assertNonEmptyString(identifier, "identifier", context);
|
|
24
24
|
if (UUID_RE.test(identifier)) {
|
|
25
|
-
return { kind: "
|
|
25
|
+
return { kind: "org_id", value: identifier };
|
|
26
26
|
}
|
|
27
27
|
if (/^0x/i.test(identifier)) {
|
|
28
28
|
assertEvmAddress(identifier, "identifier", context);
|
|
@@ -38,7 +38,7 @@ function fetchOrganizationById(client, organizationId, context) {
|
|
|
38
38
|
/**
|
|
39
39
|
* Resolve a wallet / email to its organization detail via the lookup endpoint
|
|
40
40
|
* `GET /orgs/v1/lookup?wallet=|?email=`. The lookup returns the same
|
|
41
|
-
* detail shape as the by-id read, including the resolved `
|
|
41
|
+
* detail shape as the by-id read, including the resolved `org_id`.
|
|
42
42
|
*/
|
|
43
43
|
function fetchOrganizationByLookup(client, kind, value, context) {
|
|
44
44
|
return client.request(`/orgs/v1/lookup?${kind}=${encodeURIComponent(value)}`, { context });
|
|
@@ -50,7 +50,7 @@ function fetchOrganizationByLookup(client, kind, value, context) {
|
|
|
50
50
|
*/
|
|
51
51
|
async function resolveOrganizationDetail(client, identifier, context) {
|
|
52
52
|
const id = classifyBillingIdentifier(identifier, context);
|
|
53
|
-
return id.kind === "
|
|
53
|
+
return id.kind === "org_id"
|
|
54
54
|
? fetchOrganizationById(client, id.value, context)
|
|
55
55
|
: fetchOrganizationByLookup(client, id.kind, id.value, context);
|
|
56
56
|
}
|
|
@@ -123,7 +123,7 @@ export class Billing {
|
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* Resolve a wallet or email to its organization detail — including the
|
|
126
|
-
* canonical `
|
|
126
|
+
* canonical `org_id` — via `GET /orgs/v1/lookup?wallet=|?email=`.
|
|
127
127
|
* An org-id (UUID) argument is read directly instead. SIWX must match the
|
|
128
128
|
* `?wallet`; email lookups are admin-only.
|
|
129
129
|
*/
|
|
@@ -145,10 +145,10 @@ export class Billing {
|
|
|
145
145
|
assertPositiveSafeInteger(limit, "limit", "fetching billing history");
|
|
146
146
|
}
|
|
147
147
|
const id = classifyBillingIdentifier(identifier, "fetching billing history");
|
|
148
|
-
const organizationId = id.kind === "
|
|
148
|
+
const organizationId = id.kind === "org_id"
|
|
149
149
|
? id.value
|
|
150
150
|
: (await fetchOrganizationByLookup(this.client, id.kind, id.value, "fetching billing history"))
|
|
151
|
-
.
|
|
151
|
+
.org_id;
|
|
152
152
|
const base = `/orgs/v1/${encodeURIComponent(organizationId)}/billing/history`;
|
|
153
153
|
const path = limit !== undefined
|
|
154
154
|
? `${base}?limit=${encodeURIComponent(String(limit))}`
|
|
@@ -180,7 +180,7 @@ export class Billing {
|
|
|
180
180
|
/**
|
|
181
181
|
* Link a wallet to an existing email organization to enable hybrid
|
|
182
182
|
* Stripe + x402 payments. `organizationId` is the canonical
|
|
183
|
-
* `
|
|
183
|
+
* `org_id` (UUID) returned by `createEmailOrganization` /
|
|
184
184
|
* `lookupOrganization`; the gateway addresses the route as
|
|
185
185
|
* `POST /orgs/v1/:org_id/wallets`. Returns the gateway
|
|
186
186
|
* response; v1.46+ gateways include a {@link LinkWalletPoolImplications}
|