@enlitt/protocol 0.0.0-stage → 0.1.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 +13 -0
- package/LICENSE +21 -0
- package/README.md +15 -2
- package/dist/admin.d.cts +353 -0
- package/dist/admin.d.ts +354 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/authentication.d.cts +8 -0
- package/dist/authentication.d.ts +9 -0
- package/dist/authentication.d.ts.map +1 -0
- package/dist/canonical-integer.d.cts +48 -0
- package/dist/canonical-integer.d.ts +49 -0
- package/dist/canonical-integer.d.ts.map +1 -0
- package/dist/compatibility.d.cts +23 -0
- package/dist/compatibility.d.ts +24 -0
- package/dist/compatibility.d.ts.map +1 -0
- package/dist/contract.d.cts +67 -0
- package/dist/contract.d.ts +68 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/dashboard.d.cts +1030 -0
- package/dist/dashboard.d.ts +1031 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/errors.d.cts +112 -0
- package/dist/errors.d.ts +113 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/idempotency.d.cts +79 -0
- package/dist/idempotency.d.ts +80 -0
- package/dist/idempotency.d.ts.map +1 -0
- package/dist/index.cjs +4806 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +31 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4624 -0
- package/dist/index.js.map +1 -0
- package/dist/premium-operations.d.cts +84 -0
- package/dist/premium-operations.d.ts +85 -0
- package/dist/premium-operations.d.ts.map +1 -0
- package/dist/response-stream.d.cts +246 -0
- package/dist/response-stream.d.ts +247 -0
- package/dist/response-stream.d.ts.map +1 -0
- package/dist/responses.d.cts +233 -0
- package/dist/responses.d.ts +234 -0
- package/dist/responses.d.ts.map +1 -0
- package/dist/usage.d.cts +11 -0
- package/dist/usage.d.ts +12 -0
- package/dist/usage.d.ts.map +1 -0
- package/generated/contract.json +482 -0
- package/package.json +51 -3
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type ParseOptions } from "./compatibility.js";
|
|
2
|
+
import { type ResponseValidationResult } from "./responses.js";
|
|
3
|
+
export declare const WIRE_CONTRACT_FORMAT = 1;
|
|
4
|
+
/** Every closed string set a response parser must handle in strict and tolerant modes. */
|
|
5
|
+
export declare const WIRE_CLOSED_SETS: Readonly<{
|
|
6
|
+
readonly "api_key.scope": readonly ["model", "reporting"];
|
|
7
|
+
readonly "api_key.status": readonly ["active", "revoked", "expired"];
|
|
8
|
+
readonly "application.environment": readonly ["test", "live"];
|
|
9
|
+
readonly "application.status": readonly ["active", "suspended", "closed"];
|
|
10
|
+
readonly "cli_authorization.kind": readonly ["login", "step_up"];
|
|
11
|
+
readonly "contact.type": readonly ["email", "phone"];
|
|
12
|
+
readonly "email_sign_in.account_type": readonly ["user", "business"];
|
|
13
|
+
readonly "order.kind": readonly ["subscription", "bundle"];
|
|
14
|
+
readonly "order.refund.eligibility": readonly ["full", "half", "none"];
|
|
15
|
+
readonly "order.refund.reason": readonly ["unused", "within_usage_threshold", "usage_threshold_exceeded", "window_expired", "not_active", "gift"];
|
|
16
|
+
readonly "order.status": readonly ["pending", "active", "refund_pending", "refunded", "failed", "expired"];
|
|
17
|
+
readonly "payout.blocked_reason": readonly ["payout_blocked", "below_minimum", "outstanding_deficit", "tax_details_required", "payout_account_incomplete", "monthly_payout_taken", "payout_pending"];
|
|
18
|
+
readonly "payout.connected_account_status": readonly ["none", "onboarding", "restricted", "enabled", "rejected"];
|
|
19
|
+
readonly "personal_application_call.credit_type": readonly ["standard", "premium"];
|
|
20
|
+
readonly "personal_application_call.sort": readonly ["time", "charge"];
|
|
21
|
+
readonly "personal_application_call.status": readonly ["pending", "running", "completed", "failed", "canceled", "expired"];
|
|
22
|
+
readonly "plan.interval": readonly ["month", "year"];
|
|
23
|
+
readonly "premium_operation.billing": readonly ["managed"];
|
|
24
|
+
readonly "premium_terminal.status": readonly ["completed", "failed", "canceled"];
|
|
25
|
+
readonly "response.incomplete_details.reason": readonly ["max_output_tokens"];
|
|
26
|
+
readonly "response.output_item.status": readonly ["in_progress", "completed", "incomplete"];
|
|
27
|
+
readonly "response.status": readonly ["completed", "failed", "in_progress", "cancelled", "queued", "incomplete"];
|
|
28
|
+
readonly "response_stream.type": readonly ("response.completed" | "response.content_part.added" | "response.content_part.done" | "response.created" | "response.failed" | "response.function_call_arguments.delta" | "response.function_call_arguments.done" | "response.in_progress" | "response.incomplete" | "response.output_item.added" | "response.output_item.done" | "response.output_text.delta" | "response.output_text.done")[];
|
|
29
|
+
readonly "subscription.change_mode": readonly ["checkout", "change", "locked", "unavailable"];
|
|
30
|
+
readonly "subscription.locked_downgrade": readonly ["checkout", "change"];
|
|
31
|
+
readonly "subscription.service_tier": readonly ["normal", "reduced", "minimum"];
|
|
32
|
+
readonly "subscription.status": readonly ["active", "past_due", "canceled", "suspended"];
|
|
33
|
+
}>;
|
|
34
|
+
export interface WireContract {
|
|
35
|
+
readonly contract_format: typeof WIRE_CONTRACT_FORMAT;
|
|
36
|
+
readonly api_version: string;
|
|
37
|
+
readonly version_header: string;
|
|
38
|
+
readonly unknown_enum_value: string;
|
|
39
|
+
readonly unrecognized_error_code: string;
|
|
40
|
+
readonly idempotency_key: {
|
|
41
|
+
readonly min_length: number;
|
|
42
|
+
readonly max_length: number;
|
|
43
|
+
readonly min_retention_days: number;
|
|
44
|
+
};
|
|
45
|
+
readonly error_types: readonly string[];
|
|
46
|
+
readonly error_codes: Readonly<Record<string, {
|
|
47
|
+
readonly type: string;
|
|
48
|
+
readonly http_status: number;
|
|
49
|
+
readonly retryable: boolean;
|
|
50
|
+
readonly retry_after: "required" | "forbidden";
|
|
51
|
+
readonly authorize_url: "allowed" | "forbidden";
|
|
52
|
+
readonly admissible_max_charge: "allowed" | "forbidden";
|
|
53
|
+
readonly limit_rule: "required" | "forbidden";
|
|
54
|
+
}>>;
|
|
55
|
+
readonly closed_sets: Readonly<Record<string, readonly string[]>>;
|
|
56
|
+
}
|
|
57
|
+
export declare function buildWireContract(): WireContract;
|
|
58
|
+
export declare function serializeWireContract(contract: WireContract): string;
|
|
59
|
+
export type FixtureEndpoint = "create-response" | "begin-operation" | "report-terminal" | "usage" | "business-info";
|
|
60
|
+
interface FixtureEndpointDefinition {
|
|
61
|
+
readonly method: "GET" | "POST";
|
|
62
|
+
readonly path: string;
|
|
63
|
+
readonly validateRequest: ((value: unknown) => ResponseValidationResult<unknown>) | null;
|
|
64
|
+
readonly validateResponse: (value: unknown, options?: ParseOptions) => ResponseValidationResult<unknown>;
|
|
65
|
+
}
|
|
66
|
+
export declare const FIXTURE_ENDPOINTS: Readonly<Record<FixtureEndpoint, FixtureEndpointDefinition>>;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAwBA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAgB5B,OAAO,EAML,KAAK,wBAAwB,EAC9B,MAAM,gBAAgB,CAAC;AAGxB,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,0FAA0F;AAC1F,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BlB,CAAC;AAEZ,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,eAAe,EAAE,OAAO,oBAAoB,CAAC;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE;QACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,UAAU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