@primitivedotdev/sdk 0.31.1 → 0.31.2
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/api/index.d.ts +2 -2
- package/dist/api/index.js +3 -3
- package/dist/{api-CMzxyIqH.js → api-C7hBq-Wd.js} +64 -9
- package/dist/{index-BwDgniCA.d.ts → index-C17n15Eq.d.ts} +294 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/openapi/index.js +1 -1
- package/dist/{operations.generated-BOlpIYkQ.js → operations.generated-CDIos4wH.js} +756 -44
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ const openapiDocument = {
|
|
|
10
10
|
"info": {
|
|
11
11
|
"title": "Primitive API",
|
|
12
12
|
"version": "1.0.0",
|
|
13
|
-
"description": "The Primitive API lets you manage domains, emails, webhook endpoints,\nfilters, and account settings programmatically.\n\n## Authentication\n\nMost endpoints require a Bearer token in the `Authorization` header:\n\n```\nAuthorization: Bearer prim_<your_api_key>\n```\n\nAPI keys are org-scoped. Create and manage them in your dashboard\nunder Settings > API Keys. CLI login
|
|
13
|
+
"description": "The Primitive API lets you manage domains, emails, webhook endpoints,\nfilters, and account settings programmatically.\n\n## Authentication\n\nMost endpoints require a Bearer token in the `Authorization` header:\n\n```\nAuthorization: Bearer prim_<your_api_key>\n```\n\nAPI keys are org-scoped. Create and manage them in your dashboard\nunder Settings > API Keys. CLI login plus CLI/agent signup endpoints\nexplicitly declare `security: []`; they do not require an API key because\nthey are used to create OAuth CLI sessions.\n\n## Rate Limiting\n\nThe API enforces a sliding window rate limit of **120 requests per\n60 seconds** per organization. When exceeded, the API returns `429`\nwith a `Retry-After` header indicating how many seconds to wait.\n\n## Pagination\n\nList endpoints use cursor-based pagination. Responses include a\n`meta` object with `total`, `limit`, and `cursor` fields. Pass the\n`cursor` value as a query parameter to fetch the next page. When\n`cursor` is `null`, there are no more results.\n\n## Response Format\n\nAll responses use a consistent envelope:\n\n```json\n{\n \"success\": true,\n \"data\": { ... },\n \"meta\": { \"total\": 42, \"limit\": 50, \"cursor\": \"...\" }\n}\n```\n\nErrors follow the same pattern:\n\n```json\n{\n \"success\": false,\n \"error\": { \"code\": \"not_found\", \"message\": \"Email not found\" }\n}\n```\n\n## Webhook signing\n\nOutbound webhook deliveries (configured via the `endpoints` API)\nare signed so receivers can verify they came from Primitive and\nhave not been tampered with in transit. The signing scheme is\ndeliberately simple so it can be reimplemented in any language\nin a few lines. The Node SDK's `verifyWebhookSignature` helper\nis the reference implementation; the wire details below let you\nwrite a verifier in Python, Go, Ruby, etc. without reading our\nsource.\n\n**Header**: `Primitive-Signature: t=<unix-seconds>,v1=<hex>`\n\nA legacy `MyMX-Signature` header is also sent on every delivery\nwith the same value, retained for back-compatibility with\nintegrations written before the rename. New code should read\n`Primitive-Signature`.\n\n**Signed string**: `${timestamp}.${rawBody}` where `timestamp`\nis the Unix-seconds integer from the `t=` parameter and\n`rawBody` is the exact bytes of the HTTP request body BEFORE\nany JSON decoding. Verify against the raw body, not a\nre-serialized parse, or you will silently mismatch on\ninsignificant whitespace.\n\n**Signature**: HMAC-SHA256 of the signed string, hex-encoded\n(lowercase). Use the account's webhook secret as the HMAC key,\nas a UTF-8 byte sequence.\n\n**Secret**: returned by `GET /account/webhook-secret`. The\nstring looks base64-shaped (e.g. `XNHBBW8VqoBjRfNs1tkZj11jTk...`)\nbut is NOT base64; use it AS-IS as a UTF-8 string for the HMAC\nkey. Base64-decoding before HMAC will silently produce\nmismatched signatures.\n\n**Tolerance**: by convention, reject deliveries whose `t=`\ntimestamp is more than 5 minutes off your wall-clock to defend\nagainst replay attacks. The Node SDK's helper enforces this by\ndefault.\n\n**Verification recipe** (any language):\n\n```\n1. Read the raw HTTP body (do not parse).\n2. Read `Primitive-Signature: t=<ts>,v1=<sig>`.\n3. Reject if abs(now - ts) > 300 seconds.\n4. expected = HMAC_SHA256_hex(secret_utf8, f\"{ts}.{rawBody}\")\n5. Constant-time compare expected to sig. Reject if not equal.\n```\n\nFor Node, use `verifyWebhookSignature` from\n`@primitivedotdev/sdk/webhook` (or the higher-level\n`handleWebhook` helper if you want a one-liner). For other\nlanguages, the recipe above is everything you need.\n\nTest deliveries: `POST /endpoints/{id}/test` triggers a fake\ndelivery to your endpoint URL, signed with your real account\nsecret, so you can confirm verification end-to-end without\nneeding real inbound mail. The test response carries the exact\n`signature` header value sent on the wire so you can compare\nstrings directly.\n",
|
|
14
14
|
"contact": {
|
|
15
15
|
"name": "Primitive",
|
|
16
16
|
"url": "https://primitive.dev"
|
|
@@ -33,6 +33,10 @@ const openapiDocument = {
|
|
|
33
33
|
"name": "CLI",
|
|
34
34
|
"description": "Browser-assisted CLI authentication"
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
"name": "Agent",
|
|
38
|
+
"description": "Agent signup and authentication"
|
|
39
|
+
},
|
|
36
40
|
{
|
|
37
41
|
"name": "Account",
|
|
38
42
|
"description": "Manage your account settings, storage, and webhook secret"
|
|
@@ -96,7 +100,7 @@ const openapiDocument = {
|
|
|
96
100
|
"/cli/login/poll": { "post": {
|
|
97
101
|
"operationId": "pollCliLogin",
|
|
98
102
|
"summary": "Poll CLI browser login",
|
|
99
|
-
"description": "Polls a CLI login session until the browser approval either succeeds,\nis denied, expires, or is polled too quickly. The
|
|
103
|
+
"description": "Polls a CLI login session until the browser approval either succeeds,\nis denied, expires, or is polled too quickly. The OAuth token set is\ncreated only after approval and is returned exactly once.\n",
|
|
100
104
|
"tags": ["CLI"],
|
|
101
105
|
"security": [],
|
|
102
106
|
"requestBody": {
|
|
@@ -105,7 +109,7 @@ const openapiDocument = {
|
|
|
105
109
|
},
|
|
106
110
|
"responses": {
|
|
107
111
|
"200": {
|
|
108
|
-
"description": "CLI login approved and
|
|
112
|
+
"description": "CLI login approved and OAuth token set created",
|
|
109
113
|
"headers": { "Cache-Control": {
|
|
110
114
|
"schema": { "type": "string" },
|
|
111
115
|
"description": "Always `no-store`"
|
|
@@ -246,8 +250,8 @@ const openapiDocument = {
|
|
|
246
250
|
} },
|
|
247
251
|
"/cli/signup/verify": { "post": {
|
|
248
252
|
"operationId": "verifyCliSignup",
|
|
249
|
-
"summary": "Verify CLI signup and create
|
|
250
|
-
"description": "Verifies the email code for a CLI signup session, creates the account,\nredeems the reserved signup code,
|
|
253
|
+
"summary": "Verify CLI signup and create OAuth session",
|
|
254
|
+
"description": "Verifies the email code for a CLI signup session, creates the account,\nredeems the reserved signup code, creates an org-scoped OAuth CLI\nsession, and returns the token set exactly once. This endpoint does not\nrequire an API key.\n",
|
|
251
255
|
"tags": ["CLI"],
|
|
252
256
|
"security": [],
|
|
253
257
|
"requestBody": {
|
|
@@ -256,7 +260,7 @@ const openapiDocument = {
|
|
|
256
260
|
},
|
|
257
261
|
"responses": {
|
|
258
262
|
"200": {
|
|
259
|
-
"description": "CLI signup verified and
|
|
263
|
+
"description": "CLI signup verified and OAuth token set created",
|
|
260
264
|
"headers": { "Cache-Control": {
|
|
261
265
|
"schema": { "type": "string" },
|
|
262
266
|
"description": "Always `no-store`"
|
|
@@ -273,10 +277,106 @@ const openapiDocument = {
|
|
|
273
277
|
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
274
278
|
}
|
|
275
279
|
} },
|
|
280
|
+
"/agent/signup/start": { "post": {
|
|
281
|
+
"operationId": "startAgentSignup",
|
|
282
|
+
"summary": "Start agent account signup",
|
|
283
|
+
"description": "Starts an agent-native signup session. The API validates the signup code,\ncreates a pending signup session, sends an email verification code, and\nreturns an opaque signup token used by the resend and verify steps. This\nendpoint does not require an API key.\n",
|
|
284
|
+
"tags": ["Agent"],
|
|
285
|
+
"security": [],
|
|
286
|
+
"requestBody": {
|
|
287
|
+
"required": true,
|
|
288
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/StartAgentSignupInput" } } }
|
|
289
|
+
},
|
|
290
|
+
"responses": {
|
|
291
|
+
"201": {
|
|
292
|
+
"description": "Agent signup session created and verification email sent",
|
|
293
|
+
"headers": { "Cache-Control": {
|
|
294
|
+
"schema": { "type": "string" },
|
|
295
|
+
"description": "Always `no-store`"
|
|
296
|
+
} },
|
|
297
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
298
|
+
"type": "object",
|
|
299
|
+
"properties": { "data": { "$ref": "#/components/schemas/AgentSignupStartResult" } }
|
|
300
|
+
}] } } }
|
|
301
|
+
},
|
|
302
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
303
|
+
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
304
|
+
}
|
|
305
|
+
} },
|
|
306
|
+
"/agent/signup/resend": { "post": {
|
|
307
|
+
"operationId": "resendAgentSignupVerification",
|
|
308
|
+
"summary": "Resend agent signup verification code",
|
|
309
|
+
"description": "Sends a new email verification code for a pending agent signup session.\nThis endpoint does not require an API key.\n",
|
|
310
|
+
"tags": ["Agent"],
|
|
311
|
+
"security": [],
|
|
312
|
+
"requestBody": {
|
|
313
|
+
"required": true,
|
|
314
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResendAgentSignupVerificationInput" } } }
|
|
315
|
+
},
|
|
316
|
+
"responses": {
|
|
317
|
+
"200": {
|
|
318
|
+
"description": "Verification email resent",
|
|
319
|
+
"headers": { "Cache-Control": {
|
|
320
|
+
"schema": { "type": "string" },
|
|
321
|
+
"description": "Always `no-store`"
|
|
322
|
+
} },
|
|
323
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
324
|
+
"type": "object",
|
|
325
|
+
"properties": { "data": { "$ref": "#/components/schemas/AgentSignupResendResult" } }
|
|
326
|
+
}] } } }
|
|
327
|
+
},
|
|
328
|
+
"400": {
|
|
329
|
+
"description": "Invalid token or expired token",
|
|
330
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
331
|
+
},
|
|
332
|
+
"429": {
|
|
333
|
+
"description": "Global rate limit exceeded or resend requested too quickly",
|
|
334
|
+
"headers": { "Retry-After": {
|
|
335
|
+
"schema": { "type": "integer" },
|
|
336
|
+
"description": "Seconds to wait before retrying"
|
|
337
|
+
} },
|
|
338
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
} },
|
|
342
|
+
"/agent/signup/verify": { "post": {
|
|
343
|
+
"operationId": "verifyAgentSignup",
|
|
344
|
+
"summary": "Verify agent signup and create OAuth tokens",
|
|
345
|
+
"description": "Verifies the email code for an agent signup session, creates the account\nwhen needed, redeems the reserved signup code, mints an org-scoped OAuth\nsession for CLI authentication, and returns the raw tokens exactly once.\nFor existing users, the optional `org_id` selects which accessible\nworkspace should receive the new session.\n",
|
|
346
|
+
"tags": ["Agent"],
|
|
347
|
+
"security": [],
|
|
348
|
+
"requestBody": {
|
|
349
|
+
"required": true,
|
|
350
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/VerifyAgentSignupInput" } } }
|
|
351
|
+
},
|
|
352
|
+
"responses": {
|
|
353
|
+
"200": {
|
|
354
|
+
"description": "Agent signup verified and OAuth tokens created",
|
|
355
|
+
"headers": { "Cache-Control": {
|
|
356
|
+
"schema": { "type": "string" },
|
|
357
|
+
"description": "Always `no-store`"
|
|
358
|
+
} },
|
|
359
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
360
|
+
"type": "object",
|
|
361
|
+
"properties": { "data": { "$ref": "#/components/schemas/AgentSignupVerifyResult" } }
|
|
362
|
+
}] } } }
|
|
363
|
+
},
|
|
364
|
+
"400": {
|
|
365
|
+
"description": "Invalid request, invalid verification code, expired token, invalid signup code, or account creation failure",
|
|
366
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
367
|
+
},
|
|
368
|
+
"403": { "$ref": "#/components/responses/Forbidden" },
|
|
369
|
+
"409": {
|
|
370
|
+
"description": "Existing account is not in a usable workspace state",
|
|
371
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
372
|
+
},
|
|
373
|
+
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
374
|
+
}
|
|
375
|
+
} },
|
|
276
376
|
"/cli/logout": { "post": {
|
|
277
377
|
"operationId": "cliLogout",
|
|
278
|
-
"summary": "Revoke the current CLI
|
|
279
|
-
"description": "Revokes the
|
|
378
|
+
"summary": "Revoke the current CLI OAuth session",
|
|
379
|
+
"description": "Revokes the OAuth grant used to authenticate the request. API-key\nauthenticated legacy logout requests succeed without deleting server API\nkeys so old local CLI state can be cleared safely.\n",
|
|
280
380
|
"tags": ["CLI"],
|
|
281
381
|
"requestBody": {
|
|
282
382
|
"required": false,
|
|
@@ -284,7 +384,7 @@ const openapiDocument = {
|
|
|
284
384
|
},
|
|
285
385
|
"responses": {
|
|
286
386
|
"200": {
|
|
287
|
-
"description": "CLI
|
|
387
|
+
"description": "CLI logout completed",
|
|
288
388
|
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
289
389
|
"type": "object",
|
|
290
390
|
"properties": { "data": { "$ref": "#/components/schemas/CliLogoutResult" } }
|
|
@@ -2012,7 +2112,14 @@ const openapiDocument = {
|
|
|
2012
2112
|
"slow_down",
|
|
2013
2113
|
"access_denied",
|
|
2014
2114
|
"expired_token",
|
|
2015
|
-
"invalid_device_code"
|
|
2115
|
+
"invalid_device_code",
|
|
2116
|
+
"invalid_signup_code",
|
|
2117
|
+
"invalid_signup_token",
|
|
2118
|
+
"invalid_verification_code",
|
|
2119
|
+
"email_delivery_failed",
|
|
2120
|
+
"clerk_signup_failed",
|
|
2121
|
+
"no_orgs_for_user",
|
|
2122
|
+
"org_not_accessible"
|
|
2016
2123
|
]
|
|
2017
2124
|
},
|
|
2018
2125
|
"message": { "type": "string" },
|
|
@@ -2196,13 +2303,42 @@ const openapiDocument = {
|
|
|
2196
2303
|
"properties": {
|
|
2197
2304
|
"api_key": {
|
|
2198
2305
|
"type": "string",
|
|
2199
|
-
"description": "
|
|
2306
|
+
"description": "Legacy alias for access_token. New CLI builds should persist access_token and refresh_token."
|
|
2200
2307
|
},
|
|
2201
2308
|
"key_id": {
|
|
2309
|
+
"type": "string",
|
|
2310
|
+
"format": "uuid",
|
|
2311
|
+
"description": "Legacy alias for oauth_grant_id"
|
|
2312
|
+
},
|
|
2313
|
+
"key_prefix": {
|
|
2314
|
+
"type": "string",
|
|
2315
|
+
"description": "Legacy display prefix derived from access_token"
|
|
2316
|
+
},
|
|
2317
|
+
"access_token": {
|
|
2318
|
+
"type": "string",
|
|
2319
|
+
"description": "OAuth access token for CLI API authentication"
|
|
2320
|
+
},
|
|
2321
|
+
"refresh_token": {
|
|
2322
|
+
"type": "string",
|
|
2323
|
+
"description": "OAuth refresh token used by the CLI to renew access"
|
|
2324
|
+
},
|
|
2325
|
+
"token_type": {
|
|
2326
|
+
"type": "string",
|
|
2327
|
+
"enum": ["Bearer"]
|
|
2328
|
+
},
|
|
2329
|
+
"expires_in": {
|
|
2330
|
+
"type": "integer",
|
|
2331
|
+
"description": "Seconds until access_token expires"
|
|
2332
|
+
},
|
|
2333
|
+
"auth_method": {
|
|
2334
|
+
"type": "string",
|
|
2335
|
+
"enum": ["oauth"]
|
|
2336
|
+
},
|
|
2337
|
+
"oauth_grant_id": {
|
|
2202
2338
|
"type": "string",
|
|
2203
2339
|
"format": "uuid"
|
|
2204
2340
|
},
|
|
2205
|
-
"
|
|
2341
|
+
"oauth_client_id": { "type": "string" },
|
|
2206
2342
|
"org_id": {
|
|
2207
2343
|
"type": "string",
|
|
2208
2344
|
"format": "uuid"
|
|
@@ -2213,6 +2349,13 @@ const openapiDocument = {
|
|
|
2213
2349
|
"api_key",
|
|
2214
2350
|
"key_id",
|
|
2215
2351
|
"key_prefix",
|
|
2352
|
+
"access_token",
|
|
2353
|
+
"refresh_token",
|
|
2354
|
+
"token_type",
|
|
2355
|
+
"expires_in",
|
|
2356
|
+
"auth_method",
|
|
2357
|
+
"oauth_grant_id",
|
|
2358
|
+
"oauth_client_id",
|
|
2216
2359
|
"org_id",
|
|
2217
2360
|
"org_name"
|
|
2218
2361
|
]
|
|
@@ -2240,7 +2383,7 @@ const openapiDocument = {
|
|
|
2240
2383
|
"type": "string",
|
|
2241
2384
|
"minLength": 1,
|
|
2242
2385
|
"maxLength": 80,
|
|
2243
|
-
"description": "Human-readable device name used for the created CLI
|
|
2386
|
+
"description": "Human-readable device name used for the created CLI OAuth grant"
|
|
2244
2387
|
},
|
|
2245
2388
|
"metadata": {
|
|
2246
2389
|
"type": "object",
|
|
@@ -2341,36 +2484,273 @@ const openapiDocument = {
|
|
|
2341
2484
|
"maxLength": 1024
|
|
2342
2485
|
}
|
|
2343
2486
|
},
|
|
2487
|
+
"required": ["signup_token", "verification_code"]
|
|
2488
|
+
},
|
|
2489
|
+
"CliSignupVerifyResult": {
|
|
2490
|
+
"type": "object",
|
|
2491
|
+
"properties": {
|
|
2492
|
+
"api_key": {
|
|
2493
|
+
"type": "string",
|
|
2494
|
+
"description": "Legacy alias for access_token. New CLI builds should persist access_token and refresh_token."
|
|
2495
|
+
},
|
|
2496
|
+
"key_id": {
|
|
2497
|
+
"type": "string",
|
|
2498
|
+
"format": "uuid",
|
|
2499
|
+
"description": "Legacy alias for oauth_grant_id"
|
|
2500
|
+
},
|
|
2501
|
+
"key_prefix": {
|
|
2502
|
+
"type": "string",
|
|
2503
|
+
"description": "Legacy display prefix derived from access_token"
|
|
2504
|
+
},
|
|
2505
|
+
"access_token": {
|
|
2506
|
+
"type": "string",
|
|
2507
|
+
"description": "OAuth access token for CLI API authentication"
|
|
2508
|
+
},
|
|
2509
|
+
"refresh_token": {
|
|
2510
|
+
"type": "string",
|
|
2511
|
+
"description": "OAuth refresh token used by the CLI to renew access"
|
|
2512
|
+
},
|
|
2513
|
+
"token_type": {
|
|
2514
|
+
"type": "string",
|
|
2515
|
+
"enum": ["Bearer"]
|
|
2516
|
+
},
|
|
2517
|
+
"expires_in": {
|
|
2518
|
+
"type": "integer",
|
|
2519
|
+
"description": "Seconds until access_token expires"
|
|
2520
|
+
},
|
|
2521
|
+
"auth_method": {
|
|
2522
|
+
"type": "string",
|
|
2523
|
+
"enum": ["oauth"]
|
|
2524
|
+
},
|
|
2525
|
+
"oauth_grant_id": {
|
|
2526
|
+
"type": "string",
|
|
2527
|
+
"format": "uuid"
|
|
2528
|
+
},
|
|
2529
|
+
"oauth_client_id": { "type": "string" },
|
|
2530
|
+
"org_id": {
|
|
2531
|
+
"type": "string",
|
|
2532
|
+
"format": "uuid"
|
|
2533
|
+
},
|
|
2534
|
+
"org_name": { "type": ["string", "null"] }
|
|
2535
|
+
},
|
|
2536
|
+
"required": [
|
|
2537
|
+
"api_key",
|
|
2538
|
+
"key_id",
|
|
2539
|
+
"key_prefix",
|
|
2540
|
+
"access_token",
|
|
2541
|
+
"refresh_token",
|
|
2542
|
+
"token_type",
|
|
2543
|
+
"expires_in",
|
|
2544
|
+
"auth_method",
|
|
2545
|
+
"oauth_grant_id",
|
|
2546
|
+
"oauth_client_id",
|
|
2547
|
+
"org_id",
|
|
2548
|
+
"org_name"
|
|
2549
|
+
]
|
|
2550
|
+
},
|
|
2551
|
+
"StartAgentSignupInput": {
|
|
2552
|
+
"type": "object",
|
|
2553
|
+
"additionalProperties": false,
|
|
2554
|
+
"properties": {
|
|
2555
|
+
"email": {
|
|
2556
|
+
"type": "string",
|
|
2557
|
+
"format": "email",
|
|
2558
|
+
"maxLength": 254
|
|
2559
|
+
},
|
|
2560
|
+
"signup_code": {
|
|
2561
|
+
"type": "string",
|
|
2562
|
+
"minLength": 1,
|
|
2563
|
+
"maxLength": 128
|
|
2564
|
+
},
|
|
2565
|
+
"terms_accepted": {
|
|
2566
|
+
"type": "boolean",
|
|
2567
|
+
"const": true,
|
|
2568
|
+
"description": "Must be true to confirm acceptance of Primitive's Terms of Service and Privacy Policy"
|
|
2569
|
+
},
|
|
2570
|
+
"device_name": {
|
|
2571
|
+
"type": "string",
|
|
2572
|
+
"minLength": 1,
|
|
2573
|
+
"maxLength": 80,
|
|
2574
|
+
"description": "Human-readable device name used for the created agent OAuth session"
|
|
2575
|
+
},
|
|
2576
|
+
"metadata": {
|
|
2577
|
+
"type": "object",
|
|
2578
|
+
"additionalProperties": true,
|
|
2579
|
+
"description": "Optional client metadata stored with the signup session; serialized JSON must be 2048 bytes or fewer"
|
|
2580
|
+
}
|
|
2581
|
+
},
|
|
2582
|
+
"required": [
|
|
2583
|
+
"email",
|
|
2584
|
+
"signup_code",
|
|
2585
|
+
"terms_accepted"
|
|
2586
|
+
]
|
|
2587
|
+
},
|
|
2588
|
+
"AgentSignupStartResult": {
|
|
2589
|
+
"type": "object",
|
|
2590
|
+
"properties": {
|
|
2591
|
+
"signup_token": {
|
|
2592
|
+
"type": "string",
|
|
2593
|
+
"description": "Opaque token used to verify or resend the pending agent signup"
|
|
2594
|
+
},
|
|
2595
|
+
"email": {
|
|
2596
|
+
"type": "string",
|
|
2597
|
+
"format": "email"
|
|
2598
|
+
},
|
|
2599
|
+
"expires_in": {
|
|
2600
|
+
"type": "integer",
|
|
2601
|
+
"description": "Seconds until the pending signup expires"
|
|
2602
|
+
},
|
|
2603
|
+
"resend_after": {
|
|
2604
|
+
"type": "integer",
|
|
2605
|
+
"description": "Minimum seconds before requesting another verification email"
|
|
2606
|
+
},
|
|
2607
|
+
"verification_code_length": {
|
|
2608
|
+
"type": "integer",
|
|
2609
|
+
"description": "Number of digits in the emailed verification code"
|
|
2610
|
+
}
|
|
2611
|
+
},
|
|
2344
2612
|
"required": [
|
|
2345
2613
|
"signup_token",
|
|
2346
|
-
"
|
|
2347
|
-
"
|
|
2614
|
+
"email",
|
|
2615
|
+
"expires_in",
|
|
2616
|
+
"resend_after",
|
|
2617
|
+
"verification_code_length"
|
|
2348
2618
|
]
|
|
2349
2619
|
},
|
|
2350
|
-
"
|
|
2620
|
+
"ResendAgentSignupVerificationInput": {
|
|
2621
|
+
"type": "object",
|
|
2622
|
+
"additionalProperties": false,
|
|
2623
|
+
"properties": { "signup_token": {
|
|
2624
|
+
"type": "string",
|
|
2625
|
+
"minLength": 1
|
|
2626
|
+
} },
|
|
2627
|
+
"required": ["signup_token"]
|
|
2628
|
+
},
|
|
2629
|
+
"AgentSignupResendResult": {
|
|
2630
|
+
"type": "object",
|
|
2631
|
+
"properties": {
|
|
2632
|
+
"email": {
|
|
2633
|
+
"type": "string",
|
|
2634
|
+
"format": "email"
|
|
2635
|
+
},
|
|
2636
|
+
"expires_in": {
|
|
2637
|
+
"type": "integer",
|
|
2638
|
+
"description": "Seconds until the pending signup expires"
|
|
2639
|
+
},
|
|
2640
|
+
"resend_after": {
|
|
2641
|
+
"type": "integer",
|
|
2642
|
+
"description": "Minimum seconds before requesting another verification email"
|
|
2643
|
+
},
|
|
2644
|
+
"verification_code_length": {
|
|
2645
|
+
"type": "integer",
|
|
2646
|
+
"description": "Number of digits in the emailed verification code"
|
|
2647
|
+
}
|
|
2648
|
+
},
|
|
2649
|
+
"required": [
|
|
2650
|
+
"email",
|
|
2651
|
+
"expires_in",
|
|
2652
|
+
"resend_after",
|
|
2653
|
+
"verification_code_length"
|
|
2654
|
+
]
|
|
2655
|
+
},
|
|
2656
|
+
"VerifyAgentSignupInput": {
|
|
2657
|
+
"type": "object",
|
|
2658
|
+
"additionalProperties": false,
|
|
2659
|
+
"properties": {
|
|
2660
|
+
"signup_token": {
|
|
2661
|
+
"type": "string",
|
|
2662
|
+
"minLength": 1
|
|
2663
|
+
},
|
|
2664
|
+
"verification_code": {
|
|
2665
|
+
"type": "string",
|
|
2666
|
+
"minLength": 1,
|
|
2667
|
+
"maxLength": 32
|
|
2668
|
+
},
|
|
2669
|
+
"org_id": {
|
|
2670
|
+
"type": "string",
|
|
2671
|
+
"format": "uuid",
|
|
2672
|
+
"description": "Optional workspace id to target when the verified email already belongs to multiple workspaces"
|
|
2673
|
+
}
|
|
2674
|
+
},
|
|
2675
|
+
"required": ["signup_token", "verification_code"]
|
|
2676
|
+
},
|
|
2677
|
+
"AgentOrgRef": {
|
|
2678
|
+
"type": "object",
|
|
2679
|
+
"properties": {
|
|
2680
|
+
"id": {
|
|
2681
|
+
"type": "string",
|
|
2682
|
+
"format": "uuid"
|
|
2683
|
+
},
|
|
2684
|
+
"name": { "type": ["string", "null"] }
|
|
2685
|
+
},
|
|
2686
|
+
"required": ["id", "name"]
|
|
2687
|
+
},
|
|
2688
|
+
"AgentSignupVerifyResult": {
|
|
2351
2689
|
"type": "object",
|
|
2352
2690
|
"properties": {
|
|
2353
2691
|
"api_key": {
|
|
2354
2692
|
"type": "string",
|
|
2355
|
-
"description": "
|
|
2693
|
+
"description": "Legacy alias for access_token. New CLI builds should persist access_token and refresh_token."
|
|
2694
|
+
},
|
|
2695
|
+
"key_id": {
|
|
2696
|
+
"type": "string",
|
|
2697
|
+
"format": "uuid",
|
|
2698
|
+
"description": "Legacy alias for oauth_grant_id"
|
|
2699
|
+
},
|
|
2700
|
+
"key_prefix": {
|
|
2701
|
+
"type": "string",
|
|
2702
|
+
"description": "Legacy display prefix derived from access_token"
|
|
2703
|
+
},
|
|
2704
|
+
"access_token": {
|
|
2705
|
+
"type": "string",
|
|
2706
|
+
"description": "OAuth access token for CLI API authentication"
|
|
2707
|
+
},
|
|
2708
|
+
"refresh_token": {
|
|
2709
|
+
"type": "string",
|
|
2710
|
+
"description": "OAuth refresh token used by the CLI to renew access"
|
|
2711
|
+
},
|
|
2712
|
+
"token_type": {
|
|
2713
|
+
"type": "string",
|
|
2714
|
+
"enum": ["Bearer"]
|
|
2356
2715
|
},
|
|
2357
|
-
"
|
|
2716
|
+
"expires_in": {
|
|
2717
|
+
"type": "integer",
|
|
2718
|
+
"description": "Seconds until access_token expires"
|
|
2719
|
+
},
|
|
2720
|
+
"auth_method": {
|
|
2721
|
+
"type": "string",
|
|
2722
|
+
"enum": ["oauth"]
|
|
2723
|
+
},
|
|
2724
|
+
"oauth_grant_id": {
|
|
2358
2725
|
"type": "string",
|
|
2359
2726
|
"format": "uuid"
|
|
2360
2727
|
},
|
|
2361
|
-
"
|
|
2728
|
+
"oauth_client_id": { "type": "string" },
|
|
2362
2729
|
"org_id": {
|
|
2363
2730
|
"type": "string",
|
|
2364
2731
|
"format": "uuid"
|
|
2365
2732
|
},
|
|
2366
|
-
"org_name": { "type": ["string", "null"] }
|
|
2733
|
+
"org_name": { "type": ["string", "null"] },
|
|
2734
|
+
"orgs": {
|
|
2735
|
+
"type": "array",
|
|
2736
|
+
"items": { "$ref": "#/components/schemas/AgentOrgRef" },
|
|
2737
|
+
"description": "Workspaces available to the verified email. The minted session targets `org_id`."
|
|
2738
|
+
}
|
|
2367
2739
|
},
|
|
2368
2740
|
"required": [
|
|
2369
2741
|
"api_key",
|
|
2370
2742
|
"key_id",
|
|
2371
2743
|
"key_prefix",
|
|
2744
|
+
"access_token",
|
|
2745
|
+
"refresh_token",
|
|
2746
|
+
"token_type",
|
|
2747
|
+
"expires_in",
|
|
2748
|
+
"auth_method",
|
|
2749
|
+
"oauth_grant_id",
|
|
2750
|
+
"oauth_client_id",
|
|
2372
2751
|
"org_id",
|
|
2373
|
-
"org_name"
|
|
2752
|
+
"org_name",
|
|
2753
|
+
"orgs"
|
|
2374
2754
|
]
|
|
2375
2755
|
},
|
|
2376
2756
|
"CliLogoutInput": {
|
|
@@ -2379,7 +2759,7 @@ const openapiDocument = {
|
|
|
2379
2759
|
"properties": { "key_id": {
|
|
2380
2760
|
"type": "string",
|
|
2381
2761
|
"format": "uuid",
|
|
2382
|
-
"description": "Optional
|
|
2762
|
+
"description": "Optional id guard; when provided it must match the authenticated OAuth grant id or API key id"
|
|
2383
2763
|
} }
|
|
2384
2764
|
},
|
|
2385
2765
|
"CliLogoutResult": {
|
|
@@ -2387,14 +2767,20 @@ const openapiDocument = {
|
|
|
2387
2767
|
"properties": {
|
|
2388
2768
|
"revoked": {
|
|
2389
2769
|
"type": "boolean",
|
|
2390
|
-
"
|
|
2770
|
+
"description": "True when an OAuth grant was revoked. False for API-key-authenticated legacy logout, which only clears local CLI state."
|
|
2391
2771
|
},
|
|
2392
2772
|
"key_id": {
|
|
2393
2773
|
"type": "string",
|
|
2394
|
-
"format": "uuid"
|
|
2774
|
+
"format": "uuid",
|
|
2775
|
+
"description": "API key id for API-key-authenticated legacy logout"
|
|
2776
|
+
},
|
|
2777
|
+
"oauth_grant_id": {
|
|
2778
|
+
"type": "string",
|
|
2779
|
+
"format": "uuid",
|
|
2780
|
+
"description": "OAuth grant id revoked by OAuth-authenticated logout"
|
|
2395
2781
|
}
|
|
2396
2782
|
},
|
|
2397
|
-
"required": ["revoked"
|
|
2783
|
+
"required": ["revoked"]
|
|
2398
2784
|
},
|
|
2399
2785
|
"Account": {
|
|
2400
2786
|
"type": "object",
|
|
@@ -4598,11 +4984,263 @@ const operationManifest = [
|
|
|
4598
4984
|
"tag": "Account",
|
|
4599
4985
|
"tagCommand": "account"
|
|
4600
4986
|
},
|
|
4987
|
+
{
|
|
4988
|
+
"binaryResponse": false,
|
|
4989
|
+
"bodyRequired": true,
|
|
4990
|
+
"command": "resend-agent-signup-verification",
|
|
4991
|
+
"description": "Sends a new email verification code for a pending agent signup session.\nThis endpoint does not require an API key.\n",
|
|
4992
|
+
"hasJsonBody": true,
|
|
4993
|
+
"method": "POST",
|
|
4994
|
+
"operationId": "resendAgentSignupVerification",
|
|
4995
|
+
"path": "/agent/signup/resend",
|
|
4996
|
+
"pathParams": [],
|
|
4997
|
+
"queryParams": [],
|
|
4998
|
+
"requestSchema": {
|
|
4999
|
+
"type": "object",
|
|
5000
|
+
"additionalProperties": false,
|
|
5001
|
+
"properties": { "signup_token": {
|
|
5002
|
+
"type": "string",
|
|
5003
|
+
"minLength": 1
|
|
5004
|
+
} },
|
|
5005
|
+
"required": ["signup_token"]
|
|
5006
|
+
},
|
|
5007
|
+
"responseSchema": {
|
|
5008
|
+
"type": "object",
|
|
5009
|
+
"properties": {
|
|
5010
|
+
"email": {
|
|
5011
|
+
"type": "string",
|
|
5012
|
+
"format": "email"
|
|
5013
|
+
},
|
|
5014
|
+
"expires_in": {
|
|
5015
|
+
"type": "integer",
|
|
5016
|
+
"description": "Seconds until the pending signup expires"
|
|
5017
|
+
},
|
|
5018
|
+
"resend_after": {
|
|
5019
|
+
"type": "integer",
|
|
5020
|
+
"description": "Minimum seconds before requesting another verification email"
|
|
5021
|
+
},
|
|
5022
|
+
"verification_code_length": {
|
|
5023
|
+
"type": "integer",
|
|
5024
|
+
"description": "Number of digits in the emailed verification code"
|
|
5025
|
+
}
|
|
5026
|
+
},
|
|
5027
|
+
"required": [
|
|
5028
|
+
"email",
|
|
5029
|
+
"expires_in",
|
|
5030
|
+
"resend_after",
|
|
5031
|
+
"verification_code_length"
|
|
5032
|
+
]
|
|
5033
|
+
},
|
|
5034
|
+
"sdkName": "resendAgentSignupVerification",
|
|
5035
|
+
"summary": "Resend agent signup verification code",
|
|
5036
|
+
"tag": "Agent",
|
|
5037
|
+
"tagCommand": "agent"
|
|
5038
|
+
},
|
|
5039
|
+
{
|
|
5040
|
+
"binaryResponse": false,
|
|
5041
|
+
"bodyRequired": true,
|
|
5042
|
+
"command": "start-agent-signup",
|
|
5043
|
+
"description": "Starts an agent-native signup session. The API validates the signup code,\ncreates a pending signup session, sends an email verification code, and\nreturns an opaque signup token used by the resend and verify steps. This\nendpoint does not require an API key.\n",
|
|
5044
|
+
"hasJsonBody": true,
|
|
5045
|
+
"method": "POST",
|
|
5046
|
+
"operationId": "startAgentSignup",
|
|
5047
|
+
"path": "/agent/signup/start",
|
|
5048
|
+
"pathParams": [],
|
|
5049
|
+
"queryParams": [],
|
|
5050
|
+
"requestSchema": {
|
|
5051
|
+
"type": "object",
|
|
5052
|
+
"additionalProperties": false,
|
|
5053
|
+
"properties": {
|
|
5054
|
+
"email": {
|
|
5055
|
+
"type": "string",
|
|
5056
|
+
"format": "email",
|
|
5057
|
+
"maxLength": 254
|
|
5058
|
+
},
|
|
5059
|
+
"signup_code": {
|
|
5060
|
+
"type": "string",
|
|
5061
|
+
"minLength": 1,
|
|
5062
|
+
"maxLength": 128
|
|
5063
|
+
},
|
|
5064
|
+
"terms_accepted": {
|
|
5065
|
+
"type": "boolean",
|
|
5066
|
+
"const": true,
|
|
5067
|
+
"description": "Must be true to confirm acceptance of Primitive's Terms of Service and Privacy Policy"
|
|
5068
|
+
},
|
|
5069
|
+
"device_name": {
|
|
5070
|
+
"type": "string",
|
|
5071
|
+
"minLength": 1,
|
|
5072
|
+
"maxLength": 80,
|
|
5073
|
+
"description": "Human-readable device name used for the created agent OAuth session"
|
|
5074
|
+
},
|
|
5075
|
+
"metadata": {
|
|
5076
|
+
"type": "object",
|
|
5077
|
+
"additionalProperties": true,
|
|
5078
|
+
"description": "Optional client metadata stored with the signup session; serialized JSON must be 2048 bytes or fewer"
|
|
5079
|
+
}
|
|
5080
|
+
},
|
|
5081
|
+
"required": [
|
|
5082
|
+
"email",
|
|
5083
|
+
"signup_code",
|
|
5084
|
+
"terms_accepted"
|
|
5085
|
+
]
|
|
5086
|
+
},
|
|
5087
|
+
"responseSchema": {
|
|
5088
|
+
"type": "object",
|
|
5089
|
+
"properties": {
|
|
5090
|
+
"signup_token": {
|
|
5091
|
+
"type": "string",
|
|
5092
|
+
"description": "Opaque token used to verify or resend the pending agent signup"
|
|
5093
|
+
},
|
|
5094
|
+
"email": {
|
|
5095
|
+
"type": "string",
|
|
5096
|
+
"format": "email"
|
|
5097
|
+
},
|
|
5098
|
+
"expires_in": {
|
|
5099
|
+
"type": "integer",
|
|
5100
|
+
"description": "Seconds until the pending signup expires"
|
|
5101
|
+
},
|
|
5102
|
+
"resend_after": {
|
|
5103
|
+
"type": "integer",
|
|
5104
|
+
"description": "Minimum seconds before requesting another verification email"
|
|
5105
|
+
},
|
|
5106
|
+
"verification_code_length": {
|
|
5107
|
+
"type": "integer",
|
|
5108
|
+
"description": "Number of digits in the emailed verification code"
|
|
5109
|
+
}
|
|
5110
|
+
},
|
|
5111
|
+
"required": [
|
|
5112
|
+
"signup_token",
|
|
5113
|
+
"email",
|
|
5114
|
+
"expires_in",
|
|
5115
|
+
"resend_after",
|
|
5116
|
+
"verification_code_length"
|
|
5117
|
+
]
|
|
5118
|
+
},
|
|
5119
|
+
"sdkName": "startAgentSignup",
|
|
5120
|
+
"summary": "Start agent account signup",
|
|
5121
|
+
"tag": "Agent",
|
|
5122
|
+
"tagCommand": "agent"
|
|
5123
|
+
},
|
|
5124
|
+
{
|
|
5125
|
+
"binaryResponse": false,
|
|
5126
|
+
"bodyRequired": true,
|
|
5127
|
+
"command": "verify-agent-signup",
|
|
5128
|
+
"description": "Verifies the email code for an agent signup session, creates the account\nwhen needed, redeems the reserved signup code, mints an org-scoped OAuth\nsession for CLI authentication, and returns the raw tokens exactly once.\nFor existing users, the optional `org_id` selects which accessible\nworkspace should receive the new session.\n",
|
|
5129
|
+
"hasJsonBody": true,
|
|
5130
|
+
"method": "POST",
|
|
5131
|
+
"operationId": "verifyAgentSignup",
|
|
5132
|
+
"path": "/agent/signup/verify",
|
|
5133
|
+
"pathParams": [],
|
|
5134
|
+
"queryParams": [],
|
|
5135
|
+
"requestSchema": {
|
|
5136
|
+
"type": "object",
|
|
5137
|
+
"additionalProperties": false,
|
|
5138
|
+
"properties": {
|
|
5139
|
+
"signup_token": {
|
|
5140
|
+
"type": "string",
|
|
5141
|
+
"minLength": 1
|
|
5142
|
+
},
|
|
5143
|
+
"verification_code": {
|
|
5144
|
+
"type": "string",
|
|
5145
|
+
"minLength": 1,
|
|
5146
|
+
"maxLength": 32
|
|
5147
|
+
},
|
|
5148
|
+
"org_id": {
|
|
5149
|
+
"type": "string",
|
|
5150
|
+
"format": "uuid",
|
|
5151
|
+
"description": "Optional workspace id to target when the verified email already belongs to multiple workspaces"
|
|
5152
|
+
}
|
|
5153
|
+
},
|
|
5154
|
+
"required": ["signup_token", "verification_code"]
|
|
5155
|
+
},
|
|
5156
|
+
"responseSchema": {
|
|
5157
|
+
"type": "object",
|
|
5158
|
+
"properties": {
|
|
5159
|
+
"api_key": {
|
|
5160
|
+
"type": "string",
|
|
5161
|
+
"description": "Legacy alias for access_token. New CLI builds should persist access_token and refresh_token."
|
|
5162
|
+
},
|
|
5163
|
+
"key_id": {
|
|
5164
|
+
"type": "string",
|
|
5165
|
+
"format": "uuid",
|
|
5166
|
+
"description": "Legacy alias for oauth_grant_id"
|
|
5167
|
+
},
|
|
5168
|
+
"key_prefix": {
|
|
5169
|
+
"type": "string",
|
|
5170
|
+
"description": "Legacy display prefix derived from access_token"
|
|
5171
|
+
},
|
|
5172
|
+
"access_token": {
|
|
5173
|
+
"type": "string",
|
|
5174
|
+
"description": "OAuth access token for CLI API authentication"
|
|
5175
|
+
},
|
|
5176
|
+
"refresh_token": {
|
|
5177
|
+
"type": "string",
|
|
5178
|
+
"description": "OAuth refresh token used by the CLI to renew access"
|
|
5179
|
+
},
|
|
5180
|
+
"token_type": {
|
|
5181
|
+
"type": "string",
|
|
5182
|
+
"enum": ["Bearer"]
|
|
5183
|
+
},
|
|
5184
|
+
"expires_in": {
|
|
5185
|
+
"type": "integer",
|
|
5186
|
+
"description": "Seconds until access_token expires"
|
|
5187
|
+
},
|
|
5188
|
+
"auth_method": {
|
|
5189
|
+
"type": "string",
|
|
5190
|
+
"enum": ["oauth"]
|
|
5191
|
+
},
|
|
5192
|
+
"oauth_grant_id": {
|
|
5193
|
+
"type": "string",
|
|
5194
|
+
"format": "uuid"
|
|
5195
|
+
},
|
|
5196
|
+
"oauth_client_id": { "type": "string" },
|
|
5197
|
+
"org_id": {
|
|
5198
|
+
"type": "string",
|
|
5199
|
+
"format": "uuid"
|
|
5200
|
+
},
|
|
5201
|
+
"org_name": { "type": ["string", "null"] },
|
|
5202
|
+
"orgs": {
|
|
5203
|
+
"type": "array",
|
|
5204
|
+
"items": {
|
|
5205
|
+
"type": "object",
|
|
5206
|
+
"properties": {
|
|
5207
|
+
"id": {
|
|
5208
|
+
"type": "string",
|
|
5209
|
+
"format": "uuid"
|
|
5210
|
+
},
|
|
5211
|
+
"name": { "type": ["string", "null"] }
|
|
5212
|
+
},
|
|
5213
|
+
"required": ["id", "name"]
|
|
5214
|
+
},
|
|
5215
|
+
"description": "Workspaces available to the verified email. The minted session targets `org_id`."
|
|
5216
|
+
}
|
|
5217
|
+
},
|
|
5218
|
+
"required": [
|
|
5219
|
+
"api_key",
|
|
5220
|
+
"key_id",
|
|
5221
|
+
"key_prefix",
|
|
5222
|
+
"access_token",
|
|
5223
|
+
"refresh_token",
|
|
5224
|
+
"token_type",
|
|
5225
|
+
"expires_in",
|
|
5226
|
+
"auth_method",
|
|
5227
|
+
"oauth_grant_id",
|
|
5228
|
+
"oauth_client_id",
|
|
5229
|
+
"org_id",
|
|
5230
|
+
"org_name",
|
|
5231
|
+
"orgs"
|
|
5232
|
+
]
|
|
5233
|
+
},
|
|
5234
|
+
"sdkName": "verifyAgentSignup",
|
|
5235
|
+
"summary": "Verify agent signup and create OAuth tokens",
|
|
5236
|
+
"tag": "Agent",
|
|
5237
|
+
"tagCommand": "agent"
|
|
5238
|
+
},
|
|
4601
5239
|
{
|
|
4602
5240
|
"binaryResponse": false,
|
|
4603
5241
|
"bodyRequired": false,
|
|
4604
5242
|
"command": "cli-logout",
|
|
4605
|
-
"description": "Revokes the
|
|
5243
|
+
"description": "Revokes the OAuth grant used to authenticate the request. API-key\nauthenticated legacy logout requests succeed without deleting server API\nkeys so old local CLI state can be cleared safely.\n",
|
|
4606
5244
|
"hasJsonBody": true,
|
|
4607
5245
|
"method": "POST",
|
|
4608
5246
|
"operationId": "cliLogout",
|
|
@@ -4615,7 +5253,7 @@ const operationManifest = [
|
|
|
4615
5253
|
"properties": { "key_id": {
|
|
4616
5254
|
"type": "string",
|
|
4617
5255
|
"format": "uuid",
|
|
4618
|
-
"description": "Optional
|
|
5256
|
+
"description": "Optional id guard; when provided it must match the authenticated OAuth grant id or API key id"
|
|
4619
5257
|
} }
|
|
4620
5258
|
},
|
|
4621
5259
|
"responseSchema": {
|
|
@@ -4623,17 +5261,23 @@ const operationManifest = [
|
|
|
4623
5261
|
"properties": {
|
|
4624
5262
|
"revoked": {
|
|
4625
5263
|
"type": "boolean",
|
|
4626
|
-
"
|
|
5264
|
+
"description": "True when an OAuth grant was revoked. False for API-key-authenticated legacy logout, which only clears local CLI state."
|
|
4627
5265
|
},
|
|
4628
5266
|
"key_id": {
|
|
4629
5267
|
"type": "string",
|
|
4630
|
-
"format": "uuid"
|
|
5268
|
+
"format": "uuid",
|
|
5269
|
+
"description": "API key id for API-key-authenticated legacy logout"
|
|
5270
|
+
},
|
|
5271
|
+
"oauth_grant_id": {
|
|
5272
|
+
"type": "string",
|
|
5273
|
+
"format": "uuid",
|
|
5274
|
+
"description": "OAuth grant id revoked by OAuth-authenticated logout"
|
|
4631
5275
|
}
|
|
4632
5276
|
},
|
|
4633
|
-
"required": ["revoked"
|
|
5277
|
+
"required": ["revoked"]
|
|
4634
5278
|
},
|
|
4635
5279
|
"sdkName": "cliLogout",
|
|
4636
|
-
"summary": "Revoke the current CLI
|
|
5280
|
+
"summary": "Revoke the current CLI OAuth session",
|
|
4637
5281
|
"tag": "CLI",
|
|
4638
5282
|
"tagCommand": "cli"
|
|
4639
5283
|
},
|
|
@@ -4641,7 +5285,7 @@ const operationManifest = [
|
|
|
4641
5285
|
"binaryResponse": false,
|
|
4642
5286
|
"bodyRequired": true,
|
|
4643
5287
|
"command": "poll-cli-login",
|
|
4644
|
-
"description": "Polls a CLI login session until the browser approval either succeeds,\nis denied, expires, or is polled too quickly. The
|
|
5288
|
+
"description": "Polls a CLI login session until the browser approval either succeeds,\nis denied, expires, or is polled too quickly. The OAuth token set is\ncreated only after approval and is returned exactly once.\n",
|
|
4645
5289
|
"hasJsonBody": true,
|
|
4646
5290
|
"method": "POST",
|
|
4647
5291
|
"operationId": "pollCliLogin",
|
|
@@ -4662,13 +5306,42 @@ const operationManifest = [
|
|
|
4662
5306
|
"properties": {
|
|
4663
5307
|
"api_key": {
|
|
4664
5308
|
"type": "string",
|
|
4665
|
-
"description": "
|
|
5309
|
+
"description": "Legacy alias for access_token. New CLI builds should persist access_token and refresh_token."
|
|
4666
5310
|
},
|
|
4667
5311
|
"key_id": {
|
|
5312
|
+
"type": "string",
|
|
5313
|
+
"format": "uuid",
|
|
5314
|
+
"description": "Legacy alias for oauth_grant_id"
|
|
5315
|
+
},
|
|
5316
|
+
"key_prefix": {
|
|
5317
|
+
"type": "string",
|
|
5318
|
+
"description": "Legacy display prefix derived from access_token"
|
|
5319
|
+
},
|
|
5320
|
+
"access_token": {
|
|
5321
|
+
"type": "string",
|
|
5322
|
+
"description": "OAuth access token for CLI API authentication"
|
|
5323
|
+
},
|
|
5324
|
+
"refresh_token": {
|
|
5325
|
+
"type": "string",
|
|
5326
|
+
"description": "OAuth refresh token used by the CLI to renew access"
|
|
5327
|
+
},
|
|
5328
|
+
"token_type": {
|
|
5329
|
+
"type": "string",
|
|
5330
|
+
"enum": ["Bearer"]
|
|
5331
|
+
},
|
|
5332
|
+
"expires_in": {
|
|
5333
|
+
"type": "integer",
|
|
5334
|
+
"description": "Seconds until access_token expires"
|
|
5335
|
+
},
|
|
5336
|
+
"auth_method": {
|
|
5337
|
+
"type": "string",
|
|
5338
|
+
"enum": ["oauth"]
|
|
5339
|
+
},
|
|
5340
|
+
"oauth_grant_id": {
|
|
4668
5341
|
"type": "string",
|
|
4669
5342
|
"format": "uuid"
|
|
4670
5343
|
},
|
|
4671
|
-
"
|
|
5344
|
+
"oauth_client_id": { "type": "string" },
|
|
4672
5345
|
"org_id": {
|
|
4673
5346
|
"type": "string",
|
|
4674
5347
|
"format": "uuid"
|
|
@@ -4679,6 +5352,13 @@ const operationManifest = [
|
|
|
4679
5352
|
"api_key",
|
|
4680
5353
|
"key_id",
|
|
4681
5354
|
"key_prefix",
|
|
5355
|
+
"access_token",
|
|
5356
|
+
"refresh_token",
|
|
5357
|
+
"token_type",
|
|
5358
|
+
"expires_in",
|
|
5359
|
+
"auth_method",
|
|
5360
|
+
"oauth_grant_id",
|
|
5361
|
+
"oauth_client_id",
|
|
4682
5362
|
"org_id",
|
|
4683
5363
|
"org_name"
|
|
4684
5364
|
]
|
|
@@ -4845,7 +5525,7 @@ const operationManifest = [
|
|
|
4845
5525
|
"type": "string",
|
|
4846
5526
|
"minLength": 1,
|
|
4847
5527
|
"maxLength": 80,
|
|
4848
|
-
"description": "Human-readable device name used for the created CLI
|
|
5528
|
+
"description": "Human-readable device name used for the created CLI OAuth grant"
|
|
4849
5529
|
},
|
|
4850
5530
|
"metadata": {
|
|
4851
5531
|
"type": "object",
|
|
@@ -4900,7 +5580,7 @@ const operationManifest = [
|
|
|
4900
5580
|
"binaryResponse": false,
|
|
4901
5581
|
"bodyRequired": true,
|
|
4902
5582
|
"command": "verify-cli-signup",
|
|
4903
|
-
"description": "Verifies the email code for a CLI signup session, creates the account,\nredeems the reserved signup code,
|
|
5583
|
+
"description": "Verifies the email code for a CLI signup session, creates the account,\nredeems the reserved signup code, creates an org-scoped OAuth CLI\nsession, and returns the token set exactly once. This endpoint does not\nrequire an API key.\n",
|
|
4904
5584
|
"hasJsonBody": true,
|
|
4905
5585
|
"method": "POST",
|
|
4906
5586
|
"operationId": "verifyCliSignup",
|
|
@@ -4926,24 +5606,49 @@ const operationManifest = [
|
|
|
4926
5606
|
"maxLength": 1024
|
|
4927
5607
|
}
|
|
4928
5608
|
},
|
|
4929
|
-
"required": [
|
|
4930
|
-
"signup_token",
|
|
4931
|
-
"verification_code",
|
|
4932
|
-
"password"
|
|
4933
|
-
]
|
|
5609
|
+
"required": ["signup_token", "verification_code"]
|
|
4934
5610
|
},
|
|
4935
5611
|
"responseSchema": {
|
|
4936
5612
|
"type": "object",
|
|
4937
5613
|
"properties": {
|
|
4938
5614
|
"api_key": {
|
|
4939
5615
|
"type": "string",
|
|
4940
|
-
"description": "
|
|
5616
|
+
"description": "Legacy alias for access_token. New CLI builds should persist access_token and refresh_token."
|
|
4941
5617
|
},
|
|
4942
5618
|
"key_id": {
|
|
5619
|
+
"type": "string",
|
|
5620
|
+
"format": "uuid",
|
|
5621
|
+
"description": "Legacy alias for oauth_grant_id"
|
|
5622
|
+
},
|
|
5623
|
+
"key_prefix": {
|
|
5624
|
+
"type": "string",
|
|
5625
|
+
"description": "Legacy display prefix derived from access_token"
|
|
5626
|
+
},
|
|
5627
|
+
"access_token": {
|
|
5628
|
+
"type": "string",
|
|
5629
|
+
"description": "OAuth access token for CLI API authentication"
|
|
5630
|
+
},
|
|
5631
|
+
"refresh_token": {
|
|
5632
|
+
"type": "string",
|
|
5633
|
+
"description": "OAuth refresh token used by the CLI to renew access"
|
|
5634
|
+
},
|
|
5635
|
+
"token_type": {
|
|
5636
|
+
"type": "string",
|
|
5637
|
+
"enum": ["Bearer"]
|
|
5638
|
+
},
|
|
5639
|
+
"expires_in": {
|
|
5640
|
+
"type": "integer",
|
|
5641
|
+
"description": "Seconds until access_token expires"
|
|
5642
|
+
},
|
|
5643
|
+
"auth_method": {
|
|
5644
|
+
"type": "string",
|
|
5645
|
+
"enum": ["oauth"]
|
|
5646
|
+
},
|
|
5647
|
+
"oauth_grant_id": {
|
|
4943
5648
|
"type": "string",
|
|
4944
5649
|
"format": "uuid"
|
|
4945
5650
|
},
|
|
4946
|
-
"
|
|
5651
|
+
"oauth_client_id": { "type": "string" },
|
|
4947
5652
|
"org_id": {
|
|
4948
5653
|
"type": "string",
|
|
4949
5654
|
"format": "uuid"
|
|
@@ -4954,12 +5659,19 @@ const operationManifest = [
|
|
|
4954
5659
|
"api_key",
|
|
4955
5660
|
"key_id",
|
|
4956
5661
|
"key_prefix",
|
|
5662
|
+
"access_token",
|
|
5663
|
+
"refresh_token",
|
|
5664
|
+
"token_type",
|
|
5665
|
+
"expires_in",
|
|
5666
|
+
"auth_method",
|
|
5667
|
+
"oauth_grant_id",
|
|
5668
|
+
"oauth_client_id",
|
|
4957
5669
|
"org_id",
|
|
4958
5670
|
"org_name"
|
|
4959
5671
|
]
|
|
4960
5672
|
},
|
|
4961
5673
|
"sdkName": "verifyCliSignup",
|
|
4962
|
-
"summary": "Verify CLI signup and create
|
|
5674
|
+
"summary": "Verify CLI signup and create OAuth session",
|
|
4963
5675
|
"tag": "CLI",
|
|
4964
5676
|
"tagCommand": "cli"
|
|
4965
5677
|
},
|