@run402/sdk 2.43.0 → 2.45.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/README.md +1 -1
- package/dist/errors.d.ts +8 -8
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -6
- package/dist/errors.js.map +1 -1
- package/dist/namespaces/admin.d.ts +15 -16
- package/dist/namespaces/admin.d.ts.map +1 -1
- package/dist/namespaces/admin.js +14 -15
- package/dist/namespaces/admin.js.map +1 -1
- package/dist/namespaces/billing.d.ts +66 -62
- package/dist/namespaces/billing.d.ts.map +1 -1
- package/dist/namespaces/billing.js +96 -106
- package/dist/namespaces/billing.js.map +1 -1
- package/dist/namespaces/operator.d.ts +3 -3
- package/dist/namespaces/operator.d.ts.map +1 -1
- package/dist/namespaces/operator.js +1 -1
- package/dist/namespaces/org.types.d.ts +2 -2
- package/dist/namespaces/org.types.js +1 -1
- package/dist/namespaces/projects.d.ts +2 -2
- package/dist/namespaces/projects.js +2 -2
- package/dist/namespaces/projects.types.d.ts +15 -15
- package/dist/namespaces/projects.types.d.ts.map +1 -1
- package/dist/namespaces/tier.d.ts +11 -11
- package/dist/namespaces/tier.d.ts.map +1 -1
- package/dist/namespaces/transfers.d.ts +8 -8
- package/dist/namespaces/transfers.d.ts.map +1 -1
- package/dist/namespaces/transfers.js +3 -3
- package/dist/namespaces/transfers.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `billing` namespace —
|
|
2
|
+
* `billing` namespace — organizations and Stripe checkouts.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Organizations are addressed by their canonical `organization_id` (UUID). A
|
|
5
5
|
* wallet or email is resolved to that id through the
|
|
6
|
-
* `GET /
|
|
7
|
-
* accept any of the three identifier forms and resolve internally.
|
|
8
|
-
* reads require SIWX from a wallet linked to the
|
|
6
|
+
* `GET /orgs/v1/lookup?wallet=|?email=` lookup; `getOrganization` / `history`
|
|
7
|
+
* accept any of the three identifier forms and resolve internally. Organization
|
|
8
|
+
* reads require SIWX from a wallet linked to the organization (or matching the
|
|
9
9
|
* looked-up `?wallet`), or an admin key; email lookups are admin-only.
|
|
10
|
-
* Mutations such as link-wallet
|
|
11
|
-
*
|
|
10
|
+
* Mutations such as link-wallet, checkout creation, and auto-recharge require
|
|
11
|
+
* an org credential (or admin).
|
|
12
12
|
*/
|
|
13
13
|
import { LocalError } from "../errors.js";
|
|
14
14
|
import { assertEmailAddress, assertEvmAddress, assertNonEmptyString, assertPositiveSafeInteger, assertStringInSet, } from "../validation.js";
|
|
15
15
|
const BILLING_TIERS = ["prototype", "hobby", "team"];
|
|
16
16
|
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
17
17
|
/**
|
|
18
|
-
* Classify a billing identifier as a canonical
|
|
19
|
-
* wallet address, or an email. Wallets are lowercased;
|
|
18
|
+
* Classify a billing identifier as a canonical organization id (UUID), an EVM
|
|
19
|
+
* wallet address, or an email. Wallets are lowercased; organization ids and emails
|
|
20
20
|
* are returned verbatim. Throws {@link LocalError} for anything else.
|
|
21
21
|
*/
|
|
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: "organization_id", value: identifier };
|
|
26
26
|
}
|
|
27
27
|
if (/^0x/i.test(identifier)) {
|
|
28
28
|
assertEvmAddress(identifier, "identifier", context);
|
|
@@ -31,28 +31,28 @@ function classifyBillingIdentifier(identifier, context) {
|
|
|
31
31
|
assertEmailAddress(identifier, "identifier", context);
|
|
32
32
|
return { kind: "email", value: identifier };
|
|
33
33
|
}
|
|
34
|
-
/** Read
|
|
35
|
-
function
|
|
36
|
-
return client.request(`/
|
|
34
|
+
/** Read organization billing detail by canonical id: `GET /orgs/v1/:org_id/billing`. */
|
|
35
|
+
function fetchOrganizationById(client, organizationId, context) {
|
|
36
|
+
return client.request(`/orgs/v1/${encodeURIComponent(organizationId)}/billing`, { context });
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Resolve a wallet / email to its
|
|
40
|
-
* `GET /
|
|
41
|
-
* detail shape as the by-id read, including the resolved `
|
|
39
|
+
* Resolve a wallet / email to its organization detail via the lookup endpoint
|
|
40
|
+
* `GET /orgs/v1/lookup?wallet=|?email=`. The lookup returns the same
|
|
41
|
+
* detail shape as the by-id read, including the resolved `organization_id`.
|
|
42
42
|
*/
|
|
43
|
-
function
|
|
44
|
-
return client.request(`/
|
|
43
|
+
function fetchOrganizationByLookup(client, kind, value, context) {
|
|
44
|
+
return client.request(`/orgs/v1/lookup?${kind}=${encodeURIComponent(value)}`, { context });
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* Resolve any identifier form (
|
|
48
|
-
* detail.
|
|
47
|
+
* Resolve any identifier form (organization id / wallet / email) to the organization
|
|
48
|
+
* detail. Organization ids hit the canonical by-id read; wallet/email go through
|
|
49
49
|
* the `?wallet=`/`?email=` lookup. All paths send SIWX via the kernel default.
|
|
50
50
|
*/
|
|
51
|
-
async function
|
|
51
|
+
async function resolveOrganizationDetail(client, identifier, context) {
|
|
52
52
|
const id = classifyBillingIdentifier(identifier, context);
|
|
53
|
-
return id.kind === "
|
|
54
|
-
?
|
|
55
|
-
:
|
|
53
|
+
return id.kind === "organization_id"
|
|
54
|
+
? fetchOrganizationById(client, id.value, context)
|
|
55
|
+
: fetchOrganizationByLookup(client, id.kind, id.value, context);
|
|
56
56
|
}
|
|
57
57
|
function assertNonNegativeSafeInteger(value, name, context) {
|
|
58
58
|
if (!Number.isSafeInteger(value) || value < 0) {
|
|
@@ -64,24 +64,36 @@ function assertUsdMicrosAmount(value, name, context) {
|
|
|
64
64
|
throw new LocalError(`${name} must be a safe integer USD-micros amount of at least 500000 and whole-cent aligned.`, context);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
if (!
|
|
69
|
-
throw new LocalError("
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
function checkoutRequestBody(request, context) {
|
|
68
|
+
if (!request || typeof request !== "object" || Array.isArray(request)) {
|
|
69
|
+
throw new LocalError("checkout must be an object with a product.", context);
|
|
70
|
+
}
|
|
71
|
+
if (request.product === "balance_topup") {
|
|
72
|
+
assertUsdMicrosAmount(request.amountUsdMicros, "amountUsdMicros", context);
|
|
73
|
+
return {
|
|
74
|
+
product: "balance_topup",
|
|
75
|
+
amount_usd_micros: request.amountUsdMicros,
|
|
76
|
+
...(request.successUrl !== undefined ? { success_url: request.successUrl } : {}),
|
|
77
|
+
...(request.cancelUrl !== undefined ? { cancel_url: request.cancelUrl } : {}),
|
|
78
|
+
};
|
|
75
79
|
}
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
return {
|
|
80
|
+
if (request.product === "tier") {
|
|
81
|
+
assertStringInSet(request.tier, BILLING_TIERS, "tier", context);
|
|
82
|
+
return {
|
|
83
|
+
product: "tier",
|
|
84
|
+
tier: request.tier,
|
|
85
|
+
...(request.successUrl !== undefined ? { success_url: request.successUrl } : {}),
|
|
86
|
+
...(request.cancelUrl !== undefined ? { cancel_url: request.cancelUrl } : {}),
|
|
87
|
+
};
|
|
79
88
|
}
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
if (request.product === "email_pack") {
|
|
90
|
+
return {
|
|
91
|
+
product: "email_pack",
|
|
92
|
+
...(request.successUrl !== undefined ? { success_url: request.successUrl } : {}),
|
|
93
|
+
...(request.cancelUrl !== undefined ? { cancel_url: request.cancelUrl } : {}),
|
|
94
|
+
};
|
|
83
95
|
}
|
|
84
|
-
throw new LocalError("
|
|
96
|
+
throw new LocalError("product must be one of: balance_topup, tier, email_pack.", context);
|
|
85
97
|
}
|
|
86
98
|
export class Billing {
|
|
87
99
|
client;
|
|
@@ -91,53 +103,53 @@ export class Billing {
|
|
|
91
103
|
constructor(client) {
|
|
92
104
|
this.client = client;
|
|
93
105
|
this.balance = this.checkBalance.bind(this);
|
|
94
|
-
this.createEmail = this.
|
|
106
|
+
this.createEmail = this.createEmailOrganization.bind(this);
|
|
95
107
|
this.autoRecharge = this.setAutoRecharge.bind(this);
|
|
96
108
|
}
|
|
97
|
-
/** Check a
|
|
109
|
+
/** Check a organization by organization id (UUID), wallet, or email. */
|
|
98
110
|
async checkBalance(identifier) {
|
|
99
|
-
return this.
|
|
111
|
+
return this.getOrganization(identifier);
|
|
100
112
|
}
|
|
101
113
|
/**
|
|
102
|
-
* Read a
|
|
103
|
-
* or email. An
|
|
114
|
+
* Read a organization's financial detail by organization id (UUID), wallet,
|
|
115
|
+
* or email. An organization id reads `GET /orgs/v1/:org_id/billing`
|
|
104
116
|
* directly; a wallet/email is resolved through the
|
|
105
|
-
* `GET /
|
|
106
|
-
* wallet linked to the
|
|
117
|
+
* `GET /orgs/v1/lookup?wallet=|?email=` lookup. Requires SIWX from a
|
|
118
|
+
* wallet linked to the organization (or matching the looked-up `?wallet`), or an
|
|
107
119
|
* admin key; email lookups are admin-only.
|
|
108
120
|
*/
|
|
109
|
-
async
|
|
110
|
-
return
|
|
121
|
+
async getOrganization(identifier) {
|
|
122
|
+
return resolveOrganizationDetail(this.client, identifier, "checking balance");
|
|
111
123
|
}
|
|
112
124
|
/**
|
|
113
|
-
* Resolve a wallet or email to its
|
|
114
|
-
* canonical `
|
|
115
|
-
* An
|
|
125
|
+
* Resolve a wallet or email to its organization detail — including the
|
|
126
|
+
* canonical `organization_id` — via `GET /orgs/v1/lookup?wallet=|?email=`.
|
|
127
|
+
* An org-id (UUID) argument is read directly instead. SIWX must match the
|
|
116
128
|
* `?wallet`; email lookups are admin-only.
|
|
117
129
|
*/
|
|
118
|
-
async
|
|
119
|
-
return
|
|
130
|
+
async lookupOrganization(identifier) {
|
|
131
|
+
return resolveOrganizationDetail(this.client, identifier, "looking up organization");
|
|
120
132
|
}
|
|
121
|
-
/** Fetch billing history by
|
|
133
|
+
/** Fetch billing history by organization id (UUID), wallet, or email. */
|
|
122
134
|
async history(identifier, limit) {
|
|
123
135
|
return this.getHistory(identifier, limit);
|
|
124
136
|
}
|
|
125
137
|
/**
|
|
126
|
-
* Fetch ledger history for a
|
|
127
|
-
* (UUID): a wallet/email identifier is first resolved to its
|
|
128
|
-
* lookup, then `GET /
|
|
129
|
-
* Requires SIWX from a wallet linked to the
|
|
138
|
+
* Fetch ledger history for a organization. History is keyed by organization id
|
|
139
|
+
* (UUID): a wallet/email identifier is first resolved to its organization via the
|
|
140
|
+
* lookup, then `GET /orgs/v1/:org_id/billing/history` is read.
|
|
141
|
+
* Requires SIWX from a wallet linked to the organization, or an admin key.
|
|
130
142
|
*/
|
|
131
143
|
async getHistory(identifier, limit) {
|
|
132
144
|
if (limit !== undefined) {
|
|
133
145
|
assertPositiveSafeInteger(limit, "limit", "fetching billing history");
|
|
134
146
|
}
|
|
135
147
|
const id = classifyBillingIdentifier(identifier, "fetching billing history");
|
|
136
|
-
const
|
|
148
|
+
const organizationId = id.kind === "organization_id"
|
|
137
149
|
? id.value
|
|
138
|
-
: (await
|
|
139
|
-
.
|
|
140
|
-
const base = `/
|
|
150
|
+
: (await fetchOrganizationByLookup(this.client, id.kind, id.value, "fetching billing history"))
|
|
151
|
+
.organization_id;
|
|
152
|
+
const base = `/orgs/v1/${encodeURIComponent(organizationId)}/billing/history`;
|
|
141
153
|
const path = limit !== undefined
|
|
142
154
|
? `${base}?limit=${encodeURIComponent(String(limit))}`
|
|
143
155
|
: base;
|
|
@@ -145,79 +157,57 @@ export class Billing {
|
|
|
145
157
|
context: "fetching billing history",
|
|
146
158
|
});
|
|
147
159
|
}
|
|
148
|
-
/** Create a Stripe checkout URL
|
|
149
|
-
async createCheckout(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return this.client.request(
|
|
160
|
+
/** Create a Stripe checkout URL for an organization. */
|
|
161
|
+
async createCheckout(organizationId, checkout) {
|
|
162
|
+
assertNonEmptyString(organizationId, "organizationId", "creating checkout");
|
|
163
|
+
const body = checkoutRequestBody(checkout, "creating checkout");
|
|
164
|
+
return this.client.request(`/orgs/v1/${encodeURIComponent(organizationId)}/checkouts`, {
|
|
153
165
|
method: "POST",
|
|
154
|
-
body
|
|
166
|
+
body,
|
|
155
167
|
context: "creating checkout",
|
|
156
|
-
withAuth: false,
|
|
157
168
|
});
|
|
158
169
|
}
|
|
159
|
-
/** Create an email-only (no-wallet)
|
|
160
|
-
async
|
|
161
|
-
assertEmailAddress(email, "email", "creating email
|
|
162
|
-
return this.client.request("/
|
|
170
|
+
/** Create an email-only (no-wallet) organization. Sends a verification email. */
|
|
171
|
+
async createEmailOrganization(email) {
|
|
172
|
+
assertEmailAddress(email, "email", "creating email organization");
|
|
173
|
+
return this.client.request("/orgs/v1/email", {
|
|
163
174
|
method: "POST",
|
|
164
175
|
body: { email },
|
|
165
|
-
context: "creating email
|
|
176
|
+
context: "creating email organization",
|
|
166
177
|
withAuth: false,
|
|
167
178
|
});
|
|
168
179
|
}
|
|
169
180
|
/**
|
|
170
|
-
* Link a wallet to an existing email
|
|
171
|
-
* Stripe + x402 payments. `
|
|
172
|
-
* `
|
|
173
|
-
* `
|
|
174
|
-
* `POST /
|
|
181
|
+
* Link a wallet to an existing email organization to enable hybrid
|
|
182
|
+
* Stripe + x402 payments. `organizationId` is the canonical
|
|
183
|
+
* `organization_id` (UUID) returned by `createEmailOrganization` /
|
|
184
|
+
* `lookupOrganization`; the gateway addresses the route as
|
|
185
|
+
* `POST /orgs/v1/:org_id/wallets`. Returns the gateway
|
|
175
186
|
* response; v1.46+ gateways include a {@link LinkWalletPoolImplications}
|
|
176
187
|
* block describing the freshly-shared pool's tier, current usage, and limits
|
|
177
188
|
* so callers can warn before the merge pushes usage `over_limit`.
|
|
178
189
|
*/
|
|
179
|
-
async linkWallet(
|
|
180
|
-
assertNonEmptyString(
|
|
190
|
+
async linkWallet(organizationId, wallet) {
|
|
191
|
+
assertNonEmptyString(organizationId, "organizationId", "linking wallet");
|
|
181
192
|
assertEvmAddress(wallet, "wallet", "linking wallet");
|
|
182
|
-
return this.client.request(`/
|
|
193
|
+
return this.client.request(`/orgs/v1/${encodeURIComponent(organizationId)}/wallets`, {
|
|
183
194
|
method: "POST",
|
|
184
195
|
body: { wallet: wallet.toLowerCase() },
|
|
185
196
|
context: "linking wallet",
|
|
186
197
|
});
|
|
187
198
|
}
|
|
188
|
-
/** Create a Stripe checkout for a tier subscription/renewal/upgrade. */
|
|
189
|
-
async tierCheckout(tier, identifier) {
|
|
190
|
-
assertStringInSet(tier, BILLING_TIERS, "tier", "creating tier checkout");
|
|
191
|
-
const body = checkoutIdentifierBody(identifier, "creating tier checkout");
|
|
192
|
-
return this.client.request(`/billing/v1/tiers/${encodeURIComponent(tier)}/checkout`, {
|
|
193
|
-
method: "POST",
|
|
194
|
-
body,
|
|
195
|
-
context: "creating tier checkout",
|
|
196
|
-
withAuth: false,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
/** Buy a $5 email pack (10,000 emails). */
|
|
200
|
-
async buyEmailPack(identifier) {
|
|
201
|
-
const body = checkoutIdentifierBody(identifier, "creating email pack checkout");
|
|
202
|
-
return this.client.request("/billing/v1/email-packs/checkout", {
|
|
203
|
-
method: "POST",
|
|
204
|
-
body,
|
|
205
|
-
context: "creating email pack checkout",
|
|
206
|
-
withAuth: false,
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
199
|
/** Enable/disable email-pack auto-recharge. */
|
|
210
200
|
async setAutoRecharge(opts) {
|
|
201
|
+
assertNonEmptyString(opts.organizationId, "organizationId", "setting auto-recharge");
|
|
211
202
|
const body = {
|
|
212
|
-
billing_account_id: opts.billingAccountId,
|
|
213
203
|
enabled: opts.enabled,
|
|
214
204
|
};
|
|
215
205
|
if (opts.threshold !== undefined) {
|
|
216
206
|
assertNonNegativeSafeInteger(opts.threshold, "threshold", "setting auto-recharge");
|
|
217
207
|
body.threshold = opts.threshold;
|
|
218
208
|
}
|
|
219
|
-
await this.client.request(
|
|
220
|
-
method: "
|
|
209
|
+
await this.client.request(`/orgs/v1/${encodeURIComponent(opts.organizationId)}/billing/auto-recharge`, {
|
|
210
|
+
method: "PATCH",
|
|
221
211
|
body,
|
|
222
212
|
context: "setting auto-recharge",
|
|
223
213
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/namespaces/billing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/namespaces/billing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAuG1B,MAAM,aAAa,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAE9D,MAAM,OAAO,GACX,iEAAiE,CAAC;AASpE;;;;GAIG;AACH,SAAS,yBAAyB,CAChC,UAAmB,EACnB,OAAe;IAEf,oBAAoB,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACxD,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IACxD,CAAC;IACD,IAAI,M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AAC,MAAM,CAAC,OAAO,CACxB,YAAY,kBAAkB,CAAC,cAAc,CAAC,UAAU,EACxD;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE;YACtC,OAAO,EAAE,gBAAgB;SAC1B,CACF,CAAC;IACJ,CAAC;IAED,+CAA+C;IAC/C,KAAK,CAAC,eAAe,CAAC,IAAyB;QAC7C,oBAAoB,CAAC,IAAI,CAAC,cAAc,EAAE,gBAAgB,EAAE,uBAAuB,CAAC,CAAC;QACrF,MAAM,IAAI,GAA4B;YACpC,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;QACF,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACjC,4BAA4B,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,uBAAuB,CAAC,CAAC;YACnF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAClC,CAAC;QAED,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAU,YAAY,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,wBAAwB,EAAE;YAC9G,MAAM,EAAE,OAAO;YACf,IAAI;YACJ,OAAO,EAAE,uBAAuB;SACjC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -57,7 +57,7 @@ export type DevicePollResult = {
|
|
|
57
57
|
kind: "expired_token";
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Organization overview. Forward-compatible: the gateway owns the exact shape and
|
|
61
61
|
* may add fields, so unknown keys are preserved via the index signature.
|
|
62
62
|
* `scope.kind` is `"email"` for the operator-session (email-union) and
|
|
63
63
|
* `"wallet"` for a SIWX slice.
|
|
@@ -68,7 +68,7 @@ export interface OperatorOverview {
|
|
|
68
68
|
principal?: string;
|
|
69
69
|
};
|
|
70
70
|
rollup?: Record<string, unknown>;
|
|
71
|
-
|
|
71
|
+
organizations?: unknown[];
|
|
72
72
|
wallets?: unknown[];
|
|
73
73
|
advisories?: unknown[];
|
|
74
74
|
[key: string]: unknown;
|
|
@@ -243,7 +243,7 @@ export declare class Operator {
|
|
|
243
243
|
*/
|
|
244
244
|
devicePoll(deviceCode: string): Promise<DevicePollResult>;
|
|
245
245
|
/**
|
|
246
|
-
* Fetch the
|
|
246
|
+
* Fetch the organization overview. With `opts.token` the request carries the
|
|
247
247
|
* operator-session bearer and returns the email-union; without it the request
|
|
248
248
|
* falls back to the credential provider's default auth (SIWX) and returns
|
|
249
249
|
* that wallet's slice. The CLI always passes a token (human-only surface); the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../src/namespaces/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,oBAA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C,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBpD;;;;OAIG;IACH,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM;IAWxD;;;;OAIG;IACG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAa/E"}
|
|
@@ -142,7 +142,7 @@ export class Operator {
|
|
|
142
142
|
throw new ApiError(`Unexpected operator device-token response (HTTP ${res.status})`, res.status, body, "polling operator device token");
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
|
-
* Fetch the
|
|
145
|
+
* Fetch the organization overview. With `opts.token` the request carries the
|
|
146
146
|
* operator-session bearer and returns the email-union; without it the request
|
|
147
147
|
* falls back to the credential provider's default auth (SIWX) and returns
|
|
148
148
|
* that wallet's slice. The CLI always passes a token (human-only surface); the
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* membership in the role lattice below, or a per-project grant. These shapes map
|
|
6
6
|
* to `/agent/v1/whoami` and `/orgs/v1*`.
|
|
7
7
|
*
|
|
8
|
-
* Public vocabulary is `org` / `org_id` (v1.82): the internal `
|
|
8
|
+
* Public vocabulary is `org` / `org_id` (v1.82): the internal `organization`
|
|
9
9
|
* substrate never appears on the wire.
|
|
10
10
|
*/
|
|
11
11
|
/** Org role lattice: `owner > admin > developer > billing > viewer`. */
|
|
@@ -37,7 +37,7 @@ export interface Principal {
|
|
|
37
37
|
* `"revoked"` do not). Returned by {@link Orgs.whoami} and {@link Orgs.list}.
|
|
38
38
|
*
|
|
39
39
|
* v1.82: carries `org_id` + `display_name` (the public vocabulary), replacing
|
|
40
|
-
* the pre-v1.82 `
|
|
40
|
+
* the pre-v1.82 `organization_id`.
|
|
41
41
|
*/
|
|
42
42
|
export interface OrgMembership {
|
|
43
43
|
org_id: string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* membership in the role lattice below, or a per-project grant. These shapes map
|
|
6
6
|
* to `/agent/v1/whoami` and `/orgs/v1*`.
|
|
7
7
|
*
|
|
8
|
-
* Public vocabulary is `org` / `org_id` (v1.82): the internal `
|
|
8
|
+
* Public vocabulary is `org` / `org_id` (v1.82): the internal `organization`
|
|
9
9
|
* substrate never appears on the wire.
|
|
10
10
|
*/
|
|
11
11
|
export {};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Operator-only project actions live on the {@link Admin} namespace:
|
|
9
9
|
* - `admin.archiveProject` / `admin.reactivateProject` — moderate-archive
|
|
10
|
-
* - `admin.setLeasePerpetual` —
|
|
10
|
+
* - `admin.setLeasePerpetual` — organization-level escape hatch (replaces the
|
|
11
11
|
* v1.56 `projects.pin` removed in v1.57)
|
|
12
12
|
*/
|
|
13
13
|
import type { Client } from "../kernel.js";
|
|
@@ -44,7 +44,7 @@ export declare class Projects {
|
|
|
44
44
|
/**
|
|
45
45
|
* List projects in the named, domain-aware inventory (gateway
|
|
46
46
|
* `project-findability`). Each row carries `name`, `site_url`,
|
|
47
|
-
* `custom_domains`, `
|
|
47
|
+
* `custom_domains`, `organization_id` (the owning org), `status`, and
|
|
48
48
|
* `created_at`.
|
|
49
49
|
*
|
|
50
50
|
* Membership-scoped by default (`GET /projects/v1`): returns every project
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Operator-only project actions live on the {@link Admin} namespace:
|
|
9
9
|
* - `admin.archiveProject` / `admin.reactivateProject` — moderate-archive
|
|
10
|
-
* - `admin.setLeasePerpetual` —
|
|
10
|
+
* - `admin.setLeasePerpetual` — organization-level escape hatch (replaces the
|
|
11
11
|
* v1.56 `projects.pin` removed in v1.57)
|
|
12
12
|
*/
|
|
13
13
|
import { LocalError, ProjectNotFound } from "../errors.js";
|
|
@@ -96,7 +96,7 @@ export class Projects {
|
|
|
96
96
|
/**
|
|
97
97
|
* List projects in the named, domain-aware inventory (gateway
|
|
98
98
|
* `project-findability`). Each row carries `name`, `site_url`,
|
|
99
|
-
* `custom_domains`, `
|
|
99
|
+
* `custom_domains`, `organization_id` (the owning org), `status`, and
|
|
100
100
|
* `created_at`.
|
|
101
101
|
*
|
|
102
102
|
* Membership-scoped by default (`GET /projects/v1`): returns every project
|
|
@@ -18,7 +18,7 @@ export interface ProvisionOptions {
|
|
|
18
18
|
* `developer`+ membership on that org (a project-scoped grant cannot authorize
|
|
19
19
|
* creating a new project). Omit for the cold-start path — the wallet's billing
|
|
20
20
|
* account is used or auto-created exactly as before. Note: tier is governed by
|
|
21
|
-
* the org/
|
|
21
|
+
* the org/organization, not the project — the gateway ignores a client tier.
|
|
22
22
|
*/
|
|
23
23
|
orgId?: string;
|
|
24
24
|
}
|
|
@@ -29,18 +29,18 @@ export interface ProvisionResult {
|
|
|
29
29
|
schema_slot: string;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* Lifecycle state of the owning
|
|
33
|
-
* machine moved from `internal.projects` to `internal.
|
|
32
|
+
* Lifecycle state of the owning organization (gateway v1.57+). The state
|
|
33
|
+
* machine moved from `internal.projects` to `internal.organizations`; every
|
|
34
34
|
* project on the account inherits the same value. `purging` is an internal
|
|
35
35
|
* transition state and is not exposed on the wire.
|
|
36
36
|
*/
|
|
37
|
-
export type
|
|
37
|
+
export type OrganizationLifecycleState = "active" | "past_due" | "frozen" | "dormant" | "purged";
|
|
38
38
|
/**
|
|
39
|
-
* Effective project status, derived from `(
|
|
39
|
+
* Effective project status, derived from `(organization_lifecycle_state,
|
|
40
40
|
* deleted_at, archived_at)`:
|
|
41
41
|
* - `deleted_at` set → `"deleted"`
|
|
42
42
|
* - `archived_at` set → `"archived"`
|
|
43
|
-
* - otherwise → the
|
|
43
|
+
* - otherwise → the organization's `lifecycle_state`
|
|
44
44
|
*
|
|
45
45
|
* Use this for serving / UX decisions instead of trying to combine the
|
|
46
46
|
* underlying fields yourself.
|
|
@@ -52,7 +52,7 @@ export type EffectiveProjectStatus = "active" | "past_due" | "frozen" | "dormant
|
|
|
52
52
|
* and `GET /agent/v1/operator/projects` (operator email-union, `--all`) — both
|
|
53
53
|
* share this shape.
|
|
54
54
|
*
|
|
55
|
-
* Tier and lifecycle live on the owning
|
|
55
|
+
* Tier and lifecycle live on the owning organization, not the project; the
|
|
56
56
|
* row mirrors them for convenience but read `r.tier.status()` for the
|
|
57
57
|
* authoritative account view.
|
|
58
58
|
*/
|
|
@@ -76,20 +76,20 @@ export interface ProjectSummary {
|
|
|
76
76
|
status?: EffectiveProjectStatus;
|
|
77
77
|
/** Alias of `status` (gateway v1.57 canonical field). */
|
|
78
78
|
effective_status?: EffectiveProjectStatus;
|
|
79
|
-
/** Owning
|
|
80
|
-
|
|
79
|
+
/** Owning organization's lifecycle state. */
|
|
80
|
+
organization_lifecycle_state?: OrganizationLifecycleState;
|
|
81
81
|
/** Account-level lease-perpetual escape hatch (mirror). */
|
|
82
82
|
lease_perpetual?: boolean;
|
|
83
83
|
/**
|
|
84
|
-
* Owning org (
|
|
84
|
+
* Owning org (organization) id — v1.77 org-owned control plane. A wallet
|
|
85
85
|
* authenticates; the org owns the project. Surfaced as `org_id` in CLI/MCP
|
|
86
86
|
* output. `null` for legacy rows; optional because the legacy wallet-scoped
|
|
87
87
|
* list (`GET /wallets/v1/:address/projects`) omits it.
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
organization_id?: string | null;
|
|
90
90
|
/**
|
|
91
91
|
* Provisioning principal id — provenance for who created the project (v1.77).
|
|
92
|
-
* Optional for the same reason as {@link ProjectSummary.
|
|
92
|
+
* Optional for the same reason as {@link ProjectSummary.organization_id}.
|
|
93
93
|
*/
|
|
94
94
|
created_by?: string | null;
|
|
95
95
|
created_at: string;
|
|
@@ -113,7 +113,7 @@ export interface ProjectSummary {
|
|
|
113
113
|
*/
|
|
114
114
|
export interface ListProjectsOptions {
|
|
115
115
|
/**
|
|
116
|
-
* Narrow to projects owned by one org (
|
|
116
|
+
* Narrow to projects owned by one org (organization) id. Authorize-before-
|
|
117
117
|
* reveal: a non-member or guessed id returns the same 403 as a real-but-
|
|
118
118
|
* unauthorized org; a non-UUID id is a clean 400.
|
|
119
119
|
*/
|
|
@@ -165,8 +165,8 @@ export interface UsageReport {
|
|
|
165
165
|
lease_expires_at?: string | null;
|
|
166
166
|
/** Derived effective status — see {@link EffectiveProjectStatus}. */
|
|
167
167
|
effective_status: EffectiveProjectStatus;
|
|
168
|
-
/** Owning
|
|
169
|
-
|
|
168
|
+
/** Owning organization's lifecycle state. */
|
|
169
|
+
organization_lifecycle_state: OrganizationLifecycleState;
|
|
170
170
|
}
|
|
171
171
|
export interface ColumnSchema {
|
|
172
172
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.types.d.ts","sourceRoot":"","sources":["../../src/namespaces/projects.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIxD,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,+FAA+F;IAC/F,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAID;;;;;GAKG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"projects.types.d.ts","sourceRoot":"","sources":["../../src/namespaces/projects.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,M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