@deepraxis/sdk 0.1.1-dev.9c481e3 → 0.1.1-dev.9c6b0c4
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/METHODS.md +216 -20
- package/dist/core/binary-operations.d.ts +3 -0
- package/dist/core/binary-operations.js +14 -0
- package/dist/core/credentials.d.ts +16 -6
- package/dist/core/credentials.js +24 -5
- package/dist/core/transport.js +8 -4
- package/dist/generated/binary-operations.gen.d.ts +3 -0
- package/dist/generated/binary-operations.gen.js +14 -0
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +411 -63
- package/dist/generated/sdk.gen.js +1173 -192
- package/dist/generated/types.gen.d.ts +14768 -4927
- package/dist/helpers/application-publish.js +16 -2
- package/dist/helpers/browser-connect-error.d.ts +28 -0
- package/dist/helpers/browser-connect-error.js +74 -0
- package/dist/helpers/browser-connect.d.ts +2 -0
- package/dist/helpers/browser-connect.js +31 -38
- package/dist/operations.generated.js +2892 -1074
- package/dist/resources.generated.d.ts +1866 -312
- package/dist/resources.generated.js +131 -12
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { client } from './client.gen.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Read your conversation with an agent
|
|
6
6
|
*
|
|
7
|
-
* Read your conversation with a
|
|
7
|
+
* Read your conversation with a general agent: the events of your own main session with that agent, the same page sessions.events.list returns — same query parameters, same data + next_page envelope, same event shapes. {agent_id} takes the agent_… id, the eight character identity number or the handle; a service or assume agent answers 400. Use it to collect a reply, to find tool calls waiting for approval, or to learn the real session id without ever asking for one.
|
|
8
8
|
*/
|
|
9
9
|
export const listAgentEvents = (options) => (options.client ?? client).get({
|
|
10
10
|
security: [{
|
|
@@ -22,7 +22,7 @@ export const listAgentEvents = (options) => (options.client ?? client).get({
|
|
|
22
22
|
/**
|
|
23
23
|
* Send events to an agent
|
|
24
24
|
*
|
|
25
|
-
* Talk to a
|
|
25
|
+
* Talk to a general agent: the message goes to your own main session with that agent — one entry per person, created on first use and the same every time after — so no session id is needed. This is sessions.events.send addressed by the agent instead of the session: the same body (user.message with exactly one nonempty text block, user.interrupt, user.tool_confirmation, user.custom_tool_result, user.steer, user.withdraw), the same acknowledgement and the same billing. {agent_id} takes the agent_… id, the eight character identity number or the handle. A service or assume agent answers 400 — it has no main session: reach a service agent over A2A, or open a session explicitly with sessions.create. Read the reply with agents.events.list, or follow it while it is produced with agents.events.stream. Example: POST /agent/v1/agents/agent_example/events with {"events":[{"type":"user.message","content":[{"type":"text","text":"你好"}]}]}.
|
|
26
26
|
*/
|
|
27
27
|
export const sendAgentEvents = (options) => (options.client ?? client).post({
|
|
28
28
|
security: [{
|
|
@@ -44,7 +44,7 @@ export const sendAgentEvents = (options) => (options.client ?? client).post({
|
|
|
44
44
|
/**
|
|
45
45
|
* Follow an agent live
|
|
46
46
|
*
|
|
47
|
-
* Follow an agent live over Server-Sent Events. For a
|
|
47
|
+
* Follow an agent live over Server-Sent Events. For a general agent it is the stream of your own main session with that agent, the same stream sessions.events.stream opens, event_deltas[] previews included; read past events with agents.events.list. An assume agent has no main session: its body is its MCP connections, and this stream is its broadcast point, which every live connection of the agent hears at once. It carries two events, each with an SSE id: inbox.letter_delivered { letter_id, sender, sender_name, summary, thread, create_time } when a letter arrives (the letter stays unread; take it with the agent's inbox tool, the body is not in the event), and cognition.ritual_held { ritual, owner, title, engram, create_time } when a domain gives the agent a memory. Reconnect with the Last-Event-ID header to receive what you missed from a short recent buffer (about an hour); a first connection replays nothing, so read agents.inbox.letters.list for mail already waiting. {agent_id} takes the agent_… id, the eight character identity number or the handle; a service agent answers 400. Closing the stream only drops your subscription and does not stop the agent.
|
|
48
48
|
*/
|
|
49
49
|
export const streamAgentEvents = (options) => (options.client ?? client).sse.get({
|
|
50
50
|
security: [{
|
|
@@ -358,52 +358,11 @@ export const getAgentAppearance = (options) => (options.client ?? client).get({
|
|
|
358
358
|
...options
|
|
359
359
|
});
|
|
360
360
|
/**
|
|
361
|
-
*
|
|
361
|
+
* Get agent embed policy
|
|
362
362
|
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
* Call this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget (US dollars, at most 2 decimals), system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {"customer_id":"cus_8f2a91","origin":"https://shop.example.com"}.
|
|
366
|
-
*/
|
|
367
|
-
export const createCustomerGrantCode = (options) => (options.client ?? client).post({
|
|
368
|
-
security: [{
|
|
369
|
-
key: 'BearerAuth',
|
|
370
|
-
scheme: 'bearer',
|
|
371
|
-
type: 'http'
|
|
372
|
-
}, {
|
|
373
|
-
key: 'ApiKeyAuth',
|
|
374
|
-
name: 'X-API-Key',
|
|
375
|
-
type: 'apiKey'
|
|
376
|
-
}],
|
|
377
|
-
url: '/agent/v1/agents/{agent_id}/customers/auth/grant_codes',
|
|
378
|
-
...options,
|
|
379
|
-
headers: {
|
|
380
|
-
'Content-Type': 'application/json',
|
|
381
|
-
...options.headers
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
/**
|
|
385
|
-
* Create customer access token
|
|
386
|
-
*
|
|
387
|
-
* Exchange a grant code, or the agent's publishable key for an anonymous visitor, for a customer access token that authorizes the agent's embedded sessions.
|
|
388
|
-
*
|
|
389
|
-
* No Authorization header is required: the grant code or the publishable key is the credential. Agent Kit calls this from the browser, so send the page Origin. With grant_code, the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, used, expired and other-agent codes all return the same 401 GRANT_CODE_INVALID. The sign-in starts now and lasts the code's max_session_seconds. Unlike Shopify, a visitor without an account gets a token too: send publishable_key instead and a new anonymous customer (anon_…) is created, bound to the request Origin, for 7 days. The access token lasts at most two hours and never outlives the sign-in; renew it with access_tokens/renew before expires_at. Both forms share the per-IP minute limit of anonymous issuance (default 20). Example body: {"grant_code":"cgc_…"}.
|
|
390
|
-
*/
|
|
391
|
-
export const createCustomerAccessToken = (options) => (options.client ?? client).post({
|
|
392
|
-
url: '/agent/v1/agents/{agent_id}/customers/auth/access_tokens',
|
|
393
|
-
...options,
|
|
394
|
-
headers: {
|
|
395
|
-
'Content-Type': 'application/json',
|
|
396
|
-
...options.headers
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
/**
|
|
400
|
-
* Renew customer access token
|
|
401
|
-
*
|
|
402
|
-
* Get a fresh customer access token in the same sign-in, authenticated with the current one.
|
|
403
|
-
*
|
|
404
|
-
* Send the current customer access token as the Bearer credential, with no body, a few minutes before expires_at. The new token keeps the version, budget, context, metadata and origin binding of the sign-in and lasts at most two hours, never past session_expires_at. Unlike Shopify, renewal does not revoke the presented token: it stays valid until its own expiry, so a reply that is streaming on it is not cut off. When less than 60 seconds of the sign-in remain, renewal returns 401 CUSTOMER_SESSION_EXPIRED; sign the customer in again with a new grant code from your backend. A token that was logged out or merged returns 401 ACCESS_TOKEN_REVOKED.
|
|
363
|
+
* Read a service agent's embed settings: the pages allowed to open its Kit chat (allowed_origins), the development switch (allow_localhost), what an embedded end user may upload (uploads) and whether the agent may be shared by link with the daily caps its visitors count against (share_links). The allow list decides where the agent can be embedded at all, so after deploying an application, add that application's URL origin here (scheme, host and port, never a path) before the page loads the agent — otherwise its Kit chat answers ORIGIN_NOT_ALLOWED. Budgets, monthly caps and token lifetime are set in the console and are not part of this API. An agent of another organization answers 404; an agent that is not a service agent answers 400.
|
|
405
364
|
*/
|
|
406
|
-
export const
|
|
365
|
+
export const getAgentEmbedPolicy = (options) => (options.client ?? client).get({
|
|
407
366
|
security: [{
|
|
408
367
|
key: 'BearerAuth',
|
|
409
368
|
scheme: 'bearer',
|
|
@@ -413,17 +372,15 @@ export const renewCustomerAccessToken = (options) => (options.client ?? client).
|
|
|
413
372
|
name: 'X-API-Key',
|
|
414
373
|
type: 'apiKey'
|
|
415
374
|
}],
|
|
416
|
-
url: '/agent/v1/agents/{agent_id}/
|
|
375
|
+
url: '/agent/v1/agents/{agent_id}/embed_policy',
|
|
417
376
|
...options
|
|
418
377
|
});
|
|
419
378
|
/**
|
|
420
|
-
*
|
|
379
|
+
* Update agent embed policy
|
|
421
380
|
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
* Send the current customer access token as the Bearer credential, with no body, when the customer logs out of your site. Every token of the sign-in, including renewed ones, stops working, and their live event streams close; the customer's conversations are kept. Returns 204. Calling it again with the same token returns 401 ACCESS_TOKEN_REVOKED, so treat that as already logged out.
|
|
381
|
+
* Change some of a service agent's embed settings. Only the fields you send change: everything you leave out, including the budgets and the token lifetime set in the console, is kept exactly as it was. Send allowed_origins so the pages that load the agent are allowed — an application's URL origin must be in the list before the application can embed the agent, or its Kit chat answers ORIGIN_NOT_ALLOWED. Send allow_localhost while developing on http://localhost, and uploads to open, close or bound file attachments for the embedded end user. Send share_links to let the agent be shared by link and to set the daily session and spending caps its share links count against; turning it on is refused unless the agent has an identity number. Values are checked by the service: an origin is normalized and must be https, and at most one leading wildcard label may match a single subdomain level. max_file_bytes is 1 to 104857600 bytes and max_files_per_session is 1 to 100. Example: POST /agent/v1/agents/{agent_id}/embed_policy with {"allowed_origins": ["https://my-app.example.com"]}.
|
|
425
382
|
*/
|
|
426
|
-
export const
|
|
383
|
+
export const updateAgentEmbedPolicy = (options) => (options.client ?? client).post({
|
|
427
384
|
security: [{
|
|
428
385
|
key: 'BearerAuth',
|
|
429
386
|
scheme: 'bearer',
|
|
@@ -433,15 +390,19 @@ export const deleteCurrentCustomerAccessToken = (options) => (options.client ??
|
|
|
433
390
|
name: 'X-API-Key',
|
|
434
391
|
type: 'apiKey'
|
|
435
392
|
}],
|
|
436
|
-
url: '/agent/v1/agents/{agent_id}/
|
|
437
|
-
...options
|
|
393
|
+
url: '/agent/v1/agents/{agent_id}/embed_policy',
|
|
394
|
+
...options,
|
|
395
|
+
headers: {
|
|
396
|
+
'Content-Type': 'application/json',
|
|
397
|
+
...options.headers
|
|
398
|
+
}
|
|
438
399
|
});
|
|
439
400
|
/**
|
|
440
401
|
* List Computers
|
|
441
402
|
*
|
|
442
403
|
* List the computers of your organization, archived ones included.
|
|
443
404
|
*
|
|
444
|
-
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference;
|
|
405
|
+
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
|
|
445
406
|
*/
|
|
446
407
|
export const computersList = (options) => (options?.client ?? client).get({
|
|
447
408
|
security: [{
|
|
@@ -459,9 +420,9 @@ export const computersList = (options) => (options?.client ?? client).get({
|
|
|
459
420
|
/**
|
|
460
421
|
* Create Computer
|
|
461
422
|
*
|
|
462
|
-
* Create a durable computer: a named machine whose files outlive sessions, for general
|
|
423
|
+
* Create a durable computer: a named machine whose files outlive sessions, for general agents.
|
|
463
424
|
*
|
|
464
|
-
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference;
|
|
425
|
+
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
|
|
465
426
|
*/
|
|
466
427
|
export const computersCreate = (options) => (options.client ?? client).post({
|
|
467
428
|
security: [{
|
|
@@ -505,7 +466,7 @@ export const computersDelete = (options) => (options.client ?? client).delete({
|
|
|
505
466
|
*
|
|
506
467
|
* Read one computer's status, storage use and sandbox id.
|
|
507
468
|
*
|
|
508
|
-
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference;
|
|
469
|
+
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
|
|
509
470
|
*/
|
|
510
471
|
export const computersRetrieve = (options) => (options.client ?? client).get({
|
|
511
472
|
security: [{
|
|
@@ -525,7 +486,7 @@ export const computersRetrieve = (options) => (options.client ?? client).get({
|
|
|
525
486
|
*
|
|
526
487
|
* Rename a computer.
|
|
527
488
|
*
|
|
528
|
-
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference;
|
|
489
|
+
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
|
|
529
490
|
*/
|
|
530
491
|
export const computersUpdate = (options) => (options.client ?? client).post({
|
|
531
492
|
security: [{
|
|
@@ -549,7 +510,7 @@ export const computersUpdate = (options) => (options.client ?? client).post({
|
|
|
549
510
|
*
|
|
550
511
|
* Archive a computer: its files stay readable but new sessions cannot use it.
|
|
551
512
|
*
|
|
552
|
-
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference;
|
|
513
|
+
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers. A computer an active agent holds is refused with 409 COMPUTER_IN_USE; archive the agent first.
|
|
553
514
|
*/
|
|
554
515
|
export const computersArchive = (options) => (options.client ?? client).post({
|
|
555
516
|
security: [{
|
|
@@ -594,7 +555,7 @@ export const computersAttachmentsCreate = (options) => (options.client ?? client
|
|
|
594
555
|
*
|
|
595
556
|
* List the entries of one directory on a computer.
|
|
596
557
|
*
|
|
597
|
-
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference;
|
|
558
|
+
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
|
|
598
559
|
*/
|
|
599
560
|
export const computersFilesList = (options) => (options.client ?? client).get({
|
|
600
561
|
security: [{
|
|
@@ -614,7 +575,7 @@ export const computersFilesList = (options) => (options.client ?? client).get({
|
|
|
614
575
|
*
|
|
615
576
|
* Download the bytes of one file on a computer, up to 16 MiB, with single-range support.
|
|
616
577
|
*
|
|
617
|
-
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference;
|
|
578
|
+
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; a computer starts on first use and exposes the public SDK sandbox_id. Lists include archived computers.
|
|
618
579
|
*/
|
|
619
580
|
export const computersFilesContent = (options) => (options.client ?? client).get({
|
|
620
581
|
security: [{
|
|
@@ -629,6 +590,24 @@ export const computersFilesContent = (options) => (options.client ?? client).get
|
|
|
629
590
|
url: '/agent/v1/computers/{computer_id}/files/content',
|
|
630
591
|
...options
|
|
631
592
|
});
|
|
593
|
+
/**
|
|
594
|
+
* Preview a computer file
|
|
595
|
+
*
|
|
596
|
+
* The preview product of one version of one computer file: an image becomes a 1600 px WebP, an Office document a linearized PDF, text and source the first 64 KiB, and PDF, xlsx, epub, GIF, SVG and unknown types their original bytes. Products live in the File service and are keyed by computer, path, size, mtime, variant and format version. A request that pins `v` answers from that registry without stat'ing or waking the computer; without `v` the file is read and the product generated once. A file over the size threshold, or a deployment without the File service, answers `fallback: "content"` so the caller keeps the ordinary content door.
|
|
597
|
+
*/
|
|
598
|
+
export const previewComputerFile = (options) => (options.client ?? client).get({
|
|
599
|
+
security: [{
|
|
600
|
+
key: 'BearerAuth',
|
|
601
|
+
scheme: 'bearer',
|
|
602
|
+
type: 'http'
|
|
603
|
+
}, {
|
|
604
|
+
key: 'ApiKeyAuth',
|
|
605
|
+
name: 'X-API-Key',
|
|
606
|
+
type: 'apiKey'
|
|
607
|
+
}],
|
|
608
|
+
url: '/agent/v1/computers/{computer_id}/files/preview',
|
|
609
|
+
...options
|
|
610
|
+
});
|
|
632
611
|
/**
|
|
633
612
|
* Convert a Computer Document to PDF
|
|
634
613
|
*
|
|
@@ -718,7 +697,7 @@ export const releaseComputerLease = (options) => (options.client ?? client).dele
|
|
|
718
697
|
/**
|
|
719
698
|
* List Toolsets
|
|
720
699
|
*
|
|
721
|
-
* Discover tool names, input schemas, read-only status and default permission policies before configuring an agent. The catalog is read-only: enable tools through agents.create or agents.update. agent_toolset_20260401 includes bash, edit, glob, grep, read, write, web_search, web_fetch, task_output, task_stop, monitor, agent, send_message, codemode and skill, plus todo_write,
|
|
700
|
+
* Discover tool names, input schemas, read-only status and default permission policies before configuring an agent. The catalog is read-only: enable tools through agents.create or agents.update. agent_toolset_20260401 includes bash, edit, glob, grep, read, write, web_search, web_fetch, task_output, task_stop, monitor, agent, send_message, codemode and skill, plus todo_write, ask_user_question and goal_read, which are listed so they can be switched off. Native additions require bash enabled; codemode requires bash (enabling it with bash disabled returns 400; keep bash enabled with permission_policy always_ask to restrict it); send_message also requires agent. To keep only some tools, set default_config.enabled to false and enable the wanted tools in configs; unlisted tools follow default_config. The catalog includes plugin names and versions. Sessions created through /anthropic/v1 expose only the eight official tools.
|
|
722
701
|
*/
|
|
723
702
|
export const listToolsets = (options) => (options?.client ?? client).get({
|
|
724
703
|
security: [{
|
|
@@ -777,6 +756,54 @@ export const forkSession = (options) => (options.client ?? client).post({
|
|
|
777
756
|
...options.headers
|
|
778
757
|
}
|
|
779
758
|
});
|
|
759
|
+
/**
|
|
760
|
+
* Rename Session (Extension)
|
|
761
|
+
*
|
|
762
|
+
* Give a session a short, branch-like name; the main session is always main and cannot be renamed.
|
|
763
|
+
*
|
|
764
|
+
* Available only on /agent/v1. The name is normalized first (surrounding whitespace trimmed, upper case folded to lowercase, runs of whitespace become one hyphen, characters the rule does not admit dropped, and no hyphen left hanging at either end) and then validated: non-empty, at most 32 display columns wide (a Han character counts as two), made only of Han characters, lowercase ASCII letters, digits and hyphens, and never the reserved word main. A name another of the caller's own sessions already holds is not an error: the answer carries a numeric suffix (base-2, base-3, …). Renaming the main session returns 400; a missing session, one that belongs to another caller, or one the caller cannot write returns 404. Returns 200 with the same Session shape as retrieval, name set to the new name; one rename writes a session.renamed event. Example: POST /agent/v1/sessions/sesn_login/name with body {"name":"login-fix"}.
|
|
765
|
+
*/
|
|
766
|
+
export const renameSession = (options) => (options.client ?? client).post({
|
|
767
|
+
security: [{
|
|
768
|
+
key: 'BearerAuth',
|
|
769
|
+
scheme: 'bearer',
|
|
770
|
+
type: 'http'
|
|
771
|
+
}, {
|
|
772
|
+
key: 'ApiKeyAuth',
|
|
773
|
+
name: 'X-API-Key',
|
|
774
|
+
type: 'apiKey'
|
|
775
|
+
}],
|
|
776
|
+
url: '/agent/v1/sessions/{session_id}/name',
|
|
777
|
+
...options,
|
|
778
|
+
headers: {
|
|
779
|
+
'Content-Type': 'application/json',
|
|
780
|
+
...options.headers
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
/**
|
|
784
|
+
* Update session agent version
|
|
785
|
+
*
|
|
786
|
+
* Move one session to a version of its agent
|
|
787
|
+
*
|
|
788
|
+
* Without `version`, the session moves to the agent's active version — the version new sessions get now, which is not necessarily the newest saved one. With `version`, it moves to that existing version. The change is idempotent: asking for the version the session is already on answers the session and writes nothing, so the call may be repeated freely. A session that is running a turn answers 409 SESSION_CONFLICT and changes nothing, because a turn finishes on the version it started with; ask again once it is idle. The move writes a `session.updated` event carrying the agent version and the caller as its actor, so every version change is attributable. Main sessions additionally follow their agent's active version at the start of a person-started turn; this endpoint is the same move made explicitly, and it works on every kind of session, including worker sessions that never follow on their own.
|
|
789
|
+
*/
|
|
790
|
+
export const updateSessionAgentVersion = (options) => (options.client ?? client).post({
|
|
791
|
+
security: [{
|
|
792
|
+
key: 'BearerAuth',
|
|
793
|
+
scheme: 'bearer',
|
|
794
|
+
type: 'http'
|
|
795
|
+
}, {
|
|
796
|
+
key: 'ApiKeyAuth',
|
|
797
|
+
name: 'X-API-Key',
|
|
798
|
+
type: 'apiKey'
|
|
799
|
+
}],
|
|
800
|
+
url: '/agent/v1/sessions/{session_id}/agent_version',
|
|
801
|
+
...options,
|
|
802
|
+
headers: {
|
|
803
|
+
'Content-Type': 'application/json',
|
|
804
|
+
...options.headers
|
|
805
|
+
}
|
|
806
|
+
});
|
|
780
807
|
/**
|
|
781
808
|
* List Session Artifacts (Extension)
|
|
782
809
|
*
|
|
@@ -965,6 +992,46 @@ export const listSessionCompactions = (options) => (options.client ?? client).ge
|
|
|
965
992
|
url: '/agent/v1/sessions/{session_id}/compactions',
|
|
966
993
|
...options
|
|
967
994
|
});
|
|
995
|
+
/**
|
|
996
|
+
* Upload a File (Extension)
|
|
997
|
+
*
|
|
998
|
+
* Start an upload for an embedded end user, so the browser can PUT the file's bytes straight to the File service and then attach the resulting file id to its own session. Use it only with an end-user token: a grant-bound end_user token uploads for its own agent, and an organization-level customer token must name the agent in the body (agent). A member, robot or user_key credential uses /file/v1 instead and gets 404 here. Body: filename (1–255 characters, its extension decides the blocked-type refusal), bytes (the positive byte length) and content_type (1–255 characters). Returns 201 with the File signed-upload answer: upload_id and expires_at, and url for a small file, or part_size, parts, complete_url and status_url for a large one; the addresses are returned here only and must never be stored or logged. The browser PUTs the bytes to the address (or to each part and then complete_url), which answers the File object and its file_id; then POST the file_id to /agent/v1/sessions/{session_id}/resources, and reference it in the message attachments. Refusals: 403 UPLOADS_DISABLED when uploads are off on the agent, 413 FILE_TOO_LARGE when bytes exceeds its uploads.max_file_bytes, 400 FILE_TYPE_REFUSED for a blocked executable or script extension, and 429 UPLOAD_RATE_LIMITED on the 31st unattached upload from the same user on the same agent within an hour. Example: POST /agent/v1/uploads with {"filename":"report.pdf","bytes":48211,"content_type":"application/pdf"}.
|
|
999
|
+
*/
|
|
1000
|
+
export const createAgentUpload = (options) => (options.client ?? client).post({
|
|
1001
|
+
security: [{
|
|
1002
|
+
key: 'BearerAuth',
|
|
1003
|
+
scheme: 'bearer',
|
|
1004
|
+
type: 'http'
|
|
1005
|
+
}, {
|
|
1006
|
+
key: 'ApiKeyAuth',
|
|
1007
|
+
name: 'X-API-Key',
|
|
1008
|
+
type: 'apiKey'
|
|
1009
|
+
}],
|
|
1010
|
+
url: '/agent/v1/uploads',
|
|
1011
|
+
...options,
|
|
1012
|
+
headers: {
|
|
1013
|
+
'Content-Type': 'application/json',
|
|
1014
|
+
...options.headers
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
/**
|
|
1018
|
+
* Create Upload Content URL (Extension)
|
|
1019
|
+
*
|
|
1020
|
+
* Mint a short-lived read address for one file an embedded end user uploaded, so the page can show or download its own file again. Use it only with an end-user token; file_id is the id the File service returned after the bytes were uploaded. Returns 200 with url (an address that works for 900 seconds) and expires_at; never store or log the address. Only the caller's own upload answers: a file that belongs to someone else, a missing one, or one that did not start as an upload returns 404 FILE_NOT_FOUND, so a stranger cannot learn whether another person's file exists. The request body is empty. Example: POST /agent/v1/uploads/file-Ab12.../content_url.
|
|
1021
|
+
*/
|
|
1022
|
+
export const createAgentUploadContentUrl = (options) => (options.client ?? client).post({
|
|
1023
|
+
security: [{
|
|
1024
|
+
key: 'BearerAuth',
|
|
1025
|
+
scheme: 'bearer',
|
|
1026
|
+
type: 'http'
|
|
1027
|
+
}, {
|
|
1028
|
+
key: 'ApiKeyAuth',
|
|
1029
|
+
name: 'X-API-Key',
|
|
1030
|
+
type: 'apiKey'
|
|
1031
|
+
}],
|
|
1032
|
+
url: '/agent/v1/uploads/{file_id}/content_url',
|
|
1033
|
+
...options
|
|
1034
|
+
});
|
|
968
1035
|
/**
|
|
969
1036
|
* Generate speech
|
|
970
1037
|
*
|
|
@@ -1498,7 +1565,7 @@ export const fileRetrieveUpload = (options) => (options.client ?? client).get({
|
|
|
1498
1565
|
/**
|
|
1499
1566
|
* Create a one-time upload URL
|
|
1500
1567
|
*
|
|
1501
|
-
* Upload a local file of up to 20 GiB from a coding agent without sending bytes through the model. Provide filename (the stored basename), exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes) and PUT each chunk to its numbered parts[].url in any order; an interrupted client GETs status_url to see the received parts and resends only what is missing, then POSTs complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid
|
|
1568
|
+
* Upload a local file of up to 20 GiB from a coding agent without sending bytes through the model. Provide filename (the stored basename), exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes) and PUT each chunk to its numbered parts[].url in any order; an interrupted client GETs status_url to see the received parts and resends only what is missing, then POSTs complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid or cross-organization URLs return 404, and so does a link whose upload record no longer exists. A URL that is authentic but names another action returns 403 CAPABILITY_MISMATCH: a status link posted to complete_url answers it, and so does a completion link fetched as status_url. URL lifetime defaults to 900 seconds for single PUT or 604800 (7 days) for multipart, at most 604800; all multipart URLs, including status_url, share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {"filename":"photo.png","bytes":2048,"content_type":"image/png"}.
|
|
1502
1569
|
*/
|
|
1503
1570
|
export const fileCreateSignedUpload = (options) => (options.client ?? client).post({
|
|
1504
1571
|
security: [{
|
|
@@ -2477,7 +2544,7 @@ export const listOrganizationUsage = (options) => (options.client ?? client).get
|
|
|
2477
2544
|
/**
|
|
2478
2545
|
* List Organization Usage Events
|
|
2479
2546
|
*
|
|
2480
|
-
* Usage events newest first, one opaque cursor page at a time; a page never duplicates or skips an event. Every item carries its metering lines (meter, display name, consumed quantity and unit, mapped from the billing measurements); the per-line price split (list unit price, pricing unit, billed cost) rides only the single event — fetch /organization/v1/events/{id} for it.
|
|
2547
|
+
* Usage events newest first by occurrence time (occurred_at, when the usage happened), one opaque cursor page at a time; a page never duplicates or skips an event. Every item carries its metering lines (meter, display name, consumed quantity and unit, mapped from the billing measurements); the per-line price split (list unit price, pricing unit, billed cost) rides only the single event — fetch /organization/v1/events/{id} for it. A cursor belongs to the order it was issued under: one obtained before this occurrence-time ordering, or used under the other sort direction, is refused with 400 INVALID_PARAMS instead of being reused — restart the listing.
|
|
2481
2548
|
*
|
|
2482
2549
|
*/
|
|
2483
2550
|
export const listOrganizationEvents = (options) => (options.client ?? client).get({
|
|
@@ -3028,7 +3095,7 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
|
|
|
3028
3095
|
/**
|
|
3029
3096
|
* Hire into a position
|
|
3030
3097
|
*
|
|
3031
|
-
* Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
|
|
3098
|
+
* Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_...) or an agent (agent:agent_...), treated identically, and must exist in your organization and not be archived. An agent created moments ago may not be in the organization roster yet (agents enter it asynchronously): that answers 503 ACTOR_SYNCING with a Retry-After header and retryable true, and the same call succeeds after that wait. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {"candidate":{"kind":"member","actor":"human:usr_123"},"request_id":"hire-support-1"}.
|
|
3032
3099
|
*/
|
|
3033
3100
|
export const hireOrganizationPosition = (options) => (options.client ?? client).post({
|
|
3034
3101
|
security: [{
|
|
@@ -3699,6 +3766,30 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
|
|
|
3699
3766
|
...options.headers
|
|
3700
3767
|
}
|
|
3701
3768
|
});
|
|
3769
|
+
/**
|
|
3770
|
+
* Act on a phone sandbox's screen
|
|
3771
|
+
*
|
|
3772
|
+
* See and operate an android sandbox's phone screen: take a screenshot, read the UI hierarchy to get a ref for each node, then tap a node or a screen point, long-press, swipe, scroll, type text, press a key, open or close an app, open a URL, or wait. Use it to drive and automate a mobile app on a phone sandbox created with templateID "android"; those machines have no terminal or file API, so drive the screen with this operation and run shell commands with commands.run. Start with a snapshot to learn what is on screen and to mint the refs the tap-like actions use; a ref names a node in the latest snapshot only, so after a newer snapshot, or after an action that changed the screen, take a fresh snapshot — a stale ref is refused with INVALID_PARAMS. The phone runs one action at a time, so actions on one sandbox are serial: send the next only after the previous call returns. A phone that has just been created may not have connected yet and answers 503 SERVICE_UNAVAILABLE with Retry-After: 2; retry after that delay (measured on develop: the sandbox is created in about 45 s and the phone program connects about 15 s later). Text is entered through the phone's own input, which supports ASCII only, so typing non-ASCII text into a Chinese app is not supported and answers INVALID_PARAMS. A linux sandbox has no screen and answers CAPABILITY_UNSUPPORTED.
|
|
3773
|
+
*
|
|
3774
|
+
* The same path is the caller's action socket: send GET with the standard WebSocket upgrade headers instead of POST and drive many actions over one connection. The server answers {"type":"ready","instanceId":"<id>"} first, then every frame {"id":"<your correlation id>","action":{…}} (an action of the same shape as this operation's body, at most 64 characters of id) is answered by its own id, in submission order, as {"id":"…","result":{…}} or {"id":"…","error":{"code":"…","message":"…","retryable":true}}. At most 8 actions may be in flight on one connection (the next answers RATE_LIMITED), and 10 malformed frames in a row close the connection 1008. Authentication is the caller's own (an organization API key), never the phone's token. Closing the connection ends only that client's view: actions already accepted are answered, and the phone stays connected. Before the handshake, a phone that is still being built or has not connected yet answers 503 DEVICE_NOT_READY with the state it is in and Retry-After: 2.
|
|
3775
|
+
*/
|
|
3776
|
+
export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
|
|
3777
|
+
security: [{
|
|
3778
|
+
key: 'BearerAuth',
|
|
3779
|
+
scheme: 'bearer',
|
|
3780
|
+
type: 'http'
|
|
3781
|
+
}, {
|
|
3782
|
+
key: 'ApiKeyAuth',
|
|
3783
|
+
name: 'X-API-Key',
|
|
3784
|
+
type: 'apiKey'
|
|
3785
|
+
}],
|
|
3786
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/act',
|
|
3787
|
+
...options,
|
|
3788
|
+
headers: {
|
|
3789
|
+
'Content-Type': 'application/json',
|
|
3790
|
+
...options.headers
|
|
3791
|
+
}
|
|
3792
|
+
});
|
|
3702
3793
|
/**
|
|
3703
3794
|
* Remove a file or directory in the sandbox
|
|
3704
3795
|
*
|
|
@@ -3796,7 +3887,7 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
|
|
|
3796
3887
|
/**
|
|
3797
3888
|
* Run a command in the sandbox
|
|
3798
3889
|
*
|
|
3799
|
-
* Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–3600000 milliseconds, default 600000, that is 10 minutes; E2B defaults to 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout (timeoutMs 0); output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. Example body: {"cmd":"echo hi"}.
|
|
3890
|
+
* Execute a shell command and wait for stdout, stderr and exitCode. Supply cmd, optional cwd and envs, and timeoutMs (1–3600000 milliseconds, default 600000, that is 10 minutes; E2B defaults to 60000). Unlike E2B, this endpoint is synchronous only: no background mode, callbacks or unlimited timeout (timeoutMs 0); output is bounded to 1 MiB including stream framing. Nonzero exit codes return 200 with the result. A timeout returns COMMAND_TIMEOUT (504); transport timeout does not confirm process termination, so do not blindly retry commands with side effects. On an android sandbox the command runs in the phone's root shell, its stderr is merged into stdout (read stdout and expect stderr to come back empty), and background mode is unavailable. Example body: {"cmd":"echo hi"}.
|
|
3800
3891
|
*/
|
|
3801
3892
|
export const runSandboxCommand = (options) => (options.client ?? client).post({
|
|
3802
3893
|
security: [{
|
|
@@ -3836,7 +3927,7 @@ export const sessionsDelete = (options) => (options.client ?? client).delete({
|
|
|
3836
3927
|
/**
|
|
3837
3928
|
* Get session
|
|
3838
3929
|
*
|
|
3839
|
-
* Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on
|
|
3930
|
+
* Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on the agent version's default environment, node22.
|
|
3840
3931
|
*/
|
|
3841
3932
|
export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
3842
3933
|
security: [{
|
|
@@ -3876,7 +3967,7 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
|
3876
3967
|
/**
|
|
3877
3968
|
* List agents
|
|
3878
3969
|
*
|
|
3879
|
-
* List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general
|
|
3970
|
+
* List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general for durable-computer agents, kind=service for per-session environments, or kind=assume for external MCP clients. Pass next_page from the response as page to read the next page; a null next_page means the end.
|
|
3880
3971
|
*/
|
|
3881
3972
|
export const agentsList = (options) => (options?.client ?? client).get({
|
|
3882
3973
|
security: [{
|
|
@@ -3894,7 +3985,7 @@ export const agentsList = (options) => (options?.client ?? client).get({
|
|
|
3894
3985
|
/**
|
|
3895
3986
|
* Create agent
|
|
3896
3987
|
*
|
|
3897
|
-
* Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write,
|
|
3988
|
+
* Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. Omit kind to create a service agent (Managed Agents behaviour: a fresh environment per session). Pass kind: "general" for an employee-style agent with its own computer, created with it; size and template come from the agent's computers configuration. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. skills attaches uploaded custom skills as [{type: "custom", skill_id, version?}] (skill_id from skills.create or skills.list; at most 20, no repeated skill_id). Omit version, or send "latest", to use the skill's newest version when a session starts. type anthropic returns 400. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. model and every models.allowed entry must be a catalog model that can run an agent: an unknown id returns 400 "model <id> is not in the model catalog" and an embedding, image or speech model returns 400 "model <id> cannot run an agent". name is a label, not a unique key: 1 to 256 characters after trimming, no NUL or line breaks. avatar is trimmed, must not contain spaces or point at a loopback, private or internal host, and its scheme is stored in lowercase. script and workflow binding ids are stored in lowercase, the form automation matches; bindings together with environment_id null return 400 because bindings need a machine. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}. kind defaults to service when it is omitted and no computer_id is given, and to general when computer_id is given; it cannot change after creation. A general or assume agent created without computer_id gets a new computer registered in the same request, named after the agent; a service agent with computer_id returns 400. For kind assume, provide name without model, models, subagent_model, subagents or multiagent; vault_ids are accepted, bindings and environment_id are refused. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
|
|
3898
3989
|
*/
|
|
3899
3990
|
export const agentsCreate = (options) => (options.client ?? client).post({
|
|
3900
3991
|
security: [{
|
|
@@ -4010,7 +4101,7 @@ export const sessionsList = (options) => (options?.client ?? client).get({
|
|
|
4010
4101
|
/**
|
|
4011
4102
|
* Create session
|
|
4012
4103
|
*
|
|
4013
|
-
* Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (
|
|
4104
|
+
* Create a session: one conversation with an agent. Pass agent as an agent id or {type:"agent", id, version?}; an id alone, or an object without version, pins the agent's active_version (the version chosen with agents.versions.apply, not necessarily the newest saved one). Unlike Anthropic Managed Agents, omit environment_id to use the default environment saved in the agent version (node22 for a new agent), unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. The retired "light" returns 400 naming the two forms that work: "node22", or null for no machine. For service agents, explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Unlike Anthropic Managed Agents, the only inline agent override is system ({type:"agent_with_overrides", id, system}); to change the model, tools, MCP servers or skills, save a version instead. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. budget is {type:"limit", max_list_cost:{amount, currency:"USD"}} where amount is a positive decimal string of US dollars with at most 2 decimal places ("20.00" is USD 20.00); omitted budget defaults to "20.00" and null removes the limit. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion. Assume agents return 400 INVALID_PARAMS; drive them over MCP at /agent/v1/agents/{id}/mcp instead.
|
|
4014
4105
|
*/
|
|
4015
4106
|
export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
4016
4107
|
security: [{
|
|
@@ -4050,7 +4141,7 @@ export const sessionsArchive = (options) => (options.client ?? client).post({
|
|
|
4050
4141
|
/**
|
|
4051
4142
|
* List session events
|
|
4052
4143
|
*
|
|
4053
|
-
* Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids; a request nobody answered within 24 hours is settled as unanswered and the session goes idle with stop_reason request_expired, which the /anthropic/v1 face shows as end_turn), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, system.notification_suppressed (pending background notifications that hit the wake quota and started no run), system.notification_recorded, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter. This operation addresses one session — normally a worker session an agent dispatched; to talk to a
|
|
4144
|
+
* Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids; a request nobody answered within 24 hours is settled as unanswered and the session goes idle with stop_reason request_expired, which the /anthropic/v1 face shows as end_turn), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, system.notification_suppressed (pending background notifications that hit the wake quota and started no run), system.notification_recorded, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.list instead. In the path, session_id may also be `main` (your own main session with that agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
|
|
4054
4145
|
*/
|
|
4055
4146
|
export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
4056
4147
|
security: [{
|
|
@@ -4068,7 +4159,7 @@ export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
|
4068
4159
|
/**
|
|
4069
4160
|
* Send session events
|
|
4070
4161
|
*
|
|
4071
|
-
* Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409. This operation addresses one session — normally a worker session an agent dispatched; to talk to a
|
|
4162
|
+
* Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.send instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
|
|
4072
4163
|
*/
|
|
4073
4164
|
export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
4074
4165
|
security: [{
|
|
@@ -4090,7 +4181,7 @@ export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
|
4090
4181
|
/**
|
|
4091
4182
|
* Stream session events
|
|
4092
4183
|
*
|
|
4093
|
-
* Open a Server-Sent Events stream of a session's events in real time. Use it to show a reply as it is produced; to read past events use sessions.events.list. Send a message through sessions.events.send in another request while the stream is open. Closing the stream only drops your subscription and does not stop the agent. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use to also receive event_start / event_delta previews before the final event. This operation addresses one session — normally a worker session an agent dispatched; to follow a
|
|
4184
|
+
* Open a Server-Sent Events stream of a session's events in real time. Use it to show a reply as it is produced; to read past events use sessions.events.list. Send a message through sessions.events.send in another request while the stream is open. Closing the stream only drops your subscription and does not stop the agent. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use to also receive event_start / event_delta previews before the final event. This operation addresses one session — normally a worker session an agent dispatched; to follow a general agent itself, use agents.events.stream instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
|
|
4094
4185
|
*/
|
|
4095
4186
|
export const sessionsEventsStream = (options) => (options.client ?? client).sse.get({
|
|
4096
4187
|
security: [{
|
|
@@ -4390,7 +4481,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
|
|
|
4390
4481
|
/**
|
|
4391
4482
|
* Create deployment
|
|
4392
4483
|
*
|
|
4393
|
-
* Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general
|
|
4484
|
+
* Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400. Example, a weekly cron deployment on the agent's computer: {"agent":"agent_123","name":"weekly report","initial_events":[{"type":"user.message","content":[{"type":"text","text":"Write the weekly report."}]}],"target":{"type":"computer"},"schedule":{"type":"cron","expression":"0 9 * * 1","timezone":"America/Los_Angeles"}}.
|
|
4394
4485
|
*/
|
|
4395
4486
|
export const deploymentsCreate = (options) => (options.client ?? client).post({
|
|
4396
4487
|
security: [{
|
|
@@ -4870,7 +4961,7 @@ export const applicationListVersions = (options) => (options.client ?? client).g
|
|
|
4870
4961
|
/**
|
|
4871
4962
|
* Create version
|
|
4872
4963
|
*
|
|
4873
|
-
* Upload code and bindings as a new version; a version serves nothing until deployed. Set deploy true to create the pending deployment in the same call. Rejected binding types return UNSUPPORTED.
|
|
4964
|
+
* Upload code and bindings as a new version; a version serves nothing until deployed. Set deploy true to create the pending deployment in the same call. Rejected binding types return UNSUPPORTED. Send an Idempotency-Key to make a create safe to retry: within 24 hours the same key with the same body answers the first version (and its deployment) again instead of creating a second one, and the same key with a different body is refused.
|
|
4874
4965
|
*/
|
|
4875
4966
|
export const applicationCreateVersion = (options) => (options.client ?? client).post({
|
|
4876
4967
|
security: [{
|
|
@@ -6967,36 +7058,39 @@ export const canvasRestoreCanvas = (options) => (options.client ?? client).post(
|
|
|
6967
7058
|
}
|
|
6968
7059
|
});
|
|
6969
7060
|
/**
|
|
6970
|
-
* List
|
|
7061
|
+
* List contents
|
|
6971
7062
|
*
|
|
6972
|
-
*
|
|
7063
|
+
* Discover the video contents of the API key's organization and obtain the content_id each later call takes. Archived contents stay out of the list unless status is archived; results are ordered by update_time, newest first. Filter with status (draft, published, unpublished or archived), kind (video), asset_id (the Media asset a content was made from) and q (a substring of the title). page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null, keeping the same filters.
|
|
6973
7064
|
*/
|
|
6974
|
-
export const
|
|
6975
|
-
querySerializer: { parameters: {
|
|
6976
|
-
associations: { array: { explode: false } },
|
|
6977
|
-
properties: { array: { explode: false } },
|
|
6978
|
-
propertiesWithHistory: { array: { explode: false } }
|
|
6979
|
-
} },
|
|
7065
|
+
export const contentListContents = (options) => (options?.client ?? client).get({
|
|
6980
7066
|
security: [{
|
|
6981
|
-
key: '
|
|
7067
|
+
key: 'BearerAuth',
|
|
6982
7068
|
scheme: 'bearer',
|
|
6983
7069
|
type: 'http'
|
|
7070
|
+
}, {
|
|
7071
|
+
key: 'ApiKeyAuth',
|
|
7072
|
+
name: 'X-API-Key',
|
|
7073
|
+
type: 'apiKey'
|
|
6984
7074
|
}],
|
|
6985
|
-
url: '/
|
|
7075
|
+
url: '/content/v1/contents',
|
|
6986
7076
|
...options
|
|
6987
7077
|
});
|
|
6988
7078
|
/**
|
|
6989
|
-
* Create
|
|
7079
|
+
* Create a content
|
|
6990
7080
|
*
|
|
6991
|
-
* Create a
|
|
7081
|
+
* Create a video content from one asset of a Media library, before publishing it to end users. Send library_id and asset_id from `praxis.media` (assets.create, assets.list or the asset you uploaded return them); the create pins asset_version (default 1) and immediately asks Media to transcode the wanted renditions, so the content reports readiness processing until they are ready. kind is video, the only kind today. settings is optional and its four groups are merged over the service defaults: source (library_id and asset_id required, asset_version 1, follow_new_versions false, renditions 480/720/1080), access (capability_seconds 600 within 100 to 3000, encryption false, allowed_origins empty), player (poster null, show_title true, accent_color null, default_quality auto, speeds 0.75/1/1.25/1.5/2, storyboard true, autoplay false, remember_position true) and description (at most 2000 characters). An unknown field — including mode, which was removed because a content is always signed — is refused by name with 400. Returns the new content with HTTP 201; save its id for publish, versions and playback calls.
|
|
6992
7082
|
*/
|
|
6993
|
-
export const
|
|
7083
|
+
export const contentCreateContent = (options) => (options.client ?? client).post({
|
|
6994
7084
|
security: [{
|
|
6995
|
-
key: '
|
|
7085
|
+
key: 'BearerAuth',
|
|
6996
7086
|
scheme: 'bearer',
|
|
6997
7087
|
type: 'http'
|
|
7088
|
+
}, {
|
|
7089
|
+
key: 'ApiKeyAuth',
|
|
7090
|
+
name: 'X-API-Key',
|
|
7091
|
+
type: 'apiKey'
|
|
6998
7092
|
}],
|
|
6999
|
-
url: '/
|
|
7093
|
+
url: '/content/v1/contents',
|
|
7000
7094
|
...options,
|
|
7001
7095
|
headers: {
|
|
7002
7096
|
'Content-Type': 'application/json',
|
|
@@ -7004,50 +7098,39 @@ export const crmObjectsCreate = (options) => (options.client ?? client).post({
|
|
|
7004
7098
|
}
|
|
7005
7099
|
});
|
|
7006
7100
|
/**
|
|
7007
|
-
*
|
|
7008
|
-
*
|
|
7009
|
-
* Archive a record selected from objects.list or objects.search when it should leave active results. This removes it from normal lists without deleting its history; archived=true can be used to read archived records. Confirm objectType and objectId before calling. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204.
|
|
7010
|
-
*/
|
|
7011
|
-
export const crmObjectsArchive = (options) => (options.client ?? client).delete({
|
|
7012
|
-
security: [{
|
|
7013
|
-
key: 'crm-bearerAuth',
|
|
7014
|
-
scheme: 'bearer',
|
|
7015
|
-
type: 'http'
|
|
7016
|
-
}],
|
|
7017
|
-
url: '/crm/v1/objects/{objectType}/{objectId}',
|
|
7018
|
-
...options
|
|
7019
|
-
});
|
|
7020
|
-
/**
|
|
7021
|
-
* Retrieve record
|
|
7101
|
+
* Get a content
|
|
7022
7102
|
*
|
|
7023
|
-
* Read one
|
|
7103
|
+
* Read one content with the settings that decide its playback: the source it publishes, its access settings, its player settings, its description, and the version numbers publish and versions calls need. Use it to see the status and readiness before publishing, or to read the live_version a playback will play. A content of another organization, and an archived or unknown id, all answer 404 CONTENT_NOT_FOUND.
|
|
7024
7104
|
*/
|
|
7025
|
-
export const
|
|
7026
|
-
querySerializer: { parameters: {
|
|
7027
|
-
associations: { array: { explode: false } },
|
|
7028
|
-
properties: { array: { explode: false } },
|
|
7029
|
-
propertiesWithHistory: { array: { explode: false } }
|
|
7030
|
-
} },
|
|
7105
|
+
export const contentGetContent = (options) => (options.client ?? client).get({
|
|
7031
7106
|
security: [{
|
|
7032
|
-
key: '
|
|
7107
|
+
key: 'BearerAuth',
|
|
7033
7108
|
scheme: 'bearer',
|
|
7034
7109
|
type: 'http'
|
|
7110
|
+
}, {
|
|
7111
|
+
key: 'ApiKeyAuth',
|
|
7112
|
+
name: 'X-API-Key',
|
|
7113
|
+
type: 'apiKey'
|
|
7035
7114
|
}],
|
|
7036
|
-
url: '/
|
|
7115
|
+
url: '/content/v1/contents/{content_id}',
|
|
7037
7116
|
...options
|
|
7038
7117
|
});
|
|
7039
7118
|
/**
|
|
7040
|
-
* Update
|
|
7119
|
+
* Update a content
|
|
7041
7120
|
*
|
|
7042
|
-
* Change only
|
|
7121
|
+
* Change a content's title, its settings, or both. Send only what changes: each settings group left out keeps its current value, and a group sent is a deep merge, so changing only access.capability_seconds leaves allowed_origins alone. A settings change makes a new version and never touches the live one, except access settings (capability_seconds, encryption, allowed_origins), which a playback reads from the latest version and so take effect at once with no republish (ADR-145 §4). A title-only change makes no version. Changing source (library_id, asset_id, asset_version, library_id, asset_id or renditions) asks Media to transcode again and needs a republish to play. An archived content is final and answers 409 CONTENT_INVALID_STATE.
|
|
7043
7122
|
*/
|
|
7044
|
-
export const
|
|
7123
|
+
export const contentUpdateContent = (options) => (options.client ?? client).patch({
|
|
7045
7124
|
security: [{
|
|
7046
|
-
key: '
|
|
7125
|
+
key: 'BearerAuth',
|
|
7047
7126
|
scheme: 'bearer',
|
|
7048
7127
|
type: 'http'
|
|
7128
|
+
}, {
|
|
7129
|
+
key: 'ApiKeyAuth',
|
|
7130
|
+
name: 'X-API-Key',
|
|
7131
|
+
type: 'apiKey'
|
|
7049
7132
|
}],
|
|
7050
|
-
url: '/
|
|
7133
|
+
url: '/content/v1/contents/{content_id}',
|
|
7051
7134
|
...options,
|
|
7052
7135
|
headers: {
|
|
7053
7136
|
'Content-Type': 'application/json',
|
|
@@ -7055,17 +7138,21 @@ export const crmObjectsUpdate = (options) => (options.client ?? client).patch({
|
|
|
7055
7138
|
}
|
|
7056
7139
|
});
|
|
7057
7140
|
/**
|
|
7058
|
-
*
|
|
7141
|
+
* Publish a content
|
|
7059
7142
|
*
|
|
7060
|
-
*
|
|
7143
|
+
* Make a content playable: publish the latest version, or pin the version you send in version to become the live one. Use it after the content's readiness is ready; publishing a version whose renditions are still transcoding answers 409 SOURCE_NOT_READY, and you retry once Media reports ready. A content that is already published can be published again with another version, which swaps the live one; an archived content answers 409 CONTENT_INVALID_STATE. Returns the content with status published and the new live_version. Only a published content opens a playback session.
|
|
7061
7144
|
*/
|
|
7062
|
-
export const
|
|
7145
|
+
export const contentPublishContent = (options) => (options.client ?? client).post({
|
|
7063
7146
|
security: [{
|
|
7064
|
-
key: '
|
|
7147
|
+
key: 'BearerAuth',
|
|
7065
7148
|
scheme: 'bearer',
|
|
7066
7149
|
type: 'http'
|
|
7150
|
+
}, {
|
|
7151
|
+
key: 'ApiKeyAuth',
|
|
7152
|
+
name: 'X-API-Key',
|
|
7153
|
+
type: 'apiKey'
|
|
7067
7154
|
}],
|
|
7068
|
-
url: '/
|
|
7155
|
+
url: '/content/v1/contents/{content_id}/publish',
|
|
7069
7156
|
...options,
|
|
7070
7157
|
headers: {
|
|
7071
7158
|
'Content-Type': 'application/json',
|
|
@@ -7073,49 +7160,240 @@ export const crmObjectsSearch = (options) => (options.client ?? client).post({
|
|
|
7073
7160
|
}
|
|
7074
7161
|
});
|
|
7075
7162
|
/**
|
|
7076
|
-
*
|
|
7163
|
+
* Unpublish a content
|
|
7077
7164
|
*
|
|
7078
|
-
*
|
|
7165
|
+
* Take a published content offline without deleting it or losing a version. No playback opens on it afterwards, while capabilities already issued run out by themselves within their lifetime (at most 3000 seconds). Publishing it again with a version brings it back. Only a published content can be unpublished; any other state answers 409 CONTENT_INVALID_STATE. Returns the content with status unpublished and its live_version kept for the next publish.
|
|
7079
7166
|
*/
|
|
7080
|
-
export const
|
|
7167
|
+
export const contentUnpublishContent = (options) => (options.client ?? client).post({
|
|
7081
7168
|
security: [{
|
|
7082
|
-
key: '
|
|
7169
|
+
key: 'BearerAuth',
|
|
7083
7170
|
scheme: 'bearer',
|
|
7084
7171
|
type: 'http'
|
|
7172
|
+
}, {
|
|
7173
|
+
key: 'ApiKeyAuth',
|
|
7174
|
+
name: 'X-API-Key',
|
|
7175
|
+
type: 'apiKey'
|
|
7085
7176
|
}],
|
|
7086
|
-
url: '/
|
|
7087
|
-
...options
|
|
7088
|
-
headers: {
|
|
7089
|
-
'Content-Type': 'application/json',
|
|
7090
|
-
...options.headers
|
|
7091
|
-
}
|
|
7177
|
+
url: '/content/v1/contents/{content_id}/unpublish',
|
|
7178
|
+
...options
|
|
7092
7179
|
});
|
|
7093
7180
|
/**
|
|
7094
|
-
*
|
|
7181
|
+
* Archive a content
|
|
7095
7182
|
*
|
|
7096
|
-
*
|
|
7183
|
+
* Close a content permanently when it is no longer published. A published content must be unpublished first, because a live content is never archived directly; archiving a published content answers 409 CONTENT_INVALID_STATE. An archived content is final: it cannot be republished, edited or archived again, it stays out of the list unless status is archived, and no playback opens on it. Returns the content with status archived and archive_time set.
|
|
7097
7184
|
*/
|
|
7098
|
-
export const
|
|
7185
|
+
export const contentArchiveContent = (options) => (options.client ?? client).post({
|
|
7099
7186
|
security: [{
|
|
7100
|
-
key: '
|
|
7187
|
+
key: 'BearerAuth',
|
|
7101
7188
|
scheme: 'bearer',
|
|
7102
7189
|
type: 'http'
|
|
7190
|
+
}, {
|
|
7191
|
+
key: 'ApiKeyAuth',
|
|
7192
|
+
name: 'X-API-Key',
|
|
7193
|
+
type: 'apiKey'
|
|
7103
7194
|
}],
|
|
7104
|
-
url: '/
|
|
7105
|
-
...options
|
|
7106
|
-
headers: {
|
|
7107
|
-
'Content-Type': 'application/json',
|
|
7108
|
-
...options.headers
|
|
7109
|
-
}
|
|
7195
|
+
url: '/content/v1/contents/{content_id}/archive',
|
|
7196
|
+
...options
|
|
7110
7197
|
});
|
|
7111
7198
|
/**
|
|
7112
|
-
*
|
|
7199
|
+
* List versions
|
|
7113
7200
|
*
|
|
7114
|
-
*
|
|
7201
|
+
* Read the immutable version history of a content, newest version first. Each entry is a snapshot of the settings at the time it was saved, with live telling whether that version is the one a playback plays. Use it to find the version number to pin in publish, or to read the access settings a playback is currently reading (they come from the latest version). page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null.
|
|
7115
7202
|
*/
|
|
7116
|
-
export const
|
|
7203
|
+
export const contentListVersions = (options) => (options.client ?? client).get({
|
|
7117
7204
|
security: [{
|
|
7118
|
-
key: '
|
|
7205
|
+
key: 'BearerAuth',
|
|
7206
|
+
scheme: 'bearer',
|
|
7207
|
+
type: 'http'
|
|
7208
|
+
}, {
|
|
7209
|
+
key: 'ApiKeyAuth',
|
|
7210
|
+
name: 'X-API-Key',
|
|
7211
|
+
type: 'apiKey'
|
|
7212
|
+
}],
|
|
7213
|
+
url: '/content/v1/contents/{content_id}/versions',
|
|
7214
|
+
...options
|
|
7215
|
+
});
|
|
7216
|
+
/**
|
|
7217
|
+
* Get a version
|
|
7218
|
+
*
|
|
7219
|
+
* Read one immutable version of a content: the settings exactly as they were saved, the live flag, when it was created and which actor created it. Use it to compare a version with the live one before pinning it in publish, or to check the access settings a playback is currently reading. The version segment is the positive version number from the versions list; an unknown number answers 404 VERSION_NOT_FOUND and an unknown content 404 CONTENT_NOT_FOUND.
|
|
7220
|
+
*/
|
|
7221
|
+
export const contentGetVersion = (options) => (options.client ?? client).get({
|
|
7222
|
+
security: [{
|
|
7223
|
+
key: 'BearerAuth',
|
|
7224
|
+
scheme: 'bearer',
|
|
7225
|
+
type: 'http'
|
|
7226
|
+
}, {
|
|
7227
|
+
key: 'ApiKeyAuth',
|
|
7228
|
+
name: 'X-API-Key',
|
|
7229
|
+
type: 'apiKey'
|
|
7230
|
+
}],
|
|
7231
|
+
url: '/content/v1/contents/{content_id}/versions/{version}',
|
|
7232
|
+
...options
|
|
7233
|
+
});
|
|
7234
|
+
/**
|
|
7235
|
+
* Open a playback session
|
|
7236
|
+
*
|
|
7237
|
+
* Open one playback of a published content for an end user and get the manifest address a player loads. No platform API key is needed: the caller is the end user's own Praxis customer access token carried as `Authorization: Bearer <access_token>`, verified by this door exactly as the customer exchange verifies it. A caller with no token is left to the service, which refuses it RESOURCE_NOT_GRANTED, because a content is always signed and there is no public playback. The organization is taken from the content row, never from the token, and a token that claims another organization is refused. The content must be published (otherwise 403 CONTENT_NOT_PUBLISHED), its allowed_origins must accept the request Origin when the list is not empty (otherwise 403 ORIGIN_NOT_ALLOWED), the token must cover a resource for this content (otherwise 403 RESOURCE_NOT_GRANTED) and the pinned version must be ready (otherwise 409 SOURCE_NOT_READY; retry once readiness is ready). Returns HTTP 201 with the session id, manifest_url (https://content.praxisusercontent.com/{content_id}/{capability}/master.m3u8), expire_time, the renditions, the poster, the title when the player shows it, and the player settings. The playback reads access settings from the content's latest version and source and player from the live version, so a tightened origin or lifetime takes effect without a republish. This door has its own per-IP request budget: over it answers 429 RATE_LIMITED with Retry-After.
|
|
7238
|
+
*/
|
|
7239
|
+
export const contentCreatePlaybackSession = (options) => (options.client ?? client).post({
|
|
7240
|
+
url: '/content/v1/playback/sessions',
|
|
7241
|
+
...options,
|
|
7242
|
+
headers: {
|
|
7243
|
+
'Content-Type': 'application/json',
|
|
7244
|
+
...options.headers
|
|
7245
|
+
}
|
|
7246
|
+
});
|
|
7247
|
+
/**
|
|
7248
|
+
* List records
|
|
7249
|
+
*
|
|
7250
|
+
* Browse records of one object type and obtain ids for retrieval or edits. Discover objectType with schemas.list; select properties by internal names from properties.list. Omit after for the first page, then copy paging.next.after until no next page is returned. archived defaults to false; use objects.search for property filters.
|
|
7251
|
+
*/
|
|
7252
|
+
export const crmObjectsList = (options) => (options.client ?? client).get({
|
|
7253
|
+
querySerializer: { parameters: {
|
|
7254
|
+
associations: { array: { explode: false } },
|
|
7255
|
+
properties: { array: { explode: false } },
|
|
7256
|
+
propertiesWithHistory: { array: { explode: false } }
|
|
7257
|
+
} },
|
|
7258
|
+
security: [{
|
|
7259
|
+
key: 'crm-bearerAuth',
|
|
7260
|
+
scheme: 'bearer',
|
|
7261
|
+
type: 'http'
|
|
7262
|
+
}],
|
|
7263
|
+
url: '/crm/v1/objects/{objectType}',
|
|
7264
|
+
...options
|
|
7265
|
+
});
|
|
7266
|
+
/**
|
|
7267
|
+
* Create record
|
|
7268
|
+
*
|
|
7269
|
+
* Create a customer record with property values and optional initial associations. Discover objectType with schemas.list and allowed property names with properties.list; save the returned id for subsequent calls. Each call creates a record. Example for contacts: {"properties":{"email":"person@example.com"}}. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
|
|
7270
|
+
*/
|
|
7271
|
+
export const crmObjectsCreate = (options) => (options.client ?? client).post({
|
|
7272
|
+
security: [{
|
|
7273
|
+
key: 'crm-bearerAuth',
|
|
7274
|
+
scheme: 'bearer',
|
|
7275
|
+
type: 'http'
|
|
7276
|
+
}],
|
|
7277
|
+
url: '/crm/v1/objects/{objectType}',
|
|
7278
|
+
...options,
|
|
7279
|
+
headers: {
|
|
7280
|
+
'Content-Type': 'application/json',
|
|
7281
|
+
...options.headers
|
|
7282
|
+
}
|
|
7283
|
+
});
|
|
7284
|
+
/**
|
|
7285
|
+
* Archive record
|
|
7286
|
+
*
|
|
7287
|
+
* Archive a record selected from objects.list or objects.search when it should leave active results. This removes it from normal lists without deleting its history; archived=true can be used to read archived records. Confirm objectType and objectId before calling. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204.
|
|
7288
|
+
*/
|
|
7289
|
+
export const crmObjectsArchive = (options) => (options.client ?? client).delete({
|
|
7290
|
+
security: [{
|
|
7291
|
+
key: 'crm-bearerAuth',
|
|
7292
|
+
scheme: 'bearer',
|
|
7293
|
+
type: 'http'
|
|
7294
|
+
}],
|
|
7295
|
+
url: '/crm/v1/objects/{objectType}/{objectId}',
|
|
7296
|
+
...options
|
|
7297
|
+
});
|
|
7298
|
+
/**
|
|
7299
|
+
* Retrieve record
|
|
7300
|
+
*
|
|
7301
|
+
* Read one record by id from objects.list, objects.search or objects.create. Select property names with properties and associated object types with associations; use idProperty only when objectId is a value of that unique property. Use archived=true to inspect an archived record.
|
|
7302
|
+
*/
|
|
7303
|
+
export const crmObjectsRetrieve = (options) => (options.client ?? client).get({
|
|
7304
|
+
querySerializer: { parameters: {
|
|
7305
|
+
associations: { array: { explode: false } },
|
|
7306
|
+
properties: { array: { explode: false } },
|
|
7307
|
+
propertiesWithHistory: { array: { explode: false } }
|
|
7308
|
+
} },
|
|
7309
|
+
security: [{
|
|
7310
|
+
key: 'crm-bearerAuth',
|
|
7311
|
+
scheme: 'bearer',
|
|
7312
|
+
type: 'http'
|
|
7313
|
+
}],
|
|
7314
|
+
url: '/crm/v1/objects/{objectType}/{objectId}',
|
|
7315
|
+
...options
|
|
7316
|
+
});
|
|
7317
|
+
/**
|
|
7318
|
+
* Update record
|
|
7319
|
+
*
|
|
7320
|
+
* Change only the supplied properties of a record selected from objects.list or objects.search. Omitted properties retain their values. Use property names from properties.list and valid stage ids from pipelines.retrieve. Stage-entry requirements must be satisfied by the resulting record; inspect 400 errors before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
|
|
7321
|
+
*/
|
|
7322
|
+
export const crmObjectsUpdate = (options) => (options.client ?? client).patch({
|
|
7323
|
+
security: [{
|
|
7324
|
+
key: 'crm-bearerAuth',
|
|
7325
|
+
scheme: 'bearer',
|
|
7326
|
+
type: 'http'
|
|
7327
|
+
}],
|
|
7328
|
+
url: '/crm/v1/objects/{objectType}/{objectId}',
|
|
7329
|
+
...options,
|
|
7330
|
+
headers: {
|
|
7331
|
+
'Content-Type': 'application/json',
|
|
7332
|
+
...options.headers
|
|
7333
|
+
}
|
|
7334
|
+
});
|
|
7335
|
+
/**
|
|
7336
|
+
* Search records
|
|
7337
|
+
*
|
|
7338
|
+
* Find records using text query, property filters and sort order rather than scanning a list. Obtain objectType from schemas.list and filter propertyName values from properties.list. Supply filterGroups, sorts, properties, limit and after; use empty arrays for no filters, sorts or property selection, and an empty after for the first page. Copy paging.next.after with the same query to continue. This operation reads records without changing them.
|
|
7339
|
+
*/
|
|
7340
|
+
export const crmObjectsSearch = (options) => (options.client ?? client).post({
|
|
7341
|
+
security: [{
|
|
7342
|
+
key: 'crm-bearerAuth',
|
|
7343
|
+
scheme: 'bearer',
|
|
7344
|
+
type: 'http'
|
|
7345
|
+
}],
|
|
7346
|
+
url: '/crm/v1/objects/{objectType}/search',
|
|
7347
|
+
...options,
|
|
7348
|
+
headers: {
|
|
7349
|
+
'Content-Type': 'application/json',
|
|
7350
|
+
...options.headers
|
|
7351
|
+
}
|
|
7352
|
+
});
|
|
7353
|
+
/**
|
|
7354
|
+
* Batch read records
|
|
7355
|
+
*
|
|
7356
|
+
* Read a set of known record ids in one call; use objects.search to discover ids first. Supply inputs with ids plus requested properties; set idProperty only when the inputs use unique-property values rather than record ids.
|
|
7357
|
+
*/
|
|
7358
|
+
export const crmObjectsBatchRead = (options) => (options.client ?? client).post({
|
|
7359
|
+
security: [{
|
|
7360
|
+
key: 'crm-bearerAuth',
|
|
7361
|
+
scheme: 'bearer',
|
|
7362
|
+
type: 'http'
|
|
7363
|
+
}],
|
|
7364
|
+
url: '/crm/v1/objects/{objectType}/batch/read',
|
|
7365
|
+
...options,
|
|
7366
|
+
headers: {
|
|
7367
|
+
'Content-Type': 'application/json',
|
|
7368
|
+
...options.headers
|
|
7369
|
+
}
|
|
7370
|
+
});
|
|
7371
|
+
/**
|
|
7372
|
+
* Batch create records
|
|
7373
|
+
*
|
|
7374
|
+
* Create several records of one object type using inputs with properties and optional associations. Obtain property names from properties.list; each successful input creates a record, so inspect per-item errors before resubmitting failed inputs. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
|
|
7375
|
+
*/
|
|
7376
|
+
export const crmObjectsBatchCreate = (options) => (options.client ?? client).post({
|
|
7377
|
+
security: [{
|
|
7378
|
+
key: 'crm-bearerAuth',
|
|
7379
|
+
scheme: 'bearer',
|
|
7380
|
+
type: 'http'
|
|
7381
|
+
}],
|
|
7382
|
+
url: '/crm/v1/objects/{objectType}/batch/create',
|
|
7383
|
+
...options,
|
|
7384
|
+
headers: {
|
|
7385
|
+
'Content-Type': 'application/json',
|
|
7386
|
+
...options.headers
|
|
7387
|
+
}
|
|
7388
|
+
});
|
|
7389
|
+
/**
|
|
7390
|
+
* Batch update records
|
|
7391
|
+
*
|
|
7392
|
+
* Apply distinct property patches to existing records identified by inputs[].id. Obtain ids from objects.list or objects.search and property names from properties.list. Omitted properties retain their values; inspect results and errors for each input. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
|
|
7393
|
+
*/
|
|
7394
|
+
export const crmObjectsBatchUpdate = (options) => (options.client ?? client).post({
|
|
7395
|
+
security: [{
|
|
7396
|
+
key: 'crm-bearerAuth',
|
|
7119
7397
|
scheme: 'bearer',
|
|
7120
7398
|
type: 'http'
|
|
7121
7399
|
}],
|
|
@@ -7557,11 +7835,11 @@ export const crmLayoutsUpdate = (options) => (options.client ?? client).put({
|
|
|
7557
7835
|
}
|
|
7558
7836
|
});
|
|
7559
7837
|
/**
|
|
7560
|
-
*
|
|
7838
|
+
* Create a grant code
|
|
7561
7839
|
*
|
|
7562
|
-
*
|
|
7840
|
+
* Sign one of your logged-in end users in from your backend, after your own login succeeded, by handing out a one-time grant code that the browser exchanges for an access token. Call it with the organization API key; never from the browser, because the API key must stay on your server. customer_id is your own identifier for the person (an opaque value such as your database user id, not an email address or phone number); a value starting with anon_ is reserved for anonymous visitors. resources name what the sign-in may reach and is required: each entry is a scope string in the form agent:<id>:chat, content:<id>:play or application:<id>:visit, or an object with that scope plus product params this service stores without interpreting; use the id form for one object and * for every object of a type. expires_in shortens the code's life in seconds (900 seconds, fifteen minutes, by default) and max_session_seconds shortens the sign-in's life (7 days by default); merge_customer_id merges an anonymous visitor's record into this person; origin pins the page the sign-in may be made from. When the browser still holds that visitor's own access token, send it as anonymous_access_token instead of merge_customer_id: the door verifies it and merges the visitor it names, which is the usual way a merchant continues a session the browser already began. The code is single use and unknown, used or expired codes all answer 401 GRANT_CODE_INVALID at the exchange. Returns the code with HTTP 201; pass it to the Kit in the browser and never call this route with it.
|
|
7563
7841
|
*/
|
|
7564
|
-
export const
|
|
7842
|
+
export const customerCreateGrantCode = (options) => (options.client ?? client).post({
|
|
7565
7843
|
security: [{
|
|
7566
7844
|
key: 'BearerAuth',
|
|
7567
7845
|
scheme: 'bearer',
|
|
@@ -7571,15 +7849,62 @@ export const cutListProjects = (options) => (options?.client ?? client).get({
|
|
|
7571
7849
|
name: 'X-API-Key',
|
|
7572
7850
|
type: 'apiKey'
|
|
7573
7851
|
}],
|
|
7574
|
-
url: '/
|
|
7852
|
+
url: '/customer/v1/grant_codes',
|
|
7853
|
+
...options,
|
|
7854
|
+
headers: {
|
|
7855
|
+
'Content-Type': 'application/json',
|
|
7856
|
+
...options.headers
|
|
7857
|
+
}
|
|
7858
|
+
});
|
|
7859
|
+
/**
|
|
7860
|
+
* Exchange a grant code or publishable key
|
|
7861
|
+
*
|
|
7862
|
+
* Turn a grant code, or a publishable key for an anonymous visitor, into the Praxis customer access token that authorizes the Kit's sessions and playbacks. It is PRE-AUTH: no platform API key is needed, because the grant code or the publishable key is the credential; the Kit calls it from the browser, so send the page Origin when the code or key is bound to one. Send exactly one of grant_code or publishable_key — the door refuses any other combination with 400. With grant_code the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, already used, expired and foreign codes all answer 401 GRANT_CODE_INVALID. With publishable_key a new anonymous customer (anon_…) is created and merged into the identified one later if it signs in. The sign-in may be bound to an origin at creation; when the request Origin does not satisfy it, the exchange answers 403 ORIGIN_NOT_ALLOWED, and a blocked end user answers 403 CUSTOMER_BLOCKED. The access token lasts at most two hours and never outlives the sign-in; renew it with praxis.customer.accessTokens.renew before expires_at. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
|
|
7863
|
+
*/
|
|
7864
|
+
export const customerCreateAccessToken = (options) => (options.client ?? client).post({
|
|
7865
|
+
url: '/customer/v1/access_tokens',
|
|
7866
|
+
...options,
|
|
7867
|
+
headers: {
|
|
7868
|
+
'Content-Type': 'application/json',
|
|
7869
|
+
...options.headers
|
|
7870
|
+
}
|
|
7871
|
+
});
|
|
7872
|
+
/**
|
|
7873
|
+
* Renew an access token
|
|
7874
|
+
*
|
|
7875
|
+
* Replace a live access token with a fresh one so a signed-in end user stays signed in without signing in again. It is PRE-AUTH: the credential is the token the caller already carries as `Authorization: Bearer <access_token>`, verified by this door, and the token names the sign-in it renews. Call it before the token's expires_at; the sign-in and its resource scopes stay the same, so what the end user may reach does not change. A missing, unverifiable or foreign token answers 401 ACCESS_TOKEN_EXPIRED, and a sign-in that is over answers 401 SIGN_IN_EXPIRED or SIGN_IN_REVOKED, in which case the end user signs in again through praxis.customer.accessTokens.create. A blocked end user answers 403 CUSTOMER_BLOCKED. When the sign-in itself has ended, the renewal does not extend it. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
|
|
7876
|
+
*/
|
|
7877
|
+
export const customerRenewAccessToken = (options) => (options?.client ?? client).post({ url: '/customer/v1/access_tokens/renew', ...options });
|
|
7878
|
+
/**
|
|
7879
|
+
* Sign out the current token
|
|
7880
|
+
*
|
|
7881
|
+
* Sign out: end the sign-in the caller's token belongs to and revoke every token issued from it, exactly as a logout does. It is PRE-AUTH: the credential is the token the caller carries as `Authorization: Bearer <access_token>`. Use it when the end user asks to sign out, and after it every token of that sign-in stops working and a later session or playback answers 401 SIGN_IN_REVOKED; other sign-ins of the same end user are untouched (revoke every token of one end user, organization-wide, with praxis.customer.customers.revokeTokens). A missing or unverifiable token answers 401 ACCESS_TOKEN_EXPIRED. The call answers 200 with an empty body. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
|
|
7882
|
+
*/
|
|
7883
|
+
export const customerRevokeCurrentTokens = (options) => (options?.client ?? client).delete({ url: '/customer/v1/access_tokens/current', ...options });
|
|
7884
|
+
/**
|
|
7885
|
+
* List end users
|
|
7886
|
+
*
|
|
7887
|
+
* Read the organization's end-user directory and obtain the customer_id the administrative acts take. Results are ordered by last_seen_at, most recently seen first. Filter with type (identified for people who signed in through a grant code, anonymous for visitors admitted with a publishable key), blocked (true or false), resource (one product in the form agent:<id>, content:<id> or application:<id>, giving that product's own view of the directory) and q (a prefix of the customer id). Identified and anonymous end users both appear; an anonymous one that later signs in shows merged_into and its record joins that person. page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null, keeping the same filters.
|
|
7888
|
+
*/
|
|
7889
|
+
export const customerListCustomers = (options) => (options?.client ?? client).get({
|
|
7890
|
+
security: [{
|
|
7891
|
+
key: 'BearerAuth',
|
|
7892
|
+
scheme: 'bearer',
|
|
7893
|
+
type: 'http'
|
|
7894
|
+
}, {
|
|
7895
|
+
key: 'ApiKeyAuth',
|
|
7896
|
+
name: 'X-API-Key',
|
|
7897
|
+
type: 'apiKey'
|
|
7898
|
+
}],
|
|
7899
|
+
url: '/customer/v1/customers',
|
|
7575
7900
|
...options
|
|
7576
7901
|
});
|
|
7577
7902
|
/**
|
|
7578
|
-
*
|
|
7903
|
+
* Delete an end user
|
|
7579
7904
|
*
|
|
7580
|
-
*
|
|
7905
|
+
* Delete one end user on the merchant's own confirmation, for a deletion request the person made to you. The confirm query parameter must repeat the path's customer_id; the door passes it through verbatim and the service refuses any other value with 400 INVALID_PARAMS, so a missing confirm never deletes anything. The deletion is announced on the platform event bus and each product deletes its own sessions, events and files for that person, so the call returns as soon as the directory record is gone, not when every product has finished. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
|
|
7581
7906
|
*/
|
|
7582
|
-
export const
|
|
7907
|
+
export const customerDeleteCustomer = (options) => (options.client ?? client).delete({
|
|
7583
7908
|
security: [{
|
|
7584
7909
|
key: 'BearerAuth',
|
|
7585
7910
|
scheme: 'bearer',
|
|
@@ -7589,19 +7914,15 @@ export const cutCreateProject = (options) => (options.client ?? client).post({
|
|
|
7589
7914
|
name: 'X-API-Key',
|
|
7590
7915
|
type: 'apiKey'
|
|
7591
7916
|
}],
|
|
7592
|
-
url: '/
|
|
7593
|
-
...options
|
|
7594
|
-
headers: {
|
|
7595
|
-
'Content-Type': 'application/json',
|
|
7596
|
-
...options.headers
|
|
7597
|
-
}
|
|
7917
|
+
url: '/customer/v1/customers/{customer_id}',
|
|
7918
|
+
...options
|
|
7598
7919
|
});
|
|
7599
7920
|
/**
|
|
7600
|
-
*
|
|
7921
|
+
* Get an end user
|
|
7601
7922
|
*
|
|
7602
|
-
*
|
|
7923
|
+
* Read one end user of the organization: the id, its kind, whether it is blocked, its metadata and when it was first and last seen. Add expand=products,sign_ins,usage (comma separated, any combination) to also receive the products it has used with their counts, its sign-ins with their resource scopes, and its recorded usage over the whole time. An unknown id, and an id of another organization, answer 404 CUSTOMER_NOT_FOUND.
|
|
7603
7924
|
*/
|
|
7604
|
-
export const
|
|
7925
|
+
export const customerGetCustomer = (options) => (options.client ?? client).get({
|
|
7605
7926
|
security: [{
|
|
7606
7927
|
key: 'BearerAuth',
|
|
7607
7928
|
scheme: 'bearer',
|
|
@@ -7611,15 +7932,15 @@ export const cutDeleteProject = (options) => (options.client ?? client).delete({
|
|
|
7611
7932
|
name: 'X-API-Key',
|
|
7612
7933
|
type: 'apiKey'
|
|
7613
7934
|
}],
|
|
7614
|
-
url: '/
|
|
7935
|
+
url: '/customer/v1/customers/{customer_id}',
|
|
7615
7936
|
...options
|
|
7616
7937
|
});
|
|
7617
7938
|
/**
|
|
7618
|
-
*
|
|
7939
|
+
* Read end-user usage
|
|
7619
7940
|
*
|
|
7620
|
-
*
|
|
7941
|
+
* Read what one end user has cost the organization, per product and per day. The directory stores no cost itself: this reads billing by the customerId dimension shared by every product, so it is the money figure the platform charged for that person. Send from and/or to as RFC 3339 times to narrow the window; omit both for everything recorded. Returns the total, the per-product breakdown and the per-day breakdown. An unknown id answers 404 CUSTOMER_NOT_FOUND.
|
|
7621
7942
|
*/
|
|
7622
|
-
export const
|
|
7943
|
+
export const customerGetUsage = (options) => (options.client ?? client).get({
|
|
7623
7944
|
security: [{
|
|
7624
7945
|
key: 'BearerAuth',
|
|
7625
7946
|
scheme: 'bearer',
|
|
@@ -7629,15 +7950,15 @@ export const cutRetrieveProject = (options) => (options.client ?? client).get({
|
|
|
7629
7950
|
name: 'X-API-Key',
|
|
7630
7951
|
type: 'apiKey'
|
|
7631
7952
|
}],
|
|
7632
|
-
url: '/
|
|
7953
|
+
url: '/customer/v1/customers/{customer_id}/usage',
|
|
7633
7954
|
...options
|
|
7634
7955
|
});
|
|
7635
7956
|
/**
|
|
7636
|
-
*
|
|
7957
|
+
* Block an end user
|
|
7637
7958
|
*
|
|
7638
|
-
*
|
|
7959
|
+
* Block one end user across every product of the organization. From then on no grant code, sign-in, renewal or new session and no playback is accepted for this id — each product's admission door refuses it at once. A stream already running and a playback capability already issued ride out their own token, at most two hours and 3000 seconds; they are not cut off. Send reason to record why, and the response's blocked field carries the block time, the reason and the actor. Blocking an already blocked end user is idempotent: the first block time is kept. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
|
|
7639
7960
|
*/
|
|
7640
|
-
export const
|
|
7961
|
+
export const customerBlockCustomer = (options) => (options.client ?? client).post({
|
|
7641
7962
|
security: [{
|
|
7642
7963
|
key: 'BearerAuth',
|
|
7643
7964
|
scheme: 'bearer',
|
|
@@ -7647,7 +7968,7 @@ export const cutUpdateProject = (options) => (options.client ?? client).patch({
|
|
|
7647
7968
|
name: 'X-API-Key',
|
|
7648
7969
|
type: 'apiKey'
|
|
7649
7970
|
}],
|
|
7650
|
-
url: '/
|
|
7971
|
+
url: '/customer/v1/customers/{customer_id}/block',
|
|
7651
7972
|
...options,
|
|
7652
7973
|
headers: {
|
|
7653
7974
|
'Content-Type': 'application/json',
|
|
@@ -7655,11 +7976,11 @@ export const cutUpdateProject = (options) => (options.client ?? client).patch({
|
|
|
7655
7976
|
}
|
|
7656
7977
|
});
|
|
7657
7978
|
/**
|
|
7658
|
-
*
|
|
7979
|
+
* Unblock an end user
|
|
7659
7980
|
*
|
|
7660
|
-
*
|
|
7981
|
+
* Lift a block from one end user, so the products accept its grant codes, sign-ins, renewals and new sessions again. Tokens that were revoked to enforce the block are not restored: the end user signs in again for a fresh sign-in. Unblocking an end user that is not blocked is idempotent and returns it unchanged. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
|
|
7661
7982
|
*/
|
|
7662
|
-
export const
|
|
7983
|
+
export const customerUnblockCustomer = (options) => (options.client ?? client).post({
|
|
7663
7984
|
security: [{
|
|
7664
7985
|
key: 'BearerAuth',
|
|
7665
7986
|
scheme: 'bearer',
|
|
@@ -7669,13 +7990,205 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
|
|
|
7669
7990
|
name: 'X-API-Key',
|
|
7670
7991
|
type: 'apiKey'
|
|
7671
7992
|
}],
|
|
7672
|
-
url: '/
|
|
7993
|
+
url: '/customer/v1/customers/{customer_id}/unblock',
|
|
7673
7994
|
...options
|
|
7674
7995
|
});
|
|
7675
7996
|
/**
|
|
7676
|
-
*
|
|
7997
|
+
* Revoke every token of an end user
|
|
7677
7998
|
*
|
|
7678
|
-
*
|
|
7999
|
+
* End every sign-in of one end user at once, everything of the organization's, not one product's and not one token's. Use it when credentials may have leaked and the end user must not be trusted until it signs in again; a single sign-in is ended instead with praxis.customer.accessTokens.revoke. After it every token of that end user stops working and a new session or playback answers 401 SIGN_IN_REVOKED, while the end user itself stays in the directory and may sign in again. The response counts how many sign-ins were revoked. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
|
|
8000
|
+
*/
|
|
8001
|
+
export const customerRevokeTokens = (options) => (options.client ?? client).post({
|
|
8002
|
+
security: [{
|
|
8003
|
+
key: 'BearerAuth',
|
|
8004
|
+
scheme: 'bearer',
|
|
8005
|
+
type: 'http'
|
|
8006
|
+
}, {
|
|
8007
|
+
key: 'ApiKeyAuth',
|
|
8008
|
+
name: 'X-API-Key',
|
|
8009
|
+
type: 'apiKey'
|
|
8010
|
+
}],
|
|
8011
|
+
url: '/customer/v1/customers/{customer_id}/revoke_tokens',
|
|
8012
|
+
...options
|
|
8013
|
+
});
|
|
8014
|
+
/**
|
|
8015
|
+
* List publishable keys
|
|
8016
|
+
*
|
|
8017
|
+
* List the organization's publishable keys, newest first, so you can see which anonymous admittance is open and what each one may reach. A publishable key is public by design (it ships in the browser page); use it from the Kit to admit anonymous visitors, and never expose an API key this way. The plaintext value is not in this list: it is returned once, by the create call, and only its hash is stored. page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null.
|
|
8018
|
+
*/
|
|
8019
|
+
export const customerListPublishableKeys = (options) => (options?.client ?? client).get({
|
|
8020
|
+
security: [{
|
|
8021
|
+
key: 'BearerAuth',
|
|
8022
|
+
scheme: 'bearer',
|
|
8023
|
+
type: 'http'
|
|
8024
|
+
}, {
|
|
8025
|
+
key: 'ApiKeyAuth',
|
|
8026
|
+
name: 'X-API-Key',
|
|
8027
|
+
type: 'apiKey'
|
|
8028
|
+
}],
|
|
8029
|
+
url: '/customer/v1/publishable_keys',
|
|
8030
|
+
...options
|
|
8031
|
+
});
|
|
8032
|
+
/**
|
|
8033
|
+
* Create a publishable key
|
|
8034
|
+
*
|
|
8035
|
+
* Mint a publishable key so a page can admit anonymous visitors without you signing each one in from your backend. name labels the key for the console and the key list. resources is required and names what an anonymous visitor may reach, in the same form as the grant-code scopes: agent:<id>:chat, content:<id>:play or application:<id>:visit, with * for every object of one type; give it only what the anonymous experience needs, because any visitor who has the page can use the key. The response carries the plaintext key once, in key, and the store keeps only its hash — save it then, because no later call returns it. Returns HTTP 201; the exchange that consumes it is praxis.customer.accessTokens.create with publishable_key.
|
|
8036
|
+
*/
|
|
8037
|
+
export const customerCreatePublishableKey = (options) => (options.client ?? client).post({
|
|
8038
|
+
security: [{
|
|
8039
|
+
key: 'BearerAuth',
|
|
8040
|
+
scheme: 'bearer',
|
|
8041
|
+
type: 'http'
|
|
8042
|
+
}, {
|
|
8043
|
+
key: 'ApiKeyAuth',
|
|
8044
|
+
name: 'X-API-Key',
|
|
8045
|
+
type: 'apiKey'
|
|
8046
|
+
}],
|
|
8047
|
+
url: '/customer/v1/publishable_keys',
|
|
8048
|
+
...options,
|
|
8049
|
+
headers: {
|
|
8050
|
+
'Content-Type': 'application/json',
|
|
8051
|
+
...options.headers
|
|
8052
|
+
}
|
|
8053
|
+
});
|
|
8054
|
+
/**
|
|
8055
|
+
* Delete a publishable key
|
|
8056
|
+
*
|
|
8057
|
+
* Delete a publishable key, closing that anonymous admittance for good. A page that still carries the plaintext key can no longer exchange it; any anonymous sign-ins it already made keep working until their own sign-in expires, so end users already admitted are not signed out by this call. Get the key id from the publishable key list, not from the plaintext value (only its hash is stored). An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.
|
|
8058
|
+
*/
|
|
8059
|
+
export const customerDeletePublishableKey = (options) => (options.client ?? client).delete({
|
|
8060
|
+
security: [{
|
|
8061
|
+
key: 'BearerAuth',
|
|
8062
|
+
scheme: 'bearer',
|
|
8063
|
+
type: 'http'
|
|
8064
|
+
}, {
|
|
8065
|
+
key: 'ApiKeyAuth',
|
|
8066
|
+
name: 'X-API-Key',
|
|
8067
|
+
type: 'apiKey'
|
|
8068
|
+
}],
|
|
8069
|
+
url: '/customer/v1/publishable_keys/{key_id}',
|
|
8070
|
+
...options
|
|
8071
|
+
});
|
|
8072
|
+
/**
|
|
8073
|
+
* List projects
|
|
8074
|
+
*
|
|
8075
|
+
* Discover projects owned by the API key organization and obtain project_id values. Results default to active projects ordered by updateTime descending; use filter state = "deleted" to find retained deleted projects for undelete. Continue with next_page_token as page_token until the token is absent.
|
|
8076
|
+
*/
|
|
8077
|
+
export const cutListProjects = (options) => (options?.client ?? client).get({
|
|
8078
|
+
security: [{
|
|
8079
|
+
key: 'BearerAuth',
|
|
8080
|
+
scheme: 'bearer',
|
|
8081
|
+
type: 'http'
|
|
8082
|
+
}, {
|
|
8083
|
+
key: 'ApiKeyAuth',
|
|
8084
|
+
name: 'X-API-Key',
|
|
8085
|
+
type: 'apiKey'
|
|
8086
|
+
}],
|
|
8087
|
+
url: '/cut/v1/projects',
|
|
8088
|
+
...options
|
|
8089
|
+
});
|
|
8090
|
+
/**
|
|
8091
|
+
* Create project
|
|
8092
|
+
*
|
|
8093
|
+
* Create a blank editing project in the API key organization before writing a script. First obtain accessible library ids from praxis.media; bindings must include exactly one read_write library with default_upload true. Each call creates a new project and returns HTTP 201; save its id for execute, state and timeline calls. All editing positions use seconds.
|
|
8094
|
+
*/
|
|
8095
|
+
export const cutCreateProject = (options) => (options.client ?? client).post({
|
|
8096
|
+
security: [{
|
|
8097
|
+
key: 'BearerAuth',
|
|
8098
|
+
scheme: 'bearer',
|
|
8099
|
+
type: 'http'
|
|
8100
|
+
}, {
|
|
8101
|
+
key: 'ApiKeyAuth',
|
|
8102
|
+
name: 'X-API-Key',
|
|
8103
|
+
type: 'apiKey'
|
|
8104
|
+
}],
|
|
8105
|
+
url: '/cut/v1/projects',
|
|
8106
|
+
...options,
|
|
8107
|
+
headers: {
|
|
8108
|
+
'Content-Type': 'application/json',
|
|
8109
|
+
...options.headers
|
|
8110
|
+
}
|
|
8111
|
+
});
|
|
8112
|
+
/**
|
|
8113
|
+
* Delete project
|
|
8114
|
+
*
|
|
8115
|
+
* Soft-delete a project selected from projects.list. The project is retained for seven days until purge_time and can be restored with undelete before that deadline. Deleted projects cannot be edited; list with filter state = "deleted" to locate retained projects.
|
|
8116
|
+
*/
|
|
8117
|
+
export const cutDeleteProject = (options) => (options.client ?? client).delete({
|
|
8118
|
+
security: [{
|
|
8119
|
+
key: 'BearerAuth',
|
|
8120
|
+
scheme: 'bearer',
|
|
8121
|
+
type: 'http'
|
|
8122
|
+
}, {
|
|
8123
|
+
key: 'ApiKeyAuth',
|
|
8124
|
+
name: 'X-API-Key',
|
|
8125
|
+
type: 'apiKey'
|
|
8126
|
+
}],
|
|
8127
|
+
url: '/cut/v1/projects/{project_id}',
|
|
8128
|
+
...options
|
|
8129
|
+
});
|
|
8130
|
+
/**
|
|
8131
|
+
* Retrieve project
|
|
8132
|
+
*
|
|
8133
|
+
* Inspect project metadata, settings and library bindings before editing. Copy id from projects.create or list; expand=timeline,exports,versions includes selected related resources. The expanded timeline uses seconds and the returned revision can guard a later execute call with expected_revision.
|
|
8134
|
+
*/
|
|
8135
|
+
export const cutRetrieveProject = (options) => (options.client ?? client).get({
|
|
8136
|
+
security: [{
|
|
8137
|
+
key: 'BearerAuth',
|
|
8138
|
+
scheme: 'bearer',
|
|
8139
|
+
type: 'http'
|
|
8140
|
+
}, {
|
|
8141
|
+
key: 'ApiKeyAuth',
|
|
8142
|
+
name: 'X-API-Key',
|
|
8143
|
+
type: 'apiKey'
|
|
8144
|
+
}],
|
|
8145
|
+
url: '/cut/v1/projects/{project_id}',
|
|
8146
|
+
...options
|
|
8147
|
+
});
|
|
8148
|
+
/**
|
|
8149
|
+
* Update project metadata
|
|
8150
|
+
*
|
|
8151
|
+
* Change the project display name or replace its labels by naming those fields in update_mask. Use execute for clip or track edits. Each successful update commits a new revision; labels are replaced as a whole when selected, so read and merge existing labels before overwriting them.
|
|
8152
|
+
*/
|
|
8153
|
+
export const cutUpdateProject = (options) => (options.client ?? client).patch({
|
|
8154
|
+
security: [{
|
|
8155
|
+
key: 'BearerAuth',
|
|
8156
|
+
scheme: 'bearer',
|
|
8157
|
+
type: 'http'
|
|
8158
|
+
}, {
|
|
8159
|
+
key: 'ApiKeyAuth',
|
|
8160
|
+
name: 'X-API-Key',
|
|
8161
|
+
type: 'apiKey'
|
|
8162
|
+
}],
|
|
8163
|
+
url: '/cut/v1/projects/{project_id}',
|
|
8164
|
+
...options,
|
|
8165
|
+
headers: {
|
|
8166
|
+
'Content-Type': 'application/json',
|
|
8167
|
+
...options.headers
|
|
8168
|
+
}
|
|
8169
|
+
});
|
|
8170
|
+
/**
|
|
8171
|
+
* Restore deleted project
|
|
8172
|
+
*
|
|
8173
|
+
* Return a retained deleted project to active state before its purge_time. Obtain project_id from projects.list filtered to deleted projects. This restores the project, not an older timeline revision; use versions.restore when reverting editing content.
|
|
8174
|
+
*/
|
|
8175
|
+
export const cutUndeleteProject = (options) => (options.client ?? client).post({
|
|
8176
|
+
security: [{
|
|
8177
|
+
key: 'BearerAuth',
|
|
8178
|
+
scheme: 'bearer',
|
|
8179
|
+
type: 'http'
|
|
8180
|
+
}, {
|
|
8181
|
+
key: 'ApiKeyAuth',
|
|
8182
|
+
name: 'X-API-Key',
|
|
8183
|
+
type: 'apiKey'
|
|
8184
|
+
}],
|
|
8185
|
+
url: '/cut/v1/projects/{project_id}:undelete',
|
|
8186
|
+
...options
|
|
8187
|
+
});
|
|
8188
|
+
/**
|
|
8189
|
+
* Execute editing script
|
|
8190
|
+
*
|
|
8191
|
+
* Edit the current timeline atomically using synchronous JavaScript source. Read state or timeline first, then pass its revision as expected_revision to detect concurrent changes. Unlike Shotstack, execute applies script edits to a persistent project in one transaction. Provide script or a saved edit_id with literal edits, never both; failures roll back writes. A revision conflict while preparing the response may follow a committed edit: retrieve state before retrying. Minimal script after creating a project: `const t = AddTrack("video"); Insert(t, {type: "color", color: "#123456", start: 0, length: 3}); Print(t);`
|
|
7679
8192
|
*
|
|
7680
8193
|
* <!-- cut-reference:start -->
|
|
7681
8194
|
* ### Script function, field and error reference
|
|
@@ -7758,8 +8271,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
|
|
|
7758
8271
|
* - `transform` — Position, scale, rotation, opacity, crop, blur.
|
|
7759
8272
|
* - `fit` — contain, cover, fill or none.
|
|
7760
8273
|
* - `blend` — Layer blend mode; null clears.
|
|
7761
|
-
* - `style` — Text styling: font,
|
|
7762
|
-
* - `style.
|
|
8274
|
+
* - `style` — Text styling in Shotstack's rich shape: font, gradient, stroke, shadow, box, border, align, per-word animation.
|
|
8275
|
+
* - `style.align.vertical` — top, middle or bottom; omit it, never null.
|
|
7763
8276
|
* - `playback` — Rate, direction, audio policy, or freeze.
|
|
7764
8277
|
* - `volumeDb` — Audio level in dB; 0 is source level.
|
|
7765
8278
|
* - `gain` — Keyframed audio level in dB.
|
|
@@ -7780,6 +8293,8 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
|
|
|
7780
8293
|
* - `JOIN_CONFLICT` — A join is invalid or blocks this edit.
|
|
7781
8294
|
* - `INVALID_TRANSITION` — Bad transition kind, parameter or length.
|
|
7782
8295
|
* - `INVALID_STYLE` — A style value is out of range.
|
|
8296
|
+
* - `UNSUPPORTED_STYLE_FIELD` — A Shotstack style field this platform cannot render yet.
|
|
8297
|
+
* - `STYLE_LEGACY_FIELDS` — A style written in the old flat shape; it still works.
|
|
7783
8298
|
* - `INVALID_MASK` — A mask definition is malformed.
|
|
7784
8299
|
* - `MASK_IN_USE` — The edit would break a live mask.
|
|
7785
8300
|
* - `TOO_MANY_MASKS` — At most 16 masks per project.
|
|
@@ -8807,6 +9322,20 @@ export const devopsTestReportsUpload = (options) => (options.client ?? client).p
|
|
|
8807
9322
|
...options.headers
|
|
8808
9323
|
}
|
|
8809
9324
|
});
|
|
9325
|
+
/**
|
|
9326
|
+
* Retrieve the merge gate's test plan at a commit
|
|
9327
|
+
*
|
|
9328
|
+
* Ask what the merge gate would require at one commit before running anything: the packages the base...commit diff affects, each package's input hash at that commit's own tree, and whether evidence already answers it. Read a package as passed when a recorded run covered every case the package has at the gate's sizes and they passed, failed when the newest evidence at its input hash failed, and missing when no run has a row for that (package, input hash). Use it before running tests — `praxis devops test --gate` asks this and runs exactly the missing and failed packages — or to explain a gate verdict, because it is the same required set and the same (package, input hash) lookup the gate itself decides on. The call is read-only: it starts no run, runs no case and writes nothing. The commit must already be pushed, since the hashes are recomputed from the tree GitHub holds; a commit whose tree cannot be read answers COMMIT_NOT_FOUND instead of an empty plan. A selection of nothing means every changed path belongs to no test package, which is a pass and not a failure.
|
|
9329
|
+
*/
|
|
9330
|
+
export const devopsTestPlanGet = (options) => (options.client ?? client).get({
|
|
9331
|
+
security: [{
|
|
9332
|
+
key: 'devops-bearerAuth',
|
|
9333
|
+
scheme: 'bearer',
|
|
9334
|
+
type: 'http'
|
|
9335
|
+
}],
|
|
9336
|
+
url: '/devops/v1/projects/{project}/test-plan',
|
|
9337
|
+
...options
|
|
9338
|
+
});
|
|
8810
9339
|
/**
|
|
8811
9340
|
* List projects
|
|
8812
9341
|
*
|
|
@@ -9500,7 +10029,7 @@ export const devopsChangesGet = (options) => (options.client ?? client).get({
|
|
|
9500
10029
|
/**
|
|
9501
10030
|
* Abandon a change
|
|
9502
10031
|
*
|
|
9503
|
-
* Stop a change for good: it no longer moves forward and its stage becomes abandoned. reason is required and is kept with the change. Pull requests that were already merged are not undone — the system cleans them up, or a new change reverts them — so abandoning is a statement about the change, not a rollback of code. The id is the branch name and its slash must be percent-encoded in the path (feat%2Frun-page-v2).
|
|
10032
|
+
* Stop a change for good: it no longer moves forward and its stage becomes abandoned. reason is required and is kept with the change. Pull requests it has not merged are closed with it: each one is closed on GitHub with a note naming the change and this reason, so an abandoned change never leaves an open pull request behind for someone else to clean up — a change with no open pull request makes no GitHub call at all. That close happens BEFORE the change is marked, so an abandon that cannot close them is refused with GITHUB_UNAVAILABLE and nothing has changed; send it again. Pull requests that were already merged are not undone — the system cleans them up, or a new change reverts them — so abandoning is a statement about the change, not a rollback of code. The id is the branch name and its slash must be percent-encoded in the path (feat%2Frun-page-v2). Repeating the call on a change that is already abandoned answers the change as it stands instead of refusing it: the first abandon is the fact, and a caller that lost the answer gets it back.
|
|
9504
10033
|
*/
|
|
9505
10034
|
export const devopsChangesAbandon = (options) => (options.client ?? client).post({
|
|
9506
10035
|
security: [{
|
|
@@ -9533,6 +10062,38 @@ export const devopsChangesMarkLastSlice = (options) => (options.client ?? client
|
|
|
9533
10062
|
...options.headers
|
|
9534
10063
|
}
|
|
9535
10064
|
});
|
|
10065
|
+
/**
|
|
10066
|
+
* Open a change's pull request
|
|
10067
|
+
*
|
|
10068
|
+
* Open the pull request for a change: its branch into the project's default branch, opened by DevOps's own GitHub App. A cloud workspace holds no GitHub credential, so this is how work pushed with the unit push becomes a pull request; `praxis devops change pr` calls it from the workspace. Push first: a branch with no commits beyond the default branch is refused with PULL_REQUEST_REFUSED and GitHub's words. A branch that already has an open pull request answers that one with created=false, so calling again is safe; when the call passes a title or a body, those fields are written onto that pull request (GitHub PATCH /pulls/{number}) and the answer says updated=true, while a field not passed is left as it is — which is how a wrong or missing description is corrected, and how the merge gate's exposure-declared check is re-evaluated from the new body. Only an open pull request can be rewritten: once it is merged or closed its head branch is usually deleted with it, so a call that names a title or a body is refused with PULL_REQUEST_NOT_OPEN, naming that pull request and the branch, instead of trying to open a second one. The pull request then appears on the change and runs its merge gate as usual. The id is the branch name; give it as it comes back (fix/expired-links) — the SDK and the CLI encode the slash themselves, and only a hand-written HTTP request sends fix%2Fexpired-links.
|
|
10069
|
+
*/
|
|
10070
|
+
export const devopsChangesOpenPullRequest = (options) => (options.client ?? client).post({
|
|
10071
|
+
security: [{
|
|
10072
|
+
key: 'devops-bearerAuth',
|
|
10073
|
+
scheme: 'bearer',
|
|
10074
|
+
type: 'http'
|
|
10075
|
+
}],
|
|
10076
|
+
url: '/devops/v1/changes/{id}:openPullRequest',
|
|
10077
|
+
...options,
|
|
10078
|
+
headers: {
|
|
10079
|
+
'Content-Type': 'application/json',
|
|
10080
|
+
...options.headers
|
|
10081
|
+
}
|
|
10082
|
+
});
|
|
10083
|
+
/**
|
|
10084
|
+
* Get a change workspace's read-only git credential
|
|
10085
|
+
*
|
|
10086
|
+
* A read-only git credential for the repository a change's project is bound to: a GitHub App installation token limited to that one repository with contents read, which GitHub expires within an hour. It exists for git's credential helper inside the change's cloud workspace (`praxis devops change git-credential`, installed by DevOps when it clones the repository), so `git fetch`, history and lazily fetched file contents work there; the helper hands the token to that one git request and keeps nothing. Writing is never possible with it: commits reach the branch only through the unit push. You do not need to call this yourself. Anyone who can read the change can read its repository already through the code reads, so this grants no new access. An abandoned change is refused with INVALID_ARGUMENT and a project without a repository with SOURCE_NOT_CONFIGURED. The id is the branch name and its slash must be percent-encoded in the path (fix%2Fexpired-links).
|
|
10087
|
+
*/
|
|
10088
|
+
export const devopsChangesGitCredential = (options) => (options.client ?? client).post({
|
|
10089
|
+
security: [{
|
|
10090
|
+
key: 'devops-bearerAuth',
|
|
10091
|
+
scheme: 'bearer',
|
|
10092
|
+
type: 'http'
|
|
10093
|
+
}],
|
|
10094
|
+
url: '/devops/v1/changes/{id}:gitCredential',
|
|
10095
|
+
...options
|
|
10096
|
+
});
|
|
9536
10097
|
/**
|
|
9537
10098
|
* List a project's pull requests
|
|
9538
10099
|
*
|
|
@@ -9611,6 +10172,24 @@ export const devopsPullRequestsRecordVerdict = (options) => (options.client ?? c
|
|
|
9611
10172
|
...options.headers
|
|
9612
10173
|
}
|
|
9613
10174
|
});
|
|
10175
|
+
/**
|
|
10176
|
+
* Close a pull request without merging it
|
|
10177
|
+
*
|
|
10178
|
+
* End a pull request that will never land, without abandoning the change it belongs to. DevOps closes it on GitHub through the project's own App installation, after writing this reason on the pull request, so it leaves the review queue instead of waiting for a merge that is not coming and whoever finds it later sees who ended it and why. Use it when one slice of a change is dropped while the change continues; abandoning the CHANGE closes its unmerged pull requests on its own and needs no second call. Only an open pull request can be closed: a merged one is refused with PULL_REQUEST_NOT_OPEN, because closing does not undo a merge and GitHub will not move a merged pull request back to closed, and one that is already closed answers itself unchanged, so repeating the call is safe. A pull request GitHub no longer has open is refused the same way — nothing was closed, and the platform's record catches up with GitHub on its next delivery.
|
|
10179
|
+
*/
|
|
10180
|
+
export const devopsPullRequestsClose = (options) => (options.client ?? client).post({
|
|
10181
|
+
security: [{
|
|
10182
|
+
key: 'devops-bearerAuth',
|
|
10183
|
+
scheme: 'bearer',
|
|
10184
|
+
type: 'http'
|
|
10185
|
+
}],
|
|
10186
|
+
url: '/devops/v1/pull-requests/{id}:close',
|
|
10187
|
+
...options,
|
|
10188
|
+
headers: {
|
|
10189
|
+
'Content-Type': 'application/json',
|
|
10190
|
+
...options.headers
|
|
10191
|
+
}
|
|
10192
|
+
});
|
|
9614
10193
|
/**
|
|
9615
10194
|
* List connections
|
|
9616
10195
|
*
|
|
@@ -10702,7 +11281,7 @@ export const mediaBatchAssets = (options) => (options.client ?? client).post({
|
|
|
10702
11281
|
/**
|
|
10703
11282
|
* Get job
|
|
10704
11283
|
*
|
|
10705
|
-
* Read
|
|
11284
|
+
* Read a generation, edit or batch Job; poll it after every generation or edit until status is terminal, every few seconds (an image takes seconds, a video a few minutes; an edit of a video took about four). status: queued is waiting (queue_reason says why, queue_position its place in line; provider_queue means the model’s supplier holds the task in its own queue, which can take hours when it is busy — the job keeps waiting for as long as the supplier keeps the task, and only past the supplier’s own task lifetime fails with detail_code UPSTREAM_WAIT_EXCEEDED, uncharged); in_progress or running is generating; completed means every output succeeded; completed_with_errors means some did; failed means none did; canceled or cancelled means it was stopped. Read the result output by output. A succeeded entry of outputs[] has asset_id and viewer_url, because the output is already a library asset: give viewer_url to the person. Its seed is present only when the model reports one (Doubao Seedance 2.x neither takes nor reports a seed); where present, send it back as seed with an adjusted prompt to vary that take. A failed entry has its reason in the failures[] entry with the same index: code is the error to branch on, for example CONTENT_REJECTED when the model's moderation refused an input or the result (a real human face in a reference is one cause; change the prompt or the reference, because retrying unchanged fails again) or GENERATION_FAILED when the model call failed (retrying may succeed); detail_code is the model's finer reason and model_request_id the model call to trace. usage is what the job has cost so far and is final at a terminal status; failed and refused outputs are not charged, so usage counts succeeded outputs only, and it is absent when nothing was charged.
|
|
10706
11285
|
*/
|
|
10707
11286
|
export const mediaGetJob = (options) => (options.client ?? client).get({
|
|
10708
11287
|
security: [{
|
|
@@ -10794,7 +11373,7 @@ export const mediaGetAssetLineage = (options) => (options.client ?? client).get(
|
|
|
10794
11373
|
/**
|
|
10795
11374
|
* Generate image
|
|
10796
11375
|
*
|
|
10797
|
-
* Generate
|
|
11376
|
+
* Generate images into a library from a prompt, optionally guided by existing pictures. {library_id} also accepts default, the organization’s default library. prompt is required; n (1 to 10), size, background, output_format, output, references, seed, model, asset_folder and understanding are optional. Name size, not an aspect ratio. Set output to sticker for a cut-out with a transparent background. references attach pictures of the same library with a role: subject keeps a person, product or scene consistent (several subjects put several characters in one picture), edit_target is the picture to change, style is the look to follow, structure the composition. Only a model whose modes in GET /media/v1/generation/capabilities include image takes references; any other answers INVALID_PARAMS naming the models that do, and a role a model cannot honour answers REFERENCE_TYPE_MISMATCH, both before anything is charged. A reference may be an element id (a character, product, scene or brand from the materials endpoints), which expands into its pictures and appends its description to the prompt. To draw several candidates of one key frame, send n and keep the ones you want; delete the rest. Charges are per image at the model API prices and appear in the Job’s usage; a refused or failed image costs nothing. The response is 202 with a queued Job; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} for each output’s asset and viewer_url, give viewer_url to the person and tell them usage. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice.
|
|
10798
11377
|
*/
|
|
10799
11378
|
export const mediaGenerateImage = (options) => (options.client ?? client).post({
|
|
10800
11379
|
security: [{
|
|
@@ -10812,7 +11391,7 @@ export const mediaGenerateImage = (options) => (options.client ?? client).post({
|
|
|
10812
11391
|
/**
|
|
10813
11392
|
* Generate video
|
|
10814
11393
|
*
|
|
10815
|
-
* Generate
|
|
11394
|
+
* Generate videos into a library: from a prompt, from frames, from reference pictures or videos, or by editing an existing video. {library_id} also accepts default, the organization’s default library. mode picks the anchor: text (prompt only); image (animates first_frame); first_last (between first_frame and last_frame); reference (1 to 9 references: pictures with role subject or style keep a person, product or look consistent, and video assets with role video give the camera and motion to follow; an element id expands into its pictures and description); edit (keeps the video named by source, at least 4 s, and changes what the prompt says, such as replacing its person with a subject picture; the output is as long as the source). Frames and references are assets of the same library; in the prompt call them @video1 and @image1, @image2… in request order. Read GET /media/v1/generation/capabilities first: a model takes only the modes it lists. To draw several takes of one shot and keep the best, send n (1 to 4); 480p is the cheapest way to compare takes. Charges are per output second at the model API prices and appear in the Job’s usage; a job with an input video is metered on input plus output seconds, so it costs more than the output length suggests (a 5 s edit of a 5 s source bills about 6 s); a refused or failed output costs nothing, and so does a request refused before the job starts. A real human face in a source or reference is refused by the model with CONTENT_REJECTED. Refused before any charge: output gif (OPERATION_NOT_SUPPORTED), negative_prompt, references outside reference and edit, and an unknown mode. The response is 202 with a queued Job; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} for each output’s asset and viewer_url, give viewer_url to the person and tell them usage. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice.
|
|
10816
11395
|
*/
|
|
10817
11396
|
export const mediaGenerateVideo = (options) => (options.client ?? client).post({
|
|
10818
11397
|
security: [{
|
|
@@ -10830,7 +11409,7 @@ export const mediaGenerateVideo = (options) => (options.client ?? client).post({
|
|
|
10830
11409
|
/**
|
|
10831
11410
|
* Edit asset
|
|
10832
11411
|
*
|
|
10833
|
-
*
|
|
11412
|
+
* Change an existing asset and store the result as a new asset; the source is never overwritten. {library_id} also accepts default, the organization’s default library. The body is operation (its type selects the edit and carries that edit’s own fields) plus optional model, asset_folder, understanding and idempotency_key. Edits by material: on an image, variations (near copies of a take you like), inpaint (mask, a PNG File id beginning with file-, whose transparent area is replaced by what prompt describes), erase, replace_object, recolor, replace_background, remove_background, upscale and talking_avatar (the portrait speaks a recording of the same library); on a video, upscale, reframe, redact, trim, mute, crop, extract_audio (pulls the sound out of a video as its own audio asset), erase (removes burned-in subtitles, captions and corner watermarks, found automatically or inside the boxes given), replace_person (puts the person of an image of the same library in place of the video’s person), lip_sync (re-syncs the lips to a recording of the same library), animate_person (an image of the same library performs the video’s motion), edit_video (the video changed by a one-line instruction, optionally guided by one image of the same library) and remove_background; on a recording or a video’s audio, enhance_voice; and to_video, frame and resynthesize on the material each takes. Any other type answers OPERATION_NOT_SUPPORTED, and an edit that does not fit the source’s material answers REFERENCE_TYPE_MISMATCH. Video and audio edits take their model from the platform catalogue (override with operation.model; extract_audio takes no model, it has exactly one function); an edit whose catalogue is empty answers OPERATION_NOT_SUPPORTED, 尚未上架. remove_background on a video makes a portrait matte: output mask is a small black-and-white video to use as a Cut track mask (the choice for compositing), output alpha (the default) a transparent ProRes 4444 file of about 870 MB per 15 s of 1080p, for when the transparent file itself is the deliverable; pick model from types.matting.models of the generation capabilities. output and model on an image source answer INVALID_PARAMS. The new asset records the source in derived_from; assets.lineage reads the whole edit chain. Charges are at the model API prices (video and audio edits per second of input) and appear in the Job’s usage; repeating the same edit of the same source answers the asset already made instead of paying again. The response is 202 with a queued Job whose source_asset_id is the edited asset; poll GET /media/v1/libraries/{library_id}/jobs/{job_id}, give the output’s viewer_url to the person and tell them usage.
|
|
10834
11413
|
*/
|
|
10835
11414
|
export const mediaEditAsset = (options) => (options.client ?? client).post({
|
|
10836
11415
|
security: [{
|
|
@@ -10944,7 +11523,7 @@ export const mediaListUnderstandingsByLibrary = (options) => (options.client ??
|
|
|
10944
11523
|
/**
|
|
10945
11524
|
* List jobs
|
|
10946
11525
|
*
|
|
10947
|
-
* List batch and generation jobs
|
|
11526
|
+
* List the batch and generation jobs of a library, newest first, to find a job whose id you lost or to watch several takes at once. Filter by status or by pipeline_run_id (the jobs one automation run started) and continue with next_cursor. Each entry is the same Job that GET /media/v1/libraries/{library_id}/jobs/{job_id} returns, with outputs, failures and usage.
|
|
10948
11527
|
*/
|
|
10949
11528
|
export const mediaListJobs = (options) => (options.client ?? client).get({
|
|
10950
11529
|
security: [{
|
|
@@ -10958,7 +11537,7 @@ export const mediaListJobs = (options) => (options.client ?? client).get({
|
|
|
10958
11537
|
/**
|
|
10959
11538
|
* Cancel job
|
|
10960
11539
|
*
|
|
10961
|
-
*
|
|
11540
|
+
* Stop a generation job you no longer need, for example after the first takes of a draw show the prompt is wrong. Outputs that are queued are cancelled and never charged; outputs already produced stay in the library and stay charged. A video cannot be stopped once the provider has started generating it: the call answers 409 JOB_INVALID_STATE (details VIDEO_ALREADY_RUNNING), and that output still finishes, is saved to the library and is charged. Read the returned Job, or poll it, to see which outputs ended.
|
|
10962
11541
|
*/
|
|
10963
11542
|
export const mediaCancelJob = (options) => (options.client ?? client).post({
|
|
10964
11543
|
security: [{
|
|
@@ -11001,6 +11580,74 @@ export const mediaAlignAsset = (options) => (options.client ?? client).post({
|
|
|
11001
11580
|
...options.headers
|
|
11002
11581
|
}
|
|
11003
11582
|
});
|
|
11583
|
+
/**
|
|
11584
|
+
* Get HLS renditions
|
|
11585
|
+
*
|
|
11586
|
+
* Read how ready a video asset’s on-demand ladder is, rung by rung, without building anything. Use library_id and asset_id as everywhere else. The answer names the asset, its current version, the asset’s own facts (resource_type, is_audio and duration) and one entry per recorded rung — name, height, the first indexed piece’s width, the rung’s bitrate and stored bytes, and its state (processing while pieces run, ready when every piece is ready, failed when a piece gave up). A ladder that was never requested, and an asset that is not a video, answer an empty renditions rather than an error. This read mints no capability and signs nothing, so play the ladder through the content service, which issues the short-lived play address for the current version. Example: GET /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/hls.
|
|
11587
|
+
*/
|
|
11588
|
+
export const mediaGetHlsRenditions = (options) => (options.client ?? client).get({
|
|
11589
|
+
security: [{
|
|
11590
|
+
key: 'media-BearerAuth',
|
|
11591
|
+
scheme: 'bearer',
|
|
11592
|
+
type: 'http'
|
|
11593
|
+
}],
|
|
11594
|
+
url: '/media/v1/libraries/{library_id}/assets/{asset_id}/hls',
|
|
11595
|
+
...options
|
|
11596
|
+
});
|
|
11597
|
+
/**
|
|
11598
|
+
* Request HLS renditions
|
|
11599
|
+
*
|
|
11600
|
+
* Build a video asset’s adaptive HLS ladder for its current version, so one asset plays at several clarities on an ordinary player. Use library_id from creation or listing and the asset_id of a video asset; the ladder belongs to the version the asset has now, and a later version gets its own. heights names the rungs to build: a non-empty subset of 480, 720 and 1080 with no repeats, or omitted to build all three. The ladder never upscales — a rung above the source’s short side is dropped, and a list entirely above it keeps its lowest rung. The call is asynchronous and starts paid transcoding: the work runs as the video-transcode-hls model, one piece per rung per ten minutes of source, and it is charged per output minute at that model’s published price to the organization that owns the asset (ADR-146 §5) — a rung the source cannot carry, and a failed rung, are not charged. A source longer than eight hours (28800 seconds) is refused with SOURCE_TOO_LONG before anything is planned. Repeating the call is safe: a rung already processing, ready or failed is left as it is and is never encoded twice. The response is 202 with the asset_id, its current version and one entry per rung — name, height, width, bitrate, bytes and state, where processing means the rung is still being encoded, ready means it plays and failed means it gave up and can be retried by asking again. Poll GET /media/v1/libraries/{library_id}/assets/{asset_id}/hls until every rung is ready, then play the ladder through the content service, which mints the short-lived play address. Example: POST /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/hls with {"heights":[480,720,1080]}.
|
|
11601
|
+
*/
|
|
11602
|
+
export const mediaRequestHlsRenditions = (options) => (options.client ?? client).post({
|
|
11603
|
+
security: [{
|
|
11604
|
+
key: 'media-BearerAuth',
|
|
11605
|
+
scheme: 'bearer',
|
|
11606
|
+
type: 'http'
|
|
11607
|
+
}],
|
|
11608
|
+
url: '/media/v1/libraries/{library_id}/assets/{asset_id}/hls',
|
|
11609
|
+
...options,
|
|
11610
|
+
headers: {
|
|
11611
|
+
'Content-Type': 'application/json',
|
|
11612
|
+
...options.headers
|
|
11613
|
+
}
|
|
11614
|
+
});
|
|
11615
|
+
/**
|
|
11616
|
+
* Create voice
|
|
11617
|
+
*
|
|
11618
|
+
* Create a voice for this library. Send exactly one of the two shapes: consent_id with samples (a real person’s recordings, a consented voice, cloned before it can speak) or design_asset_id (a preview the voice-design run produced in this library, a generated voice). A generated voice is not cloned: it is ready when the call answers, its job already completed, and it speaks only through the speech model recorded on it, so speech naming another model is refused with INVALID_PARAMS. Each preview builds at most one voice, and building one gives back the design’s other previews, which then cannot be used. Sending both shapes, or neither, is refused with INVALID_PARAMS, and origin is written by the platform only. Answers 202 with a job.
|
|
11619
|
+
*/
|
|
11620
|
+
export const mediaCreateVoice = (options) => (options.client ?? client).post({
|
|
11621
|
+
security: [{
|
|
11622
|
+
key: 'media-BearerAuth',
|
|
11623
|
+
scheme: 'bearer',
|
|
11624
|
+
type: 'http'
|
|
11625
|
+
}],
|
|
11626
|
+
url: '/media/v1/libraries/{library_id}/voices',
|
|
11627
|
+
...options,
|
|
11628
|
+
headers: {
|
|
11629
|
+
'Content-Type': 'application/json',
|
|
11630
|
+
...options.headers
|
|
11631
|
+
}
|
|
11632
|
+
});
|
|
11633
|
+
/**
|
|
11634
|
+
* Design a voice
|
|
11635
|
+
*
|
|
11636
|
+
* Design a voice from a text description. The model makes count preview recordings (default 3), each stored in this library as an audio asset; listen, then create a voice whose design_asset_id names the preview you chose. Send description (1 to 500 characters), preview_text (15 to 200 characters, the line each preview speaks), language (zh or en) and optionally count (1 to 3). A description that fails review fails the slot with CONTENT_REJECTED and is never retried, so changing the words is the fix. Answers 202 with a job to poll.
|
|
11637
|
+
*/
|
|
11638
|
+
export const mediaDesignVoice = (options) => (options.client ?? client).post({
|
|
11639
|
+
security: [{
|
|
11640
|
+
key: 'media-BearerAuth',
|
|
11641
|
+
scheme: 'bearer',
|
|
11642
|
+
type: 'http'
|
|
11643
|
+
}],
|
|
11644
|
+
url: '/media/v1/libraries/{library_id}/voices/designs',
|
|
11645
|
+
...options,
|
|
11646
|
+
headers: {
|
|
11647
|
+
'Content-Type': 'application/json',
|
|
11648
|
+
...options.headers
|
|
11649
|
+
}
|
|
11650
|
+
});
|
|
11004
11651
|
/**
|
|
11005
11652
|
* List types
|
|
11006
11653
|
*
|
|
@@ -11243,6 +11890,340 @@ export const ontologySearch = (options) => (options.client ?? client).post({
|
|
|
11243
11890
|
...options.headers
|
|
11244
11891
|
}
|
|
11245
11892
|
});
|
|
11893
|
+
/**
|
|
11894
|
+
* List repositories
|
|
11895
|
+
*
|
|
11896
|
+
* 列出这个组织现有的库,默认库也在其中。库很少,一页通常装得下;用 next_cursor 翻页。先在这里拿到 repository_id,再用它列出或发布包。
|
|
11897
|
+
*/
|
|
11898
|
+
export const registryRepositoriesList = (options) => (options?.client ?? client).get({
|
|
11899
|
+
security: [{
|
|
11900
|
+
key: 'registry-bearerAuth',
|
|
11901
|
+
scheme: 'bearer',
|
|
11902
|
+
type: 'http'
|
|
11903
|
+
}],
|
|
11904
|
+
url: '/registry/v1/repositories',
|
|
11905
|
+
...options
|
|
11906
|
+
});
|
|
11907
|
+
/**
|
|
11908
|
+
* Create repository
|
|
11909
|
+
*
|
|
11910
|
+
* 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。
|
|
11911
|
+
*/
|
|
11912
|
+
export const registryRepositoriesCreate = (options) => (options.client ?? client).post({
|
|
11913
|
+
security: [{
|
|
11914
|
+
key: 'registry-bearerAuth',
|
|
11915
|
+
scheme: 'bearer',
|
|
11916
|
+
type: 'http'
|
|
11917
|
+
}],
|
|
11918
|
+
url: '/registry/v1/repositories',
|
|
11919
|
+
...options,
|
|
11920
|
+
headers: {
|
|
11921
|
+
'Content-Type': 'application/json',
|
|
11922
|
+
...options.headers
|
|
11923
|
+
}
|
|
11924
|
+
});
|
|
11925
|
+
/**
|
|
11926
|
+
* Delete repository
|
|
11927
|
+
*
|
|
11928
|
+
* 删一个空的库。默认库不能删(FAILED_PRECONDITION);库里还有包时也不能删,先把包删掉或改用别的库。删除请求重发会 404,所以删除前先读一次确认。
|
|
11929
|
+
*/
|
|
11930
|
+
export const registryRepositoriesDelete = (options) => (options.client ?? client).delete({
|
|
11931
|
+
security: [{
|
|
11932
|
+
key: 'registry-bearerAuth',
|
|
11933
|
+
scheme: 'bearer',
|
|
11934
|
+
type: 'http'
|
|
11935
|
+
}],
|
|
11936
|
+
url: '/registry/v1/repositories/{repository_id}',
|
|
11937
|
+
...options
|
|
11938
|
+
});
|
|
11939
|
+
/**
|
|
11940
|
+
* Retrieve repository
|
|
11941
|
+
*
|
|
11942
|
+
* 读一个库的名称、说明、包数量和默认标记。repository_id 来自 repositories.list 或 repositories.create;另一个组织的库或不存在的库一律 404,不区分两者。
|
|
11943
|
+
*/
|
|
11944
|
+
export const registryRepositoriesRetrieve = (options) => (options.client ?? client).get({
|
|
11945
|
+
security: [{
|
|
11946
|
+
key: 'registry-bearerAuth',
|
|
11947
|
+
scheme: 'bearer',
|
|
11948
|
+
type: 'http'
|
|
11949
|
+
}],
|
|
11950
|
+
url: '/registry/v1/repositories/{repository_id}',
|
|
11951
|
+
...options
|
|
11952
|
+
});
|
|
11953
|
+
/**
|
|
11954
|
+
* Update repository
|
|
11955
|
+
*
|
|
11956
|
+
* 改库的 display_name 或 description。只送要改的字段,省略的保持原值;name 建库之后不能改,它标识库。一个字段都不送会 400。
|
|
11957
|
+
*/
|
|
11958
|
+
export const registryRepositoriesUpdate = (options) => (options.client ?? client).patch({
|
|
11959
|
+
security: [{
|
|
11960
|
+
key: 'registry-bearerAuth',
|
|
11961
|
+
scheme: 'bearer',
|
|
11962
|
+
type: 'http'
|
|
11963
|
+
}],
|
|
11964
|
+
url: '/registry/v1/repositories/{repository_id}',
|
|
11965
|
+
...options,
|
|
11966
|
+
headers: {
|
|
11967
|
+
'Content-Type': 'application/json',
|
|
11968
|
+
...options.headers
|
|
11969
|
+
}
|
|
11970
|
+
});
|
|
11971
|
+
/**
|
|
11972
|
+
* List packages
|
|
11973
|
+
*
|
|
11974
|
+
* 列出一个库里的包,可按种类筛、按名字搜、按最近更新或下载量排序。kind=skill 只看技能,kind=plugin 只看插件,省略则两类都返回。q 在 name、title 和 description 上做子串匹配。sort 默认 updated;downloads 按累计下载量降序,用来找这个库最常用的资源。
|
|
11975
|
+
*/
|
|
11976
|
+
export const registryRepositoriesPackagesList = (options) => (options.client ?? client).get({
|
|
11977
|
+
security: [{
|
|
11978
|
+
key: 'registry-bearerAuth',
|
|
11979
|
+
scheme: 'bearer',
|
|
11980
|
+
type: 'http'
|
|
11981
|
+
}],
|
|
11982
|
+
url: '/registry/v1/repositories/{repository_id}/packages',
|
|
11983
|
+
...options
|
|
11984
|
+
});
|
|
11985
|
+
/**
|
|
11986
|
+
* Publish a package
|
|
11987
|
+
*
|
|
11988
|
+
* 把一个新包发布进这个库,一次调用建立包并上传它的第一个版本。发布内容是 multipart:version 必填,archive 给一个 zip,或者 files 给一组文件(每个文件的 filename 是相对上传根的路径,例如 pdf/SKILL.md)。单个顶层目录会被剥掉。种类按根上有什么判:有 SKILL.md 就是 skill,有 .claude-plugin/plugin.json 就是 plugin;两者都没有、或都有,会被拒。名字从 SKILL.md 或 plugin.json 里读,不从路径或 query 猜。限额:上传 ≤25 MiB,解压后 ≤50 MiB,≤1000 个文件。版本必须是 semver 且严格递增;第一个版本可以是任意合法 semver,之后每个新版本都要比已发布的最高版本高。把已有智能体的技能搬过来时,先用 GET /agent/v1/skills/{id}/versions/{v}/content 导出 zip,再在这里作为 archive 发布。
|
|
11989
|
+
*/
|
|
11990
|
+
export const registryRepositoriesPackagesCreate = (options) => (options.client ?? client).post({
|
|
11991
|
+
...formDataBodySerializer,
|
|
11992
|
+
security: [{
|
|
11993
|
+
key: 'registry-bearerAuth',
|
|
11994
|
+
scheme: 'bearer',
|
|
11995
|
+
type: 'http'
|
|
11996
|
+
}],
|
|
11997
|
+
url: '/registry/v1/repositories/{repository_id}/packages',
|
|
11998
|
+
...options,
|
|
11999
|
+
headers: {
|
|
12000
|
+
'Content-Type': null,
|
|
12001
|
+
...options.headers
|
|
12002
|
+
}
|
|
12003
|
+
});
|
|
12004
|
+
/**
|
|
12005
|
+
* Retrieve package
|
|
12006
|
+
*
|
|
12007
|
+
* 读一个包的元数据:种类、所属库、当前 latest_version、作者、标签和累计下载量。package_id 来自 packages.list 或 packages.create;另一个组织或不存在都返回 404。软删期间这个包一律 404,恢复后才重新出现。
|
|
12008
|
+
*/
|
|
12009
|
+
export const registryPackagesRetrieve = (options) => (options.client ?? client).get({
|
|
12010
|
+
security: [{
|
|
12011
|
+
key: 'registry-bearerAuth',
|
|
12012
|
+
scheme: 'bearer',
|
|
12013
|
+
type: 'http'
|
|
12014
|
+
}],
|
|
12015
|
+
url: '/registry/v1/packages/{package_id}',
|
|
12016
|
+
...options
|
|
12017
|
+
});
|
|
12018
|
+
/**
|
|
12019
|
+
* List versions
|
|
12020
|
+
*
|
|
12021
|
+
* 列出一个包的所有版本,含已撤回的。撤回的版本仍在列表里(它占着版本号),withdrawn 为 true,并带 withdraw_time。按发布顺序返回。
|
|
12022
|
+
*/
|
|
12023
|
+
export const registryPackagesVersionsList = (options) => (options.client ?? client).get({
|
|
12024
|
+
security: [{
|
|
12025
|
+
key: 'registry-bearerAuth',
|
|
12026
|
+
scheme: 'bearer',
|
|
12027
|
+
type: 'http'
|
|
12028
|
+
}],
|
|
12029
|
+
url: '/registry/v1/packages/{package_id}/versions',
|
|
12030
|
+
...options
|
|
12031
|
+
});
|
|
12032
|
+
/**
|
|
12033
|
+
* Publish a version
|
|
12034
|
+
*
|
|
12035
|
+
* 给一个已有的包发新版本。请求体与 packages.create 相同(multipart:version 必填,archive 或 files 给内容),但种类和名字沿用这个包,不再从上传内容重判。version 必须比已发布的最高版本高(撤回的版本也占号,不能复用);比它低或相等返回 FAILED_PRECONDITION。title、description、tags 不填就沿用这个包现在显示的,不会被新版本里 SKILL.md 或 plugin.json 的描述覆盖;要改就在这次请求里给。作者不随新版本改变。
|
|
12036
|
+
*/
|
|
12037
|
+
export const registryPackagesVersionsCreate = (options) => (options.client ?? client).post({
|
|
12038
|
+
...formDataBodySerializer,
|
|
12039
|
+
security: [{
|
|
12040
|
+
key: 'registry-bearerAuth',
|
|
12041
|
+
scheme: 'bearer',
|
|
12042
|
+
type: 'http'
|
|
12043
|
+
}],
|
|
12044
|
+
url: '/registry/v1/packages/{package_id}/versions',
|
|
12045
|
+
...options,
|
|
12046
|
+
headers: {
|
|
12047
|
+
'Content-Type': null,
|
|
12048
|
+
...options.headers
|
|
12049
|
+
}
|
|
12050
|
+
});
|
|
12051
|
+
/**
|
|
12052
|
+
* List commits
|
|
12053
|
+
*
|
|
12054
|
+
* 列出一个 git 包的提交历史,最新的在前。ref 不给就是包的默认分支;limit 与 offset 分页,has_more 为 true 表示还有下一页。只读:提交只能通过 git 协议推送(clone 地址在包的 clone_url)。OCI 包没有 git 读接口,返回 404。
|
|
12055
|
+
*/
|
|
12056
|
+
export const registryGitLog = (options) => (options.client ?? client).get({
|
|
12057
|
+
security: [{
|
|
12058
|
+
key: 'registry-bearerAuth',
|
|
12059
|
+
scheme: 'bearer',
|
|
12060
|
+
type: 'http'
|
|
12061
|
+
}],
|
|
12062
|
+
url: '/registry/v1/packages/{package_id}/git/log',
|
|
12063
|
+
...options
|
|
12064
|
+
});
|
|
12065
|
+
/**
|
|
12066
|
+
* Read a commit
|
|
12067
|
+
*
|
|
12068
|
+
* 按对象 id 读一个提交(完整 sha,不解析缩写)。返回提交信息、作者、提交时间与父提交。仓库里没有这个对象返回 404。
|
|
12069
|
+
*/
|
|
12070
|
+
export const registryGitCommitsRetrieve = (options) => (options.client ?? client).get({
|
|
12071
|
+
security: [{
|
|
12072
|
+
key: 'registry-bearerAuth',
|
|
12073
|
+
scheme: 'bearer',
|
|
12074
|
+
type: 'http'
|
|
12075
|
+
}],
|
|
12076
|
+
url: '/registry/v1/packages/{package_id}/git/commits/{sha}',
|
|
12077
|
+
...options
|
|
12078
|
+
});
|
|
12079
|
+
/**
|
|
12080
|
+
* List a tree
|
|
12081
|
+
*
|
|
12082
|
+
* 读一个树对象(或一个提交的根树)的条目:名字、类型(blob / tree / commit)、模式、对象 id,以及已知时的大小。只列这一层,不递归。
|
|
12083
|
+
*/
|
|
12084
|
+
export const registryGitTreesRetrieve = (options) => (options.client ?? client).get({
|
|
12085
|
+
security: [{
|
|
12086
|
+
key: 'registry-bearerAuth',
|
|
12087
|
+
scheme: 'bearer',
|
|
12088
|
+
type: 'http'
|
|
12089
|
+
}],
|
|
12090
|
+
url: '/registry/v1/packages/{package_id}/git/trees/{sha}',
|
|
12091
|
+
...options
|
|
12092
|
+
});
|
|
12093
|
+
/**
|
|
12094
|
+
* Download a file from a ref
|
|
12095
|
+
*
|
|
12096
|
+
* 按引用读一个文件的原始字节,边读边发(流式),没有大小上限。path 是仓库内相对路径,可以含斜杠;ref 不给就是默认分支。路径不是文件或引用不存在返回 404。
|
|
12097
|
+
*/
|
|
12098
|
+
export const registryGitFilesRetrieve = (options) => (options.client ?? client).get({
|
|
12099
|
+
security: [{
|
|
12100
|
+
key: 'registry-bearerAuth',
|
|
12101
|
+
scheme: 'bearer',
|
|
12102
|
+
type: 'http'
|
|
12103
|
+
}],
|
|
12104
|
+
url: '/registry/v1/packages/{package_id}/git/files/{path}',
|
|
12105
|
+
...options
|
|
12106
|
+
});
|
|
12107
|
+
/**
|
|
12108
|
+
* List version contents
|
|
12109
|
+
*
|
|
12110
|
+
* 列出一个版本解压后的文件清单(路径和大小),用来在不下载整个包的前提下看它包含什么。路径是相对包根的,例如 SKILL.md 或 plugin/skills/review.md。已撤回的版本仍可读清单。
|
|
12111
|
+
*/
|
|
12112
|
+
export const registryPackagesVersionsContents = (options) => (options.client ?? client).get({
|
|
12113
|
+
security: [{
|
|
12114
|
+
key: 'registry-bearerAuth',
|
|
12115
|
+
scheme: 'bearer',
|
|
12116
|
+
type: 'http'
|
|
12117
|
+
}],
|
|
12118
|
+
url: '/registry/v1/packages/{package_id}/versions/{version}/contents',
|
|
12119
|
+
...options
|
|
12120
|
+
});
|
|
12121
|
+
/**
|
|
12122
|
+
* Download a file
|
|
12123
|
+
*
|
|
12124
|
+
* 下载一个版本里的单个文件,返回原始字节。path 是 contents 给出的路径,可以含斜杠(例如 plugin/skills/review.md)。用它按文件取内容,装到磁盘上时保留这个相对路径。不计入 downloads。
|
|
12125
|
+
*/
|
|
12126
|
+
export const registryPackagesVersionsFilesRetrieve = (options) => (options.client ?? client).get({
|
|
12127
|
+
security: [{
|
|
12128
|
+
key: 'registry-bearerAuth',
|
|
12129
|
+
scheme: 'bearer',
|
|
12130
|
+
type: 'http'
|
|
12131
|
+
}],
|
|
12132
|
+
url: '/registry/v1/packages/{package_id}/versions/{version}/files/{path}',
|
|
12133
|
+
...options
|
|
12134
|
+
});
|
|
12135
|
+
/**
|
|
12136
|
+
* Download version archive
|
|
12137
|
+
*
|
|
12138
|
+
* 下载一个版本的完整 zip 归档,用来整包安装或转存。每次调用都计入这个包的 downloads,所以不要为了看内容而反复拉 archive——先读 contents,只取需要的文件用 files 下载。
|
|
12139
|
+
*/
|
|
12140
|
+
export const registryPackagesVersionsArchive = (options) => (options.client ?? client).get({
|
|
12141
|
+
security: [{
|
|
12142
|
+
key: 'registry-bearerAuth',
|
|
12143
|
+
scheme: 'bearer',
|
|
12144
|
+
type: 'http'
|
|
12145
|
+
}],
|
|
12146
|
+
url: '/registry/v1/packages/{package_id}/versions/{version}/archive',
|
|
12147
|
+
...options
|
|
12148
|
+
});
|
|
12149
|
+
/**
|
|
12150
|
+
* Withdraw a version
|
|
12151
|
+
*
|
|
12152
|
+
* 撤回一个版本。撤回后它不再是 latest、不能被新装;已经装好的照常可用。版本号仍被占着,不能再用它发新版本。已经撤回的版本再撤回会返回 FAILED_PRECONDITION。撤回是不可逆的:要重新提供这个版本,用更高的版本号重新发布。
|
|
12153
|
+
*/
|
|
12154
|
+
export const registryPackagesVersionsWithdraw = (options) => (options.client ?? client).post({
|
|
12155
|
+
security: [{
|
|
12156
|
+
key: 'registry-bearerAuth',
|
|
12157
|
+
scheme: 'bearer',
|
|
12158
|
+
type: 'http'
|
|
12159
|
+
}],
|
|
12160
|
+
url: '/registry/v1/packages/{package_id}/versions/{version}:withdraw',
|
|
12161
|
+
...options
|
|
12162
|
+
});
|
|
12163
|
+
/**
|
|
12164
|
+
* List installations
|
|
12165
|
+
*
|
|
12166
|
+
* 列出这个包装在哪些智能体和电脑上。每次读取都会和目标那边对账,以目标现在的实际情况为准,所以每条记录的 state 是读取这一刻的结论:installed 表示目标上有它且版本与记录一致;drifted 表示目标上有它但版本不同,此时 version 显示目标上的版本;missing 表示目标上已经没有它(被人在智能体或电脑那边删掉了),记录仍保留,可以用 installations.delete 清掉,或用 installations.update 重新装回;unknown 表示这次问不到目标,不代表没装,稍后重读。withdrawn 表示这条记录的版本已被撤回。一次返回全部记录,没有分页,按创建时间排序。
|
|
12167
|
+
*/
|
|
12168
|
+
export const registryPackagesInstallationsList = (options) => (options.client ?? client).get({
|
|
12169
|
+
security: [{
|
|
12170
|
+
key: 'registry-bearerAuth',
|
|
12171
|
+
scheme: 'bearer',
|
|
12172
|
+
type: 'http'
|
|
12173
|
+
}],
|
|
12174
|
+
url: '/registry/v1/packages/{package_id}/installations',
|
|
12175
|
+
...options
|
|
12176
|
+
});
|
|
12177
|
+
/**
|
|
12178
|
+
* Install a package
|
|
12179
|
+
*
|
|
12180
|
+
* 把一个包装到目标上:技能装到智能体(agent_ids),插件装到电脑(computer_ids),一次最多 50 个目标;目标种类给错会被拒(400),包的种类可从 packages.retrieve 的 kind 得知。技能装的是具体版本,version 省略时装最新版,之后不会自动升级,要换版本用 installations.update。插件只能装库里的最新版本,version 若给了就必须等于最新版,否则 FAILED_PRECONDITION。撤回的版本不能新装。同一目标重复装同一个包不会报错,而是把它移到这个版本。技能被拒的情形:智能体上已有同名的另一个技能(名字冲突),或这个智能体已经有 20 个技能。各目标独立处理:只要有一个成功就返回 201,成功的在 data 里,失败的目标在 errors 里逐个列出 target_id、code 和 message,按消息修正后只对失败的目标重发;全部失败时不返回 201,而是按第一个失败返回错误状态。装到智能体或电脑上要求调用者本人有权限,权限不足会出现在该目标的 errors 里。
|
|
12181
|
+
*/
|
|
12182
|
+
export const registryPackagesInstallationsCreate = (options) => (options.client ?? client).post({
|
|
12183
|
+
security: [{
|
|
12184
|
+
key: 'registry-bearerAuth',
|
|
12185
|
+
scheme: 'bearer',
|
|
12186
|
+
type: 'http'
|
|
12187
|
+
}],
|
|
12188
|
+
url: '/registry/v1/packages/{package_id}/installations',
|
|
12189
|
+
...options,
|
|
12190
|
+
headers: {
|
|
12191
|
+
'Content-Type': 'application/json',
|
|
12192
|
+
...options.headers
|
|
12193
|
+
}
|
|
12194
|
+
});
|
|
12195
|
+
/**
|
|
12196
|
+
* Update an installation
|
|
12197
|
+
*
|
|
12198
|
+
* 把一条安装记录换到另一个版本。技能可以换到任何未撤回的版本(升级或回退),version 省略时换到最新版;插件只能换到库里的最新版本,version 给了也必须等于最新版。撤回的版本不能换过去。对账为 missing 的记录用它可以重新装回去。同名冲突和 20 个技能上限的规则与安装时相同。
|
|
12199
|
+
*/
|
|
12200
|
+
export const registryInstallationsUpdate = (options) => (options.client ?? client).post({
|
|
12201
|
+
security: [{
|
|
12202
|
+
key: 'registry-bearerAuth',
|
|
12203
|
+
scheme: 'bearer',
|
|
12204
|
+
type: 'http'
|
|
12205
|
+
}],
|
|
12206
|
+
url: '/registry/v1/installations/{installation_id}:update',
|
|
12207
|
+
...options,
|
|
12208
|
+
headers: {
|
|
12209
|
+
'Content-Type': 'application/json',
|
|
12210
|
+
...options.headers
|
|
12211
|
+
}
|
|
12212
|
+
});
|
|
12213
|
+
/**
|
|
12214
|
+
* Remove an installation
|
|
12215
|
+
*
|
|
12216
|
+
* 把包从目标上卸下来,并删掉这条安装记录:技能从智能体的技能列表里移除,插件从电脑上卸载。目标那边已经没有它时也算完成。包本身和它的版本不受影响,之后可以重新安装。记录删除后重发会 404,所以删除前先用 installations.list 确认。
|
|
12217
|
+
*/
|
|
12218
|
+
export const registryInstallationsDelete = (options) => (options.client ?? client).delete({
|
|
12219
|
+
security: [{
|
|
12220
|
+
key: 'registry-bearerAuth',
|
|
12221
|
+
scheme: 'bearer',
|
|
12222
|
+
type: 'http'
|
|
12223
|
+
}],
|
|
12224
|
+
url: '/registry/v1/installations/{installation_id}',
|
|
12225
|
+
...options
|
|
12226
|
+
});
|
|
11246
12227
|
/**
|
|
11247
12228
|
* List sandboxes (v2)
|
|
11248
12229
|
*
|
|
@@ -11284,7 +12265,7 @@ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).ge
|
|
|
11284
12265
|
/**
|
|
11285
12266
|
* Create sandbox (v2)
|
|
11286
12267
|
*
|
|
11287
|
-
* Create a sandbox from a template. Every sandbox declares its lifecycle at creation. On the own face (X-Praxis-Face: own-v1) send ephemeral: true for an ephemeral sandbox (never pauses, cannot be snapshotted, deleted when it ends; for jobs such as transcodes, scripts and builds) or ephemeral: false for a persistent one (pauses and resumes, snapshots, mounts volumes, kept after it stops; for long-lived computers). Leaving ephemeral out returns INVALID_PARAMS. autoPause: true, onExpire: pause, autoPauseMemory, autoResume, idleTimeout, retention and volumes belong to persistent sandboxes and need ephemeral: false. Choose persistent only for long-lived computers. On the E2B-compatible face autoPause is the declaration: true is persistent, false or absent is ephemeral and ends at its timeout. Responses carry ephemeral. When a sandbox's machine has ended (timeout, kill, retention, provider loss), reaching it returns SANDBOX_EXPIRED (410) with terminationReason in the message: its files are gone, create a new sandbox.
|
|
12268
|
+
* Create a sandbox from a template. Every sandbox declares its lifecycle at creation. On the own face (X-Praxis-Face: own-v1) send ephemeral: true for an ephemeral sandbox (never pauses, cannot be snapshotted, deleted when it ends; for jobs such as transcodes, scripts and builds) or ephemeral: false for a persistent one (pauses and resumes, snapshots, mounts volumes, kept after it stops; for long-lived computers). Leaving ephemeral out returns INVALID_PARAMS. autoPause: true, onExpire: pause, autoPauseMemory, autoResume, idleTimeout, retention and volumes belong to persistent sandboxes and need ephemeral: false. Choose persistent only for long-lived computers. On the E2B-compatible face autoPause is the declaration: true is persistent, false or absent is ephemeral and ends at its timeout. Responses carry ephemeral. When a sandbox's machine has ended (timeout, kill, retention, provider loss), reaching it returns SANDBOX_EXPIRED (410) with terminationReason in the message: its files are gone, create a new sandbox. To keep results, declare outputs: [{ path }] on the own face (up to eight absolute paths, a directory or a file): when the sandbox ends for any reason except provider loss or a failed start, each path is packed as .tar.gz and stored in File, and the killed event of GET /sandbox/v1/events/sandboxes/{sandboxID} lists each fileId or the reason it was not kept. Paths not declared are not kept. The E2B face refuses outputs. On the own face an android phone accepts waitForReady: true, an own-face-only option: the create then waits until the phone program has connected (state running) or 55 seconds have passed since the request arrived (the vendor create itself takes about 48 s, so this is often not enough), and answers with the state it reached — a timeout is not an error; omit it (the default) and the create answers at once, before the phone connects, with state starting or booting, which you follow with the detail read or the act socket.
|
|
11288
12269
|
*/
|
|
11289
12270
|
export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
|
|
11290
12271
|
security: [
|
|
@@ -12380,7 +13361,7 @@ export const shareListPermissions = (options) => (options?.client ?? client).get
|
|
|
12380
13361
|
/**
|
|
12381
13362
|
* Create share
|
|
12382
13363
|
*
|
|
12383
|
-
* Make one
|
|
13364
|
+
* Make one object readable by anyone holding a link, before sending the link to a person or embedding it. Name the object as resource {type, id} — a file id from the File API, a canvas id, a media asset's library_id/asset_id, or an agent id (agent_...) of a service agent whose owner turned share links on. The response is 201 and is the only time link.web_url is returned; store it, because later reads omit it and a lost address means creating another share (the old one keeps working until you delete it). Opening a file or media link signs a short-lived read address; opening a canvas link shows a snapshot rendered at that moment; opening an agent link starts a Hosted conversation with that agent as the visitor, so each browser keeps its own history. The link is anonymous, and for every type so far read-only. A type that cannot be shared answers 400 RESOURCE_TYPE_UNSUPPORTED; an agent whose share links are switched off answers 400 RESOURCE_NOT_SHAREABLE and its owner turns them on in the agent's embed settings (share_links), which also requires the agent to have a short number; an object that is missing or outside your organization answers 404 RESOURCE_NOT_FOUND.
|
|
12384
13365
|
*/
|
|
12385
13366
|
export const shareCreatePermission = (options) => (options.client ?? client).post({
|
|
12386
13367
|
security: [{
|