casedev 0.53.1 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/compute/v1/index.d.mts +2 -0
- package/resources/compute/v1/index.d.mts.map +1 -1
- package/resources/compute/v1/index.d.ts +2 -0
- package/resources/compute/v1/index.d.ts.map +1 -1
- package/resources/compute/v1/index.js +5 -1
- package/resources/compute/v1/index.js.map +1 -1
- package/resources/compute/v1/index.mjs +2 -0
- package/resources/compute/v1/index.mjs.map +1 -1
- package/resources/compute/v1/instance-types.d.mts +73 -0
- package/resources/compute/v1/instance-types.d.mts.map +1 -0
- package/resources/compute/v1/instance-types.d.ts +73 -0
- package/resources/compute/v1/instance-types.d.ts.map +1 -0
- package/resources/compute/v1/instance-types.js +27 -0
- package/resources/compute/v1/instance-types.js.map +1 -0
- package/resources/compute/v1/instance-types.mjs +23 -0
- package/resources/compute/v1/instance-types.mjs.map +1 -0
- package/resources/compute/v1/instances.d.mts +160 -0
- package/resources/compute/v1/instances.d.mts.map +1 -0
- package/resources/compute/v1/instances.d.ts +160 -0
- package/resources/compute/v1/instances.d.ts.map +1 -0
- package/resources/compute/v1/instances.js +77 -0
- package/resources/compute/v1/instances.js.map +1 -0
- package/resources/compute/v1/instances.mjs +73 -0
- package/resources/compute/v1/instances.mjs.map +1 -0
- package/resources/compute/v1/v1.d.mts +19 -0
- package/resources/compute/v1/v1.d.mts.map +1 -1
- package/resources/compute/v1/v1.d.ts +19 -0
- package/resources/compute/v1/v1.d.ts.map +1 -1
- package/resources/compute/v1/v1.js +25 -0
- package/resources/compute/v1/v1.js.map +1 -1
- package/resources/compute/v1/v1.mjs +25 -0
- package/resources/compute/v1/v1.mjs.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/vault/vault.d.mts +6 -5
- package/resources/vault/vault.d.mts.map +1 -1
- package/resources/vault/vault.d.ts +6 -5
- package/resources/vault/vault.d.ts.map +1 -1
- package/resources/vault/vault.js +6 -5
- package/resources/vault/vault.js.map +1 -1
- package/resources/vault/vault.mjs +6 -5
- package/resources/vault/vault.mjs.map +1 -1
- package/resources/webhooks/index.d.mts +3 -0
- package/resources/webhooks/index.d.mts.map +1 -0
- package/resources/webhooks/index.d.ts +3 -0
- package/resources/webhooks/index.d.ts.map +1 -0
- package/resources/webhooks/index.js +9 -0
- package/resources/webhooks/index.js.map +1 -0
- package/resources/webhooks/index.mjs +4 -0
- package/resources/webhooks/index.mjs.map +1 -0
- package/resources/webhooks/v1/deliveries.d.mts +42 -0
- package/resources/webhooks/v1/deliveries.d.mts.map +1 -0
- package/resources/webhooks/v1/deliveries.d.ts +42 -0
- package/resources/webhooks/v1/deliveries.d.ts.map +1 -0
- package/resources/webhooks/v1/deliveries.js +48 -0
- package/resources/webhooks/v1/deliveries.js.map +1 -0
- package/resources/webhooks/v1/deliveries.mjs +44 -0
- package/resources/webhooks/v1/deliveries.mjs.map +1 -0
- package/resources/webhooks/v1/endpoints.d.mts +121 -0
- package/resources/webhooks/v1/endpoints.d.mts.map +1 -0
- package/resources/webhooks/v1/endpoints.d.ts +121 -0
- package/resources/webhooks/v1/endpoints.d.ts.map +1 -0
- package/resources/webhooks/v1/endpoints.js +96 -0
- package/resources/webhooks/v1/endpoints.js.map +1 -0
- package/resources/webhooks/v1/endpoints.mjs +92 -0
- package/resources/webhooks/v1/endpoints.mjs.map +1 -0
- package/resources/webhooks/v1/event-types.d.mts +15 -0
- package/resources/webhooks/v1/event-types.d.mts.map +1 -0
- package/resources/webhooks/v1/event-types.d.ts +15 -0
- package/resources/webhooks/v1/event-types.d.ts.map +1 -0
- package/resources/webhooks/v1/event-types.js +24 -0
- package/resources/webhooks/v1/event-types.js.map +1 -0
- package/resources/webhooks/v1/event-types.mjs +20 -0
- package/resources/webhooks/v1/event-types.mjs.map +1 -0
- package/resources/webhooks/v1/index.d.mts +5 -0
- package/resources/webhooks/v1/index.d.mts.map +1 -0
- package/resources/webhooks/v1/index.d.ts +5 -0
- package/resources/webhooks/v1/index.d.ts.map +1 -0
- package/resources/webhooks/v1/index.js +13 -0
- package/resources/webhooks/v1/index.js.map +1 -0
- package/resources/webhooks/v1/index.mjs +6 -0
- package/resources/webhooks/v1/index.mjs.map +1 -0
- package/resources/webhooks/v1/v1.d.mts +18 -0
- package/resources/webhooks/v1/v1.d.mts.map +1 -0
- package/resources/webhooks/v1/v1.d.ts +18 -0
- package/resources/webhooks/v1/v1.d.ts.map +1 -0
- package/resources/webhooks/v1/v1.js +25 -0
- package/resources/webhooks/v1/v1.js.map +1 -0
- package/resources/webhooks/v1/v1.mjs +20 -0
- package/resources/webhooks/v1/v1.mjs.map +1 -0
- package/resources/webhooks/v1.d.mts +2 -0
- package/resources/webhooks/v1.d.mts.map +1 -0
- package/resources/webhooks/v1.d.ts +2 -0
- package/resources/webhooks/v1.d.ts.map +1 -0
- package/resources/webhooks/v1.js +6 -0
- package/resources/webhooks/v1.js.map +1 -0
- package/resources/webhooks/v1.mjs +3 -0
- package/resources/webhooks/v1.mjs.map +1 -0
- package/resources/webhooks/webhooks.d.mts +10 -0
- package/resources/webhooks/webhooks.d.mts.map +1 -0
- package/resources/webhooks/webhooks.d.ts +10 -0
- package/resources/webhooks/webhooks.d.ts.map +1 -0
- package/resources/webhooks/webhooks.js +17 -0
- package/resources/webhooks/webhooks.js.map +1 -0
- package/resources/webhooks/webhooks.mjs +12 -0
- package/resources/webhooks/webhooks.mjs.map +1 -0
- package/resources/webhooks.d.mts +2 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +2 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +6 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +3 -0
- package/resources/webhooks.mjs.map +1 -0
- package/src/client.ts +5 -0
- package/src/resources/compute/v1/index.ts +9 -0
- package/src/resources/compute/v1/instance-types.ts +89 -0
- package/src/resources/compute/v1/instances.ts +240 -0
- package/src/resources/compute/v1/v1.ts +44 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/vault/vault.ts +6 -5
- package/src/resources/webhooks/index.ts +4 -0
- package/src/resources/webhooks/v1/deliveries.ts +74 -0
- package/src/resources/webhooks/v1/endpoints.ts +204 -0
- package/src/resources/webhooks/v1/event-types.ts +23 -0
- package/src/resources/webhooks/v1/index.ts +13 -0
- package/src/resources/webhooks/v1/v1.ts +45 -0
- package/src/resources/webhooks/v1.ts +3 -0
- package/src/resources/webhooks/webhooks.ts +15 -0
- package/src/resources/webhooks.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
import { path } from '../../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Serverless GPU and CPU infrastructure
|
|
10
|
+
*/
|
|
11
|
+
export class Instances extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Launches a new GPU compute instance with automatic SSH key generation. Supports
|
|
14
|
+
* mounting Case.dev Vaults as filesystems and configurable auto-shutdown. Instance
|
|
15
|
+
* boots in ~2-5 minutes. Perfect for batch OCR processing, AI model training, and
|
|
16
|
+
* intensive document analysis workloads.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const instance = await client.compute.v1.instances.create({
|
|
21
|
+
* instanceType: 'gpu_1x_a10',
|
|
22
|
+
* name: 'ocr-batch-job',
|
|
23
|
+
* region: 'us-west-1',
|
|
24
|
+
* autoShutdownMinutes: 120,
|
|
25
|
+
* vaultIds: ['vault_abc123'],
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
create(body: InstanceCreateParams, options?: RequestOptions): APIPromise<InstanceCreateResponse> {
|
|
30
|
+
return this._client.post('/compute/v1/instances', { body, ...options });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves detailed information about a GPU instance including SSH connection
|
|
35
|
+
* details, vault mount scripts, real-time cost tracking, and current status. SSH
|
|
36
|
+
* private key included for secure access.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const instance = await client.compute.v1.instances.retrieve(
|
|
41
|
+
* 'id',
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<InstanceRetrieveResponse> {
|
|
46
|
+
return this._client.get(path`/compute/v1/instances/${id}`, options);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves all GPU compute instances for your organization with real-time status
|
|
51
|
+
* updates from Lambda Labs. Includes pricing, runtime metrics, and auto-shutdown
|
|
52
|
+
* configuration. Perfect for monitoring AI workloads, document processing jobs,
|
|
53
|
+
* and cost tracking.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const instances = await client.compute.v1.instances.list();
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
list(options?: RequestOptions): APIPromise<InstanceListResponse> {
|
|
61
|
+
return this._client.get('/compute/v1/instances', options);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Terminates a running GPU instance, calculates final cost, and cleans up SSH
|
|
66
|
+
* keys. This action is permanent and cannot be undone. All data on the instance
|
|
67
|
+
* will be lost.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const instance = await client.compute.v1.instances.delete(
|
|
72
|
+
* 'id',
|
|
73
|
+
* );
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
delete(id: string, options?: RequestOptions): APIPromise<InstanceDeleteResponse> {
|
|
77
|
+
return this._client.delete(path`/compute/v1/instances/${id}`, options);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface InstanceCreateResponse {
|
|
82
|
+
id?: string;
|
|
83
|
+
|
|
84
|
+
autoShutdownMinutes?: number | null;
|
|
85
|
+
|
|
86
|
+
createdAt?: string;
|
|
87
|
+
|
|
88
|
+
gpu?: string;
|
|
89
|
+
|
|
90
|
+
instanceType?: string;
|
|
91
|
+
|
|
92
|
+
message?: string;
|
|
93
|
+
|
|
94
|
+
name?: string;
|
|
95
|
+
|
|
96
|
+
pricePerHour?: string;
|
|
97
|
+
|
|
98
|
+
region?: string;
|
|
99
|
+
|
|
100
|
+
specs?: unknown;
|
|
101
|
+
|
|
102
|
+
status?: string;
|
|
103
|
+
|
|
104
|
+
vaults?: Array<unknown>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface InstanceRetrieveResponse {
|
|
108
|
+
id?: string;
|
|
109
|
+
|
|
110
|
+
autoShutdownMinutes?: number | null;
|
|
111
|
+
|
|
112
|
+
createdAt?: string;
|
|
113
|
+
|
|
114
|
+
currentCost?: string;
|
|
115
|
+
|
|
116
|
+
currentRuntimeSeconds?: number;
|
|
117
|
+
|
|
118
|
+
gpu?: string;
|
|
119
|
+
|
|
120
|
+
instanceType?: string;
|
|
121
|
+
|
|
122
|
+
ip?: string | null;
|
|
123
|
+
|
|
124
|
+
name?: string;
|
|
125
|
+
|
|
126
|
+
pricePerHour?: string;
|
|
127
|
+
|
|
128
|
+
region?: string;
|
|
129
|
+
|
|
130
|
+
specs?: unknown;
|
|
131
|
+
|
|
132
|
+
ssh?: InstanceRetrieveResponse.SSH | null;
|
|
133
|
+
|
|
134
|
+
startedAt?: string | null;
|
|
135
|
+
|
|
136
|
+
status?: string;
|
|
137
|
+
|
|
138
|
+
vaultMounts?: unknown | null;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export namespace InstanceRetrieveResponse {
|
|
142
|
+
export interface SSH {
|
|
143
|
+
command?: string;
|
|
144
|
+
|
|
145
|
+
host?: string;
|
|
146
|
+
|
|
147
|
+
instructions?: Array<unknown>;
|
|
148
|
+
|
|
149
|
+
privateKey?: string;
|
|
150
|
+
|
|
151
|
+
user?: string;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface InstanceListResponse {
|
|
156
|
+
count?: number;
|
|
157
|
+
|
|
158
|
+
instances?: Array<InstanceListResponse.Instance>;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export namespace InstanceListResponse {
|
|
162
|
+
export interface Instance {
|
|
163
|
+
id?: string;
|
|
164
|
+
|
|
165
|
+
autoShutdownMinutes?: number | null;
|
|
166
|
+
|
|
167
|
+
createdAt?: string;
|
|
168
|
+
|
|
169
|
+
gpu?: string;
|
|
170
|
+
|
|
171
|
+
instanceType?: string;
|
|
172
|
+
|
|
173
|
+
ip?: string | null;
|
|
174
|
+
|
|
175
|
+
name?: string;
|
|
176
|
+
|
|
177
|
+
pricePerHour?: string;
|
|
178
|
+
|
|
179
|
+
region?: string;
|
|
180
|
+
|
|
181
|
+
startedAt?: string | null;
|
|
182
|
+
|
|
183
|
+
status?: 'booting' | 'running' | 'stopping' | 'stopped' | 'terminated' | 'failed';
|
|
184
|
+
|
|
185
|
+
totalCost?: string;
|
|
186
|
+
|
|
187
|
+
totalRuntimeSeconds?: number;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface InstanceDeleteResponse {
|
|
192
|
+
id?: string;
|
|
193
|
+
|
|
194
|
+
message?: string;
|
|
195
|
+
|
|
196
|
+
name?: string;
|
|
197
|
+
|
|
198
|
+
status?: string;
|
|
199
|
+
|
|
200
|
+
totalCost?: string;
|
|
201
|
+
|
|
202
|
+
totalRuntimeSeconds?: number;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface InstanceCreateParams {
|
|
206
|
+
/**
|
|
207
|
+
* GPU type (e.g., 'gpu_1x_h100_sxm5')
|
|
208
|
+
*/
|
|
209
|
+
instanceType: string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Instance name
|
|
213
|
+
*/
|
|
214
|
+
name: string;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Region (e.g., 'us-west-1')
|
|
218
|
+
*/
|
|
219
|
+
region: string;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Auto-shutdown timer (null = never)
|
|
223
|
+
*/
|
|
224
|
+
autoShutdownMinutes?: number | null;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Vault IDs to mount
|
|
228
|
+
*/
|
|
229
|
+
vaultIds?: Array<string>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export declare namespace Instances {
|
|
233
|
+
export {
|
|
234
|
+
type InstanceCreateResponse as InstanceCreateResponse,
|
|
235
|
+
type InstanceRetrieveResponse as InstanceRetrieveResponse,
|
|
236
|
+
type InstanceListResponse as InstanceListResponse,
|
|
237
|
+
type InstanceDeleteResponse as InstanceDeleteResponse,
|
|
238
|
+
type InstanceCreateParams as InstanceCreateParams,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
@@ -11,6 +11,17 @@ import {
|
|
|
11
11
|
EnvironmentSetDefaultResponse,
|
|
12
12
|
Environments,
|
|
13
13
|
} from './environments';
|
|
14
|
+
import * as InstanceTypesAPI from './instance-types';
|
|
15
|
+
import { InstanceTypeListResponse, InstanceTypes } from './instance-types';
|
|
16
|
+
import * as InstancesAPI from './instances';
|
|
17
|
+
import {
|
|
18
|
+
InstanceCreateParams,
|
|
19
|
+
InstanceCreateResponse,
|
|
20
|
+
InstanceDeleteResponse,
|
|
21
|
+
InstanceListResponse,
|
|
22
|
+
InstanceRetrieveResponse,
|
|
23
|
+
Instances,
|
|
24
|
+
} from './instances';
|
|
14
25
|
import * as SecretsAPI from './secrets';
|
|
15
26
|
import {
|
|
16
27
|
SecretCreateParams,
|
|
@@ -26,6 +37,7 @@ import {
|
|
|
26
37
|
Secrets,
|
|
27
38
|
} from './secrets';
|
|
28
39
|
import { APIPromise } from '../../../core/api-promise';
|
|
40
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
29
41
|
import { RequestOptions } from '../../../internal/request-options';
|
|
30
42
|
|
|
31
43
|
/**
|
|
@@ -33,8 +45,27 @@ import { RequestOptions } from '../../../internal/request-options';
|
|
|
33
45
|
*/
|
|
34
46
|
export class V1 extends APIResource {
|
|
35
47
|
environments: EnvironmentsAPI.Environments = new EnvironmentsAPI.Environments(this._client);
|
|
48
|
+
instanceTypes: InstanceTypesAPI.InstanceTypes = new InstanceTypesAPI.InstanceTypes(this._client);
|
|
49
|
+
instances: InstancesAPI.Instances = new InstancesAPI.Instances(this._client);
|
|
36
50
|
secrets: SecretsAPI.Secrets = new SecretsAPI.Secrets(this._client);
|
|
37
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Returns current pricing for GPU instances. Prices are fetched in real-time and
|
|
54
|
+
* include a 20% platform fee. For detailed instance types and availability, use
|
|
55
|
+
* GET /compute/v1/instance-types.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* await client.compute.v1.getPricing();
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
getPricing(options?: RequestOptions): APIPromise<void> {
|
|
63
|
+
return this._client.get('/compute/v1/pricing', {
|
|
64
|
+
...options,
|
|
65
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
38
69
|
/**
|
|
39
70
|
* Returns detailed compute usage statistics and billing information for your
|
|
40
71
|
* organization. Includes GPU and CPU hours, total runs, costs, and breakdowns by
|
|
@@ -110,6 +141,8 @@ export interface V1GetUsageParams {
|
|
|
110
141
|
}
|
|
111
142
|
|
|
112
143
|
V1.Environments = Environments;
|
|
144
|
+
V1.InstanceTypes = InstanceTypes;
|
|
145
|
+
V1.Instances = Instances;
|
|
113
146
|
V1.Secrets = Secrets;
|
|
114
147
|
|
|
115
148
|
export declare namespace V1 {
|
|
@@ -125,6 +158,17 @@ export declare namespace V1 {
|
|
|
125
158
|
type EnvironmentCreateParams as EnvironmentCreateParams,
|
|
126
159
|
};
|
|
127
160
|
|
|
161
|
+
export { InstanceTypes as InstanceTypes, type InstanceTypeListResponse as InstanceTypeListResponse };
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
Instances as Instances,
|
|
165
|
+
type InstanceCreateResponse as InstanceCreateResponse,
|
|
166
|
+
type InstanceRetrieveResponse as InstanceRetrieveResponse,
|
|
167
|
+
type InstanceListResponse as InstanceListResponse,
|
|
168
|
+
type InstanceDeleteResponse as InstanceDeleteResponse,
|
|
169
|
+
type InstanceCreateParams as InstanceCreateParams,
|
|
170
|
+
};
|
|
171
|
+
|
|
128
172
|
export {
|
|
129
173
|
Secrets as Secrets,
|
|
130
174
|
type SecretCreateResponse as SecretCreateResponse,
|
package/src/resources/index.ts
CHANGED
|
@@ -176,11 +176,12 @@ export class Vault extends APIResource {
|
|
|
176
176
|
/**
|
|
177
177
|
* Triggers ingestion workflow for a vault object to extract text, generate chunks,
|
|
178
178
|
* and create embeddings. For supported file types (PDF, DOCX, PPTX, TXT, RTF, XML,
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
179
|
+
* HTML, Markdown, CSV/TSV, JSON/YAML/TOML, common source code files, ZIP, audio,
|
|
180
|
+
* video), processing happens asynchronously. ZIP archives are unpacked recursively
|
|
181
|
+
* up to 5 levels, and each extracted file is created as an independent vault
|
|
182
|
+
* object and ingested via the normal pipeline. For unsupported types (images,
|
|
183
|
+
* etc.), the file is marked as completed immediately without text extraction.
|
|
184
|
+
* GraphRAG indexing must be triggered separately via POST
|
|
184
185
|
* /vault/:id/graphrag/:objectId.
|
|
185
186
|
*
|
|
186
187
|
* @example
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Webhook endpoint management
|
|
11
|
+
*/
|
|
12
|
+
export class Deliveries extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Get webhook delivery
|
|
15
|
+
*/
|
|
16
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<void> {
|
|
17
|
+
return this._client.get(path`/webhooks/v1/deliveries/${id}`, {
|
|
18
|
+
...options,
|
|
19
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Returns delivery attempts for the organization, newest first. Filter by
|
|
25
|
+
* endpoint_id or status to narrow results.
|
|
26
|
+
*/
|
|
27
|
+
list(query: DeliveryListParams | null | undefined = {}, options?: RequestOptions): APIPromise<void> {
|
|
28
|
+
return this._client.get('/webhooks/v1/deliveries', {
|
|
29
|
+
query,
|
|
30
|
+
...options,
|
|
31
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Re-sends the original event to its endpoint. The payload is reconstructed from
|
|
37
|
+
* the delivery record (same eventId, eventType, and occurred_at). The signature
|
|
38
|
+
* header includes `svix-delivery-attempt: replay` so receivers can distinguish
|
|
39
|
+
* replays from first-time deliveries. Uses the endpoint's current signing secret —
|
|
40
|
+
* not the one in force at the original delivery time.
|
|
41
|
+
*/
|
|
42
|
+
replay(
|
|
43
|
+
id: string,
|
|
44
|
+
body: DeliveryReplayParams | null | undefined = {},
|
|
45
|
+
options?: RequestOptions,
|
|
46
|
+
): APIPromise<void> {
|
|
47
|
+
return this._client.post(path`/webhooks/v1/deliveries/${id}/replay`, {
|
|
48
|
+
body,
|
|
49
|
+
...options,
|
|
50
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface DeliveryListParams {
|
|
56
|
+
endpoint_id?: string;
|
|
57
|
+
|
|
58
|
+
limit?: number;
|
|
59
|
+
|
|
60
|
+
status?: 'pending' | 'delivered' | 'failed';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface DeliveryReplayParams {
|
|
64
|
+
/**
|
|
65
|
+
* Override payload to deliver. Must only be supplied when the delivery record
|
|
66
|
+
* lacks enough context to reconstruct the original event (rare). Defaults to an
|
|
67
|
+
* empty data envelope.
|
|
68
|
+
*/
|
|
69
|
+
payload?: unknown;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export declare namespace Deliveries {
|
|
73
|
+
export { type DeliveryListParams as DeliveryListParams, type DeliveryReplayParams as DeliveryReplayParams };
|
|
74
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Webhook endpoint management
|
|
11
|
+
*/
|
|
12
|
+
export class Endpoints extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a webhook endpoint that receives platform events matching the supplied
|
|
15
|
+
* event-type filters. Returns the generated signing secret ONCE — the response is
|
|
16
|
+
* the only time it is shown in plaintext.
|
|
17
|
+
*/
|
|
18
|
+
create(body: EndpointCreateParams, options?: RequestOptions): APIPromise<void> {
|
|
19
|
+
return this._client.post('/webhooks/v1/endpoints', {
|
|
20
|
+
body,
|
|
21
|
+
...options,
|
|
22
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get webhook endpoint
|
|
28
|
+
*/
|
|
29
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<void> {
|
|
30
|
+
return this._client.get(path`/webhooks/v1/endpoints/${id}`, {
|
|
31
|
+
...options,
|
|
32
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Partially updates a webhook endpoint. Any omitted field is left unchanged.
|
|
38
|
+
* Signing secrets are rotated via the separate /rotate_secret endpoint.
|
|
39
|
+
*/
|
|
40
|
+
update(id: string, body: EndpointUpdateParams, options?: RequestOptions): APIPromise<void> {
|
|
41
|
+
return this._client.patch(path`/webhooks/v1/endpoints/${id}`, {
|
|
42
|
+
body,
|
|
43
|
+
...options,
|
|
44
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns the organization's webhook endpoints, newest first. Signing secrets are
|
|
50
|
+
* never included.
|
|
51
|
+
*/
|
|
52
|
+
list(query: EndpointListParams | null | undefined = {}, options?: RequestOptions): APIPromise<void> {
|
|
53
|
+
return this._client.get('/webhooks/v1/endpoints', {
|
|
54
|
+
query,
|
|
55
|
+
...options,
|
|
56
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Soft-deletes a webhook endpoint. Delivery stops immediately and the endpoint no
|
|
62
|
+
* longer appears in list results. Delivery history is preserved (and can be
|
|
63
|
+
* fetched via GET /deliveries with the endpoint_id filter) so audit trails and
|
|
64
|
+
* post-mortem debugging remain possible.
|
|
65
|
+
*/
|
|
66
|
+
delete(id: string, options?: RequestOptions): APIPromise<void> {
|
|
67
|
+
return this._client.delete(path`/webhooks/v1/endpoints/${id}`, {
|
|
68
|
+
...options,
|
|
69
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Generates a new signing secret for the endpoint. The previous secret remains
|
|
75
|
+
* valid until `previousSecretExpiresInSec` elapses (default 24h, max 30 days).
|
|
76
|
+
* During the grace window deliveries are signed with both secrets so receivers can
|
|
77
|
+
* migrate without downtime. Returns the new secret — this is the only time it is
|
|
78
|
+
* shown in plaintext.
|
|
79
|
+
*/
|
|
80
|
+
rotateSecret(
|
|
81
|
+
id: string,
|
|
82
|
+
body: EndpointRotateSecretParams | null | undefined = {},
|
|
83
|
+
options?: RequestOptions,
|
|
84
|
+
): APIPromise<void> {
|
|
85
|
+
return this._client.post(path`/webhooks/v1/endpoints/${id}/rotate_secret`, {
|
|
86
|
+
body,
|
|
87
|
+
...options,
|
|
88
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Synchronously delivers a synthetic `webhook.test` event to the endpoint and
|
|
94
|
+
* returns the HTTP result. No retries. Useful for validating that a new endpoint
|
|
95
|
+
* is reachable and its signature verifier works. The delivery is not persisted in
|
|
96
|
+
* the delivery history.
|
|
97
|
+
*/
|
|
98
|
+
test(
|
|
99
|
+
id: string,
|
|
100
|
+
body: EndpointTestParams | null | undefined = {},
|
|
101
|
+
options?: RequestOptions,
|
|
102
|
+
): APIPromise<void> {
|
|
103
|
+
return this._client.post(path`/webhooks/v1/endpoints/${id}/test`, {
|
|
104
|
+
body,
|
|
105
|
+
...options,
|
|
106
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface EndpointCreateParams {
|
|
112
|
+
/**
|
|
113
|
+
* Glob patterns of event types to deliver (e.g. "vault._", "ocr.job.completed",
|
|
114
|
+
* "_")
|
|
115
|
+
*/
|
|
116
|
+
eventTypeFilters: Array<string>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* HTTPS callback URL that will receive event deliveries
|
|
120
|
+
*/
|
|
121
|
+
url: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Human-readable label for this endpoint
|
|
125
|
+
*/
|
|
126
|
+
description?: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Optional per-resource allowlists. If vaultIds is set, only events for those
|
|
130
|
+
* vaults are delivered. Same for matterIds.
|
|
131
|
+
*/
|
|
132
|
+
resourceScopes?: EndpointCreateParams.ResourceScopes;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export namespace EndpointCreateParams {
|
|
136
|
+
/**
|
|
137
|
+
* Optional per-resource allowlists. If vaultIds is set, only events for those
|
|
138
|
+
* vaults are delivered. Same for matterIds.
|
|
139
|
+
*/
|
|
140
|
+
export interface ResourceScopes {
|
|
141
|
+
matterIds?: Array<string>;
|
|
142
|
+
|
|
143
|
+
vaultIds?: Array<string>;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface EndpointUpdateParams {
|
|
148
|
+
description?: string | null;
|
|
149
|
+
|
|
150
|
+
eventTypeFilters?: Array<string>;
|
|
151
|
+
|
|
152
|
+
resourceScopes?: EndpointUpdateParams.ResourceScopes | null;
|
|
153
|
+
|
|
154
|
+
status?: 'active' | 'disabled';
|
|
155
|
+
|
|
156
|
+
url?: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export namespace EndpointUpdateParams {
|
|
160
|
+
export interface ResourceScopes {
|
|
161
|
+
matterIds?: Array<string>;
|
|
162
|
+
|
|
163
|
+
vaultIds?: Array<string>;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface EndpointListParams {
|
|
168
|
+
limit?: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Filter by endpoint status
|
|
172
|
+
*/
|
|
173
|
+
status?: 'active' | 'disabled' | 'auto_disabled';
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface EndpointRotateSecretParams {
|
|
177
|
+
/**
|
|
178
|
+
* How long (seconds) the old secret continues to be accepted. 0 invalidates
|
|
179
|
+
* immediately. Default: 86400 (24h).
|
|
180
|
+
*/
|
|
181
|
+
previousSecretExpiresInSec?: number;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface EndpointTestParams {
|
|
185
|
+
/**
|
|
186
|
+
* Event type to simulate. Defaults to "webhook.test".
|
|
187
|
+
*/
|
|
188
|
+
eventType?: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Custom `data` payload. Defaults to a small placeholder.
|
|
192
|
+
*/
|
|
193
|
+
payload?: unknown;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export declare namespace Endpoints {
|
|
197
|
+
export {
|
|
198
|
+
type EndpointCreateParams as EndpointCreateParams,
|
|
199
|
+
type EndpointUpdateParams as EndpointUpdateParams,
|
|
200
|
+
type EndpointListParams as EndpointListParams,
|
|
201
|
+
type EndpointRotateSecretParams as EndpointRotateSecretParams,
|
|
202
|
+
type EndpointTestParams as EndpointTestParams,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Webhook endpoint management
|
|
10
|
+
*/
|
|
11
|
+
export class EventTypes extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Returns the catalog of event types that can be subscribed to via webhook
|
|
14
|
+
* endpoints. Each entry lists the required service scope the API key must carry to
|
|
15
|
+
* subscribe, plus the stability level.
|
|
16
|
+
*/
|
|
17
|
+
list(options?: RequestOptions): APIPromise<void> {
|
|
18
|
+
return this._client.get('/webhooks/v1/event_types', {
|
|
19
|
+
...options,
|
|
20
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Deliveries, type DeliveryListParams, type DeliveryReplayParams } from './deliveries';
|
|
4
|
+
export {
|
|
5
|
+
Endpoints,
|
|
6
|
+
type EndpointCreateParams,
|
|
7
|
+
type EndpointUpdateParams,
|
|
8
|
+
type EndpointListParams,
|
|
9
|
+
type EndpointRotateSecretParams,
|
|
10
|
+
type EndpointTestParams,
|
|
11
|
+
} from './endpoints';
|
|
12
|
+
export { EventTypes } from './event-types';
|
|
13
|
+
export { V1 } from './v1';
|