@oxchannels/sdk 1.0.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.
@@ -0,0 +1,398 @@
1
+ export interface paths {
2
+ "/v1/device-enrollments/complete": {
3
+ parameters: {
4
+ query?: never;
5
+ header?: never;
6
+ path?: never;
7
+ cookie?: never;
8
+ };
9
+ get?: never;
10
+ put?: never;
11
+ /** Device Enrollment complete */
12
+ post: operations["DeviceEnrollment_complete"];
13
+ delete?: never;
14
+ options?: never;
15
+ head?: never;
16
+ patch?: never;
17
+ trace?: never;
18
+ };
19
+ }
20
+ export type webhooks = Record<string, never>;
21
+ export interface components {
22
+ schemas: {
23
+ EnrollmentCompleteResponseDto: {
24
+ deviceId: string;
25
+ encryptionKeyId: string;
26
+ generation: number;
27
+ /** @description Opaque local profile binding; contains no provider identifier. */
28
+ profileRef: string;
29
+ /** @description Reveal-once credential; store only in the OS-backed key store. */
30
+ refreshCredential: string;
31
+ signingKeyId: string;
32
+ };
33
+ EnrollmentProofDto: {
34
+ code: string;
35
+ codeId: string;
36
+ encryptionJwk: {
37
+ [key: string]: string;
38
+ };
39
+ encryptionProof: string;
40
+ nonce: string;
41
+ signingJwk: {
42
+ [key: string]: string;
43
+ };
44
+ signingProof: string;
45
+ version: number;
46
+ workspaceId: string;
47
+ };
48
+ /** OxChannels ErrorEnvelope v2 */
49
+ ErrorEnvelopeV2: {
50
+ /** @enum {unknown} */
51
+ category: "VALIDATION";
52
+ /** @enum {unknown} */
53
+ code: "INVALID_REQUEST";
54
+ correlationId: string;
55
+ /** @enum {unknown} */
56
+ effectEvidence: "NOT_APPLIED";
57
+ message: string;
58
+ /** @enum {unknown} */
59
+ retryable: false;
60
+ /** @enum {unknown} */
61
+ schemaVersion: "2.0.0";
62
+ traceId: string;
63
+ violations?: {
64
+ code: string;
65
+ path: string;
66
+ }[];
67
+ } | {
68
+ /** @enum {unknown} */
69
+ category: "AUTHENTICATION";
70
+ /** @enum {unknown} */
71
+ code: "AUTHENTICATION_REQUIRED";
72
+ correlationId: string;
73
+ /** @enum {unknown} */
74
+ effectEvidence: "NOT_APPLIED";
75
+ message: string;
76
+ /** @enum {unknown} */
77
+ retryable: true;
78
+ /** @enum {unknown} */
79
+ schemaVersion: "2.0.0";
80
+ traceId: string;
81
+ violations?: {
82
+ code: string;
83
+ path: string;
84
+ }[];
85
+ } | {
86
+ /** @enum {unknown} */
87
+ category: "AUTHORIZATION";
88
+ /** @enum {unknown} */
89
+ code: "FORBIDDEN";
90
+ correlationId: string;
91
+ /** @enum {unknown} */
92
+ effectEvidence: "NOT_APPLIED";
93
+ message: string;
94
+ /** @enum {unknown} */
95
+ retryable: false;
96
+ /** @enum {unknown} */
97
+ schemaVersion: "2.0.0";
98
+ traceId: string;
99
+ violations?: {
100
+ code: string;
101
+ path: string;
102
+ }[];
103
+ } | {
104
+ /** @enum {unknown} */
105
+ category: "RESOURCE";
106
+ /** @enum {unknown} */
107
+ code: "NOT_FOUND";
108
+ correlationId: string;
109
+ /** @enum {unknown} */
110
+ effectEvidence: "NOT_APPLIED";
111
+ message: string;
112
+ /** @enum {unknown} */
113
+ retryable: false;
114
+ /** @enum {unknown} */
115
+ schemaVersion: "2.0.0";
116
+ traceId: string;
117
+ violations?: {
118
+ code: string;
119
+ path: string;
120
+ }[];
121
+ } | {
122
+ /** @enum {unknown} */
123
+ category: "CONFLICT";
124
+ /** @enum {unknown} */
125
+ code: "IDEMPOTENCY_CONFLICT";
126
+ correlationId: string;
127
+ /** @enum {unknown} */
128
+ effectEvidence: null;
129
+ message: string;
130
+ /** @enum {unknown} */
131
+ retryable: false;
132
+ /** @enum {unknown} */
133
+ schemaVersion: "2.0.0";
134
+ traceId: string;
135
+ violations?: {
136
+ code: string;
137
+ path: string;
138
+ }[];
139
+ } | {
140
+ /** @enum {unknown} */
141
+ category: "RATE_LIMIT";
142
+ /** @enum {unknown} */
143
+ code: "RATE_LIMITED";
144
+ correlationId: string;
145
+ /** @enum {unknown} */
146
+ effectEvidence: null;
147
+ message: string;
148
+ /** @enum {unknown} */
149
+ retryable: true;
150
+ retryAfterSeconds: number;
151
+ /** @enum {unknown} */
152
+ schemaVersion: "2.0.0";
153
+ traceId: string;
154
+ violations?: {
155
+ code: string;
156
+ path: string;
157
+ }[];
158
+ } | {
159
+ /** @enum {unknown} */
160
+ category: "INTERNAL";
161
+ /** @enum {unknown} */
162
+ code: "INTERNAL_SAFE_FAILURE";
163
+ correlationId: string;
164
+ /** @enum {unknown} */
165
+ effectEvidence: null;
166
+ message: string;
167
+ /** @enum {unknown} */
168
+ retryable: false;
169
+ /** @enum {unknown} */
170
+ schemaVersion: "2.0.0";
171
+ traceId: string;
172
+ violations?: {
173
+ code: string;
174
+ path: string;
175
+ }[];
176
+ } | {
177
+ /** @enum {unknown} */
178
+ category: "CONFLICT";
179
+ /** @enum {unknown} */
180
+ code: "CONFLICT";
181
+ correlationId: string;
182
+ /** @enum {unknown} */
183
+ effectEvidence: null;
184
+ message: string;
185
+ /** @enum {unknown} */
186
+ retryable: false;
187
+ /** @enum {unknown} */
188
+ schemaVersion: "2.0.0";
189
+ traceId: string;
190
+ violations?: {
191
+ code: string;
192
+ path: string;
193
+ }[];
194
+ };
195
+ ErrorEnvelopeV2AuthenticationRequired: {
196
+ code: "ErrorEnvelopeV2AuthenticationRequired";
197
+ } & (Omit<components["schemas"]["ErrorEnvelopeV2"], "code"> & {
198
+ /** @enum {unknown} */
199
+ category: "AUTHENTICATION";
200
+ /** @enum {unknown} */
201
+ code: "AUTHENTICATION_REQUIRED";
202
+ correlationId: string;
203
+ /** @enum {unknown} */
204
+ effectEvidence: "NOT_APPLIED";
205
+ message: string;
206
+ /** @enum {unknown} */
207
+ retryable: true;
208
+ /** @enum {unknown} */
209
+ schemaVersion: "2.0.0";
210
+ traceId: string;
211
+ violations?: {
212
+ code: string;
213
+ path: string;
214
+ }[];
215
+ });
216
+ ErrorEnvelopeV2Conflict: {
217
+ code: "ErrorEnvelopeV2Conflict";
218
+ } & (Omit<components["schemas"]["ErrorEnvelopeV2"], "code"> & {
219
+ /** @enum {unknown} */
220
+ category: "CONFLICT";
221
+ /** @enum {unknown} */
222
+ code: "CONFLICT";
223
+ correlationId: string;
224
+ /** @enum {unknown} */
225
+ effectEvidence: null;
226
+ message: string;
227
+ /** @enum {unknown} */
228
+ retryable: false;
229
+ /** @enum {unknown} */
230
+ schemaVersion: "2.0.0";
231
+ traceId: string;
232
+ violations?: {
233
+ code: string;
234
+ path: string;
235
+ }[];
236
+ });
237
+ ErrorEnvelopeV2IdempotencyConflict: {
238
+ code: "ErrorEnvelopeV2IdempotencyConflict";
239
+ } & (Omit<components["schemas"]["ErrorEnvelopeV2"], "code"> & {
240
+ /** @enum {unknown} */
241
+ category: "CONFLICT";
242
+ /** @enum {unknown} */
243
+ code: "IDEMPOTENCY_CONFLICT";
244
+ correlationId: string;
245
+ /** @enum {unknown} */
246
+ effectEvidence: null;
247
+ message: string;
248
+ /** @enum {unknown} */
249
+ retryable: false;
250
+ /** @enum {unknown} */
251
+ schemaVersion: "2.0.0";
252
+ traceId: string;
253
+ violations?: {
254
+ code: string;
255
+ path: string;
256
+ }[];
257
+ });
258
+ ErrorEnvelopeV2InternalSafeFailure: {
259
+ code: "ErrorEnvelopeV2InternalSafeFailure";
260
+ } & (Omit<components["schemas"]["ErrorEnvelopeV2"], "code"> & {
261
+ /** @enum {unknown} */
262
+ category: "INTERNAL";
263
+ /** @enum {unknown} */
264
+ code: "INTERNAL_SAFE_FAILURE";
265
+ correlationId: string;
266
+ /** @enum {unknown} */
267
+ effectEvidence: null;
268
+ message: string;
269
+ /** @enum {unknown} */
270
+ retryable: false;
271
+ /** @enum {unknown} */
272
+ schemaVersion: "2.0.0";
273
+ traceId: string;
274
+ violations?: {
275
+ code: string;
276
+ path: string;
277
+ }[];
278
+ });
279
+ ErrorEnvelopeV2InvalidRequest: {
280
+ code: "ErrorEnvelopeV2InvalidRequest";
281
+ } & (Omit<components["schemas"]["ErrorEnvelopeV2"], "code"> & {
282
+ /** @enum {unknown} */
283
+ category: "VALIDATION";
284
+ /** @enum {unknown} */
285
+ code: "INVALID_REQUEST";
286
+ correlationId: string;
287
+ /** @enum {unknown} */
288
+ effectEvidence: "NOT_APPLIED";
289
+ message: string;
290
+ /** @enum {unknown} */
291
+ retryable: false;
292
+ /** @enum {unknown} */
293
+ schemaVersion: "2.0.0";
294
+ traceId: string;
295
+ violations?: {
296
+ code: string;
297
+ path: string;
298
+ }[];
299
+ });
300
+ ErrorEnvelopeV2NotFound: {
301
+ code: "ErrorEnvelopeV2NotFound";
302
+ } & (Omit<components["schemas"]["ErrorEnvelopeV2"], "code"> & {
303
+ /** @enum {unknown} */
304
+ category: "RESOURCE";
305
+ /** @enum {unknown} */
306
+ code: "NOT_FOUND";
307
+ correlationId: string;
308
+ /** @enum {unknown} */
309
+ effectEvidence: "NOT_APPLIED";
310
+ message: string;
311
+ /** @enum {unknown} */
312
+ retryable: false;
313
+ /** @enum {unknown} */
314
+ schemaVersion: "2.0.0";
315
+ traceId: string;
316
+ violations?: {
317
+ code: string;
318
+ path: string;
319
+ }[];
320
+ });
321
+ };
322
+ responses: never;
323
+ parameters: never;
324
+ requestBodies: never;
325
+ headers: never;
326
+ pathItems: never;
327
+ }
328
+ export type $defs = Record<string, never>;
329
+ export interface operations {
330
+ DeviceEnrollment_complete: {
331
+ parameters: {
332
+ query?: never;
333
+ header?: never;
334
+ path?: never;
335
+ cookie?: never;
336
+ };
337
+ requestBody: {
338
+ content: {
339
+ "application/json": components["schemas"]["EnrollmentProofDto"];
340
+ };
341
+ };
342
+ responses: {
343
+ 201: {
344
+ headers: {
345
+ [name: string]: unknown;
346
+ };
347
+ content: {
348
+ "application/json": components["schemas"]["EnrollmentCompleteResponseDto"];
349
+ };
350
+ };
351
+ /** @description Invalid request */
352
+ 400: {
353
+ headers: {
354
+ [name: string]: unknown;
355
+ };
356
+ content: {
357
+ "application/json": components["schemas"]["ErrorEnvelopeV2InvalidRequest"];
358
+ };
359
+ };
360
+ /** @description Authentication required */
361
+ 401: {
362
+ headers: {
363
+ [name: string]: unknown;
364
+ };
365
+ content: {
366
+ "application/json": components["schemas"]["ErrorEnvelopeV2AuthenticationRequired"];
367
+ };
368
+ };
369
+ /** @description Resource unavailable */
370
+ 404: {
371
+ headers: {
372
+ [name: string]: unknown;
373
+ };
374
+ content: {
375
+ "application/json": components["schemas"]["ErrorEnvelopeV2NotFound"];
376
+ };
377
+ };
378
+ /** @description State or idempotency conflict */
379
+ 409: {
380
+ headers: {
381
+ [name: string]: unknown;
382
+ };
383
+ content: {
384
+ "application/json": components["schemas"]["ErrorEnvelopeV2Conflict"] | components["schemas"]["ErrorEnvelopeV2IdempotencyConflict"];
385
+ };
386
+ };
387
+ /** @description Unexpected server failure */
388
+ 500: {
389
+ headers: {
390
+ [name: string]: unknown;
391
+ };
392
+ content: {
393
+ "application/json": components["schemas"]["ErrorEnvelopeV2InternalSafeFailure"];
394
+ };
395
+ };
396
+ };
397
+ };
398
+ }
@@ -0,0 +1 @@
1
+ export { OXCHANNELS_CONTRACT_SET_VERSION, OxChannelsApiError, OxChannelsApiErrorV2, OxChannelsApiProtocolError, createAgentBootstrapClient, createDashboardContractClient, createDashboardV2Client, createOxStudioClient, createPartnerClient, createPublicClient, } from '../client.js';
@@ -0,0 +1,2 @@
1
+ // Compatibility re-export. Wire types are generated in *-schema.ts; runtime wrappers live in client.ts.
2
+ export { OXCHANNELS_CONTRACT_SET_VERSION, OxChannelsApiError, OxChannelsApiErrorV2, OxChannelsApiProtocolError, createAgentBootstrapClient, createDashboardContractClient, createDashboardV2Client, createOxStudioClient, createPartnerClient, createPublicClient, } from '../client.js';
@@ -0,0 +1,83 @@
1
+ export declare const PARITY_CONTRACT_SET_VERSION: "2.0.0";
2
+ /**
3
+ * The response header that names who imposed a delayed retry.
4
+ *
5
+ * It is a header rather than an envelope field on purpose. Contract-set 2.0.0 error envelopes are
6
+ * closed schemas, and this repository's compatibility rule treats *any* added output property —
7
+ * required or optional — as breaking, because the generated clients parse closed-world and would
8
+ * reject a wider body. A header carries the same machine-readable fact additively, so a client
9
+ * pinned to 1.13.52 keeps working byte-for-byte while a client that wants the distinction can read
10
+ * it today. Moving it into the envelope belongs to the next contract major.
11
+ *
12
+ * Why the distinction matters at all: before Task 18.2 an OxChannels policy limit and a provider
13
+ * throttle both arrived as a bare `RATE_LIMITED`, and the backend answered every non-public 429
14
+ * with a hardcoded sixty seconds. Retrying at an interval we invented, inside a window somebody
15
+ * else set, is how a connected account gets suspended.
16
+ *
17
+ * The operator-facing surfaces publish the same distinction in full: `GET /privacy/limits` returns
18
+ * our thresholds and the provider's observed limits as two separate lists, and
19
+ * `GET /privacy/limit-decisions` records every judgement with its authority.
20
+ */
21
+ export declare const LIMIT_AUTHORITY_HEADER: "oxchannels-limit-authority";
22
+ export declare const LIMIT_AUTHORITY_HEADER_VALUES: readonly ["OXCHANNELS", "PROVIDER"];
23
+ export type LimitAuthorityHeaderValue = (typeof LIMIT_AUTHORITY_HEADER_VALUES)[number];
24
+ export declare const ACTIVE_API_ERROR_CODES: readonly ["INVALID_REQUEST", "AUTHENTICATION_REQUIRED", "FORBIDDEN", "NOT_FOUND", "IDEMPOTENCY_CONFLICT", "RATE_LIMITED", "INTERNAL_SAFE_FAILURE"];
25
+ export declare const ACTIVE_API_ERROR_CODES_V2: readonly ["INVALID_REQUEST", "AUTHENTICATION_REQUIRED", "FORBIDDEN", "NOT_FOUND", "IDEMPOTENCY_CONFLICT", "RATE_LIMITED", "INTERNAL_SAFE_FAILURE", "CONFLICT"];
26
+ export declare const COLLABORATION_CONFLICT_CODES: readonly ["DUPLICATE_INVITATION", "LAST_OWNER", "ROLE_CEILING", "SELF_MUTATION_REQUIRES_TRANSFER", "STALE_ACCESS_GENERATION", "STALE_ACCOUNT_GROUP", "STALE_INVITATION", "STALE_MEMBERSHIP"];
27
+ export declare const RESERVED_API_ERROR_CODES: readonly ["SCHEMA_UNSUPPORTED", "STALE_CAPABILITY", "UNSUPPORTED_ACTION", "CONNECTION_REQUIRED", "PROVIDER_REAUTH_REQUIRED", "PROVIDER_REVIEW_REQUIRED", "PROVIDER_PERMISSION_DENIED", "PROVIDER_REJECTED", "DEPENDENCY_UNAVAILABLE", "UNKNOWN_EFFECT"];
28
+ export type ActiveApiErrorCode = (typeof ACTIVE_API_ERROR_CODES)[number];
29
+ export type ActiveApiErrorCodeV2 = (typeof ACTIVE_API_ERROR_CODES_V2)[number];
30
+ export type CollaborationConflictCode = (typeof COLLABORATION_CONFLICT_CODES)[number];
31
+ export type ReservedApiErrorCode = (typeof RESERVED_API_ERROR_CODES)[number];
32
+ export type ApiErrorCode = ActiveApiErrorCodeV2 | ReservedApiErrorCode;
33
+ export type ApiErrorTaxonomyStatus = 'ACTIVE' | 'RESERVED';
34
+ export type ApiErrorCategory = 'VALIDATION' | 'AUTHENTICATION' | 'AUTHORIZATION' | 'RESOURCE' | 'CONFLICT' | 'RATE_LIMIT' | 'CAPABILITY' | 'PROVIDER' | 'DEPENDENCY' | 'INTERNAL';
35
+ export type ApiErrorRetry = 'NONE' | 'AFTER_DELAY' | 'REFRESH_AUTH' | 'POLL' | 'MANUAL_REVIEW';
36
+ export type ApiErrorEffect = 'NOT_APPLIED' | 'NO_EFFECT_CLAIM' | 'UNKNOWN';
37
+ export interface ApiErrorTaxonomyEntry {
38
+ readonly code: ApiErrorCode;
39
+ readonly status: ApiErrorTaxonomyStatus;
40
+ readonly category: ApiErrorCategory;
41
+ readonly defaultHttpStatus: number;
42
+ readonly retry: ApiErrorRetry;
43
+ readonly effect: ApiErrorEffect;
44
+ }
45
+ export declare const API_ERROR_TAXONOMY: Readonly<Record<ApiErrorCode, Readonly<ApiErrorTaxonomyEntry>>>;
46
+ export type ContractJsonSchema = Readonly<Record<string, unknown>>;
47
+ export declare const API_ERROR_TAXONOMY_ENTRY_JSON_SCHEMA: ContractJsonSchema;
48
+ export declare const ERROR_ENVELOPE_V1_JSON_SCHEMA: ContractJsonSchema;
49
+ export declare const ERROR_ENVELOPE_V2_JSON_SCHEMA: ContractJsonSchema;
50
+ export declare const API_ERROR_TAXONOMY_ENTRY_OPENAPI_SCHEMA: Readonly<Record<string, unknown>>;
51
+ export declare const ERROR_ENVELOPE_V1_OPENAPI_SCHEMA: Readonly<Record<string, unknown>>;
52
+ export declare const ERROR_ENVELOPE_V2_OPENAPI_SCHEMA: Readonly<Record<string, unknown>>;
53
+ export declare const ERROR_ENVELOPE_V2_VARIANT_OPENAPI_SCHEMAS: Readonly<Record<ActiveApiErrorCodeV2, ContractJsonSchema>>;
54
+ export interface ApiErrorEnvelopeV1 {
55
+ readonly version: 'v1';
56
+ readonly code: ActiveApiErrorCode;
57
+ readonly message: string;
58
+ readonly traceId: string;
59
+ readonly retryable: boolean;
60
+ }
61
+ export interface ApiErrorEnvelopeV2 {
62
+ readonly schemaVersion: typeof PARITY_CONTRACT_SET_VERSION;
63
+ readonly code: ActiveApiErrorCodeV2;
64
+ readonly category: ApiErrorCategory;
65
+ readonly message: string;
66
+ readonly traceId: string;
67
+ readonly correlationId: string;
68
+ readonly retryable: boolean;
69
+ readonly effectEvidence: 'NOT_APPLIED' | 'UNKNOWN' | null;
70
+ readonly retryAfterSeconds?: number;
71
+ readonly violations?: readonly Readonly<ApiErrorViolation>[];
72
+ }
73
+ export interface ApiErrorViolation {
74
+ readonly path: string;
75
+ readonly code: string;
76
+ }
77
+ export interface CollaborationConflictViolation extends ApiErrorViolation {
78
+ readonly path: 'collaboration';
79
+ readonly code: CollaborationConflictCode;
80
+ }
81
+ export declare function isCollaborationConflictCode(value: unknown): value is CollaborationConflictCode;
82
+ export declare function parseApiErrorEnvelopeV1(value: unknown): Readonly<ApiErrorEnvelopeV1>;
83
+ export declare function parseApiErrorEnvelopeV2(value: unknown): Readonly<ApiErrorEnvelopeV2>;