run402-mcp 2.41.1 → 2.43.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 +2 -2
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/tools/list-projects.d.ts +8 -2
- package/dist/tools/list-projects.d.ts.map +1 -1
- package/dist/tools/list-projects.js +40 -14
- package/dist/tools/list-projects.js.map +1 -1
- package/dist/tools/orgs.d.ts +38 -12
- package/dist/tools/orgs.d.ts.map +1 -1
- package/dist/tools/orgs.js +97 -20
- package/dist/tools/orgs.js.map +1 -1
- package/dist/tools/provision.d.ts +2 -0
- package/dist/tools/provision.d.ts.map +1 -1
- package/dist/tools/provision.js +5 -0
- package/dist/tools/provision.js.map +1 -1
- package/dist/tools/rename-project.d.ts +16 -0
- package/dist/tools/rename-project.d.ts.map +1 -0
- package/dist/tools/rename-project.js +26 -0
- package/dist/tools/rename-project.js.map +1 -0
- package/dist/tools/status.d.ts.map +1 -1
- package/dist/tools/status.js +4 -1
- package/dist/tools/status.js.map +1 -1
- package/package.json +1 -1
- package/sdk/dist/control-plane-credentials.d.ts +1 -1
- package/sdk/dist/control-plane-credentials.js +1 -1
- package/sdk/dist/index.d.ts +16 -7
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +19 -8
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/namespaces/operator.d.ts +101 -0
- package/sdk/dist/namespaces/operator.d.ts.map +1 -1
- package/sdk/dist/namespaces/operator.js +60 -1
- package/sdk/dist/namespaces/operator.js.map +1 -1
- package/sdk/dist/namespaces/org.d.ts +73 -35
- package/sdk/dist/namespaces/org.d.ts.map +1 -1
- package/sdk/dist/namespaces/org.js +122 -71
- package/sdk/dist/namespaces/org.js.map +1 -1
- package/sdk/dist/namespaces/org.types.d.ts +51 -17
- package/sdk/dist/namespaces/org.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/org.types.js +7 -4
- package/sdk/dist/namespaces/org.types.js.map +1 -1
- package/sdk/dist/namespaces/projects.d.ts +44 -16
- package/sdk/dist/namespaces/projects.d.ts.map +1 -1
- package/sdk/dist/namespaces/projects.js +72 -28
- package/sdk/dist/namespaces/projects.js.map +1 -1
- package/sdk/dist/namespaces/projects.types.d.ts +98 -10
- package/sdk/dist/namespaces/projects.types.d.ts.map +1 -1
- package/sdk/dist/node/index.d.ts +3 -1
- package/sdk/dist/node/index.d.ts.map +1 -1
- package/sdk/dist/node/index.js +2 -1
- package/sdk/dist/node/index.js.map +1 -1
- package/sdk/dist/node/operator-claim.d.ts +49 -0
- package/sdk/dist/node/operator-claim.d.ts.map +1 -0
- package/sdk/dist/node/operator-claim.js +77 -0
- package/sdk/dist/node/operator-claim.js.map +1 -0
- package/sdk/dist/scoped.d.ts +3 -2
- package/sdk/dist/scoped.d.ts.map +1 -1
- package/sdk/dist/scoped.js +5 -2
- package/sdk/dist/scoped.js.map +1 -1
|
@@ -114,6 +114,101 @@ export interface CliTokenExchange {
|
|
|
114
114
|
/** Must match the `state` used at authorize time. */
|
|
115
115
|
state: string;
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* A claim challenge (`POST …/claim-wallet-org/challenge`). The wallet must sign a
|
|
119
|
+
* fresh SIWX message carrying {@link ClaimChallenge.nonce}; that signed message
|
|
120
|
+
* becomes the `SIGN-IN-WITH-X` header on {@link ClaimWalletOrg.submit}. Reveals
|
|
121
|
+
* nothing about the wallet's orgs — control is proven only at claim time.
|
|
122
|
+
*/
|
|
123
|
+
export interface ClaimChallenge {
|
|
124
|
+
challenge_id: string;
|
|
125
|
+
nonce: string;
|
|
126
|
+
expires_at: string;
|
|
127
|
+
sign_instructions?: {
|
|
128
|
+
scheme?: string;
|
|
129
|
+
nonce?: string;
|
|
130
|
+
note?: string;
|
|
131
|
+
[key: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
[key: string]: unknown;
|
|
134
|
+
}
|
|
135
|
+
/** Input to {@link ClaimWalletOrg.challenge}. */
|
|
136
|
+
export interface ClaimChallengeInput {
|
|
137
|
+
/** The wallet (0x EVM address) whose agent-owned org is being claimed. */
|
|
138
|
+
wallet: string;
|
|
139
|
+
/**
|
|
140
|
+
* The human's write-capable control-plane session bearer. Falls back to the
|
|
141
|
+
* client's default auth when omitted — pass it explicitly unless the client was
|
|
142
|
+
* constructed with control-plane-session credentials.
|
|
143
|
+
*/
|
|
144
|
+
token?: string;
|
|
145
|
+
}
|
|
146
|
+
/** Input to {@link ClaimWalletOrg.submit}. */
|
|
147
|
+
export interface ClaimSubmitInput {
|
|
148
|
+
/**
|
|
149
|
+
* The fresh SIWX proof over the challenge nonce — the value of the
|
|
150
|
+
* `SIGN-IN-WITH-X` header (the wallet proof). In Node, build it with
|
|
151
|
+
* `signWalletOrgClaim` from `@run402/sdk/node`.
|
|
152
|
+
*/
|
|
153
|
+
siwx: string;
|
|
154
|
+
/** The human's control-plane session bearer (see {@link ClaimChallengeInput.token}). */
|
|
155
|
+
token?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Target org id. Omit on the first submit; supply it on the second round when
|
|
158
|
+
* the first returned `select_org` (the wallet's agent owns more than one org).
|
|
159
|
+
* The same `token` + `siwx` are reused — no re-challenge, no re-sign.
|
|
160
|
+
*/
|
|
161
|
+
orgId?: string;
|
|
162
|
+
/** Optional label to set on the claimed org at the same time. `null`/`""` clears. */
|
|
163
|
+
displayName?: string | null;
|
|
164
|
+
}
|
|
165
|
+
/** One org offered for selection when a wallet's agent owns more than one (`select_org`). */
|
|
166
|
+
export interface SelectableOrg {
|
|
167
|
+
org_id: string;
|
|
168
|
+
display_name: string | null;
|
|
169
|
+
tier: string;
|
|
170
|
+
[key: string]: unknown;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Result of {@link ClaimWalletOrg.submit}. A discriminated union: `"claimed"` on
|
|
174
|
+
* success, or `"select_org"` when the wallet's agent owns more than one org and
|
|
175
|
+
* the caller must re-submit with a chosen `orgId`. `select_org` is a normal
|
|
176
|
+
* (non-error) result — it is returned, never thrown.
|
|
177
|
+
*/
|
|
178
|
+
export type ClaimResult = {
|
|
179
|
+
status: "claimed";
|
|
180
|
+
org_id: string;
|
|
181
|
+
display_name: string | null;
|
|
182
|
+
role: string;
|
|
183
|
+
/** True when the human already owned the org (idempotent re-claim). */
|
|
184
|
+
already_owned?: boolean;
|
|
185
|
+
[key: string]: unknown;
|
|
186
|
+
} | {
|
|
187
|
+
status: "select_org";
|
|
188
|
+
selectable_orgs: SelectableOrg[];
|
|
189
|
+
[key: string]: unknown;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Wallet-owned org claim — `r.operator.claimWalletOrg.*`. The isomorphic
|
|
193
|
+
* (raw-proof) seam: `challenge` issues a nonce; `submit` posts the dual proof
|
|
194
|
+
* (control-plane session bearer + a fresh `SIGN-IN-WITH-X` wallet signature). The
|
|
195
|
+
* Node convenience `signWalletOrgClaim` / `claimWalletOrg` in `@run402/sdk/node`
|
|
196
|
+
* runs the whole dance (read session → challenge → sign → submit).
|
|
197
|
+
*/
|
|
198
|
+
export declare class ClaimWalletOrg {
|
|
199
|
+
private readonly client;
|
|
200
|
+
constructor(client: Client);
|
|
201
|
+
/** Request a single-use challenge nonce the wallet must sign (`POST …/claim-wallet-org/challenge`). */
|
|
202
|
+
challenge(input: ClaimChallengeInput): Promise<ClaimChallenge>;
|
|
203
|
+
/**
|
|
204
|
+
* Execute the claim (`POST …/claim-wallet-org`) carrying both proofs: the
|
|
205
|
+
* control-plane session bearer (the human) and the `SIGN-IN-WITH-X` wallet
|
|
206
|
+
* signature. Returns a discriminated {@link ClaimResult}; a `select_org` result
|
|
207
|
+
* is returned (not thrown). Throws {@link StepUpRequiredError} when the session
|
|
208
|
+
* is not passkey-fresh, and `ApiError` (`WALLET_PROOF_INVALID`) on a bad proof.
|
|
209
|
+
*/
|
|
210
|
+
submit(input: ClaimSubmitInput): Promise<ClaimResult>;
|
|
211
|
+
}
|
|
117
212
|
export declare class Operator {
|
|
118
213
|
private readonly client;
|
|
119
214
|
/**
|
|
@@ -125,6 +220,12 @@ export declare class Operator {
|
|
|
125
220
|
* CLI write-login below. See {@link OperatorSession}.
|
|
126
221
|
*/
|
|
127
222
|
readonly session: OperatorSession;
|
|
223
|
+
/**
|
|
224
|
+
* Wallet-owned org claim (v1.82): `r.operator.claimWalletOrg.challenge()` +
|
|
225
|
+
* `.submit()`. The raw dual-proof seam; the Node convenience `claimWalletOrg`
|
|
226
|
+
* in `@run402/sdk/node` runs the full dance.
|
|
227
|
+
*/
|
|
228
|
+
readonly claimWalletOrg: ClaimWalletOrg;
|
|
128
229
|
constructor(client: Client);
|
|
129
230
|
/**
|
|
130
231
|
* Begin the device-authorization flow. Unauthenticated. Returns the codes 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;;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AAG,MAAM;IAWxD;;;;OAIG;IACG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAa/E"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Gateway contract: kychee-com/run402-private#443 (RFC 8628 device-auth bridge).
|
|
19
19
|
*/
|
|
20
|
-
import { ApiError, NetworkError } from "../errors.js";
|
|
20
|
+
import { ApiError, LocalError, NetworkError } from "../errors.js";
|
|
21
21
|
import { OperatorSession } from "./operator-session.js";
|
|
22
22
|
const POLL_ERROR_CODES = new Set([
|
|
23
23
|
"authorization_pending",
|
|
@@ -25,6 +25,58 @@ const POLL_ERROR_CODES = new Set([
|
|
|
25
25
|
"access_denied",
|
|
26
26
|
"expired_token",
|
|
27
27
|
]);
|
|
28
|
+
/**
|
|
29
|
+
* Wallet-owned org claim — `r.operator.claimWalletOrg.*`. The isomorphic
|
|
30
|
+
* (raw-proof) seam: `challenge` issues a nonce; `submit` posts the dual proof
|
|
31
|
+
* (control-plane session bearer + a fresh `SIGN-IN-WITH-X` wallet signature). The
|
|
32
|
+
* Node convenience `signWalletOrgClaim` / `claimWalletOrg` in `@run402/sdk/node`
|
|
33
|
+
* runs the whole dance (read session → challenge → sign → submit).
|
|
34
|
+
*/
|
|
35
|
+
export class ClaimWalletOrg {
|
|
36
|
+
client;
|
|
37
|
+
constructor(client) {
|
|
38
|
+
this.client = client;
|
|
39
|
+
}
|
|
40
|
+
/** Request a single-use challenge nonce the wallet must sign (`POST …/claim-wallet-org/challenge`). */
|
|
41
|
+
async challenge(input) {
|
|
42
|
+
if (!input?.wallet) {
|
|
43
|
+
throw new LocalError("claimWalletOrg.challenge requires { wallet }", "requesting wallet-org claim challenge");
|
|
44
|
+
}
|
|
45
|
+
return this.client.request("/agent/v1/operator/claim-wallet-org/challenge", {
|
|
46
|
+
method: "POST",
|
|
47
|
+
body: { wallet: input.wallet },
|
|
48
|
+
...(input.token ? { headers: { Authorization: `Bearer ${input.token}` }, withAuth: false } : {}),
|
|
49
|
+
context: "requesting wallet-org claim challenge",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Execute the claim (`POST …/claim-wallet-org`) carrying both proofs: the
|
|
54
|
+
* control-plane session bearer (the human) and the `SIGN-IN-WITH-X` wallet
|
|
55
|
+
* signature. Returns a discriminated {@link ClaimResult}; a `select_org` result
|
|
56
|
+
* is returned (not thrown). Throws {@link StepUpRequiredError} when the session
|
|
57
|
+
* is not passkey-fresh, and `ApiError` (`WALLET_PROOF_INVALID`) on a bad proof.
|
|
58
|
+
*/
|
|
59
|
+
async submit(input) {
|
|
60
|
+
if (!input?.siwx) {
|
|
61
|
+
throw new LocalError("claimWalletOrg.submit requires { siwx } (the SIGN-IN-WITH-X proof)", "claiming wallet org");
|
|
62
|
+
}
|
|
63
|
+
const headers = { "SIGN-IN-WITH-X": input.siwx };
|
|
64
|
+
if (input.token)
|
|
65
|
+
headers.Authorization = `Bearer ${input.token}`;
|
|
66
|
+
const body = {};
|
|
67
|
+
if (input.orgId !== undefined)
|
|
68
|
+
body.org_id = input.orgId;
|
|
69
|
+
if (input.displayName !== undefined)
|
|
70
|
+
body.display_name = input.displayName;
|
|
71
|
+
return this.client.request("/agent/v1/operator/claim-wallet-org", {
|
|
72
|
+
method: "POST",
|
|
73
|
+
body,
|
|
74
|
+
headers,
|
|
75
|
+
withAuth: !input.token,
|
|
76
|
+
context: "claiming wallet org",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
28
80
|
export class Operator {
|
|
29
81
|
client;
|
|
30
82
|
/**
|
|
@@ -36,9 +88,16 @@ export class Operator {
|
|
|
36
88
|
* CLI write-login below. See {@link OperatorSession}.
|
|
37
89
|
*/
|
|
38
90
|
session;
|
|
91
|
+
/**
|
|
92
|
+
* Wallet-owned org claim (v1.82): `r.operator.claimWalletOrg.challenge()` +
|
|
93
|
+
* `.submit()`. The raw dual-proof seam; the Node convenience `claimWalletOrg`
|
|
94
|
+
* in `@run402/sdk/node` runs the full dance.
|
|
95
|
+
*/
|
|
96
|
+
claimWalletOrg;
|
|
39
97
|
constructor(client) {
|
|
40
98
|
this.client = client;
|
|
41
99
|
this.session = new OperatorSession(client);
|
|
100
|
+
this.claimWalletOrg = new ClaimWalletOrg(client);
|
|
42
101
|
}
|
|
43
102
|
/**
|
|
44
103
|
* Begin the device-authorization flow. Unauthenticated. Returns the codes the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.js","sourceRoot":"","sources":["../../src/namespaces/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"operator.js","sourceRoot":"","sources":["../../src/namespaces/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA+FxD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B,uBAAuB;IACvB,WAAW;IACX,eAAe;IACf,eAAe;CAChB,CAAC,CAAC;AAgFH;;;;;;GAMG;AACH,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,uGAAuG;IACvG,KAAK,CAAC,SAAS,CAAC,KAA0B;QACxC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,UAAU,CAAC,8CAA8C,EAAE,uCAAuC,CAAC,CAAC;QAChH,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAiB,+CAA+C,EAAE;YAC1F,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAA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AE,2BAA2B;SACrC,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,4EAA4E;IAC5E,4EAA4E;IAC5E,2EAA2E;IAC3E,gEAAgE;IAChE,8EAA8E;IAC9E,+DAA+D;IAE/D;;;;OAIG;IACH,oBAAoB,CAAC,MAA0B;QAC7C,MAAM,CAAC,GAAG,IAAI,eAAe,CAAC;YAC5B,YAAY,EAAE,MAAM,CAAC,WAAW;YAChC,cAAc,EAAE,MAAM,CAAC,aAAa;YACpC,qBAAqB,EAAE,MAAM;YAC7B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAC;QACH,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,yCAAyC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;IACvF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,gBAAgB,CAAC,MAAwB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAsB,mCAAmC,EAAE;YACnF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,aAAa,EAAE,MAAM,CAAC,YAAY;gBAClC,YAAY,EAAE,MAAM,CAAC,WAAW;gBAChC,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB;YACD,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,mCAAmC;SAC7C,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,73 +1,111 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `org` namespace — the org-owned control plane (gateway v1.77
|
|
3
|
-
*
|
|
4
|
-
* invites (owner-gated), and read the control-plane audit trail. All routes use
|
|
5
|
-
* the existing SIWX auth; authorization is a membership lookup, never
|
|
6
|
-
* `wallet == signer`.
|
|
2
|
+
* `org` namespace — the org-owned control plane (gateway v1.77+, first-class in
|
|
3
|
+
* v1.82). Mirrors the `r.projects` / `r.project(id)` idiom:
|
|
7
4
|
*
|
|
8
|
-
*
|
|
9
|
-
* `r.org
|
|
10
|
-
*
|
|
5
|
+
* - `r.orgs` — collection + identity: `create`, `list`, `whoami`.
|
|
6
|
+
* - `r.org(id)` — a resource-scoped sub-client (id pre-bound): `get`,
|
|
7
|
+
* `rename`, `members.*`, `invites.*`, `audit`.
|
|
8
|
+
*
|
|
9
|
+
* All routes use the existing SIWX (or control-plane-session) auth; authorization
|
|
10
|
+
* is a membership lookup, never `wallet == signer`. Mutations (`create`,
|
|
11
|
+
* `rename`, member/invite changes) are step-up gated server-side and may return
|
|
12
|
+
* `STEP_UP_REQUIRED` when driven by a stale control-plane session.
|
|
11
13
|
*/
|
|
12
14
|
import type { Client } from "../kernel.js";
|
|
13
|
-
import type { AddMemberInput, AuditEvent, AuditOptions, CreateInviteInput, MemberMutationResult, MemberRevokeResult, OrgInvite, OrgInviteRevokeResult, OrgMember, OrgMembership, OrgRole, WhoAmIResult } from "./org.types.js";
|
|
14
|
-
/** Member management — `r.org.members.*`. */
|
|
15
|
+
import type { AddMemberInput, AuditEvent, AuditOptions, CreateInviteInput, CreateOrgInput, MemberMutationResult, MemberRevokeResult, OrgDetail, OrgInvite, OrgInviteRevokeResult, OrgMember, OrgMembership, OrgRole, OrgSummary, WhoAmIResult } from "./org.types.js";
|
|
16
|
+
/** Member management — `r.org(id).members.*`. The org id is bound at construction. */
|
|
15
17
|
export declare class OrgMembers {
|
|
16
18
|
private readonly client;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
private readonly orgId;
|
|
20
|
+
constructor(client: Client, orgId: string);
|
|
21
|
+
/** List members of the org (`GET /orgs/v1/:org_id/members`). Any active member. */
|
|
22
|
+
list(): Promise<OrgMember[]>;
|
|
20
23
|
/**
|
|
21
|
-
* Add a member by wallet (`POST /orgs/v1/:
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
* Add a member by wallet (`POST /orgs/v1/:org_id/members`). Requires an active
|
|
25
|
+
* `owner` membership. A brand-new wallet is provisioned as a `human` principal;
|
|
26
|
+
* `role` defaults to `"developer"` server-side.
|
|
24
27
|
*/
|
|
25
|
-
add(
|
|
28
|
+
add(input: AddMemberInput): Promise<MemberMutationResult>;
|
|
26
29
|
/**
|
|
27
30
|
* Change a member's role (`PATCH …/members/:principal_id`). Requires `owner`;
|
|
28
31
|
* demoting the org's only active owner fails with `409 LAST_OWNER`.
|
|
29
32
|
*/
|
|
30
|
-
setRole(
|
|
33
|
+
setRole(principalId: string, role: OrgRole): Promise<MemberMutationResult>;
|
|
31
34
|
/**
|
|
32
35
|
* Revoke a member (`DELETE …/members/:principal_id`) — one row, status
|
|
33
36
|
* `revoked`, no key rotation. Requires `owner`; revoking the org's only active
|
|
34
37
|
* owner fails with `409 LAST_OWNER`.
|
|
35
38
|
*/
|
|
36
|
-
revoke(
|
|
39
|
+
revoke(principalId: string): Promise<MemberRevokeResult>;
|
|
37
40
|
}
|
|
38
|
-
/** Email-invite management — `r.org.invites.*`. */
|
|
41
|
+
/** Email-invite management — `r.org(id).invites.*`. The org id is bound at construction. */
|
|
39
42
|
export declare class OrgInvites {
|
|
40
43
|
private readonly client;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
private readonly orgId;
|
|
45
|
+
constructor(client: Client, orgId: string);
|
|
46
|
+
/** List pending email invites (`GET /orgs/v1/:org_id/invites`). Any active member. */
|
|
47
|
+
list(): Promise<OrgInvite[]>;
|
|
44
48
|
/**
|
|
45
49
|
* Invite a person by email (`POST …/invites`); claimed at their first login.
|
|
46
50
|
* Requires `owner` (plus step-up when driven by a control-plane session).
|
|
47
51
|
*/
|
|
48
|
-
create(
|
|
52
|
+
create(input: CreateInviteInput): Promise<OrgInvite>;
|
|
49
53
|
/** Revoke a pending invite by its pending principal id (`DELETE …/invites/:principal_id`). Requires `owner`. */
|
|
50
|
-
revoke(
|
|
54
|
+
revoke(principalId: string): Promise<OrgInviteRevokeResult>;
|
|
51
55
|
}
|
|
52
|
-
|
|
56
|
+
/**
|
|
57
|
+
* A resource-scoped org sub-client returned by `r.org(id)`. The org id is bound
|
|
58
|
+
* at construction; instance operations take no repeated id argument. Mirrors the
|
|
59
|
+
* project-scoped `r.project(id)` shape (narrower scope).
|
|
60
|
+
*/
|
|
61
|
+
export declare class ScopedOrg {
|
|
53
62
|
private readonly client;
|
|
54
|
-
/** Member management (`r.org.members.*`). */
|
|
63
|
+
/** Member management (`r.org(id).members.*`). */
|
|
55
64
|
readonly members: OrgMembers;
|
|
56
|
-
/** Email-invite management (`r.org.invites.*`). */
|
|
65
|
+
/** Email-invite management (`r.org(id).invites.*`). */
|
|
57
66
|
readonly invites: OrgInvites;
|
|
67
|
+
/** The org id this sub-client is bound to. Read-only. */
|
|
68
|
+
readonly orgId: string;
|
|
69
|
+
constructor(client: Client, orgId: string);
|
|
70
|
+
/**
|
|
71
|
+
* Read this org (`GET /orgs/v1/:org_id`) — `{ org_id, display_name, tier, role }`.
|
|
72
|
+
* Any active member may view; a non-member (including a guessed id) gets the
|
|
73
|
+
* same non-revealing `403`.
|
|
74
|
+
*/
|
|
75
|
+
get(): Promise<OrgDetail>;
|
|
76
|
+
/**
|
|
77
|
+
* Rename this org (`PATCH /orgs/v1/:org_id`). Owner-only + step-up gated. Pass
|
|
78
|
+
* `null` or `""` to clear the label. Returns the updated `{ org_id,
|
|
79
|
+
* display_name, tier }`.
|
|
80
|
+
*/
|
|
81
|
+
rename(displayName: string | null): Promise<OrgSummary>;
|
|
82
|
+
/**
|
|
83
|
+
* Control-plane audit trail for this org (`GET /orgs/v1/:org_id/audit`).
|
|
84
|
+
* admin+. Newest-first; page with the `before` cursor.
|
|
85
|
+
*/
|
|
86
|
+
audit(opts?: AuditOptions): Promise<AuditEvent[]>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Org collection + identity — `r.orgs.*`. Operations that are not bound to a
|
|
90
|
+
* single org: create a new org, list the caller's orgs, resolve the principal.
|
|
91
|
+
*/
|
|
92
|
+
export declare class Orgs {
|
|
93
|
+
private readonly client;
|
|
58
94
|
constructor(client: Client);
|
|
95
|
+
/**
|
|
96
|
+
* Create an empty org on the `prototype` tier (`POST /orgs/v1`); the caller
|
|
97
|
+
* becomes `owner`. Accepts only an optional `displayName` — there is no tier at
|
|
98
|
+
* create (paid tiers are a separate flow). Step-up gated; the soft per-owner
|
|
99
|
+
* free-org cap may return `FREE_ORG_OWNER_LIMIT_EXCEEDED`.
|
|
100
|
+
*/
|
|
101
|
+
create(input?: CreateOrgInput): Promise<OrgSummary>;
|
|
102
|
+
/** List the orgs the caller is an active member of (`GET /orgs/v1`), as memberships. */
|
|
103
|
+
list(): Promise<OrgMembership[]>;
|
|
59
104
|
/**
|
|
60
105
|
* Resolve the caller's control-plane principal and its org memberships
|
|
61
106
|
* (`GET /agent/v1/whoami`). This is the REMOTE identity; for the local,
|
|
62
107
|
* network-free wallet/profile identity use `r.whoami()`.
|
|
63
108
|
*/
|
|
64
109
|
whoami(): Promise<WhoAmIResult>;
|
|
65
|
-
/** List the orgs the caller is a member of (`GET /orgs/v1`), as memberships. */
|
|
66
|
-
list(): Promise<OrgMembership[]>;
|
|
67
|
-
/**
|
|
68
|
-
* Control-plane audit trail for an org (`GET /orgs/v1/:billing_account_id/audit`).
|
|
69
|
-
* admin+. Newest-first; page with the `before` cursor.
|
|
70
|
-
*/
|
|
71
|
-
audit(billingAccountId: string, opts?: AuditOptions): Promise<AuditEvent[]>;
|
|
72
110
|
}
|
|
73
111
|
//# sourceMappingURL=org.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/namespaces/org.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/namespaces/org.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAA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