@deepraxis/sdk 0.1.1-dev.a60648b → 0.1.1-dev.a67dca4
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 +347 -191
- package/dist/core/deprecation.d.ts +11 -0
- package/dist/core/deprecation.js +20 -0
- package/dist/core/transport.d.ts +4 -0
- package/dist/core/transport.js +3 -0
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +577 -207
- package/dist/generated/sdk.gen.js +1655 -745
- package/dist/generated/types.gen.d.ts +6125 -3360
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/operations.generated.js +9795 -7765
- package/dist/resources.generated.d.ts +352 -123
- package/dist/resources.generated.js +370 -137
- package/package.json +1 -1
|
@@ -929,6 +929,30 @@ export const listSessionRequests = (options) => (options.client ?? client).get({
|
|
|
929
929
|
url: '/agent/v1/sessions/{session_id}/requests',
|
|
930
930
|
...options
|
|
931
931
|
});
|
|
932
|
+
/**
|
|
933
|
+
* Create Session Dictation Stream (Extension)
|
|
934
|
+
*
|
|
935
|
+
* Open a dictation stream for a session and get the address to push microphone audio to.
|
|
936
|
+
*
|
|
937
|
+
* Own-face extension. The body is optional: hotwords (at most 50 words the recogniser should favour). Returns 201 { id, push_url, expires_at }: id is the stream id (mst_...), push_url a wss address, expires_at when the address stops accepting a new connection. The speech-to-text model is the agent's dictation_model, or the platform default when it names none. Once connected to push_url, send one text frame {"type":"start","format":"pcm_s16le","sample_rate":16000,"channels":1}, then binary PCM frames of at most 64 KiB, then {"type":"stop"}; the text frames you receive are partial, final, done (with audio_seconds and cost_usd) and error. Each final carries end_ms, where that sentence ends in the audio you sent: if the connection drops, send what comes after the last end_ms to a new dictation. You may connect ahead of time: the stream waits up to 5 minutes for start; after start it closes after 30 s without a frame, and it carries at most 10 minutes of audio. push_url carries a short-lived capability: treat it as a secret and do not store or log it. A session that is missing or not yours returns 404; a model that cannot transcribe a live stream returns 409 DICTATION_UNCONFIGURED; dictation not available in this environment returns 503 DICTATION_UNAVAILABLE; more than 50 hotwords or an unsupported field returns 400.
|
|
938
|
+
*/
|
|
939
|
+
export const createSessionDictation = (options) => (options.client ?? client).post({
|
|
940
|
+
security: [{
|
|
941
|
+
key: 'BearerAuth',
|
|
942
|
+
scheme: 'bearer',
|
|
943
|
+
type: 'http'
|
|
944
|
+
}, {
|
|
945
|
+
key: 'ApiKeyAuth',
|
|
946
|
+
name: 'X-API-Key',
|
|
947
|
+
type: 'apiKey'
|
|
948
|
+
}],
|
|
949
|
+
url: '/agent/v1/sessions/{session_id}/dictations',
|
|
950
|
+
...options,
|
|
951
|
+
headers: {
|
|
952
|
+
'Content-Type': 'application/json',
|
|
953
|
+
...options.headers
|
|
954
|
+
}
|
|
955
|
+
});
|
|
932
956
|
/**
|
|
933
957
|
* List Session Background Tasks (Extension)
|
|
934
958
|
*
|
|
@@ -1138,7 +1162,7 @@ export const browserListSessions = (options) => (options?.client ?? client).get(
|
|
|
1138
1162
|
/**
|
|
1139
1163
|
* 创建浏览器会话
|
|
1140
1164
|
*
|
|
1141
|
-
* 创建云端 Chrome,返回自带凭证的 connectUrl。API 会话默认断开后结束;最长 6
|
|
1165
|
+
* 创建云端 Chrome,返回自带凭证的 connectUrl。API 会话默认断开后结束;最长 6 小时。运行中服务每 60 秒做一次健康检查(Browser.getVersion,超时 10 秒),连续 2 次失败即以 closeReason=watchdog 结束会话,keepAlive=true 也不豁免;该事件记录判据读数。
|
|
1142
1166
|
*/
|
|
1143
1167
|
export const browserCreateSession = (options) => (options.client ?? client).post({
|
|
1144
1168
|
security: [{
|
|
@@ -2667,11 +2691,11 @@ export const exportOrganizationCharges = (options) => (options.client ?? client)
|
|
|
2667
2691
|
...options
|
|
2668
2692
|
});
|
|
2669
2693
|
/**
|
|
2670
|
-
*
|
|
2694
|
+
* Your inbox counts for the notification bell
|
|
2671
2695
|
*
|
|
2672
|
-
*
|
|
2696
|
+
* Bell-badge counts for the calling person in the organization behind your credential: notices not yet read and not yet seen. The person is always the credential's own; the request cannot name another member. Read-only; no usage charge.
|
|
2673
2697
|
*/
|
|
2674
|
-
export const
|
|
2698
|
+
export const getOrganizationNotificationsInbox = (options) => (options?.client ?? client).get({
|
|
2675
2699
|
security: [{
|
|
2676
2700
|
key: 'BearerAuth',
|
|
2677
2701
|
scheme: 'bearer',
|
|
@@ -2681,15 +2705,15 @@ export const listOrganizationDepartments = (options) => (options?.client ?? clie
|
|
|
2681
2705
|
name: 'X-API-Key',
|
|
2682
2706
|
type: 'apiKey'
|
|
2683
2707
|
}],
|
|
2684
|
-
url: '/organization/v1/
|
|
2708
|
+
url: '/organization/v1/notifications/inbox',
|
|
2685
2709
|
...options
|
|
2686
2710
|
});
|
|
2687
2711
|
/**
|
|
2688
|
-
*
|
|
2712
|
+
* List the letters addressed to you
|
|
2689
2713
|
*
|
|
2690
|
-
*
|
|
2714
|
+
* The letters this person received in this organization, newest first, as the notification center lists them (ADR-193 §5, #4107): the sender, the summary and the whole body are the copy this reader receives — every human:/agent: address is rendered as the directory's display name, and one the directory cannot name reads 「未知成员」, never an address or an internal id. Also the kind, when it arrived, whether it is read, and one line saying why it reached this person. The address is the credential's own and is never a request field. Details stay whole in body; open one by its id. Pass next_cursor unchanged as cursor; null ends the list. Read-only; no usage charge.
|
|
2691
2715
|
*/
|
|
2692
|
-
export const
|
|
2716
|
+
export const listOrganizationNotificationLetters = (options) => (options?.client ?? client).get({
|
|
2693
2717
|
security: [{
|
|
2694
2718
|
key: 'BearerAuth',
|
|
2695
2719
|
scheme: 'bearer',
|
|
@@ -2699,19 +2723,15 @@ export const establishOrganizationDepartment = (options) => (options.client ?? c
|
|
|
2699
2723
|
name: 'X-API-Key',
|
|
2700
2724
|
type: 'apiKey'
|
|
2701
2725
|
}],
|
|
2702
|
-
url: '/organization/v1/
|
|
2703
|
-
...options
|
|
2704
|
-
headers: {
|
|
2705
|
-
'Content-Type': 'application/json',
|
|
2706
|
-
...options.headers
|
|
2707
|
-
}
|
|
2726
|
+
url: '/organization/v1/notifications/letters',
|
|
2727
|
+
...options
|
|
2708
2728
|
});
|
|
2709
2729
|
/**
|
|
2710
|
-
*
|
|
2730
|
+
* Mark one of your letters read
|
|
2711
2731
|
*
|
|
2712
|
-
*
|
|
2732
|
+
* Mark one letter addressed to you as read, together with the bell notice it wrote, so the platform does not email it later as unread. The mailbox is the credential's own — an agent credential reads its own agent mailbox, never its owner's — and the request names only the letter. Repeating the call changes nothing and keeps the first read time. A letter that is not in your mailbox in this organization, or does not exist, answers 404 the same way. Returns how many delivered letters you still have unread. No usage charge.
|
|
2713
2733
|
*/
|
|
2714
|
-
export const
|
|
2734
|
+
export const readOrganizationNotificationLetter = (options) => (options.client ?? client).post({
|
|
2715
2735
|
security: [{
|
|
2716
2736
|
key: 'BearerAuth',
|
|
2717
2737
|
scheme: 'bearer',
|
|
@@ -2721,15 +2741,15 @@ export const getOrganizationDepartment = (options) => (options.client ?? client)
|
|
|
2721
2741
|
name: 'X-API-Key',
|
|
2722
2742
|
type: 'apiKey'
|
|
2723
2743
|
}],
|
|
2724
|
-
url: '/organization/v1/
|
|
2744
|
+
url: '/organization/v1/notifications/letters/{id}:read',
|
|
2725
2745
|
...options
|
|
2726
2746
|
});
|
|
2727
2747
|
/**
|
|
2728
|
-
*
|
|
2748
|
+
* Mark all your letters read
|
|
2729
2749
|
*
|
|
2730
|
-
*
|
|
2750
|
+
* Mark every delivered letter in your own mailbox in this organization as read, with their bell notices; give kind to read only letters of that kind. Nothing in another mailbox is touched. Letters still scheduled are not delivered yet and stay as they are. Returns how many delivered letters you still have unread. No usage charge.
|
|
2731
2751
|
*/
|
|
2732
|
-
export const
|
|
2752
|
+
export const readAllOrganizationNotificationLetters = (options) => (options?.client ?? client).post({
|
|
2733
2753
|
security: [{
|
|
2734
2754
|
key: 'BearerAuth',
|
|
2735
2755
|
scheme: 'bearer',
|
|
@@ -2739,19 +2759,19 @@ export const reorganizeOrganizationDepartment = (options) => (options.client ??
|
|
|
2739
2759
|
name: 'X-API-Key',
|
|
2740
2760
|
type: 'apiKey'
|
|
2741
2761
|
}],
|
|
2742
|
-
url: '/organization/v1/
|
|
2762
|
+
url: '/organization/v1/notifications/letters:readAll',
|
|
2743
2763
|
...options,
|
|
2744
2764
|
headers: {
|
|
2745
2765
|
'Content-Type': 'application/json',
|
|
2746
|
-
...options
|
|
2766
|
+
...options?.headers
|
|
2747
2767
|
}
|
|
2748
2768
|
});
|
|
2749
2769
|
/**
|
|
2750
|
-
*
|
|
2770
|
+
* Archive one of your letters
|
|
2751
2771
|
*
|
|
2752
|
-
*
|
|
2772
|
+
* Archive one letter addressed to you: it leaves the default letters list (ask for archived=true to see archived ones) and is marked read, with its bell notice. Repeating the call changes nothing and keeps the first archive time. A letter that is not in your mailbox in this organization, or does not exist, answers 404 the same way. Returns how many delivered letters you still have unread. No usage charge.
|
|
2753
2773
|
*/
|
|
2754
|
-
export const
|
|
2774
|
+
export const archiveOrganizationNotificationLetter = (options) => (options.client ?? client).post({
|
|
2755
2775
|
security: [{
|
|
2756
2776
|
key: 'BearerAuth',
|
|
2757
2777
|
scheme: 'bearer',
|
|
@@ -2761,37 +2781,15 @@ export const dissolveOrganizationDepartment = (options) => (options.client ?? cl
|
|
|
2761
2781
|
name: 'X-API-Key',
|
|
2762
2782
|
type: 'apiKey'
|
|
2763
2783
|
}],
|
|
2764
|
-
url: '/organization/v1/
|
|
2784
|
+
url: '/organization/v1/notifications/letters/{id}:archive',
|
|
2765
2785
|
...options
|
|
2766
2786
|
});
|
|
2767
2787
|
/**
|
|
2768
|
-
*
|
|
2769
|
-
*
|
|
2770
|
-
* Replaces the charter of a department: free-text rules that apply to the department and are inherited by every department below it. Send the charter.revision you last read as expected_revision (0 when the department has no charter yet); each successful amendment raises the revision by one. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for text over 2000 characters or a non-integer expected_revision; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_DISSOLVED; 409 REVISION_CONFLICT when the charter moved on, so get the department again, merge your change and retry with its revision.
|
|
2771
|
-
*/
|
|
2772
|
-
export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
|
|
2773
|
-
security: [{
|
|
2774
|
-
key: 'BearerAuth',
|
|
2775
|
-
scheme: 'bearer',
|
|
2776
|
-
type: 'http'
|
|
2777
|
-
}, {
|
|
2778
|
-
key: 'ApiKeyAuth',
|
|
2779
|
-
name: 'X-API-Key',
|
|
2780
|
-
type: 'apiKey'
|
|
2781
|
-
}],
|
|
2782
|
-
url: '/organization/v1/departments/{id}/charter',
|
|
2783
|
-
...options,
|
|
2784
|
-
headers: {
|
|
2785
|
-
'Content-Type': 'application/json',
|
|
2786
|
-
...options.headers
|
|
2787
|
-
}
|
|
2788
|
-
});
|
|
2789
|
-
/**
|
|
2790
|
-
* List jobs
|
|
2788
|
+
* Your notification switches, and what they resolve to
|
|
2791
2789
|
*
|
|
2792
|
-
*
|
|
2790
|
+
* This person's notification preferences in the organization behind the credential: their own per-category switches, the channels they unsubscribed from everywhere, the organization's layer (defaults, blocked channels, whether members may change their own switches, hidden categories), and for every offered channel the answer the five layers produce — which layer decided it (platform_mandatory, channel_opt_out, person, organization_default, platform_default). Each catalog row also carries its severity (high/medium/low/none): it shapes the display only and never decides delivery (#4107). Read-only; no usage charge.
|
|
2793
2791
|
*/
|
|
2794
|
-
export const
|
|
2792
|
+
export const getOrganizationNotificationPreferences = (options) => (options?.client ?? client).get({
|
|
2795
2793
|
security: [{
|
|
2796
2794
|
key: 'BearerAuth',
|
|
2797
2795
|
scheme: 'bearer',
|
|
@@ -2801,15 +2799,15 @@ export const listOrganizationJobs = (options) => (options?.client ?? client).get
|
|
|
2801
2799
|
name: 'X-API-Key',
|
|
2802
2800
|
type: 'apiKey'
|
|
2803
2801
|
}],
|
|
2804
|
-
url: '/organization/v1/
|
|
2802
|
+
url: '/organization/v1/notifications/preferences',
|
|
2805
2803
|
...options
|
|
2806
2804
|
});
|
|
2807
2805
|
/**
|
|
2808
|
-
*
|
|
2806
|
+
* Change your notification switches
|
|
2809
2807
|
*
|
|
2810
|
-
*
|
|
2808
|
+
* Set this person's own notification switches in this organization. Refused with INVALID_PARAMS for an unknown category, a channel the category does not declare, or a channel this deployment has no provider for (nothing is stored that could not take effect); NOT_CONFIGURABLE for a category nobody configures; CRITICAL_CHANNELS_OFF when a critical category would be left with every offered channel off; ORGANIZATION_LOCKED when the organization does not let members change their own switches. A channel the organization blocked is still storable — the block decides, the switch stays theirs.
|
|
2811
2809
|
*/
|
|
2812
|
-
export const
|
|
2810
|
+
export const updateOrganizationNotificationPreferences = (options) => (options.client ?? client).post({
|
|
2813
2811
|
security: [{
|
|
2814
2812
|
key: 'BearerAuth',
|
|
2815
2813
|
scheme: 'bearer',
|
|
@@ -2819,7 +2817,7 @@ export const defineOrganizationJob = (options) => (options.client ?? client).pos
|
|
|
2819
2817
|
name: 'X-API-Key',
|
|
2820
2818
|
type: 'apiKey'
|
|
2821
2819
|
}],
|
|
2822
|
-
url: '/organization/v1/
|
|
2820
|
+
url: '/organization/v1/notifications/preferences',
|
|
2823
2821
|
...options,
|
|
2824
2822
|
headers: {
|
|
2825
2823
|
'Content-Type': 'application/json',
|
|
@@ -2827,11 +2825,11 @@ export const defineOrganizationJob = (options) => (options.client ?? client).pos
|
|
|
2827
2825
|
}
|
|
2828
2826
|
});
|
|
2829
2827
|
/**
|
|
2830
|
-
*
|
|
2828
|
+
* The organization's notification layer
|
|
2831
2829
|
*
|
|
2832
|
-
*
|
|
2830
|
+
* The organization's own preference layer: its per-category defaults for members who said nothing, the channels it blocks for everyone, whether members may change their own switches, and the non-critical categories it keeps off members' pages. Any member may read it; only an owner or admin may change it. A critical category can never be hidden, because hiding it would hide a channel nobody may switch off.
|
|
2833
2831
|
*/
|
|
2834
|
-
export const
|
|
2832
|
+
export const getOrganizationNotificationDefaults = (options) => (options?.client ?? client).get({
|
|
2835
2833
|
security: [{
|
|
2836
2834
|
key: 'BearerAuth',
|
|
2837
2835
|
scheme: 'bearer',
|
|
@@ -2841,15 +2839,15 @@ export const getOrganizationJob = (options) => (options.client ?? client).get({
|
|
|
2841
2839
|
name: 'X-API-Key',
|
|
2842
2840
|
type: 'apiKey'
|
|
2843
2841
|
}],
|
|
2844
|
-
url: '/organization/v1/
|
|
2842
|
+
url: '/organization/v1/notifications/organization_default',
|
|
2845
2843
|
...options
|
|
2846
2844
|
});
|
|
2847
2845
|
/**
|
|
2848
|
-
*
|
|
2846
|
+
* Set the organization's notification layer
|
|
2849
2847
|
*
|
|
2850
|
-
*
|
|
2848
|
+
* Change the organization's notification layer. Requires an organization owner or admin role; a member answers 403. Refused with INVALID_PARAMS for an unknown or non-configurable category, a channel the category does not declare, or a hidden critical category. Blocking a channel silences it for every member, and a critical category's mandatory channel still reaches people (ADR-193 §4 layer 1); setting member_may_change false makes these defaults final for members.
|
|
2851
2849
|
*/
|
|
2852
|
-
export const
|
|
2850
|
+
export const updateOrganizationNotificationDefaults = (options) => (options.client ?? client).post({
|
|
2853
2851
|
security: [{
|
|
2854
2852
|
key: 'BearerAuth',
|
|
2855
2853
|
scheme: 'bearer',
|
|
@@ -2859,7 +2857,7 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
|
|
|
2859
2857
|
name: 'X-API-Key',
|
|
2860
2858
|
type: 'apiKey'
|
|
2861
2859
|
}],
|
|
2862
|
-
url: '/organization/v1/
|
|
2860
|
+
url: '/organization/v1/notifications/organization_default',
|
|
2863
2861
|
...options,
|
|
2864
2862
|
headers: {
|
|
2865
2863
|
'Content-Type': 'application/json',
|
|
@@ -2867,11 +2865,11 @@ export const reviseOrganizationJob = (options) => (options.client ?? client).pat
|
|
|
2867
2865
|
}
|
|
2868
2866
|
});
|
|
2869
2867
|
/**
|
|
2870
|
-
*
|
|
2868
|
+
* Your own notification delivery records
|
|
2871
2869
|
*
|
|
2872
|
-
*
|
|
2870
|
+
* This person's delivery records in this organization, newest first: channel, status, the reason nothing was sent, the address a mail actually went to, and a carrier's verdict for a sent sms. The recipient is always the credential's own. Records are kept 30 days. Pass next_page unchanged as page; null ends the list. Read-only; no usage charge.
|
|
2873
2871
|
*/
|
|
2874
|
-
export const
|
|
2872
|
+
export const listOrganizationNotificationDeliveries = (options) => (options?.client ?? client).get({
|
|
2875
2873
|
security: [{
|
|
2876
2874
|
key: 'BearerAuth',
|
|
2877
2875
|
scheme: 'bearer',
|
|
@@ -2881,15 +2879,15 @@ export const retireOrganizationJob = (options) => (options.client ?? client).pos
|
|
|
2881
2879
|
name: 'X-API-Key',
|
|
2882
2880
|
type: 'apiKey'
|
|
2883
2881
|
}],
|
|
2884
|
-
url: '/organization/v1/
|
|
2882
|
+
url: '/organization/v1/notifications/deliveries',
|
|
2885
2883
|
...options
|
|
2886
2884
|
});
|
|
2887
2885
|
/**
|
|
2888
|
-
*
|
|
2886
|
+
* Upgrade to a full sandbox
|
|
2889
2887
|
*
|
|
2890
|
-
*
|
|
2888
|
+
* Move a light sandbox to a full environment when its capabilities are insufficient. Stops active processes and terminals, migrates files, and preserves the sandbox ID and name. Reconnect with the new envdAccessToken. A failed migration preserves source files but does not restart terminated processes.
|
|
2891
2889
|
*/
|
|
2892
|
-
export const
|
|
2890
|
+
export const upgradeSandbox = (options) => (options.client ?? client).post({
|
|
2893
2891
|
security: [{
|
|
2894
2892
|
key: 'BearerAuth',
|
|
2895
2893
|
scheme: 'bearer',
|
|
@@ -2899,15 +2897,19 @@ export const listOrganizationLadders = (options) => (options?.client ?? client).
|
|
|
2899
2897
|
name: 'X-API-Key',
|
|
2900
2898
|
type: 'apiKey'
|
|
2901
2899
|
}],
|
|
2902
|
-
url: '/
|
|
2903
|
-
...options
|
|
2900
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/upgrade',
|
|
2901
|
+
...options,
|
|
2902
|
+
headers: {
|
|
2903
|
+
'Content-Type': 'application/json',
|
|
2904
|
+
...options.headers
|
|
2905
|
+
}
|
|
2904
2906
|
});
|
|
2905
2907
|
/**
|
|
2906
|
-
*
|
|
2908
|
+
* Extend a running sandbox without shortening its deadline
|
|
2907
2909
|
*
|
|
2908
|
-
*
|
|
2910
|
+
* Extend a running sandbox only when it needs a later expiry; this never resumes a paused sandbox. Timeout is seconds from now, not added to the prior deadline, and must be 900, 1800 or 3600. Returns 409 for paused, expired, or non-extending requests.
|
|
2909
2911
|
*/
|
|
2910
|
-
export const
|
|
2912
|
+
export const extendSandbox = (options) => (options.client ?? client).post({
|
|
2911
2913
|
security: [{
|
|
2912
2914
|
key: 'BearerAuth',
|
|
2913
2915
|
scheme: 'bearer',
|
|
@@ -2917,7 +2919,7 @@ export const defineOrganizationLadder = (options) => (options.client ?? client).
|
|
|
2917
2919
|
name: 'X-API-Key',
|
|
2918
2920
|
type: 'apiKey'
|
|
2919
2921
|
}],
|
|
2920
|
-
url: '/
|
|
2922
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/extend',
|
|
2921
2923
|
...options,
|
|
2922
2924
|
headers: {
|
|
2923
2925
|
'Content-Type': 'application/json',
|
|
@@ -2925,11 +2927,11 @@ export const defineOrganizationLadder = (options) => (options.client ?? client).
|
|
|
2925
2927
|
}
|
|
2926
2928
|
});
|
|
2927
2929
|
/**
|
|
2928
|
-
*
|
|
2930
|
+
* List live processes and retained observations
|
|
2929
2931
|
*
|
|
2930
|
-
*
|
|
2932
|
+
* Inspect live processes and retained observations; this does not start a command. Praxis observation, not complete provider history. Only a witnessed exit event establishes exitCode; disconnects and restarts leave gaps and unknown state. Output retains at most 1 MiB/1024 chunks per process and 4 MiB/4096 chunks per instance across 256 observations. Truncation is explicit. Output data is base64; timestamps are Unix milliseconds. Reading never resumes a paused sandbox.
|
|
2931
2933
|
*/
|
|
2932
|
-
export const
|
|
2934
|
+
export const listObservedProcesses = (options) => (options.client ?? client).get({
|
|
2933
2935
|
security: [{
|
|
2934
2936
|
key: 'BearerAuth',
|
|
2935
2937
|
scheme: 'bearer',
|
|
@@ -2939,15 +2941,33 @@ export const getOrganizationLadder = (options) => (options.client ?? client).get
|
|
|
2939
2941
|
name: 'X-API-Key',
|
|
2940
2942
|
type: 'apiKey'
|
|
2941
2943
|
}],
|
|
2942
|
-
url: '/
|
|
2944
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/processes',
|
|
2943
2945
|
...options
|
|
2944
2946
|
});
|
|
2945
2947
|
/**
|
|
2946
|
-
*
|
|
2948
|
+
* Read bounded observed process output
|
|
2947
2949
|
*
|
|
2948
|
-
*
|
|
2950
|
+
* Read retained stdout and stderr chunks for a processID returned by processes.list. Praxis observation, not complete provider history. Only a witnessed exit event establishes exitCode; disconnects and restarts leave gaps and unknown state. Output retains at most 1 MiB/1024 chunks per process and 4 MiB/4096 chunks per instance across 256 observations. Truncation is explicit. Output data is base64; timestamps are Unix milliseconds. Reading never resumes a paused sandbox.
|
|
2949
2951
|
*/
|
|
2950
|
-
export const
|
|
2952
|
+
export const getObservedProcessOutput = (options) => (options.client ?? client).get({
|
|
2953
|
+
security: [{
|
|
2954
|
+
key: 'BearerAuth',
|
|
2955
|
+
scheme: 'bearer',
|
|
2956
|
+
type: 'http'
|
|
2957
|
+
}, {
|
|
2958
|
+
key: 'ApiKeyAuth',
|
|
2959
|
+
name: 'X-API-Key',
|
|
2960
|
+
type: 'apiKey'
|
|
2961
|
+
}],
|
|
2962
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output',
|
|
2963
|
+
...options
|
|
2964
|
+
});
|
|
2965
|
+
/**
|
|
2966
|
+
* Start a task whose output is pushed off the machine while it runs
|
|
2967
|
+
*
|
|
2968
|
+
* Run a long command whose output you will read back afterwards, including after the sandbox is deleted, instead of holding one connection open. Use this for builds, test runs and batch jobs; use commands.run for a short command whose output you want inline. The machine's resident daemon pushes the task's stdout/stderr to Praxis storage as it is produced, so the log survives the sandbox (seven days) and can be read in ranges with sandboxes.tasks.log; no vendor exec channel is involved. The command and the shipping credential travel to the daemon in its process environment, never in argv, so neither appears in the machine's process list. Only a full sandbox whose daemon advertises log-ship can run a task; any other machine returns PROVIDER_UNSUPPORTED with the reason. Returns 201 with the task id; starting is not waiting — poll the log to follow the task, and the final marker's exitCode for how it ended.
|
|
2969
|
+
*/
|
|
2970
|
+
export const startSandboxTask = (options) => (options.client ?? client).post({
|
|
2951
2971
|
security: [{
|
|
2952
2972
|
key: 'BearerAuth',
|
|
2953
2973
|
scheme: 'bearer',
|
|
@@ -2957,7 +2977,7 @@ export const reviseOrganizationLadder = (options) => (options.client ?? client).
|
|
|
2957
2977
|
name: 'X-API-Key',
|
|
2958
2978
|
type: 'apiKey'
|
|
2959
2979
|
}],
|
|
2960
|
-
url: '/
|
|
2980
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/tasks',
|
|
2961
2981
|
...options,
|
|
2962
2982
|
headers: {
|
|
2963
2983
|
'Content-Type': 'application/json',
|
|
@@ -2965,11 +2985,11 @@ export const reviseOrganizationLadder = (options) => (options.client ?? client).
|
|
|
2965
2985
|
}
|
|
2966
2986
|
});
|
|
2967
2987
|
/**
|
|
2968
|
-
*
|
|
2988
|
+
* Read a range of a task's pushed output
|
|
2969
2989
|
*
|
|
2970
|
-
*
|
|
2990
|
+
* Follow a task started with sandboxes.tasks.start, or read it long after its sandbox is gone. This reads Praxis storage and never the machine, so the answer is the same whether the sandbox is running, paused or deleted; the log is kept for seven days. Read in ranges: pass the previous answer's nextOffset as offset to continue, and stop when done is true. done means the final marker exists and the whole stream has been read, and only then do exitCode and size carry the task's outcome. text is UTF-8 decoded by bytes and backs up to a whole character when a cut would split one, so a page never ends mid-character; size, offset and nextOffset all count bytes. Ownership comes from the sandbox's index row while it exists and from the record written when the task started once it does not, so a sandbox id you own keeps answering after the sandbox is deleted. A task that was never started, or one belonging to another organization, returns NOT_FOUND.
|
|
2971
2991
|
*/
|
|
2972
|
-
export const
|
|
2992
|
+
export const getSandboxTaskLog = (options) => (options.client ?? client).get({
|
|
2973
2993
|
security: [{
|
|
2974
2994
|
key: 'BearerAuth',
|
|
2975
2995
|
scheme: 'bearer',
|
|
@@ -2979,37 +2999,89 @@ export const listOrganizationPositions = (options) => (options?.client ?? client
|
|
|
2979
2999
|
name: 'X-API-Key',
|
|
2980
3000
|
type: 'apiKey'
|
|
2981
3001
|
}],
|
|
2982
|
-
url: '/
|
|
3002
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log',
|
|
2983
3003
|
...options
|
|
2984
3004
|
});
|
|
2985
3005
|
/**
|
|
2986
|
-
*
|
|
3006
|
+
* Kill sandbox
|
|
2987
3007
|
*
|
|
2988
|
-
*
|
|
3008
|
+
* Kill a sandbox: stop it and release its resources for good. Use it when you are done with the sandbox; to keep its state for later use pause it instead with pauseSandbox. Success answers 204 with no body, and a killed sandbox answers 404 afterwards.
|
|
2989
3009
|
*/
|
|
2990
|
-
export const
|
|
2991
|
-
security: [
|
|
2992
|
-
|
|
3010
|
+
export const deleteSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).delete({
|
|
3011
|
+
security: [
|
|
3012
|
+
{
|
|
3013
|
+
key: 'sandbox-ApiKeyAuth',
|
|
3014
|
+
name: 'X-API-Key',
|
|
3015
|
+
type: 'apiKey'
|
|
3016
|
+
},
|
|
3017
|
+
{
|
|
3018
|
+
key: 'sandbox-AuthProviderBearerAuth',
|
|
2993
3019
|
scheme: 'bearer',
|
|
2994
3020
|
type: 'http'
|
|
2995
|
-
},
|
|
2996
|
-
|
|
3021
|
+
},
|
|
3022
|
+
{
|
|
3023
|
+
key: 'sandbox-AuthProviderTeamAuth',
|
|
3024
|
+
name: 'X-Team-ID',
|
|
3025
|
+
type: 'apiKey'
|
|
3026
|
+
},
|
|
3027
|
+
{ name: 'X-Admin-Token', type: 'apiKey' },
|
|
3028
|
+
{
|
|
3029
|
+
key: 'sandbox-AdminTeamAuth',
|
|
3030
|
+
name: 'X-Team-ID',
|
|
3031
|
+
type: 'apiKey'
|
|
3032
|
+
},
|
|
3033
|
+
{
|
|
3034
|
+
key: 'sandbox-AdminJWTAuth',
|
|
3035
|
+
scheme: 'bearer',
|
|
3036
|
+
type: 'http'
|
|
3037
|
+
}
|
|
3038
|
+
],
|
|
3039
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}',
|
|
3040
|
+
...options
|
|
3041
|
+
});
|
|
3042
|
+
/**
|
|
3043
|
+
* Sandbox
|
|
3044
|
+
*
|
|
3045
|
+
* Read one sandbox: its state (running or paused), template, resources, start time and expiry (endAt), plus the access token for its data plane when it is running. Use it to poll the state or the remaining lifetime of a sandbox; to find sandboxes use listSandboxes. An unknown id or another team's sandbox answers 404.
|
|
3046
|
+
*/
|
|
3047
|
+
export const getSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).get({
|
|
3048
|
+
security: [
|
|
3049
|
+
{
|
|
3050
|
+
key: 'sandbox-ApiKeyAuth',
|
|
2997
3051
|
name: 'X-API-Key',
|
|
2998
3052
|
type: 'apiKey'
|
|
2999
|
-
}
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3053
|
+
},
|
|
3054
|
+
{
|
|
3055
|
+
key: 'sandbox-AuthProviderBearerAuth',
|
|
3056
|
+
scheme: 'bearer',
|
|
3057
|
+
type: 'http'
|
|
3058
|
+
},
|
|
3059
|
+
{
|
|
3060
|
+
key: 'sandbox-AuthProviderTeamAuth',
|
|
3061
|
+
name: 'X-Team-ID',
|
|
3062
|
+
type: 'apiKey'
|
|
3063
|
+
},
|
|
3064
|
+
{ name: 'X-Admin-Token', type: 'apiKey' },
|
|
3065
|
+
{
|
|
3066
|
+
key: 'sandbox-AdminTeamAuth',
|
|
3067
|
+
name: 'X-Team-ID',
|
|
3068
|
+
type: 'apiKey'
|
|
3069
|
+
},
|
|
3070
|
+
{
|
|
3071
|
+
key: 'sandbox-AdminJWTAuth',
|
|
3072
|
+
scheme: 'bearer',
|
|
3073
|
+
type: 'http'
|
|
3074
|
+
}
|
|
3075
|
+
],
|
|
3076
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}',
|
|
3077
|
+
...options
|
|
3006
3078
|
});
|
|
3007
3079
|
/**
|
|
3008
|
-
*
|
|
3080
|
+
* Rename a sandbox
|
|
3009
3081
|
*
|
|
3010
|
-
*
|
|
3082
|
+
* Rename your sandbox. Names are trimmed, must contain 1–64 characters after trimming, and must be unique within your team. Only name may be changed. Returns the updated sandbox detail, as GET does. Killed or unavailable sandboxes return 404.
|
|
3011
3083
|
*/
|
|
3012
|
-
export const
|
|
3084
|
+
export const renameSandbox = (options) => (options.client ?? client).patch({
|
|
3013
3085
|
security: [{
|
|
3014
3086
|
key: 'BearerAuth',
|
|
3015
3087
|
scheme: 'bearer',
|
|
@@ -3019,15 +3091,21 @@ export const getOrganizationPosition = (options) => (options.client ?? client).g
|
|
|
3019
3091
|
name: 'X-API-Key',
|
|
3020
3092
|
type: 'apiKey'
|
|
3021
3093
|
}],
|
|
3022
|
-
url: '/
|
|
3023
|
-
...options
|
|
3094
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}',
|
|
3095
|
+
...options,
|
|
3096
|
+
headers: {
|
|
3097
|
+
'Content-Type': 'application/json',
|
|
3098
|
+
...options.headers
|
|
3099
|
+
}
|
|
3024
3100
|
});
|
|
3025
3101
|
/**
|
|
3026
|
-
*
|
|
3102
|
+
* Act on a phone sandbox's screen
|
|
3027
3103
|
*
|
|
3028
|
-
*
|
|
3104
|
+
* 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.
|
|
3105
|
+
*
|
|
3106
|
+
* 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.
|
|
3029
3107
|
*/
|
|
3030
|
-
export const
|
|
3108
|
+
export const actOnSandboxDisplay = (options) => (options.client ?? client).post({
|
|
3031
3109
|
security: [{
|
|
3032
3110
|
key: 'BearerAuth',
|
|
3033
3111
|
scheme: 'bearer',
|
|
@@ -3037,7 +3115,7 @@ export const reviseOrganizationPosition = (options) => (options.client ?? client
|
|
|
3037
3115
|
name: 'X-API-Key',
|
|
3038
3116
|
type: 'apiKey'
|
|
3039
3117
|
}],
|
|
3040
|
-
url: '/
|
|
3118
|
+
url: '/sandbox/v1/sandboxes/{sandboxID}/act',
|
|
3041
3119
|
...options,
|
|
3042
3120
|
headers: {
|
|
3043
3121
|
'Content-Type': 'application/json',
|
|
@@ -3045,11 +3123,11 @@ export const reviseOrganizationPosition = (options) => (options.client ?? client
|
|
|
3045
3123
|
}
|
|
3046
3124
|
});
|
|
3047
3125
|
/**
|
|
3048
|
-
*
|
|
3126
|
+
* Remove a file or directory in the sandbox
|
|
3049
3127
|
*
|
|
3050
|
-
*
|
|
3128
|
+
* Remove an unneeded file or recursively remove a directory and its contents. This permanently deletes the selected path; read any needed content first. Returns 204 after removal.
|
|
3051
3129
|
*/
|
|
3052
|
-
export const
|
|
3130
|
+
export const removeSandboxFile = (options) => (options.client ?? client).delete({
|
|
3053
3131
|
security: [{
|
|
3054
3132
|
key: 'BearerAuth',
|
|
3055
3133
|
scheme: 'bearer',
|
|
@@ -3059,15 +3137,15 @@ export const closeOrganizationPosition = (options) => (options.client ?? client)
|
|
|
3059
3137
|
name: 'X-API-Key',
|
|
3060
3138
|
type: 'apiKey'
|
|
3061
3139
|
}],
|
|
3062
|
-
url: '/
|
|
3140
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
|
|
3063
3141
|
...options
|
|
3064
3142
|
});
|
|
3065
3143
|
/**
|
|
3066
|
-
*
|
|
3144
|
+
* Read a file in the sandbox
|
|
3067
3145
|
*
|
|
3068
|
-
*
|
|
3146
|
+
* Read UTF-8 file content when a command needs input or produced a text artifact. Returns a JSON string. Unlike E2B, this endpoint supports text only and rejects output above 1 MiB; binary and streaming reads are unavailable.
|
|
3069
3147
|
*/
|
|
3070
|
-
export const
|
|
3148
|
+
export const readSandboxFile = (options) => (options.client ?? client).get({
|
|
3071
3149
|
security: [{
|
|
3072
3150
|
key: 'BearerAuth',
|
|
3073
3151
|
scheme: 'bearer',
|
|
@@ -3077,15 +3155,15 @@ export const freezeOrganizationPosition = (options) => (options.client ?? client
|
|
|
3077
3155
|
name: 'X-API-Key',
|
|
3078
3156
|
type: 'apiKey'
|
|
3079
3157
|
}],
|
|
3080
|
-
url: '/
|
|
3158
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
|
|
3081
3159
|
...options
|
|
3082
3160
|
});
|
|
3083
3161
|
/**
|
|
3084
|
-
*
|
|
3162
|
+
* Write a file in the sandbox
|
|
3085
3163
|
*
|
|
3086
|
-
*
|
|
3164
|
+
* Write a file in the sandbox before running a command. Replaces the target content and creates missing parent directories. Unlike E2B, this endpoint accepts one UTF-8 text file per request, at most 1 MiB; binary and batch writes are unavailable. Example body: {"path":"/tmp/hello.txt","data":"hello"}.
|
|
3087
3165
|
*/
|
|
3088
|
-
export const
|
|
3166
|
+
export const writeSandboxFile = (options) => (options.client ?? client).put({
|
|
3089
3167
|
security: [{
|
|
3090
3168
|
key: 'BearerAuth',
|
|
3091
3169
|
scheme: 'bearer',
|
|
@@ -3095,47 +3173,7 @@ export const unfreezeOrganizationPosition = (options) => (options.client ?? clie
|
|
|
3095
3173
|
name: 'X-API-Key',
|
|
3096
3174
|
type: 'apiKey'
|
|
3097
3175
|
}],
|
|
3098
|
-
url: '/
|
|
3099
|
-
...options
|
|
3100
|
-
});
|
|
3101
|
-
/**
|
|
3102
|
-
* Reassign a position's manager
|
|
3103
|
-
*
|
|
3104
|
-
* Sets the position this position reports to, or sends null to return to the default line: the head position of its department, and for a head position the head of the parent department. Requires an organization owner or admin, or the head of the position's department or of a department above it. The target may be in any department. Errors: 400 REPORTING_CYCLE when the new line would loop back to this position; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND for the position or the target; 409 POSITION_CLOSED when either is closed.
|
|
3105
|
-
*/
|
|
3106
|
-
export const reassignOrganizationPositionManager = (options) => (options.client ?? client).put({
|
|
3107
|
-
security: [{
|
|
3108
|
-
key: 'BearerAuth',
|
|
3109
|
-
scheme: 'bearer',
|
|
3110
|
-
type: 'http'
|
|
3111
|
-
}, {
|
|
3112
|
-
key: 'ApiKeyAuth',
|
|
3113
|
-
name: 'X-API-Key',
|
|
3114
|
-
type: 'apiKey'
|
|
3115
|
-
}],
|
|
3116
|
-
url: '/organization/v1/positions/{id}/manager',
|
|
3117
|
-
...options,
|
|
3118
|
-
headers: {
|
|
3119
|
-
'Content-Type': 'application/json',
|
|
3120
|
-
...options.headers
|
|
3121
|
-
}
|
|
3122
|
-
});
|
|
3123
|
-
/**
|
|
3124
|
-
* Regrade a position
|
|
3125
|
-
*
|
|
3126
|
-
* Sets the job level of a position. If the position was opened from a job that lists allowed levels, the level must be one of them. Requires an organization owner or admin; a department head cannot regrade. Errors: 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND; 409 POSITION_CLOSED.
|
|
3127
|
-
*/
|
|
3128
|
-
export const regradeOrganizationPosition = (options) => (options.client ?? client).put({
|
|
3129
|
-
security: [{
|
|
3130
|
-
key: 'BearerAuth',
|
|
3131
|
-
scheme: 'bearer',
|
|
3132
|
-
type: 'http'
|
|
3133
|
-
}, {
|
|
3134
|
-
key: 'ApiKeyAuth',
|
|
3135
|
-
name: 'X-API-Key',
|
|
3136
|
-
type: 'apiKey'
|
|
3137
|
-
}],
|
|
3138
|
-
url: '/organization/v1/positions/{id}/level',
|
|
3176
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files',
|
|
3139
3177
|
...options,
|
|
3140
3178
|
headers: {
|
|
3141
3179
|
'Content-Type': 'application/json',
|
|
@@ -3143,11 +3181,11 @@ export const regradeOrganizationPosition = (options) => (options.client ?? clien
|
|
|
3143
3181
|
}
|
|
3144
3182
|
});
|
|
3145
3183
|
/**
|
|
3146
|
-
*
|
|
3184
|
+
* List files in a sandbox directory
|
|
3147
3185
|
*
|
|
3148
|
-
*
|
|
3186
|
+
* Inspect a directory to find paths to read or remove. Returns immediate children with name, path, type and size. Unlike E2B, recursive depth is unavailable and responses are limited to 1 MiB.
|
|
3149
3187
|
*/
|
|
3150
|
-
export const
|
|
3188
|
+
export const listSandboxFiles = (options) => (options.client ?? client).get({
|
|
3151
3189
|
security: [{
|
|
3152
3190
|
key: 'BearerAuth',
|
|
3153
3191
|
scheme: 'bearer',
|
|
@@ -3157,15 +3195,15 @@ export const designateOrganizationPositionHead = (options) => (options.client ??
|
|
|
3157
3195
|
name: 'X-API-Key',
|
|
3158
3196
|
type: 'apiKey'
|
|
3159
3197
|
}],
|
|
3160
|
-
url: '/
|
|
3198
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files:list',
|
|
3161
3199
|
...options
|
|
3162
3200
|
});
|
|
3163
3201
|
/**
|
|
3164
|
-
*
|
|
3202
|
+
* Create a directory in the sandbox
|
|
3165
3203
|
*
|
|
3166
|
-
*
|
|
3204
|
+
* Create a directory and missing parent directories before writing files. Returns true when created or false when the path already exists. Supply the path as a query parameter.
|
|
3167
3205
|
*/
|
|
3168
|
-
export const
|
|
3206
|
+
export const makeSandboxDirectory = (options) => (options.client ?? client).post({
|
|
3169
3207
|
security: [{
|
|
3170
3208
|
key: 'BearerAuth',
|
|
3171
3209
|
scheme: 'bearer',
|
|
@@ -3175,19 +3213,15 @@ export const hireOrganizationPosition = (options) => (options.client ?? client).
|
|
|
3175
3213
|
name: 'X-API-Key',
|
|
3176
3214
|
type: 'apiKey'
|
|
3177
3215
|
}],
|
|
3178
|
-
url: '/
|
|
3179
|
-
...options
|
|
3180
|
-
headers: {
|
|
3181
|
-
'Content-Type': 'application/json',
|
|
3182
|
-
...options.headers
|
|
3183
|
-
}
|
|
3216
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/files:makeDir',
|
|
3217
|
+
...options
|
|
3184
3218
|
});
|
|
3185
3219
|
/**
|
|
3186
|
-
*
|
|
3220
|
+
* Run a command in the sandbox
|
|
3187
3221
|
*
|
|
3188
|
-
*
|
|
3222
|
+
* 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"}.
|
|
3189
3223
|
*/
|
|
3190
|
-
export const
|
|
3224
|
+
export const runSandboxCommand = (options) => (options.client ?? client).post({
|
|
3191
3225
|
security: [{
|
|
3192
3226
|
key: 'BearerAuth',
|
|
3193
3227
|
scheme: 'bearer',
|
|
@@ -3197,7 +3231,7 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
|
|
|
3197
3231
|
name: 'X-API-Key',
|
|
3198
3232
|
type: 'apiKey'
|
|
3199
3233
|
}],
|
|
3200
|
-
url: '/
|
|
3234
|
+
url: '/sandbox/v1/sandboxes/{sandbox_id}/commands',
|
|
3201
3235
|
...options,
|
|
3202
3236
|
headers: {
|
|
3203
3237
|
'Content-Type': 'application/json',
|
|
@@ -3205,11 +3239,11 @@ export const replaceOrganizationPositionHolder = (options) => (options.client ??
|
|
|
3205
3239
|
}
|
|
3206
3240
|
});
|
|
3207
3241
|
/**
|
|
3208
|
-
*
|
|
3242
|
+
* Start adding a phone of your own
|
|
3209
3243
|
*
|
|
3210
|
-
*
|
|
3244
|
+
* Begin bringing your own device (BYOD): the platform answers an 8-character code, its ten-minute deadline and the QR payload your phone's app scans, and nothing is registered until the owner taps Allow on the phone. Show the QR payload (or the code) in your app; the phone opens GET /sandbox/v1/byod/pairings/{code} — with no credential — to show the organization and the deadline, then posts the claim once. The pairing stores the organization's display name, which the phone shows on its Allow screen, so create the pairing from a session or key that carries one. A code is spent by the first successful claim and cannot be reused; create a new pairing for another device. BYOD devices are separate from sandboxes: they never appear in listSandboxes and have no template, size or expiry. Example: POST /sandbox/v1/byod/pairings with no body returns {code:'K7M4PQRS',expires_at:'2026-11-22T13:10:00.000Z',qr:'praxis://byod/pair?code=K7M4PQRS&api=https%3A%2F%2Fapi.deepraxis.com'}.
|
|
3211
3245
|
*/
|
|
3212
|
-
export const
|
|
3246
|
+
export const createByodPairing = (options) => (options?.client ?? client).post({
|
|
3213
3247
|
security: [{
|
|
3214
3248
|
key: 'BearerAuth',
|
|
3215
3249
|
scheme: 'bearer',
|
|
@@ -3219,15 +3253,15 @@ export const listOrganizationAssignments = (options) => (options?.client ?? clie
|
|
|
3219
3253
|
name: 'X-API-Key',
|
|
3220
3254
|
type: 'apiKey'
|
|
3221
3255
|
}],
|
|
3222
|
-
url: '/
|
|
3256
|
+
url: '/sandbox/v1/byod/pairings',
|
|
3223
3257
|
...options
|
|
3224
3258
|
});
|
|
3225
3259
|
/**
|
|
3226
|
-
*
|
|
3260
|
+
* List your organization's own devices
|
|
3227
3261
|
*
|
|
3228
|
-
*
|
|
3262
|
+
* List the devices your organization has paired, oldest first, with each one's platform, name, model, OS version, live online fact and when it was last seen. Use it to find a device id before you act on it, rename it or disconnect it, or to show the BYOD page. A revoked device is not listed, so a device that disappears from this answer was disconnected; there is no paging because an organization's own devices are few. Each row carries capabilities and, for a desktop, the agent_dirs it registered. Example: GET /sandbox/v1/byod/devices returns {data:[{object:'byod_device',id:'byd_0123456789abcdefghijklmno',platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16',online:true,last_seen_at:'2026-11-22T12:58:00.000Z',created_at:'2026-11-22T12:40:00.000Z',capabilities:['display'],agent_dirs:[]}]}.
|
|
3229
3263
|
*/
|
|
3230
|
-
export const
|
|
3264
|
+
export const listByodDevices = (options) => (options?.client ?? client).get({
|
|
3231
3265
|
security: [{
|
|
3232
3266
|
key: 'BearerAuth',
|
|
3233
3267
|
scheme: 'bearer',
|
|
@@ -3237,15 +3271,15 @@ export const getOrganizationAssignment = (options) => (options.client ?? client)
|
|
|
3237
3271
|
name: 'X-API-Key',
|
|
3238
3272
|
type: 'apiKey'
|
|
3239
3273
|
}],
|
|
3240
|
-
url: '/
|
|
3274
|
+
url: '/sandbox/v1/byod/devices',
|
|
3241
3275
|
...options
|
|
3242
3276
|
});
|
|
3243
3277
|
/**
|
|
3244
|
-
*
|
|
3278
|
+
* Read one of your organization's devices
|
|
3245
3279
|
*
|
|
3246
|
-
*
|
|
3280
|
+
* Read one BYOD device: the same fields listByodDevices returns, for a single device. Use it to poll whether a device is online before acting on it, or to refresh one row of the BYOD page after a rename. An unknown id and another organization's device both answer 404, so the answer never reveals that a foreign device exists. Example: GET /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno.
|
|
3247
3281
|
*/
|
|
3248
|
-
export const
|
|
3282
|
+
export const getByodDevice = (options) => (options.client ?? client).get({
|
|
3249
3283
|
security: [{
|
|
3250
3284
|
key: 'BearerAuth',
|
|
3251
3285
|
scheme: 'bearer',
|
|
@@ -3255,19 +3289,15 @@ export const transferOrganizationAssignment = (options) => (options.client ?? cl
|
|
|
3255
3289
|
name: 'X-API-Key',
|
|
3256
3290
|
type: 'apiKey'
|
|
3257
3291
|
}],
|
|
3258
|
-
url: '/
|
|
3259
|
-
...options
|
|
3260
|
-
headers: {
|
|
3261
|
-
'Content-Type': 'application/json',
|
|
3262
|
-
...options.headers
|
|
3263
|
-
}
|
|
3292
|
+
url: '/sandbox/v1/byod/devices/{deviceID}',
|
|
3293
|
+
...options
|
|
3264
3294
|
});
|
|
3265
3295
|
/**
|
|
3266
|
-
*
|
|
3296
|
+
* Rename one of your organization's devices
|
|
3267
3297
|
*
|
|
3268
|
-
*
|
|
3298
|
+
* Change a device's display name, and nothing else: pairing, credential, platform and connection are untouched. Use it to give a shared phone a name your team recognises. The body takes exactly one field, name, 1 to 64 characters after trimming; a missing, extra or wrongly typed field answers INVALID_PARAMS. An unknown id and another organization's device both answer 404. Example: PATCH /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno with {name:'Shelf phone'} returns the updated device.
|
|
3269
3299
|
*/
|
|
3270
|
-
export const
|
|
3300
|
+
export const updateByodDevice = (options) => (options.client ?? client).patch({
|
|
3271
3301
|
security: [{
|
|
3272
3302
|
key: 'BearerAuth',
|
|
3273
3303
|
scheme: 'bearer',
|
|
@@ -3277,7 +3307,7 @@ export const terminateOrganizationAssignment = (options) => (options.client ?? c
|
|
|
3277
3307
|
name: 'X-API-Key',
|
|
3278
3308
|
type: 'apiKey'
|
|
3279
3309
|
}],
|
|
3280
|
-
url: '/
|
|
3310
|
+
url: '/sandbox/v1/byod/devices/{deviceID}',
|
|
3281
3311
|
...options,
|
|
3282
3312
|
headers: {
|
|
3283
3313
|
'Content-Type': 'application/json',
|
|
@@ -3285,11 +3315,11 @@ export const terminateOrganizationAssignment = (options) => (options.client ?? c
|
|
|
3285
3315
|
}
|
|
3286
3316
|
});
|
|
3287
3317
|
/**
|
|
3288
|
-
*
|
|
3318
|
+
* Disconnect a device and revoke its credential
|
|
3289
3319
|
*
|
|
3290
|
-
*
|
|
3320
|
+
* Disconnect a paired device: the device's credential is revoked, its control connection is closed, and it stops appearing in listByodDevices. Use it when the phone is lost, lent or no longer wanted; the same disconnect is offered as one tap on the device itself. The operation is idempotent — disconnecting an already-disconnected device answers the same 200 — so a retry after a lost response is safe. The device is untouched: nothing is erased on the phone, and it can be paired again with a new pairing. Because a revoked device is not listed, a later listByodDevices no longer shows it. An unknown id and another organization's device both answer 404. Example: POST /sandbox/v1/byod/devices/byd_0123456789abcdefghijklmno/disconnect returns {id:'byd_0123456789abcdefghijklmno',object:'byod_device',disconnected:true}.
|
|
3291
3321
|
*/
|
|
3292
|
-
export const
|
|
3322
|
+
export const disconnectByodDevice = (options) => (options.client ?? client).post({
|
|
3293
3323
|
security: [{
|
|
3294
3324
|
key: 'BearerAuth',
|
|
3295
3325
|
scheme: 'bearer',
|
|
@@ -3299,15 +3329,15 @@ export const makePrimaryOrganizationAssignment = (options) => (options.client ??
|
|
|
3299
3329
|
name: 'X-API-Key',
|
|
3300
3330
|
type: 'apiKey'
|
|
3301
3331
|
}],
|
|
3302
|
-
url: '/
|
|
3332
|
+
url: '/sandbox/v1/byod/devices/{deviceID}/disconnect',
|
|
3303
3333
|
...options
|
|
3304
3334
|
});
|
|
3305
3335
|
/**
|
|
3306
|
-
*
|
|
3336
|
+
* Read a pairing for the phone's Allow screen
|
|
3307
3337
|
*
|
|
3308
|
-
*
|
|
3338
|
+
* The phone's own read, called by the app that scanned the QR code or the code was typed into: it answers the organization's display name and the code's deadline, which the owner sees before tapping Allow. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and do not call it from server code. An unknown, spent or expired code answers 404, with nothing said about which of the three it is; that also covers a code another organization created. The read is a preview only: it registers nothing, and the claim is what spends the code. Example: GET /sandbox/v1/byod/pairings/K7M4PQRS returns {organization_name:'烟火测试团队',expires_at:'2026-11-22T13:10:00.000Z'}.
|
|
3309
3339
|
*/
|
|
3310
|
-
export const
|
|
3340
|
+
export const getByodPairing = (options) => (options.client ?? client).get({
|
|
3311
3341
|
security: [{
|
|
3312
3342
|
key: 'BearerAuth',
|
|
3313
3343
|
scheme: 'bearer',
|
|
@@ -3317,15 +3347,15 @@ export const listOrganizationActors = (options) => (options?.client ?? client).g
|
|
|
3317
3347
|
name: 'X-API-Key',
|
|
3318
3348
|
type: 'apiKey'
|
|
3319
3349
|
}],
|
|
3320
|
-
url: '/
|
|
3350
|
+
url: '/sandbox/v1/byod/pairings/{code}',
|
|
3321
3351
|
...options
|
|
3322
3352
|
});
|
|
3323
3353
|
/**
|
|
3324
|
-
*
|
|
3354
|
+
* Claim a pairing and register the phone
|
|
3325
3355
|
*
|
|
3326
|
-
*
|
|
3356
|
+
* The phone's own final step after the owner taps Allow: it registers the device and answers the device id, a one-time credential and the control socket url the app dials. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and never call it from server code. The claim is single use: the first successful call spends the code and a second call answers 404, as does an unknown or expired code, so the app must store the credential the moment it arrives because it is never shown again. Connect to socket_url with Authorization: Bearer <credential>; the socket speaks the phone channel (hello, ping/pong, act, result/error) and the device's one connection is replaced if the app reconnects. Example: POST /sandbox/v1/byod/pairings/K7M4PQRS/claim with {platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16'} returns {device_id:'byd_0123456789abcdefghijklmno',credential:'…',socket_url:'wss://49982-byd0123456789abcdefghijklmno.sandbox.praxisusercontent.com/'}.
|
|
3327
3357
|
*/
|
|
3328
|
-
export const
|
|
3358
|
+
export const claimByodPairing = (options) => (options.client ?? client).post({
|
|
3329
3359
|
security: [{
|
|
3330
3360
|
key: 'BearerAuth',
|
|
3331
3361
|
scheme: 'bearer',
|
|
@@ -3335,15 +3365,19 @@ export const getOrganizationActor = (options) => (options.client ?? client).get(
|
|
|
3335
3365
|
name: 'X-API-Key',
|
|
3336
3366
|
type: 'apiKey'
|
|
3337
3367
|
}],
|
|
3338
|
-
url: '/
|
|
3339
|
-
...options
|
|
3368
|
+
url: '/sandbox/v1/byod/pairings/{code}/claim',
|
|
3369
|
+
...options,
|
|
3370
|
+
headers: {
|
|
3371
|
+
'Content-Type': 'application/json',
|
|
3372
|
+
...options.headers
|
|
3373
|
+
}
|
|
3340
3374
|
});
|
|
3341
3375
|
/**
|
|
3342
|
-
* List
|
|
3376
|
+
* List departments
|
|
3343
3377
|
*
|
|
3344
|
-
* Lists the
|
|
3378
|
+
* Lists the departments of your organization's tree, including the root department; use it to find a department id or to walk the tree one level at a time with parent_id. Dissolved departments are included unless you filter status=active. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/departments?status=active.
|
|
3345
3379
|
*/
|
|
3346
|
-
export const
|
|
3380
|
+
export const listOrganizationDepartments = (options) => (options?.client ?? client).get({
|
|
3347
3381
|
security: [{
|
|
3348
3382
|
key: 'BearerAuth',
|
|
3349
3383
|
scheme: 'bearer',
|
|
@@ -3353,15 +3387,15 @@ export const listOrganizationPeriods = (options) => (options?.client ?? client).
|
|
|
3353
3387
|
name: 'X-API-Key',
|
|
3354
3388
|
type: 'apiKey'
|
|
3355
3389
|
}],
|
|
3356
|
-
url: '/
|
|
3390
|
+
url: '/workforce/v1/departments',
|
|
3357
3391
|
...options
|
|
3358
3392
|
});
|
|
3359
3393
|
/**
|
|
3360
|
-
*
|
|
3394
|
+
* Establish a department
|
|
3361
3395
|
*
|
|
3362
|
-
*
|
|
3396
|
+
* Creates a department under an existing active parent department; use it to grow the tree, and use reorganize to rename or move one that already exists. order defaults to one after the last active sibling. The new department has no head position and no charter: open a position in it, then designate that position as head. Requires an organization owner or admin, or the head of the parent department or of a department above it. Errors: 400 INVALID_PARAMS for a missing or empty name, a name over 100 characters, an unknown body field or an active sibling with the same name; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND when the parent does not exist; 409 DEPARTMENT_DISSOLVED when the parent is dissolved. Example body: {"parent_id":"dept_123","name":"Support"}.
|
|
3363
3397
|
*/
|
|
3364
|
-
export const
|
|
3398
|
+
export const establishOrganizationDepartment = (options) => (options.client ?? client).post({
|
|
3365
3399
|
security: [{
|
|
3366
3400
|
key: 'BearerAuth',
|
|
3367
3401
|
scheme: 'bearer',
|
|
@@ -3371,7 +3405,7 @@ export const openOrganizationPeriod = (options) => (options.client ?? client).po
|
|
|
3371
3405
|
name: 'X-API-Key',
|
|
3372
3406
|
type: 'apiKey'
|
|
3373
3407
|
}],
|
|
3374
|
-
url: '/
|
|
3408
|
+
url: '/workforce/v1/departments',
|
|
3375
3409
|
...options,
|
|
3376
3410
|
headers: {
|
|
3377
3411
|
'Content-Type': 'application/json',
|
|
@@ -3379,11 +3413,11 @@ export const openOrganizationPeriod = (options) => (options.client ?? client).po
|
|
|
3379
3413
|
}
|
|
3380
3414
|
});
|
|
3381
3415
|
/**
|
|
3382
|
-
* Get a
|
|
3416
|
+
* Get a department
|
|
3383
3417
|
*
|
|
3384
|
-
* Reads one
|
|
3418
|
+
* Reads one department with its head position id and its charter, including the charter revision you need before amending the charter. Read-only. Errors: 404 DEPARTMENT_NOT_FOUND when the id is not a department of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
3385
3419
|
*/
|
|
3386
|
-
export const
|
|
3420
|
+
export const getOrganizationDepartment = (options) => (options.client ?? client).get({
|
|
3387
3421
|
security: [{
|
|
3388
3422
|
key: 'BearerAuth',
|
|
3389
3423
|
scheme: 'bearer',
|
|
@@ -3393,15 +3427,15 @@ export const getOrganizationPeriod = (options) => (options.client ?? client).get
|
|
|
3393
3427
|
name: 'X-API-Key',
|
|
3394
3428
|
type: 'apiKey'
|
|
3395
3429
|
}],
|
|
3396
|
-
url: '/
|
|
3430
|
+
url: '/workforce/v1/departments/{id}',
|
|
3397
3431
|
...options
|
|
3398
3432
|
});
|
|
3399
3433
|
/**
|
|
3400
|
-
*
|
|
3434
|
+
* Reorganize a department
|
|
3401
3435
|
*
|
|
3402
|
-
*
|
|
3436
|
+
* Renames a department, moves it under another parent, or changes its sort order; send at least one of parent_id, name and order. Sub-departments and positions move with it. Requires an organization owner or admin. The root department is the organization itself: its name is the organization's name and cannot be changed here (rename the organization in its settings), and it can never be moved, but its order can change. Errors: 400 INVALID_PARAMS when no field is given, a name is empty or over 100 characters, or a department already has that name under the same parent; 400 DEPARTMENT_CYCLE when the new parent is the department itself or one of its descendants; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND for the department or the new parent; 409 DEPARTMENT_DISSOLVED when either is dissolved; 409 DEPARTMENT_ROOT_IMMUTABLE when parent_id or name is sent for the root.
|
|
3403
3437
|
*/
|
|
3404
|
-
export const
|
|
3438
|
+
export const reorganizeOrganizationDepartment = (options) => (options.client ?? client).patch({
|
|
3405
3439
|
security: [{
|
|
3406
3440
|
key: 'BearerAuth',
|
|
3407
3441
|
scheme: 'bearer',
|
|
@@ -3411,15 +3445,19 @@ export const closeOrganizationPeriod = (options) => (options.client ?? client).p
|
|
|
3411
3445
|
name: 'X-API-Key',
|
|
3412
3446
|
type: 'apiKey'
|
|
3413
3447
|
}],
|
|
3414
|
-
url: '/
|
|
3415
|
-
...options
|
|
3448
|
+
url: '/workforce/v1/departments/{id}',
|
|
3449
|
+
...options,
|
|
3450
|
+
headers: {
|
|
3451
|
+
'Content-Type': 'application/json',
|
|
3452
|
+
...options.headers
|
|
3453
|
+
}
|
|
3416
3454
|
});
|
|
3417
3455
|
/**
|
|
3418
|
-
*
|
|
3456
|
+
* Dissolve a department
|
|
3419
3457
|
*
|
|
3420
|
-
*
|
|
3458
|
+
* Dissolves an empty department: it leaves the active tree, keeps its record for history, and takes no new sub-departments or positions. This API has no operation to reopen it. Requires an organization owner or admin. The department must have no active sub-department and no position that is not closed; dissolve or close those first. Takes no body. Errors: 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_NOT_EMPTY while an active sub-department or an unclosed position remains; 409 DEPARTMENT_ROOT_IMMUTABLE for the root; 409 DEPARTMENT_DISSOLVED when it is already dissolved.
|
|
3421
3459
|
*/
|
|
3422
|
-
export const
|
|
3460
|
+
export const dissolveOrganizationDepartment = (options) => (options.client ?? client).post({
|
|
3423
3461
|
security: [{
|
|
3424
3462
|
key: 'BearerAuth',
|
|
3425
3463
|
scheme: 'bearer',
|
|
@@ -3429,15 +3467,15 @@ export const listOrganizationObjectives = (options) => (options?.client ?? clien
|
|
|
3429
3467
|
name: 'X-API-Key',
|
|
3430
3468
|
type: 'apiKey'
|
|
3431
3469
|
}],
|
|
3432
|
-
url: '/
|
|
3470
|
+
url: '/workforce/v1/departments/{id}/dissolve',
|
|
3433
3471
|
...options
|
|
3434
3472
|
});
|
|
3435
3473
|
/**
|
|
3436
|
-
*
|
|
3474
|
+
* Amend a department charter
|
|
3437
3475
|
*
|
|
3438
|
-
*
|
|
3476
|
+
* Replaces the charter of a department: free-text rules that apply to the department and are inherited by every department below it. Send the charter.revision you last read as expected_revision (0 when the department has no charter yet); each successful amendment raises the revision by one. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for text over 2000 characters or a non-integer expected_revision; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_DISSOLVED; 409 REVISION_CONFLICT when the charter moved on, so get the department again, merge your change and retry with its revision.
|
|
3439
3477
|
*/
|
|
3440
|
-
export const
|
|
3478
|
+
export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
|
|
3441
3479
|
security: [{
|
|
3442
3480
|
key: 'BearerAuth',
|
|
3443
3481
|
scheme: 'bearer',
|
|
@@ -3447,7 +3485,7 @@ export const setOrganizationObjective = (options) => (options.client ?? client).
|
|
|
3447
3485
|
name: 'X-API-Key',
|
|
3448
3486
|
type: 'apiKey'
|
|
3449
3487
|
}],
|
|
3450
|
-
url: '/
|
|
3488
|
+
url: '/workforce/v1/departments/{id}/charter',
|
|
3451
3489
|
...options,
|
|
3452
3490
|
headers: {
|
|
3453
3491
|
'Content-Type': 'application/json',
|
|
@@ -3455,11 +3493,11 @@ export const setOrganizationObjective = (options) => (options.client ?? client).
|
|
|
3455
3493
|
}
|
|
3456
3494
|
});
|
|
3457
3495
|
/**
|
|
3458
|
-
*
|
|
3496
|
+
* List jobs
|
|
3459
3497
|
*
|
|
3460
|
-
*
|
|
3498
|
+
* Lists the jobs of your organization ordered by code; use it to find the job_id to open positions from. Retired jobs are included unless you filter status=active. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
3461
3499
|
*/
|
|
3462
|
-
export const
|
|
3500
|
+
export const listOrganizationJobs = (options) => (options?.client ?? client).get({
|
|
3463
3501
|
security: [{
|
|
3464
3502
|
key: 'BearerAuth',
|
|
3465
3503
|
scheme: 'bearer',
|
|
@@ -3469,15 +3507,15 @@ export const getOrganizationObjective = (options) => (options.client ?? client).
|
|
|
3469
3507
|
name: 'X-API-Key',
|
|
3470
3508
|
type: 'apiKey'
|
|
3471
3509
|
}],
|
|
3472
|
-
url: '/
|
|
3510
|
+
url: '/workforce/v1/jobs',
|
|
3473
3511
|
...options
|
|
3474
3512
|
});
|
|
3475
3513
|
/**
|
|
3476
|
-
*
|
|
3514
|
+
* Define a job
|
|
3477
3515
|
*
|
|
3478
|
-
*
|
|
3516
|
+
* Creates a job: a reusable template of duties and methods that is copied onto each position opened from it. The new job starts at revision 1 and status active. code is your own unique key for the job inside the organization. level_ids restricts the levels positions of this job may carry (empty or omitted allows any level). Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty or duplicate code, a name over 100 characters, text over 4000 characters or an unknown body field; 403 PERMISSION_DENIED; 404 JOB_LEVEL_NOT_FOUND when a level id does not exist. Example body: {"code":"support-agent","name":"Support agent","duties":"Answer customer tickets."}.
|
|
3479
3517
|
*/
|
|
3480
|
-
export const
|
|
3518
|
+
export const defineOrganizationJob = (options) => (options.client ?? client).post({
|
|
3481
3519
|
security: [{
|
|
3482
3520
|
key: 'BearerAuth',
|
|
3483
3521
|
scheme: 'bearer',
|
|
@@ -3487,7 +3525,7 @@ export const reviseOrganizationObjective = (options) => (options.client ?? clien
|
|
|
3487
3525
|
name: 'X-API-Key',
|
|
3488
3526
|
type: 'apiKey'
|
|
3489
3527
|
}],
|
|
3490
|
-
url: '/
|
|
3528
|
+
url: '/workforce/v1/jobs',
|
|
3491
3529
|
...options,
|
|
3492
3530
|
headers: {
|
|
3493
3531
|
'Content-Type': 'application/json',
|
|
@@ -3495,11 +3533,11 @@ export const reviseOrganizationObjective = (options) => (options.client ?? clien
|
|
|
3495
3533
|
}
|
|
3496
3534
|
});
|
|
3497
3535
|
/**
|
|
3498
|
-
*
|
|
3536
|
+
* Get a job
|
|
3499
3537
|
*
|
|
3500
|
-
*
|
|
3538
|
+
* Reads one job with its current revision, which you need before revising it. Read-only. Errors: 404 JOB_NOT_FOUND when the id is not a job of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
3501
3539
|
*/
|
|
3502
|
-
export const
|
|
3540
|
+
export const getOrganizationJob = (options) => (options.client ?? client).get({
|
|
3503
3541
|
security: [{
|
|
3504
3542
|
key: 'BearerAuth',
|
|
3505
3543
|
scheme: 'bearer',
|
|
@@ -3509,19 +3547,15 @@ export const alignOrganizationObjective = (options) => (options.client ?? client
|
|
|
3509
3547
|
name: 'X-API-Key',
|
|
3510
3548
|
type: 'apiKey'
|
|
3511
3549
|
}],
|
|
3512
|
-
url: '/
|
|
3513
|
-
...options
|
|
3514
|
-
headers: {
|
|
3515
|
-
'Content-Type': 'application/json',
|
|
3516
|
-
...options.headers
|
|
3517
|
-
}
|
|
3550
|
+
url: '/workforce/v1/jobs/{id}',
|
|
3551
|
+
...options
|
|
3518
3552
|
});
|
|
3519
3553
|
/**
|
|
3520
|
-
*
|
|
3554
|
+
* Revise a job
|
|
3521
3555
|
*
|
|
3522
|
-
*
|
|
3556
|
+
* Changes the name, duties, methods or allowed levels of a job; send expected_revision and at least one of those fields. Positions already opened keep their own copy and level, and only positions opened afterwards use the revised text. level_ids replaces the whole list. Each success raises the job revision by one. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when no field is given or a value breaks its limits; 403 PERMISSION_DENIED; 404 JOB_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND when a level id does not exist; 409 REVISION_CONFLICT when the job moved on, so get the job again and retry with its revision.
|
|
3523
3557
|
*/
|
|
3524
|
-
export const
|
|
3558
|
+
export const reviseOrganizationJob = (options) => (options.client ?? client).patch({
|
|
3525
3559
|
security: [{
|
|
3526
3560
|
key: 'BearerAuth',
|
|
3527
3561
|
scheme: 'bearer',
|
|
@@ -3531,7 +3565,7 @@ export const gradeOrganizationObjective = (options) => (options.client ?? client
|
|
|
3531
3565
|
name: 'X-API-Key',
|
|
3532
3566
|
type: 'apiKey'
|
|
3533
3567
|
}],
|
|
3534
|
-
url: '/
|
|
3568
|
+
url: '/workforce/v1/jobs/{id}',
|
|
3535
3569
|
...options,
|
|
3536
3570
|
headers: {
|
|
3537
3571
|
'Content-Type': 'application/json',
|
|
@@ -3539,11 +3573,11 @@ export const gradeOrganizationObjective = (options) => (options.client ?? client
|
|
|
3539
3573
|
}
|
|
3540
3574
|
});
|
|
3541
3575
|
/**
|
|
3542
|
-
*
|
|
3576
|
+
* Retire a job
|
|
3543
3577
|
*
|
|
3544
|
-
*
|
|
3578
|
+
* Retires a job so no new position can be opened from it; positions already opened are unchanged. Retiring a job that is already retired returns it unchanged. Takes no body. Requires an organization owner or admin. Errors: 403 PERMISSION_DENIED; 404 JOB_NOT_FOUND.
|
|
3545
3579
|
*/
|
|
3546
|
-
export const
|
|
3580
|
+
export const retireOrganizationJob = (options) => (options.client ?? client).post({
|
|
3547
3581
|
security: [{
|
|
3548
3582
|
key: 'BearerAuth',
|
|
3549
3583
|
scheme: 'bearer',
|
|
@@ -3553,15 +3587,33 @@ export const listOrganizationKeyResults = (options) => (options?.client ?? clien
|
|
|
3553
3587
|
name: 'X-API-Key',
|
|
3554
3588
|
type: 'apiKey'
|
|
3555
3589
|
}],
|
|
3556
|
-
url: '/
|
|
3590
|
+
url: '/workforce/v1/jobs/{id}/retire',
|
|
3557
3591
|
...options
|
|
3558
3592
|
});
|
|
3559
3593
|
/**
|
|
3560
|
-
*
|
|
3594
|
+
* List job ladders
|
|
3561
3595
|
*
|
|
3562
|
-
*
|
|
3596
|
+
* Lists the job ladders of your organization, oldest first, each with its levels in ascending order; use it to find the level ids for jobs and positions. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
3563
3597
|
*/
|
|
3564
|
-
export const
|
|
3598
|
+
export const listOrganizationLadders = (options) => (options?.client ?? client).get({
|
|
3599
|
+
security: [{
|
|
3600
|
+
key: 'BearerAuth',
|
|
3601
|
+
scheme: 'bearer',
|
|
3602
|
+
type: 'http'
|
|
3603
|
+
}, {
|
|
3604
|
+
key: 'ApiKeyAuth',
|
|
3605
|
+
name: 'X-API-Key',
|
|
3606
|
+
type: 'apiKey'
|
|
3607
|
+
}],
|
|
3608
|
+
url: '/workforce/v1/ladders',
|
|
3609
|
+
...options
|
|
3610
|
+
});
|
|
3611
|
+
/**
|
|
3612
|
+
* Define a job ladder
|
|
3613
|
+
*
|
|
3614
|
+
* Creates a job ladder: a named, ordered set of job levels such as junior to senior. Each level gets its own id (lvl_...), which jobs and positions refer to. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty name, an empty levels array, two levels with the same order or an unknown body field; 403 PERMISSION_DENIED. Example body: {"name":"Support","levels":[{"name":"Junior","order":1},{"name":"Senior","order":2}]}.
|
|
3615
|
+
*/
|
|
3616
|
+
export const defineOrganizationLadder = (options) => (options.client ?? client).post({
|
|
3565
3617
|
security: [{
|
|
3566
3618
|
key: 'BearerAuth',
|
|
3567
3619
|
scheme: 'bearer',
|
|
@@ -3571,7 +3623,7 @@ export const setOrganizationKeyResult = (options) => (options.client ?? client).
|
|
|
3571
3623
|
name: 'X-API-Key',
|
|
3572
3624
|
type: 'apiKey'
|
|
3573
3625
|
}],
|
|
3574
|
-
url: '/
|
|
3626
|
+
url: '/workforce/v1/ladders',
|
|
3575
3627
|
...options,
|
|
3576
3628
|
headers: {
|
|
3577
3629
|
'Content-Type': 'application/json',
|
|
@@ -3579,11 +3631,11 @@ export const setOrganizationKeyResult = (options) => (options.client ?? client).
|
|
|
3579
3631
|
}
|
|
3580
3632
|
});
|
|
3581
3633
|
/**
|
|
3582
|
-
* Get a
|
|
3634
|
+
* Get a job ladder
|
|
3583
3635
|
*
|
|
3584
|
-
* Reads one
|
|
3636
|
+
* Reads one job ladder with its levels in ascending order. Read-only. Errors: 404 LADDER_NOT_FOUND when the id is not a ladder of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
3585
3637
|
*/
|
|
3586
|
-
export const
|
|
3638
|
+
export const getOrganizationLadder = (options) => (options.client ?? client).get({
|
|
3587
3639
|
security: [{
|
|
3588
3640
|
key: 'BearerAuth',
|
|
3589
3641
|
scheme: 'bearer',
|
|
@@ -3593,15 +3645,15 @@ export const getOrganizationKeyResult = (options) => (options.client ?? client).
|
|
|
3593
3645
|
name: 'X-API-Key',
|
|
3594
3646
|
type: 'apiKey'
|
|
3595
3647
|
}],
|
|
3596
|
-
url: '/
|
|
3648
|
+
url: '/workforce/v1/ladders/{id}',
|
|
3597
3649
|
...options
|
|
3598
3650
|
});
|
|
3599
3651
|
/**
|
|
3600
|
-
* Revise a
|
|
3652
|
+
* Revise a job ladder
|
|
3601
3653
|
*
|
|
3602
|
-
*
|
|
3654
|
+
* Replaces all levels of a ladder with the array you send. A level with an id keeps that id and takes the new name and order, a level without an id is created, and an existing level you leave out is deleted. A level cannot be deleted while an open position or a job's level_ids still refers to it; first regrade those positions or revise those jobs. Send name to rename the ladder; leave it out to keep the name. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty levels array, duplicate order values, a level id sent twice or a level that is still referenced; 403 PERMISSION_DENIED; 404 LADDER_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND when a level id does not belong to this ladder.
|
|
3603
3655
|
*/
|
|
3604
|
-
export const
|
|
3656
|
+
export const reviseOrganizationLadder = (options) => (options.client ?? client).put({
|
|
3605
3657
|
security: [{
|
|
3606
3658
|
key: 'BearerAuth',
|
|
3607
3659
|
scheme: 'bearer',
|
|
@@ -3611,7 +3663,7 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
|
|
|
3611
3663
|
name: 'X-API-Key',
|
|
3612
3664
|
type: 'apiKey'
|
|
3613
3665
|
}],
|
|
3614
|
-
url: '/
|
|
3666
|
+
url: '/workforce/v1/ladders/{id}',
|
|
3615
3667
|
...options,
|
|
3616
3668
|
headers: {
|
|
3617
3669
|
'Content-Type': 'application/json',
|
|
@@ -3619,11 +3671,11 @@ export const reviseOrganizationKeyResult = (options) => (options.client ?? clien
|
|
|
3619
3671
|
}
|
|
3620
3672
|
});
|
|
3621
3673
|
/**
|
|
3622
|
-
* List
|
|
3674
|
+
* List positions
|
|
3623
3675
|
*
|
|
3624
|
-
* Lists
|
|
3676
|
+
* Lists positions across the organization ordered by department and then number, vacant ones included; narrow it with department_id, job_id, status or is_head. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100, a non-boolean is_head or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/positions?department_id=dept_123&status=active.
|
|
3625
3677
|
*/
|
|
3626
|
-
export const
|
|
3678
|
+
export const listOrganizationPositions = (options) => (options?.client ?? client).get({
|
|
3627
3679
|
security: [{
|
|
3628
3680
|
key: 'BearerAuth',
|
|
3629
3681
|
scheme: 'bearer',
|
|
@@ -3633,15 +3685,15 @@ export const listOrganizationSpecs = (options) => (options?.client ?? client).ge
|
|
|
3633
3685
|
name: 'X-API-Key',
|
|
3634
3686
|
type: 'apiKey'
|
|
3635
3687
|
}],
|
|
3636
|
-
url: '/
|
|
3688
|
+
url: '/workforce/v1/positions',
|
|
3637
3689
|
...options
|
|
3638
3690
|
});
|
|
3639
3691
|
/**
|
|
3640
|
-
*
|
|
3692
|
+
* Open positions
|
|
3641
3693
|
*
|
|
3642
|
-
*
|
|
3694
|
+
* Opens one or more vacant positions in a department, optionally from a job: the job's name becomes the title and its duties and methods are copied onto each position. Without job_id a title is required. Positions get consecutive numbers in the department that are never reused. Open a position and then hire into it; the root department's head position already exists and is held by the organization's owner, seated automatically when the organization is first used. request_id makes the call idempotent: repeating it returns the first result and opens nothing more. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for a count outside 1 to 100, a missing request_id or an unknown body field; 400 POSITION_NAME_REQUIRED without job_id and title; 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND, JOB_NOT_FOUND, JOB_LEVEL_NOT_FOUND or POSITION_NOT_FOUND; 409 DEPARTMENT_DISSOLVED, JOB_RETIRED or POSITION_CLOSED (the reports_to target). Example body: {"department_id":"dept_123","job_id":"jpr_123","count":2,"request_id":"open-support-2026-11"}.
|
|
3643
3695
|
*/
|
|
3644
|
-
export const
|
|
3696
|
+
export const openOrganizationPositions = (options) => (options.client ?? client).post({
|
|
3645
3697
|
security: [{
|
|
3646
3698
|
key: 'BearerAuth',
|
|
3647
3699
|
scheme: 'bearer',
|
|
@@ -3651,15 +3703,19 @@ export const getOrganizationSpec = (options) => (options.client ?? client).get({
|
|
|
3651
3703
|
name: 'X-API-Key',
|
|
3652
3704
|
type: 'apiKey'
|
|
3653
3705
|
}],
|
|
3654
|
-
url: '/
|
|
3655
|
-
...options
|
|
3706
|
+
url: '/workforce/v1/positions',
|
|
3707
|
+
...options,
|
|
3708
|
+
headers: {
|
|
3709
|
+
'Content-Type': 'application/json',
|
|
3710
|
+
...options.headers
|
|
3711
|
+
}
|
|
3656
3712
|
});
|
|
3657
3713
|
/**
|
|
3658
|
-
*
|
|
3714
|
+
* Get a position
|
|
3659
3715
|
*
|
|
3660
|
-
*
|
|
3716
|
+
* Reads one position with its derived effective_reports_to line. Read-only. Errors: 404 POSITION_NOT_FOUND when the id is not a position of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
3661
3717
|
*/
|
|
3662
|
-
export const
|
|
3718
|
+
export const getOrganizationPosition = (options) => (options.client ?? client).get({
|
|
3663
3719
|
security: [{
|
|
3664
3720
|
key: 'BearerAuth',
|
|
3665
3721
|
scheme: 'bearer',
|
|
@@ -3669,37 +3725,15 @@ export const reviseOrganizationSpec = (options) => (options.client ?? client).pu
|
|
|
3669
3725
|
name: 'X-API-Key',
|
|
3670
3726
|
type: 'apiKey'
|
|
3671
3727
|
}],
|
|
3672
|
-
url: '/
|
|
3673
|
-
...options,
|
|
3674
|
-
headers: {
|
|
3675
|
-
'Content-Type': 'application/json',
|
|
3676
|
-
...options.headers
|
|
3677
|
-
}
|
|
3678
|
-
});
|
|
3679
|
-
/**
|
|
3680
|
-
* List spec revisions
|
|
3681
|
-
*
|
|
3682
|
-
* Lists every stored revision of one subject's spec, newest first, each with its body, author and creation instant; use it to see what changed over time or to pick a revision to read or diff. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist.
|
|
3683
|
-
*/
|
|
3684
|
-
export const listOrganizationSpecRevisions = (options) => (options.client ?? client).get({
|
|
3685
|
-
security: [{
|
|
3686
|
-
key: 'BearerAuth',
|
|
3687
|
-
scheme: 'bearer',
|
|
3688
|
-
type: 'http'
|
|
3689
|
-
}, {
|
|
3690
|
-
key: 'ApiKeyAuth',
|
|
3691
|
-
name: 'X-API-Key',
|
|
3692
|
-
type: 'apiKey'
|
|
3693
|
-
}],
|
|
3694
|
-
url: '/organization/v1/specs/{kind}/{id}/revisions',
|
|
3728
|
+
url: '/workforce/v1/positions/{id}',
|
|
3695
3729
|
...options
|
|
3696
3730
|
});
|
|
3697
3731
|
/**
|
|
3698
|
-
*
|
|
3732
|
+
* Revise a position
|
|
3699
3733
|
*
|
|
3700
|
-
*
|
|
3734
|
+
* Changes the title, duties or methods of one position; the job it was opened from is not touched, and the position's own copy is what changes. Sending no field returns the position unchanged. Requires an organization owner or admin, or the head of the position's department or of a department above it. A frozen position can still be revised. Errors: 400 INVALID_PARAMS for an empty title, a title over 100 characters or text over 4000 characters; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED.
|
|
3701
3735
|
*/
|
|
3702
|
-
export const
|
|
3736
|
+
export const reviseOrganizationPosition = (options) => (options.client ?? client).patch({
|
|
3703
3737
|
security: [{
|
|
3704
3738
|
key: 'BearerAuth',
|
|
3705
3739
|
scheme: 'bearer',
|
|
@@ -3709,15 +3743,19 @@ export const diffOrganizationSpec = (options) => (options.client ?? client).get(
|
|
|
3709
3743
|
name: 'X-API-Key',
|
|
3710
3744
|
type: 'apiKey'
|
|
3711
3745
|
}],
|
|
3712
|
-
url: '/
|
|
3713
|
-
...options
|
|
3746
|
+
url: '/workforce/v1/positions/{id}',
|
|
3747
|
+
...options,
|
|
3748
|
+
headers: {
|
|
3749
|
+
'Content-Type': 'application/json',
|
|
3750
|
+
...options.headers
|
|
3751
|
+
}
|
|
3714
3752
|
});
|
|
3715
3753
|
/**
|
|
3716
|
-
*
|
|
3754
|
+
* Close a position
|
|
3717
3755
|
*
|
|
3718
|
-
*
|
|
3756
|
+
* Closes a vacant position for good; its number stays used and the record stays for history. A closed head position stops being the head, so the department has no head until you designate another. Closing a closed position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_OCCUPIED while someone still holds the position.
|
|
3719
3757
|
*/
|
|
3720
|
-
export const
|
|
3758
|
+
export const closeOrganizationPosition = (options) => (options.client ?? client).post({
|
|
3721
3759
|
security: [{
|
|
3722
3760
|
key: 'BearerAuth',
|
|
3723
3761
|
scheme: 'bearer',
|
|
@@ -3727,15 +3765,15 @@ export const getOrganizationEffectiveSpec = (options) => (options?.client ?? cli
|
|
|
3727
3765
|
name: 'X-API-Key',
|
|
3728
3766
|
type: 'apiKey'
|
|
3729
3767
|
}],
|
|
3730
|
-
url: '/
|
|
3768
|
+
url: '/workforce/v1/positions/{id}/close',
|
|
3731
3769
|
...options
|
|
3732
3770
|
});
|
|
3733
3771
|
/**
|
|
3734
|
-
*
|
|
3772
|
+
* Freeze a position
|
|
3735
3773
|
*
|
|
3736
|
-
*
|
|
3774
|
+
* Freezes a vacant position to keep it without using it, for example while hiring is paused; unfreeze brings it back. Freezing a frozen position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED; 409 POSITION_OCCUPIED while someone still holds the position.
|
|
3737
3775
|
*/
|
|
3738
|
-
export const
|
|
3776
|
+
export const freezeOrganizationPosition = (options) => (options.client ?? client).post({
|
|
3739
3777
|
security: [{
|
|
3740
3778
|
key: 'BearerAuth',
|
|
3741
3779
|
scheme: 'bearer',
|
|
@@ -3745,15 +3783,15 @@ export const getOrganizationSpecSchema = (options) => (options?.client ?? client
|
|
|
3745
3783
|
name: 'X-API-Key',
|
|
3746
3784
|
type: 'apiKey'
|
|
3747
3785
|
}],
|
|
3748
|
-
url: '/
|
|
3786
|
+
url: '/workforce/v1/positions/{id}/freeze',
|
|
3749
3787
|
...options
|
|
3750
3788
|
});
|
|
3751
3789
|
/**
|
|
3752
|
-
*
|
|
3790
|
+
* Unfreeze a position
|
|
3753
3791
|
*
|
|
3754
|
-
*
|
|
3792
|
+
* Returns a frozen position to active. Unfreezing an active position returns it unchanged. Takes no body. Requires an organization owner or admin, or the head of the position's department or of a department above it. Errors: 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED.
|
|
3755
3793
|
*/
|
|
3756
|
-
export const
|
|
3794
|
+
export const unfreezeOrganizationPosition = (options) => (options.client ?? client).post({
|
|
3757
3795
|
security: [{
|
|
3758
3796
|
key: 'BearerAuth',
|
|
3759
3797
|
scheme: 'bearer',
|
|
@@ -3763,15 +3801,15 @@ export const planOrganizationReconcile = (options) => (options.client ?? client)
|
|
|
3763
3801
|
name: 'X-API-Key',
|
|
3764
3802
|
type: 'apiKey'
|
|
3765
3803
|
}],
|
|
3766
|
-
url: '/
|
|
3804
|
+
url: '/workforce/v1/positions/{id}/unfreeze',
|
|
3767
3805
|
...options
|
|
3768
3806
|
});
|
|
3769
3807
|
/**
|
|
3770
|
-
*
|
|
3808
|
+
* Reassign a position's manager
|
|
3771
3809
|
*
|
|
3772
|
-
*
|
|
3810
|
+
* Sets the position this position reports to, or sends null to return to the default line: the head position of its department, and for a head position the head of the parent department. Requires an organization owner or admin, or the head of the position's department or of a department above it. The target may be in any department. Errors: 400 REPORTING_CYCLE when the new line would loop back to this position; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND for the position or the target; 409 POSITION_CLOSED when either is closed.
|
|
3773
3811
|
*/
|
|
3774
|
-
export const
|
|
3812
|
+
export const reassignOrganizationPositionManager = (options) => (options.client ?? client).put({
|
|
3775
3813
|
security: [{
|
|
3776
3814
|
key: 'BearerAuth',
|
|
3777
3815
|
scheme: 'bearer',
|
|
@@ -3781,15 +3819,19 @@ export const getOrganizationReconcileStatus = (options) => (options.client ?? cl
|
|
|
3781
3819
|
name: 'X-API-Key',
|
|
3782
3820
|
type: 'apiKey'
|
|
3783
3821
|
}],
|
|
3784
|
-
url: '/
|
|
3785
|
-
...options
|
|
3822
|
+
url: '/workforce/v1/positions/{id}/manager',
|
|
3823
|
+
...options,
|
|
3824
|
+
headers: {
|
|
3825
|
+
'Content-Type': 'application/json',
|
|
3826
|
+
...options.headers
|
|
3827
|
+
}
|
|
3786
3828
|
});
|
|
3787
3829
|
/**
|
|
3788
|
-
*
|
|
3830
|
+
* Regrade a position
|
|
3789
3831
|
*
|
|
3790
|
-
*
|
|
3832
|
+
* Sets the job level of a position. If the position was opened from a job that lists allowed levels, the level must be one of them. Requires an organization owner or admin; a department head cannot regrade. Errors: 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 JOB_LEVEL_NOT_FOUND; 409 POSITION_CLOSED.
|
|
3791
3833
|
*/
|
|
3792
|
-
export const
|
|
3834
|
+
export const regradeOrganizationPosition = (options) => (options.client ?? client).put({
|
|
3793
3835
|
security: [{
|
|
3794
3836
|
key: 'BearerAuth',
|
|
3795
3837
|
scheme: 'bearer',
|
|
@@ -3799,7 +3841,7 @@ export const runOrganizationReconcile = (options) => (options.client ?? client).
|
|
|
3799
3841
|
name: 'X-API-Key',
|
|
3800
3842
|
type: 'apiKey'
|
|
3801
3843
|
}],
|
|
3802
|
-
url: '/
|
|
3844
|
+
url: '/workforce/v1/positions/{id}/level',
|
|
3803
3845
|
...options,
|
|
3804
3846
|
headers: {
|
|
3805
3847
|
'Content-Type': 'application/json',
|
|
@@ -3807,11 +3849,11 @@ export const runOrganizationReconcile = (options) => (options.client ?? client).
|
|
|
3807
3849
|
}
|
|
3808
3850
|
});
|
|
3809
3851
|
/**
|
|
3810
|
-
*
|
|
3852
|
+
* Designate a department head position
|
|
3811
3853
|
*
|
|
3812
|
-
*
|
|
3854
|
+
* Makes this position the head of its department; the previous head position stays an ordinary position. The head is a position, not a person, and positions in the department with no explicit manager report to it. Takes no body. Requires an organization owner or admin. Errors: 400 REPORTING_CYCLE when the change would make a position report into its own line; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 409 POSITION_CLOSED or POSITION_FROZEN, because only an active position can be head.
|
|
3813
3855
|
*/
|
|
3814
|
-
export const
|
|
3856
|
+
export const designateOrganizationPositionHead = (options) => (options.client ?? client).post({
|
|
3815
3857
|
security: [{
|
|
3816
3858
|
key: 'BearerAuth',
|
|
3817
3859
|
scheme: 'bearer',
|
|
@@ -3821,19 +3863,15 @@ export const pauseOrganizationReconcile = (options) => (options.client ?? client
|
|
|
3821
3863
|
name: 'X-API-Key',
|
|
3822
3864
|
type: 'apiKey'
|
|
3823
3865
|
}],
|
|
3824
|
-
url: '/
|
|
3825
|
-
...options
|
|
3826
|
-
headers: {
|
|
3827
|
-
'Content-Type': 'application/json',
|
|
3828
|
-
...options.headers
|
|
3829
|
-
}
|
|
3866
|
+
url: '/workforce/v1/positions/{id}/designate_head',
|
|
3867
|
+
...options
|
|
3830
3868
|
});
|
|
3831
3869
|
/**
|
|
3832
|
-
*
|
|
3870
|
+
* Hire into a position
|
|
3833
3871
|
*
|
|
3834
|
-
*
|
|
3872
|
+
* 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"}.
|
|
3835
3873
|
*/
|
|
3836
|
-
export const
|
|
3874
|
+
export const hireOrganizationPosition = (options) => (options.client ?? client).post({
|
|
3837
3875
|
security: [{
|
|
3838
3876
|
key: 'BearerAuth',
|
|
3839
3877
|
scheme: 'bearer',
|
|
@@ -3843,7 +3881,7 @@ export const resumeOrganizationReconcile = (options) => (options.client ?? clien
|
|
|
3843
3881
|
name: 'X-API-Key',
|
|
3844
3882
|
type: 'apiKey'
|
|
3845
3883
|
}],
|
|
3846
|
-
url: '/
|
|
3884
|
+
url: '/workforce/v1/positions/{id}/hire',
|
|
3847
3885
|
...options,
|
|
3848
3886
|
headers: {
|
|
3849
3887
|
'Content-Type': 'application/json',
|
|
@@ -3851,11 +3889,11 @@ export const resumeOrganizationReconcile = (options) => (options.client ?? clien
|
|
|
3851
3889
|
}
|
|
3852
3890
|
});
|
|
3853
3891
|
/**
|
|
3854
|
-
*
|
|
3892
|
+
* Replace a position's holder
|
|
3855
3893
|
*
|
|
3856
|
-
*
|
|
3894
|
+
* Ends the current holder's assignment with reason replaced and seats the successor in the same step, so the position is never vacant in between; the ended assignment records the successor's assignment id as successor_assignment_id. Nothing the predecessor learned or remembered passes to the successor, because experience belongs to the actor, not the position. The successor must exist in your organization and not be archived; it becomes primary if it holds nothing else, otherwise a concurrent assignment. If the predecessor was primary and holds other positions, the earliest of those becomes its primary. request_id makes the call idempotent: repeating it returns the first result and replaces nobody again. 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 successor or request_id, a successor that already holds this position or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND for the successor; 409 POSITION_VACANT when nobody holds the position, so use hire instead. Example body: {"successor":"agent:agent_123","request_id":"replace-support-1"}.
|
|
3857
3895
|
*/
|
|
3858
|
-
export const
|
|
3896
|
+
export const replaceOrganizationPositionHolder = (options) => (options.client ?? client).post({
|
|
3859
3897
|
security: [{
|
|
3860
3898
|
key: 'BearerAuth',
|
|
3861
3899
|
scheme: 'bearer',
|
|
@@ -3865,7 +3903,7 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
|
|
|
3865
3903
|
name: 'X-API-Key',
|
|
3866
3904
|
type: 'apiKey'
|
|
3867
3905
|
}],
|
|
3868
|
-
url: '/
|
|
3906
|
+
url: '/workforce/v1/positions/{id}/replace_holder',
|
|
3869
3907
|
...options,
|
|
3870
3908
|
headers: {
|
|
3871
3909
|
'Content-Type': 'application/json',
|
|
@@ -3873,11 +3911,11 @@ export const upgradeSandbox = (options) => (options.client ?? client).post({
|
|
|
3873
3911
|
}
|
|
3874
3912
|
});
|
|
3875
3913
|
/**
|
|
3876
|
-
*
|
|
3914
|
+
* List assignments
|
|
3877
3915
|
*
|
|
3878
|
-
*
|
|
3916
|
+
* Lists assignments, newest start first, each tying one actor (person or agent) to one position; use it to see who holds what, or the history of a position or an actor. Ended assignments are included unless you filter active=true. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100, a non-boolean active or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/assignments?position_id=pos_123&active=true.
|
|
3879
3917
|
*/
|
|
3880
|
-
export const
|
|
3918
|
+
export const listOrganizationAssignments = (options) => (options?.client ?? client).get({
|
|
3881
3919
|
security: [{
|
|
3882
3920
|
key: 'BearerAuth',
|
|
3883
3921
|
scheme: 'bearer',
|
|
@@ -3887,19 +3925,15 @@ export const extendSandbox = (options) => (options.client ?? client).post({
|
|
|
3887
3925
|
name: 'X-API-Key',
|
|
3888
3926
|
type: 'apiKey'
|
|
3889
3927
|
}],
|
|
3890
|
-
url: '/
|
|
3891
|
-
...options
|
|
3892
|
-
headers: {
|
|
3893
|
-
'Content-Type': 'application/json',
|
|
3894
|
-
...options.headers
|
|
3895
|
-
}
|
|
3928
|
+
url: '/workforce/v1/assignments',
|
|
3929
|
+
...options
|
|
3896
3930
|
});
|
|
3897
3931
|
/**
|
|
3898
|
-
*
|
|
3932
|
+
* Get an assignment
|
|
3899
3933
|
*
|
|
3900
|
-
*
|
|
3934
|
+
* Reads one assignment, current or ended, with who appointed and ended it and, for a replaced holder, the successor's assignment id. Read-only. Errors: 404 ASSIGNMENT_NOT_FOUND when the id is not an assignment of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
3901
3935
|
*/
|
|
3902
|
-
export const
|
|
3936
|
+
export const getOrganizationAssignment = (options) => (options.client ?? client).get({
|
|
3903
3937
|
security: [{
|
|
3904
3938
|
key: 'BearerAuth',
|
|
3905
3939
|
scheme: 'bearer',
|
|
@@ -3909,15 +3943,15 @@ export const listObservedProcesses = (options) => (options.client ?? client).get
|
|
|
3909
3943
|
name: 'X-API-Key',
|
|
3910
3944
|
type: 'apiKey'
|
|
3911
3945
|
}],
|
|
3912
|
-
url: '/
|
|
3946
|
+
url: '/workforce/v1/assignments/{id}',
|
|
3913
3947
|
...options
|
|
3914
3948
|
});
|
|
3915
3949
|
/**
|
|
3916
|
-
*
|
|
3950
|
+
* Transfer an assignment to another position
|
|
3917
3951
|
*
|
|
3918
|
-
*
|
|
3952
|
+
* Moves the actor from its current position to another vacant one: the current assignment ends with reason transferred and a new one starts in the target position, keeping the primary flag, so a primary assignment stays primary. Use it for a move or promotion; use terminate when the actor leaves the position without another. Only a current assignment can be transferred. The target must be active and vacant. Needs write rights over both departments: an organization owner or admin, or a head whose department is, or is above, both the department being left and the target's department. Errors: 400 INVALID_PARAMS for a missing to_position_id or a target equal to the current position; 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or already ended assignment; 404 POSITION_NOT_FOUND for the target; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED for the target. Example body: {"to_position_id":"pos_456"}.
|
|
3919
3953
|
*/
|
|
3920
|
-
export const
|
|
3954
|
+
export const transferOrganizationAssignment = (options) => (options.client ?? client).post({
|
|
3921
3955
|
security: [{
|
|
3922
3956
|
key: 'BearerAuth',
|
|
3923
3957
|
scheme: 'bearer',
|
|
@@ -3927,15 +3961,19 @@ export const getObservedProcessOutput = (options) => (options.client ?? client).
|
|
|
3927
3961
|
name: 'X-API-Key',
|
|
3928
3962
|
type: 'apiKey'
|
|
3929
3963
|
}],
|
|
3930
|
-
url: '/
|
|
3931
|
-
...options
|
|
3964
|
+
url: '/workforce/v1/assignments/{id}/transfer',
|
|
3965
|
+
...options,
|
|
3966
|
+
headers: {
|
|
3967
|
+
'Content-Type': 'application/json',
|
|
3968
|
+
...options.headers
|
|
3969
|
+
}
|
|
3932
3970
|
});
|
|
3933
3971
|
/**
|
|
3934
|
-
*
|
|
3972
|
+
* End an assignment
|
|
3935
3973
|
*
|
|
3936
|
-
*
|
|
3974
|
+
* Ends a current assignment with the reason you give; the position becomes vacant and the assignment stays as history that never revives. If it was the actor's primary and the actor still holds other positions, the earliest of those becomes primary. Use transfer instead to move the actor to another position. 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 reason or one outside the list; 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or already ended assignment. Example body: {"reason":"resigned"}.
|
|
3937
3975
|
*/
|
|
3938
|
-
export const
|
|
3976
|
+
export const terminateOrganizationAssignment = (options) => (options.client ?? client).post({
|
|
3939
3977
|
security: [{
|
|
3940
3978
|
key: 'BearerAuth',
|
|
3941
3979
|
scheme: 'bearer',
|
|
@@ -3945,7 +3983,7 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
|
|
|
3945
3983
|
name: 'X-API-Key',
|
|
3946
3984
|
type: 'apiKey'
|
|
3947
3985
|
}],
|
|
3948
|
-
url: '/
|
|
3986
|
+
url: '/workforce/v1/assignments/{id}/terminate',
|
|
3949
3987
|
...options,
|
|
3950
3988
|
headers: {
|
|
3951
3989
|
'Content-Type': 'application/json',
|
|
@@ -3953,11 +3991,11 @@ export const startSandboxTask = (options) => (options.client ?? client).post({
|
|
|
3953
3991
|
}
|
|
3954
3992
|
});
|
|
3955
3993
|
/**
|
|
3956
|
-
*
|
|
3994
|
+
* Make an assignment primary
|
|
3957
3995
|
*
|
|
3958
|
-
*
|
|
3996
|
+
* Makes this assignment the actor's primary one; the actor's previous primary becomes a concurrent assignment in the same step. Use it when an actor holds several positions and its main one changes. An assignment that is already primary is returned unchanged. Takes no body. Requires an organization owner or admin; a department head cannot call this. Errors: 403 PERMISSION_DENIED; 404 ASSIGNMENT_NOT_FOUND for an unknown or ended assignment.
|
|
3959
3997
|
*/
|
|
3960
|
-
export const
|
|
3998
|
+
export const makePrimaryOrganizationAssignment = (options) => (options.client ?? client).post({
|
|
3961
3999
|
security: [{
|
|
3962
4000
|
key: 'BearerAuth',
|
|
3963
4001
|
scheme: 'bearer',
|
|
@@ -3967,89 +4005,51 @@ export const getSandboxTaskLog = (options) => (options.client ?? client).get({
|
|
|
3967
4005
|
name: 'X-API-Key',
|
|
3968
4006
|
type: 'apiKey'
|
|
3969
4007
|
}],
|
|
3970
|
-
url: '/
|
|
4008
|
+
url: '/workforce/v1/assignments/{id}/make_primary',
|
|
3971
4009
|
...options
|
|
3972
4010
|
});
|
|
3973
4011
|
/**
|
|
3974
|
-
*
|
|
4012
|
+
* List actors holding positions
|
|
3975
4013
|
*
|
|
3976
|
-
*
|
|
4014
|
+
* Lists every actor, person or agent, that currently holds at least one position, ordered by actor address, each with its primary position and all positions it holds; use it to see who works where. Actors holding nothing are not listed. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/actors?department_id=dept_123.
|
|
3977
4015
|
*/
|
|
3978
|
-
export const
|
|
3979
|
-
security: [
|
|
3980
|
-
|
|
3981
|
-
key: 'sandbox-ApiKeyAuth',
|
|
3982
|
-
name: 'X-API-Key',
|
|
3983
|
-
type: 'apiKey'
|
|
3984
|
-
},
|
|
3985
|
-
{
|
|
3986
|
-
key: 'sandbox-AuthProviderBearerAuth',
|
|
4016
|
+
export const listOrganizationActors = (options) => (options?.client ?? client).get({
|
|
4017
|
+
security: [{
|
|
4018
|
+
key: 'BearerAuth',
|
|
3987
4019
|
scheme: 'bearer',
|
|
3988
4020
|
type: 'http'
|
|
3989
|
-
},
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
name: 'X-Team-ID',
|
|
3993
|
-
type: 'apiKey'
|
|
3994
|
-
},
|
|
3995
|
-
{ name: 'X-Admin-Token', type: 'apiKey' },
|
|
3996
|
-
{
|
|
3997
|
-
key: 'sandbox-AdminTeamAuth',
|
|
3998
|
-
name: 'X-Team-ID',
|
|
4021
|
+
}, {
|
|
4022
|
+
key: 'ApiKeyAuth',
|
|
4023
|
+
name: 'X-API-Key',
|
|
3999
4024
|
type: 'apiKey'
|
|
4000
|
-
},
|
|
4001
|
-
|
|
4002
|
-
key: 'sandbox-AdminJWTAuth',
|
|
4003
|
-
scheme: 'bearer',
|
|
4004
|
-
type: 'http'
|
|
4005
|
-
}
|
|
4006
|
-
],
|
|
4007
|
-
url: '/sandbox/v1/sandboxes/{sandboxID}',
|
|
4025
|
+
}],
|
|
4026
|
+
url: '/workforce/v1/actors',
|
|
4008
4027
|
...options
|
|
4009
4028
|
});
|
|
4010
4029
|
/**
|
|
4011
|
-
*
|
|
4030
|
+
* Get the position chain of an actor
|
|
4012
4031
|
*
|
|
4013
|
-
*
|
|
4032
|
+
* Reads where an actor, person or agent, sits in the organization: its primary position and its concurrent positions, each with the department path from the root down with every level's charter, the job, title and level name, the manager (the first filled position up the reporting line), the position's own duties and methods, and objectives. Use it to answer who this actor is and what it is responsible for. An actor that holds no position is not an error: primary is null and concurrent is empty. Read-only. Errors: 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
4014
4033
|
*/
|
|
4015
|
-
export const
|
|
4016
|
-
security: [
|
|
4017
|
-
|
|
4018
|
-
key: 'sandbox-ApiKeyAuth',
|
|
4019
|
-
name: 'X-API-Key',
|
|
4020
|
-
type: 'apiKey'
|
|
4021
|
-
},
|
|
4022
|
-
{
|
|
4023
|
-
key: 'sandbox-AuthProviderBearerAuth',
|
|
4034
|
+
export const getOrganizationActor = (options) => (options.client ?? client).get({
|
|
4035
|
+
security: [{
|
|
4036
|
+
key: 'BearerAuth',
|
|
4024
4037
|
scheme: 'bearer',
|
|
4025
4038
|
type: 'http'
|
|
4026
|
-
},
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
name: 'X-Team-ID',
|
|
4030
|
-
type: 'apiKey'
|
|
4031
|
-
},
|
|
4032
|
-
{ name: 'X-Admin-Token', type: 'apiKey' },
|
|
4033
|
-
{
|
|
4034
|
-
key: 'sandbox-AdminTeamAuth',
|
|
4035
|
-
name: 'X-Team-ID',
|
|
4039
|
+
}, {
|
|
4040
|
+
key: 'ApiKeyAuth',
|
|
4041
|
+
name: 'X-API-Key',
|
|
4036
4042
|
type: 'apiKey'
|
|
4037
|
-
},
|
|
4038
|
-
|
|
4039
|
-
key: 'sandbox-AdminJWTAuth',
|
|
4040
|
-
scheme: 'bearer',
|
|
4041
|
-
type: 'http'
|
|
4042
|
-
}
|
|
4043
|
-
],
|
|
4044
|
-
url: '/sandbox/v1/sandboxes/{sandboxID}',
|
|
4043
|
+
}],
|
|
4044
|
+
url: '/workforce/v1/actors/{actor}',
|
|
4045
4045
|
...options
|
|
4046
4046
|
});
|
|
4047
4047
|
/**
|
|
4048
|
-
*
|
|
4048
|
+
* List periods
|
|
4049
4049
|
*
|
|
4050
|
-
*
|
|
4050
|
+
* Lists the periods of your organization's OKR calendar, newest start first; use it to find the period_id to set objectives in, or to see which periods are still open for grading. Closed periods are included. Filter cadence to read one level of the calendar. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/periods?cadence=quarter.
|
|
4051
4051
|
*/
|
|
4052
|
-
export const
|
|
4052
|
+
export const listOrganizationPeriods = (options) => (options?.client ?? client).get({
|
|
4053
4053
|
security: [{
|
|
4054
4054
|
key: 'BearerAuth',
|
|
4055
4055
|
scheme: 'bearer',
|
|
@@ -4059,21 +4059,15 @@ export const renameSandbox = (options) => (options.client ?? client).patch({
|
|
|
4059
4059
|
name: 'X-API-Key',
|
|
4060
4060
|
type: 'apiKey'
|
|
4061
4061
|
}],
|
|
4062
|
-
url: '/
|
|
4063
|
-
...options
|
|
4064
|
-
headers: {
|
|
4065
|
-
'Content-Type': 'application/json',
|
|
4066
|
-
...options.headers
|
|
4067
|
-
}
|
|
4062
|
+
url: '/workforce/v1/periods',
|
|
4063
|
+
...options
|
|
4068
4064
|
});
|
|
4069
4065
|
/**
|
|
4070
|
-
*
|
|
4071
|
-
*
|
|
4072
|
-
* 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.
|
|
4066
|
+
* Open a period
|
|
4073
4067
|
*
|
|
4074
|
-
*
|
|
4068
|
+
* Opens a period in your organization's single OKR calendar of years, halves and quarters; objectives are set inside a period. Its status is derived, never sent: planning before start_on, active from start_on through end_on inclusive, grading after end_on, and closed only when you close it. Periods of the same cadence never overlap. Give parent_id to place a half or quarter inside a coarser period (year > half > quarter) that contains its whole range. Dates are calendar dates, and today is read as the UTC date. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty name, a name over 100 characters, a cadence outside the list, a date that is not YYYY-MM-DD, start_on after end_on or an unknown body field; 400 PERIOD_OVERLAP when a period of the same cadence already covers part of the range, or the parent is not coarser or does not contain the range; 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND when parent_id does not exist. Example body: {"name":"2026 Q4","cadence":"quarter","start_on":"2026-10-01","end_on":"2026-12-31"}.
|
|
4075
4069
|
*/
|
|
4076
|
-
export const
|
|
4070
|
+
export const openOrganizationPeriod = (options) => (options.client ?? client).post({
|
|
4077
4071
|
security: [{
|
|
4078
4072
|
key: 'BearerAuth',
|
|
4079
4073
|
scheme: 'bearer',
|
|
@@ -4083,7 +4077,7 @@ export const actOnSandboxDisplay = (options) => (options.client ?? client).post(
|
|
|
4083
4077
|
name: 'X-API-Key',
|
|
4084
4078
|
type: 'apiKey'
|
|
4085
4079
|
}],
|
|
4086
|
-
url: '/
|
|
4080
|
+
url: '/workforce/v1/periods',
|
|
4087
4081
|
...options,
|
|
4088
4082
|
headers: {
|
|
4089
4083
|
'Content-Type': 'application/json',
|
|
@@ -4091,11 +4085,11 @@ export const actOnSandboxDisplay = (options) => (options.client ?? client).post(
|
|
|
4091
4085
|
}
|
|
4092
4086
|
});
|
|
4093
4087
|
/**
|
|
4094
|
-
*
|
|
4088
|
+
* Get a period
|
|
4095
4089
|
*
|
|
4096
|
-
*
|
|
4090
|
+
* Reads one period with its derived status, so you can tell whether it is still planning, active, in grading or closed. Read-only. Errors: 404 PERIOD_NOT_FOUND when the id is not a period of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
4097
4091
|
*/
|
|
4098
|
-
export const
|
|
4092
|
+
export const getOrganizationPeriod = (options) => (options.client ?? client).get({
|
|
4099
4093
|
security: [{
|
|
4100
4094
|
key: 'BearerAuth',
|
|
4101
4095
|
scheme: 'bearer',
|
|
@@ -4105,15 +4099,15 @@ export const removeSandboxFile = (options) => (options.client ?? client).delete(
|
|
|
4105
4099
|
name: 'X-API-Key',
|
|
4106
4100
|
type: 'apiKey'
|
|
4107
4101
|
}],
|
|
4108
|
-
url: '/
|
|
4102
|
+
url: '/workforce/v1/periods/{id}',
|
|
4109
4103
|
...options
|
|
4110
4104
|
});
|
|
4111
4105
|
/**
|
|
4112
|
-
*
|
|
4106
|
+
* Close a period
|
|
4113
4107
|
*
|
|
4114
|
-
*
|
|
4108
|
+
* Closes a period once its objectives are graded: closed is the only status you set yourself, and it never reverts. After it, objectives and key results of the period can no longer be set or revised. Closing does not grade or change any objective. Closing a period that is already closed returns it unchanged. Takes no body. Requires an organization owner or admin. Errors: 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND.
|
|
4115
4109
|
*/
|
|
4116
|
-
export const
|
|
4110
|
+
export const closeOrganizationPeriod = (options) => (options.client ?? client).post({
|
|
4117
4111
|
security: [{
|
|
4118
4112
|
key: 'BearerAuth',
|
|
4119
4113
|
scheme: 'bearer',
|
|
@@ -4123,15 +4117,15 @@ export const readSandboxFile = (options) => (options.client ?? client).get({
|
|
|
4123
4117
|
name: 'X-API-Key',
|
|
4124
4118
|
type: 'apiKey'
|
|
4125
4119
|
}],
|
|
4126
|
-
url: '/
|
|
4120
|
+
url: '/workforce/v1/periods/{id}/close',
|
|
4127
4121
|
...options
|
|
4128
4122
|
});
|
|
4129
4123
|
/**
|
|
4130
|
-
*
|
|
4124
|
+
* List objectives
|
|
4131
4125
|
*
|
|
4132
|
-
*
|
|
4126
|
+
* Lists objectives, oldest first, each with its scope, the parents it aligns to and, once graded, its result and score; use it to find an objective id or to read one period or one department's objectives. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/objectives?period_id=prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38&status=active.
|
|
4133
4127
|
*/
|
|
4134
|
-
export const
|
|
4128
|
+
export const listOrganizationObjectives = (options) => (options?.client ?? client).get({
|
|
4135
4129
|
security: [{
|
|
4136
4130
|
key: 'BearerAuth',
|
|
4137
4131
|
scheme: 'bearer',
|
|
@@ -4141,19 +4135,15 @@ export const writeSandboxFile = (options) => (options.client ?? client).put({
|
|
|
4141
4135
|
name: 'X-API-Key',
|
|
4142
4136
|
type: 'apiKey'
|
|
4143
4137
|
}],
|
|
4144
|
-
url: '/
|
|
4145
|
-
...options
|
|
4146
|
-
headers: {
|
|
4147
|
-
'Content-Type': 'application/json',
|
|
4148
|
-
...options.headers
|
|
4149
|
-
}
|
|
4138
|
+
url: '/workforce/v1/objectives',
|
|
4139
|
+
...options
|
|
4150
4140
|
});
|
|
4151
4141
|
/**
|
|
4152
|
-
*
|
|
4142
|
+
* Set an objective
|
|
4153
4143
|
*
|
|
4154
|
-
*
|
|
4144
|
+
* Sets an objective: what a department or a position is trying to reach in one open period. It hangs on a department or a position of your organization's tree, and company objectives hang on the root department. It starts active with no parents; align it to higher objectives with the align operation, and add key results with the key results operations. Requires an organization owner or admin, or the head of the objective's home department (the department itself, or the department of the position). Errors: 400 INVALID_PARAMS for an empty title, a title over 200 characters, a description over 2000 characters, a scope kind outside the list or an unknown body field; 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND, DEPARTMENT_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED, DEPARTMENT_DISSOLVED or POSITION_CLOSED. Example body: {"period_id":"prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38","scope":{"kind":"department","id":"dept_4c2e9a17d0b34f58a6e1b3c7d9f20e84"},"title":"Cut first-response time"}.
|
|
4155
4145
|
*/
|
|
4156
|
-
export const
|
|
4146
|
+
export const setOrganizationObjective = (options) => (options.client ?? client).post({
|
|
4157
4147
|
security: [{
|
|
4158
4148
|
key: 'BearerAuth',
|
|
4159
4149
|
scheme: 'bearer',
|
|
@@ -4163,15 +4153,19 @@ export const listSandboxFiles = (options) => (options.client ?? client).get({
|
|
|
4163
4153
|
name: 'X-API-Key',
|
|
4164
4154
|
type: 'apiKey'
|
|
4165
4155
|
}],
|
|
4166
|
-
url: '/
|
|
4167
|
-
...options
|
|
4156
|
+
url: '/workforce/v1/objectives',
|
|
4157
|
+
...options,
|
|
4158
|
+
headers: {
|
|
4159
|
+
'Content-Type': 'application/json',
|
|
4160
|
+
...options.headers
|
|
4161
|
+
}
|
|
4168
4162
|
});
|
|
4169
4163
|
/**
|
|
4170
|
-
*
|
|
4164
|
+
* Get an objective
|
|
4171
4165
|
*
|
|
4172
|
-
*
|
|
4166
|
+
* Reads one objective with its scope, the parents it aligns to with their weights, its status and, once graded, its result, score and grade note. Its key results are read with the key results list filtered by objective_id. Read-only. Errors: 404 OBJECTIVE_NOT_FOUND when the id is not an objective of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
4173
4167
|
*/
|
|
4174
|
-
export const
|
|
4168
|
+
export const getOrganizationObjective = (options) => (options.client ?? client).get({
|
|
4175
4169
|
security: [{
|
|
4176
4170
|
key: 'BearerAuth',
|
|
4177
4171
|
scheme: 'bearer',
|
|
@@ -4181,15 +4175,15 @@ export const makeSandboxDirectory = (options) => (options.client ?? client).post
|
|
|
4181
4175
|
name: 'X-API-Key',
|
|
4182
4176
|
type: 'apiKey'
|
|
4183
4177
|
}],
|
|
4184
|
-
url: '/
|
|
4178
|
+
url: '/workforce/v1/objectives/{id}',
|
|
4185
4179
|
...options
|
|
4186
4180
|
});
|
|
4187
4181
|
/**
|
|
4188
|
-
*
|
|
4182
|
+
* Revise an objective
|
|
4189
4183
|
*
|
|
4190
|
-
*
|
|
4184
|
+
* Rewords an active objective: change its title, its description or both; send at least one. Its period, scope and alignment do not change here; use align for parents, and grade to close it. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS when no field is given, a title is empty or over 200 characters, or a description is over 2000 characters; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 409 PERIOD_CLOSED when the objective was already graded or its period is closed. Example body: {"title":"Cut first-response time to under 2 hours"}.
|
|
4191
4185
|
*/
|
|
4192
|
-
export const
|
|
4186
|
+
export const reviseOrganizationObjective = (options) => (options.client ?? client).patch({
|
|
4193
4187
|
security: [{
|
|
4194
4188
|
key: 'BearerAuth',
|
|
4195
4189
|
scheme: 'bearer',
|
|
@@ -4199,7 +4193,7 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
|
|
|
4199
4193
|
name: 'X-API-Key',
|
|
4200
4194
|
type: 'apiKey'
|
|
4201
4195
|
}],
|
|
4202
|
-
url: '/
|
|
4196
|
+
url: '/workforce/v1/objectives/{id}',
|
|
4203
4197
|
...options,
|
|
4204
4198
|
headers: {
|
|
4205
4199
|
'Content-Type': 'application/json',
|
|
@@ -4207,11 +4201,11 @@ export const runSandboxCommand = (options) => (options.client ?? client).post({
|
|
|
4207
4201
|
}
|
|
4208
4202
|
});
|
|
4209
4203
|
/**
|
|
4210
|
-
*
|
|
4204
|
+
* Align an objective to parent objectives
|
|
4211
4205
|
*
|
|
4212
|
-
*
|
|
4206
|
+
* Replaces the whole set of parent objectives this objective contributes to; send an empty parents array to remove its alignment. An objective aligns only upward: each parent must hang on the objective's own department or on a department above it, the objective cannot be its own parent, and the alignment graph must stay free of cycles. Each weight is greater than 0 and at most 1, and a parent may appear once. A closed parent is refused. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for a weight outside the range, a repeated parent or an unknown body field; 400 ALIGNMENT_CYCLE when a parent is the objective itself or the alignment would loop; 400 SCOPE_MISMATCH when a parent hangs outside the objective's department and its ancestors; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND for the objective or a parent; 409 PERIOD_CLOSED when a parent is closed. Example body: {"parents":[{"objective_id":"obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96","weight":1}]}.
|
|
4213
4207
|
*/
|
|
4214
|
-
export const
|
|
4208
|
+
export const alignOrganizationObjective = (options) => (options.client ?? client).put({
|
|
4215
4209
|
security: [{
|
|
4216
4210
|
key: 'BearerAuth',
|
|
4217
4211
|
scheme: 'bearer',
|
|
@@ -4221,15 +4215,19 @@ export const createByodPairing = (options) => (options?.client ?? client).post({
|
|
|
4221
4215
|
name: 'X-API-Key',
|
|
4222
4216
|
type: 'apiKey'
|
|
4223
4217
|
}],
|
|
4224
|
-
url: '/
|
|
4225
|
-
...options
|
|
4218
|
+
url: '/workforce/v1/objectives/{id}/parents',
|
|
4219
|
+
...options,
|
|
4220
|
+
headers: {
|
|
4221
|
+
'Content-Type': 'application/json',
|
|
4222
|
+
...options.headers
|
|
4223
|
+
}
|
|
4226
4224
|
});
|
|
4227
4225
|
/**
|
|
4228
|
-
*
|
|
4226
|
+
* Grade an objective
|
|
4229
4227
|
*
|
|
4230
|
-
*
|
|
4228
|
+
* Grades an objective and closes it in place: records its result, its score from 0 to 1, an optional note, and the scores of the key results you list. A key result you leave out keeps no score. Grading happens once; a closed objective cannot be graded again. When the objective has any committed key result and the result is not achieved, a note is required. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for a result outside the list, a non-numeric score or a note over 2000 characters; 400 SCORE_OUT_OF_RANGE when any score is outside 0 to 1; 400 GRADE_NOTE_REQUIRED when a committed objective is graded other than achieved without a note; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 404 KEY_RESULT_NOT_FOUND when a listed key result does not belong to this objective; 409 PERIOD_CLOSED when the objective is already closed. Example body: {"result":"partial","score":0.6,"note":"Hiring slipped a month."}.
|
|
4231
4229
|
*/
|
|
4232
|
-
export const
|
|
4230
|
+
export const gradeOrganizationObjective = (options) => (options.client ?? client).post({
|
|
4233
4231
|
security: [{
|
|
4234
4232
|
key: 'BearerAuth',
|
|
4235
4233
|
scheme: 'bearer',
|
|
@@ -4239,15 +4237,19 @@ export const listByodDevices = (options) => (options?.client ?? client).get({
|
|
|
4239
4237
|
name: 'X-API-Key',
|
|
4240
4238
|
type: 'apiKey'
|
|
4241
4239
|
}],
|
|
4242
|
-
url: '/
|
|
4243
|
-
...options
|
|
4240
|
+
url: '/workforce/v1/objectives/{id}/grade',
|
|
4241
|
+
...options,
|
|
4242
|
+
headers: {
|
|
4243
|
+
'Content-Type': 'application/json',
|
|
4244
|
+
...options.headers
|
|
4245
|
+
}
|
|
4244
4246
|
});
|
|
4245
4247
|
/**
|
|
4246
|
-
*
|
|
4248
|
+
* List key results
|
|
4247
4249
|
*
|
|
4248
|
-
*
|
|
4250
|
+
* Lists key results, oldest first, each with its metric, health, done flag and, once its objective is graded, its score; use it to read the key results of one objective or the ones a position owns. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/key_results?objective_id=obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96.
|
|
4249
4251
|
*/
|
|
4250
|
-
export const
|
|
4252
|
+
export const listOrganizationKeyResults = (options) => (options?.client ?? client).get({
|
|
4251
4253
|
security: [{
|
|
4252
4254
|
key: 'BearerAuth',
|
|
4253
4255
|
scheme: 'bearer',
|
|
@@ -4257,15 +4259,15 @@ export const getByodDevice = (options) => (options.client ?? client).get({
|
|
|
4257
4259
|
name: 'X-API-Key',
|
|
4258
4260
|
type: 'apiKey'
|
|
4259
4261
|
}],
|
|
4260
|
-
url: '/
|
|
4262
|
+
url: '/workforce/v1/key_results',
|
|
4261
4263
|
...options
|
|
4262
4264
|
});
|
|
4263
4265
|
/**
|
|
4264
|
-
*
|
|
4266
|
+
* Set a key result
|
|
4265
4267
|
*
|
|
4266
|
-
*
|
|
4268
|
+
* Sets a key result under an active objective: a measurable outcome owned by one position, whose current holder moves its progress. Give a metric to measure it by numbers; omit metric for a binary key result, whose progress is its done flag. It starts with health on_track, done false and no score. Requires an organization owner or admin, or the head of the objective's home department or of a department above it. Errors: 400 INVALID_PARAMS for an empty title, a title over 200 characters, a commitment outside the list, a metric whose target equals its initial value or whose unit is outside the list, or an unknown body field; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED when the objective is graded or its period is closed; 409 POSITION_CLOSED when the owner position is closed. Example body: {"objective_id":"obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96","title":"Median first response under 2 hours","owner_position_id":"pos_7a1c5e92d3b84f60a9e2c4d8b1f30a57","commitment":"committed","metric":{"initial":6,"target":2,"unit":"none"}}.
|
|
4267
4269
|
*/
|
|
4268
|
-
export const
|
|
4270
|
+
export const setOrganizationKeyResult = (options) => (options.client ?? client).post({
|
|
4269
4271
|
security: [{
|
|
4270
4272
|
key: 'BearerAuth',
|
|
4271
4273
|
scheme: 'bearer',
|
|
@@ -4275,7 +4277,7 @@ export const updateByodDevice = (options) => (options.client ?? client).patch({
|
|
|
4275
4277
|
name: 'X-API-Key',
|
|
4276
4278
|
type: 'apiKey'
|
|
4277
4279
|
}],
|
|
4278
|
-
url: '/
|
|
4280
|
+
url: '/workforce/v1/key_results',
|
|
4279
4281
|
...options,
|
|
4280
4282
|
headers: {
|
|
4281
4283
|
'Content-Type': 'application/json',
|
|
@@ -4283,11 +4285,11 @@ export const updateByodDevice = (options) => (options.client ?? client).patch({
|
|
|
4283
4285
|
}
|
|
4284
4286
|
});
|
|
4285
4287
|
/**
|
|
4286
|
-
*
|
|
4288
|
+
* Get a key result
|
|
4287
4289
|
*
|
|
4288
|
-
*
|
|
4290
|
+
* Reads one key result with its metric, its health, its done flag, its owner position and its score. Progress of a metric key result is (current - initial) / (target - initial), clamped between 0 and 1; a key result without a metric counts as 1 when done is true and 0 otherwise. Read-only. Errors: 404 KEY_RESULT_NOT_FOUND when the id is not a key result of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
|
|
4289
4291
|
*/
|
|
4290
|
-
export const
|
|
4292
|
+
export const getOrganizationKeyResult = (options) => (options.client ?? client).get({
|
|
4291
4293
|
security: [{
|
|
4292
4294
|
key: 'BearerAuth',
|
|
4293
4295
|
scheme: 'bearer',
|
|
@@ -4297,15 +4299,15 @@ export const disconnectByodDevice = (options) => (options.client ?? client).post
|
|
|
4297
4299
|
name: 'X-API-Key',
|
|
4298
4300
|
type: 'apiKey'
|
|
4299
4301
|
}],
|
|
4300
|
-
url: '/
|
|
4302
|
+
url: '/workforce/v1/key_results/{id}',
|
|
4301
4303
|
...options
|
|
4302
4304
|
});
|
|
4303
4305
|
/**
|
|
4304
|
-
*
|
|
4306
|
+
* Revise a key result
|
|
4305
4307
|
*
|
|
4306
|
-
*
|
|
4308
|
+
* Edits a key result; send at least one field. Progress is updated by this edit, not by check-in records: write metric.current for a metric key result, or done for a binary one, and set health as it changes. The holder of the owner position, when a person, may change only metric.current, health and done; an organization owner or admin, or the head of the objective's home department or of a department above it, may change any field. An agent holding the position cannot write it. metric replaces the whole metric; done applies only to a key result without a metric. Errors: 400 INVALID_PARAMS when no field is given, done is sent for a key result that has a metric, or a field is malformed; 403 NOT_POSITION_HOLDER when the caller is neither a manager nor the position's person holder; 403 PERMISSION_DENIED when a holder changes more than progress; 404 KEY_RESULT_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED when the objective is graded or its period is closed; 409 POSITION_CLOSED for a closed new owner. Example body: {"metric":{"initial":6,"current":3.5,"target":2,"unit":"none"},"health":"at_risk"}.
|
|
4307
4309
|
*/
|
|
4308
|
-
export const
|
|
4310
|
+
export const reviseOrganizationKeyResult = (options) => (options.client ?? client).patch({
|
|
4309
4311
|
security: [{
|
|
4310
4312
|
key: 'BearerAuth',
|
|
4311
4313
|
scheme: 'bearer',
|
|
@@ -4315,15 +4317,19 @@ export const getByodPairing = (options) => (options.client ?? client).get({
|
|
|
4315
4317
|
name: 'X-API-Key',
|
|
4316
4318
|
type: 'apiKey'
|
|
4317
4319
|
}],
|
|
4318
|
-
url: '/
|
|
4319
|
-
...options
|
|
4320
|
+
url: '/workforce/v1/key_results/{id}',
|
|
4321
|
+
...options,
|
|
4322
|
+
headers: {
|
|
4323
|
+
'Content-Type': 'application/json',
|
|
4324
|
+
...options.headers
|
|
4325
|
+
}
|
|
4320
4326
|
});
|
|
4321
4327
|
/**
|
|
4322
|
-
*
|
|
4328
|
+
* List specs
|
|
4323
4329
|
*
|
|
4324
|
-
*
|
|
4330
|
+
* Lists the specs (规定) of the organization in the workforce/v1 envelope (api_version, kind, metadata, spec; status is null in a list); use it to find which subject already has a spec before reading or revising one. Narrow it with kind. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, an unknown kind, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/specs?kind=job.
|
|
4325
4331
|
*/
|
|
4326
|
-
export const
|
|
4332
|
+
export const listOrganizationSpecs = (options) => (options?.client ?? client).get({
|
|
4327
4333
|
security: [{
|
|
4328
4334
|
key: 'BearerAuth',
|
|
4329
4335
|
scheme: 'bearer',
|
|
@@ -4333,19 +4339,15 @@ export const claimByodPairing = (options) => (options.client ?? client).post({
|
|
|
4333
4339
|
name: 'X-API-Key',
|
|
4334
4340
|
type: 'apiKey'
|
|
4335
4341
|
}],
|
|
4336
|
-
url: '/
|
|
4337
|
-
...options
|
|
4338
|
-
headers: {
|
|
4339
|
-
'Content-Type': 'application/json',
|
|
4340
|
-
...options.headers
|
|
4341
|
-
}
|
|
4342
|
+
url: '/workforce/v1/specs',
|
|
4343
|
+
...options
|
|
4342
4344
|
});
|
|
4343
4345
|
/**
|
|
4344
|
-
*
|
|
4346
|
+
* Get a spec
|
|
4345
4347
|
*
|
|
4346
|
-
*
|
|
4348
|
+
* Reads one subject's spec in the workforce/v1 envelope: metadata (id, name, revision, labels, annotations, change_note, update_time, updated_by), spec ({ document, provision }) and status (how many holders last reconciled on it, how many are ready and how many have a failed block). revision reads one historical revision instead, with status null. A subject never written answers revision 0 with an empty spec, so a first revise sends metadata.revision 0. Read-only. Errors: 400 INVALID_PARAMS for a non-integer revision; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject, or the named SPEC_REVISION_NOT_FOUND, does not exist. Example: GET /workforce/v1/specs/job/jpr_123?revision=2.
|
|
4347
4349
|
*/
|
|
4348
|
-
export const
|
|
4350
|
+
export const getOrganizationSpec = (options) => (options.client ?? client).get({
|
|
4349
4351
|
security: [{
|
|
4350
4352
|
key: 'BearerAuth',
|
|
4351
4353
|
scheme: 'bearer',
|
|
@@ -4355,15 +4357,15 @@ export const sessionsDelete = (options) => (options.client ?? client).delete({
|
|
|
4355
4357
|
name: 'X-API-Key',
|
|
4356
4358
|
type: 'apiKey'
|
|
4357
4359
|
}],
|
|
4358
|
-
url: '/
|
|
4360
|
+
url: '/workforce/v1/specs/{kind}/{id}',
|
|
4359
4361
|
...options
|
|
4360
4362
|
});
|
|
4361
4363
|
/**
|
|
4362
|
-
*
|
|
4364
|
+
* Revise a spec
|
|
4363
4365
|
*
|
|
4364
|
-
*
|
|
4366
|
+
* Replaces the whole spec of a subject: metadata.revision is the revision you last read (0 when none was written) and each success raises it by one, so a mismatch returns REVISION_CONFLICT and you must read again, merge and retry. The spec is { document, provision }: document is Markdown text injected into the holder's memory and never merged, provision holds the capability blocks and remove; GET /workforce/v1/spec_schema returns the JSON Schema of every block, and a block outside it is refused with its path. labels and annotations carry over from the previous revision when omitted; change_note belongs to this revision only. Other metadata fields you read back (id, name, update_time, updated_by) are accepted and ignored. dry_run=true checks everything and writes nothing: it answers the spec that would be written, the changes against the live one and the reconcile plan of every affected holder in office (at most 50, plans_truncated says more exist). Requires an organization owner or admin, or the head of the subject's department. Errors: 400 INVALID_PARAMS for a missing spec or metadata.revision, an api_version other than workforce/v1, labels or annotations over their limits, a block outside the registry or an unknown body field; 403 PERMISSION_DENIED; 404 when the subject does not exist; 409 REVISION_CONFLICT. Example body: {"metadata":{"revision":0,"change_note":"first charter"},"spec":{"document":"Deliver reliably.","provision":{"computer":{"template":"base"}}}}.
|
|
4365
4367
|
*/
|
|
4366
|
-
export const
|
|
4368
|
+
export const reviseOrganizationSpec = (options) => (options.client ?? client).put({
|
|
4367
4369
|
security: [{
|
|
4368
4370
|
key: 'BearerAuth',
|
|
4369
4371
|
scheme: 'bearer',
|
|
@@ -4373,15 +4375,19 @@ export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
|
4373
4375
|
name: 'X-API-Key',
|
|
4374
4376
|
type: 'apiKey'
|
|
4375
4377
|
}],
|
|
4376
|
-
url: '/
|
|
4377
|
-
...options
|
|
4378
|
+
url: '/workforce/v1/specs/{kind}/{id}',
|
|
4379
|
+
...options,
|
|
4380
|
+
headers: {
|
|
4381
|
+
'Content-Type': 'application/json',
|
|
4382
|
+
...options.headers
|
|
4383
|
+
}
|
|
4378
4384
|
});
|
|
4379
4385
|
/**
|
|
4380
|
-
*
|
|
4386
|
+
* List spec revisions
|
|
4381
4387
|
*
|
|
4382
|
-
*
|
|
4388
|
+
* Lists every stored revision of one subject's spec, newest first, each with its body, author and creation instant; use it to see what changed over time or to pick a revision to read or diff. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist.
|
|
4383
4389
|
*/
|
|
4384
|
-
export const
|
|
4390
|
+
export const listOrganizationSpecRevisions = (options) => (options.client ?? client).get({
|
|
4385
4391
|
security: [{
|
|
4386
4392
|
key: 'BearerAuth',
|
|
4387
4393
|
scheme: 'bearer',
|
|
@@ -4391,19 +4397,15 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
|
4391
4397
|
name: 'X-API-Key',
|
|
4392
4398
|
type: 'apiKey'
|
|
4393
4399
|
}],
|
|
4394
|
-
url: '/
|
|
4395
|
-
...options
|
|
4396
|
-
headers: {
|
|
4397
|
-
'Content-Type': 'application/json',
|
|
4398
|
-
...options.headers
|
|
4399
|
-
}
|
|
4400
|
+
url: '/workforce/v1/specs/{kind}/{id}/revisions',
|
|
4401
|
+
...options
|
|
4400
4402
|
});
|
|
4401
4403
|
/**
|
|
4402
|
-
*
|
|
4404
|
+
* Diff two spec revisions
|
|
4403
4405
|
*
|
|
4404
|
-
*
|
|
4406
|
+
* Compares two revisions of one subject's spec and lists the changes between them, each with its path and, for a change, the value before and after; revision 0 is the empty spec, so diffing 0 against 1 shows the first write. Read-only. Errors: 400 INVALID_PARAMS when from or to is missing or not an integer; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject does not exist, or SPEC_REVISION_NOT_FOUND when from or to was never written. Example: GET /workforce/v1/specs/job/jpr_123/diff?from=1&to=2.
|
|
4405
4407
|
*/
|
|
4406
|
-
export const
|
|
4408
|
+
export const diffOrganizationSpec = (options) => (options.client ?? client).get({
|
|
4407
4409
|
security: [{
|
|
4408
4410
|
key: 'BearerAuth',
|
|
4409
4411
|
scheme: 'bearer',
|
|
@@ -4413,15 +4415,15 @@ export const agentsList = (options) => (options?.client ?? client).get({
|
|
|
4413
4415
|
name: 'X-API-Key',
|
|
4414
4416
|
type: 'apiKey'
|
|
4415
4417
|
}],
|
|
4416
|
-
url: '/
|
|
4418
|
+
url: '/workforce/v1/specs/{kind}/{id}/diff',
|
|
4417
4419
|
...options
|
|
4418
4420
|
});
|
|
4419
4421
|
/**
|
|
4420
|
-
*
|
|
4422
|
+
* Read the effective spec
|
|
4421
4423
|
*
|
|
4422
|
-
*
|
|
4424
|
+
* Merges the spec chain of a seat or an actor and returns the one effective configuration: the merged capability blocks, the document of every layer, where each merged value came from, and anything only the merged result shows to be wrong. Give exactly one of actor (every seat the actor holds) or position_id (one seat, held or vacant, a preview before hiring); holder_kind defaults from the seat's holder. Read-only; nothing is changed. Errors: 400 INVALID_PARAMS when neither or both of actor and position_id are given, the actor address is malformed, holder_kind is neither agent nor human, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 POSITION_NOT_FOUND. Example: GET /workforce/v1/effective_spec?actor=agent:agent_123.
|
|
4423
4425
|
*/
|
|
4424
|
-
export const
|
|
4426
|
+
export const getOrganizationEffectiveSpec = (options) => (options?.client ?? client).get({
|
|
4425
4427
|
security: [{
|
|
4426
4428
|
key: 'BearerAuth',
|
|
4427
4429
|
scheme: 'bearer',
|
|
@@ -4431,19 +4433,15 @@ export const agentsCreate = (options) => (options.client ?? client).post({
|
|
|
4431
4433
|
name: 'X-API-Key',
|
|
4432
4434
|
type: 'apiKey'
|
|
4433
4435
|
}],
|
|
4434
|
-
url: '/
|
|
4435
|
-
...options
|
|
4436
|
-
headers: {
|
|
4437
|
-
'Content-Type': 'application/json',
|
|
4438
|
-
...options.headers
|
|
4439
|
-
}
|
|
4436
|
+
url: '/workforce/v1/effective_spec',
|
|
4437
|
+
...options
|
|
4440
4438
|
});
|
|
4441
4439
|
/**
|
|
4442
|
-
*
|
|
4440
|
+
* Read the spec schema
|
|
4443
4441
|
*
|
|
4444
|
-
*
|
|
4442
|
+
* Returns the JSON Schema (draft 2020-12) of a spec body, generated from the block registry: document, provision, every block and field under provision, and remove. Each field carries x-praxis-merge (single, set, keyed or layered), x-praxis-merge-key for a set, x-praxis-holders on a block (agent, human), and x-praxis-applied (whether reconcile applies it today), plus a Chinese title and an English description. Read it before writing a spec so a block or field is never guessed. The body is the schema itself, returned without any key renamed. Read-only. Errors: 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/spec_schema.
|
|
4445
4443
|
*/
|
|
4446
|
-
export const
|
|
4444
|
+
export const getOrganizationSpecSchema = (options) => (options?.client ?? client).get({
|
|
4447
4445
|
security: [{
|
|
4448
4446
|
key: 'BearerAuth',
|
|
4449
4447
|
scheme: 'bearer',
|
|
@@ -4453,15 +4451,15 @@ export const agentsRetrieve = (options) => (options.client ?? client).get({
|
|
|
4453
4451
|
name: 'X-API-Key',
|
|
4454
4452
|
type: 'apiKey'
|
|
4455
4453
|
}],
|
|
4456
|
-
url: '/
|
|
4454
|
+
url: '/workforce/v1/spec_schema',
|
|
4457
4455
|
...options
|
|
4458
4456
|
});
|
|
4459
4457
|
/**
|
|
4460
|
-
*
|
|
4458
|
+
* Plan reconciliation
|
|
4461
4459
|
*
|
|
4462
|
-
*
|
|
4460
|
+
* Dry-runs the reconciler for one holder and returns what it would change: an action per block (hold, update, none, pending, blocked) with the value it would write, and the violations only the merged result shows. It changes nothing - no state, no agent and no memory. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/reconcile/plan?actor=agent:agent_123.
|
|
4463
4461
|
*/
|
|
4464
|
-
export const
|
|
4462
|
+
export const planOrganizationReconcile = (options) => (options.client ?? client).get({
|
|
4465
4463
|
security: [{
|
|
4466
4464
|
key: 'BearerAuth',
|
|
4467
4465
|
scheme: 'bearer',
|
|
@@ -4471,19 +4469,15 @@ export const agentsUpdate = (options) => (options.client ?? client).post({
|
|
|
4471
4469
|
name: 'X-API-Key',
|
|
4472
4470
|
type: 'apiKey'
|
|
4473
4471
|
}],
|
|
4474
|
-
url: '/
|
|
4475
|
-
...options
|
|
4476
|
-
headers: {
|
|
4477
|
-
'Content-Type': 'application/json',
|
|
4478
|
-
...options.headers
|
|
4479
|
-
}
|
|
4472
|
+
url: '/workforce/v1/reconcile/plan',
|
|
4473
|
+
...options
|
|
4480
4474
|
});
|
|
4481
4475
|
/**
|
|
4482
|
-
*
|
|
4476
|
+
* Read reconcile status
|
|
4483
4477
|
*
|
|
4484
|
-
*
|
|
4478
|
+
* Reads the reconciler's last result for one holder: whether the sweep is paused, the seats and layer revisions of the last applied run, each block's state (ready, pending, failed, waiting_human, paused or not_applicable), the drift between what is applied and what the specs want, and when it last applied. Read-only; it changes nothing. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/reconcile/status?actor=agent:agent_123.
|
|
4485
4479
|
*/
|
|
4486
|
-
export const
|
|
4480
|
+
export const getOrganizationReconcileStatus = (options) => (options.client ?? client).get({
|
|
4487
4481
|
security: [{
|
|
4488
4482
|
key: 'BearerAuth',
|
|
4489
4483
|
scheme: 'bearer',
|
|
@@ -4493,15 +4487,15 @@ export const agentsArchive = (options) => (options.client ?? client).post({
|
|
|
4493
4487
|
name: 'X-API-Key',
|
|
4494
4488
|
type: 'apiKey'
|
|
4495
4489
|
}],
|
|
4496
|
-
url: '/
|
|
4490
|
+
url: '/workforce/v1/reconcile/status',
|
|
4497
4491
|
...options
|
|
4498
4492
|
});
|
|
4499
4493
|
/**
|
|
4500
|
-
*
|
|
4494
|
+
* Run reconciliation now
|
|
4501
4495
|
*
|
|
4502
|
-
*
|
|
4496
|
+
* Reconciles one holder now instead of waiting for the sweep: it plans, applies every update and returns the new status. Run plan first to see the changes without applying them. Requires an organization owner or admin. A block that cannot be applied now stays pending, waiting_human or failed, and the returned status says so. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
|
|
4503
4497
|
*/
|
|
4504
|
-
export const
|
|
4498
|
+
export const runOrganizationReconcile = (options) => (options.client ?? client).post({
|
|
4505
4499
|
security: [{
|
|
4506
4500
|
key: 'BearerAuth',
|
|
4507
4501
|
scheme: 'bearer',
|
|
@@ -4511,15 +4505,19 @@ export const agentsVersionsList = (options) => (options.client ?? client).get({
|
|
|
4511
4505
|
name: 'X-API-Key',
|
|
4512
4506
|
type: 'apiKey'
|
|
4513
4507
|
}],
|
|
4514
|
-
url: '/
|
|
4515
|
-
...options
|
|
4508
|
+
url: '/workforce/v1/reconcile/run',
|
|
4509
|
+
...options,
|
|
4510
|
+
headers: {
|
|
4511
|
+
'Content-Type': 'application/json',
|
|
4512
|
+
...options.headers
|
|
4513
|
+
}
|
|
4516
4514
|
});
|
|
4517
4515
|
/**
|
|
4518
|
-
*
|
|
4516
|
+
* Pause reconciliation
|
|
4519
4517
|
*
|
|
4520
|
-
*
|
|
4518
|
+
* Stops the sweep from reconciling one holder until it is resumed: the holder's blocks keep their state and no further update is applied. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
|
|
4521
4519
|
*/
|
|
4522
|
-
export const
|
|
4520
|
+
export const pauseOrganizationReconcile = (options) => (options.client ?? client).post({
|
|
4523
4521
|
security: [{
|
|
4524
4522
|
key: 'BearerAuth',
|
|
4525
4523
|
scheme: 'bearer',
|
|
@@ -4529,15 +4527,19 @@ export const sessionsList = (options) => (options?.client ?? client).get({
|
|
|
4529
4527
|
name: 'X-API-Key',
|
|
4530
4528
|
type: 'apiKey'
|
|
4531
4529
|
}],
|
|
4532
|
-
url: '/
|
|
4533
|
-
...options
|
|
4530
|
+
url: '/workforce/v1/reconcile/pause',
|
|
4531
|
+
...options,
|
|
4532
|
+
headers: {
|
|
4533
|
+
'Content-Type': 'application/json',
|
|
4534
|
+
...options.headers
|
|
4535
|
+
}
|
|
4534
4536
|
});
|
|
4535
4537
|
/**
|
|
4536
|
-
*
|
|
4538
|
+
* Resume reconciliation
|
|
4537
4539
|
*
|
|
4538
|
-
*
|
|
4540
|
+
* Restarts the sweep for a paused holder and reconciles it now, returning the new status. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a body field is unknown; 403 PERMISSION_DENIED. Example body: {"actor":"agent:agent_123"}.
|
|
4539
4541
|
*/
|
|
4540
|
-
export const
|
|
4542
|
+
export const resumeOrganizationReconcile = (options) => (options.client ?? client).post({
|
|
4541
4543
|
security: [{
|
|
4542
4544
|
key: 'BearerAuth',
|
|
4543
4545
|
scheme: 'bearer',
|
|
@@ -4547,7 +4549,7 @@ export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
|
4547
4549
|
name: 'X-API-Key',
|
|
4548
4550
|
type: 'apiKey'
|
|
4549
4551
|
}],
|
|
4550
|
-
url: '/
|
|
4552
|
+
url: '/workforce/v1/reconcile/resume',
|
|
4551
4553
|
...options,
|
|
4552
4554
|
headers: {
|
|
4553
4555
|
'Content-Type': 'application/json',
|
|
@@ -4555,11 +4557,11 @@ export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
|
4555
4557
|
}
|
|
4556
4558
|
});
|
|
4557
4559
|
/**
|
|
4558
|
-
*
|
|
4560
|
+
* Delete session
|
|
4559
4561
|
*
|
|
4560
|
-
*
|
|
4562
|
+
* Delete an idle or terminated session and its event history after saving a deletion snapshot. Supply the session id from creation or listing. Running sessions return 409 INVALID_STATE: interrupt first or wait until idle or terminated. Afterwards retrieval and event listing return 404 and lists omit the session. Example: DELETE /agent/v1/sessions/sesn_example.
|
|
4561
4563
|
*/
|
|
4562
|
-
export const
|
|
4564
|
+
export const sessionsDelete = (options) => (options.client ?? client).delete({
|
|
4563
4565
|
security: [{
|
|
4564
4566
|
key: 'BearerAuth',
|
|
4565
4567
|
scheme: 'bearer',
|
|
@@ -4569,15 +4571,15 @@ export const sessionsArchive = (options) => (options.client ?? client).post({
|
|
|
4569
4571
|
name: 'X-API-Key',
|
|
4570
4572
|
type: 'apiKey'
|
|
4571
4573
|
}],
|
|
4572
|
-
url: '/agent/v1/sessions/{session_id}
|
|
4574
|
+
url: '/agent/v1/sessions/{session_id}',
|
|
4573
4575
|
...options
|
|
4574
4576
|
});
|
|
4575
4577
|
/**
|
|
4576
|
-
*
|
|
4578
|
+
* Get session
|
|
4577
4579
|
*
|
|
4578
|
-
* Read
|
|
4580
|
+
* 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.
|
|
4579
4581
|
*/
|
|
4580
|
-
export const
|
|
4582
|
+
export const sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
4581
4583
|
security: [{
|
|
4582
4584
|
key: 'BearerAuth',
|
|
4583
4585
|
scheme: 'bearer',
|
|
@@ -4587,15 +4589,15 @@ export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
|
4587
4589
|
name: 'X-API-Key',
|
|
4588
4590
|
type: 'apiKey'
|
|
4589
4591
|
}],
|
|
4590
|
-
url: '/agent/v1/sessions/{session_id}
|
|
4592
|
+
url: '/agent/v1/sessions/{session_id}',
|
|
4591
4593
|
...options
|
|
4592
4594
|
});
|
|
4593
4595
|
/**
|
|
4594
|
-
*
|
|
4596
|
+
* Update session
|
|
4595
4597
|
*
|
|
4596
|
-
*
|
|
4598
|
+
* Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.
|
|
4597
4599
|
*/
|
|
4598
|
-
export const
|
|
4600
|
+
export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
4599
4601
|
security: [{
|
|
4600
4602
|
key: 'BearerAuth',
|
|
4601
4603
|
scheme: 'bearer',
|
|
@@ -4605,7 +4607,7 @@ export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
|
4605
4607
|
name: 'X-API-Key',
|
|
4606
4608
|
type: 'apiKey'
|
|
4607
4609
|
}],
|
|
4608
|
-
url: '/agent/v1/sessions/{session_id}
|
|
4610
|
+
url: '/agent/v1/sessions/{session_id}',
|
|
4609
4611
|
...options,
|
|
4610
4612
|
headers: {
|
|
4611
4613
|
'Content-Type': 'application/json',
|
|
@@ -4613,11 +4615,11 @@ export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
|
4613
4615
|
}
|
|
4614
4616
|
});
|
|
4615
4617
|
/**
|
|
4616
|
-
*
|
|
4618
|
+
* List agents
|
|
4617
4619
|
*
|
|
4618
|
-
*
|
|
4620
|
+
* 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.
|
|
4619
4621
|
*/
|
|
4620
|
-
export const
|
|
4622
|
+
export const agentsList = (options) => (options?.client ?? client).get({
|
|
4621
4623
|
security: [{
|
|
4622
4624
|
key: 'BearerAuth',
|
|
4623
4625
|
scheme: 'bearer',
|
|
@@ -4627,15 +4629,15 @@ export const sessionsEventsStream = (options) => (options.client ?? client).sse.
|
|
|
4627
4629
|
name: 'X-API-Key',
|
|
4628
4630
|
type: 'apiKey'
|
|
4629
4631
|
}],
|
|
4630
|
-
url: '/agent/v1/
|
|
4632
|
+
url: '/agent/v1/agents',
|
|
4631
4633
|
...options
|
|
4632
4634
|
});
|
|
4633
4635
|
/**
|
|
4634
|
-
*
|
|
4636
|
+
* Create agent
|
|
4635
4637
|
*
|
|
4636
|
-
*
|
|
4638
|
+
* 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 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. phone gives the agent one phone, in one of two mutually exclusive forms: {sku, name?, archive: {exclude}} is a cloud Android device the platform builds on demand from that Sandbox SKU, and {byod, name?} is your organization's own device, named by a byd_… id it already owns (Brought Your Own Device), which the platform drives but never builds. A body naming both sku and byod returns 400, and a byd_… id this organization does not own returns 400 INVALID_PARAMS. Only a general or assume agent may have a phone: a service agent with phone returns 400. Drive assume agents over MCP at /agent/v1/agents/{id}/mcp.
|
|
4637
4639
|
*/
|
|
4638
|
-
export const
|
|
4640
|
+
export const agentsCreate = (options) => (options.client ?? client).post({
|
|
4639
4641
|
security: [{
|
|
4640
4642
|
key: 'BearerAuth',
|
|
4641
4643
|
scheme: 'bearer',
|
|
@@ -4645,15 +4647,19 @@ export const sessionsThreadsList = (options) => (options.client ?? client).get({
|
|
|
4645
4647
|
name: 'X-API-Key',
|
|
4646
4648
|
type: 'apiKey'
|
|
4647
4649
|
}],
|
|
4648
|
-
url: '/agent/v1/
|
|
4649
|
-
...options
|
|
4650
|
+
url: '/agent/v1/agents',
|
|
4651
|
+
...options,
|
|
4652
|
+
headers: {
|
|
4653
|
+
'Content-Type': 'application/json',
|
|
4654
|
+
...options.headers
|
|
4655
|
+
}
|
|
4650
4656
|
});
|
|
4651
4657
|
/**
|
|
4652
|
-
* Get
|
|
4658
|
+
* Get agent
|
|
4653
4659
|
*
|
|
4654
|
-
* Read
|
|
4660
|
+
* Read the agent configuration currently effective for new sessions. By default, version equals active_version and latest_version identifies the newest saved version, including an unapplied save. Use latest_version for optimistic concurrency when updating. Pass version as a positive integer to read that saved version; version=active is equivalent to omission. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so tools can be sent back unchanged to agents.update. Use agents.versions.list to enumerate saved versions.
|
|
4655
4661
|
*/
|
|
4656
|
-
export const
|
|
4662
|
+
export const agentsRetrieve = (options) => (options.client ?? client).get({
|
|
4657
4663
|
security: [{
|
|
4658
4664
|
key: 'BearerAuth',
|
|
4659
4665
|
scheme: 'bearer',
|
|
@@ -4663,7 +4669,217 @@ export const sessionsThreadsRetrieve = (options) => (options.client ?? client).g
|
|
|
4663
4669
|
name: 'X-API-Key',
|
|
4664
4670
|
type: 'apiKey'
|
|
4665
4671
|
}],
|
|
4666
|
-
url: '/agent/v1/
|
|
4672
|
+
url: '/agent/v1/agents/{agent_id}',
|
|
4673
|
+
...options
|
|
4674
|
+
});
|
|
4675
|
+
/**
|
|
4676
|
+
* Update agent
|
|
4677
|
+
*
|
|
4678
|
+
* Save configuration changes as a new immutable version. Send latest_version from a default retrieve or update response as the request version for optimistic concurrency; a stale value returns 409. apply defaults to true and makes the new version effective; apply false saves without changing active_version. The response contains the effective configuration, with version equal to active_version and latest_version naming the newest saved version. An unchanged configuration, including a note-only update, is a no-op returning 200 and the current effective version without creating or activating a version. version_note records up to 280 characters only when a configuration change creates a new version; null is equivalent to omission. Use agents.versions.apply to activate an existing saved version. Existing sessions and tokens keep their version. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. tools: [] removes every tool, while tools: null returns 400 (tools cannot be null; send [] to remove every tool). On update, omit skills to keep them, send an array to replace them, or send [] or null to clear them. 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. phone takes the same two mutually exclusive forms as agents.create: {sku, name?, archive} for a cloud device, or {byod, name?} for your organization's own device (a byd_… id); naming both returns 400, and a byd_… id this organization does not own returns 400 INVALID_PARAMS. phone: null turns the phone off and releases a cloud device; a BYOD phone is the organization's and is never killed. Assume agents reject model, models, subagent_model, subagents and multiagent on every update; other fields follow the general agent rules, with vault_ids also accepted.
|
|
4679
|
+
*/
|
|
4680
|
+
export const agentsUpdate = (options) => (options.client ?? client).post({
|
|
4681
|
+
security: [{
|
|
4682
|
+
key: 'BearerAuth',
|
|
4683
|
+
scheme: 'bearer',
|
|
4684
|
+
type: 'http'
|
|
4685
|
+
}, {
|
|
4686
|
+
key: 'ApiKeyAuth',
|
|
4687
|
+
name: 'X-API-Key',
|
|
4688
|
+
type: 'apiKey'
|
|
4689
|
+
}],
|
|
4690
|
+
url: '/agent/v1/agents/{agent_id}',
|
|
4691
|
+
...options,
|
|
4692
|
+
headers: {
|
|
4693
|
+
'Content-Type': 'application/json',
|
|
4694
|
+
...options.headers
|
|
4695
|
+
}
|
|
4696
|
+
});
|
|
4697
|
+
/**
|
|
4698
|
+
* Archive agent
|
|
4699
|
+
*
|
|
4700
|
+
* Archive an agent so it can no longer be updated and no new session can be created from it (AGENT_ARCHIVED). The agent and all of its versions stay readable. Use it to retire an agent you no longer want to run; it does not delete anything.
|
|
4701
|
+
*/
|
|
4702
|
+
export const agentsArchive = (options) => (options.client ?? client).post({
|
|
4703
|
+
security: [{
|
|
4704
|
+
key: 'BearerAuth',
|
|
4705
|
+
scheme: 'bearer',
|
|
4706
|
+
type: 'http'
|
|
4707
|
+
}, {
|
|
4708
|
+
key: 'ApiKeyAuth',
|
|
4709
|
+
name: 'X-API-Key',
|
|
4710
|
+
type: 'apiKey'
|
|
4711
|
+
}],
|
|
4712
|
+
url: '/agent/v1/agents/{agent_id}/archive',
|
|
4713
|
+
...options
|
|
4714
|
+
});
|
|
4715
|
+
/**
|
|
4716
|
+
* List agent versions
|
|
4717
|
+
*
|
|
4718
|
+
* List the saved versions of one agent in ascending version number, oldest first, in pages of at most 100 (default 20). Each item is the full agent definition at that saved version, so you can compare configurations. active is true only for the item new sessions use. active_version on every item is the same agent-level currently effective version; it is not that item's version. Use agents.retrieve with version to read a single saved version; agent_id comes from agents.list or agents.create. Pass next_page as page to continue.
|
|
4719
|
+
*/
|
|
4720
|
+
export const agentsVersionsList = (options) => (options.client ?? client).get({
|
|
4721
|
+
security: [{
|
|
4722
|
+
key: 'BearerAuth',
|
|
4723
|
+
scheme: 'bearer',
|
|
4724
|
+
type: 'http'
|
|
4725
|
+
}, {
|
|
4726
|
+
key: 'ApiKeyAuth',
|
|
4727
|
+
name: 'X-API-Key',
|
|
4728
|
+
type: 'apiKey'
|
|
4729
|
+
}],
|
|
4730
|
+
url: '/agent/v1/agents/{agent_id}/versions',
|
|
4731
|
+
...options
|
|
4732
|
+
});
|
|
4733
|
+
/**
|
|
4734
|
+
* List sessions
|
|
4735
|
+
*
|
|
4736
|
+
* List sessions of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Archived sessions are hidden unless include_archived is true. Unlike Anthropic Managed Agents, only limit, page, agent_id, deployment_id and include_archived are honored; the other filters declared here (agent_version, created_at ranges, memory_store_id, order, statuses) are not supported and return 400. Use the returned id with sessions.retrieve or sessions.events.list; pass next_page as page for the next page.
|
|
4737
|
+
*/
|
|
4738
|
+
export const sessionsList = (options) => (options?.client ?? client).get({
|
|
4739
|
+
security: [{
|
|
4740
|
+
key: 'BearerAuth',
|
|
4741
|
+
scheme: 'bearer',
|
|
4742
|
+
type: 'http'
|
|
4743
|
+
}, {
|
|
4744
|
+
key: 'ApiKeyAuth',
|
|
4745
|
+
name: 'X-API-Key',
|
|
4746
|
+
type: 'apiKey'
|
|
4747
|
+
}],
|
|
4748
|
+
url: '/agent/v1/sessions',
|
|
4749
|
+
...options
|
|
4750
|
+
});
|
|
4751
|
+
/**
|
|
4752
|
+
* Create session
|
|
4753
|
+
*
|
|
4754
|
+
* 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.
|
|
4755
|
+
*/
|
|
4756
|
+
export const sessionsCreate = (options) => (options.client ?? client).post({
|
|
4757
|
+
security: [{
|
|
4758
|
+
key: 'BearerAuth',
|
|
4759
|
+
scheme: 'bearer',
|
|
4760
|
+
type: 'http'
|
|
4761
|
+
}, {
|
|
4762
|
+
key: 'ApiKeyAuth',
|
|
4763
|
+
name: 'X-API-Key',
|
|
4764
|
+
type: 'apiKey'
|
|
4765
|
+
}],
|
|
4766
|
+
url: '/agent/v1/sessions',
|
|
4767
|
+
...options,
|
|
4768
|
+
headers: {
|
|
4769
|
+
'Content-Type': 'application/json',
|
|
4770
|
+
...options.headers
|
|
4771
|
+
}
|
|
4772
|
+
});
|
|
4773
|
+
/**
|
|
4774
|
+
* Archive session
|
|
4775
|
+
*
|
|
4776
|
+
* Archive a session. An archived session refuses new messages with 400 invalid_request_error, while its details and event history stay readable. Archiving again is idempotent and archived_at keeps the first archive time. Use it when a conversation is finished; it does not delete anything.
|
|
4777
|
+
*/
|
|
4778
|
+
export const sessionsArchive = (options) => (options.client ?? client).post({
|
|
4779
|
+
security: [{
|
|
4780
|
+
key: 'BearerAuth',
|
|
4781
|
+
scheme: 'bearer',
|
|
4782
|
+
type: 'http'
|
|
4783
|
+
}, {
|
|
4784
|
+
key: 'ApiKeyAuth',
|
|
4785
|
+
name: 'X-API-Key',
|
|
4786
|
+
type: 'apiKey'
|
|
4787
|
+
}],
|
|
4788
|
+
url: '/agent/v1/sessions/{session_id}/archive',
|
|
4789
|
+
...options
|
|
4790
|
+
});
|
|
4791
|
+
/**
|
|
4792
|
+
* List session events
|
|
4793
|
+
*
|
|
4794
|
+
* 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.
|
|
4795
|
+
*/
|
|
4796
|
+
export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
4797
|
+
security: [{
|
|
4798
|
+
key: 'BearerAuth',
|
|
4799
|
+
scheme: 'bearer',
|
|
4800
|
+
type: 'http'
|
|
4801
|
+
}, {
|
|
4802
|
+
key: 'ApiKeyAuth',
|
|
4803
|
+
name: 'X-API-Key',
|
|
4804
|
+
type: 'apiKey'
|
|
4805
|
+
}],
|
|
4806
|
+
url: '/agent/v1/sessions/{session_id}/events',
|
|
4807
|
+
...options
|
|
4808
|
+
});
|
|
4809
|
+
/**
|
|
4810
|
+
* Send session events
|
|
4811
|
+
*
|
|
4812
|
+
* 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.
|
|
4813
|
+
*/
|
|
4814
|
+
export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
4815
|
+
security: [{
|
|
4816
|
+
key: 'BearerAuth',
|
|
4817
|
+
scheme: 'bearer',
|
|
4818
|
+
type: 'http'
|
|
4819
|
+
}, {
|
|
4820
|
+
key: 'ApiKeyAuth',
|
|
4821
|
+
name: 'X-API-Key',
|
|
4822
|
+
type: 'apiKey'
|
|
4823
|
+
}],
|
|
4824
|
+
url: '/agent/v1/sessions/{session_id}/events',
|
|
4825
|
+
...options,
|
|
4826
|
+
headers: {
|
|
4827
|
+
'Content-Type': 'application/json',
|
|
4828
|
+
...options.headers
|
|
4829
|
+
}
|
|
4830
|
+
});
|
|
4831
|
+
/**
|
|
4832
|
+
* Stream session events
|
|
4833
|
+
*
|
|
4834
|
+
* 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.
|
|
4835
|
+
*/
|
|
4836
|
+
export const sessionsEventsStream = (options) => (options.client ?? client).sse.get({
|
|
4837
|
+
security: [{
|
|
4838
|
+
key: 'BearerAuth',
|
|
4839
|
+
scheme: 'bearer',
|
|
4840
|
+
type: 'http'
|
|
4841
|
+
}, {
|
|
4842
|
+
key: 'ApiKeyAuth',
|
|
4843
|
+
name: 'X-API-Key',
|
|
4844
|
+
type: 'apiKey'
|
|
4845
|
+
}],
|
|
4846
|
+
url: '/agent/v1/sessions/{session_id}/events/stream',
|
|
4847
|
+
...options
|
|
4848
|
+
});
|
|
4849
|
+
/**
|
|
4850
|
+
* List session threads
|
|
4851
|
+
*
|
|
4852
|
+
* List the execution threads of a session: the primary thread plus every child thread started by subagents or advisors, in created_at order. Child threads reference the primary through parent_thread_id. Pages hold at most 100 threads (default 20). Use a thread id with sessions.threads.retrieve, sessions.threads.events.list or sessions.threads.events.stream.
|
|
4853
|
+
*/
|
|
4854
|
+
export const sessionsThreadsList = (options) => (options.client ?? client).get({
|
|
4855
|
+
security: [{
|
|
4856
|
+
key: 'BearerAuth',
|
|
4857
|
+
scheme: 'bearer',
|
|
4858
|
+
type: 'http'
|
|
4859
|
+
}, {
|
|
4860
|
+
key: 'ApiKeyAuth',
|
|
4861
|
+
name: 'X-API-Key',
|
|
4862
|
+
type: 'apiKey'
|
|
4863
|
+
}],
|
|
4864
|
+
url: '/agent/v1/sessions/{session_id}/threads',
|
|
4865
|
+
...options
|
|
4866
|
+
});
|
|
4867
|
+
/**
|
|
4868
|
+
* Get session thread
|
|
4869
|
+
*
|
|
4870
|
+
* Read one execution thread of a session, field for field the same as its list item. Thread ids that are unknown, malformed or belong to another session all return 404, so existence is not revealed. thread_id comes from sessions.threads.list or from the session_thread_id of a session.thread_created event.
|
|
4871
|
+
*/
|
|
4872
|
+
export const sessionsThreadsRetrieve = (options) => (options.client ?? client).get({
|
|
4873
|
+
security: [{
|
|
4874
|
+
key: 'BearerAuth',
|
|
4875
|
+
scheme: 'bearer',
|
|
4876
|
+
type: 'http'
|
|
4877
|
+
}, {
|
|
4878
|
+
key: 'ApiKeyAuth',
|
|
4879
|
+
name: 'X-API-Key',
|
|
4880
|
+
type: 'apiKey'
|
|
4881
|
+
}],
|
|
4882
|
+
url: '/agent/v1/sessions/{session_id}/threads/{thread_id}',
|
|
4667
4883
|
...options
|
|
4668
4884
|
});
|
|
4669
4885
|
/**
|
|
@@ -4915,7 +5131,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
|
|
|
4915
5131
|
/**
|
|
4916
5132
|
* Create deployment
|
|
4917
5133
|
*
|
|
4918
|
-
* 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"}}.
|
|
5134
|
+
* Freeze session parameters as a deployment; this operation does not open a session. An agent reference with only an id follows the agent's active version: each run uses the version in effect at that moment, so a later agent save reaches the next run with no edit here. Name a version to pin it; only a version that is applied can be pinned, so a save made with apply false is refused with 409 AGENT_VERSION_NOT_APPLIED. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. environment_id and target are alternatives: send at least one of them; target:{type:"computer"} is for general agents and needs no environment_id, while target:{type:"environment"} still requires one. 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"}}.
|
|
4919
5135
|
*/
|
|
4920
5136
|
export const deploymentsCreate = (options) => (options.client ?? client).post({
|
|
4921
5137
|
security: [{
|
|
@@ -4955,7 +5171,7 @@ export const deploymentsRetrieve = (options) => (options.client ?? client).get({
|
|
|
4955
5171
|
/**
|
|
4956
5172
|
* Update deployment
|
|
4957
5173
|
*
|
|
4958
|
-
* Partially update a deployment. Omitted fields keep their values
|
|
5174
|
+
* Partially update a deployment. Omitted fields keep their values. An agent reference with only an id makes the deployment follow the agent's active version from now on, so later agent saves carry through; name a version to pin it instead, and only a version that is applied (not one saved with apply false) may be pinned. Metadata merges string values and deletes keys set to null. Null clears schedule, resources and description; name, environment_id and initial_events cannot be cleared. Archived deployments return 409. Overrides apply to new sessions; updating a schedule recalculates its next occurrence.
|
|
4959
5175
|
*/
|
|
4960
5176
|
export const deploymentsUpdate = (options) => (options.client ?? client).post({
|
|
4961
5177
|
security: [{
|
|
@@ -8917,87 +9133,649 @@ export const cutCreateBinding = (options) => (options.client ?? client).post({
|
|
|
8917
9133
|
name: 'X-API-Key',
|
|
8918
9134
|
type: 'apiKey'
|
|
8919
9135
|
}],
|
|
8920
|
-
url: '/cut/v1/projects/{project_id}/bindings',
|
|
8921
|
-
...options,
|
|
8922
|
-
headers: {
|
|
8923
|
-
'Content-Type': 'application/json',
|
|
8924
|
-
...options.headers
|
|
8925
|
-
}
|
|
9136
|
+
url: '/cut/v1/projects/{project_id}/bindings',
|
|
9137
|
+
...options,
|
|
9138
|
+
headers: {
|
|
9139
|
+
'Content-Type': 'application/json',
|
|
9140
|
+
...options.headers
|
|
9141
|
+
}
|
|
9142
|
+
});
|
|
9143
|
+
/**
|
|
9144
|
+
* Remove library binding
|
|
9145
|
+
*
|
|
9146
|
+
* Detach a library alias obtained from bindings.list after removing all timeline clips that reference its library. BINDING_IN_USE returns 409 while references remain; inspect timeline and edit those clips first. Removal must preserve the one writable default upload binding.
|
|
9147
|
+
*/
|
|
9148
|
+
export const cutDeleteBinding = (options) => (options.client ?? client).delete({
|
|
9149
|
+
security: [{
|
|
9150
|
+
key: 'BearerAuth',
|
|
9151
|
+
scheme: 'bearer',
|
|
9152
|
+
type: 'http'
|
|
9153
|
+
}, {
|
|
9154
|
+
key: 'ApiKeyAuth',
|
|
9155
|
+
name: 'X-API-Key',
|
|
9156
|
+
type: 'apiKey'
|
|
9157
|
+
}],
|
|
9158
|
+
url: '/cut/v1/projects/{project_id}/bindings/{name}',
|
|
9159
|
+
...options
|
|
9160
|
+
});
|
|
9161
|
+
/**
|
|
9162
|
+
* Import project media
|
|
9163
|
+
*
|
|
9164
|
+
* Import a URL, data URI or existing file into a writable project media library. Select binding from bindings.list or omit it to use default_upload. Save library_id and asset_id from the result and use them as libraryId and assetId inside execute script media references; overwrites follow the source asset latest version.
|
|
9165
|
+
*/
|
|
9166
|
+
export const cutImportMedia = (options) => (options.client ?? client).post({
|
|
9167
|
+
security: [{
|
|
9168
|
+
key: 'BearerAuth',
|
|
9169
|
+
scheme: 'bearer',
|
|
9170
|
+
type: 'http'
|
|
9171
|
+
}, {
|
|
9172
|
+
key: 'ApiKeyAuth',
|
|
9173
|
+
name: 'X-API-Key',
|
|
9174
|
+
type: 'apiKey'
|
|
9175
|
+
}],
|
|
9176
|
+
url: '/cut/v1/projects/{project_id}/media:import',
|
|
9177
|
+
...options,
|
|
9178
|
+
headers: {
|
|
9179
|
+
'Content-Type': 'application/json',
|
|
9180
|
+
...options.headers
|
|
9181
|
+
}
|
|
9182
|
+
});
|
|
9183
|
+
/**
|
|
9184
|
+
* List project exports
|
|
9185
|
+
*
|
|
9186
|
+
* Find export jobs associated with this project before polling or canceling a render. Copy an export id into praxis.cut.exports.retrieve or cancel. Continue with next_page_token as page_token when present; queued or in-progress jobs have not produced a final media asset.
|
|
9187
|
+
*/
|
|
9188
|
+
export const cutListExports = (options) => (options.client ?? client).get({
|
|
9189
|
+
security: [{
|
|
9190
|
+
key: 'BearerAuth',
|
|
9191
|
+
scheme: 'bearer',
|
|
9192
|
+
type: 'http'
|
|
9193
|
+
}, {
|
|
9194
|
+
key: 'ApiKeyAuth',
|
|
9195
|
+
name: 'X-API-Key',
|
|
9196
|
+
type: 'apiKey'
|
|
9197
|
+
}],
|
|
9198
|
+
url: '/cut/v1/projects/{project_id}/exports',
|
|
9199
|
+
...options
|
|
9200
|
+
});
|
|
9201
|
+
/**
|
|
9202
|
+
* Create video export
|
|
9203
|
+
*
|
|
9204
|
+
* Start an asynchronous video export from the project into a writable bound media library. Choose binding from bindings.list or omit it for default_upload, and optionally select revision and output settings. HTTP 202 only accepts the job; poll praxis.cut.exports.retrieve using the returned id until status is done, failed or canceled. On done, asset identifies the video written back to praxis.media. Each call starts a job, so retrieve a known job before retrying a submission.
|
|
9205
|
+
*/
|
|
9206
|
+
export const cutCreateExport = (options) => (options.client ?? client).post({
|
|
9207
|
+
security: [{
|
|
9208
|
+
key: 'BearerAuth',
|
|
9209
|
+
scheme: 'bearer',
|
|
9210
|
+
type: 'http'
|
|
9211
|
+
}, {
|
|
9212
|
+
key: 'ApiKeyAuth',
|
|
9213
|
+
name: 'X-API-Key',
|
|
9214
|
+
type: 'apiKey'
|
|
9215
|
+
}],
|
|
9216
|
+
url: '/cut/v1/projects/{project_id}/exports',
|
|
9217
|
+
...options,
|
|
9218
|
+
headers: {
|
|
9219
|
+
'Content-Type': 'application/json',
|
|
9220
|
+
...options.headers
|
|
9221
|
+
}
|
|
9222
|
+
});
|
|
9223
|
+
/**
|
|
9224
|
+
* Create draft range render
|
|
9225
|
+
*
|
|
9226
|
+
* Render one interval of the timeline so you can hear or look at how that passage comes out, without publishing anything to a media library. Choose kind audio for the mixed soundtrack as an .m4a file, or kind video for a draft-quality .mp4 with picture and sound. from and to are seconds on the project clock and must satisfy 0 <= from < to, to <= the timeline duration (an end up to 0.05 s past it, a rounded duration, is read as the end), and to - from <= 120; a longer passage is requested in several 分段请求 ranges and joined by the caller. The result is a temporary file (purpose user_data) that expires 24 hours after it is stored and is never imported into a library, so it is not a deliverable and carries no cut-export tag. HTTP 202 only accepts the job; poll praxis.cut.renders.retrieve using the returned id until status is done or failed, then read url while it lasts. A draft also bills like a draft export, by rendered seconds. Each project runs at most 2 draft renders at a time, a budget separate from its exports; a third answers HTTP 429 CUT_BUSY and the same call succeeds once one finishes.
|
|
9227
|
+
*/
|
|
9228
|
+
export const cutCreateRender = (options) => (options.client ?? client).post({
|
|
9229
|
+
security: [{
|
|
9230
|
+
key: 'BearerAuth',
|
|
9231
|
+
scheme: 'bearer',
|
|
9232
|
+
type: 'http'
|
|
9233
|
+
}, {
|
|
9234
|
+
key: 'ApiKeyAuth',
|
|
9235
|
+
name: 'X-API-Key',
|
|
9236
|
+
type: 'apiKey'
|
|
9237
|
+
}],
|
|
9238
|
+
url: '/cut/v1/projects/{project_id}/renders',
|
|
9239
|
+
...options,
|
|
9240
|
+
headers: {
|
|
9241
|
+
'Content-Type': 'application/json',
|
|
9242
|
+
...options.headers
|
|
9243
|
+
}
|
|
9244
|
+
});
|
|
9245
|
+
/**
|
|
9246
|
+
* Retrieve draft range render
|
|
9247
|
+
*
|
|
9248
|
+
* Poll a draft render id returned by projects.renders.create to see whether the interval is ready, then read url while it lasts. queued and rendering are in progress; done provides file_id and a short-lived url for the rendered .m4a or .mp4; failed provides error. Only done yields a url, and the file behind it disappears 24 hours after it was stored, so retrieve again when the link has expired.
|
|
9249
|
+
*/
|
|
9250
|
+
export const cutRetrieveRender = (options) => (options.client ?? client).get({
|
|
9251
|
+
security: [{
|
|
9252
|
+
key: 'BearerAuth',
|
|
9253
|
+
scheme: 'bearer',
|
|
9254
|
+
type: 'http'
|
|
9255
|
+
}, {
|
|
9256
|
+
key: 'ApiKeyAuth',
|
|
9257
|
+
name: 'X-API-Key',
|
|
9258
|
+
type: 'apiKey'
|
|
9259
|
+
}],
|
|
9260
|
+
url: '/cut/v1/renders/{render_id}',
|
|
9261
|
+
...options
|
|
9262
|
+
});
|
|
9263
|
+
/**
|
|
9264
|
+
* Retrieve video export
|
|
9265
|
+
*
|
|
9266
|
+
* Poll an export id returned by projects.exports.create or list to observe render progress. queued, fetching, rendering, stitching and saving are in progress; done provides asset in the target library, failed provides error, and canceled means the job stopped. Only done confirms a usable output asset.
|
|
9267
|
+
*/
|
|
9268
|
+
export const cutRetrieveExport = (options) => (options.client ?? client).get({
|
|
9269
|
+
security: [{
|
|
9270
|
+
key: 'BearerAuth',
|
|
9271
|
+
scheme: 'bearer',
|
|
9272
|
+
type: 'http'
|
|
9273
|
+
}, {
|
|
9274
|
+
key: 'ApiKeyAuth',
|
|
9275
|
+
name: 'X-API-Key',
|
|
9276
|
+
type: 'apiKey'
|
|
9277
|
+
}],
|
|
9278
|
+
url: '/cut/v1/exports/{export_id}',
|
|
9279
|
+
...options
|
|
9280
|
+
});
|
|
9281
|
+
/**
|
|
9282
|
+
* Cancel video export
|
|
9283
|
+
*
|
|
9284
|
+
* Request cancellation of an export obtained from projects.exports.create or list when its output is no longer needed. Read the returned job status and retrieve it to confirm the terminal outcome; do not interpret a cancellation request as successful rendering.
|
|
9285
|
+
*/
|
|
9286
|
+
export const cutCancelExport = (options) => (options.client ?? client).post({
|
|
9287
|
+
security: [{
|
|
9288
|
+
key: 'BearerAuth',
|
|
9289
|
+
scheme: 'bearer',
|
|
9290
|
+
type: 'http'
|
|
9291
|
+
}, {
|
|
9292
|
+
key: 'ApiKeyAuth',
|
|
9293
|
+
name: 'X-API-Key',
|
|
9294
|
+
type: 'apiKey'
|
|
9295
|
+
}],
|
|
9296
|
+
url: '/cut/v1/exports/{export_id}:cancel',
|
|
9297
|
+
...options
|
|
9298
|
+
});
|
|
9299
|
+
/**
|
|
9300
|
+
* List saved versions
|
|
9301
|
+
*
|
|
9302
|
+
* Find saved timeline snapshots for this project and obtain version_id values for restore. A saved version records its original revision; restoring it creates a new current revision rather than rewinding the revision counter. Continue with next_page_token as page_token until absent.
|
|
9303
|
+
*/
|
|
9304
|
+
export const cutListVersions = (options) => (options.client ?? client).get({
|
|
9305
|
+
security: [{
|
|
9306
|
+
key: 'BearerAuth',
|
|
9307
|
+
scheme: 'bearer',
|
|
9308
|
+
type: 'http'
|
|
9309
|
+
}, {
|
|
9310
|
+
key: 'ApiKeyAuth',
|
|
9311
|
+
name: 'X-API-Key',
|
|
9312
|
+
type: 'apiKey'
|
|
9313
|
+
}],
|
|
9314
|
+
url: '/cut/v1/projects/{project_id}/versions',
|
|
9315
|
+
...options
|
|
9316
|
+
});
|
|
9317
|
+
/**
|
|
9318
|
+
* Save project version
|
|
9319
|
+
*
|
|
9320
|
+
* Save the current project timeline as a named recovery point before a substantial edit. Supply an optional label or send an empty object; keep the returned version id for versions.restore. Saving a version does not publish a rendered asset; use projects.exports.create for video output.
|
|
9321
|
+
*/
|
|
9322
|
+
export const cutCreateVersion = (options) => (options.client ?? client).post({
|
|
9323
|
+
security: [{
|
|
9324
|
+
key: 'BearerAuth',
|
|
9325
|
+
scheme: 'bearer',
|
|
9326
|
+
type: 'http'
|
|
9327
|
+
}, {
|
|
9328
|
+
key: 'ApiKeyAuth',
|
|
9329
|
+
name: 'X-API-Key',
|
|
9330
|
+
type: 'apiKey'
|
|
9331
|
+
}],
|
|
9332
|
+
url: '/cut/v1/projects/{project_id}/versions',
|
|
9333
|
+
...options,
|
|
9334
|
+
headers: {
|
|
9335
|
+
'Content-Type': 'application/json',
|
|
9336
|
+
...options.headers
|
|
9337
|
+
}
|
|
9338
|
+
});
|
|
9339
|
+
/**
|
|
9340
|
+
* Restore saved version
|
|
9341
|
+
*
|
|
9342
|
+
* Replace current editing content with a saved project snapshot selected from projects.versions.list. The restore commits a new transaction and revision while preserving the saved version for future use. Inspect the returned summary and timeline before further editing; a response revision conflict can follow a committed restore, so retrieve current state before retrying.
|
|
9343
|
+
*/
|
|
9344
|
+
export const cutRestoreVersion = (options) => (options.client ?? client).post({
|
|
9345
|
+
security: [{
|
|
9346
|
+
key: 'BearerAuth',
|
|
9347
|
+
scheme: 'bearer',
|
|
9348
|
+
type: 'http'
|
|
9349
|
+
}, {
|
|
9350
|
+
key: 'ApiKeyAuth',
|
|
9351
|
+
name: 'X-API-Key',
|
|
9352
|
+
type: 'apiKey'
|
|
9353
|
+
}],
|
|
9354
|
+
url: '/cut/v1/versions/{version_id}:restore',
|
|
9355
|
+
...options
|
|
9356
|
+
});
|
|
9357
|
+
/**
|
|
9358
|
+
* List table databases
|
|
9359
|
+
*
|
|
9360
|
+
* Find the table databases owned by your tenant (databases of the other type are not listed) and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
|
|
9361
|
+
*/
|
|
9362
|
+
export const databaseListTableDatabases = (options) => (options?.client ?? client).get({
|
|
9363
|
+
security: [{
|
|
9364
|
+
key: 'database-bearerAuth',
|
|
9365
|
+
scheme: 'bearer',
|
|
9366
|
+
type: 'http'
|
|
9367
|
+
}],
|
|
9368
|
+
url: '/database/v1/table',
|
|
9369
|
+
...options
|
|
9370
|
+
});
|
|
9371
|
+
/**
|
|
9372
|
+
* Create table database
|
|
9373
|
+
*
|
|
9374
|
+
* Creates an empty table database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.table.tables.create, then read and write rows with praxis.database.table.rest. The path is the type: the body takes no kind, and a body that carries kind returns 400 INVALID_PARAMS: kind is set by the path. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListTableDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies. For Redis-style keys use praxis.database.kv.create instead.
|
|
9375
|
+
*/
|
|
9376
|
+
export const databaseCreateTableDatabase = (options) => (options.client ?? client).post({
|
|
9377
|
+
security: [{
|
|
9378
|
+
key: 'database-bearerAuth',
|
|
9379
|
+
scheme: 'bearer',
|
|
9380
|
+
type: 'http'
|
|
9381
|
+
}],
|
|
9382
|
+
url: '/database/v1/table',
|
|
9383
|
+
...options,
|
|
9384
|
+
headers: {
|
|
9385
|
+
'Content-Type': 'application/json',
|
|
9386
|
+
...options.headers
|
|
9387
|
+
}
|
|
9388
|
+
});
|
|
9389
|
+
/**
|
|
9390
|
+
* List key-value databases
|
|
9391
|
+
*
|
|
9392
|
+
* Find the key-value databases owned by your tenant (databases of the other type are not listed) and obtain their ids for key and command operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
|
|
9393
|
+
*/
|
|
9394
|
+
export const databaseListKvDatabases = (options) => (options?.client ?? client).get({
|
|
9395
|
+
security: [{
|
|
9396
|
+
key: 'database-bearerAuth',
|
|
9397
|
+
scheme: 'bearer',
|
|
9398
|
+
type: 'http'
|
|
9399
|
+
}],
|
|
9400
|
+
url: '/database/v1/kv',
|
|
9401
|
+
...options
|
|
9402
|
+
});
|
|
9403
|
+
/**
|
|
9404
|
+
* Create key-value database
|
|
9405
|
+
*
|
|
9406
|
+
* Creates an empty key-value database (键值库) for the caller and returns it with status active (HTTP 201); read and write it next with praxis.database.kv.keys and praxis.database.kv.commands, or point an existing Redis or @upstash/redis client at /redis/<database_id>. The path is the type: the body takes no kind, and a body that carries kind returns 400 INVALID_PARAMS: kind is set by the path. Creating a key-value database in an organization that has not been opened for it returns 400 INVALID_PARAMS: kind kv is not available. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListKvDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Use a Praxis credential; access is scoped to its tenant. For structured tables and rows use praxis.database.table.create instead.
|
|
9407
|
+
*/
|
|
9408
|
+
export const databaseCreateKvDatabase = (options) => (options.client ?? client).post({
|
|
9409
|
+
security: [{
|
|
9410
|
+
key: 'database-bearerAuth',
|
|
9411
|
+
scheme: 'bearer',
|
|
9412
|
+
type: 'http'
|
|
9413
|
+
}],
|
|
9414
|
+
url: '/database/v1/kv',
|
|
9415
|
+
...options,
|
|
9416
|
+
headers: {
|
|
9417
|
+
'Content-Type': 'application/json',
|
|
9418
|
+
...options.headers
|
|
9419
|
+
}
|
|
9420
|
+
});
|
|
9421
|
+
/**
|
|
9422
|
+
* Delete database
|
|
9423
|
+
*
|
|
9424
|
+
* Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
|
|
9425
|
+
*/
|
|
9426
|
+
export const databaseDeleteTableDatabase = (options) => (options.client ?? client).delete({
|
|
9427
|
+
security: [{
|
|
9428
|
+
key: 'database-bearerAuth',
|
|
9429
|
+
scheme: 'bearer',
|
|
9430
|
+
type: 'http'
|
|
9431
|
+
}],
|
|
9432
|
+
url: '/database/v1/table/{database_id}',
|
|
9433
|
+
...options
|
|
9434
|
+
});
|
|
9435
|
+
/**
|
|
9436
|
+
* Get table database
|
|
9437
|
+
*
|
|
9438
|
+
* Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id, or the id of a key-value database, returns 404 DATABASE_NOT_FOUND.
|
|
9439
|
+
*/
|
|
9440
|
+
export const databaseGetTableDatabase = (options) => (options.client ?? client).get({
|
|
9441
|
+
security: [{
|
|
9442
|
+
key: 'database-bearerAuth',
|
|
9443
|
+
scheme: 'bearer',
|
|
9444
|
+
type: 'http'
|
|
9445
|
+
}],
|
|
9446
|
+
url: '/database/v1/table/{database_id}',
|
|
9447
|
+
...options
|
|
9448
|
+
});
|
|
9449
|
+
/**
|
|
9450
|
+
* Update database
|
|
9451
|
+
*
|
|
9452
|
+
* Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreTableDatabase.
|
|
9453
|
+
*/
|
|
9454
|
+
export const databaseUpdateTableDatabase = (options) => (options.client ?? client).patch({
|
|
9455
|
+
security: [{
|
|
9456
|
+
key: 'database-bearerAuth',
|
|
9457
|
+
scheme: 'bearer',
|
|
9458
|
+
type: 'http'
|
|
9459
|
+
}],
|
|
9460
|
+
url: '/database/v1/table/{database_id}',
|
|
9461
|
+
...options,
|
|
9462
|
+
headers: {
|
|
9463
|
+
'Content-Type': 'application/json',
|
|
9464
|
+
...options.headers
|
|
9465
|
+
}
|
|
9466
|
+
});
|
|
9467
|
+
/**
|
|
9468
|
+
* Delete database
|
|
9469
|
+
*
|
|
9470
|
+
* Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
|
|
9471
|
+
*/
|
|
9472
|
+
export const databaseDeleteKvDatabase = (options) => (options.client ?? client).delete({
|
|
9473
|
+
security: [{
|
|
9474
|
+
key: 'database-bearerAuth',
|
|
9475
|
+
scheme: 'bearer',
|
|
9476
|
+
type: 'http'
|
|
9477
|
+
}],
|
|
9478
|
+
url: '/database/v1/kv/{database_id}',
|
|
9479
|
+
...options
|
|
9480
|
+
});
|
|
9481
|
+
/**
|
|
9482
|
+
* Get key-value database
|
|
9483
|
+
*
|
|
9484
|
+
* Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before key or command operations to confirm status is active: key and command calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id, or the id of a table database, returns 404 DATABASE_NOT_FOUND.
|
|
9485
|
+
*/
|
|
9486
|
+
export const databaseGetKvDatabase = (options) => (options.client ?? client).get({
|
|
9487
|
+
security: [{
|
|
9488
|
+
key: 'database-bearerAuth',
|
|
9489
|
+
scheme: 'bearer',
|
|
9490
|
+
type: 'http'
|
|
9491
|
+
}],
|
|
9492
|
+
url: '/database/v1/kv/{database_id}',
|
|
9493
|
+
...options
|
|
9494
|
+
});
|
|
9495
|
+
/**
|
|
9496
|
+
* Update database
|
|
9497
|
+
*
|
|
9498
|
+
* Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreKvDatabase.
|
|
9499
|
+
*/
|
|
9500
|
+
export const databaseUpdateKvDatabase = (options) => (options.client ?? client).patch({
|
|
9501
|
+
security: [{
|
|
9502
|
+
key: 'database-bearerAuth',
|
|
9503
|
+
scheme: 'bearer',
|
|
9504
|
+
type: 'http'
|
|
9505
|
+
}],
|
|
9506
|
+
url: '/database/v1/kv/{database_id}',
|
|
9507
|
+
...options,
|
|
9508
|
+
headers: {
|
|
9509
|
+
'Content-Type': 'application/json',
|
|
9510
|
+
...options.headers
|
|
9511
|
+
}
|
|
9512
|
+
});
|
|
9513
|
+
/**
|
|
9514
|
+
* Restore database
|
|
9515
|
+
*
|
|
9516
|
+
* Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
|
|
9517
|
+
*/
|
|
9518
|
+
export const databaseRestoreTableDatabase = (options) => (options.client ?? client).post({
|
|
9519
|
+
security: [{
|
|
9520
|
+
key: 'database-bearerAuth',
|
|
9521
|
+
scheme: 'bearer',
|
|
9522
|
+
type: 'http'
|
|
9523
|
+
}],
|
|
9524
|
+
url: '/database/v1/table/{database_id}/restore',
|
|
9525
|
+
...options
|
|
9526
|
+
});
|
|
9527
|
+
/**
|
|
9528
|
+
* Restore database
|
|
9529
|
+
*
|
|
9530
|
+
* Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
|
|
9531
|
+
*/
|
|
9532
|
+
export const databaseRestoreKvDatabase = (options) => (options.client ?? client).post({
|
|
9533
|
+
security: [{
|
|
9534
|
+
key: 'database-bearerAuth',
|
|
9535
|
+
scheme: 'bearer',
|
|
9536
|
+
type: 'http'
|
|
9537
|
+
}],
|
|
9538
|
+
url: '/database/v1/kv/{database_id}/restore',
|
|
9539
|
+
...options
|
|
9540
|
+
});
|
|
9541
|
+
/**
|
|
9542
|
+
* Permanently purge database
|
|
9543
|
+
*
|
|
9544
|
+
* Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
|
|
9545
|
+
*/
|
|
9546
|
+
export const databasePurgeTableDatabase = (options) => (options.client ?? client).post({
|
|
9547
|
+
security: [{
|
|
9548
|
+
key: 'database-bearerAuth',
|
|
9549
|
+
scheme: 'bearer',
|
|
9550
|
+
type: 'http'
|
|
9551
|
+
}],
|
|
9552
|
+
url: '/database/v1/table/{database_id}/purge',
|
|
9553
|
+
...options
|
|
9554
|
+
});
|
|
9555
|
+
/**
|
|
9556
|
+
* Permanently purge database
|
|
9557
|
+
*
|
|
9558
|
+
* Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
|
|
9559
|
+
*/
|
|
9560
|
+
export const databasePurgeKvDatabase = (options) => (options.client ?? client).post({
|
|
9561
|
+
security: [{
|
|
9562
|
+
key: 'database-bearerAuth',
|
|
9563
|
+
scheme: 'bearer',
|
|
9564
|
+
type: 'http'
|
|
9565
|
+
}],
|
|
9566
|
+
url: '/database/v1/kv/{database_id}/purge',
|
|
9567
|
+
...options
|
|
9568
|
+
});
|
|
9569
|
+
/**
|
|
9570
|
+
* List tables
|
|
9571
|
+
*
|
|
9572
|
+
* Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseTableGetTable instead when you also need row_count for one table.
|
|
9573
|
+
*/
|
|
9574
|
+
export const databaseTableListTables = (options) => (options.client ?? client).get({
|
|
9575
|
+
security: [{
|
|
9576
|
+
key: 'database-bearerAuth',
|
|
9577
|
+
scheme: 'bearer',
|
|
9578
|
+
type: 'http'
|
|
9579
|
+
}],
|
|
9580
|
+
url: '/database/v1/table/{database_id}/tables',
|
|
9581
|
+
...options
|
|
9582
|
+
});
|
|
9583
|
+
/**
|
|
9584
|
+
* Create table
|
|
9585
|
+
*
|
|
9586
|
+
* Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseTableAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseTableInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
|
|
9587
|
+
*/
|
|
9588
|
+
export const databaseTableCreateTable = (options) => (options.client ?? client).post({
|
|
9589
|
+
security: [{
|
|
9590
|
+
key: 'database-bearerAuth',
|
|
9591
|
+
scheme: 'bearer',
|
|
9592
|
+
type: 'http'
|
|
9593
|
+
}],
|
|
9594
|
+
url: '/database/v1/table/{database_id}/tables',
|
|
9595
|
+
...options,
|
|
9596
|
+
headers: {
|
|
9597
|
+
'Content-Type': 'application/json',
|
|
9598
|
+
...options.headers
|
|
9599
|
+
}
|
|
9600
|
+
});
|
|
9601
|
+
/**
|
|
9602
|
+
* Delete table
|
|
9603
|
+
*
|
|
9604
|
+
* Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
|
|
9605
|
+
*/
|
|
9606
|
+
export const databaseTableDeleteTable = (options) => (options.client ?? client).delete({
|
|
9607
|
+
security: [{
|
|
9608
|
+
key: 'database-bearerAuth',
|
|
9609
|
+
scheme: 'bearer',
|
|
9610
|
+
type: 'http'
|
|
9611
|
+
}],
|
|
9612
|
+
url: '/database/v1/table/{database_id}/tables/{table}',
|
|
9613
|
+
...options
|
|
9614
|
+
});
|
|
9615
|
+
/**
|
|
9616
|
+
* Get table
|
|
9617
|
+
*
|
|
9618
|
+
* Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
|
|
9619
|
+
*/
|
|
9620
|
+
export const databaseTableGetTable = (options) => (options.client ?? client).get({
|
|
9621
|
+
security: [{
|
|
9622
|
+
key: 'database-bearerAuth',
|
|
9623
|
+
scheme: 'bearer',
|
|
9624
|
+
type: 'http'
|
|
9625
|
+
}],
|
|
9626
|
+
url: '/database/v1/table/{database_id}/tables/{table}',
|
|
9627
|
+
...options
|
|
9628
|
+
});
|
|
9629
|
+
/**
|
|
9630
|
+
* Update table
|
|
9631
|
+
*
|
|
9632
|
+
* Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseTableAddField, databaseTableUpdateField and databaseTableDeleteField.
|
|
9633
|
+
*/
|
|
9634
|
+
export const databaseTableUpdateTable = (options) => (options.client ?? client).patch({
|
|
9635
|
+
security: [{
|
|
9636
|
+
key: 'database-bearerAuth',
|
|
9637
|
+
scheme: 'bearer',
|
|
9638
|
+
type: 'http'
|
|
9639
|
+
}],
|
|
9640
|
+
url: '/database/v1/table/{database_id}/tables/{table}',
|
|
9641
|
+
...options,
|
|
9642
|
+
headers: {
|
|
9643
|
+
'Content-Type': 'application/json',
|
|
9644
|
+
...options.headers
|
|
9645
|
+
}
|
|
9646
|
+
});
|
|
9647
|
+
/**
|
|
9648
|
+
* Add field
|
|
9649
|
+
*
|
|
9650
|
+
* Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.
|
|
9651
|
+
*/
|
|
9652
|
+
export const databaseTableAddField = (options) => (options.client ?? client).post({
|
|
9653
|
+
security: [{
|
|
9654
|
+
key: 'database-bearerAuth',
|
|
9655
|
+
scheme: 'bearer',
|
|
9656
|
+
type: 'http'
|
|
9657
|
+
}],
|
|
9658
|
+
url: '/database/v1/table/{database_id}/tables/{table}/fields',
|
|
9659
|
+
...options,
|
|
9660
|
+
headers: {
|
|
9661
|
+
'Content-Type': 'application/json',
|
|
9662
|
+
...options.headers
|
|
9663
|
+
}
|
|
9664
|
+
});
|
|
9665
|
+
/**
|
|
9666
|
+
* Delete field
|
|
9667
|
+
*
|
|
9668
|
+
* Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
|
|
9669
|
+
*/
|
|
9670
|
+
export const databaseTableDeleteField = (options) => (options.client ?? client).delete({
|
|
9671
|
+
security: [{
|
|
9672
|
+
key: 'database-bearerAuth',
|
|
9673
|
+
scheme: 'bearer',
|
|
9674
|
+
type: 'http'
|
|
9675
|
+
}],
|
|
9676
|
+
url: '/database/v1/table/{database_id}/tables/{table}/fields/{field}',
|
|
9677
|
+
...options
|
|
9678
|
+
});
|
|
9679
|
+
/**
|
|
9680
|
+
* Update field
|
|
9681
|
+
*
|
|
9682
|
+
* Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
|
|
9683
|
+
*/
|
|
9684
|
+
export const databaseTableUpdateField = (options) => (options.client ?? client).patch({
|
|
9685
|
+
security: [{
|
|
9686
|
+
key: 'database-bearerAuth',
|
|
9687
|
+
scheme: 'bearer',
|
|
9688
|
+
type: 'http'
|
|
9689
|
+
}],
|
|
9690
|
+
url: '/database/v1/table/{database_id}/tables/{table}/fields/{field}',
|
|
9691
|
+
...options,
|
|
9692
|
+
headers: {
|
|
9693
|
+
'Content-Type': 'application/json',
|
|
9694
|
+
...options.headers
|
|
9695
|
+
}
|
|
9696
|
+
});
|
|
9697
|
+
/**
|
|
9698
|
+
* List events
|
|
9699
|
+
*
|
|
9700
|
+
* Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
|
|
9701
|
+
*/
|
|
9702
|
+
export const databaseTableListEvents = (options) => (options.client ?? client).get({
|
|
9703
|
+
security: [{
|
|
9704
|
+
key: 'database-bearerAuth',
|
|
9705
|
+
scheme: 'bearer',
|
|
9706
|
+
type: 'http'
|
|
9707
|
+
}],
|
|
9708
|
+
url: '/database/v1/table/{database_id}/events',
|
|
9709
|
+
...options
|
|
9710
|
+
});
|
|
9711
|
+
/**
|
|
9712
|
+
* List key-value database events
|
|
9713
|
+
*
|
|
9714
|
+
* Read the lifecycle events of a key-value database (created, status changes), including while the database is deleting; use it to see when the database was provisioned or deleted. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. This is paged lifecycle history, not a feed of key changes: writing, updating or deleting keys does not add events. The id of a table database returns 404 DATABASE_NOT_FOUND here; read its events with praxis.database.table.events.list.
|
|
9715
|
+
*/
|
|
9716
|
+
export const databaseKvListEvents = (options) => (options.client ?? client).get({
|
|
9717
|
+
security: [{
|
|
9718
|
+
key: 'database-bearerAuth',
|
|
9719
|
+
scheme: 'bearer',
|
|
9720
|
+
type: 'http'
|
|
9721
|
+
}],
|
|
9722
|
+
url: '/database/v1/kv/{database_id}/events',
|
|
9723
|
+
...options
|
|
8926
9724
|
});
|
|
8927
9725
|
/**
|
|
8928
|
-
*
|
|
9726
|
+
* Delete rows
|
|
8929
9727
|
*
|
|
8930
|
-
*
|
|
9728
|
+
* Deletes the rows matched by the filter query parameters (the same filters as databaseTableSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
|
|
8931
9729
|
*/
|
|
8932
|
-
export const
|
|
9730
|
+
export const databaseTableDelete = (options) => (options.client ?? client).delete({
|
|
8933
9731
|
security: [{
|
|
8934
|
-
key: '
|
|
9732
|
+
key: 'database-bearerAuth',
|
|
8935
9733
|
scheme: 'bearer',
|
|
8936
9734
|
type: 'http'
|
|
8937
|
-
}, {
|
|
8938
|
-
key: 'ApiKeyAuth',
|
|
8939
|
-
name: 'X-API-Key',
|
|
8940
|
-
type: 'apiKey'
|
|
8941
9735
|
}],
|
|
8942
|
-
url: '/
|
|
9736
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
8943
9737
|
...options
|
|
8944
9738
|
});
|
|
8945
9739
|
/**
|
|
8946
|
-
*
|
|
9740
|
+
* Select rows
|
|
8947
9741
|
*
|
|
8948
|
-
*
|
|
9742
|
+
* Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
|
|
8949
9743
|
*/
|
|
8950
|
-
export const
|
|
9744
|
+
export const databaseTableSelect = (options) => (options.client ?? client).get({
|
|
8951
9745
|
security: [{
|
|
8952
|
-
key: '
|
|
9746
|
+
key: 'database-bearerAuth',
|
|
8953
9747
|
scheme: 'bearer',
|
|
8954
9748
|
type: 'http'
|
|
8955
|
-
}, {
|
|
8956
|
-
key: 'ApiKeyAuth',
|
|
8957
|
-
name: 'X-API-Key',
|
|
8958
|
-
type: 'apiKey'
|
|
8959
9749
|
}],
|
|
8960
|
-
url: '/
|
|
8961
|
-
...options
|
|
8962
|
-
headers: {
|
|
8963
|
-
'Content-Type': 'application/json',
|
|
8964
|
-
...options.headers
|
|
8965
|
-
}
|
|
9750
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
9751
|
+
...options
|
|
8966
9752
|
});
|
|
8967
9753
|
/**
|
|
8968
|
-
*
|
|
9754
|
+
* Count rows
|
|
8969
9755
|
*
|
|
8970
|
-
*
|
|
9756
|
+
* Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
|
|
8971
9757
|
*/
|
|
8972
|
-
export const
|
|
9758
|
+
export const databaseTableHead = (options) => (options.client ?? client).head({
|
|
8973
9759
|
security: [{
|
|
8974
|
-
key: '
|
|
9760
|
+
key: 'database-bearerAuth',
|
|
8975
9761
|
scheme: 'bearer',
|
|
8976
9762
|
type: 'http'
|
|
8977
|
-
}, {
|
|
8978
|
-
key: 'ApiKeyAuth',
|
|
8979
|
-
name: 'X-API-Key',
|
|
8980
|
-
type: 'apiKey'
|
|
8981
9763
|
}],
|
|
8982
|
-
url: '/
|
|
9764
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
8983
9765
|
...options
|
|
8984
9766
|
});
|
|
8985
9767
|
/**
|
|
8986
|
-
*
|
|
9768
|
+
* Update rows
|
|
8987
9769
|
*
|
|
8988
|
-
*
|
|
9770
|
+
* Updates the rows matched by the filter query parameters (the same filters as databaseTableSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
|
|
8989
9771
|
*/
|
|
8990
|
-
export const
|
|
9772
|
+
export const databaseTableUpdate = (options) => (options.client ?? client).patch({
|
|
8991
9773
|
security: [{
|
|
8992
|
-
key: '
|
|
9774
|
+
key: 'database-bearerAuth',
|
|
8993
9775
|
scheme: 'bearer',
|
|
8994
9776
|
type: 'http'
|
|
8995
|
-
}, {
|
|
8996
|
-
key: 'ApiKeyAuth',
|
|
8997
|
-
name: 'X-API-Key',
|
|
8998
|
-
type: 'apiKey'
|
|
8999
9777
|
}],
|
|
9000
|
-
url: '/
|
|
9778
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
9001
9779
|
...options,
|
|
9002
9780
|
headers: {
|
|
9003
9781
|
'Content-Type': 'application/json',
|
|
@@ -9005,21 +9783,19 @@ export const cutCreateExport = (options) => (options.client ?? client).post({
|
|
|
9005
9783
|
}
|
|
9006
9784
|
});
|
|
9007
9785
|
/**
|
|
9008
|
-
*
|
|
9786
|
+
* Insert rows
|
|
9009
9787
|
*
|
|
9010
|
-
*
|
|
9788
|
+
* Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
|
|
9789
|
+
* Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
|
|
9790
|
+
* The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
|
|
9011
9791
|
*/
|
|
9012
|
-
export const
|
|
9792
|
+
export const databaseTableInsert = (options) => (options.client ?? client).post({
|
|
9013
9793
|
security: [{
|
|
9014
|
-
key: '
|
|
9794
|
+
key: 'database-bearerAuth',
|
|
9015
9795
|
scheme: 'bearer',
|
|
9016
9796
|
type: 'http'
|
|
9017
|
-
}, {
|
|
9018
|
-
key: 'ApiKeyAuth',
|
|
9019
|
-
name: 'X-API-Key',
|
|
9020
|
-
type: 'apiKey'
|
|
9021
9797
|
}],
|
|
9022
|
-
url: '/
|
|
9798
|
+
url: '/database/v1/table/{database_id}/rest/{table}',
|
|
9023
9799
|
...options,
|
|
9024
9800
|
headers: {
|
|
9025
9801
|
'Content-Type': 'application/json',
|
|
@@ -9027,93 +9803,77 @@ export const cutCreateRender = (options) => (options.client ?? client).post({
|
|
|
9027
9803
|
}
|
|
9028
9804
|
});
|
|
9029
9805
|
/**
|
|
9030
|
-
*
|
|
9806
|
+
* List keys
|
|
9031
9807
|
*
|
|
9032
|
-
*
|
|
9808
|
+
* Browse the keys of a key-value database (kind kv): use it to see what is stored before reading one key with databaseKvGetKey; to run an arbitrary Redis command (counters, ranges, scans) use databaseKvExecuteCommand instead. Keys come back in lexicographic key order, one page at a time, as summaries (key, type, remaining TTL, size) without values; expired keys are never returned. pattern filters with a Redis glob (* ? [abc] [^abc]) matched against the whole key, and type keeps one value type. limit is 1–500, default 50; while next_cursor is a string, pass it back unchanged as cursor for the next page; null means this is the last page. Needs a read credential. Errors: 400 INVALID_PARAMS for a limit outside 1–500 or a malformed query; 404 DATABASE_NOT_FOUND for an unknown id.
|
|
9033
9809
|
*/
|
|
9034
|
-
export const
|
|
9810
|
+
export const databaseKvListKeys = (options) => (options.client ?? client).get({
|
|
9035
9811
|
security: [{
|
|
9036
|
-
key: '
|
|
9812
|
+
key: 'database-bearerAuth',
|
|
9037
9813
|
scheme: 'bearer',
|
|
9038
9814
|
type: 'http'
|
|
9039
|
-
}, {
|
|
9040
|
-
key: 'ApiKeyAuth',
|
|
9041
|
-
name: 'X-API-Key',
|
|
9042
|
-
type: 'apiKey'
|
|
9043
9815
|
}],
|
|
9044
|
-
url: '/
|
|
9816
|
+
url: '/database/v1/kv/{database_id}/keys',
|
|
9045
9817
|
...options
|
|
9046
9818
|
});
|
|
9047
9819
|
/**
|
|
9048
|
-
*
|
|
9820
|
+
* Delete key
|
|
9049
9821
|
*
|
|
9050
|
-
*
|
|
9822
|
+
* Delete one key of a key-value database together with its value; the data cannot be recovered. A key that is absent or has already expired is not an error: the call succeeds with deleted false, so it is safe to retry. To delete many keys at once or by pattern, list them with databaseKvListKeys or run DEL / UNLINK through databaseKvExecuteCommand. Needs a read-write credential. Errors: 404 DATABASE_NOT_FOUND for an unknown id; 403 BINDING_READ_ONLY for a read-only credential.
|
|
9051
9823
|
*/
|
|
9052
|
-
export const
|
|
9824
|
+
export const databaseKvDeleteKey = (options) => (options.client ?? client).delete({
|
|
9053
9825
|
security: [{
|
|
9054
|
-
key: '
|
|
9826
|
+
key: 'database-bearerAuth',
|
|
9055
9827
|
scheme: 'bearer',
|
|
9056
9828
|
type: 'http'
|
|
9057
|
-
}, {
|
|
9058
|
-
key: 'ApiKeyAuth',
|
|
9059
|
-
name: 'X-API-Key',
|
|
9060
|
-
type: 'apiKey'
|
|
9061
9829
|
}],
|
|
9062
|
-
url: '/
|
|
9830
|
+
url: '/database/v1/kv/{database_id}/keys/{key}',
|
|
9063
9831
|
...options
|
|
9064
9832
|
});
|
|
9065
9833
|
/**
|
|
9066
|
-
*
|
|
9834
|
+
* Get key
|
|
9067
9835
|
*
|
|
9068
|
-
*
|
|
9836
|
+
* Read one key of a key-value database with its type, TTL, size and value; use databaseKvListKeys first to find key names. A string value is returned whole. A hash, list, set or zset is returned a page of entries at a time: limit is 1–1000, default 100, and while next_cursor is a string, pass it back unchanged as cursor to read the next page; string values and the last page return next_cursor null. value takes the shape of type: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}]. Needs a read credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS for a limit outside 1–1000; 404 DATABASE_NOT_FOUND.
|
|
9069
9837
|
*/
|
|
9070
|
-
export const
|
|
9838
|
+
export const databaseKvGetKey = (options) => (options.client ?? client).get({
|
|
9071
9839
|
security: [{
|
|
9072
|
-
key: '
|
|
9840
|
+
key: 'database-bearerAuth',
|
|
9073
9841
|
scheme: 'bearer',
|
|
9074
9842
|
type: 'http'
|
|
9075
|
-
}, {
|
|
9076
|
-
key: 'ApiKeyAuth',
|
|
9077
|
-
name: 'X-API-Key',
|
|
9078
|
-
type: 'apiKey'
|
|
9079
9843
|
}],
|
|
9080
|
-
url: '/
|
|
9844
|
+
url: '/database/v1/kv/{database_id}/keys/{key}',
|
|
9081
9845
|
...options
|
|
9082
9846
|
});
|
|
9083
9847
|
/**
|
|
9084
|
-
*
|
|
9848
|
+
* Update key
|
|
9085
9849
|
*
|
|
9086
|
-
*
|
|
9850
|
+
* Change only the TTL of an existing key of a key-value database, leaving its value alone. update_mask must be ttl_ms (the only writable field) and ttl_ms is required: a positive integer is the new TTL in milliseconds (Redis PEXPIRE), null removes the TTL so the key never expires (PERSIST). To replace the value use databaseKvSetKey. Returns the key after the change. Needs a read-write credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS when update_mask is not ttl_ms or ttl_ms is neither a positive integer nor null; 404 DATABASE_NOT_FOUND; 403 BINDING_READ_ONLY.
|
|
9087
9851
|
*/
|
|
9088
|
-
export const
|
|
9852
|
+
export const databaseKvUpdateKey = (options) => (options.client ?? client).patch({
|
|
9089
9853
|
security: [{
|
|
9090
|
-
key: '
|
|
9854
|
+
key: 'database-bearerAuth',
|
|
9091
9855
|
scheme: 'bearer',
|
|
9092
9856
|
type: 'http'
|
|
9093
|
-
}, {
|
|
9094
|
-
key: 'ApiKeyAuth',
|
|
9095
|
-
name: 'X-API-Key',
|
|
9096
|
-
type: 'apiKey'
|
|
9097
9857
|
}],
|
|
9098
|
-
url: '/
|
|
9099
|
-
...options
|
|
9858
|
+
url: '/database/v1/kv/{database_id}/keys/{key}',
|
|
9859
|
+
...options,
|
|
9860
|
+
headers: {
|
|
9861
|
+
'Content-Type': 'application/json',
|
|
9862
|
+
...options.headers
|
|
9863
|
+
}
|
|
9100
9864
|
});
|
|
9101
9865
|
/**
|
|
9102
|
-
*
|
|
9866
|
+
* Set key
|
|
9103
9867
|
*
|
|
9104
|
-
*
|
|
9868
|
+
* Overwrite one key of a key-value database with a whole new value in a single transaction, creating it if absent; the previous value is dropped first and never merged, even when the type changes. To change only the TTL use databaseKvUpdateKey; to add to a counter or push onto a list use databaseKvExecuteCommand. type decides the shape of value: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}] with finite scores. Containers must not be empty, and hash fields and set members must be unique. ttl_ms omitted keeps the key's existing TTL, a positive integer sets a new one in milliseconds, null makes the key permanent. A value is at most 1 MiB and a key at most 1 KiB. Returns the stored key (first page for a container). Needs a read-write credential. Errors: 400 INVALID_PARAMS for an empty container, duplicate field or member, non-finite score or bad ttl_ms; 400 LIMIT_EXCEEDED for an oversized key or value; 503 CAPACITY when the database is full; 404 DATABASE_NOT_FOUND; 403 BINDING_READ_ONLY for a read-only credential.
|
|
9105
9869
|
*/
|
|
9106
|
-
export const
|
|
9870
|
+
export const databaseKvSetKey = (options) => (options.client ?? client).put({
|
|
9107
9871
|
security: [{
|
|
9108
|
-
key: '
|
|
9872
|
+
key: 'database-bearerAuth',
|
|
9109
9873
|
scheme: 'bearer',
|
|
9110
9874
|
type: 'http'
|
|
9111
|
-
}, {
|
|
9112
|
-
key: 'ApiKeyAuth',
|
|
9113
|
-
name: 'X-API-Key',
|
|
9114
|
-
type: 'apiKey'
|
|
9115
9875
|
}],
|
|
9116
|
-
url: '/
|
|
9876
|
+
url: '/database/v1/kv/{database_id}/keys/{key}',
|
|
9117
9877
|
...options,
|
|
9118
9878
|
headers: {
|
|
9119
9879
|
'Content-Type': 'application/json',
|
|
@@ -9121,27 +9881,29 @@ export const cutCreateVersion = (options) => (options.client ?? client).post({
|
|
|
9121
9881
|
}
|
|
9122
9882
|
});
|
|
9123
9883
|
/**
|
|
9124
|
-
*
|
|
9884
|
+
* Execute command
|
|
9125
9885
|
*
|
|
9126
|
-
*
|
|
9886
|
+
* Run one Redis command with Redis 7 semantics against a key-value database and get its reply; use it for what the key operations cannot do: counters (INCR), list and set operations, ranges (LRANGE, ZRANGE), scans (SCAN, HSCAN) and expiry commands. For one whole-value read or write use databaseKvGetKey / databaseKvSetKey; for existing Redis clients use the Upstash-compatible face under /redis. command is the command name followed by its arguments, every element a string, for example ["SET","k","v"] or ["LRANGE","queue","0","9"]. result is Redis's reply as plain JSON (integers, strings, arrays, null), never base64. Not supported: Lua scripting (EVAL), blocking commands, Pub/Sub and Streams. A value is at most 1 MiB, a key at most 1 KiB, a reply at most 8 MiB (read big collections in ranges with SCAN, HSCAN, LRANGE or ZRANGE) and the database at most 1 GiB. A read command needs a read credential; a write command, or a command that cannot be parsed, needs a read-write credential. Errors: 400 KV_COMMAND_ERROR when Redis rejects the command, with Redis's own text in message (for example WRONGTYPE Operation against a key holding the wrong kind of value or ERR unknown command); 400 INVALID_PARAMS for a missing or empty command; 404 DATABASE_NOT_FOUND; 403 BINDING_READ_ONLY for a write on a read-only credential.
|
|
9127
9887
|
*/
|
|
9128
|
-
export const
|
|
9888
|
+
export const databaseKvExecuteCommand = (options) => (options.client ?? client).post({
|
|
9129
9889
|
security: [{
|
|
9130
|
-
key: '
|
|
9890
|
+
key: 'database-bearerAuth',
|
|
9131
9891
|
scheme: 'bearer',
|
|
9132
9892
|
type: 'http'
|
|
9133
|
-
}, {
|
|
9134
|
-
key: 'ApiKeyAuth',
|
|
9135
|
-
name: 'X-API-Key',
|
|
9136
|
-
type: 'apiKey'
|
|
9137
9893
|
}],
|
|
9138
|
-
url: '/
|
|
9139
|
-
...options
|
|
9894
|
+
url: '/database/v1/kv/{database_id}/commands',
|
|
9895
|
+
...options,
|
|
9896
|
+
headers: {
|
|
9897
|
+
'Content-Type': 'application/json',
|
|
9898
|
+
...options.headers
|
|
9899
|
+
}
|
|
9140
9900
|
});
|
|
9141
9901
|
/**
|
|
9142
9902
|
* List databases
|
|
9143
9903
|
*
|
|
9144
|
-
* Find databases owned by your tenant and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
|
|
9904
|
+
* Deprecated: use praxis.database.table.list for a table database or praxis.database.kv.list for a key-value database instead; this path stops working on 2027-03-01. Find databases owned by your tenant and obtain their ids for schema or row operations. Excludes deleting by default. status=active or status=deleting selects that state; invalid values return 400 INVALID_PARAMS.
|
|
9905
|
+
*
|
|
9906
|
+
* @deprecated
|
|
9145
9907
|
*/
|
|
9146
9908
|
export const databaseListDatabases = (options) => (options?.client ?? client).get({
|
|
9147
9909
|
security: [{
|
|
@@ -9155,7 +9917,9 @@ export const databaseListDatabases = (options) => (options?.client ?? client).ge
|
|
|
9155
9917
|
/**
|
|
9156
9918
|
* Create database
|
|
9157
9919
|
*
|
|
9158
|
-
* Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
|
|
9920
|
+
* Deprecated: use praxis.database.table.create for a table database or praxis.database.kv.create for a key-value database instead; this path stops working on 2027-03-01. Creates an empty database for the caller and returns it with status active (HTTP 201); add tables next with praxis.database.databases.tables.create. name is required and is 1–64 visible characters after trimming. kind is optional: table (the default) for tables and rows, kv for Redis-style keys and values; it cannot change later, and creating kv where it is not available returns 400 INVALID_PARAMS: kind kv is not available. labels are optional string tags (at most 64; each key starts with a lowercase letter and uses up to 63 characters of a-z 0-9 _ -; each value is up to 63 characters of a-z 0-9 _ -) that databaseListDatabases can filter on. If initialization fails the call returns 503 CAPACITY and the half-created database is left with status failed; retry by calling create again, which makes a new database. Unlike Supabase, this creates a SQLite-backed database without a PostgreSQL connection or SQL execution endpoint. Use a Praxis credential; access is scoped to its tenant, not to Supabase Auth users or RLS policies.
|
|
9921
|
+
*
|
|
9922
|
+
* @deprecated
|
|
9159
9923
|
*/
|
|
9160
9924
|
export const databaseCreateDatabase = (options) => (options.client ?? client).post({
|
|
9161
9925
|
security: [{
|
|
@@ -9173,7 +9937,9 @@ export const databaseCreateDatabase = (options) => (options.client ?? client).po
|
|
|
9173
9937
|
/**
|
|
9174
9938
|
* Delete database
|
|
9175
9939
|
*
|
|
9176
|
-
* Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
|
|
9940
|
+
* Deprecated: use praxis.database.table.delete for a table database or praxis.database.kv.delete for a key-value database instead; this path stops working on 2027-03-01. Soft-delete a database when it should stop accepting schema and row operations. Idempotently enters deleting with a seven-day purge_at. GET remains available; child operations return 409 until restored.
|
|
9941
|
+
*
|
|
9942
|
+
* @deprecated
|
|
9177
9943
|
*/
|
|
9178
9944
|
export const databaseDeleteDatabase = (options) => (options.client ?? client).delete({
|
|
9179
9945
|
security: [{
|
|
@@ -9187,7 +9953,9 @@ export const databaseDeleteDatabase = (options) => (options.client ?? client).de
|
|
|
9187
9953
|
/**
|
|
9188
9954
|
* Get database
|
|
9189
9955
|
*
|
|
9190
|
-
* Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id returns 404 DATABASE_NOT_FOUND.
|
|
9956
|
+
* Deprecated: use praxis.database.table.retrieve for a table database or praxis.database.kv.retrieve for a key-value database instead; this path stops working on 2027-03-01. Returns one database by id, including a database in the deleting state (purge_at then shows when it will be permanently removed). Call it before table or row operations to confirm status is active: schema and row calls on a deleting database return 409 DATABASE_INVALID_STATE. size_bytes is refreshed from live storage at most once every five seconds. A purged or unknown id returns 404 DATABASE_NOT_FOUND.
|
|
9957
|
+
*
|
|
9958
|
+
* @deprecated
|
|
9191
9959
|
*/
|
|
9192
9960
|
export const databaseGetDatabase = (options) => (options.client ?? client).get({
|
|
9193
9961
|
security: [{
|
|
@@ -9201,7 +9969,9 @@ export const databaseGetDatabase = (options) => (options.client ?? client).get({
|
|
|
9201
9969
|
/**
|
|
9202
9970
|
* Update database
|
|
9203
9971
|
*
|
|
9204
|
-
* Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreDatabase.
|
|
9972
|
+
* Deprecated: use praxis.database.table.update for a table database or praxis.database.kv.update for a key-value database instead; this path stops working on 2027-03-01. Renames an active database and/or replaces its labels; send only the keys you want to change. labels is replaced as a whole, not merged, so include every label you want to keep. A body without name or labels, or with values equal to the current ones, changes nothing and leaves updated_at as is. A database in the deleting state returns 409 DATABASE_INVALID_STATE; restore it first with databaseRestoreDatabase.
|
|
9973
|
+
*
|
|
9974
|
+
* @deprecated
|
|
9205
9975
|
*/
|
|
9206
9976
|
export const databaseUpdateDatabase = (options) => (options.client ?? client).patch({
|
|
9207
9977
|
security: [{
|
|
@@ -9219,7 +9989,9 @@ export const databaseUpdateDatabase = (options) => (options.client ?? client).pa
|
|
|
9219
9989
|
/**
|
|
9220
9990
|
* Restore database
|
|
9221
9991
|
*
|
|
9222
|
-
* Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
|
|
9992
|
+
* Deprecated: use praxis.database.table.restore for a table database or praxis.database.kv.restore for a key-value database instead; this path stops working on 2027-03-01. Recover a soft-deleted database within its seven-day recovery window. Restore before purge_at. An empty body is accepted. Active databases return 409; purged databases return 404.
|
|
9993
|
+
*
|
|
9994
|
+
* @deprecated
|
|
9223
9995
|
*/
|
|
9224
9996
|
export const databaseRestoreDatabase = (options) => (options.client ?? client).post({
|
|
9225
9997
|
security: [{
|
|
@@ -9233,7 +10005,9 @@ export const databaseRestoreDatabase = (options) => (options.client ?? client).p
|
|
|
9233
10005
|
/**
|
|
9234
10006
|
* Permanently purge database
|
|
9235
10007
|
*
|
|
9236
|
-
* Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
|
|
10008
|
+
* Deprecated: use praxis.database.table.purge.create for a table database or praxis.database.kv.purge.create for a key-value database instead; this path stops working on 2027-03-01. Immediately and irreversibly purges a deleting database. Active databases return 409; absent or already purged databases return 404.
|
|
10009
|
+
*
|
|
10010
|
+
* @deprecated
|
|
9237
10011
|
*/
|
|
9238
10012
|
export const databasePurgeDatabase = (options) => (options.client ?? client).post({
|
|
9239
10013
|
security: [{
|
|
@@ -9247,7 +10021,9 @@ export const databasePurgeDatabase = (options) => (options.client ?? client).pos
|
|
|
9247
10021
|
/**
|
|
9248
10022
|
* List tables
|
|
9249
10023
|
*
|
|
9250
|
-
* Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseGetTable instead when you also need row_count for one table.
|
|
10024
|
+
* Deprecated: use praxis.database.table.tables.list instead; this path stops working on 2027-03-01. Lists every table of an active database with its field definitions. A database holds at most 50 tables, so the single page contains all of them and next_cursor is always null. Use databaseGetTable instead when you also need row_count for one table.
|
|
10025
|
+
*
|
|
10026
|
+
* @deprecated
|
|
9251
10027
|
*/
|
|
9252
10028
|
export const databaseListTables = (options) => (options.client ?? client).get({
|
|
9253
10029
|
security: [{
|
|
@@ -9261,7 +10037,9 @@ export const databaseListTables = (options) => (options.client ?? client).get({
|
|
|
9261
10037
|
/**
|
|
9262
10038
|
* Create table
|
|
9263
10039
|
*
|
|
9264
|
-
* Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
|
|
10040
|
+
* Deprecated: use praxis.database.table.tables.create instead; this path stops working on 2027-03-01. Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.
|
|
10041
|
+
*
|
|
10042
|
+
* @deprecated
|
|
9265
10043
|
*/
|
|
9266
10044
|
export const databaseCreateTable = (options) => (options.client ?? client).post({
|
|
9267
10045
|
security: [{
|
|
@@ -9279,7 +10057,9 @@ export const databaseCreateTable = (options) => (options.client ?? client).post(
|
|
|
9279
10057
|
/**
|
|
9280
10058
|
* Delete table
|
|
9281
10059
|
*
|
|
9282
|
-
* Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
|
|
10060
|
+
* Deprecated: use praxis.database.table.tables.delete instead; this path stops working on 2027-03-01. Permanently drops a table with all of its rows; the deletion is immediate and has no recovery window or undo. Refused with 409 REFERENCE_RESTRICT while a link field of another table points at this table, so delete or change those fields first. Returns {deleted: true}. A table name can be reused afterwards.
|
|
10061
|
+
*
|
|
10062
|
+
* @deprecated
|
|
9283
10063
|
*/
|
|
9284
10064
|
export const databaseDeleteTable = (options) => (options.client ?? client).delete({
|
|
9285
10065
|
security: [{
|
|
@@ -9293,7 +10073,9 @@ export const databaseDeleteTable = (options) => (options.client ?? client).delet
|
|
|
9293
10073
|
/**
|
|
9294
10074
|
* Get table
|
|
9295
10075
|
*
|
|
9296
|
-
* Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
|
|
10076
|
+
* Deprecated: use praxis.database.table.tables.retrieve instead; this path stops working on 2027-03-01. Returns one table by id or name with its field definitions, schema_revision and row_count. row_count is only returned by this operation, not by list or create. Use field ids from this response for stable references because field names can be renamed; an unknown table returns 404 TABLE_NOT_FOUND.
|
|
10077
|
+
*
|
|
10078
|
+
* @deprecated
|
|
9297
10079
|
*/
|
|
9298
10080
|
export const databaseGetTable = (options) => (options.client ?? client).get({
|
|
9299
10081
|
security: [{
|
|
@@ -9307,7 +10089,9 @@ export const databaseGetTable = (options) => (options.client ?? client).get({
|
|
|
9307
10089
|
/**
|
|
9308
10090
|
* Update table
|
|
9309
10091
|
*
|
|
9310
|
-
* Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseAddField, databaseUpdateField and databaseDeleteField.
|
|
10092
|
+
* Deprecated: use praxis.database.table.tables.update instead; this path stops working on 2027-03-01. Renames a table and/or changes its description; send only the keys to change, and send description null to clear it. The new name must follow ^[a-z_][a-z0-9_]{0,62}$ and be unused (409 UNIQUE_VIOLATION); ids are stable, so renaming never rewrites row data. A body with no changes or values equal to the current ones does not bump schema_revision. Fields cannot be changed here; use databaseAddField, databaseUpdateField and databaseDeleteField.
|
|
10093
|
+
*
|
|
10094
|
+
* @deprecated
|
|
9311
10095
|
*/
|
|
9312
10096
|
export const databaseUpdateTable = (options) => (options.client ?? client).patch({
|
|
9313
10097
|
security: [{
|
|
@@ -9325,7 +10109,9 @@ export const databaseUpdateTable = (options) => (options.client ?? client).patch
|
|
|
9325
10109
|
/**
|
|
9326
10110
|
* Add field
|
|
9327
10111
|
*
|
|
9328
|
-
* Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.
|
|
10112
|
+
* Deprecated: use praxis.database.table.tables.fields.create instead; this path stops working on 2027-03-01. Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.
|
|
10113
|
+
*
|
|
10114
|
+
* @deprecated
|
|
9329
10115
|
*/
|
|
9330
10116
|
export const databaseAddField = (options) => (options.client ?? client).post({
|
|
9331
10117
|
security: [{
|
|
@@ -9343,7 +10129,9 @@ export const databaseAddField = (options) => (options.client ?? client).post({
|
|
|
9343
10129
|
/**
|
|
9344
10130
|
* Delete field
|
|
9345
10131
|
*
|
|
9346
|
-
* Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
|
|
10132
|
+
* Deprecated: use praxis.database.table.tables.fields.delete instead; this path stops working on 2027-03-01. Deletes one field definition from a table and returns the updated table; the deletion is immediate and has no recovery window. Look the field up by id or name. The field's index, if any, is dropped with it, and the name can be reused afterwards. Unknown fields return 400 FIELD_NOT_FOUND.
|
|
10133
|
+
*
|
|
10134
|
+
* @deprecated
|
|
9347
10135
|
*/
|
|
9348
10136
|
export const databaseDeleteField = (options) => (options.client ?? client).delete({
|
|
9349
10137
|
security: [{
|
|
@@ -9357,7 +10145,9 @@ export const databaseDeleteField = (options) => (options.client ?? client).delet
|
|
|
9357
10145
|
/**
|
|
9358
10146
|
* Update field
|
|
9359
10147
|
*
|
|
9360
|
-
* Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
|
|
10148
|
+
* Deprecated: use praxis.database.table.tables.fields.update instead; this path stops working on 2027-03-01. Changes a field's name, description, required flag, indexed flag, default or json options.schema and returns the updated table. The field type, a link field's linked_table_id and the unique flag cannot be changed (400 FIELD_TYPE_IMMUTABLE or INVALID_PARAMS). Setting required to true fails with 400 VALIDATION_FAILED while existing rows hold null for the field. A new json schema constrains only later writes; existing rows are not revalidated. Renaming never rewrites row data, and a request that changes nothing does not bump schema_revision. Unlike Supabase, field types and uniqueness cannot be altered through SQL migrations; use the supported field settings described here.
|
|
10149
|
+
*
|
|
10150
|
+
* @deprecated
|
|
9361
10151
|
*/
|
|
9362
10152
|
export const databaseUpdateField = (options) => (options.client ?? client).patch({
|
|
9363
10153
|
security: [{
|
|
@@ -9375,7 +10165,9 @@ export const databaseUpdateField = (options) => (options.client ?? client).patch
|
|
|
9375
10165
|
/**
|
|
9376
10166
|
* List events
|
|
9377
10167
|
*
|
|
9378
|
-
* Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
|
|
10168
|
+
* Deprecated: use praxis.database.table.events.list for a table database or praxis.database.kv.events.list for a key-value database instead; this path stops working on 2027-03-01. Read lifecycle and schema events, including while the database is deleting. next_cursor is an opaque string cursor (do not do arithmetic on it): pass it as after_seq for asc or before_seq for desc. Supplying both cursors returns 400 INVALID_PARAMS. Unlike Supabase Realtime, this is paged lifecycle and schema history, not a subscription or a row-change feed; row inserts, updates and deletes do not appear here.
|
|
10169
|
+
*
|
|
10170
|
+
* @deprecated
|
|
9379
10171
|
*/
|
|
9380
10172
|
export const databaseListEvents = (options) => (options.client ?? client).get({
|
|
9381
10173
|
security: [{
|
|
@@ -9389,7 +10181,9 @@ export const databaseListEvents = (options) => (options.client ?? client).get({
|
|
|
9389
10181
|
/**
|
|
9390
10182
|
* Delete rows
|
|
9391
10183
|
*
|
|
9392
|
-
* Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
|
|
10184
|
+
* Deprecated: use praxis.database.table.rest.delete instead; this path stops working on 2027-03-01. Deletes the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. Deletion is immediate and cannot be undone. A row that a link field of another table still references makes the whole call fail with 409 REFERENCE_RESTRICT and nothing is deleted. The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the deleted rows.
|
|
10185
|
+
*
|
|
10186
|
+
* @deprecated
|
|
9393
10187
|
*/
|
|
9394
10188
|
export const databaseDelete = (options) => (options.client ?? client).delete({
|
|
9395
10189
|
security: [{
|
|
@@ -9403,7 +10197,9 @@ export const databaseDelete = (options) => (options.client ?? client).delete({
|
|
|
9403
10197
|
/**
|
|
9404
10198
|
* Select rows
|
|
9405
10199
|
*
|
|
9406
|
-
* Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
|
|
10200
|
+
* Deprecated: use praxis.database.table.rest.retrieve instead; this path stops working on 2027-03-01. Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.
|
|
10201
|
+
*
|
|
10202
|
+
* @deprecated
|
|
9407
10203
|
*/
|
|
9408
10204
|
export const databaseSelect = (options) => (options.client ?? client).get({
|
|
9409
10205
|
security: [{
|
|
@@ -9417,7 +10213,9 @@ export const databaseSelect = (options) => (options.client ?? client).get({
|
|
|
9417
10213
|
/**
|
|
9418
10214
|
* Count rows
|
|
9419
10215
|
*
|
|
9420
|
-
* Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
|
|
10216
|
+
* Deprecated: use praxis.database.table.rest.head instead; this path stops working on 2027-03-01. Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is **. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.
|
|
10217
|
+
*
|
|
10218
|
+
* @deprecated
|
|
9421
10219
|
*/
|
|
9422
10220
|
export const databaseHead = (options) => (options.client ?? client).head({
|
|
9423
10221
|
security: [{
|
|
@@ -9431,7 +10229,9 @@ export const databaseHead = (options) => (options.client ?? client).head({
|
|
|
9431
10229
|
/**
|
|
9432
10230
|
* Update rows
|
|
9433
10231
|
*
|
|
9434
|
-
* Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
|
|
10232
|
+
* Deprecated: use praxis.database.table.rest.update instead; this path stops working on 2027-03-01. Updates the rows matched by the filter query parameters (the same filters as databaseSelect); with no filter every row of the table matches. The JSON object body lists only the fields to change, other fields keep their values, and id cannot be changed. Values are validated against the field types and the required and unique settings (400 VALIDATION_FAILED, 409 UNIQUE_VIOLATION). The default response is 204 with no body; send Prefer: return=representation to get HTTP 200 with the updated rows. Each changed row's _version increases by one.
|
|
10233
|
+
*
|
|
10234
|
+
* @deprecated
|
|
9435
10235
|
*/
|
|
9436
10236
|
export const databaseUpdate = (options) => (options.client ?? client).patch({
|
|
9437
10237
|
security: [{
|
|
@@ -9449,9 +10249,11 @@ export const databaseUpdate = (options) => (options.client ?? client).patch({
|
|
|
9449
10249
|
/**
|
|
9450
10250
|
* Insert rows
|
|
9451
10251
|
*
|
|
9452
|
-
* Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
|
|
10252
|
+
* Deprecated: use praxis.database.table.rest.create instead; this path stops working on 2027-03-01. Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
|
|
9453
10253
|
* Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
|
|
9454
10254
|
* The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.
|
|
10255
|
+
*
|
|
10256
|
+
* @deprecated
|
|
9455
10257
|
*/
|
|
9456
10258
|
export const databaseInsert = (options) => (options.client ?? client).post({
|
|
9457
10259
|
security: [{
|
|
@@ -9466,6 +10268,114 @@ export const databaseInsert = (options) => (options.client ?? client).post({
|
|
|
9466
10268
|
...options.headers
|
|
9467
10269
|
}
|
|
9468
10270
|
});
|
|
10271
|
+
/**
|
|
10272
|
+
* List keys
|
|
10273
|
+
*
|
|
10274
|
+
* Deprecated: use praxis.database.kv.keys.list instead; this path stops working on 2027-03-01. Browse the keys of a key-value database (kind kv): use it to see what is stored before reading one key with databaseGetKey; to run an arbitrary Redis command (counters, ranges, scans) use databaseExecuteCommand instead. Keys come back in lexicographic key order, one page at a time, as summaries (key, type, remaining TTL, size) without values; expired keys are never returned. pattern filters with a Redis glob (* ? [abc] [^abc]) matched against the whole key, and type keeps one value type. limit is 1–500, default 50; while next_cursor is a string, pass it back unchanged as cursor for the next page; null means this is the last page. Needs a read credential. Errors: 400 INVALID_PARAMS for a limit outside 1–500 or a malformed query; 404 DATABASE_NOT_FOUND for an unknown id; 409 DATABASE_KIND_MISMATCH when the database is a table database.
|
|
10275
|
+
*
|
|
10276
|
+
* @deprecated
|
|
10277
|
+
*/
|
|
10278
|
+
export const databaseListKeys = (options) => (options.client ?? client).get({
|
|
10279
|
+
security: [{
|
|
10280
|
+
key: 'database-bearerAuth',
|
|
10281
|
+
scheme: 'bearer',
|
|
10282
|
+
type: 'http'
|
|
10283
|
+
}],
|
|
10284
|
+
url: '/database/v1/databases/{database_id}/keys',
|
|
10285
|
+
...options
|
|
10286
|
+
});
|
|
10287
|
+
/**
|
|
10288
|
+
* Delete key
|
|
10289
|
+
*
|
|
10290
|
+
* Deprecated: use praxis.database.kv.keys.delete instead; this path stops working on 2027-03-01. Delete one key of a key-value database together with its value; the data cannot be recovered. A key that is absent or has already expired is not an error: the call succeeds with deleted false, so it is safe to retry. To delete many keys at once or by pattern, list them with databaseListKeys or run DEL / UNLINK through databaseExecuteCommand. Needs a read-write credential. Errors: 404 DATABASE_NOT_FOUND for an unknown id; 409 DATABASE_KIND_MISMATCH for a table database; 403 BINDING_READ_ONLY for a read-only credential.
|
|
10291
|
+
*
|
|
10292
|
+
* @deprecated
|
|
10293
|
+
*/
|
|
10294
|
+
export const databaseDeleteKey = (options) => (options.client ?? client).delete({
|
|
10295
|
+
security: [{
|
|
10296
|
+
key: 'database-bearerAuth',
|
|
10297
|
+
scheme: 'bearer',
|
|
10298
|
+
type: 'http'
|
|
10299
|
+
}],
|
|
10300
|
+
url: '/database/v1/databases/{database_id}/keys/{key}',
|
|
10301
|
+
...options
|
|
10302
|
+
});
|
|
10303
|
+
/**
|
|
10304
|
+
* Get key
|
|
10305
|
+
*
|
|
10306
|
+
* Deprecated: use praxis.database.kv.keys.retrieve instead; this path stops working on 2027-03-01. Read one key of a key-value database with its type, TTL, size and value; use databaseListKeys first to find key names. A string value is returned whole. A hash, list, set or zset is returned a page of entries at a time: limit is 1–1000, default 100, and while next_cursor is a string, pass it back unchanged as cursor to read the next page; string values and the last page return next_cursor null. value takes the shape of type: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}]. Needs a read credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS for a limit outside 1–1000; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH for a table database.
|
|
10307
|
+
*
|
|
10308
|
+
* @deprecated
|
|
10309
|
+
*/
|
|
10310
|
+
export const databaseGetKey = (options) => (options.client ?? client).get({
|
|
10311
|
+
security: [{
|
|
10312
|
+
key: 'database-bearerAuth',
|
|
10313
|
+
scheme: 'bearer',
|
|
10314
|
+
type: 'http'
|
|
10315
|
+
}],
|
|
10316
|
+
url: '/database/v1/databases/{database_id}/keys/{key}',
|
|
10317
|
+
...options
|
|
10318
|
+
});
|
|
10319
|
+
/**
|
|
10320
|
+
* Update key
|
|
10321
|
+
*
|
|
10322
|
+
* Deprecated: use praxis.database.kv.keys.update instead; this path stops working on 2027-03-01. Change only the TTL of an existing key of a key-value database, leaving its value alone. update_mask must be ttl_ms (the only writable field) and ttl_ms is required: a positive integer is the new TTL in milliseconds (Redis PEXPIRE), null removes the TTL so the key never expires (PERSIST). To replace the value use databaseSetKey. Returns the key after the change. Needs a read-write credential. Errors: 404 KEY_NOT_FOUND when the key does not exist or has expired; 400 INVALID_PARAMS when update_mask is not ttl_ms or ttl_ms is neither a positive integer nor null; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY.
|
|
10323
|
+
*
|
|
10324
|
+
* @deprecated
|
|
10325
|
+
*/
|
|
10326
|
+
export const databaseUpdateKey = (options) => (options.client ?? client).patch({
|
|
10327
|
+
security: [{
|
|
10328
|
+
key: 'database-bearerAuth',
|
|
10329
|
+
scheme: 'bearer',
|
|
10330
|
+
type: 'http'
|
|
10331
|
+
}],
|
|
10332
|
+
url: '/database/v1/databases/{database_id}/keys/{key}',
|
|
10333
|
+
...options,
|
|
10334
|
+
headers: {
|
|
10335
|
+
'Content-Type': 'application/json',
|
|
10336
|
+
...options.headers
|
|
10337
|
+
}
|
|
10338
|
+
});
|
|
10339
|
+
/**
|
|
10340
|
+
* Set key
|
|
10341
|
+
*
|
|
10342
|
+
* Deprecated: use praxis.database.kv.keys.set instead; this path stops working on 2027-03-01. Overwrite one key of a key-value database with a whole new value in a single transaction, creating it if absent; the previous value is dropped first and never merged, even when the type changes. To change only the TTL use databaseUpdateKey; to add to a counter or push onto a list use databaseExecuteCommand. type decides the shape of value: a string; hash as [{field, value}]; list and set as a string array; zset as [{member, score}] with finite scores. Containers must not be empty, and hash fields and set members must be unique. ttl_ms omitted keeps the key's existing TTL, a positive integer sets a new one in milliseconds, null makes the key permanent. A value is at most 1 MiB and a key at most 1 KiB. Returns the stored key (first page for a container). Needs a read-write credential. Errors: 400 INVALID_PARAMS for an empty container, duplicate field or member, non-finite score or bad ttl_ms; 400 LIMIT_EXCEEDED for an oversized key or value; 503 CAPACITY when the database is full; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY for a read-only credential.
|
|
10343
|
+
*
|
|
10344
|
+
* @deprecated
|
|
10345
|
+
*/
|
|
10346
|
+
export const databaseSetKey = (options) => (options.client ?? client).put({
|
|
10347
|
+
security: [{
|
|
10348
|
+
key: 'database-bearerAuth',
|
|
10349
|
+
scheme: 'bearer',
|
|
10350
|
+
type: 'http'
|
|
10351
|
+
}],
|
|
10352
|
+
url: '/database/v1/databases/{database_id}/keys/{key}',
|
|
10353
|
+
...options,
|
|
10354
|
+
headers: {
|
|
10355
|
+
'Content-Type': 'application/json',
|
|
10356
|
+
...options.headers
|
|
10357
|
+
}
|
|
10358
|
+
});
|
|
10359
|
+
/**
|
|
10360
|
+
* Execute command
|
|
10361
|
+
*
|
|
10362
|
+
* Deprecated: use praxis.database.kv.commands.execute instead; this path stops working on 2027-03-01. Run one Redis command with Redis 7 semantics against a key-value database and get its reply; use it for what the key operations cannot do: counters (INCR), list and set operations, ranges (LRANGE, ZRANGE), scans (SCAN, HSCAN) and expiry commands. For one whole-value read or write use databaseGetKey / databaseSetKey; for existing Redis clients use the Upstash-compatible face under /redis. command is the command name followed by its arguments, every element a string, for example ["SET","k","v"] or ["LRANGE","queue","0","9"]. result is Redis's reply as plain JSON (integers, strings, arrays, null), never base64. Not supported: Lua scripting (EVAL), blocking commands, Pub/Sub and Streams. A value is at most 1 MiB, a key at most 1 KiB, a reply at most 8 MiB (read big collections in ranges with SCAN, HSCAN, LRANGE or ZRANGE) and the database at most 1 GiB. A read command needs a read credential; a write command, or a command that cannot be parsed, needs a read-write credential. Errors: 400 KV_COMMAND_ERROR when Redis rejects the command, with Redis's own text in message (for example WRONGTYPE Operation against a key holding the wrong kind of value or ERR unknown command); 400 INVALID_PARAMS for a missing or empty command; 404 DATABASE_NOT_FOUND; 409 DATABASE_KIND_MISMATCH; 403 BINDING_READ_ONLY for a write on a read-only credential.
|
|
10363
|
+
*
|
|
10364
|
+
* @deprecated
|
|
10365
|
+
*/
|
|
10366
|
+
export const databaseExecuteCommand = (options) => (options.client ?? client).post({
|
|
10367
|
+
security: [{
|
|
10368
|
+
key: 'database-bearerAuth',
|
|
10369
|
+
scheme: 'bearer',
|
|
10370
|
+
type: 'http'
|
|
10371
|
+
}],
|
|
10372
|
+
url: '/database/v1/databases/{database_id}/commands',
|
|
10373
|
+
...options,
|
|
10374
|
+
headers: {
|
|
10375
|
+
'Content-Type': 'application/json',
|
|
10376
|
+
...options.headers
|
|
10377
|
+
}
|
|
10378
|
+
});
|
|
9469
10379
|
/**
|
|
9470
10380
|
* Read a commit's test catalog
|
|
9471
10381
|
*
|
|
@@ -9965,7 +10875,7 @@ export const devopsPromotionsGet = (options) => (options.client ?? client).get({
|
|
|
9965
10875
|
/**
|
|
9966
10876
|
* Approve or reject a promotion
|
|
9967
10877
|
*
|
|
9968
|
-
*
|
|
10878
|
+
* Not supported yet (Sean 2026-11-27: approvals return as a step of the workflow engine): every call answers 409 ENGINE_UNSUPPORTED, and an environment that requires approval is refused when a promotion into it is created, so no promotion waits for an answer.
|
|
9969
10879
|
*/
|
|
9970
10880
|
export const devopsPromotionsApprove = (options) => (options.client ?? client).post({
|
|
9971
10881
|
security: [{
|
|
@@ -10015,7 +10925,7 @@ export const devopsPromotionsRetry = (options) => (options.client ?? client).pos
|
|
|
10015
10925
|
/**
|
|
10016
10926
|
* Conclude an observation
|
|
10017
10927
|
*
|
|
10018
|
-
*
|
|
10928
|
+
* Retired with the observation window (ticket-4240): a promotion ends when its deploy ends, so no promotion is ever observing and every call answers 409 PROMOTION_NOT_OBSERVING. Watching production after a release is its author's own work; to undo a release use environments.rollback, which also takes the culprit Change this call used to record.
|
|
10019
10929
|
*/
|
|
10020
10930
|
export const devopsPromotionsConclude = (options) => (options.client ?? client).post({
|
|
10021
10931
|
security: [{
|