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