@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.
- package/LICENSE +7 -0
- package/QUICKSTART.md +604 -0
- package/README.md +193 -0
- package/contracts/openapi-agent-bootstrap-contract-v2.json +1266 -0
- package/contracts/openapi-dashboard-contract-v2.json +98996 -0
- package/contracts/openapi-partner-contract-v2.json +14808 -0
- package/contracts/openapi-public-contract-v2.json +13489 -0
- package/dist/client.d.ts +83 -0
- package/dist/client.js +661 -0
- package/dist/generated/agent-bootstrap-contract-v2-schema.d.ts +398 -0
- package/dist/generated/agent-bootstrap-contract-v2-schema.js +1 -0
- package/dist/generated/client.d.ts +1 -0
- package/dist/generated/client.js +2 -0
- package/dist/generated/contracts/api-errors.d.ts +83 -0
- package/dist/generated/contracts/api-errors.js +296 -0
- package/dist/generated/contracts/json-data.d.ts +16 -0
- package/dist/generated/contracts/json-data.js +308 -0
- package/dist/generated/dashboard-contract-v2-schema.d.ts +45429 -0
- package/dist/generated/dashboard-contract-v2-schema.js +1 -0
- package/dist/generated/partner-contract-v2-schema.d.ts +6458 -0
- package/dist/generated/partner-contract-v2-schema.js +1 -0
- package/dist/generated/public-contract-v2-schema.d.ts +4112 -0
- package/dist/generated/public-contract-v2-schema.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -0
- package/generated/provenance.json +87 -0
- package/package.json +55 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { ActiveApiErrorCodeV2 as ContractActiveApiErrorCodeV2, ApiErrorCategory as ContractApiErrorCategory, ApiErrorEnvelopeV2 as ContractApiErrorEnvelopeV2, ApiErrorViolation as ContractApiErrorViolation } from './generated/contracts/api-errors.js';
|
|
2
|
+
import type { paths as AgentBootstrapContractV2Paths } from './generated/agent-bootstrap-contract-v2-schema.js';
|
|
3
|
+
import type { paths as DashboardContractV2Paths } from './generated/dashboard-contract-v2-schema.js';
|
|
4
|
+
import type { paths as PartnerContractV2Paths } from './generated/partner-contract-v2-schema.js';
|
|
5
|
+
import type { paths as PublicContractV2Paths } from './generated/public-contract-v2-schema.js';
|
|
6
|
+
export declare const OXCHANNELS_CONTRACT_SET_VERSION: "2.0.0";
|
|
7
|
+
export type ActiveApiErrorCode = ContractActiveApiErrorCodeV2;
|
|
8
|
+
export type ApiErrorCategory = ContractApiErrorCategory;
|
|
9
|
+
export type ApiErrorViolation = ContractApiErrorViolation;
|
|
10
|
+
export type ErrorEnvelopeV2 = ContractApiErrorEnvelopeV2;
|
|
11
|
+
export declare class OxChannelsApiError<Code extends string = string> extends Error {
|
|
12
|
+
readonly status: number;
|
|
13
|
+
readonly code: Code;
|
|
14
|
+
readonly traceId?: string | undefined;
|
|
15
|
+
constructor(status: number, code: Code, traceId?: string | undefined);
|
|
16
|
+
}
|
|
17
|
+
export declare class OxChannelsApiErrorV2 extends OxChannelsApiError<ActiveApiErrorCode> {
|
|
18
|
+
readonly schemaVersion: "2.0.0";
|
|
19
|
+
readonly envelope: Readonly<ErrorEnvelopeV2>;
|
|
20
|
+
readonly apiMessage: string;
|
|
21
|
+
readonly correlationId: string;
|
|
22
|
+
readonly retryable: boolean;
|
|
23
|
+
readonly category: ApiErrorCategory;
|
|
24
|
+
readonly effectEvidence: 'NOT_APPLIED' | 'UNKNOWN' | null;
|
|
25
|
+
readonly retryAfterSeconds?: number;
|
|
26
|
+
readonly violations?: readonly Readonly<ApiErrorViolation>[];
|
|
27
|
+
constructor(status: number, envelope: Readonly<ErrorEnvelopeV2>);
|
|
28
|
+
}
|
|
29
|
+
export declare class OxChannelsApiProtocolError extends Error {
|
|
30
|
+
readonly status: number;
|
|
31
|
+
readonly code: "ERROR_ENVELOPE_INVALID";
|
|
32
|
+
constructor(status: number);
|
|
33
|
+
}
|
|
34
|
+
export interface ProviderBindingRotationSelection {
|
|
35
|
+
readonly workspaceId: string;
|
|
36
|
+
readonly registrationId: string;
|
|
37
|
+
}
|
|
38
|
+
interface ContractV2BaseOptions {
|
|
39
|
+
readonly baseUrl?: string;
|
|
40
|
+
readonly timeoutMs?: number;
|
|
41
|
+
readonly allowInsecureLoopbackForDevelopment?: boolean;
|
|
42
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
43
|
+
}
|
|
44
|
+
export interface PublicClientOptions extends ContractV2BaseOptions {
|
|
45
|
+
readonly onUnauthorized?: () => void;
|
|
46
|
+
}
|
|
47
|
+
export declare function createPublicClient(options?: PublicClientOptions): import("openapi-fetch").Client<PublicContractV2Paths, `${string}/${string}`>;
|
|
48
|
+
export interface DashboardV2ClientOptions {
|
|
49
|
+
readonly baseUrl?: string;
|
|
50
|
+
readonly allowInsecureLoopbackForDevelopment?: boolean;
|
|
51
|
+
readonly csrfToken: () => string | undefined;
|
|
52
|
+
readonly requestId?: () => string;
|
|
53
|
+
readonly expectedProviderBindingId?: (selection: Readonly<ProviderBindingRotationSelection>) => string | undefined;
|
|
54
|
+
readonly onUnauthorized?: () => void;
|
|
55
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
56
|
+
readonly timeoutMs?: number;
|
|
57
|
+
}
|
|
58
|
+
export declare function createDashboardV2Client(options: DashboardV2ClientOptions): import("openapi-fetch").Client<DashboardContractV2Paths, `${string}/${string}`>;
|
|
59
|
+
interface PartnerClientBaseOptions extends ContractV2BaseOptions {
|
|
60
|
+
readonly baseUrl: string;
|
|
61
|
+
readonly correlationId?: () => string | undefined;
|
|
62
|
+
}
|
|
63
|
+
export type PartnerClientOptions = PartnerClientBaseOptions & (Readonly<{
|
|
64
|
+
serviceKey: () => string;
|
|
65
|
+
bearer?: never;
|
|
66
|
+
}> | Readonly<{
|
|
67
|
+
bearer: () => string;
|
|
68
|
+
serviceKey?: never;
|
|
69
|
+
}>);
|
|
70
|
+
export declare function createPartnerClient(options: PartnerClientOptions): import("openapi-fetch").Client<PartnerContractV2Paths, `${string}/${string}`>;
|
|
71
|
+
export interface AgentBootstrapClientOptions extends ContractV2BaseOptions {
|
|
72
|
+
readonly baseUrl: string;
|
|
73
|
+
}
|
|
74
|
+
export declare function createAgentBootstrapClient(options: AgentBootstrapClientOptions): import("openapi-fetch").Client<AgentBootstrapContractV2Paths, `${string}/${string}`>;
|
|
75
|
+
export declare const createDashboardContractClient: typeof createDashboardV2Client;
|
|
76
|
+
export declare const createOxStudioClient: typeof createPartnerClient;
|
|
77
|
+
export type PublicClient = ReturnType<typeof createPublicClient>;
|
|
78
|
+
export type DashboardV2Client = ReturnType<typeof createDashboardV2Client>;
|
|
79
|
+
export type DashboardContractClient = DashboardV2Client;
|
|
80
|
+
export type PartnerClient = ReturnType<typeof createPartnerClient>;
|
|
81
|
+
export type OxStudioClient = PartnerClient;
|
|
82
|
+
export type AgentBootstrapClient = ReturnType<typeof createAgentBootstrapClient>;
|
|
83
|
+
export {};
|