@tarkahq/sdk 0.0.0-stage → 0.3.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.
Files changed (130) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +69 -0
  3. package/README.md +700 -2
  4. package/api-source.json +38 -0
  5. package/dist/cjs/client.d.ts +114 -0
  6. package/dist/cjs/client.js +174 -0
  7. package/dist/cjs/errors.d.ts +27 -0
  8. package/dist/cjs/errors.js +78 -0
  9. package/dist/cjs/generated/google/api/annotations.d.ts +1 -0
  10. package/dist/cjs/generated/google/api/annotations.js +10 -0
  11. package/dist/cjs/generated/google/api/http.d.ts +395 -0
  12. package/dist/cjs/generated/google/api/http.js +421 -0
  13. package/dist/cjs/generated/google/protobuf/descriptor.d.ts +873 -0
  14. package/dist/cjs/generated/google/protobuf/descriptor.js +3992 -0
  15. package/dist/cjs/generated/google/protobuf/empty.d.ts +35 -0
  16. package/dist/cjs/generated/google/protobuf/empty.js +58 -0
  17. package/dist/cjs/generated/google/protobuf/struct.d.ts +127 -0
  18. package/dist/cjs/generated/google/protobuf/struct.js +529 -0
  19. package/dist/cjs/generated/google/protobuf/timestamp.d.ts +128 -0
  20. package/dist/cjs/generated/google/protobuf/timestamp.js +95 -0
  21. package/dist/cjs/generated/protoc-gen-openapiv2/options/annotations.d.ts +1 -0
  22. package/dist/cjs/generated/protoc-gen-openapiv2/options/annotations.js +10 -0
  23. package/dist/cjs/generated/protoc-gen-openapiv2/options/openapiv2.d.ts +983 -0
  24. package/dist/cjs/generated/protoc-gen-openapiv2/options/openapiv2.js +4874 -0
  25. package/dist/cjs/generated/tarka/access/v1/access.d.ts +322 -0
  26. package/dist/cjs/generated/tarka/access/v1/access.js +2979 -0
  27. package/dist/cjs/generated/tarka/channels/v1/channels.d.ts +370 -0
  28. package/dist/cjs/generated/tarka/channels/v1/channels.js +3603 -0
  29. package/dist/cjs/generated/tarka/gateway/v1/gateway.d.ts +804 -0
  30. package/dist/cjs/generated/tarka/gateway/v1/gateway.js +8081 -0
  31. package/dist/cjs/generated/tarka/iam/v1/iam.d.ts +1291 -0
  32. package/dist/cjs/generated/tarka/iam/v1/iam.js +13207 -0
  33. package/dist/cjs/generated/tarka/inference/v1/inference.d.ts +699 -0
  34. package/dist/cjs/generated/tarka/inference/v1/inference.js +7058 -0
  35. package/dist/cjs/generated/tarka/provisioning/v1/agent_secrets.d.ts +70 -0
  36. package/dist/cjs/generated/tarka/provisioning/v1/agent_secrets.js +603 -0
  37. package/dist/cjs/generated/tarka/provisioning/v1/billing_quote.d.ts +171 -0
  38. package/dist/cjs/generated/tarka/provisioning/v1/billing_quote.js +1588 -0
  39. package/dist/cjs/generated/tarka/provisioning/v1/job.d.ts +168 -0
  40. package/dist/cjs/generated/tarka/provisioning/v1/job.js +1505 -0
  41. package/dist/cjs/generated/tarka/provisioning/v1/provisioning.d.ts +2644 -0
  42. package/dist/cjs/generated/tarka/provisioning/v1/provisioning.js +19501 -0
  43. package/dist/cjs/generated/tarka/provisioning/v1/registry_credentials.d.ts +89 -0
  44. package/dist/cjs/generated/tarka/provisioning/v1/registry_credentials.js +856 -0
  45. package/dist/cjs/generated/tarka/provisioning/v1/sandbox.d.ts +431 -0
  46. package/dist/cjs/generated/tarka/provisioning/v1/sandbox.js +3203 -0
  47. package/dist/cjs/generated/tarka/provisioning/v1/source_builds.d.ts +291 -0
  48. package/dist/cjs/generated/tarka/provisioning/v1/source_builds.js +3920 -0
  49. package/dist/cjs/grpc.d.ts +12 -0
  50. package/dist/cjs/grpc.js +55 -0
  51. package/dist/cjs/index.d.ts +6 -0
  52. package/dist/cjs/index.js +21 -0
  53. package/dist/cjs/package.json +1 -0
  54. package/dist/cjs/resources/inference.d.ts +293 -0
  55. package/dist/cjs/resources/inference.js +451 -0
  56. package/dist/cjs/resources/provisioning.d.ts +389 -0
  57. package/dist/cjs/resources/provisioning.js +552 -0
  58. package/dist/cjs/resources/sandboxes.d.ts +360 -0
  59. package/dist/cjs/resources/sandboxes.js +732 -0
  60. package/dist/cjs/rpc-types.d.ts +36 -0
  61. package/dist/cjs/rpc-types.js +29 -0
  62. package/dist/cjs/runtime.d.ts +99 -0
  63. package/dist/cjs/runtime.js +473 -0
  64. package/dist/cjs/transport.d.ts +60 -0
  65. package/dist/cjs/transport.js +114 -0
  66. package/dist/cjs/types.d.ts +309 -0
  67. package/dist/cjs/types.js +2 -0
  68. package/dist/esm/client.d.ts +114 -0
  69. package/dist/esm/client.js +169 -0
  70. package/dist/esm/errors.d.ts +27 -0
  71. package/dist/esm/errors.js +71 -0
  72. package/dist/esm/generated/google/api/annotations.d.ts +1 -0
  73. package/dist/esm/generated/google/api/annotations.js +7 -0
  74. package/dist/esm/generated/google/api/http.d.ts +395 -0
  75. package/dist/esm/generated/google/api/http.js +418 -0
  76. package/dist/esm/generated/google/protobuf/descriptor.d.ts +873 -0
  77. package/dist/esm/generated/google/protobuf/descriptor.js +3977 -0
  78. package/dist/esm/generated/google/protobuf/empty.d.ts +35 -0
  79. package/dist/esm/generated/google/protobuf/empty.js +55 -0
  80. package/dist/esm/generated/google/protobuf/struct.d.ts +127 -0
  81. package/dist/esm/generated/google/protobuf/struct.js +524 -0
  82. package/dist/esm/generated/google/protobuf/timestamp.d.ts +128 -0
  83. package/dist/esm/generated/google/protobuf/timestamp.js +92 -0
  84. package/dist/esm/generated/protoc-gen-openapiv2/options/annotations.d.ts +1 -0
  85. package/dist/esm/generated/protoc-gen-openapiv2/options/annotations.js +7 -0
  86. package/dist/esm/generated/protoc-gen-openapiv2/options/openapiv2.d.ts +983 -0
  87. package/dist/esm/generated/protoc-gen-openapiv2/options/openapiv2.js +4859 -0
  88. package/dist/esm/generated/tarka/access/v1/access.d.ts +322 -0
  89. package/dist/esm/generated/tarka/access/v1/access.js +2976 -0
  90. package/dist/esm/generated/tarka/channels/v1/channels.d.ts +370 -0
  91. package/dist/esm/generated/tarka/channels/v1/channels.js +3600 -0
  92. package/dist/esm/generated/tarka/gateway/v1/gateway.d.ts +804 -0
  93. package/dist/esm/generated/tarka/gateway/v1/gateway.js +8077 -0
  94. package/dist/esm/generated/tarka/iam/v1/iam.d.ts +1291 -0
  95. package/dist/esm/generated/tarka/iam/v1/iam.js +13203 -0
  96. package/dist/esm/generated/tarka/inference/v1/inference.d.ts +699 -0
  97. package/dist/esm/generated/tarka/inference/v1/inference.js +7055 -0
  98. package/dist/esm/generated/tarka/provisioning/v1/agent_secrets.d.ts +70 -0
  99. package/dist/esm/generated/tarka/provisioning/v1/agent_secrets.js +600 -0
  100. package/dist/esm/generated/tarka/provisioning/v1/billing_quote.d.ts +171 -0
  101. package/dist/esm/generated/tarka/provisioning/v1/billing_quote.js +1585 -0
  102. package/dist/esm/generated/tarka/provisioning/v1/job.d.ts +168 -0
  103. package/dist/esm/generated/tarka/provisioning/v1/job.js +1500 -0
  104. package/dist/esm/generated/tarka/provisioning/v1/provisioning.d.ts +2644 -0
  105. package/dist/esm/generated/tarka/provisioning/v1/provisioning.js +19496 -0
  106. package/dist/esm/generated/tarka/provisioning/v1/registry_credentials.d.ts +89 -0
  107. package/dist/esm/generated/tarka/provisioning/v1/registry_credentials.js +853 -0
  108. package/dist/esm/generated/tarka/provisioning/v1/sandbox.d.ts +431 -0
  109. package/dist/esm/generated/tarka/provisioning/v1/sandbox.js +3192 -0
  110. package/dist/esm/generated/tarka/provisioning/v1/source_builds.d.ts +291 -0
  111. package/dist/esm/generated/tarka/provisioning/v1/source_builds.js +3917 -0
  112. package/dist/esm/grpc.d.ts +12 -0
  113. package/dist/esm/grpc.js +11 -0
  114. package/dist/esm/index.d.ts +6 -0
  115. package/dist/esm/index.js +4 -0
  116. package/dist/esm/resources/inference.d.ts +293 -0
  117. package/dist/esm/resources/inference.js +437 -0
  118. package/dist/esm/resources/provisioning.d.ts +389 -0
  119. package/dist/esm/resources/provisioning.js +531 -0
  120. package/dist/esm/resources/sandboxes.d.ts +360 -0
  121. package/dist/esm/resources/sandboxes.js +718 -0
  122. package/dist/esm/rpc-types.d.ts +36 -0
  123. package/dist/esm/rpc-types.js +26 -0
  124. package/dist/esm/runtime.d.ts +99 -0
  125. package/dist/esm/runtime.js +466 -0
  126. package/dist/esm/transport.d.ts +60 -0
  127. package/dist/esm/transport.js +110 -0
  128. package/dist/esm/types.d.ts +309 -0
  129. package/dist/esm/types.js +1 -0
  130. package/package.json +155 -4
@@ -0,0 +1,3192 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.4
4
+ // protoc v3.19.1
5
+ // source: tarka/provisioning/v1/sandbox.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { Timestamp } from "../../../google/protobuf/timestamp.js";
9
+ import { JobResources } from "./job.js";
10
+ export const protobufPackage = "tarka.provisioning.v1";
11
+ /** SandboxRuntime is a supported source-code runtime family. */
12
+ export var SandboxRuntime;
13
+ (function (SandboxRuntime) {
14
+ /** SANDBOX_RUNTIME_UNSPECIFIED - SANDBOX_RUNTIME_UNSPECIFIED is invalid for creation. */
15
+ SandboxRuntime[SandboxRuntime["SANDBOX_RUNTIME_UNSPECIFIED"] = 0] = "SANDBOX_RUNTIME_UNSPECIFIED";
16
+ SandboxRuntime[SandboxRuntime["SANDBOX_RUNTIME_PYTHON"] = 1] = "SANDBOX_RUNTIME_PYTHON";
17
+ SandboxRuntime[SandboxRuntime["SANDBOX_RUNTIME_NODE"] = 2] = "SANDBOX_RUNTIME_NODE";
18
+ SandboxRuntime[SandboxRuntime["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
19
+ })(SandboxRuntime || (SandboxRuntime = {}));
20
+ export function sandboxRuntimeFromJSON(object) {
21
+ switch (object) {
22
+ case 0:
23
+ case "SANDBOX_RUNTIME_UNSPECIFIED":
24
+ return SandboxRuntime.SANDBOX_RUNTIME_UNSPECIFIED;
25
+ case 1:
26
+ case "SANDBOX_RUNTIME_PYTHON":
27
+ return SandboxRuntime.SANDBOX_RUNTIME_PYTHON;
28
+ case 2:
29
+ case "SANDBOX_RUNTIME_NODE":
30
+ return SandboxRuntime.SANDBOX_RUNTIME_NODE;
31
+ case -1:
32
+ case "UNRECOGNIZED":
33
+ default:
34
+ return SandboxRuntime.UNRECOGNIZED;
35
+ }
36
+ }
37
+ export function sandboxRuntimeToJSON(object) {
38
+ switch (object) {
39
+ case SandboxRuntime.SANDBOX_RUNTIME_UNSPECIFIED:
40
+ return "SANDBOX_RUNTIME_UNSPECIFIED";
41
+ case SandboxRuntime.SANDBOX_RUNTIME_PYTHON:
42
+ return "SANDBOX_RUNTIME_PYTHON";
43
+ case SandboxRuntime.SANDBOX_RUNTIME_NODE:
44
+ return "SANDBOX_RUNTIME_NODE";
45
+ case SandboxRuntime.UNRECOGNIZED:
46
+ default:
47
+ return "UNRECOGNIZED";
48
+ }
49
+ }
50
+ /** SandboxTemplateStatus is the lifecycle of a reusable sandbox template. */
51
+ export var SandboxTemplateStatus;
52
+ (function (SandboxTemplateStatus) {
53
+ SandboxTemplateStatus[SandboxTemplateStatus["SANDBOX_TEMPLATE_STATUS_UNSPECIFIED"] = 0] = "SANDBOX_TEMPLATE_STATUS_UNSPECIFIED";
54
+ SandboxTemplateStatus[SandboxTemplateStatus["SANDBOX_TEMPLATE_STATUS_PENDING"] = 1] = "SANDBOX_TEMPLATE_STATUS_PENDING";
55
+ SandboxTemplateStatus[SandboxTemplateStatus["SANDBOX_TEMPLATE_STATUS_BUILDING"] = 2] = "SANDBOX_TEMPLATE_STATUS_BUILDING";
56
+ SandboxTemplateStatus[SandboxTemplateStatus["SANDBOX_TEMPLATE_STATUS_READY"] = 3] = "SANDBOX_TEMPLATE_STATUS_READY";
57
+ SandboxTemplateStatus[SandboxTemplateStatus["SANDBOX_TEMPLATE_STATUS_FAILED"] = 4] = "SANDBOX_TEMPLATE_STATUS_FAILED";
58
+ SandboxTemplateStatus[SandboxTemplateStatus["SANDBOX_TEMPLATE_STATUS_DELETING"] = 5] = "SANDBOX_TEMPLATE_STATUS_DELETING";
59
+ SandboxTemplateStatus[SandboxTemplateStatus["SANDBOX_TEMPLATE_STATUS_DELETED"] = 6] = "SANDBOX_TEMPLATE_STATUS_DELETED";
60
+ SandboxTemplateStatus[SandboxTemplateStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
61
+ })(SandboxTemplateStatus || (SandboxTemplateStatus = {}));
62
+ export function sandboxTemplateStatusFromJSON(object) {
63
+ switch (object) {
64
+ case 0:
65
+ case "SANDBOX_TEMPLATE_STATUS_UNSPECIFIED":
66
+ return SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_UNSPECIFIED;
67
+ case 1:
68
+ case "SANDBOX_TEMPLATE_STATUS_PENDING":
69
+ return SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_PENDING;
70
+ case 2:
71
+ case "SANDBOX_TEMPLATE_STATUS_BUILDING":
72
+ return SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_BUILDING;
73
+ case 3:
74
+ case "SANDBOX_TEMPLATE_STATUS_READY":
75
+ return SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_READY;
76
+ case 4:
77
+ case "SANDBOX_TEMPLATE_STATUS_FAILED":
78
+ return SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_FAILED;
79
+ case 5:
80
+ case "SANDBOX_TEMPLATE_STATUS_DELETING":
81
+ return SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_DELETING;
82
+ case 6:
83
+ case "SANDBOX_TEMPLATE_STATUS_DELETED":
84
+ return SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_DELETED;
85
+ case -1:
86
+ case "UNRECOGNIZED":
87
+ default:
88
+ return SandboxTemplateStatus.UNRECOGNIZED;
89
+ }
90
+ }
91
+ export function sandboxTemplateStatusToJSON(object) {
92
+ switch (object) {
93
+ case SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_UNSPECIFIED:
94
+ return "SANDBOX_TEMPLATE_STATUS_UNSPECIFIED";
95
+ case SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_PENDING:
96
+ return "SANDBOX_TEMPLATE_STATUS_PENDING";
97
+ case SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_BUILDING:
98
+ return "SANDBOX_TEMPLATE_STATUS_BUILDING";
99
+ case SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_READY:
100
+ return "SANDBOX_TEMPLATE_STATUS_READY";
101
+ case SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_FAILED:
102
+ return "SANDBOX_TEMPLATE_STATUS_FAILED";
103
+ case SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_DELETING:
104
+ return "SANDBOX_TEMPLATE_STATUS_DELETING";
105
+ case SandboxTemplateStatus.SANDBOX_TEMPLATE_STATUS_DELETED:
106
+ return "SANDBOX_TEMPLATE_STATUS_DELETED";
107
+ case SandboxTemplateStatus.UNRECOGNIZED:
108
+ default:
109
+ return "UNRECOGNIZED";
110
+ }
111
+ }
112
+ /** CodeSandboxStatus is the lifecycle of an isolated sandbox instance. */
113
+ export var CodeSandboxStatus;
114
+ (function (CodeSandboxStatus) {
115
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_UNSPECIFIED"] = 0] = "CODE_SANDBOX_STATUS_UNSPECIFIED";
116
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_STARTING"] = 1] = "CODE_SANDBOX_STATUS_STARTING";
117
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_READY"] = 2] = "CODE_SANDBOX_STATUS_READY";
118
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_BUSY"] = 3] = "CODE_SANDBOX_STATUS_BUSY";
119
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_STOPPING"] = 4] = "CODE_SANDBOX_STATUS_STOPPING";
120
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_STOPPED"] = 5] = "CODE_SANDBOX_STATUS_STOPPED";
121
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_FAILED"] = 6] = "CODE_SANDBOX_STATUS_FAILED";
122
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_EXPIRED"] = 7] = "CODE_SANDBOX_STATUS_EXPIRED";
123
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_DELETED"] = 8] = "CODE_SANDBOX_STATUS_DELETED";
124
+ /**
125
+ * CODE_SANDBOX_STATUS_QUEUED - Capacity has been reserved but the runtime is not ready. Queue/setup time
126
+ * does not consume the requested sandbox lifetime or incur compute usage.
127
+ */
128
+ CodeSandboxStatus[CodeSandboxStatus["CODE_SANDBOX_STATUS_QUEUED"] = 9] = "CODE_SANDBOX_STATUS_QUEUED";
129
+ CodeSandboxStatus[CodeSandboxStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
130
+ })(CodeSandboxStatus || (CodeSandboxStatus = {}));
131
+ export function codeSandboxStatusFromJSON(object) {
132
+ switch (object) {
133
+ case 0:
134
+ case "CODE_SANDBOX_STATUS_UNSPECIFIED":
135
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_UNSPECIFIED;
136
+ case 1:
137
+ case "CODE_SANDBOX_STATUS_STARTING":
138
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_STARTING;
139
+ case 2:
140
+ case "CODE_SANDBOX_STATUS_READY":
141
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_READY;
142
+ case 3:
143
+ case "CODE_SANDBOX_STATUS_BUSY":
144
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_BUSY;
145
+ case 4:
146
+ case "CODE_SANDBOX_STATUS_STOPPING":
147
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_STOPPING;
148
+ case 5:
149
+ case "CODE_SANDBOX_STATUS_STOPPED":
150
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_STOPPED;
151
+ case 6:
152
+ case "CODE_SANDBOX_STATUS_FAILED":
153
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_FAILED;
154
+ case 7:
155
+ case "CODE_SANDBOX_STATUS_EXPIRED":
156
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_EXPIRED;
157
+ case 8:
158
+ case "CODE_SANDBOX_STATUS_DELETED":
159
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_DELETED;
160
+ case 9:
161
+ case "CODE_SANDBOX_STATUS_QUEUED":
162
+ return CodeSandboxStatus.CODE_SANDBOX_STATUS_QUEUED;
163
+ case -1:
164
+ case "UNRECOGNIZED":
165
+ default:
166
+ return CodeSandboxStatus.UNRECOGNIZED;
167
+ }
168
+ }
169
+ export function codeSandboxStatusToJSON(object) {
170
+ switch (object) {
171
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_UNSPECIFIED:
172
+ return "CODE_SANDBOX_STATUS_UNSPECIFIED";
173
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_STARTING:
174
+ return "CODE_SANDBOX_STATUS_STARTING";
175
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_READY:
176
+ return "CODE_SANDBOX_STATUS_READY";
177
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_BUSY:
178
+ return "CODE_SANDBOX_STATUS_BUSY";
179
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_STOPPING:
180
+ return "CODE_SANDBOX_STATUS_STOPPING";
181
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_STOPPED:
182
+ return "CODE_SANDBOX_STATUS_STOPPED";
183
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_FAILED:
184
+ return "CODE_SANDBOX_STATUS_FAILED";
185
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_EXPIRED:
186
+ return "CODE_SANDBOX_STATUS_EXPIRED";
187
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_DELETED:
188
+ return "CODE_SANDBOX_STATUS_DELETED";
189
+ case CodeSandboxStatus.CODE_SANDBOX_STATUS_QUEUED:
190
+ return "CODE_SANDBOX_STATUS_QUEUED";
191
+ case CodeSandboxStatus.UNRECOGNIZED:
192
+ default:
193
+ return "UNRECOGNIZED";
194
+ }
195
+ }
196
+ /** ExecutionStatus is the terminal or in-progress state of one execution. */
197
+ export var ExecutionStatus;
198
+ (function (ExecutionStatus) {
199
+ ExecutionStatus[ExecutionStatus["EXECUTION_STATUS_UNSPECIFIED"] = 0] = "EXECUTION_STATUS_UNSPECIFIED";
200
+ ExecutionStatus[ExecutionStatus["EXECUTION_STATUS_RUNNING"] = 1] = "EXECUTION_STATUS_RUNNING";
201
+ ExecutionStatus[ExecutionStatus["EXECUTION_STATUS_SUCCEEDED"] = 2] = "EXECUTION_STATUS_SUCCEEDED";
202
+ ExecutionStatus[ExecutionStatus["EXECUTION_STATUS_FAILED"] = 3] = "EXECUTION_STATUS_FAILED";
203
+ ExecutionStatus[ExecutionStatus["EXECUTION_STATUS_TIMED_OUT"] = 4] = "EXECUTION_STATUS_TIMED_OUT";
204
+ ExecutionStatus[ExecutionStatus["EXECUTION_STATUS_CANCELLED"] = 5] = "EXECUTION_STATUS_CANCELLED";
205
+ ExecutionStatus[ExecutionStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
206
+ })(ExecutionStatus || (ExecutionStatus = {}));
207
+ export function executionStatusFromJSON(object) {
208
+ switch (object) {
209
+ case 0:
210
+ case "EXECUTION_STATUS_UNSPECIFIED":
211
+ return ExecutionStatus.EXECUTION_STATUS_UNSPECIFIED;
212
+ case 1:
213
+ case "EXECUTION_STATUS_RUNNING":
214
+ return ExecutionStatus.EXECUTION_STATUS_RUNNING;
215
+ case 2:
216
+ case "EXECUTION_STATUS_SUCCEEDED":
217
+ return ExecutionStatus.EXECUTION_STATUS_SUCCEEDED;
218
+ case 3:
219
+ case "EXECUTION_STATUS_FAILED":
220
+ return ExecutionStatus.EXECUTION_STATUS_FAILED;
221
+ case 4:
222
+ case "EXECUTION_STATUS_TIMED_OUT":
223
+ return ExecutionStatus.EXECUTION_STATUS_TIMED_OUT;
224
+ case 5:
225
+ case "EXECUTION_STATUS_CANCELLED":
226
+ return ExecutionStatus.EXECUTION_STATUS_CANCELLED;
227
+ case -1:
228
+ case "UNRECOGNIZED":
229
+ default:
230
+ return ExecutionStatus.UNRECOGNIZED;
231
+ }
232
+ }
233
+ export function executionStatusToJSON(object) {
234
+ switch (object) {
235
+ case ExecutionStatus.EXECUTION_STATUS_UNSPECIFIED:
236
+ return "EXECUTION_STATUS_UNSPECIFIED";
237
+ case ExecutionStatus.EXECUTION_STATUS_RUNNING:
238
+ return "EXECUTION_STATUS_RUNNING";
239
+ case ExecutionStatus.EXECUTION_STATUS_SUCCEEDED:
240
+ return "EXECUTION_STATUS_SUCCEEDED";
241
+ case ExecutionStatus.EXECUTION_STATUS_FAILED:
242
+ return "EXECUTION_STATUS_FAILED";
243
+ case ExecutionStatus.EXECUTION_STATUS_TIMED_OUT:
244
+ return "EXECUTION_STATUS_TIMED_OUT";
245
+ case ExecutionStatus.EXECUTION_STATUS_CANCELLED:
246
+ return "EXECUTION_STATUS_CANCELLED";
247
+ case ExecutionStatus.UNRECOGNIZED:
248
+ default:
249
+ return "UNRECOGNIZED";
250
+ }
251
+ }
252
+ function createBaseSandboxTemplate() {
253
+ return {
254
+ id: "",
255
+ orgId: "",
256
+ alias: "",
257
+ displayName: "",
258
+ runtime: 0,
259
+ runtimeVersion: "",
260
+ baseTemplateAlias: "",
261
+ isBuiltin: false,
262
+ status: 0,
263
+ dependencyFileType: "",
264
+ dependencyManifestSha256: "",
265
+ imageDigest: "",
266
+ buildErrorCode: "",
267
+ createdAt: undefined,
268
+ updatedAt: undefined,
269
+ };
270
+ }
271
+ export const SandboxTemplate = {
272
+ encode(message, writer = new BinaryWriter()) {
273
+ if (message.id !== "") {
274
+ writer.uint32(10).string(message.id);
275
+ }
276
+ if (message.orgId !== "") {
277
+ writer.uint32(18).string(message.orgId);
278
+ }
279
+ if (message.alias !== "") {
280
+ writer.uint32(26).string(message.alias);
281
+ }
282
+ if (message.displayName !== "") {
283
+ writer.uint32(34).string(message.displayName);
284
+ }
285
+ if (message.runtime !== 0) {
286
+ writer.uint32(40).int32(message.runtime);
287
+ }
288
+ if (message.runtimeVersion !== "") {
289
+ writer.uint32(50).string(message.runtimeVersion);
290
+ }
291
+ if (message.baseTemplateAlias !== "") {
292
+ writer.uint32(58).string(message.baseTemplateAlias);
293
+ }
294
+ if (message.isBuiltin !== false) {
295
+ writer.uint32(64).bool(message.isBuiltin);
296
+ }
297
+ if (message.status !== 0) {
298
+ writer.uint32(72).int32(message.status);
299
+ }
300
+ if (message.dependencyFileType !== "") {
301
+ writer.uint32(82).string(message.dependencyFileType);
302
+ }
303
+ if (message.dependencyManifestSha256 !== "") {
304
+ writer.uint32(90).string(message.dependencyManifestSha256);
305
+ }
306
+ if (message.imageDigest !== "") {
307
+ writer.uint32(98).string(message.imageDigest);
308
+ }
309
+ if (message.buildErrorCode !== "") {
310
+ writer.uint32(106).string(message.buildErrorCode);
311
+ }
312
+ if (message.createdAt !== undefined) {
313
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(114).fork()).join();
314
+ }
315
+ if (message.updatedAt !== undefined) {
316
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(122).fork()).join();
317
+ }
318
+ return writer;
319
+ },
320
+ decode(input, length) {
321
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
322
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
323
+ if (previousRecursionDepth >= 100) {
324
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
325
+ }
326
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
327
+ try {
328
+ const end = length === undefined ? reader.len : reader.pos + length;
329
+ const message = createBaseSandboxTemplate();
330
+ while (reader.pos < end) {
331
+ const tag = reader.uint32();
332
+ switch (tag >>> 3) {
333
+ case 1: {
334
+ if (tag !== 10) {
335
+ break;
336
+ }
337
+ message.id = reader.string();
338
+ continue;
339
+ }
340
+ case 2: {
341
+ if (tag !== 18) {
342
+ break;
343
+ }
344
+ message.orgId = reader.string();
345
+ continue;
346
+ }
347
+ case 3: {
348
+ if (tag !== 26) {
349
+ break;
350
+ }
351
+ message.alias = reader.string();
352
+ continue;
353
+ }
354
+ case 4: {
355
+ if (tag !== 34) {
356
+ break;
357
+ }
358
+ message.displayName = reader.string();
359
+ continue;
360
+ }
361
+ case 5: {
362
+ if (tag !== 40) {
363
+ break;
364
+ }
365
+ message.runtime = reader.int32();
366
+ continue;
367
+ }
368
+ case 6: {
369
+ if (tag !== 50) {
370
+ break;
371
+ }
372
+ message.runtimeVersion = reader.string();
373
+ continue;
374
+ }
375
+ case 7: {
376
+ if (tag !== 58) {
377
+ break;
378
+ }
379
+ message.baseTemplateAlias = reader.string();
380
+ continue;
381
+ }
382
+ case 8: {
383
+ if (tag !== 64) {
384
+ break;
385
+ }
386
+ message.isBuiltin = reader.bool();
387
+ continue;
388
+ }
389
+ case 9: {
390
+ if (tag !== 72) {
391
+ break;
392
+ }
393
+ message.status = reader.int32();
394
+ continue;
395
+ }
396
+ case 10: {
397
+ if (tag !== 82) {
398
+ break;
399
+ }
400
+ message.dependencyFileType = reader.string();
401
+ continue;
402
+ }
403
+ case 11: {
404
+ if (tag !== 90) {
405
+ break;
406
+ }
407
+ message.dependencyManifestSha256 = reader.string();
408
+ continue;
409
+ }
410
+ case 12: {
411
+ if (tag !== 98) {
412
+ break;
413
+ }
414
+ message.imageDigest = reader.string();
415
+ continue;
416
+ }
417
+ case 13: {
418
+ if (tag !== 106) {
419
+ break;
420
+ }
421
+ message.buildErrorCode = reader.string();
422
+ continue;
423
+ }
424
+ case 14: {
425
+ if (tag !== 114) {
426
+ break;
427
+ }
428
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
429
+ continue;
430
+ }
431
+ case 15: {
432
+ if (tag !== 122) {
433
+ break;
434
+ }
435
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
436
+ continue;
437
+ }
438
+ }
439
+ if ((tag & 7) === 4 || tag === 0) {
440
+ break;
441
+ }
442
+ reader.skip(tag & 7);
443
+ }
444
+ return message;
445
+ }
446
+ finally {
447
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
448
+ }
449
+ },
450
+ fromJSON(object) {
451
+ return {
452
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
453
+ orgId: isSet(object.orgId)
454
+ ? globalThis.String(object.orgId)
455
+ : isSet(object.org_id)
456
+ ? globalThis.String(object.org_id)
457
+ : "",
458
+ alias: isSet(object.alias) ? globalThis.String(object.alias) : "",
459
+ displayName: isSet(object.displayName)
460
+ ? globalThis.String(object.displayName)
461
+ : isSet(object.display_name)
462
+ ? globalThis.String(object.display_name)
463
+ : "",
464
+ runtime: isSet(object.runtime) ? sandboxRuntimeFromJSON(object.runtime) : 0,
465
+ runtimeVersion: isSet(object.runtimeVersion)
466
+ ? globalThis.String(object.runtimeVersion)
467
+ : isSet(object.runtime_version)
468
+ ? globalThis.String(object.runtime_version)
469
+ : "",
470
+ baseTemplateAlias: isSet(object.baseTemplateAlias)
471
+ ? globalThis.String(object.baseTemplateAlias)
472
+ : isSet(object.base_template_alias)
473
+ ? globalThis.String(object.base_template_alias)
474
+ : "",
475
+ isBuiltin: isSet(object.isBuiltin)
476
+ ? globalThis.Boolean(object.isBuiltin)
477
+ : isSet(object.is_builtin)
478
+ ? globalThis.Boolean(object.is_builtin)
479
+ : false,
480
+ status: isSet(object.status) ? sandboxTemplateStatusFromJSON(object.status) : 0,
481
+ dependencyFileType: isSet(object.dependencyFileType)
482
+ ? globalThis.String(object.dependencyFileType)
483
+ : isSet(object.dependency_file_type)
484
+ ? globalThis.String(object.dependency_file_type)
485
+ : "",
486
+ dependencyManifestSha256: isSet(object.dependencyManifestSha256)
487
+ ? globalThis.String(object.dependencyManifestSha256)
488
+ : isSet(object.dependency_manifest_sha256)
489
+ ? globalThis.String(object.dependency_manifest_sha256)
490
+ : "",
491
+ imageDigest: isSet(object.imageDigest)
492
+ ? globalThis.String(object.imageDigest)
493
+ : isSet(object.image_digest)
494
+ ? globalThis.String(object.image_digest)
495
+ : "",
496
+ buildErrorCode: isSet(object.buildErrorCode)
497
+ ? globalThis.String(object.buildErrorCode)
498
+ : isSet(object.build_error_code)
499
+ ? globalThis.String(object.build_error_code)
500
+ : "",
501
+ createdAt: isSet(object.createdAt)
502
+ ? fromJsonTimestamp(object.createdAt)
503
+ : isSet(object.created_at)
504
+ ? fromJsonTimestamp(object.created_at)
505
+ : undefined,
506
+ updatedAt: isSet(object.updatedAt)
507
+ ? fromJsonTimestamp(object.updatedAt)
508
+ : isSet(object.updated_at)
509
+ ? fromJsonTimestamp(object.updated_at)
510
+ : undefined,
511
+ };
512
+ },
513
+ toJSON(message) {
514
+ const obj = {};
515
+ if (message.id !== "") {
516
+ obj.id = message.id;
517
+ }
518
+ if (message.orgId !== "") {
519
+ obj.orgId = message.orgId;
520
+ }
521
+ if (message.alias !== "") {
522
+ obj.alias = message.alias;
523
+ }
524
+ if (message.displayName !== "") {
525
+ obj.displayName = message.displayName;
526
+ }
527
+ if (message.runtime !== 0) {
528
+ obj.runtime = sandboxRuntimeToJSON(message.runtime);
529
+ }
530
+ if (message.runtimeVersion !== "") {
531
+ obj.runtimeVersion = message.runtimeVersion;
532
+ }
533
+ if (message.baseTemplateAlias !== "") {
534
+ obj.baseTemplateAlias = message.baseTemplateAlias;
535
+ }
536
+ if (message.isBuiltin !== false) {
537
+ obj.isBuiltin = message.isBuiltin;
538
+ }
539
+ if (message.status !== 0) {
540
+ obj.status = sandboxTemplateStatusToJSON(message.status);
541
+ }
542
+ if (message.dependencyFileType !== "") {
543
+ obj.dependencyFileType = message.dependencyFileType;
544
+ }
545
+ if (message.dependencyManifestSha256 !== "") {
546
+ obj.dependencyManifestSha256 = message.dependencyManifestSha256;
547
+ }
548
+ if (message.imageDigest !== "") {
549
+ obj.imageDigest = message.imageDigest;
550
+ }
551
+ if (message.buildErrorCode !== "") {
552
+ obj.buildErrorCode = message.buildErrorCode;
553
+ }
554
+ if (message.createdAt !== undefined) {
555
+ obj.createdAt = message.createdAt.toISOString();
556
+ }
557
+ if (message.updatedAt !== undefined) {
558
+ obj.updatedAt = message.updatedAt.toISOString();
559
+ }
560
+ return obj;
561
+ },
562
+ create(base) {
563
+ return SandboxTemplate.fromPartial(base ?? {});
564
+ },
565
+ fromPartial(object) {
566
+ const message = createBaseSandboxTemplate();
567
+ message.id = object.id ?? "";
568
+ message.orgId = object.orgId ?? "";
569
+ message.alias = object.alias ?? "";
570
+ message.displayName = object.displayName ?? "";
571
+ message.runtime = object.runtime ?? 0;
572
+ message.runtimeVersion = object.runtimeVersion ?? "";
573
+ message.baseTemplateAlias = object.baseTemplateAlias ?? "";
574
+ message.isBuiltin = object.isBuiltin ?? false;
575
+ message.status = object.status ?? 0;
576
+ message.dependencyFileType = object.dependencyFileType ?? "";
577
+ message.dependencyManifestSha256 = object.dependencyManifestSha256 ?? "";
578
+ message.imageDigest = object.imageDigest ?? "";
579
+ message.buildErrorCode = object.buildErrorCode ?? "";
580
+ message.createdAt = object.createdAt ?? undefined;
581
+ message.updatedAt = object.updatedAt ?? undefined;
582
+ return message;
583
+ },
584
+ };
585
+ function createBaseListSandboxTemplatesRequest() {
586
+ return { orgId: "" };
587
+ }
588
+ export const ListSandboxTemplatesRequest = {
589
+ encode(message, writer = new BinaryWriter()) {
590
+ if (message.orgId !== "") {
591
+ writer.uint32(10).string(message.orgId);
592
+ }
593
+ return writer;
594
+ },
595
+ decode(input, length) {
596
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
597
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
598
+ if (previousRecursionDepth >= 100) {
599
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
600
+ }
601
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
602
+ try {
603
+ const end = length === undefined ? reader.len : reader.pos + length;
604
+ const message = createBaseListSandboxTemplatesRequest();
605
+ while (reader.pos < end) {
606
+ const tag = reader.uint32();
607
+ switch (tag >>> 3) {
608
+ case 1: {
609
+ if (tag !== 10) {
610
+ break;
611
+ }
612
+ message.orgId = reader.string();
613
+ continue;
614
+ }
615
+ }
616
+ if ((tag & 7) === 4 || tag === 0) {
617
+ break;
618
+ }
619
+ reader.skip(tag & 7);
620
+ }
621
+ return message;
622
+ }
623
+ finally {
624
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
625
+ }
626
+ },
627
+ fromJSON(object) {
628
+ return {
629
+ orgId: isSet(object.orgId)
630
+ ? globalThis.String(object.orgId)
631
+ : isSet(object.org_id)
632
+ ? globalThis.String(object.org_id)
633
+ : "",
634
+ };
635
+ },
636
+ toJSON(message) {
637
+ const obj = {};
638
+ if (message.orgId !== "") {
639
+ obj.orgId = message.orgId;
640
+ }
641
+ return obj;
642
+ },
643
+ create(base) {
644
+ return ListSandboxTemplatesRequest.fromPartial(base ?? {});
645
+ },
646
+ fromPartial(object) {
647
+ const message = createBaseListSandboxTemplatesRequest();
648
+ message.orgId = object.orgId ?? "";
649
+ return message;
650
+ },
651
+ };
652
+ function createBaseListSandboxTemplatesResponse() {
653
+ return { templates: [] };
654
+ }
655
+ export const ListSandboxTemplatesResponse = {
656
+ encode(message, writer = new BinaryWriter()) {
657
+ for (const v of message.templates) {
658
+ SandboxTemplate.encode(v, writer.uint32(10).fork()).join();
659
+ }
660
+ return writer;
661
+ },
662
+ decode(input, length) {
663
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
664
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
665
+ if (previousRecursionDepth >= 100) {
666
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
667
+ }
668
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
669
+ try {
670
+ const end = length === undefined ? reader.len : reader.pos + length;
671
+ const message = createBaseListSandboxTemplatesResponse();
672
+ while (reader.pos < end) {
673
+ const tag = reader.uint32();
674
+ switch (tag >>> 3) {
675
+ case 1: {
676
+ if (tag !== 10) {
677
+ break;
678
+ }
679
+ message.templates.push(SandboxTemplate.decode(reader, reader.uint32()));
680
+ continue;
681
+ }
682
+ }
683
+ if ((tag & 7) === 4 || tag === 0) {
684
+ break;
685
+ }
686
+ reader.skip(tag & 7);
687
+ }
688
+ return message;
689
+ }
690
+ finally {
691
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
692
+ }
693
+ },
694
+ fromJSON(object) {
695
+ return {
696
+ templates: globalThis.Array.isArray(object?.templates)
697
+ ? object.templates.map((e) => SandboxTemplate.fromJSON(e))
698
+ : [],
699
+ };
700
+ },
701
+ toJSON(message) {
702
+ const obj = {};
703
+ if (message.templates?.length) {
704
+ obj.templates = message.templates.map((e) => SandboxTemplate.toJSON(e));
705
+ }
706
+ return obj;
707
+ },
708
+ create(base) {
709
+ return ListSandboxTemplatesResponse.fromPartial(base ?? {});
710
+ },
711
+ fromPartial(object) {
712
+ const message = createBaseListSandboxTemplatesResponse();
713
+ message.templates = object.templates?.map((e) => SandboxTemplate.fromPartial(e)) || [];
714
+ return message;
715
+ },
716
+ };
717
+ function createBaseCreateSandboxTemplateRequest() {
718
+ return {
719
+ orgId: "",
720
+ alias: "",
721
+ displayName: "",
722
+ baseTemplateAlias: "",
723
+ dependencyFile: undefined,
724
+ idempotencyKey: "",
725
+ };
726
+ }
727
+ export const CreateSandboxTemplateRequest = {
728
+ encode(message, writer = new BinaryWriter()) {
729
+ if (message.orgId !== "") {
730
+ writer.uint32(10).string(message.orgId);
731
+ }
732
+ if (message.alias !== "") {
733
+ writer.uint32(18).string(message.alias);
734
+ }
735
+ if (message.displayName !== "") {
736
+ writer.uint32(26).string(message.displayName);
737
+ }
738
+ if (message.baseTemplateAlias !== "") {
739
+ writer.uint32(34).string(message.baseTemplateAlias);
740
+ }
741
+ switch (message.dependencyFile?.$case) {
742
+ case "requirementsTxt":
743
+ writer.uint32(42).string(message.dependencyFile.value);
744
+ break;
745
+ case "packageJson":
746
+ writer.uint32(50).string(message.dependencyFile.value);
747
+ break;
748
+ case "pyprojectToml":
749
+ writer.uint32(58).string(message.dependencyFile.value);
750
+ break;
751
+ }
752
+ if (message.idempotencyKey !== "") {
753
+ writer.uint32(66).string(message.idempotencyKey);
754
+ }
755
+ return writer;
756
+ },
757
+ decode(input, length) {
758
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
759
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
760
+ if (previousRecursionDepth >= 100) {
761
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
762
+ }
763
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
764
+ try {
765
+ const end = length === undefined ? reader.len : reader.pos + length;
766
+ const message = createBaseCreateSandboxTemplateRequest();
767
+ while (reader.pos < end) {
768
+ const tag = reader.uint32();
769
+ switch (tag >>> 3) {
770
+ case 1: {
771
+ if (tag !== 10) {
772
+ break;
773
+ }
774
+ message.orgId = reader.string();
775
+ continue;
776
+ }
777
+ case 2: {
778
+ if (tag !== 18) {
779
+ break;
780
+ }
781
+ message.alias = reader.string();
782
+ continue;
783
+ }
784
+ case 3: {
785
+ if (tag !== 26) {
786
+ break;
787
+ }
788
+ message.displayName = reader.string();
789
+ continue;
790
+ }
791
+ case 4: {
792
+ if (tag !== 34) {
793
+ break;
794
+ }
795
+ message.baseTemplateAlias = reader.string();
796
+ continue;
797
+ }
798
+ case 5: {
799
+ if (tag !== 42) {
800
+ break;
801
+ }
802
+ message.dependencyFile = { $case: "requirementsTxt", value: reader.string() };
803
+ continue;
804
+ }
805
+ case 6: {
806
+ if (tag !== 50) {
807
+ break;
808
+ }
809
+ message.dependencyFile = { $case: "packageJson", value: reader.string() };
810
+ continue;
811
+ }
812
+ case 7: {
813
+ if (tag !== 58) {
814
+ break;
815
+ }
816
+ message.dependencyFile = { $case: "pyprojectToml", value: reader.string() };
817
+ continue;
818
+ }
819
+ case 8: {
820
+ if (tag !== 66) {
821
+ break;
822
+ }
823
+ message.idempotencyKey = reader.string();
824
+ continue;
825
+ }
826
+ }
827
+ if ((tag & 7) === 4 || tag === 0) {
828
+ break;
829
+ }
830
+ reader.skip(tag & 7);
831
+ }
832
+ return message;
833
+ }
834
+ finally {
835
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
836
+ }
837
+ },
838
+ fromJSON(object) {
839
+ return {
840
+ orgId: isSet(object.orgId)
841
+ ? globalThis.String(object.orgId)
842
+ : isSet(object.org_id)
843
+ ? globalThis.String(object.org_id)
844
+ : "",
845
+ alias: isSet(object.alias) ? globalThis.String(object.alias) : "",
846
+ displayName: isSet(object.displayName)
847
+ ? globalThis.String(object.displayName)
848
+ : isSet(object.display_name)
849
+ ? globalThis.String(object.display_name)
850
+ : "",
851
+ baseTemplateAlias: isSet(object.baseTemplateAlias)
852
+ ? globalThis.String(object.baseTemplateAlias)
853
+ : isSet(object.base_template_alias)
854
+ ? globalThis.String(object.base_template_alias)
855
+ : "",
856
+ dependencyFile: isSet(object.requirementsTxt)
857
+ ? { $case: "requirementsTxt", value: globalThis.String(object.requirementsTxt) }
858
+ : isSet(object.requirements_txt)
859
+ ? { $case: "requirementsTxt", value: globalThis.String(object.requirements_txt) }
860
+ : isSet(object.packageJson)
861
+ ? { $case: "packageJson", value: globalThis.String(object.packageJson) }
862
+ : isSet(object.package_json)
863
+ ? { $case: "packageJson", value: globalThis.String(object.package_json) }
864
+ : isSet(object.pyprojectToml)
865
+ ? { $case: "pyprojectToml", value: globalThis.String(object.pyprojectToml) }
866
+ : isSet(object.pyproject_toml)
867
+ ? { $case: "pyprojectToml", value: globalThis.String(object.pyproject_toml) }
868
+ : undefined,
869
+ idempotencyKey: isSet(object.idempotencyKey)
870
+ ? globalThis.String(object.idempotencyKey)
871
+ : isSet(object.idempotency_key)
872
+ ? globalThis.String(object.idempotency_key)
873
+ : "",
874
+ };
875
+ },
876
+ toJSON(message) {
877
+ const obj = {};
878
+ if (message.orgId !== "") {
879
+ obj.orgId = message.orgId;
880
+ }
881
+ if (message.alias !== "") {
882
+ obj.alias = message.alias;
883
+ }
884
+ if (message.displayName !== "") {
885
+ obj.displayName = message.displayName;
886
+ }
887
+ if (message.baseTemplateAlias !== "") {
888
+ obj.baseTemplateAlias = message.baseTemplateAlias;
889
+ }
890
+ if (message.dependencyFile?.$case === "requirementsTxt") {
891
+ obj.requirementsTxt = message.dependencyFile.value;
892
+ }
893
+ else if (message.dependencyFile?.$case === "packageJson") {
894
+ obj.packageJson = message.dependencyFile.value;
895
+ }
896
+ else if (message.dependencyFile?.$case === "pyprojectToml") {
897
+ obj.pyprojectToml = message.dependencyFile.value;
898
+ }
899
+ if (message.idempotencyKey !== "") {
900
+ obj.idempotencyKey = message.idempotencyKey;
901
+ }
902
+ return obj;
903
+ },
904
+ create(base) {
905
+ return CreateSandboxTemplateRequest.fromPartial(base ?? {});
906
+ },
907
+ fromPartial(object) {
908
+ const message = createBaseCreateSandboxTemplateRequest();
909
+ message.orgId = object.orgId ?? "";
910
+ message.alias = object.alias ?? "";
911
+ message.displayName = object.displayName ?? "";
912
+ message.baseTemplateAlias = object.baseTemplateAlias ?? "";
913
+ switch (object.dependencyFile?.$case) {
914
+ case "requirementsTxt": {
915
+ if (object.dependencyFile?.value !== undefined && object.dependencyFile?.value !== null) {
916
+ message.dependencyFile = { $case: "requirementsTxt", value: object.dependencyFile.value };
917
+ }
918
+ break;
919
+ }
920
+ case "packageJson": {
921
+ if (object.dependencyFile?.value !== undefined && object.dependencyFile?.value !== null) {
922
+ message.dependencyFile = { $case: "packageJson", value: object.dependencyFile.value };
923
+ }
924
+ break;
925
+ }
926
+ case "pyprojectToml": {
927
+ if (object.dependencyFile?.value !== undefined && object.dependencyFile?.value !== null) {
928
+ message.dependencyFile = { $case: "pyprojectToml", value: object.dependencyFile.value };
929
+ }
930
+ break;
931
+ }
932
+ }
933
+ message.idempotencyKey = object.idempotencyKey ?? "";
934
+ return message;
935
+ },
936
+ };
937
+ function createBaseGetSandboxTemplateRequest() {
938
+ return { orgId: "", templateId: "" };
939
+ }
940
+ export const GetSandboxTemplateRequest = {
941
+ encode(message, writer = new BinaryWriter()) {
942
+ if (message.orgId !== "") {
943
+ writer.uint32(10).string(message.orgId);
944
+ }
945
+ if (message.templateId !== "") {
946
+ writer.uint32(18).string(message.templateId);
947
+ }
948
+ return writer;
949
+ },
950
+ decode(input, length) {
951
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
952
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
953
+ if (previousRecursionDepth >= 100) {
954
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
955
+ }
956
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
957
+ try {
958
+ const end = length === undefined ? reader.len : reader.pos + length;
959
+ const message = createBaseGetSandboxTemplateRequest();
960
+ while (reader.pos < end) {
961
+ const tag = reader.uint32();
962
+ switch (tag >>> 3) {
963
+ case 1: {
964
+ if (tag !== 10) {
965
+ break;
966
+ }
967
+ message.orgId = reader.string();
968
+ continue;
969
+ }
970
+ case 2: {
971
+ if (tag !== 18) {
972
+ break;
973
+ }
974
+ message.templateId = reader.string();
975
+ continue;
976
+ }
977
+ }
978
+ if ((tag & 7) === 4 || tag === 0) {
979
+ break;
980
+ }
981
+ reader.skip(tag & 7);
982
+ }
983
+ return message;
984
+ }
985
+ finally {
986
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
987
+ }
988
+ },
989
+ fromJSON(object) {
990
+ return {
991
+ orgId: isSet(object.orgId)
992
+ ? globalThis.String(object.orgId)
993
+ : isSet(object.org_id)
994
+ ? globalThis.String(object.org_id)
995
+ : "",
996
+ templateId: isSet(object.templateId)
997
+ ? globalThis.String(object.templateId)
998
+ : isSet(object.template_id)
999
+ ? globalThis.String(object.template_id)
1000
+ : "",
1001
+ };
1002
+ },
1003
+ toJSON(message) {
1004
+ const obj = {};
1005
+ if (message.orgId !== "") {
1006
+ obj.orgId = message.orgId;
1007
+ }
1008
+ if (message.templateId !== "") {
1009
+ obj.templateId = message.templateId;
1010
+ }
1011
+ return obj;
1012
+ },
1013
+ create(base) {
1014
+ return GetSandboxTemplateRequest.fromPartial(base ?? {});
1015
+ },
1016
+ fromPartial(object) {
1017
+ const message = createBaseGetSandboxTemplateRequest();
1018
+ message.orgId = object.orgId ?? "";
1019
+ message.templateId = object.templateId ?? "";
1020
+ return message;
1021
+ },
1022
+ };
1023
+ function createBaseDeleteSandboxTemplateRequest() {
1024
+ return { orgId: "", templateId: "" };
1025
+ }
1026
+ export const DeleteSandboxTemplateRequest = {
1027
+ encode(message, writer = new BinaryWriter()) {
1028
+ if (message.orgId !== "") {
1029
+ writer.uint32(10).string(message.orgId);
1030
+ }
1031
+ if (message.templateId !== "") {
1032
+ writer.uint32(18).string(message.templateId);
1033
+ }
1034
+ return writer;
1035
+ },
1036
+ decode(input, length) {
1037
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1038
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1039
+ if (previousRecursionDepth >= 100) {
1040
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1041
+ }
1042
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1043
+ try {
1044
+ const end = length === undefined ? reader.len : reader.pos + length;
1045
+ const message = createBaseDeleteSandboxTemplateRequest();
1046
+ while (reader.pos < end) {
1047
+ const tag = reader.uint32();
1048
+ switch (tag >>> 3) {
1049
+ case 1: {
1050
+ if (tag !== 10) {
1051
+ break;
1052
+ }
1053
+ message.orgId = reader.string();
1054
+ continue;
1055
+ }
1056
+ case 2: {
1057
+ if (tag !== 18) {
1058
+ break;
1059
+ }
1060
+ message.templateId = reader.string();
1061
+ continue;
1062
+ }
1063
+ }
1064
+ if ((tag & 7) === 4 || tag === 0) {
1065
+ break;
1066
+ }
1067
+ reader.skip(tag & 7);
1068
+ }
1069
+ return message;
1070
+ }
1071
+ finally {
1072
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1073
+ }
1074
+ },
1075
+ fromJSON(object) {
1076
+ return {
1077
+ orgId: isSet(object.orgId)
1078
+ ? globalThis.String(object.orgId)
1079
+ : isSet(object.org_id)
1080
+ ? globalThis.String(object.org_id)
1081
+ : "",
1082
+ templateId: isSet(object.templateId)
1083
+ ? globalThis.String(object.templateId)
1084
+ : isSet(object.template_id)
1085
+ ? globalThis.String(object.template_id)
1086
+ : "",
1087
+ };
1088
+ },
1089
+ toJSON(message) {
1090
+ const obj = {};
1091
+ if (message.orgId !== "") {
1092
+ obj.orgId = message.orgId;
1093
+ }
1094
+ if (message.templateId !== "") {
1095
+ obj.templateId = message.templateId;
1096
+ }
1097
+ return obj;
1098
+ },
1099
+ create(base) {
1100
+ return DeleteSandboxTemplateRequest.fromPartial(base ?? {});
1101
+ },
1102
+ fromPartial(object) {
1103
+ const message = createBaseDeleteSandboxTemplateRequest();
1104
+ message.orgId = object.orgId ?? "";
1105
+ message.templateId = object.templateId ?? "";
1106
+ return message;
1107
+ },
1108
+ };
1109
+ function createBaseCodeSandbox() {
1110
+ return {
1111
+ id: "",
1112
+ orgId: "",
1113
+ templateId: "",
1114
+ templateAlias: "",
1115
+ runtime: 0,
1116
+ status: 0,
1117
+ timeoutSeconds: 0,
1118
+ expiresAt: undefined,
1119
+ createdAt: undefined,
1120
+ readyAt: undefined,
1121
+ stoppedAt: undefined,
1122
+ failureCode: "",
1123
+ location: "",
1124
+ queueDeadline: undefined,
1125
+ };
1126
+ }
1127
+ export const CodeSandbox = {
1128
+ encode(message, writer = new BinaryWriter()) {
1129
+ if (message.id !== "") {
1130
+ writer.uint32(10).string(message.id);
1131
+ }
1132
+ if (message.orgId !== "") {
1133
+ writer.uint32(18).string(message.orgId);
1134
+ }
1135
+ if (message.templateId !== "") {
1136
+ writer.uint32(26).string(message.templateId);
1137
+ }
1138
+ if (message.templateAlias !== "") {
1139
+ writer.uint32(34).string(message.templateAlias);
1140
+ }
1141
+ if (message.runtime !== 0) {
1142
+ writer.uint32(40).int32(message.runtime);
1143
+ }
1144
+ if (message.status !== 0) {
1145
+ writer.uint32(48).int32(message.status);
1146
+ }
1147
+ if (message.timeoutSeconds !== 0) {
1148
+ writer.uint32(56).int32(message.timeoutSeconds);
1149
+ }
1150
+ if (message.expiresAt !== undefined) {
1151
+ Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(66).fork()).join();
1152
+ }
1153
+ if (message.createdAt !== undefined) {
1154
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(74).fork()).join();
1155
+ }
1156
+ if (message.readyAt !== undefined) {
1157
+ Timestamp.encode(toTimestamp(message.readyAt), writer.uint32(82).fork()).join();
1158
+ }
1159
+ if (message.stoppedAt !== undefined) {
1160
+ Timestamp.encode(toTimestamp(message.stoppedAt), writer.uint32(90).fork()).join();
1161
+ }
1162
+ if (message.failureCode !== "") {
1163
+ writer.uint32(98).string(message.failureCode);
1164
+ }
1165
+ if (message.location !== "") {
1166
+ writer.uint32(106).string(message.location);
1167
+ }
1168
+ if (message.queueDeadline !== undefined) {
1169
+ Timestamp.encode(toTimestamp(message.queueDeadline), writer.uint32(114).fork()).join();
1170
+ }
1171
+ return writer;
1172
+ },
1173
+ decode(input, length) {
1174
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1175
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1176
+ if (previousRecursionDepth >= 100) {
1177
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1178
+ }
1179
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1180
+ try {
1181
+ const end = length === undefined ? reader.len : reader.pos + length;
1182
+ const message = createBaseCodeSandbox();
1183
+ while (reader.pos < end) {
1184
+ const tag = reader.uint32();
1185
+ switch (tag >>> 3) {
1186
+ case 1: {
1187
+ if (tag !== 10) {
1188
+ break;
1189
+ }
1190
+ message.id = reader.string();
1191
+ continue;
1192
+ }
1193
+ case 2: {
1194
+ if (tag !== 18) {
1195
+ break;
1196
+ }
1197
+ message.orgId = reader.string();
1198
+ continue;
1199
+ }
1200
+ case 3: {
1201
+ if (tag !== 26) {
1202
+ break;
1203
+ }
1204
+ message.templateId = reader.string();
1205
+ continue;
1206
+ }
1207
+ case 4: {
1208
+ if (tag !== 34) {
1209
+ break;
1210
+ }
1211
+ message.templateAlias = reader.string();
1212
+ continue;
1213
+ }
1214
+ case 5: {
1215
+ if (tag !== 40) {
1216
+ break;
1217
+ }
1218
+ message.runtime = reader.int32();
1219
+ continue;
1220
+ }
1221
+ case 6: {
1222
+ if (tag !== 48) {
1223
+ break;
1224
+ }
1225
+ message.status = reader.int32();
1226
+ continue;
1227
+ }
1228
+ case 7: {
1229
+ if (tag !== 56) {
1230
+ break;
1231
+ }
1232
+ message.timeoutSeconds = reader.int32();
1233
+ continue;
1234
+ }
1235
+ case 8: {
1236
+ if (tag !== 66) {
1237
+ break;
1238
+ }
1239
+ message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1240
+ continue;
1241
+ }
1242
+ case 9: {
1243
+ if (tag !== 74) {
1244
+ break;
1245
+ }
1246
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1247
+ continue;
1248
+ }
1249
+ case 10: {
1250
+ if (tag !== 82) {
1251
+ break;
1252
+ }
1253
+ message.readyAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1254
+ continue;
1255
+ }
1256
+ case 11: {
1257
+ if (tag !== 90) {
1258
+ break;
1259
+ }
1260
+ message.stoppedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1261
+ continue;
1262
+ }
1263
+ case 12: {
1264
+ if (tag !== 98) {
1265
+ break;
1266
+ }
1267
+ message.failureCode = reader.string();
1268
+ continue;
1269
+ }
1270
+ case 13: {
1271
+ if (tag !== 106) {
1272
+ break;
1273
+ }
1274
+ message.location = reader.string();
1275
+ continue;
1276
+ }
1277
+ case 14: {
1278
+ if (tag !== 114) {
1279
+ break;
1280
+ }
1281
+ message.queueDeadline = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1282
+ continue;
1283
+ }
1284
+ }
1285
+ if ((tag & 7) === 4 || tag === 0) {
1286
+ break;
1287
+ }
1288
+ reader.skip(tag & 7);
1289
+ }
1290
+ return message;
1291
+ }
1292
+ finally {
1293
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1294
+ }
1295
+ },
1296
+ fromJSON(object) {
1297
+ return {
1298
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1299
+ orgId: isSet(object.orgId)
1300
+ ? globalThis.String(object.orgId)
1301
+ : isSet(object.org_id)
1302
+ ? globalThis.String(object.org_id)
1303
+ : "",
1304
+ templateId: isSet(object.templateId)
1305
+ ? globalThis.String(object.templateId)
1306
+ : isSet(object.template_id)
1307
+ ? globalThis.String(object.template_id)
1308
+ : "",
1309
+ templateAlias: isSet(object.templateAlias)
1310
+ ? globalThis.String(object.templateAlias)
1311
+ : isSet(object.template_alias)
1312
+ ? globalThis.String(object.template_alias)
1313
+ : "",
1314
+ runtime: isSet(object.runtime) ? sandboxRuntimeFromJSON(object.runtime) : 0,
1315
+ status: isSet(object.status) ? codeSandboxStatusFromJSON(object.status) : 0,
1316
+ timeoutSeconds: isSet(object.timeoutSeconds)
1317
+ ? globalThis.Number(object.timeoutSeconds)
1318
+ : isSet(object.timeout_seconds)
1319
+ ? globalThis.Number(object.timeout_seconds)
1320
+ : 0,
1321
+ expiresAt: isSet(object.expiresAt)
1322
+ ? fromJsonTimestamp(object.expiresAt)
1323
+ : isSet(object.expires_at)
1324
+ ? fromJsonTimestamp(object.expires_at)
1325
+ : undefined,
1326
+ createdAt: isSet(object.createdAt)
1327
+ ? fromJsonTimestamp(object.createdAt)
1328
+ : isSet(object.created_at)
1329
+ ? fromJsonTimestamp(object.created_at)
1330
+ : undefined,
1331
+ readyAt: isSet(object.readyAt)
1332
+ ? fromJsonTimestamp(object.readyAt)
1333
+ : isSet(object.ready_at)
1334
+ ? fromJsonTimestamp(object.ready_at)
1335
+ : undefined,
1336
+ stoppedAt: isSet(object.stoppedAt)
1337
+ ? fromJsonTimestamp(object.stoppedAt)
1338
+ : isSet(object.stopped_at)
1339
+ ? fromJsonTimestamp(object.stopped_at)
1340
+ : undefined,
1341
+ failureCode: isSet(object.failureCode)
1342
+ ? globalThis.String(object.failureCode)
1343
+ : isSet(object.failure_code)
1344
+ ? globalThis.String(object.failure_code)
1345
+ : "",
1346
+ location: isSet(object.location) ? globalThis.String(object.location) : "",
1347
+ queueDeadline: isSet(object.queueDeadline)
1348
+ ? fromJsonTimestamp(object.queueDeadline)
1349
+ : isSet(object.queue_deadline)
1350
+ ? fromJsonTimestamp(object.queue_deadline)
1351
+ : undefined,
1352
+ };
1353
+ },
1354
+ toJSON(message) {
1355
+ const obj = {};
1356
+ if (message.id !== "") {
1357
+ obj.id = message.id;
1358
+ }
1359
+ if (message.orgId !== "") {
1360
+ obj.orgId = message.orgId;
1361
+ }
1362
+ if (message.templateId !== "") {
1363
+ obj.templateId = message.templateId;
1364
+ }
1365
+ if (message.templateAlias !== "") {
1366
+ obj.templateAlias = message.templateAlias;
1367
+ }
1368
+ if (message.runtime !== 0) {
1369
+ obj.runtime = sandboxRuntimeToJSON(message.runtime);
1370
+ }
1371
+ if (message.status !== 0) {
1372
+ obj.status = codeSandboxStatusToJSON(message.status);
1373
+ }
1374
+ if (message.timeoutSeconds !== 0) {
1375
+ obj.timeoutSeconds = Math.round(message.timeoutSeconds);
1376
+ }
1377
+ if (message.expiresAt !== undefined) {
1378
+ obj.expiresAt = message.expiresAt.toISOString();
1379
+ }
1380
+ if (message.createdAt !== undefined) {
1381
+ obj.createdAt = message.createdAt.toISOString();
1382
+ }
1383
+ if (message.readyAt !== undefined) {
1384
+ obj.readyAt = message.readyAt.toISOString();
1385
+ }
1386
+ if (message.stoppedAt !== undefined) {
1387
+ obj.stoppedAt = message.stoppedAt.toISOString();
1388
+ }
1389
+ if (message.failureCode !== "") {
1390
+ obj.failureCode = message.failureCode;
1391
+ }
1392
+ if (message.location !== "") {
1393
+ obj.location = message.location;
1394
+ }
1395
+ if (message.queueDeadline !== undefined) {
1396
+ obj.queueDeadline = message.queueDeadline.toISOString();
1397
+ }
1398
+ return obj;
1399
+ },
1400
+ create(base) {
1401
+ return CodeSandbox.fromPartial(base ?? {});
1402
+ },
1403
+ fromPartial(object) {
1404
+ const message = createBaseCodeSandbox();
1405
+ message.id = object.id ?? "";
1406
+ message.orgId = object.orgId ?? "";
1407
+ message.templateId = object.templateId ?? "";
1408
+ message.templateAlias = object.templateAlias ?? "";
1409
+ message.runtime = object.runtime ?? 0;
1410
+ message.status = object.status ?? 0;
1411
+ message.timeoutSeconds = object.timeoutSeconds ?? 0;
1412
+ message.expiresAt = object.expiresAt ?? undefined;
1413
+ message.createdAt = object.createdAt ?? undefined;
1414
+ message.readyAt = object.readyAt ?? undefined;
1415
+ message.stoppedAt = object.stoppedAt ?? undefined;
1416
+ message.failureCode = object.failureCode ?? "";
1417
+ message.location = object.location ?? "";
1418
+ message.queueDeadline = object.queueDeadline ?? undefined;
1419
+ return message;
1420
+ },
1421
+ };
1422
+ function createBaseListSandboxesRequest() {
1423
+ return { orgId: "" };
1424
+ }
1425
+ export const ListSandboxesRequest = {
1426
+ encode(message, writer = new BinaryWriter()) {
1427
+ if (message.orgId !== "") {
1428
+ writer.uint32(10).string(message.orgId);
1429
+ }
1430
+ return writer;
1431
+ },
1432
+ decode(input, length) {
1433
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1434
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1435
+ if (previousRecursionDepth >= 100) {
1436
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1437
+ }
1438
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1439
+ try {
1440
+ const end = length === undefined ? reader.len : reader.pos + length;
1441
+ const message = createBaseListSandboxesRequest();
1442
+ while (reader.pos < end) {
1443
+ const tag = reader.uint32();
1444
+ switch (tag >>> 3) {
1445
+ case 1: {
1446
+ if (tag !== 10) {
1447
+ break;
1448
+ }
1449
+ message.orgId = reader.string();
1450
+ continue;
1451
+ }
1452
+ }
1453
+ if ((tag & 7) === 4 || tag === 0) {
1454
+ break;
1455
+ }
1456
+ reader.skip(tag & 7);
1457
+ }
1458
+ return message;
1459
+ }
1460
+ finally {
1461
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1462
+ }
1463
+ },
1464
+ fromJSON(object) {
1465
+ return {
1466
+ orgId: isSet(object.orgId)
1467
+ ? globalThis.String(object.orgId)
1468
+ : isSet(object.org_id)
1469
+ ? globalThis.String(object.org_id)
1470
+ : "",
1471
+ };
1472
+ },
1473
+ toJSON(message) {
1474
+ const obj = {};
1475
+ if (message.orgId !== "") {
1476
+ obj.orgId = message.orgId;
1477
+ }
1478
+ return obj;
1479
+ },
1480
+ create(base) {
1481
+ return ListSandboxesRequest.fromPartial(base ?? {});
1482
+ },
1483
+ fromPartial(object) {
1484
+ const message = createBaseListSandboxesRequest();
1485
+ message.orgId = object.orgId ?? "";
1486
+ return message;
1487
+ },
1488
+ };
1489
+ function createBaseListSandboxesResponse() {
1490
+ return { sandboxes: [] };
1491
+ }
1492
+ export const ListSandboxesResponse = {
1493
+ encode(message, writer = new BinaryWriter()) {
1494
+ for (const v of message.sandboxes) {
1495
+ CodeSandbox.encode(v, writer.uint32(10).fork()).join();
1496
+ }
1497
+ return writer;
1498
+ },
1499
+ decode(input, length) {
1500
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1501
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1502
+ if (previousRecursionDepth >= 100) {
1503
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1504
+ }
1505
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1506
+ try {
1507
+ const end = length === undefined ? reader.len : reader.pos + length;
1508
+ const message = createBaseListSandboxesResponse();
1509
+ while (reader.pos < end) {
1510
+ const tag = reader.uint32();
1511
+ switch (tag >>> 3) {
1512
+ case 1: {
1513
+ if (tag !== 10) {
1514
+ break;
1515
+ }
1516
+ message.sandboxes.push(CodeSandbox.decode(reader, reader.uint32()));
1517
+ continue;
1518
+ }
1519
+ }
1520
+ if ((tag & 7) === 4 || tag === 0) {
1521
+ break;
1522
+ }
1523
+ reader.skip(tag & 7);
1524
+ }
1525
+ return message;
1526
+ }
1527
+ finally {
1528
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1529
+ }
1530
+ },
1531
+ fromJSON(object) {
1532
+ return {
1533
+ sandboxes: globalThis.Array.isArray(object?.sandboxes)
1534
+ ? object.sandboxes.map((e) => CodeSandbox.fromJSON(e))
1535
+ : [],
1536
+ };
1537
+ },
1538
+ toJSON(message) {
1539
+ const obj = {};
1540
+ if (message.sandboxes?.length) {
1541
+ obj.sandboxes = message.sandboxes.map((e) => CodeSandbox.toJSON(e));
1542
+ }
1543
+ return obj;
1544
+ },
1545
+ create(base) {
1546
+ return ListSandboxesResponse.fromPartial(base ?? {});
1547
+ },
1548
+ fromPartial(object) {
1549
+ const message = createBaseListSandboxesResponse();
1550
+ message.sandboxes = object.sandboxes?.map((e) => CodeSandbox.fromPartial(e)) || [];
1551
+ return message;
1552
+ },
1553
+ };
1554
+ function createBaseCreateCodeSandboxRequest() {
1555
+ return {
1556
+ orgId: "",
1557
+ template: "",
1558
+ timeoutSeconds: 0,
1559
+ idempotencyKey: "",
1560
+ location: "",
1561
+ acceptedQuoteId: "",
1562
+ resources: undefined,
1563
+ maxNetworkBytes: undefined,
1564
+ };
1565
+ }
1566
+ export const CreateCodeSandboxRequest = {
1567
+ encode(message, writer = new BinaryWriter()) {
1568
+ if (message.orgId !== "") {
1569
+ writer.uint32(10).string(message.orgId);
1570
+ }
1571
+ if (message.template !== "") {
1572
+ writer.uint32(18).string(message.template);
1573
+ }
1574
+ if (message.timeoutSeconds !== 0) {
1575
+ writer.uint32(24).int32(message.timeoutSeconds);
1576
+ }
1577
+ if (message.idempotencyKey !== "") {
1578
+ writer.uint32(34).string(message.idempotencyKey);
1579
+ }
1580
+ if (message.location !== "") {
1581
+ writer.uint32(42).string(message.location);
1582
+ }
1583
+ if (message.acceptedQuoteId !== "") {
1584
+ writer.uint32(50).string(message.acceptedQuoteId);
1585
+ }
1586
+ if (message.resources !== undefined) {
1587
+ JobResources.encode(message.resources, writer.uint32(58).fork()).join();
1588
+ }
1589
+ if (message.maxNetworkBytes !== undefined) {
1590
+ if (BigInt.asUintN(64, message.maxNetworkBytes) !== message.maxNetworkBytes) {
1591
+ throw new globalThis.Error("value provided for field message.maxNetworkBytes of type uint64 too large");
1592
+ }
1593
+ writer.uint32(64).uint64(message.maxNetworkBytes);
1594
+ }
1595
+ return writer;
1596
+ },
1597
+ decode(input, length) {
1598
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1599
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1600
+ if (previousRecursionDepth >= 100) {
1601
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1602
+ }
1603
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1604
+ try {
1605
+ const end = length === undefined ? reader.len : reader.pos + length;
1606
+ const message = createBaseCreateCodeSandboxRequest();
1607
+ while (reader.pos < end) {
1608
+ const tag = reader.uint32();
1609
+ switch (tag >>> 3) {
1610
+ case 1: {
1611
+ if (tag !== 10) {
1612
+ break;
1613
+ }
1614
+ message.orgId = reader.string();
1615
+ continue;
1616
+ }
1617
+ case 2: {
1618
+ if (tag !== 18) {
1619
+ break;
1620
+ }
1621
+ message.template = reader.string();
1622
+ continue;
1623
+ }
1624
+ case 3: {
1625
+ if (tag !== 24) {
1626
+ break;
1627
+ }
1628
+ message.timeoutSeconds = reader.int32();
1629
+ continue;
1630
+ }
1631
+ case 4: {
1632
+ if (tag !== 34) {
1633
+ break;
1634
+ }
1635
+ message.idempotencyKey = reader.string();
1636
+ continue;
1637
+ }
1638
+ case 5: {
1639
+ if (tag !== 42) {
1640
+ break;
1641
+ }
1642
+ message.location = reader.string();
1643
+ continue;
1644
+ }
1645
+ case 6: {
1646
+ if (tag !== 50) {
1647
+ break;
1648
+ }
1649
+ message.acceptedQuoteId = reader.string();
1650
+ continue;
1651
+ }
1652
+ case 7: {
1653
+ if (tag !== 58) {
1654
+ break;
1655
+ }
1656
+ message.resources = JobResources.decode(reader, reader.uint32());
1657
+ continue;
1658
+ }
1659
+ case 8: {
1660
+ if (tag !== 64) {
1661
+ break;
1662
+ }
1663
+ message.maxNetworkBytes = reader.uint64();
1664
+ continue;
1665
+ }
1666
+ }
1667
+ if ((tag & 7) === 4 || tag === 0) {
1668
+ break;
1669
+ }
1670
+ reader.skip(tag & 7);
1671
+ }
1672
+ return message;
1673
+ }
1674
+ finally {
1675
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1676
+ }
1677
+ },
1678
+ fromJSON(object) {
1679
+ return {
1680
+ orgId: isSet(object.orgId)
1681
+ ? globalThis.String(object.orgId)
1682
+ : isSet(object.org_id)
1683
+ ? globalThis.String(object.org_id)
1684
+ : "",
1685
+ template: isSet(object.template) ? globalThis.String(object.template) : "",
1686
+ timeoutSeconds: isSet(object.timeoutSeconds)
1687
+ ? globalThis.Number(object.timeoutSeconds)
1688
+ : isSet(object.timeout_seconds)
1689
+ ? globalThis.Number(object.timeout_seconds)
1690
+ : 0,
1691
+ idempotencyKey: isSet(object.idempotencyKey)
1692
+ ? globalThis.String(object.idempotencyKey)
1693
+ : isSet(object.idempotency_key)
1694
+ ? globalThis.String(object.idempotency_key)
1695
+ : "",
1696
+ location: isSet(object.location) ? globalThis.String(object.location) : "",
1697
+ acceptedQuoteId: isSet(object.acceptedQuoteId)
1698
+ ? globalThis.String(object.acceptedQuoteId)
1699
+ : isSet(object.accepted_quote_id)
1700
+ ? globalThis.String(object.accepted_quote_id)
1701
+ : "",
1702
+ resources: isSet(object.resources) ? JobResources.fromJSON(object.resources) : undefined,
1703
+ maxNetworkBytes: isSet(object.maxNetworkBytes)
1704
+ ? BigInt(object.maxNetworkBytes)
1705
+ : isSet(object.max_network_bytes)
1706
+ ? BigInt(object.max_network_bytes)
1707
+ : undefined,
1708
+ };
1709
+ },
1710
+ toJSON(message) {
1711
+ const obj = {};
1712
+ if (message.orgId !== "") {
1713
+ obj.orgId = message.orgId;
1714
+ }
1715
+ if (message.template !== "") {
1716
+ obj.template = message.template;
1717
+ }
1718
+ if (message.timeoutSeconds !== 0) {
1719
+ obj.timeoutSeconds = Math.round(message.timeoutSeconds);
1720
+ }
1721
+ if (message.idempotencyKey !== "") {
1722
+ obj.idempotencyKey = message.idempotencyKey;
1723
+ }
1724
+ if (message.location !== "") {
1725
+ obj.location = message.location;
1726
+ }
1727
+ if (message.acceptedQuoteId !== "") {
1728
+ obj.acceptedQuoteId = message.acceptedQuoteId;
1729
+ }
1730
+ if (message.resources !== undefined) {
1731
+ obj.resources = JobResources.toJSON(message.resources);
1732
+ }
1733
+ if (message.maxNetworkBytes !== undefined) {
1734
+ obj.maxNetworkBytes = message.maxNetworkBytes.toString();
1735
+ }
1736
+ return obj;
1737
+ },
1738
+ create(base) {
1739
+ return CreateCodeSandboxRequest.fromPartial(base ?? {});
1740
+ },
1741
+ fromPartial(object) {
1742
+ const message = createBaseCreateCodeSandboxRequest();
1743
+ message.orgId = object.orgId ?? "";
1744
+ message.template = object.template ?? "";
1745
+ message.timeoutSeconds = object.timeoutSeconds ?? 0;
1746
+ message.idempotencyKey = object.idempotencyKey ?? "";
1747
+ message.location = object.location ?? "";
1748
+ message.acceptedQuoteId = object.acceptedQuoteId ?? "";
1749
+ message.resources = (object.resources !== undefined && object.resources !== null)
1750
+ ? JobResources.fromPartial(object.resources)
1751
+ : undefined;
1752
+ message.maxNetworkBytes = (object.maxNetworkBytes !== undefined && object.maxNetworkBytes !== null)
1753
+ ? BigInt(object.maxNetworkBytes)
1754
+ : undefined;
1755
+ return message;
1756
+ },
1757
+ };
1758
+ function createBaseGetCodeSandboxRequest() {
1759
+ return { orgId: "", sandboxId: "" };
1760
+ }
1761
+ export const GetCodeSandboxRequest = {
1762
+ encode(message, writer = new BinaryWriter()) {
1763
+ if (message.orgId !== "") {
1764
+ writer.uint32(10).string(message.orgId);
1765
+ }
1766
+ if (message.sandboxId !== "") {
1767
+ writer.uint32(18).string(message.sandboxId);
1768
+ }
1769
+ return writer;
1770
+ },
1771
+ decode(input, length) {
1772
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1773
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1774
+ if (previousRecursionDepth >= 100) {
1775
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1776
+ }
1777
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1778
+ try {
1779
+ const end = length === undefined ? reader.len : reader.pos + length;
1780
+ const message = createBaseGetCodeSandboxRequest();
1781
+ while (reader.pos < end) {
1782
+ const tag = reader.uint32();
1783
+ switch (tag >>> 3) {
1784
+ case 1: {
1785
+ if (tag !== 10) {
1786
+ break;
1787
+ }
1788
+ message.orgId = reader.string();
1789
+ continue;
1790
+ }
1791
+ case 2: {
1792
+ if (tag !== 18) {
1793
+ break;
1794
+ }
1795
+ message.sandboxId = reader.string();
1796
+ continue;
1797
+ }
1798
+ }
1799
+ if ((tag & 7) === 4 || tag === 0) {
1800
+ break;
1801
+ }
1802
+ reader.skip(tag & 7);
1803
+ }
1804
+ return message;
1805
+ }
1806
+ finally {
1807
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1808
+ }
1809
+ },
1810
+ fromJSON(object) {
1811
+ return {
1812
+ orgId: isSet(object.orgId)
1813
+ ? globalThis.String(object.orgId)
1814
+ : isSet(object.org_id)
1815
+ ? globalThis.String(object.org_id)
1816
+ : "",
1817
+ sandboxId: isSet(object.sandboxId)
1818
+ ? globalThis.String(object.sandboxId)
1819
+ : isSet(object.sandbox_id)
1820
+ ? globalThis.String(object.sandbox_id)
1821
+ : "",
1822
+ };
1823
+ },
1824
+ toJSON(message) {
1825
+ const obj = {};
1826
+ if (message.orgId !== "") {
1827
+ obj.orgId = message.orgId;
1828
+ }
1829
+ if (message.sandboxId !== "") {
1830
+ obj.sandboxId = message.sandboxId;
1831
+ }
1832
+ return obj;
1833
+ },
1834
+ create(base) {
1835
+ return GetCodeSandboxRequest.fromPartial(base ?? {});
1836
+ },
1837
+ fromPartial(object) {
1838
+ const message = createBaseGetCodeSandboxRequest();
1839
+ message.orgId = object.orgId ?? "";
1840
+ message.sandboxId = object.sandboxId ?? "";
1841
+ return message;
1842
+ },
1843
+ };
1844
+ function createBaseDeleteCodeSandboxRequest() {
1845
+ return { orgId: "", sandboxId: "" };
1846
+ }
1847
+ export const DeleteCodeSandboxRequest = {
1848
+ encode(message, writer = new BinaryWriter()) {
1849
+ if (message.orgId !== "") {
1850
+ writer.uint32(10).string(message.orgId);
1851
+ }
1852
+ if (message.sandboxId !== "") {
1853
+ writer.uint32(18).string(message.sandboxId);
1854
+ }
1855
+ return writer;
1856
+ },
1857
+ decode(input, length) {
1858
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1859
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1860
+ if (previousRecursionDepth >= 100) {
1861
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1862
+ }
1863
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1864
+ try {
1865
+ const end = length === undefined ? reader.len : reader.pos + length;
1866
+ const message = createBaseDeleteCodeSandboxRequest();
1867
+ while (reader.pos < end) {
1868
+ const tag = reader.uint32();
1869
+ switch (tag >>> 3) {
1870
+ case 1: {
1871
+ if (tag !== 10) {
1872
+ break;
1873
+ }
1874
+ message.orgId = reader.string();
1875
+ continue;
1876
+ }
1877
+ case 2: {
1878
+ if (tag !== 18) {
1879
+ break;
1880
+ }
1881
+ message.sandboxId = reader.string();
1882
+ continue;
1883
+ }
1884
+ }
1885
+ if ((tag & 7) === 4 || tag === 0) {
1886
+ break;
1887
+ }
1888
+ reader.skip(tag & 7);
1889
+ }
1890
+ return message;
1891
+ }
1892
+ finally {
1893
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1894
+ }
1895
+ },
1896
+ fromJSON(object) {
1897
+ return {
1898
+ orgId: isSet(object.orgId)
1899
+ ? globalThis.String(object.orgId)
1900
+ : isSet(object.org_id)
1901
+ ? globalThis.String(object.org_id)
1902
+ : "",
1903
+ sandboxId: isSet(object.sandboxId)
1904
+ ? globalThis.String(object.sandboxId)
1905
+ : isSet(object.sandbox_id)
1906
+ ? globalThis.String(object.sandbox_id)
1907
+ : "",
1908
+ };
1909
+ },
1910
+ toJSON(message) {
1911
+ const obj = {};
1912
+ if (message.orgId !== "") {
1913
+ obj.orgId = message.orgId;
1914
+ }
1915
+ if (message.sandboxId !== "") {
1916
+ obj.sandboxId = message.sandboxId;
1917
+ }
1918
+ return obj;
1919
+ },
1920
+ create(base) {
1921
+ return DeleteCodeSandboxRequest.fromPartial(base ?? {});
1922
+ },
1923
+ fromPartial(object) {
1924
+ const message = createBaseDeleteCodeSandboxRequest();
1925
+ message.orgId = object.orgId ?? "";
1926
+ message.sandboxId = object.sandboxId ?? "";
1927
+ return message;
1928
+ },
1929
+ };
1930
+ function createBaseExecuteRequest() {
1931
+ return { orgId: "", sandboxId: "", code: "", stdin: "", timeoutSeconds: 0, idempotencyKey: "" };
1932
+ }
1933
+ export const ExecuteRequest = {
1934
+ encode(message, writer = new BinaryWriter()) {
1935
+ if (message.orgId !== "") {
1936
+ writer.uint32(10).string(message.orgId);
1937
+ }
1938
+ if (message.sandboxId !== "") {
1939
+ writer.uint32(18).string(message.sandboxId);
1940
+ }
1941
+ if (message.code !== "") {
1942
+ writer.uint32(26).string(message.code);
1943
+ }
1944
+ if (message.stdin !== "") {
1945
+ writer.uint32(34).string(message.stdin);
1946
+ }
1947
+ if (message.timeoutSeconds !== 0) {
1948
+ writer.uint32(40).int32(message.timeoutSeconds);
1949
+ }
1950
+ if (message.idempotencyKey !== "") {
1951
+ writer.uint32(50).string(message.idempotencyKey);
1952
+ }
1953
+ return writer;
1954
+ },
1955
+ decode(input, length) {
1956
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1957
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1958
+ if (previousRecursionDepth >= 100) {
1959
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1960
+ }
1961
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1962
+ try {
1963
+ const end = length === undefined ? reader.len : reader.pos + length;
1964
+ const message = createBaseExecuteRequest();
1965
+ while (reader.pos < end) {
1966
+ const tag = reader.uint32();
1967
+ switch (tag >>> 3) {
1968
+ case 1: {
1969
+ if (tag !== 10) {
1970
+ break;
1971
+ }
1972
+ message.orgId = reader.string();
1973
+ continue;
1974
+ }
1975
+ case 2: {
1976
+ if (tag !== 18) {
1977
+ break;
1978
+ }
1979
+ message.sandboxId = reader.string();
1980
+ continue;
1981
+ }
1982
+ case 3: {
1983
+ if (tag !== 26) {
1984
+ break;
1985
+ }
1986
+ message.code = reader.string();
1987
+ continue;
1988
+ }
1989
+ case 4: {
1990
+ if (tag !== 34) {
1991
+ break;
1992
+ }
1993
+ message.stdin = reader.string();
1994
+ continue;
1995
+ }
1996
+ case 5: {
1997
+ if (tag !== 40) {
1998
+ break;
1999
+ }
2000
+ message.timeoutSeconds = reader.int32();
2001
+ continue;
2002
+ }
2003
+ case 6: {
2004
+ if (tag !== 50) {
2005
+ break;
2006
+ }
2007
+ message.idempotencyKey = reader.string();
2008
+ continue;
2009
+ }
2010
+ }
2011
+ if ((tag & 7) === 4 || tag === 0) {
2012
+ break;
2013
+ }
2014
+ reader.skip(tag & 7);
2015
+ }
2016
+ return message;
2017
+ }
2018
+ finally {
2019
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2020
+ }
2021
+ },
2022
+ fromJSON(object) {
2023
+ return {
2024
+ orgId: isSet(object.orgId)
2025
+ ? globalThis.String(object.orgId)
2026
+ : isSet(object.org_id)
2027
+ ? globalThis.String(object.org_id)
2028
+ : "",
2029
+ sandboxId: isSet(object.sandboxId)
2030
+ ? globalThis.String(object.sandboxId)
2031
+ : isSet(object.sandbox_id)
2032
+ ? globalThis.String(object.sandbox_id)
2033
+ : "",
2034
+ code: isSet(object.code) ? globalThis.String(object.code) : "",
2035
+ stdin: isSet(object.stdin) ? globalThis.String(object.stdin) : "",
2036
+ timeoutSeconds: isSet(object.timeoutSeconds)
2037
+ ? globalThis.Number(object.timeoutSeconds)
2038
+ : isSet(object.timeout_seconds)
2039
+ ? globalThis.Number(object.timeout_seconds)
2040
+ : 0,
2041
+ idempotencyKey: isSet(object.idempotencyKey)
2042
+ ? globalThis.String(object.idempotencyKey)
2043
+ : isSet(object.idempotency_key)
2044
+ ? globalThis.String(object.idempotency_key)
2045
+ : "",
2046
+ };
2047
+ },
2048
+ toJSON(message) {
2049
+ const obj = {};
2050
+ if (message.orgId !== "") {
2051
+ obj.orgId = message.orgId;
2052
+ }
2053
+ if (message.sandboxId !== "") {
2054
+ obj.sandboxId = message.sandboxId;
2055
+ }
2056
+ if (message.code !== "") {
2057
+ obj.code = message.code;
2058
+ }
2059
+ if (message.stdin !== "") {
2060
+ obj.stdin = message.stdin;
2061
+ }
2062
+ if (message.timeoutSeconds !== 0) {
2063
+ obj.timeoutSeconds = Math.round(message.timeoutSeconds);
2064
+ }
2065
+ if (message.idempotencyKey !== "") {
2066
+ obj.idempotencyKey = message.idempotencyKey;
2067
+ }
2068
+ return obj;
2069
+ },
2070
+ create(base) {
2071
+ return ExecuteRequest.fromPartial(base ?? {});
2072
+ },
2073
+ fromPartial(object) {
2074
+ const message = createBaseExecuteRequest();
2075
+ message.orgId = object.orgId ?? "";
2076
+ message.sandboxId = object.sandboxId ?? "";
2077
+ message.code = object.code ?? "";
2078
+ message.stdin = object.stdin ?? "";
2079
+ message.timeoutSeconds = object.timeoutSeconds ?? 0;
2080
+ message.idempotencyKey = object.idempotencyKey ?? "";
2081
+ return message;
2082
+ },
2083
+ };
2084
+ function createBaseGetExecutionRequest() {
2085
+ return { orgId: "", sandboxId: "", executionId: "" };
2086
+ }
2087
+ export const GetExecutionRequest = {
2088
+ encode(message, writer = new BinaryWriter()) {
2089
+ if (message.orgId !== "") {
2090
+ writer.uint32(10).string(message.orgId);
2091
+ }
2092
+ if (message.sandboxId !== "") {
2093
+ writer.uint32(18).string(message.sandboxId);
2094
+ }
2095
+ if (message.executionId !== "") {
2096
+ writer.uint32(26).string(message.executionId);
2097
+ }
2098
+ return writer;
2099
+ },
2100
+ decode(input, length) {
2101
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2102
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2103
+ if (previousRecursionDepth >= 100) {
2104
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2105
+ }
2106
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2107
+ try {
2108
+ const end = length === undefined ? reader.len : reader.pos + length;
2109
+ const message = createBaseGetExecutionRequest();
2110
+ while (reader.pos < end) {
2111
+ const tag = reader.uint32();
2112
+ switch (tag >>> 3) {
2113
+ case 1: {
2114
+ if (tag !== 10) {
2115
+ break;
2116
+ }
2117
+ message.orgId = reader.string();
2118
+ continue;
2119
+ }
2120
+ case 2: {
2121
+ if (tag !== 18) {
2122
+ break;
2123
+ }
2124
+ message.sandboxId = reader.string();
2125
+ continue;
2126
+ }
2127
+ case 3: {
2128
+ if (tag !== 26) {
2129
+ break;
2130
+ }
2131
+ message.executionId = reader.string();
2132
+ continue;
2133
+ }
2134
+ }
2135
+ if ((tag & 7) === 4 || tag === 0) {
2136
+ break;
2137
+ }
2138
+ reader.skip(tag & 7);
2139
+ }
2140
+ return message;
2141
+ }
2142
+ finally {
2143
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2144
+ }
2145
+ },
2146
+ fromJSON(object) {
2147
+ return {
2148
+ orgId: isSet(object.orgId)
2149
+ ? globalThis.String(object.orgId)
2150
+ : isSet(object.org_id)
2151
+ ? globalThis.String(object.org_id)
2152
+ : "",
2153
+ sandboxId: isSet(object.sandboxId)
2154
+ ? globalThis.String(object.sandboxId)
2155
+ : isSet(object.sandbox_id)
2156
+ ? globalThis.String(object.sandbox_id)
2157
+ : "",
2158
+ executionId: isSet(object.executionId)
2159
+ ? globalThis.String(object.executionId)
2160
+ : isSet(object.execution_id)
2161
+ ? globalThis.String(object.execution_id)
2162
+ : "",
2163
+ };
2164
+ },
2165
+ toJSON(message) {
2166
+ const obj = {};
2167
+ if (message.orgId !== "") {
2168
+ obj.orgId = message.orgId;
2169
+ }
2170
+ if (message.sandboxId !== "") {
2171
+ obj.sandboxId = message.sandboxId;
2172
+ }
2173
+ if (message.executionId !== "") {
2174
+ obj.executionId = message.executionId;
2175
+ }
2176
+ return obj;
2177
+ },
2178
+ create(base) {
2179
+ return GetExecutionRequest.fromPartial(base ?? {});
2180
+ },
2181
+ fromPartial(object) {
2182
+ const message = createBaseGetExecutionRequest();
2183
+ message.orgId = object.orgId ?? "";
2184
+ message.sandboxId = object.sandboxId ?? "";
2185
+ message.executionId = object.executionId ?? "";
2186
+ return message;
2187
+ },
2188
+ };
2189
+ function createBaseExecution() {
2190
+ return {
2191
+ id: "",
2192
+ sandboxId: "",
2193
+ status: 0,
2194
+ stdout: "",
2195
+ stderr: "",
2196
+ exitCode: 0,
2197
+ durationMs: 0,
2198
+ outputTruncated: false,
2199
+ errorCode: "",
2200
+ createdAt: undefined,
2201
+ completedAt: undefined,
2202
+ outputExpiresAt: undefined,
2203
+ };
2204
+ }
2205
+ export const Execution = {
2206
+ encode(message, writer = new BinaryWriter()) {
2207
+ if (message.id !== "") {
2208
+ writer.uint32(10).string(message.id);
2209
+ }
2210
+ if (message.sandboxId !== "") {
2211
+ writer.uint32(18).string(message.sandboxId);
2212
+ }
2213
+ if (message.status !== 0) {
2214
+ writer.uint32(24).int32(message.status);
2215
+ }
2216
+ if (message.stdout !== "") {
2217
+ writer.uint32(34).string(message.stdout);
2218
+ }
2219
+ if (message.stderr !== "") {
2220
+ writer.uint32(42).string(message.stderr);
2221
+ }
2222
+ if (message.exitCode !== 0) {
2223
+ writer.uint32(48).int32(message.exitCode);
2224
+ }
2225
+ if (message.durationMs !== 0) {
2226
+ writer.uint32(56).int32(message.durationMs);
2227
+ }
2228
+ if (message.outputTruncated !== false) {
2229
+ writer.uint32(64).bool(message.outputTruncated);
2230
+ }
2231
+ if (message.errorCode !== "") {
2232
+ writer.uint32(74).string(message.errorCode);
2233
+ }
2234
+ if (message.createdAt !== undefined) {
2235
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
2236
+ }
2237
+ if (message.completedAt !== undefined) {
2238
+ Timestamp.encode(toTimestamp(message.completedAt), writer.uint32(90).fork()).join();
2239
+ }
2240
+ if (message.outputExpiresAt !== undefined) {
2241
+ Timestamp.encode(toTimestamp(message.outputExpiresAt), writer.uint32(98).fork()).join();
2242
+ }
2243
+ return writer;
2244
+ },
2245
+ decode(input, length) {
2246
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2247
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2248
+ if (previousRecursionDepth >= 100) {
2249
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2250
+ }
2251
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2252
+ try {
2253
+ const end = length === undefined ? reader.len : reader.pos + length;
2254
+ const message = createBaseExecution();
2255
+ while (reader.pos < end) {
2256
+ const tag = reader.uint32();
2257
+ switch (tag >>> 3) {
2258
+ case 1: {
2259
+ if (tag !== 10) {
2260
+ break;
2261
+ }
2262
+ message.id = reader.string();
2263
+ continue;
2264
+ }
2265
+ case 2: {
2266
+ if (tag !== 18) {
2267
+ break;
2268
+ }
2269
+ message.sandboxId = reader.string();
2270
+ continue;
2271
+ }
2272
+ case 3: {
2273
+ if (tag !== 24) {
2274
+ break;
2275
+ }
2276
+ message.status = reader.int32();
2277
+ continue;
2278
+ }
2279
+ case 4: {
2280
+ if (tag !== 34) {
2281
+ break;
2282
+ }
2283
+ message.stdout = reader.string();
2284
+ continue;
2285
+ }
2286
+ case 5: {
2287
+ if (tag !== 42) {
2288
+ break;
2289
+ }
2290
+ message.stderr = reader.string();
2291
+ continue;
2292
+ }
2293
+ case 6: {
2294
+ if (tag !== 48) {
2295
+ break;
2296
+ }
2297
+ message.exitCode = reader.int32();
2298
+ continue;
2299
+ }
2300
+ case 7: {
2301
+ if (tag !== 56) {
2302
+ break;
2303
+ }
2304
+ message.durationMs = reader.int32();
2305
+ continue;
2306
+ }
2307
+ case 8: {
2308
+ if (tag !== 64) {
2309
+ break;
2310
+ }
2311
+ message.outputTruncated = reader.bool();
2312
+ continue;
2313
+ }
2314
+ case 9: {
2315
+ if (tag !== 74) {
2316
+ break;
2317
+ }
2318
+ message.errorCode = reader.string();
2319
+ continue;
2320
+ }
2321
+ case 10: {
2322
+ if (tag !== 82) {
2323
+ break;
2324
+ }
2325
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2326
+ continue;
2327
+ }
2328
+ case 11: {
2329
+ if (tag !== 90) {
2330
+ break;
2331
+ }
2332
+ message.completedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2333
+ continue;
2334
+ }
2335
+ case 12: {
2336
+ if (tag !== 98) {
2337
+ break;
2338
+ }
2339
+ message.outputExpiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2340
+ continue;
2341
+ }
2342
+ }
2343
+ if ((tag & 7) === 4 || tag === 0) {
2344
+ break;
2345
+ }
2346
+ reader.skip(tag & 7);
2347
+ }
2348
+ return message;
2349
+ }
2350
+ finally {
2351
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2352
+ }
2353
+ },
2354
+ fromJSON(object) {
2355
+ return {
2356
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2357
+ sandboxId: isSet(object.sandboxId)
2358
+ ? globalThis.String(object.sandboxId)
2359
+ : isSet(object.sandbox_id)
2360
+ ? globalThis.String(object.sandbox_id)
2361
+ : "",
2362
+ status: isSet(object.status) ? executionStatusFromJSON(object.status) : 0,
2363
+ stdout: isSet(object.stdout) ? globalThis.String(object.stdout) : "",
2364
+ stderr: isSet(object.stderr) ? globalThis.String(object.stderr) : "",
2365
+ exitCode: isSet(object.exitCode)
2366
+ ? globalThis.Number(object.exitCode)
2367
+ : isSet(object.exit_code)
2368
+ ? globalThis.Number(object.exit_code)
2369
+ : 0,
2370
+ durationMs: isSet(object.durationMs)
2371
+ ? globalThis.Number(object.durationMs)
2372
+ : isSet(object.duration_ms)
2373
+ ? globalThis.Number(object.duration_ms)
2374
+ : 0,
2375
+ outputTruncated: isSet(object.outputTruncated)
2376
+ ? globalThis.Boolean(object.outputTruncated)
2377
+ : isSet(object.output_truncated)
2378
+ ? globalThis.Boolean(object.output_truncated)
2379
+ : false,
2380
+ errorCode: isSet(object.errorCode)
2381
+ ? globalThis.String(object.errorCode)
2382
+ : isSet(object.error_code)
2383
+ ? globalThis.String(object.error_code)
2384
+ : "",
2385
+ createdAt: isSet(object.createdAt)
2386
+ ? fromJsonTimestamp(object.createdAt)
2387
+ : isSet(object.created_at)
2388
+ ? fromJsonTimestamp(object.created_at)
2389
+ : undefined,
2390
+ completedAt: isSet(object.completedAt)
2391
+ ? fromJsonTimestamp(object.completedAt)
2392
+ : isSet(object.completed_at)
2393
+ ? fromJsonTimestamp(object.completed_at)
2394
+ : undefined,
2395
+ outputExpiresAt: isSet(object.outputExpiresAt)
2396
+ ? fromJsonTimestamp(object.outputExpiresAt)
2397
+ : isSet(object.output_expires_at)
2398
+ ? fromJsonTimestamp(object.output_expires_at)
2399
+ : undefined,
2400
+ };
2401
+ },
2402
+ toJSON(message) {
2403
+ const obj = {};
2404
+ if (message.id !== "") {
2405
+ obj.id = message.id;
2406
+ }
2407
+ if (message.sandboxId !== "") {
2408
+ obj.sandboxId = message.sandboxId;
2409
+ }
2410
+ if (message.status !== 0) {
2411
+ obj.status = executionStatusToJSON(message.status);
2412
+ }
2413
+ if (message.stdout !== "") {
2414
+ obj.stdout = message.stdout;
2415
+ }
2416
+ if (message.stderr !== "") {
2417
+ obj.stderr = message.stderr;
2418
+ }
2419
+ if (message.exitCode !== 0) {
2420
+ obj.exitCode = Math.round(message.exitCode);
2421
+ }
2422
+ if (message.durationMs !== 0) {
2423
+ obj.durationMs = Math.round(message.durationMs);
2424
+ }
2425
+ if (message.outputTruncated !== false) {
2426
+ obj.outputTruncated = message.outputTruncated;
2427
+ }
2428
+ if (message.errorCode !== "") {
2429
+ obj.errorCode = message.errorCode;
2430
+ }
2431
+ if (message.createdAt !== undefined) {
2432
+ obj.createdAt = message.createdAt.toISOString();
2433
+ }
2434
+ if (message.completedAt !== undefined) {
2435
+ obj.completedAt = message.completedAt.toISOString();
2436
+ }
2437
+ if (message.outputExpiresAt !== undefined) {
2438
+ obj.outputExpiresAt = message.outputExpiresAt.toISOString();
2439
+ }
2440
+ return obj;
2441
+ },
2442
+ create(base) {
2443
+ return Execution.fromPartial(base ?? {});
2444
+ },
2445
+ fromPartial(object) {
2446
+ const message = createBaseExecution();
2447
+ message.id = object.id ?? "";
2448
+ message.sandboxId = object.sandboxId ?? "";
2449
+ message.status = object.status ?? 0;
2450
+ message.stdout = object.stdout ?? "";
2451
+ message.stderr = object.stderr ?? "";
2452
+ message.exitCode = object.exitCode ?? 0;
2453
+ message.durationMs = object.durationMs ?? 0;
2454
+ message.outputTruncated = object.outputTruncated ?? false;
2455
+ message.errorCode = object.errorCode ?? "";
2456
+ message.createdAt = object.createdAt ?? undefined;
2457
+ message.completedAt = object.completedAt ?? undefined;
2458
+ message.outputExpiresAt = object.outputExpiresAt ?? undefined;
2459
+ return message;
2460
+ },
2461
+ };
2462
+ export const SandboxServiceDefinition = {
2463
+ name: "SandboxService",
2464
+ fullName: "tarka.provisioning.v1.SandboxService",
2465
+ methods: {
2466
+ /**
2467
+ * ListSandboxTemplates returns built-in and organization-owned templates
2468
+ * visible to the caller.
2469
+ */
2470
+ listSandboxTemplates: {
2471
+ name: "ListSandboxTemplates",
2472
+ requestType: ListSandboxTemplatesRequest,
2473
+ requestStream: false,
2474
+ responseType: ListSandboxTemplatesResponse,
2475
+ responseStream: false,
2476
+ options: {
2477
+ _unknownFields: {
2478
+ 578365826: [
2479
+ Buffer.from([
2480
+ 45,
2481
+ 18,
2482
+ 43,
2483
+ 47,
2484
+ 99,
2485
+ 111,
2486
+ 110,
2487
+ 116,
2488
+ 114,
2489
+ 111,
2490
+ 108,
2491
+ 47,
2492
+ 118,
2493
+ 49,
2494
+ 47,
2495
+ 111,
2496
+ 114,
2497
+ 103,
2498
+ 115,
2499
+ 47,
2500
+ 123,
2501
+ 111,
2502
+ 114,
2503
+ 103,
2504
+ 95,
2505
+ 105,
2506
+ 100,
2507
+ 125,
2508
+ 47,
2509
+ 115,
2510
+ 97,
2511
+ 110,
2512
+ 100,
2513
+ 98,
2514
+ 111,
2515
+ 120,
2516
+ 45,
2517
+ 116,
2518
+ 101,
2519
+ 109,
2520
+ 112,
2521
+ 108,
2522
+ 97,
2523
+ 116,
2524
+ 101,
2525
+ 115,
2526
+ ]),
2527
+ ],
2528
+ },
2529
+ },
2530
+ },
2531
+ /**
2532
+ * CreateSandboxTemplate builds an immutable dependency revision and
2533
+ * idempotently returns the resulting template.
2534
+ */
2535
+ createSandboxTemplate: {
2536
+ name: "CreateSandboxTemplate",
2537
+ requestType: CreateSandboxTemplateRequest,
2538
+ requestStream: false,
2539
+ responseType: SandboxTemplate,
2540
+ responseStream: false,
2541
+ options: {
2542
+ _unknownFields: {
2543
+ 578365826: [
2544
+ Buffer.from([
2545
+ 48,
2546
+ 34,
2547
+ 43,
2548
+ 47,
2549
+ 99,
2550
+ 111,
2551
+ 110,
2552
+ 116,
2553
+ 114,
2554
+ 111,
2555
+ 108,
2556
+ 47,
2557
+ 118,
2558
+ 49,
2559
+ 47,
2560
+ 111,
2561
+ 114,
2562
+ 103,
2563
+ 115,
2564
+ 47,
2565
+ 123,
2566
+ 111,
2567
+ 114,
2568
+ 103,
2569
+ 95,
2570
+ 105,
2571
+ 100,
2572
+ 125,
2573
+ 47,
2574
+ 115,
2575
+ 97,
2576
+ 110,
2577
+ 100,
2578
+ 98,
2579
+ 111,
2580
+ 120,
2581
+ 45,
2582
+ 116,
2583
+ 101,
2584
+ 109,
2585
+ 112,
2586
+ 108,
2587
+ 97,
2588
+ 116,
2589
+ 101,
2590
+ 115,
2591
+ 58,
2592
+ 1,
2593
+ 42,
2594
+ ]),
2595
+ ],
2596
+ },
2597
+ },
2598
+ },
2599
+ /** GetSandboxTemplate returns a template by identifier. */
2600
+ getSandboxTemplate: {
2601
+ name: "GetSandboxTemplate",
2602
+ requestType: GetSandboxTemplateRequest,
2603
+ requestStream: false,
2604
+ responseType: SandboxTemplate,
2605
+ responseStream: false,
2606
+ options: {
2607
+ _unknownFields: {
2608
+ 578365826: [
2609
+ Buffer.from([
2610
+ 59,
2611
+ 18,
2612
+ 57,
2613
+ 47,
2614
+ 99,
2615
+ 111,
2616
+ 110,
2617
+ 116,
2618
+ 114,
2619
+ 111,
2620
+ 108,
2621
+ 47,
2622
+ 118,
2623
+ 49,
2624
+ 47,
2625
+ 111,
2626
+ 114,
2627
+ 103,
2628
+ 115,
2629
+ 47,
2630
+ 123,
2631
+ 111,
2632
+ 114,
2633
+ 103,
2634
+ 95,
2635
+ 105,
2636
+ 100,
2637
+ 125,
2638
+ 47,
2639
+ 115,
2640
+ 97,
2641
+ 110,
2642
+ 100,
2643
+ 98,
2644
+ 111,
2645
+ 120,
2646
+ 45,
2647
+ 116,
2648
+ 101,
2649
+ 109,
2650
+ 112,
2651
+ 108,
2652
+ 97,
2653
+ 116,
2654
+ 101,
2655
+ 115,
2656
+ 47,
2657
+ 123,
2658
+ 116,
2659
+ 101,
2660
+ 109,
2661
+ 112,
2662
+ 108,
2663
+ 97,
2664
+ 116,
2665
+ 101,
2666
+ 95,
2667
+ 105,
2668
+ 100,
2669
+ 125,
2670
+ ]),
2671
+ ],
2672
+ },
2673
+ },
2674
+ },
2675
+ /** DeleteSandboxTemplate retires a template that has no active sandboxes. */
2676
+ deleteSandboxTemplate: {
2677
+ name: "DeleteSandboxTemplate",
2678
+ requestType: DeleteSandboxTemplateRequest,
2679
+ requestStream: false,
2680
+ responseType: SandboxTemplate,
2681
+ responseStream: false,
2682
+ options: {
2683
+ _unknownFields: {
2684
+ 578365826: [
2685
+ Buffer.from([
2686
+ 59,
2687
+ 42,
2688
+ 57,
2689
+ 47,
2690
+ 99,
2691
+ 111,
2692
+ 110,
2693
+ 116,
2694
+ 114,
2695
+ 111,
2696
+ 108,
2697
+ 47,
2698
+ 118,
2699
+ 49,
2700
+ 47,
2701
+ 111,
2702
+ 114,
2703
+ 103,
2704
+ 115,
2705
+ 47,
2706
+ 123,
2707
+ 111,
2708
+ 114,
2709
+ 103,
2710
+ 95,
2711
+ 105,
2712
+ 100,
2713
+ 125,
2714
+ 47,
2715
+ 115,
2716
+ 97,
2717
+ 110,
2718
+ 100,
2719
+ 98,
2720
+ 111,
2721
+ 120,
2722
+ 45,
2723
+ 116,
2724
+ 101,
2725
+ 109,
2726
+ 112,
2727
+ 108,
2728
+ 97,
2729
+ 116,
2730
+ 101,
2731
+ 115,
2732
+ 47,
2733
+ 123,
2734
+ 116,
2735
+ 101,
2736
+ 109,
2737
+ 112,
2738
+ 108,
2739
+ 97,
2740
+ 116,
2741
+ 101,
2742
+ 95,
2743
+ 105,
2744
+ 100,
2745
+ 125,
2746
+ ]),
2747
+ ],
2748
+ },
2749
+ },
2750
+ },
2751
+ /** ListSandboxes returns non-deleted sandboxes for an organization. */
2752
+ listSandboxes: {
2753
+ name: "ListSandboxes",
2754
+ requestType: ListSandboxesRequest,
2755
+ requestStream: false,
2756
+ responseType: ListSandboxesResponse,
2757
+ responseStream: false,
2758
+ options: {
2759
+ _unknownFields: {
2760
+ 578365826: [
2761
+ Buffer.from([
2762
+ 37,
2763
+ 18,
2764
+ 35,
2765
+ 47,
2766
+ 99,
2767
+ 111,
2768
+ 110,
2769
+ 116,
2770
+ 114,
2771
+ 111,
2772
+ 108,
2773
+ 47,
2774
+ 118,
2775
+ 49,
2776
+ 47,
2777
+ 111,
2778
+ 114,
2779
+ 103,
2780
+ 115,
2781
+ 47,
2782
+ 123,
2783
+ 111,
2784
+ 114,
2785
+ 103,
2786
+ 95,
2787
+ 105,
2788
+ 100,
2789
+ 125,
2790
+ 47,
2791
+ 115,
2792
+ 97,
2793
+ 110,
2794
+ 100,
2795
+ 98,
2796
+ 111,
2797
+ 120,
2798
+ 101,
2799
+ 115,
2800
+ ]),
2801
+ ],
2802
+ },
2803
+ },
2804
+ },
2805
+ /** CreateSandbox starts an isolated sandbox from a ready template. */
2806
+ createSandbox: {
2807
+ name: "CreateSandbox",
2808
+ requestType: CreateCodeSandboxRequest,
2809
+ requestStream: false,
2810
+ responseType: CodeSandbox,
2811
+ responseStream: false,
2812
+ options: {
2813
+ _unknownFields: {
2814
+ 578365826: [
2815
+ Buffer.from([
2816
+ 40,
2817
+ 34,
2818
+ 35,
2819
+ 47,
2820
+ 99,
2821
+ 111,
2822
+ 110,
2823
+ 116,
2824
+ 114,
2825
+ 111,
2826
+ 108,
2827
+ 47,
2828
+ 118,
2829
+ 49,
2830
+ 47,
2831
+ 111,
2832
+ 114,
2833
+ 103,
2834
+ 115,
2835
+ 47,
2836
+ 123,
2837
+ 111,
2838
+ 114,
2839
+ 103,
2840
+ 95,
2841
+ 105,
2842
+ 100,
2843
+ 125,
2844
+ 47,
2845
+ 115,
2846
+ 97,
2847
+ 110,
2848
+ 100,
2849
+ 98,
2850
+ 111,
2851
+ 120,
2852
+ 101,
2853
+ 115,
2854
+ 58,
2855
+ 1,
2856
+ 42,
2857
+ ]),
2858
+ ],
2859
+ },
2860
+ },
2861
+ },
2862
+ /** GetSandbox returns a sandbox by identifier. */
2863
+ getSandbox: {
2864
+ name: "GetSandbox",
2865
+ requestType: GetCodeSandboxRequest,
2866
+ requestStream: false,
2867
+ responseType: CodeSandbox,
2868
+ responseStream: false,
2869
+ options: {
2870
+ _unknownFields: {
2871
+ 578365826: [
2872
+ Buffer.from([
2873
+ 50,
2874
+ 18,
2875
+ 48,
2876
+ 47,
2877
+ 99,
2878
+ 111,
2879
+ 110,
2880
+ 116,
2881
+ 114,
2882
+ 111,
2883
+ 108,
2884
+ 47,
2885
+ 118,
2886
+ 49,
2887
+ 47,
2888
+ 111,
2889
+ 114,
2890
+ 103,
2891
+ 115,
2892
+ 47,
2893
+ 123,
2894
+ 111,
2895
+ 114,
2896
+ 103,
2897
+ 95,
2898
+ 105,
2899
+ 100,
2900
+ 125,
2901
+ 47,
2902
+ 115,
2903
+ 97,
2904
+ 110,
2905
+ 100,
2906
+ 98,
2907
+ 111,
2908
+ 120,
2909
+ 101,
2910
+ 115,
2911
+ 47,
2912
+ 123,
2913
+ 115,
2914
+ 97,
2915
+ 110,
2916
+ 100,
2917
+ 98,
2918
+ 111,
2919
+ 120,
2920
+ 95,
2921
+ 105,
2922
+ 100,
2923
+ 125,
2924
+ ]),
2925
+ ],
2926
+ },
2927
+ },
2928
+ },
2929
+ /** DeleteSandbox stops and deletes a sandbox. Repeated deletion is safe. */
2930
+ deleteSandbox: {
2931
+ name: "DeleteSandbox",
2932
+ requestType: DeleteCodeSandboxRequest,
2933
+ requestStream: false,
2934
+ responseType: CodeSandbox,
2935
+ responseStream: false,
2936
+ options: {
2937
+ _unknownFields: {
2938
+ 578365826: [
2939
+ Buffer.from([
2940
+ 50,
2941
+ 42,
2942
+ 48,
2943
+ 47,
2944
+ 99,
2945
+ 111,
2946
+ 110,
2947
+ 116,
2948
+ 114,
2949
+ 111,
2950
+ 108,
2951
+ 47,
2952
+ 118,
2953
+ 49,
2954
+ 47,
2955
+ 111,
2956
+ 114,
2957
+ 103,
2958
+ 115,
2959
+ 47,
2960
+ 123,
2961
+ 111,
2962
+ 114,
2963
+ 103,
2964
+ 95,
2965
+ 105,
2966
+ 100,
2967
+ 125,
2968
+ 47,
2969
+ 115,
2970
+ 97,
2971
+ 110,
2972
+ 100,
2973
+ 98,
2974
+ 111,
2975
+ 120,
2976
+ 101,
2977
+ 115,
2978
+ 47,
2979
+ 123,
2980
+ 115,
2981
+ 97,
2982
+ 110,
2983
+ 100,
2984
+ 98,
2985
+ 111,
2986
+ 120,
2987
+ 95,
2988
+ 105,
2989
+ 100,
2990
+ 125,
2991
+ ]),
2992
+ ],
2993
+ },
2994
+ },
2995
+ },
2996
+ /** Execute runs one source-code payload in a ready sandbox. */
2997
+ execute: {
2998
+ name: "Execute",
2999
+ requestType: ExecuteRequest,
3000
+ requestStream: false,
3001
+ responseType: Execution,
3002
+ responseStream: false,
3003
+ options: {
3004
+ _unknownFields: {
3005
+ 578365826: [
3006
+ Buffer.from([
3007
+ 61,
3008
+ 34,
3009
+ 56,
3010
+ 47,
3011
+ 99,
3012
+ 111,
3013
+ 110,
3014
+ 116,
3015
+ 114,
3016
+ 111,
3017
+ 108,
3018
+ 47,
3019
+ 118,
3020
+ 49,
3021
+ 47,
3022
+ 111,
3023
+ 114,
3024
+ 103,
3025
+ 115,
3026
+ 47,
3027
+ 123,
3028
+ 111,
3029
+ 114,
3030
+ 103,
3031
+ 95,
3032
+ 105,
3033
+ 100,
3034
+ 125,
3035
+ 47,
3036
+ 115,
3037
+ 97,
3038
+ 110,
3039
+ 100,
3040
+ 98,
3041
+ 111,
3042
+ 120,
3043
+ 101,
3044
+ 115,
3045
+ 47,
3046
+ 123,
3047
+ 115,
3048
+ 97,
3049
+ 110,
3050
+ 100,
3051
+ 98,
3052
+ 111,
3053
+ 120,
3054
+ 95,
3055
+ 105,
3056
+ 100,
3057
+ 125,
3058
+ 58,
3059
+ 101,
3060
+ 120,
3061
+ 101,
3062
+ 99,
3063
+ 117,
3064
+ 116,
3065
+ 101,
3066
+ 58,
3067
+ 1,
3068
+ 42,
3069
+ ]),
3070
+ ],
3071
+ },
3072
+ },
3073
+ },
3074
+ /** GetExecution returns execution status and retained output. */
3075
+ getExecution: {
3076
+ name: "GetExecution",
3077
+ requestType: GetExecutionRequest,
3078
+ requestStream: false,
3079
+ responseType: Execution,
3080
+ responseStream: false,
3081
+ options: {
3082
+ _unknownFields: {
3083
+ 578365826: [
3084
+ Buffer.from([
3085
+ 76,
3086
+ 18,
3087
+ 74,
3088
+ 47,
3089
+ 99,
3090
+ 111,
3091
+ 110,
3092
+ 116,
3093
+ 114,
3094
+ 111,
3095
+ 108,
3096
+ 47,
3097
+ 118,
3098
+ 49,
3099
+ 47,
3100
+ 111,
3101
+ 114,
3102
+ 103,
3103
+ 115,
3104
+ 47,
3105
+ 123,
3106
+ 111,
3107
+ 114,
3108
+ 103,
3109
+ 95,
3110
+ 105,
3111
+ 100,
3112
+ 125,
3113
+ 47,
3114
+ 115,
3115
+ 97,
3116
+ 110,
3117
+ 100,
3118
+ 98,
3119
+ 111,
3120
+ 120,
3121
+ 101,
3122
+ 115,
3123
+ 47,
3124
+ 123,
3125
+ 115,
3126
+ 97,
3127
+ 110,
3128
+ 100,
3129
+ 98,
3130
+ 111,
3131
+ 120,
3132
+ 95,
3133
+ 105,
3134
+ 100,
3135
+ 125,
3136
+ 47,
3137
+ 101,
3138
+ 120,
3139
+ 101,
3140
+ 99,
3141
+ 117,
3142
+ 116,
3143
+ 105,
3144
+ 111,
3145
+ 110,
3146
+ 115,
3147
+ 47,
3148
+ 123,
3149
+ 101,
3150
+ 120,
3151
+ 101,
3152
+ 99,
3153
+ 117,
3154
+ 116,
3155
+ 105,
3156
+ 111,
3157
+ 110,
3158
+ 95,
3159
+ 105,
3160
+ 100,
3161
+ 125,
3162
+ ]),
3163
+ ],
3164
+ },
3165
+ },
3166
+ },
3167
+ },
3168
+ };
3169
+ function toTimestamp(date) {
3170
+ const seconds = BigInt(Math.trunc(date.getTime() / 1_000));
3171
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
3172
+ return { seconds, nanos };
3173
+ }
3174
+ function fromTimestamp(t) {
3175
+ let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1_000;
3176
+ millis += (t.nanos || 0) / 1_000_000;
3177
+ return new globalThis.Date(millis);
3178
+ }
3179
+ function fromJsonTimestamp(o) {
3180
+ if (o instanceof globalThis.Date) {
3181
+ return o;
3182
+ }
3183
+ else if (typeof o === "string") {
3184
+ return new globalThis.Date(o);
3185
+ }
3186
+ else {
3187
+ return fromTimestamp(Timestamp.fromJSON(o));
3188
+ }
3189
+ }
3190
+ function isSet(value) {
3191
+ return value !== null && value !== undefined;
3192
+ }