@spencerboucher/switchyard-client 0.0.0-stage → 0.14.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 +21 -0
- package/README.md +24 -2
- package/dist/index.js +3842 -0
- package/dist/types/api.d.ts +28 -0
- package/dist/types/client.d.ts +56 -0
- package/dist/types/connection.d.ts +66 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/protocol/adapter-preview.d.ts +455 -0
- package/dist/types/protocol/adapters.d.ts +113 -0
- package/dist/types/protocol/agent-wire.d.ts +269 -0
- package/dist/types/protocol/api.d.ts +1463 -0
- package/dist/types/protocol/backoff.d.ts +5 -0
- package/dist/types/protocol/client-wire.d.ts +1730 -0
- package/dist/types/protocol/contributions.d.ts +62 -0
- package/dist/types/protocol/entities.d.ts +1350 -0
- package/dist/types/protocol/errors.d.ts +115 -0
- package/dist/types/protocol/events.d.ts +1098 -0
- package/dist/types/protocol/github.d.ts +510 -0
- package/dist/types/protocol/host-wire.d.ts +1456 -0
- package/dist/types/protocol/ids.d.ts +7 -0
- package/dist/types/protocol/index.d.ts +28 -0
- package/dist/types/protocol/policies.d.ts +576 -0
- package/dist/types/protocol/terminal-wire.d.ts +45 -0
- package/dist/types/protocol/titles.d.ts +9 -0
- package/dist/types/protocol/ui.d.ts +164 -0
- package/dist/types/protocol/views.d.ts +12 -0
- package/dist/types/protocol/web-bridge.d.ts +30 -0
- package/dist/types/store.d.ts +59 -0
- package/dist/types/wait.d.ts +20 -0
- package/package.json +28 -4
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ERROR_CODES: readonly ["unauthorized", "forbidden", "not_found", "invalid_request", "conflict", "already_answered", "stale_control", "host_unreachable", "pi_incompatible", "native_session_missing", "invalid_transition", "dependency_cycle", "workspace_dirty", "workspace_unmerged", "workspace_active_sessions", "branch_invalid", "path_collision", "not_a_git_repo", "repo_mismatch", "enrollment_expired", "enrollment_used", "device_revoked", "unsupported_capability", "too_large", "ui_tree_too_large", "timeout", "rate_limited", "internal"];
|
|
3
|
+
export declare const ErrorCode: z.ZodEnum<{
|
|
4
|
+
already_answered: "already_answered";
|
|
5
|
+
branch_invalid: "branch_invalid";
|
|
6
|
+
conflict: "conflict";
|
|
7
|
+
dependency_cycle: "dependency_cycle";
|
|
8
|
+
device_revoked: "device_revoked";
|
|
9
|
+
enrollment_expired: "enrollment_expired";
|
|
10
|
+
enrollment_used: "enrollment_used";
|
|
11
|
+
forbidden: "forbidden";
|
|
12
|
+
host_unreachable: "host_unreachable";
|
|
13
|
+
internal: "internal";
|
|
14
|
+
invalid_request: "invalid_request";
|
|
15
|
+
invalid_transition: "invalid_transition";
|
|
16
|
+
native_session_missing: "native_session_missing";
|
|
17
|
+
not_a_git_repo: "not_a_git_repo";
|
|
18
|
+
not_found: "not_found";
|
|
19
|
+
path_collision: "path_collision";
|
|
20
|
+
pi_incompatible: "pi_incompatible";
|
|
21
|
+
rate_limited: "rate_limited";
|
|
22
|
+
repo_mismatch: "repo_mismatch";
|
|
23
|
+
stale_control: "stale_control";
|
|
24
|
+
timeout: "timeout";
|
|
25
|
+
too_large: "too_large";
|
|
26
|
+
ui_tree_too_large: "ui_tree_too_large";
|
|
27
|
+
unauthorized: "unauthorized";
|
|
28
|
+
unsupported_capability: "unsupported_capability";
|
|
29
|
+
workspace_active_sessions: "workspace_active_sessions";
|
|
30
|
+
workspace_dirty: "workspace_dirty";
|
|
31
|
+
workspace_unmerged: "workspace_unmerged";
|
|
32
|
+
}>;
|
|
33
|
+
export type ErrorCode = z.infer<typeof ErrorCode>;
|
|
34
|
+
export declare const ErrorBody: z.ZodObject<{
|
|
35
|
+
code: z.ZodEnum<{
|
|
36
|
+
already_answered: "already_answered";
|
|
37
|
+
branch_invalid: "branch_invalid";
|
|
38
|
+
conflict: "conflict";
|
|
39
|
+
dependency_cycle: "dependency_cycle";
|
|
40
|
+
device_revoked: "device_revoked";
|
|
41
|
+
enrollment_expired: "enrollment_expired";
|
|
42
|
+
enrollment_used: "enrollment_used";
|
|
43
|
+
forbidden: "forbidden";
|
|
44
|
+
host_unreachable: "host_unreachable";
|
|
45
|
+
internal: "internal";
|
|
46
|
+
invalid_request: "invalid_request";
|
|
47
|
+
invalid_transition: "invalid_transition";
|
|
48
|
+
native_session_missing: "native_session_missing";
|
|
49
|
+
not_a_git_repo: "not_a_git_repo";
|
|
50
|
+
not_found: "not_found";
|
|
51
|
+
path_collision: "path_collision";
|
|
52
|
+
pi_incompatible: "pi_incompatible";
|
|
53
|
+
rate_limited: "rate_limited";
|
|
54
|
+
repo_mismatch: "repo_mismatch";
|
|
55
|
+
stale_control: "stale_control";
|
|
56
|
+
timeout: "timeout";
|
|
57
|
+
too_large: "too_large";
|
|
58
|
+
ui_tree_too_large: "ui_tree_too_large";
|
|
59
|
+
unauthorized: "unauthorized";
|
|
60
|
+
unsupported_capability: "unsupported_capability";
|
|
61
|
+
workspace_active_sessions: "workspace_active_sessions";
|
|
62
|
+
workspace_dirty: "workspace_dirty";
|
|
63
|
+
workspace_unmerged: "workspace_unmerged";
|
|
64
|
+
}>;
|
|
65
|
+
message: z.ZodString;
|
|
66
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export type ErrorBody = z.infer<typeof ErrorBody>;
|
|
69
|
+
export declare const ApiError: z.ZodObject<{
|
|
70
|
+
error: z.ZodObject<{
|
|
71
|
+
code: z.ZodEnum<{
|
|
72
|
+
already_answered: "already_answered";
|
|
73
|
+
branch_invalid: "branch_invalid";
|
|
74
|
+
conflict: "conflict";
|
|
75
|
+
dependency_cycle: "dependency_cycle";
|
|
76
|
+
device_revoked: "device_revoked";
|
|
77
|
+
enrollment_expired: "enrollment_expired";
|
|
78
|
+
enrollment_used: "enrollment_used";
|
|
79
|
+
forbidden: "forbidden";
|
|
80
|
+
host_unreachable: "host_unreachable";
|
|
81
|
+
internal: "internal";
|
|
82
|
+
invalid_request: "invalid_request";
|
|
83
|
+
invalid_transition: "invalid_transition";
|
|
84
|
+
native_session_missing: "native_session_missing";
|
|
85
|
+
not_a_git_repo: "not_a_git_repo";
|
|
86
|
+
not_found: "not_found";
|
|
87
|
+
path_collision: "path_collision";
|
|
88
|
+
pi_incompatible: "pi_incompatible";
|
|
89
|
+
rate_limited: "rate_limited";
|
|
90
|
+
repo_mismatch: "repo_mismatch";
|
|
91
|
+
stale_control: "stale_control";
|
|
92
|
+
timeout: "timeout";
|
|
93
|
+
too_large: "too_large";
|
|
94
|
+
ui_tree_too_large: "ui_tree_too_large";
|
|
95
|
+
unauthorized: "unauthorized";
|
|
96
|
+
unsupported_capability: "unsupported_capability";
|
|
97
|
+
workspace_active_sessions: "workspace_active_sessions";
|
|
98
|
+
workspace_dirty: "workspace_dirty";
|
|
99
|
+
workspace_unmerged: "workspace_unmerged";
|
|
100
|
+
}>;
|
|
101
|
+
message: z.ZodString;
|
|
102
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export type ApiError = z.infer<typeof ApiError>;
|
|
106
|
+
/** Error carrying a protocol error code, thrown across package boundaries. */
|
|
107
|
+
export declare class SwitchyardError extends Error {
|
|
108
|
+
readonly code: ErrorCode;
|
|
109
|
+
readonly details?: unknown;
|
|
110
|
+
constructor(code: ErrorCode, message: string, details?: unknown);
|
|
111
|
+
toBody(): ErrorBody;
|
|
112
|
+
}
|
|
113
|
+
/** HTTP status for an error code. */
|
|
114
|
+
export declare function httpStatusFor(code: ErrorCode): number;
|
|
115
|
+
//# sourceMappingURL=errors.d.ts.map
|