@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,3917 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.4
4
+ // protoc v3.19.1
5
+ // source: tarka/provisioning/v1/source_builds.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { Timestamp } from "../../../google/protobuf/timestamp.js";
9
+ export const protobufPackage = "tarka.provisioning.v1";
10
+ function createBaseStartGitHubSourceAuthorizationRequest() {
11
+ return { orgId: "" };
12
+ }
13
+ export const StartGitHubSourceAuthorizationRequest = {
14
+ encode(message, writer = new BinaryWriter()) {
15
+ if (message.orgId !== "") {
16
+ writer.uint32(10).string(message.orgId);
17
+ }
18
+ return writer;
19
+ },
20
+ decode(input, length) {
21
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
22
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
23
+ if (previousRecursionDepth >= 100) {
24
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
25
+ }
26
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
27
+ try {
28
+ const end = length === undefined ? reader.len : reader.pos + length;
29
+ const message = createBaseStartGitHubSourceAuthorizationRequest();
30
+ while (reader.pos < end) {
31
+ const tag = reader.uint32();
32
+ switch (tag >>> 3) {
33
+ case 1: {
34
+ if (tag !== 10) {
35
+ break;
36
+ }
37
+ message.orgId = reader.string();
38
+ continue;
39
+ }
40
+ }
41
+ if ((tag & 7) === 4 || tag === 0) {
42
+ break;
43
+ }
44
+ reader.skip(tag & 7);
45
+ }
46
+ return message;
47
+ }
48
+ finally {
49
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
50
+ }
51
+ },
52
+ fromJSON(object) {
53
+ return {
54
+ orgId: isSet(object.orgId)
55
+ ? globalThis.String(object.orgId)
56
+ : isSet(object.org_id)
57
+ ? globalThis.String(object.org_id)
58
+ : "",
59
+ };
60
+ },
61
+ toJSON(message) {
62
+ const obj = {};
63
+ if (message.orgId !== "") {
64
+ obj.orgId = message.orgId;
65
+ }
66
+ return obj;
67
+ },
68
+ create(base) {
69
+ return StartGitHubSourceAuthorizationRequest.fromPartial(base ?? {});
70
+ },
71
+ fromPartial(object) {
72
+ const message = createBaseStartGitHubSourceAuthorizationRequest();
73
+ message.orgId = object.orgId ?? "";
74
+ return message;
75
+ },
76
+ };
77
+ function createBaseGitHubSourceAuthorization() {
78
+ return { id: "", authorizationUrl: "", expiresAt: undefined };
79
+ }
80
+ export const GitHubSourceAuthorization = {
81
+ encode(message, writer = new BinaryWriter()) {
82
+ if (message.id !== "") {
83
+ writer.uint32(10).string(message.id);
84
+ }
85
+ if (message.authorizationUrl !== "") {
86
+ writer.uint32(18).string(message.authorizationUrl);
87
+ }
88
+ if (message.expiresAt !== undefined) {
89
+ Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(26).fork()).join();
90
+ }
91
+ return writer;
92
+ },
93
+ decode(input, length) {
94
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
95
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
96
+ if (previousRecursionDepth >= 100) {
97
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
98
+ }
99
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
100
+ try {
101
+ const end = length === undefined ? reader.len : reader.pos + length;
102
+ const message = createBaseGitHubSourceAuthorization();
103
+ while (reader.pos < end) {
104
+ const tag = reader.uint32();
105
+ switch (tag >>> 3) {
106
+ case 1: {
107
+ if (tag !== 10) {
108
+ break;
109
+ }
110
+ message.id = reader.string();
111
+ continue;
112
+ }
113
+ case 2: {
114
+ if (tag !== 18) {
115
+ break;
116
+ }
117
+ message.authorizationUrl = reader.string();
118
+ continue;
119
+ }
120
+ case 3: {
121
+ if (tag !== 26) {
122
+ break;
123
+ }
124
+ message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
125
+ continue;
126
+ }
127
+ }
128
+ if ((tag & 7) === 4 || tag === 0) {
129
+ break;
130
+ }
131
+ reader.skip(tag & 7);
132
+ }
133
+ return message;
134
+ }
135
+ finally {
136
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
137
+ }
138
+ },
139
+ fromJSON(object) {
140
+ return {
141
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
142
+ authorizationUrl: isSet(object.authorizationUrl)
143
+ ? globalThis.String(object.authorizationUrl)
144
+ : isSet(object.authorization_url)
145
+ ? globalThis.String(object.authorization_url)
146
+ : "",
147
+ expiresAt: isSet(object.expiresAt)
148
+ ? fromJsonTimestamp(object.expiresAt)
149
+ : isSet(object.expires_at)
150
+ ? fromJsonTimestamp(object.expires_at)
151
+ : undefined,
152
+ };
153
+ },
154
+ toJSON(message) {
155
+ const obj = {};
156
+ if (message.id !== "") {
157
+ obj.id = message.id;
158
+ }
159
+ if (message.authorizationUrl !== "") {
160
+ obj.authorizationUrl = message.authorizationUrl;
161
+ }
162
+ if (message.expiresAt !== undefined) {
163
+ obj.expiresAt = message.expiresAt.toISOString();
164
+ }
165
+ return obj;
166
+ },
167
+ create(base) {
168
+ return GitHubSourceAuthorization.fromPartial(base ?? {});
169
+ },
170
+ fromPartial(object) {
171
+ const message = createBaseGitHubSourceAuthorization();
172
+ message.id = object.id ?? "";
173
+ message.authorizationUrl = object.authorizationUrl ?? "";
174
+ message.expiresAt = object.expiresAt ?? undefined;
175
+ return message;
176
+ },
177
+ };
178
+ function createBaseListGitHubSourceInstallationsRequest() {
179
+ return { orgId: "", authorizationId: "" };
180
+ }
181
+ export const ListGitHubSourceInstallationsRequest = {
182
+ encode(message, writer = new BinaryWriter()) {
183
+ if (message.orgId !== "") {
184
+ writer.uint32(10).string(message.orgId);
185
+ }
186
+ if (message.authorizationId !== "") {
187
+ writer.uint32(18).string(message.authorizationId);
188
+ }
189
+ return writer;
190
+ },
191
+ decode(input, length) {
192
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
193
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
194
+ if (previousRecursionDepth >= 100) {
195
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
196
+ }
197
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
198
+ try {
199
+ const end = length === undefined ? reader.len : reader.pos + length;
200
+ const message = createBaseListGitHubSourceInstallationsRequest();
201
+ while (reader.pos < end) {
202
+ const tag = reader.uint32();
203
+ switch (tag >>> 3) {
204
+ case 1: {
205
+ if (tag !== 10) {
206
+ break;
207
+ }
208
+ message.orgId = reader.string();
209
+ continue;
210
+ }
211
+ case 2: {
212
+ if (tag !== 18) {
213
+ break;
214
+ }
215
+ message.authorizationId = reader.string();
216
+ continue;
217
+ }
218
+ }
219
+ if ((tag & 7) === 4 || tag === 0) {
220
+ break;
221
+ }
222
+ reader.skip(tag & 7);
223
+ }
224
+ return message;
225
+ }
226
+ finally {
227
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
228
+ }
229
+ },
230
+ fromJSON(object) {
231
+ return {
232
+ orgId: isSet(object.orgId)
233
+ ? globalThis.String(object.orgId)
234
+ : isSet(object.org_id)
235
+ ? globalThis.String(object.org_id)
236
+ : "",
237
+ authorizationId: isSet(object.authorizationId)
238
+ ? globalThis.String(object.authorizationId)
239
+ : isSet(object.authorization_id)
240
+ ? globalThis.String(object.authorization_id)
241
+ : "",
242
+ };
243
+ },
244
+ toJSON(message) {
245
+ const obj = {};
246
+ if (message.orgId !== "") {
247
+ obj.orgId = message.orgId;
248
+ }
249
+ if (message.authorizationId !== "") {
250
+ obj.authorizationId = message.authorizationId;
251
+ }
252
+ return obj;
253
+ },
254
+ create(base) {
255
+ return ListGitHubSourceInstallationsRequest.fromPartial(base ?? {});
256
+ },
257
+ fromPartial(object) {
258
+ const message = createBaseListGitHubSourceInstallationsRequest();
259
+ message.orgId = object.orgId ?? "";
260
+ message.authorizationId = object.authorizationId ?? "";
261
+ return message;
262
+ },
263
+ };
264
+ function createBaseGitHubSourceInstallation() {
265
+ return { id: 0n, account: "" };
266
+ }
267
+ export const GitHubSourceInstallation = {
268
+ encode(message, writer = new BinaryWriter()) {
269
+ if (message.id !== 0n) {
270
+ if (BigInt.asIntN(64, message.id) !== message.id) {
271
+ throw new globalThis.Error("value provided for field message.id of type int64 too large");
272
+ }
273
+ writer.uint32(8).int64(message.id);
274
+ }
275
+ if (message.account !== "") {
276
+ writer.uint32(18).string(message.account);
277
+ }
278
+ return writer;
279
+ },
280
+ decode(input, length) {
281
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
282
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
283
+ if (previousRecursionDepth >= 100) {
284
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
285
+ }
286
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
287
+ try {
288
+ const end = length === undefined ? reader.len : reader.pos + length;
289
+ const message = createBaseGitHubSourceInstallation();
290
+ while (reader.pos < end) {
291
+ const tag = reader.uint32();
292
+ switch (tag >>> 3) {
293
+ case 1: {
294
+ if (tag !== 8) {
295
+ break;
296
+ }
297
+ message.id = reader.int64();
298
+ continue;
299
+ }
300
+ case 2: {
301
+ if (tag !== 18) {
302
+ break;
303
+ }
304
+ message.account = reader.string();
305
+ continue;
306
+ }
307
+ }
308
+ if ((tag & 7) === 4 || tag === 0) {
309
+ break;
310
+ }
311
+ reader.skip(tag & 7);
312
+ }
313
+ return message;
314
+ }
315
+ finally {
316
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
317
+ }
318
+ },
319
+ fromJSON(object) {
320
+ return {
321
+ id: isSet(object.id) ? BigInt(object.id) : 0n,
322
+ account: isSet(object.account) ? globalThis.String(object.account) : "",
323
+ };
324
+ },
325
+ toJSON(message) {
326
+ const obj = {};
327
+ if (message.id !== 0n) {
328
+ obj.id = message.id.toString();
329
+ }
330
+ if (message.account !== "") {
331
+ obj.account = message.account;
332
+ }
333
+ return obj;
334
+ },
335
+ create(base) {
336
+ return GitHubSourceInstallation.fromPartial(base ?? {});
337
+ },
338
+ fromPartial(object) {
339
+ const message = createBaseGitHubSourceInstallation();
340
+ message.id = (object.id !== undefined && object.id !== null) ? BigInt(object.id) : 0n;
341
+ message.account = object.account ?? "";
342
+ return message;
343
+ },
344
+ };
345
+ function createBaseListGitHubSourceInstallationsResponse() {
346
+ return { installations: [], installationUrl: "" };
347
+ }
348
+ export const ListGitHubSourceInstallationsResponse = {
349
+ encode(message, writer = new BinaryWriter()) {
350
+ for (const v of message.installations) {
351
+ GitHubSourceInstallation.encode(v, writer.uint32(10).fork()).join();
352
+ }
353
+ if (message.installationUrl !== "") {
354
+ writer.uint32(18).string(message.installationUrl);
355
+ }
356
+ return writer;
357
+ },
358
+ decode(input, length) {
359
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
360
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
361
+ if (previousRecursionDepth >= 100) {
362
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
363
+ }
364
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
365
+ try {
366
+ const end = length === undefined ? reader.len : reader.pos + length;
367
+ const message = createBaseListGitHubSourceInstallationsResponse();
368
+ while (reader.pos < end) {
369
+ const tag = reader.uint32();
370
+ switch (tag >>> 3) {
371
+ case 1: {
372
+ if (tag !== 10) {
373
+ break;
374
+ }
375
+ message.installations.push(GitHubSourceInstallation.decode(reader, reader.uint32()));
376
+ continue;
377
+ }
378
+ case 2: {
379
+ if (tag !== 18) {
380
+ break;
381
+ }
382
+ message.installationUrl = reader.string();
383
+ continue;
384
+ }
385
+ }
386
+ if ((tag & 7) === 4 || tag === 0) {
387
+ break;
388
+ }
389
+ reader.skip(tag & 7);
390
+ }
391
+ return message;
392
+ }
393
+ finally {
394
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
395
+ }
396
+ },
397
+ fromJSON(object) {
398
+ return {
399
+ installations: globalThis.Array.isArray(object?.installations)
400
+ ? object.installations.map((e) => GitHubSourceInstallation.fromJSON(e))
401
+ : [],
402
+ installationUrl: isSet(object.installationUrl)
403
+ ? globalThis.String(object.installationUrl)
404
+ : isSet(object.installation_url)
405
+ ? globalThis.String(object.installation_url)
406
+ : "",
407
+ };
408
+ },
409
+ toJSON(message) {
410
+ const obj = {};
411
+ if (message.installations?.length) {
412
+ obj.installations = message.installations.map((e) => GitHubSourceInstallation.toJSON(e));
413
+ }
414
+ if (message.installationUrl !== "") {
415
+ obj.installationUrl = message.installationUrl;
416
+ }
417
+ return obj;
418
+ },
419
+ create(base) {
420
+ return ListGitHubSourceInstallationsResponse.fromPartial(base ?? {});
421
+ },
422
+ fromPartial(object) {
423
+ const message = createBaseListGitHubSourceInstallationsResponse();
424
+ message.installations = object.installations?.map((e) => GitHubSourceInstallation.fromPartial(e)) || [];
425
+ message.installationUrl = object.installationUrl ?? "";
426
+ return message;
427
+ },
428
+ };
429
+ function createBaseListGitHubSourceRepositoriesRequest() {
430
+ return { orgId: "", authorizationId: "", installationId: 0n };
431
+ }
432
+ export const ListGitHubSourceRepositoriesRequest = {
433
+ encode(message, writer = new BinaryWriter()) {
434
+ if (message.orgId !== "") {
435
+ writer.uint32(10).string(message.orgId);
436
+ }
437
+ if (message.authorizationId !== "") {
438
+ writer.uint32(18).string(message.authorizationId);
439
+ }
440
+ if (message.installationId !== 0n) {
441
+ if (BigInt.asIntN(64, message.installationId) !== message.installationId) {
442
+ throw new globalThis.Error("value provided for field message.installationId of type int64 too large");
443
+ }
444
+ writer.uint32(24).int64(message.installationId);
445
+ }
446
+ return writer;
447
+ },
448
+ decode(input, length) {
449
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
450
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
451
+ if (previousRecursionDepth >= 100) {
452
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
453
+ }
454
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
455
+ try {
456
+ const end = length === undefined ? reader.len : reader.pos + length;
457
+ const message = createBaseListGitHubSourceRepositoriesRequest();
458
+ while (reader.pos < end) {
459
+ const tag = reader.uint32();
460
+ switch (tag >>> 3) {
461
+ case 1: {
462
+ if (tag !== 10) {
463
+ break;
464
+ }
465
+ message.orgId = reader.string();
466
+ continue;
467
+ }
468
+ case 2: {
469
+ if (tag !== 18) {
470
+ break;
471
+ }
472
+ message.authorizationId = reader.string();
473
+ continue;
474
+ }
475
+ case 3: {
476
+ if (tag !== 24) {
477
+ break;
478
+ }
479
+ message.installationId = reader.int64();
480
+ continue;
481
+ }
482
+ }
483
+ if ((tag & 7) === 4 || tag === 0) {
484
+ break;
485
+ }
486
+ reader.skip(tag & 7);
487
+ }
488
+ return message;
489
+ }
490
+ finally {
491
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
492
+ }
493
+ },
494
+ fromJSON(object) {
495
+ return {
496
+ orgId: isSet(object.orgId)
497
+ ? globalThis.String(object.orgId)
498
+ : isSet(object.org_id)
499
+ ? globalThis.String(object.org_id)
500
+ : "",
501
+ authorizationId: isSet(object.authorizationId)
502
+ ? globalThis.String(object.authorizationId)
503
+ : isSet(object.authorization_id)
504
+ ? globalThis.String(object.authorization_id)
505
+ : "",
506
+ installationId: isSet(object.installationId)
507
+ ? BigInt(object.installationId)
508
+ : isSet(object.installation_id)
509
+ ? BigInt(object.installation_id)
510
+ : 0n,
511
+ };
512
+ },
513
+ toJSON(message) {
514
+ const obj = {};
515
+ if (message.orgId !== "") {
516
+ obj.orgId = message.orgId;
517
+ }
518
+ if (message.authorizationId !== "") {
519
+ obj.authorizationId = message.authorizationId;
520
+ }
521
+ if (message.installationId !== 0n) {
522
+ obj.installationId = message.installationId.toString();
523
+ }
524
+ return obj;
525
+ },
526
+ create(base) {
527
+ return ListGitHubSourceRepositoriesRequest.fromPartial(base ?? {});
528
+ },
529
+ fromPartial(object) {
530
+ const message = createBaseListGitHubSourceRepositoriesRequest();
531
+ message.orgId = object.orgId ?? "";
532
+ message.authorizationId = object.authorizationId ?? "";
533
+ message.installationId = (object.installationId !== undefined && object.installationId !== null)
534
+ ? BigInt(object.installationId)
535
+ : 0n;
536
+ return message;
537
+ },
538
+ };
539
+ function createBaseGitHubSourceRepository() {
540
+ return { id: 0n, fullName: "", defaultBranch: "", private: false };
541
+ }
542
+ export const GitHubSourceRepository = {
543
+ encode(message, writer = new BinaryWriter()) {
544
+ if (message.id !== 0n) {
545
+ if (BigInt.asIntN(64, message.id) !== message.id) {
546
+ throw new globalThis.Error("value provided for field message.id of type int64 too large");
547
+ }
548
+ writer.uint32(8).int64(message.id);
549
+ }
550
+ if (message.fullName !== "") {
551
+ writer.uint32(18).string(message.fullName);
552
+ }
553
+ if (message.defaultBranch !== "") {
554
+ writer.uint32(26).string(message.defaultBranch);
555
+ }
556
+ if (message.private !== false) {
557
+ writer.uint32(32).bool(message.private);
558
+ }
559
+ return writer;
560
+ },
561
+ decode(input, length) {
562
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
563
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
564
+ if (previousRecursionDepth >= 100) {
565
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
566
+ }
567
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
568
+ try {
569
+ const end = length === undefined ? reader.len : reader.pos + length;
570
+ const message = createBaseGitHubSourceRepository();
571
+ while (reader.pos < end) {
572
+ const tag = reader.uint32();
573
+ switch (tag >>> 3) {
574
+ case 1: {
575
+ if (tag !== 8) {
576
+ break;
577
+ }
578
+ message.id = reader.int64();
579
+ continue;
580
+ }
581
+ case 2: {
582
+ if (tag !== 18) {
583
+ break;
584
+ }
585
+ message.fullName = reader.string();
586
+ continue;
587
+ }
588
+ case 3: {
589
+ if (tag !== 26) {
590
+ break;
591
+ }
592
+ message.defaultBranch = reader.string();
593
+ continue;
594
+ }
595
+ case 4: {
596
+ if (tag !== 32) {
597
+ break;
598
+ }
599
+ message.private = reader.bool();
600
+ continue;
601
+ }
602
+ }
603
+ if ((tag & 7) === 4 || tag === 0) {
604
+ break;
605
+ }
606
+ reader.skip(tag & 7);
607
+ }
608
+ return message;
609
+ }
610
+ finally {
611
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
612
+ }
613
+ },
614
+ fromJSON(object) {
615
+ return {
616
+ id: isSet(object.id) ? BigInt(object.id) : 0n,
617
+ fullName: isSet(object.fullName)
618
+ ? globalThis.String(object.fullName)
619
+ : isSet(object.full_name)
620
+ ? globalThis.String(object.full_name)
621
+ : "",
622
+ defaultBranch: isSet(object.defaultBranch)
623
+ ? globalThis.String(object.defaultBranch)
624
+ : isSet(object.default_branch)
625
+ ? globalThis.String(object.default_branch)
626
+ : "",
627
+ private: isSet(object.private) ? globalThis.Boolean(object.private) : false,
628
+ };
629
+ },
630
+ toJSON(message) {
631
+ const obj = {};
632
+ if (message.id !== 0n) {
633
+ obj.id = message.id.toString();
634
+ }
635
+ if (message.fullName !== "") {
636
+ obj.fullName = message.fullName;
637
+ }
638
+ if (message.defaultBranch !== "") {
639
+ obj.defaultBranch = message.defaultBranch;
640
+ }
641
+ if (message.private !== false) {
642
+ obj.private = message.private;
643
+ }
644
+ return obj;
645
+ },
646
+ create(base) {
647
+ return GitHubSourceRepository.fromPartial(base ?? {});
648
+ },
649
+ fromPartial(object) {
650
+ const message = createBaseGitHubSourceRepository();
651
+ message.id = (object.id !== undefined && object.id !== null) ? BigInt(object.id) : 0n;
652
+ message.fullName = object.fullName ?? "";
653
+ message.defaultBranch = object.defaultBranch ?? "";
654
+ message.private = object.private ?? false;
655
+ return message;
656
+ },
657
+ };
658
+ function createBaseListGitHubSourceRepositoriesResponse() {
659
+ return { repositories: [] };
660
+ }
661
+ export const ListGitHubSourceRepositoriesResponse = {
662
+ encode(message, writer = new BinaryWriter()) {
663
+ for (const v of message.repositories) {
664
+ GitHubSourceRepository.encode(v, writer.uint32(10).fork()).join();
665
+ }
666
+ return writer;
667
+ },
668
+ decode(input, length) {
669
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
670
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
671
+ if (previousRecursionDepth >= 100) {
672
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
673
+ }
674
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
675
+ try {
676
+ const end = length === undefined ? reader.len : reader.pos + length;
677
+ const message = createBaseListGitHubSourceRepositoriesResponse();
678
+ while (reader.pos < end) {
679
+ const tag = reader.uint32();
680
+ switch (tag >>> 3) {
681
+ case 1: {
682
+ if (tag !== 10) {
683
+ break;
684
+ }
685
+ message.repositories.push(GitHubSourceRepository.decode(reader, reader.uint32()));
686
+ continue;
687
+ }
688
+ }
689
+ if ((tag & 7) === 4 || tag === 0) {
690
+ break;
691
+ }
692
+ reader.skip(tag & 7);
693
+ }
694
+ return message;
695
+ }
696
+ finally {
697
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
698
+ }
699
+ },
700
+ fromJSON(object) {
701
+ return {
702
+ repositories: globalThis.Array.isArray(object?.repositories)
703
+ ? object.repositories.map((e) => GitHubSourceRepository.fromJSON(e))
704
+ : [],
705
+ };
706
+ },
707
+ toJSON(message) {
708
+ const obj = {};
709
+ if (message.repositories?.length) {
710
+ obj.repositories = message.repositories.map((e) => GitHubSourceRepository.toJSON(e));
711
+ }
712
+ return obj;
713
+ },
714
+ create(base) {
715
+ return ListGitHubSourceRepositoriesResponse.fromPartial(base ?? {});
716
+ },
717
+ fromPartial(object) {
718
+ const message = createBaseListGitHubSourceRepositoriesResponse();
719
+ message.repositories = object.repositories?.map((e) => GitHubSourceRepository.fromPartial(e)) || [];
720
+ return message;
721
+ },
722
+ };
723
+ function createBaseConnectGitHubSourceRequest() {
724
+ return { orgId: "", authorizationId: "", installationId: 0n, repositoryIds: [] };
725
+ }
726
+ export const ConnectGitHubSourceRequest = {
727
+ encode(message, writer = new BinaryWriter()) {
728
+ if (message.orgId !== "") {
729
+ writer.uint32(10).string(message.orgId);
730
+ }
731
+ if (message.authorizationId !== "") {
732
+ writer.uint32(18).string(message.authorizationId);
733
+ }
734
+ if (message.installationId !== 0n) {
735
+ if (BigInt.asIntN(64, message.installationId) !== message.installationId) {
736
+ throw new globalThis.Error("value provided for field message.installationId of type int64 too large");
737
+ }
738
+ writer.uint32(24).int64(message.installationId);
739
+ }
740
+ for (const v of message.repositoryIds) {
741
+ if (BigInt.asIntN(64, v) !== v) {
742
+ throw new globalThis.Error("value provided for field v! of type int64 too large");
743
+ }
744
+ writer.uint32(32).int64(v);
745
+ }
746
+ return writer;
747
+ },
748
+ decode(input, length) {
749
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
750
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
751
+ if (previousRecursionDepth >= 100) {
752
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
753
+ }
754
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
755
+ try {
756
+ const end = length === undefined ? reader.len : reader.pos + length;
757
+ const message = createBaseConnectGitHubSourceRequest();
758
+ while (reader.pos < end) {
759
+ const tag = reader.uint32();
760
+ switch (tag >>> 3) {
761
+ case 1: {
762
+ if (tag !== 10) {
763
+ break;
764
+ }
765
+ message.orgId = reader.string();
766
+ continue;
767
+ }
768
+ case 2: {
769
+ if (tag !== 18) {
770
+ break;
771
+ }
772
+ message.authorizationId = reader.string();
773
+ continue;
774
+ }
775
+ case 3: {
776
+ if (tag !== 24) {
777
+ break;
778
+ }
779
+ message.installationId = reader.int64();
780
+ continue;
781
+ }
782
+ case 4: {
783
+ if (tag === 32) {
784
+ message.repositoryIds.push(reader.int64());
785
+ continue;
786
+ }
787
+ if (tag === 34) {
788
+ const end2 = reader.uint32() + reader.pos;
789
+ while (reader.pos < end2) {
790
+ message.repositoryIds.push(reader.int64());
791
+ }
792
+ continue;
793
+ }
794
+ break;
795
+ }
796
+ }
797
+ if ((tag & 7) === 4 || tag === 0) {
798
+ break;
799
+ }
800
+ reader.skip(tag & 7);
801
+ }
802
+ return message;
803
+ }
804
+ finally {
805
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
806
+ }
807
+ },
808
+ fromJSON(object) {
809
+ return {
810
+ orgId: isSet(object.orgId)
811
+ ? globalThis.String(object.orgId)
812
+ : isSet(object.org_id)
813
+ ? globalThis.String(object.org_id)
814
+ : "",
815
+ authorizationId: isSet(object.authorizationId)
816
+ ? globalThis.String(object.authorizationId)
817
+ : isSet(object.authorization_id)
818
+ ? globalThis.String(object.authorization_id)
819
+ : "",
820
+ installationId: isSet(object.installationId)
821
+ ? BigInt(object.installationId)
822
+ : isSet(object.installation_id)
823
+ ? BigInt(object.installation_id)
824
+ : 0n,
825
+ repositoryIds: globalThis.Array.isArray(object?.repositoryIds)
826
+ ? object.repositoryIds.map((e) => BigInt(e))
827
+ : globalThis.Array.isArray(object?.repository_ids)
828
+ ? object.repository_ids.map((e) => BigInt(e))
829
+ : [],
830
+ };
831
+ },
832
+ toJSON(message) {
833
+ const obj = {};
834
+ if (message.orgId !== "") {
835
+ obj.orgId = message.orgId;
836
+ }
837
+ if (message.authorizationId !== "") {
838
+ obj.authorizationId = message.authorizationId;
839
+ }
840
+ if (message.installationId !== 0n) {
841
+ obj.installationId = message.installationId.toString();
842
+ }
843
+ if (message.repositoryIds?.length) {
844
+ obj.repositoryIds = message.repositoryIds.map((e) => e.toString());
845
+ }
846
+ return obj;
847
+ },
848
+ create(base) {
849
+ return ConnectGitHubSourceRequest.fromPartial(base ?? {});
850
+ },
851
+ fromPartial(object) {
852
+ const message = createBaseConnectGitHubSourceRequest();
853
+ message.orgId = object.orgId ?? "";
854
+ message.authorizationId = object.authorizationId ?? "";
855
+ message.installationId = (object.installationId !== undefined && object.installationId !== null)
856
+ ? BigInt(object.installationId)
857
+ : 0n;
858
+ message.repositoryIds = object.repositoryIds?.map((e) => BigInt(e)) || [];
859
+ return message;
860
+ },
861
+ };
862
+ function createBaseSourceRepository() {
863
+ return { id: "", fullName: "", defaultBranch: "", status: "" };
864
+ }
865
+ export const SourceRepository = {
866
+ encode(message, writer = new BinaryWriter()) {
867
+ if (message.id !== "") {
868
+ writer.uint32(10).string(message.id);
869
+ }
870
+ if (message.fullName !== "") {
871
+ writer.uint32(18).string(message.fullName);
872
+ }
873
+ if (message.defaultBranch !== "") {
874
+ writer.uint32(26).string(message.defaultBranch);
875
+ }
876
+ if (message.status !== "") {
877
+ writer.uint32(34).string(message.status);
878
+ }
879
+ return writer;
880
+ },
881
+ decode(input, length) {
882
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
883
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
884
+ if (previousRecursionDepth >= 100) {
885
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
886
+ }
887
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
888
+ try {
889
+ const end = length === undefined ? reader.len : reader.pos + length;
890
+ const message = createBaseSourceRepository();
891
+ while (reader.pos < end) {
892
+ const tag = reader.uint32();
893
+ switch (tag >>> 3) {
894
+ case 1: {
895
+ if (tag !== 10) {
896
+ break;
897
+ }
898
+ message.id = reader.string();
899
+ continue;
900
+ }
901
+ case 2: {
902
+ if (tag !== 18) {
903
+ break;
904
+ }
905
+ message.fullName = reader.string();
906
+ continue;
907
+ }
908
+ case 3: {
909
+ if (tag !== 26) {
910
+ break;
911
+ }
912
+ message.defaultBranch = reader.string();
913
+ continue;
914
+ }
915
+ case 4: {
916
+ if (tag !== 34) {
917
+ break;
918
+ }
919
+ message.status = reader.string();
920
+ continue;
921
+ }
922
+ }
923
+ if ((tag & 7) === 4 || tag === 0) {
924
+ break;
925
+ }
926
+ reader.skip(tag & 7);
927
+ }
928
+ return message;
929
+ }
930
+ finally {
931
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
932
+ }
933
+ },
934
+ fromJSON(object) {
935
+ return {
936
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
937
+ fullName: isSet(object.fullName)
938
+ ? globalThis.String(object.fullName)
939
+ : isSet(object.full_name)
940
+ ? globalThis.String(object.full_name)
941
+ : "",
942
+ defaultBranch: isSet(object.defaultBranch)
943
+ ? globalThis.String(object.defaultBranch)
944
+ : isSet(object.default_branch)
945
+ ? globalThis.String(object.default_branch)
946
+ : "",
947
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
948
+ };
949
+ },
950
+ toJSON(message) {
951
+ const obj = {};
952
+ if (message.id !== "") {
953
+ obj.id = message.id;
954
+ }
955
+ if (message.fullName !== "") {
956
+ obj.fullName = message.fullName;
957
+ }
958
+ if (message.defaultBranch !== "") {
959
+ obj.defaultBranch = message.defaultBranch;
960
+ }
961
+ if (message.status !== "") {
962
+ obj.status = message.status;
963
+ }
964
+ return obj;
965
+ },
966
+ create(base) {
967
+ return SourceRepository.fromPartial(base ?? {});
968
+ },
969
+ fromPartial(object) {
970
+ const message = createBaseSourceRepository();
971
+ message.id = object.id ?? "";
972
+ message.fullName = object.fullName ?? "";
973
+ message.defaultBranch = object.defaultBranch ?? "";
974
+ message.status = object.status ?? "";
975
+ return message;
976
+ },
977
+ };
978
+ function createBaseSourceConnection() {
979
+ return { id: "", provider: "", status: "", repositories: [] };
980
+ }
981
+ export const SourceConnection = {
982
+ encode(message, writer = new BinaryWriter()) {
983
+ if (message.id !== "") {
984
+ writer.uint32(10).string(message.id);
985
+ }
986
+ if (message.provider !== "") {
987
+ writer.uint32(18).string(message.provider);
988
+ }
989
+ if (message.status !== "") {
990
+ writer.uint32(26).string(message.status);
991
+ }
992
+ for (const v of message.repositories) {
993
+ SourceRepository.encode(v, writer.uint32(34).fork()).join();
994
+ }
995
+ return writer;
996
+ },
997
+ decode(input, length) {
998
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
999
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1000
+ if (previousRecursionDepth >= 100) {
1001
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1002
+ }
1003
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1004
+ try {
1005
+ const end = length === undefined ? reader.len : reader.pos + length;
1006
+ const message = createBaseSourceConnection();
1007
+ while (reader.pos < end) {
1008
+ const tag = reader.uint32();
1009
+ switch (tag >>> 3) {
1010
+ case 1: {
1011
+ if (tag !== 10) {
1012
+ break;
1013
+ }
1014
+ message.id = reader.string();
1015
+ continue;
1016
+ }
1017
+ case 2: {
1018
+ if (tag !== 18) {
1019
+ break;
1020
+ }
1021
+ message.provider = reader.string();
1022
+ continue;
1023
+ }
1024
+ case 3: {
1025
+ if (tag !== 26) {
1026
+ break;
1027
+ }
1028
+ message.status = reader.string();
1029
+ continue;
1030
+ }
1031
+ case 4: {
1032
+ if (tag !== 34) {
1033
+ break;
1034
+ }
1035
+ message.repositories.push(SourceRepository.decode(reader, reader.uint32()));
1036
+ continue;
1037
+ }
1038
+ }
1039
+ if ((tag & 7) === 4 || tag === 0) {
1040
+ break;
1041
+ }
1042
+ reader.skip(tag & 7);
1043
+ }
1044
+ return message;
1045
+ }
1046
+ finally {
1047
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1048
+ }
1049
+ },
1050
+ fromJSON(object) {
1051
+ return {
1052
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1053
+ provider: isSet(object.provider) ? globalThis.String(object.provider) : "",
1054
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
1055
+ repositories: globalThis.Array.isArray(object?.repositories)
1056
+ ? object.repositories.map((e) => SourceRepository.fromJSON(e))
1057
+ : [],
1058
+ };
1059
+ },
1060
+ toJSON(message) {
1061
+ const obj = {};
1062
+ if (message.id !== "") {
1063
+ obj.id = message.id;
1064
+ }
1065
+ if (message.provider !== "") {
1066
+ obj.provider = message.provider;
1067
+ }
1068
+ if (message.status !== "") {
1069
+ obj.status = message.status;
1070
+ }
1071
+ if (message.repositories?.length) {
1072
+ obj.repositories = message.repositories.map((e) => SourceRepository.toJSON(e));
1073
+ }
1074
+ return obj;
1075
+ },
1076
+ create(base) {
1077
+ return SourceConnection.fromPartial(base ?? {});
1078
+ },
1079
+ fromPartial(object) {
1080
+ const message = createBaseSourceConnection();
1081
+ message.id = object.id ?? "";
1082
+ message.provider = object.provider ?? "";
1083
+ message.status = object.status ?? "";
1084
+ message.repositories = object.repositories?.map((e) => SourceRepository.fromPartial(e)) || [];
1085
+ return message;
1086
+ },
1087
+ };
1088
+ function createBaseListSourceConnectionsRequest() {
1089
+ return { orgId: "" };
1090
+ }
1091
+ export const ListSourceConnectionsRequest = {
1092
+ encode(message, writer = new BinaryWriter()) {
1093
+ if (message.orgId !== "") {
1094
+ writer.uint32(10).string(message.orgId);
1095
+ }
1096
+ return writer;
1097
+ },
1098
+ decode(input, length) {
1099
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1100
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1101
+ if (previousRecursionDepth >= 100) {
1102
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1103
+ }
1104
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1105
+ try {
1106
+ const end = length === undefined ? reader.len : reader.pos + length;
1107
+ const message = createBaseListSourceConnectionsRequest();
1108
+ while (reader.pos < end) {
1109
+ const tag = reader.uint32();
1110
+ switch (tag >>> 3) {
1111
+ case 1: {
1112
+ if (tag !== 10) {
1113
+ break;
1114
+ }
1115
+ message.orgId = reader.string();
1116
+ continue;
1117
+ }
1118
+ }
1119
+ if ((tag & 7) === 4 || tag === 0) {
1120
+ break;
1121
+ }
1122
+ reader.skip(tag & 7);
1123
+ }
1124
+ return message;
1125
+ }
1126
+ finally {
1127
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1128
+ }
1129
+ },
1130
+ fromJSON(object) {
1131
+ return {
1132
+ orgId: isSet(object.orgId)
1133
+ ? globalThis.String(object.orgId)
1134
+ : isSet(object.org_id)
1135
+ ? globalThis.String(object.org_id)
1136
+ : "",
1137
+ };
1138
+ },
1139
+ toJSON(message) {
1140
+ const obj = {};
1141
+ if (message.orgId !== "") {
1142
+ obj.orgId = message.orgId;
1143
+ }
1144
+ return obj;
1145
+ },
1146
+ create(base) {
1147
+ return ListSourceConnectionsRequest.fromPartial(base ?? {});
1148
+ },
1149
+ fromPartial(object) {
1150
+ const message = createBaseListSourceConnectionsRequest();
1151
+ message.orgId = object.orgId ?? "";
1152
+ return message;
1153
+ },
1154
+ };
1155
+ function createBaseListSourceConnectionsResponse() {
1156
+ return { connections: [] };
1157
+ }
1158
+ export const ListSourceConnectionsResponse = {
1159
+ encode(message, writer = new BinaryWriter()) {
1160
+ for (const v of message.connections) {
1161
+ SourceConnection.encode(v, writer.uint32(10).fork()).join();
1162
+ }
1163
+ return writer;
1164
+ },
1165
+ decode(input, length) {
1166
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1167
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1168
+ if (previousRecursionDepth >= 100) {
1169
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1170
+ }
1171
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1172
+ try {
1173
+ const end = length === undefined ? reader.len : reader.pos + length;
1174
+ const message = createBaseListSourceConnectionsResponse();
1175
+ while (reader.pos < end) {
1176
+ const tag = reader.uint32();
1177
+ switch (tag >>> 3) {
1178
+ case 1: {
1179
+ if (tag !== 10) {
1180
+ break;
1181
+ }
1182
+ message.connections.push(SourceConnection.decode(reader, reader.uint32()));
1183
+ continue;
1184
+ }
1185
+ }
1186
+ if ((tag & 7) === 4 || tag === 0) {
1187
+ break;
1188
+ }
1189
+ reader.skip(tag & 7);
1190
+ }
1191
+ return message;
1192
+ }
1193
+ finally {
1194
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1195
+ }
1196
+ },
1197
+ fromJSON(object) {
1198
+ return {
1199
+ connections: globalThis.Array.isArray(object?.connections)
1200
+ ? object.connections.map((e) => SourceConnection.fromJSON(e))
1201
+ : [],
1202
+ };
1203
+ },
1204
+ toJSON(message) {
1205
+ const obj = {};
1206
+ if (message.connections?.length) {
1207
+ obj.connections = message.connections.map((e) => SourceConnection.toJSON(e));
1208
+ }
1209
+ return obj;
1210
+ },
1211
+ create(base) {
1212
+ return ListSourceConnectionsResponse.fromPartial(base ?? {});
1213
+ },
1214
+ fromPartial(object) {
1215
+ const message = createBaseListSourceConnectionsResponse();
1216
+ message.connections = object.connections?.map((e) => SourceConnection.fromPartial(e)) || [];
1217
+ return message;
1218
+ },
1219
+ };
1220
+ function createBaseDisconnectSourceConnectionRequest() {
1221
+ return { orgId: "", connectionId: "" };
1222
+ }
1223
+ export const DisconnectSourceConnectionRequest = {
1224
+ encode(message, writer = new BinaryWriter()) {
1225
+ if (message.orgId !== "") {
1226
+ writer.uint32(10).string(message.orgId);
1227
+ }
1228
+ if (message.connectionId !== "") {
1229
+ writer.uint32(18).string(message.connectionId);
1230
+ }
1231
+ return writer;
1232
+ },
1233
+ decode(input, length) {
1234
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1235
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1236
+ if (previousRecursionDepth >= 100) {
1237
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1238
+ }
1239
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1240
+ try {
1241
+ const end = length === undefined ? reader.len : reader.pos + length;
1242
+ const message = createBaseDisconnectSourceConnectionRequest();
1243
+ while (reader.pos < end) {
1244
+ const tag = reader.uint32();
1245
+ switch (tag >>> 3) {
1246
+ case 1: {
1247
+ if (tag !== 10) {
1248
+ break;
1249
+ }
1250
+ message.orgId = reader.string();
1251
+ continue;
1252
+ }
1253
+ case 2: {
1254
+ if (tag !== 18) {
1255
+ break;
1256
+ }
1257
+ message.connectionId = reader.string();
1258
+ continue;
1259
+ }
1260
+ }
1261
+ if ((tag & 7) === 4 || tag === 0) {
1262
+ break;
1263
+ }
1264
+ reader.skip(tag & 7);
1265
+ }
1266
+ return message;
1267
+ }
1268
+ finally {
1269
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1270
+ }
1271
+ },
1272
+ fromJSON(object) {
1273
+ return {
1274
+ orgId: isSet(object.orgId)
1275
+ ? globalThis.String(object.orgId)
1276
+ : isSet(object.org_id)
1277
+ ? globalThis.String(object.org_id)
1278
+ : "",
1279
+ connectionId: isSet(object.connectionId)
1280
+ ? globalThis.String(object.connectionId)
1281
+ : isSet(object.connection_id)
1282
+ ? globalThis.String(object.connection_id)
1283
+ : "",
1284
+ };
1285
+ },
1286
+ toJSON(message) {
1287
+ const obj = {};
1288
+ if (message.orgId !== "") {
1289
+ obj.orgId = message.orgId;
1290
+ }
1291
+ if (message.connectionId !== "") {
1292
+ obj.connectionId = message.connectionId;
1293
+ }
1294
+ return obj;
1295
+ },
1296
+ create(base) {
1297
+ return DisconnectSourceConnectionRequest.fromPartial(base ?? {});
1298
+ },
1299
+ fromPartial(object) {
1300
+ const message = createBaseDisconnectSourceConnectionRequest();
1301
+ message.orgId = object.orgId ?? "";
1302
+ message.connectionId = object.connectionId ?? "";
1303
+ return message;
1304
+ },
1305
+ };
1306
+ function createBaseConnectHostedGitSourceRequest() {
1307
+ return { orgId: "", repositoryId: "" };
1308
+ }
1309
+ export const ConnectHostedGitSourceRequest = {
1310
+ encode(message, writer = new BinaryWriter()) {
1311
+ if (message.orgId !== "") {
1312
+ writer.uint32(10).string(message.orgId);
1313
+ }
1314
+ if (message.repositoryId !== "") {
1315
+ writer.uint32(18).string(message.repositoryId);
1316
+ }
1317
+ return writer;
1318
+ },
1319
+ decode(input, length) {
1320
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1321
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1322
+ if (previousRecursionDepth >= 100) {
1323
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1324
+ }
1325
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1326
+ try {
1327
+ const end = length === undefined ? reader.len : reader.pos + length;
1328
+ const message = createBaseConnectHostedGitSourceRequest();
1329
+ while (reader.pos < end) {
1330
+ const tag = reader.uint32();
1331
+ switch (tag >>> 3) {
1332
+ case 1: {
1333
+ if (tag !== 10) {
1334
+ break;
1335
+ }
1336
+ message.orgId = reader.string();
1337
+ continue;
1338
+ }
1339
+ case 2: {
1340
+ if (tag !== 18) {
1341
+ break;
1342
+ }
1343
+ message.repositoryId = reader.string();
1344
+ continue;
1345
+ }
1346
+ }
1347
+ if ((tag & 7) === 4 || tag === 0) {
1348
+ break;
1349
+ }
1350
+ reader.skip(tag & 7);
1351
+ }
1352
+ return message;
1353
+ }
1354
+ finally {
1355
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1356
+ }
1357
+ },
1358
+ fromJSON(object) {
1359
+ return {
1360
+ orgId: isSet(object.orgId)
1361
+ ? globalThis.String(object.orgId)
1362
+ : isSet(object.org_id)
1363
+ ? globalThis.String(object.org_id)
1364
+ : "",
1365
+ repositoryId: isSet(object.repositoryId)
1366
+ ? globalThis.String(object.repositoryId)
1367
+ : isSet(object.repository_id)
1368
+ ? globalThis.String(object.repository_id)
1369
+ : "",
1370
+ };
1371
+ },
1372
+ toJSON(message) {
1373
+ const obj = {};
1374
+ if (message.orgId !== "") {
1375
+ obj.orgId = message.orgId;
1376
+ }
1377
+ if (message.repositoryId !== "") {
1378
+ obj.repositoryId = message.repositoryId;
1379
+ }
1380
+ return obj;
1381
+ },
1382
+ create(base) {
1383
+ return ConnectHostedGitSourceRequest.fromPartial(base ?? {});
1384
+ },
1385
+ fromPartial(object) {
1386
+ const message = createBaseConnectHostedGitSourceRequest();
1387
+ message.orgId = object.orgId ?? "";
1388
+ message.repositoryId = object.repositoryId ?? "";
1389
+ return message;
1390
+ },
1391
+ };
1392
+ function createBaseSourceBuildService() {
1393
+ return { name: "", context: "", dockerfile: "" };
1394
+ }
1395
+ export const SourceBuildService = {
1396
+ encode(message, writer = new BinaryWriter()) {
1397
+ if (message.name !== "") {
1398
+ writer.uint32(10).string(message.name);
1399
+ }
1400
+ if (message.context !== "") {
1401
+ writer.uint32(18).string(message.context);
1402
+ }
1403
+ if (message.dockerfile !== "") {
1404
+ writer.uint32(26).string(message.dockerfile);
1405
+ }
1406
+ return writer;
1407
+ },
1408
+ decode(input, length) {
1409
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1410
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1411
+ if (previousRecursionDepth >= 100) {
1412
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1413
+ }
1414
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1415
+ try {
1416
+ const end = length === undefined ? reader.len : reader.pos + length;
1417
+ const message = createBaseSourceBuildService();
1418
+ while (reader.pos < end) {
1419
+ const tag = reader.uint32();
1420
+ switch (tag >>> 3) {
1421
+ case 1: {
1422
+ if (tag !== 10) {
1423
+ break;
1424
+ }
1425
+ message.name = reader.string();
1426
+ continue;
1427
+ }
1428
+ case 2: {
1429
+ if (tag !== 18) {
1430
+ break;
1431
+ }
1432
+ message.context = reader.string();
1433
+ continue;
1434
+ }
1435
+ case 3: {
1436
+ if (tag !== 26) {
1437
+ break;
1438
+ }
1439
+ message.dockerfile = reader.string();
1440
+ continue;
1441
+ }
1442
+ }
1443
+ if ((tag & 7) === 4 || tag === 0) {
1444
+ break;
1445
+ }
1446
+ reader.skip(tag & 7);
1447
+ }
1448
+ return message;
1449
+ }
1450
+ finally {
1451
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1452
+ }
1453
+ },
1454
+ fromJSON(object) {
1455
+ return {
1456
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1457
+ context: isSet(object.context) ? globalThis.String(object.context) : "",
1458
+ dockerfile: isSet(object.dockerfile) ? globalThis.String(object.dockerfile) : "",
1459
+ };
1460
+ },
1461
+ toJSON(message) {
1462
+ const obj = {};
1463
+ if (message.name !== "") {
1464
+ obj.name = message.name;
1465
+ }
1466
+ if (message.context !== "") {
1467
+ obj.context = message.context;
1468
+ }
1469
+ if (message.dockerfile !== "") {
1470
+ obj.dockerfile = message.dockerfile;
1471
+ }
1472
+ return obj;
1473
+ },
1474
+ create(base) {
1475
+ return SourceBuildService.fromPartial(base ?? {});
1476
+ },
1477
+ fromPartial(object) {
1478
+ const message = createBaseSourceBuildService();
1479
+ message.name = object.name ?? "";
1480
+ message.context = object.context ?? "";
1481
+ message.dockerfile = object.dockerfile ?? "";
1482
+ return message;
1483
+ },
1484
+ };
1485
+ function createBaseSourceBuildConfig() {
1486
+ return { services: [], composePath: "" };
1487
+ }
1488
+ export const SourceBuildConfig = {
1489
+ encode(message, writer = new BinaryWriter()) {
1490
+ for (const v of message.services) {
1491
+ SourceBuildService.encode(v, writer.uint32(10).fork()).join();
1492
+ }
1493
+ if (message.composePath !== "") {
1494
+ writer.uint32(18).string(message.composePath);
1495
+ }
1496
+ return writer;
1497
+ },
1498
+ decode(input, length) {
1499
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1500
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1501
+ if (previousRecursionDepth >= 100) {
1502
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1503
+ }
1504
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1505
+ try {
1506
+ const end = length === undefined ? reader.len : reader.pos + length;
1507
+ const message = createBaseSourceBuildConfig();
1508
+ while (reader.pos < end) {
1509
+ const tag = reader.uint32();
1510
+ switch (tag >>> 3) {
1511
+ case 1: {
1512
+ if (tag !== 10) {
1513
+ break;
1514
+ }
1515
+ message.services.push(SourceBuildService.decode(reader, reader.uint32()));
1516
+ continue;
1517
+ }
1518
+ case 2: {
1519
+ if (tag !== 18) {
1520
+ break;
1521
+ }
1522
+ message.composePath = reader.string();
1523
+ continue;
1524
+ }
1525
+ }
1526
+ if ((tag & 7) === 4 || tag === 0) {
1527
+ break;
1528
+ }
1529
+ reader.skip(tag & 7);
1530
+ }
1531
+ return message;
1532
+ }
1533
+ finally {
1534
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1535
+ }
1536
+ },
1537
+ fromJSON(object) {
1538
+ return {
1539
+ services: globalThis.Array.isArray(object?.services)
1540
+ ? object.services.map((e) => SourceBuildService.fromJSON(e))
1541
+ : [],
1542
+ composePath: isSet(object.composePath)
1543
+ ? globalThis.String(object.composePath)
1544
+ : isSet(object.compose_path)
1545
+ ? globalThis.String(object.compose_path)
1546
+ : "",
1547
+ };
1548
+ },
1549
+ toJSON(message) {
1550
+ const obj = {};
1551
+ if (message.services?.length) {
1552
+ obj.services = message.services.map((e) => SourceBuildService.toJSON(e));
1553
+ }
1554
+ if (message.composePath !== "") {
1555
+ obj.composePath = message.composePath;
1556
+ }
1557
+ return obj;
1558
+ },
1559
+ create(base) {
1560
+ return SourceBuildConfig.fromPartial(base ?? {});
1561
+ },
1562
+ fromPartial(object) {
1563
+ const message = createBaseSourceBuildConfig();
1564
+ message.services = object.services?.map((e) => SourceBuildService.fromPartial(e)) || [];
1565
+ message.composePath = object.composePath ?? "";
1566
+ return message;
1567
+ },
1568
+ };
1569
+ function createBaseGetSourceCapabilitiesRequest() {
1570
+ return { orgId: "" };
1571
+ }
1572
+ export const GetSourceCapabilitiesRequest = {
1573
+ encode(message, writer = new BinaryWriter()) {
1574
+ if (message.orgId !== "") {
1575
+ writer.uint32(10).string(message.orgId);
1576
+ }
1577
+ return writer;
1578
+ },
1579
+ decode(input, length) {
1580
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1581
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1582
+ if (previousRecursionDepth >= 100) {
1583
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1584
+ }
1585
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1586
+ try {
1587
+ const end = length === undefined ? reader.len : reader.pos + length;
1588
+ const message = createBaseGetSourceCapabilitiesRequest();
1589
+ while (reader.pos < end) {
1590
+ const tag = reader.uint32();
1591
+ switch (tag >>> 3) {
1592
+ case 1: {
1593
+ if (tag !== 10) {
1594
+ break;
1595
+ }
1596
+ message.orgId = reader.string();
1597
+ continue;
1598
+ }
1599
+ }
1600
+ if ((tag & 7) === 4 || tag === 0) {
1601
+ break;
1602
+ }
1603
+ reader.skip(tag & 7);
1604
+ }
1605
+ return message;
1606
+ }
1607
+ finally {
1608
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1609
+ }
1610
+ },
1611
+ fromJSON(object) {
1612
+ return {
1613
+ orgId: isSet(object.orgId)
1614
+ ? globalThis.String(object.orgId)
1615
+ : isSet(object.org_id)
1616
+ ? globalThis.String(object.org_id)
1617
+ : "",
1618
+ };
1619
+ },
1620
+ toJSON(message) {
1621
+ const obj = {};
1622
+ if (message.orgId !== "") {
1623
+ obj.orgId = message.orgId;
1624
+ }
1625
+ return obj;
1626
+ },
1627
+ create(base) {
1628
+ return GetSourceCapabilitiesRequest.fromPartial(base ?? {});
1629
+ },
1630
+ fromPartial(object) {
1631
+ const message = createBaseGetSourceCapabilitiesRequest();
1632
+ message.orgId = object.orgId ?? "";
1633
+ return message;
1634
+ },
1635
+ };
1636
+ function createBaseGetSourceCapabilitiesResponse() {
1637
+ return { githubConnections: false, hostedGitConnections: false, builds: false };
1638
+ }
1639
+ export const GetSourceCapabilitiesResponse = {
1640
+ encode(message, writer = new BinaryWriter()) {
1641
+ if (message.githubConnections !== false) {
1642
+ writer.uint32(8).bool(message.githubConnections);
1643
+ }
1644
+ if (message.hostedGitConnections !== false) {
1645
+ writer.uint32(16).bool(message.hostedGitConnections);
1646
+ }
1647
+ if (message.builds !== false) {
1648
+ writer.uint32(24).bool(message.builds);
1649
+ }
1650
+ return writer;
1651
+ },
1652
+ decode(input, length) {
1653
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1654
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1655
+ if (previousRecursionDepth >= 100) {
1656
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1657
+ }
1658
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1659
+ try {
1660
+ const end = length === undefined ? reader.len : reader.pos + length;
1661
+ const message = createBaseGetSourceCapabilitiesResponse();
1662
+ while (reader.pos < end) {
1663
+ const tag = reader.uint32();
1664
+ switch (tag >>> 3) {
1665
+ case 1: {
1666
+ if (tag !== 8) {
1667
+ break;
1668
+ }
1669
+ message.githubConnections = reader.bool();
1670
+ continue;
1671
+ }
1672
+ case 2: {
1673
+ if (tag !== 16) {
1674
+ break;
1675
+ }
1676
+ message.hostedGitConnections = reader.bool();
1677
+ continue;
1678
+ }
1679
+ case 3: {
1680
+ if (tag !== 24) {
1681
+ break;
1682
+ }
1683
+ message.builds = reader.bool();
1684
+ continue;
1685
+ }
1686
+ }
1687
+ if ((tag & 7) === 4 || tag === 0) {
1688
+ break;
1689
+ }
1690
+ reader.skip(tag & 7);
1691
+ }
1692
+ return message;
1693
+ }
1694
+ finally {
1695
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1696
+ }
1697
+ },
1698
+ fromJSON(object) {
1699
+ return {
1700
+ githubConnections: isSet(object.githubConnections)
1701
+ ? globalThis.Boolean(object.githubConnections)
1702
+ : isSet(object.github_connections)
1703
+ ? globalThis.Boolean(object.github_connections)
1704
+ : false,
1705
+ hostedGitConnections: isSet(object.hostedGitConnections)
1706
+ ? globalThis.Boolean(object.hostedGitConnections)
1707
+ : isSet(object.hosted_git_connections)
1708
+ ? globalThis.Boolean(object.hosted_git_connections)
1709
+ : false,
1710
+ builds: isSet(object.builds) ? globalThis.Boolean(object.builds) : false,
1711
+ };
1712
+ },
1713
+ toJSON(message) {
1714
+ const obj = {};
1715
+ if (message.githubConnections !== false) {
1716
+ obj.githubConnections = message.githubConnections;
1717
+ }
1718
+ if (message.hostedGitConnections !== false) {
1719
+ obj.hostedGitConnections = message.hostedGitConnections;
1720
+ }
1721
+ if (message.builds !== false) {
1722
+ obj.builds = message.builds;
1723
+ }
1724
+ return obj;
1725
+ },
1726
+ create(base) {
1727
+ return GetSourceCapabilitiesResponse.fromPartial(base ?? {});
1728
+ },
1729
+ fromPartial(object) {
1730
+ const message = createBaseGetSourceCapabilitiesResponse();
1731
+ message.githubConnections = object.githubConnections ?? false;
1732
+ message.hostedGitConnections = object.hostedGitConnections ?? false;
1733
+ message.builds = object.builds ?? false;
1734
+ return message;
1735
+ },
1736
+ };
1737
+ function createBasePreviewSourceRequest() {
1738
+ return { orgId: "", repositoryId: "", branch: "", composePath: "" };
1739
+ }
1740
+ export const PreviewSourceRequest = {
1741
+ encode(message, writer = new BinaryWriter()) {
1742
+ if (message.orgId !== "") {
1743
+ writer.uint32(10).string(message.orgId);
1744
+ }
1745
+ if (message.repositoryId !== "") {
1746
+ writer.uint32(18).string(message.repositoryId);
1747
+ }
1748
+ if (message.branch !== "") {
1749
+ writer.uint32(26).string(message.branch);
1750
+ }
1751
+ if (message.composePath !== "") {
1752
+ writer.uint32(34).string(message.composePath);
1753
+ }
1754
+ return writer;
1755
+ },
1756
+ decode(input, length) {
1757
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1758
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1759
+ if (previousRecursionDepth >= 100) {
1760
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1761
+ }
1762
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1763
+ try {
1764
+ const end = length === undefined ? reader.len : reader.pos + length;
1765
+ const message = createBasePreviewSourceRequest();
1766
+ while (reader.pos < end) {
1767
+ const tag = reader.uint32();
1768
+ switch (tag >>> 3) {
1769
+ case 1: {
1770
+ if (tag !== 10) {
1771
+ break;
1772
+ }
1773
+ message.orgId = reader.string();
1774
+ continue;
1775
+ }
1776
+ case 2: {
1777
+ if (tag !== 18) {
1778
+ break;
1779
+ }
1780
+ message.repositoryId = reader.string();
1781
+ continue;
1782
+ }
1783
+ case 3: {
1784
+ if (tag !== 26) {
1785
+ break;
1786
+ }
1787
+ message.branch = reader.string();
1788
+ continue;
1789
+ }
1790
+ case 4: {
1791
+ if (tag !== 34) {
1792
+ break;
1793
+ }
1794
+ message.composePath = reader.string();
1795
+ continue;
1796
+ }
1797
+ }
1798
+ if ((tag & 7) === 4 || tag === 0) {
1799
+ break;
1800
+ }
1801
+ reader.skip(tag & 7);
1802
+ }
1803
+ return message;
1804
+ }
1805
+ finally {
1806
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1807
+ }
1808
+ },
1809
+ fromJSON(object) {
1810
+ return {
1811
+ orgId: isSet(object.orgId)
1812
+ ? globalThis.String(object.orgId)
1813
+ : isSet(object.org_id)
1814
+ ? globalThis.String(object.org_id)
1815
+ : "",
1816
+ repositoryId: isSet(object.repositoryId)
1817
+ ? globalThis.String(object.repositoryId)
1818
+ : isSet(object.repository_id)
1819
+ ? globalThis.String(object.repository_id)
1820
+ : "",
1821
+ branch: isSet(object.branch) ? globalThis.String(object.branch) : "",
1822
+ composePath: isSet(object.composePath)
1823
+ ? globalThis.String(object.composePath)
1824
+ : isSet(object.compose_path)
1825
+ ? globalThis.String(object.compose_path)
1826
+ : "",
1827
+ };
1828
+ },
1829
+ toJSON(message) {
1830
+ const obj = {};
1831
+ if (message.orgId !== "") {
1832
+ obj.orgId = message.orgId;
1833
+ }
1834
+ if (message.repositoryId !== "") {
1835
+ obj.repositoryId = message.repositoryId;
1836
+ }
1837
+ if (message.branch !== "") {
1838
+ obj.branch = message.branch;
1839
+ }
1840
+ if (message.composePath !== "") {
1841
+ obj.composePath = message.composePath;
1842
+ }
1843
+ return obj;
1844
+ },
1845
+ create(base) {
1846
+ return PreviewSourceRequest.fromPartial(base ?? {});
1847
+ },
1848
+ fromPartial(object) {
1849
+ const message = createBasePreviewSourceRequest();
1850
+ message.orgId = object.orgId ?? "";
1851
+ message.repositoryId = object.repositoryId ?? "";
1852
+ message.branch = object.branch ?? "";
1853
+ message.composePath = object.composePath ?? "";
1854
+ return message;
1855
+ },
1856
+ };
1857
+ function createBasePreviewSourceResponse() {
1858
+ return { repositoryId: "", branch: "", commitSha: "", composePath: "", composeYaml: "", config: undefined };
1859
+ }
1860
+ export const PreviewSourceResponse = {
1861
+ encode(message, writer = new BinaryWriter()) {
1862
+ if (message.repositoryId !== "") {
1863
+ writer.uint32(10).string(message.repositoryId);
1864
+ }
1865
+ if (message.branch !== "") {
1866
+ writer.uint32(18).string(message.branch);
1867
+ }
1868
+ if (message.commitSha !== "") {
1869
+ writer.uint32(26).string(message.commitSha);
1870
+ }
1871
+ if (message.composePath !== "") {
1872
+ writer.uint32(34).string(message.composePath);
1873
+ }
1874
+ if (message.composeYaml !== "") {
1875
+ writer.uint32(42).string(message.composeYaml);
1876
+ }
1877
+ if (message.config !== undefined) {
1878
+ SourceBuildConfig.encode(message.config, writer.uint32(50).fork()).join();
1879
+ }
1880
+ return writer;
1881
+ },
1882
+ decode(input, length) {
1883
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1884
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1885
+ if (previousRecursionDepth >= 100) {
1886
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1887
+ }
1888
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1889
+ try {
1890
+ const end = length === undefined ? reader.len : reader.pos + length;
1891
+ const message = createBasePreviewSourceResponse();
1892
+ while (reader.pos < end) {
1893
+ const tag = reader.uint32();
1894
+ switch (tag >>> 3) {
1895
+ case 1: {
1896
+ if (tag !== 10) {
1897
+ break;
1898
+ }
1899
+ message.repositoryId = reader.string();
1900
+ continue;
1901
+ }
1902
+ case 2: {
1903
+ if (tag !== 18) {
1904
+ break;
1905
+ }
1906
+ message.branch = reader.string();
1907
+ continue;
1908
+ }
1909
+ case 3: {
1910
+ if (tag !== 26) {
1911
+ break;
1912
+ }
1913
+ message.commitSha = reader.string();
1914
+ continue;
1915
+ }
1916
+ case 4: {
1917
+ if (tag !== 34) {
1918
+ break;
1919
+ }
1920
+ message.composePath = reader.string();
1921
+ continue;
1922
+ }
1923
+ case 5: {
1924
+ if (tag !== 42) {
1925
+ break;
1926
+ }
1927
+ message.composeYaml = reader.string();
1928
+ continue;
1929
+ }
1930
+ case 6: {
1931
+ if (tag !== 50) {
1932
+ break;
1933
+ }
1934
+ message.config = SourceBuildConfig.decode(reader, reader.uint32());
1935
+ continue;
1936
+ }
1937
+ }
1938
+ if ((tag & 7) === 4 || tag === 0) {
1939
+ break;
1940
+ }
1941
+ reader.skip(tag & 7);
1942
+ }
1943
+ return message;
1944
+ }
1945
+ finally {
1946
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1947
+ }
1948
+ },
1949
+ fromJSON(object) {
1950
+ return {
1951
+ repositoryId: isSet(object.repositoryId)
1952
+ ? globalThis.String(object.repositoryId)
1953
+ : isSet(object.repository_id)
1954
+ ? globalThis.String(object.repository_id)
1955
+ : "",
1956
+ branch: isSet(object.branch) ? globalThis.String(object.branch) : "",
1957
+ commitSha: isSet(object.commitSha)
1958
+ ? globalThis.String(object.commitSha)
1959
+ : isSet(object.commit_sha)
1960
+ ? globalThis.String(object.commit_sha)
1961
+ : "",
1962
+ composePath: isSet(object.composePath)
1963
+ ? globalThis.String(object.composePath)
1964
+ : isSet(object.compose_path)
1965
+ ? globalThis.String(object.compose_path)
1966
+ : "",
1967
+ composeYaml: isSet(object.composeYaml)
1968
+ ? globalThis.String(object.composeYaml)
1969
+ : isSet(object.compose_yaml)
1970
+ ? globalThis.String(object.compose_yaml)
1971
+ : "",
1972
+ config: isSet(object.config) ? SourceBuildConfig.fromJSON(object.config) : undefined,
1973
+ };
1974
+ },
1975
+ toJSON(message) {
1976
+ const obj = {};
1977
+ if (message.repositoryId !== "") {
1978
+ obj.repositoryId = message.repositoryId;
1979
+ }
1980
+ if (message.branch !== "") {
1981
+ obj.branch = message.branch;
1982
+ }
1983
+ if (message.commitSha !== "") {
1984
+ obj.commitSha = message.commitSha;
1985
+ }
1986
+ if (message.composePath !== "") {
1987
+ obj.composePath = message.composePath;
1988
+ }
1989
+ if (message.composeYaml !== "") {
1990
+ obj.composeYaml = message.composeYaml;
1991
+ }
1992
+ if (message.config !== undefined) {
1993
+ obj.config = SourceBuildConfig.toJSON(message.config);
1994
+ }
1995
+ return obj;
1996
+ },
1997
+ create(base) {
1998
+ return PreviewSourceResponse.fromPartial(base ?? {});
1999
+ },
2000
+ fromPartial(object) {
2001
+ const message = createBasePreviewSourceResponse();
2002
+ message.repositoryId = object.repositoryId ?? "";
2003
+ message.branch = object.branch ?? "";
2004
+ message.commitSha = object.commitSha ?? "";
2005
+ message.composePath = object.composePath ?? "";
2006
+ message.composeYaml = object.composeYaml ?? "";
2007
+ message.config = (object.config !== undefined && object.config !== null)
2008
+ ? SourceBuildConfig.fromPartial(object.config)
2009
+ : undefined;
2010
+ return message;
2011
+ },
2012
+ };
2013
+ function createBasePrepareSourceDeploymentRequest() {
2014
+ return { orgId: "", buildId: "" };
2015
+ }
2016
+ export const PrepareSourceDeploymentRequest = {
2017
+ encode(message, writer = new BinaryWriter()) {
2018
+ if (message.orgId !== "") {
2019
+ writer.uint32(10).string(message.orgId);
2020
+ }
2021
+ if (message.buildId !== "") {
2022
+ writer.uint32(18).string(message.buildId);
2023
+ }
2024
+ return writer;
2025
+ },
2026
+ decode(input, length) {
2027
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2028
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2029
+ if (previousRecursionDepth >= 100) {
2030
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2031
+ }
2032
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2033
+ try {
2034
+ const end = length === undefined ? reader.len : reader.pos + length;
2035
+ const message = createBasePrepareSourceDeploymentRequest();
2036
+ while (reader.pos < end) {
2037
+ const tag = reader.uint32();
2038
+ switch (tag >>> 3) {
2039
+ case 1: {
2040
+ if (tag !== 10) {
2041
+ break;
2042
+ }
2043
+ message.orgId = reader.string();
2044
+ continue;
2045
+ }
2046
+ case 2: {
2047
+ if (tag !== 18) {
2048
+ break;
2049
+ }
2050
+ message.buildId = reader.string();
2051
+ continue;
2052
+ }
2053
+ }
2054
+ if ((tag & 7) === 4 || tag === 0) {
2055
+ break;
2056
+ }
2057
+ reader.skip(tag & 7);
2058
+ }
2059
+ return message;
2060
+ }
2061
+ finally {
2062
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2063
+ }
2064
+ },
2065
+ fromJSON(object) {
2066
+ return {
2067
+ orgId: isSet(object.orgId)
2068
+ ? globalThis.String(object.orgId)
2069
+ : isSet(object.org_id)
2070
+ ? globalThis.String(object.org_id)
2071
+ : "",
2072
+ buildId: isSet(object.buildId)
2073
+ ? globalThis.String(object.buildId)
2074
+ : isSet(object.build_id)
2075
+ ? globalThis.String(object.build_id)
2076
+ : "",
2077
+ };
2078
+ },
2079
+ toJSON(message) {
2080
+ const obj = {};
2081
+ if (message.orgId !== "") {
2082
+ obj.orgId = message.orgId;
2083
+ }
2084
+ if (message.buildId !== "") {
2085
+ obj.buildId = message.buildId;
2086
+ }
2087
+ return obj;
2088
+ },
2089
+ create(base) {
2090
+ return PrepareSourceDeploymentRequest.fromPartial(base ?? {});
2091
+ },
2092
+ fromPartial(object) {
2093
+ const message = createBasePrepareSourceDeploymentRequest();
2094
+ message.orgId = object.orgId ?? "";
2095
+ message.buildId = object.buildId ?? "";
2096
+ return message;
2097
+ },
2098
+ };
2099
+ function createBasePrepareSourceDeploymentResponse() {
2100
+ return { composeYaml: "", commitSha: "", images: {} };
2101
+ }
2102
+ export const PrepareSourceDeploymentResponse = {
2103
+ encode(message, writer = new BinaryWriter()) {
2104
+ if (message.composeYaml !== "") {
2105
+ writer.uint32(10).string(message.composeYaml);
2106
+ }
2107
+ if (message.commitSha !== "") {
2108
+ writer.uint32(18).string(message.commitSha);
2109
+ }
2110
+ globalThis.Object.entries(message.images).forEach(([key, value]) => {
2111
+ PrepareSourceDeploymentResponse_ImagesEntry.encode({ key: key, value }, writer.uint32(26).fork()).join();
2112
+ });
2113
+ return writer;
2114
+ },
2115
+ decode(input, length) {
2116
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2117
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2118
+ if (previousRecursionDepth >= 100) {
2119
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2120
+ }
2121
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2122
+ try {
2123
+ const end = length === undefined ? reader.len : reader.pos + length;
2124
+ const message = createBasePrepareSourceDeploymentResponse();
2125
+ while (reader.pos < end) {
2126
+ const tag = reader.uint32();
2127
+ switch (tag >>> 3) {
2128
+ case 1: {
2129
+ if (tag !== 10) {
2130
+ break;
2131
+ }
2132
+ message.composeYaml = reader.string();
2133
+ continue;
2134
+ }
2135
+ case 2: {
2136
+ if (tag !== 18) {
2137
+ break;
2138
+ }
2139
+ message.commitSha = reader.string();
2140
+ continue;
2141
+ }
2142
+ case 3: {
2143
+ if (tag !== 26) {
2144
+ break;
2145
+ }
2146
+ const entry3 = PrepareSourceDeploymentResponse_ImagesEntry.decode(reader, reader.uint32());
2147
+ if (entry3.value !== undefined) {
2148
+ message.images[entry3.key] = entry3.value;
2149
+ }
2150
+ continue;
2151
+ }
2152
+ }
2153
+ if ((tag & 7) === 4 || tag === 0) {
2154
+ break;
2155
+ }
2156
+ reader.skip(tag & 7);
2157
+ }
2158
+ return message;
2159
+ }
2160
+ finally {
2161
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2162
+ }
2163
+ },
2164
+ fromJSON(object) {
2165
+ return {
2166
+ composeYaml: isSet(object.composeYaml)
2167
+ ? globalThis.String(object.composeYaml)
2168
+ : isSet(object.compose_yaml)
2169
+ ? globalThis.String(object.compose_yaml)
2170
+ : "",
2171
+ commitSha: isSet(object.commitSha)
2172
+ ? globalThis.String(object.commitSha)
2173
+ : isSet(object.commit_sha)
2174
+ ? globalThis.String(object.commit_sha)
2175
+ : "",
2176
+ images: isObject(object.images)
2177
+ ? globalThis.Object.entries(object.images).reduce((acc, [key, value]) => {
2178
+ globalThis.Object.defineProperty(acc, key, {
2179
+ value: globalThis.String(value),
2180
+ enumerable: true,
2181
+ configurable: true,
2182
+ writable: true,
2183
+ });
2184
+ return acc;
2185
+ }, {})
2186
+ : {},
2187
+ };
2188
+ },
2189
+ toJSON(message) {
2190
+ const obj = {};
2191
+ if (message.composeYaml !== "") {
2192
+ obj.composeYaml = message.composeYaml;
2193
+ }
2194
+ if (message.commitSha !== "") {
2195
+ obj.commitSha = message.commitSha;
2196
+ }
2197
+ if (message.images) {
2198
+ const entries = globalThis.Object.entries(message.images);
2199
+ if (entries.length > 0) {
2200
+ obj.images = {};
2201
+ entries.forEach(([k, v]) => {
2202
+ obj.images[k] = v;
2203
+ });
2204
+ }
2205
+ }
2206
+ return obj;
2207
+ },
2208
+ create(base) {
2209
+ return PrepareSourceDeploymentResponse.fromPartial(base ?? {});
2210
+ },
2211
+ fromPartial(object) {
2212
+ const message = createBasePrepareSourceDeploymentResponse();
2213
+ message.composeYaml = object.composeYaml ?? "";
2214
+ message.commitSha = object.commitSha ?? "";
2215
+ message.images = globalThis.Object.entries(object.images ?? {}).reduce((acc, [key, value]) => {
2216
+ if (value !== undefined) {
2217
+ acc[key] = globalThis.String(value);
2218
+ }
2219
+ return acc;
2220
+ }, {});
2221
+ return message;
2222
+ },
2223
+ };
2224
+ function createBasePrepareSourceDeploymentResponse_ImagesEntry() {
2225
+ return { key: "", value: "" };
2226
+ }
2227
+ export const PrepareSourceDeploymentResponse_ImagesEntry = {
2228
+ encode(message, writer = new BinaryWriter()) {
2229
+ if (message.key !== "") {
2230
+ writer.uint32(10).string(message.key);
2231
+ }
2232
+ if (message.value !== "") {
2233
+ writer.uint32(18).string(message.value);
2234
+ }
2235
+ return writer;
2236
+ },
2237
+ decode(input, length) {
2238
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2239
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2240
+ if (previousRecursionDepth >= 100) {
2241
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2242
+ }
2243
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2244
+ try {
2245
+ const end = length === undefined ? reader.len : reader.pos + length;
2246
+ const message = createBasePrepareSourceDeploymentResponse_ImagesEntry();
2247
+ while (reader.pos < end) {
2248
+ const tag = reader.uint32();
2249
+ switch (tag >>> 3) {
2250
+ case 1: {
2251
+ if (tag !== 10) {
2252
+ break;
2253
+ }
2254
+ message.key = reader.string();
2255
+ continue;
2256
+ }
2257
+ case 2: {
2258
+ if (tag !== 18) {
2259
+ break;
2260
+ }
2261
+ message.value = reader.string();
2262
+ continue;
2263
+ }
2264
+ }
2265
+ if ((tag & 7) === 4 || tag === 0) {
2266
+ break;
2267
+ }
2268
+ reader.skip(tag & 7);
2269
+ }
2270
+ return message;
2271
+ }
2272
+ finally {
2273
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2274
+ }
2275
+ },
2276
+ fromJSON(object) {
2277
+ return {
2278
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
2279
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
2280
+ };
2281
+ },
2282
+ toJSON(message) {
2283
+ const obj = {};
2284
+ if (message.key !== "") {
2285
+ obj.key = message.key;
2286
+ }
2287
+ if (message.value !== "") {
2288
+ obj.value = message.value;
2289
+ }
2290
+ return obj;
2291
+ },
2292
+ create(base) {
2293
+ return PrepareSourceDeploymentResponse_ImagesEntry.fromPartial(base ?? {});
2294
+ },
2295
+ fromPartial(object) {
2296
+ const message = createBasePrepareSourceDeploymentResponse_ImagesEntry();
2297
+ message.key = object.key ?? "";
2298
+ message.value = object.value ?? "";
2299
+ return message;
2300
+ },
2301
+ };
2302
+ function createBasePutSourceTargetRequest() {
2303
+ return {
2304
+ orgId: "",
2305
+ name: "",
2306
+ repositoryId: "",
2307
+ branch: "",
2308
+ config: undefined,
2309
+ autoBuild: false,
2310
+ expectedVersion: "",
2311
+ };
2312
+ }
2313
+ export const PutSourceTargetRequest = {
2314
+ encode(message, writer = new BinaryWriter()) {
2315
+ if (message.orgId !== "") {
2316
+ writer.uint32(10).string(message.orgId);
2317
+ }
2318
+ if (message.name !== "") {
2319
+ writer.uint32(18).string(message.name);
2320
+ }
2321
+ if (message.repositoryId !== "") {
2322
+ writer.uint32(26).string(message.repositoryId);
2323
+ }
2324
+ if (message.branch !== "") {
2325
+ writer.uint32(34).string(message.branch);
2326
+ }
2327
+ if (message.config !== undefined) {
2328
+ SourceBuildConfig.encode(message.config, writer.uint32(42).fork()).join();
2329
+ }
2330
+ if (message.autoBuild !== false) {
2331
+ writer.uint32(48).bool(message.autoBuild);
2332
+ }
2333
+ if (message.expectedVersion !== "") {
2334
+ writer.uint32(58).string(message.expectedVersion);
2335
+ }
2336
+ return writer;
2337
+ },
2338
+ decode(input, length) {
2339
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2340
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2341
+ if (previousRecursionDepth >= 100) {
2342
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2343
+ }
2344
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2345
+ try {
2346
+ const end = length === undefined ? reader.len : reader.pos + length;
2347
+ const message = createBasePutSourceTargetRequest();
2348
+ while (reader.pos < end) {
2349
+ const tag = reader.uint32();
2350
+ switch (tag >>> 3) {
2351
+ case 1: {
2352
+ if (tag !== 10) {
2353
+ break;
2354
+ }
2355
+ message.orgId = reader.string();
2356
+ continue;
2357
+ }
2358
+ case 2: {
2359
+ if (tag !== 18) {
2360
+ break;
2361
+ }
2362
+ message.name = reader.string();
2363
+ continue;
2364
+ }
2365
+ case 3: {
2366
+ if (tag !== 26) {
2367
+ break;
2368
+ }
2369
+ message.repositoryId = reader.string();
2370
+ continue;
2371
+ }
2372
+ case 4: {
2373
+ if (tag !== 34) {
2374
+ break;
2375
+ }
2376
+ message.branch = reader.string();
2377
+ continue;
2378
+ }
2379
+ case 5: {
2380
+ if (tag !== 42) {
2381
+ break;
2382
+ }
2383
+ message.config = SourceBuildConfig.decode(reader, reader.uint32());
2384
+ continue;
2385
+ }
2386
+ case 6: {
2387
+ if (tag !== 48) {
2388
+ break;
2389
+ }
2390
+ message.autoBuild = reader.bool();
2391
+ continue;
2392
+ }
2393
+ case 7: {
2394
+ if (tag !== 58) {
2395
+ break;
2396
+ }
2397
+ message.expectedVersion = reader.string();
2398
+ continue;
2399
+ }
2400
+ }
2401
+ if ((tag & 7) === 4 || tag === 0) {
2402
+ break;
2403
+ }
2404
+ reader.skip(tag & 7);
2405
+ }
2406
+ return message;
2407
+ }
2408
+ finally {
2409
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2410
+ }
2411
+ },
2412
+ fromJSON(object) {
2413
+ return {
2414
+ orgId: isSet(object.orgId)
2415
+ ? globalThis.String(object.orgId)
2416
+ : isSet(object.org_id)
2417
+ ? globalThis.String(object.org_id)
2418
+ : "",
2419
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2420
+ repositoryId: isSet(object.repositoryId)
2421
+ ? globalThis.String(object.repositoryId)
2422
+ : isSet(object.repository_id)
2423
+ ? globalThis.String(object.repository_id)
2424
+ : "",
2425
+ branch: isSet(object.branch) ? globalThis.String(object.branch) : "",
2426
+ config: isSet(object.config) ? SourceBuildConfig.fromJSON(object.config) : undefined,
2427
+ autoBuild: isSet(object.autoBuild)
2428
+ ? globalThis.Boolean(object.autoBuild)
2429
+ : isSet(object.auto_build)
2430
+ ? globalThis.Boolean(object.auto_build)
2431
+ : false,
2432
+ expectedVersion: isSet(object.expectedVersion)
2433
+ ? globalThis.String(object.expectedVersion)
2434
+ : isSet(object.expected_version)
2435
+ ? globalThis.String(object.expected_version)
2436
+ : "",
2437
+ };
2438
+ },
2439
+ toJSON(message) {
2440
+ const obj = {};
2441
+ if (message.orgId !== "") {
2442
+ obj.orgId = message.orgId;
2443
+ }
2444
+ if (message.name !== "") {
2445
+ obj.name = message.name;
2446
+ }
2447
+ if (message.repositoryId !== "") {
2448
+ obj.repositoryId = message.repositoryId;
2449
+ }
2450
+ if (message.branch !== "") {
2451
+ obj.branch = message.branch;
2452
+ }
2453
+ if (message.config !== undefined) {
2454
+ obj.config = SourceBuildConfig.toJSON(message.config);
2455
+ }
2456
+ if (message.autoBuild !== false) {
2457
+ obj.autoBuild = message.autoBuild;
2458
+ }
2459
+ if (message.expectedVersion !== "") {
2460
+ obj.expectedVersion = message.expectedVersion;
2461
+ }
2462
+ return obj;
2463
+ },
2464
+ create(base) {
2465
+ return PutSourceTargetRequest.fromPartial(base ?? {});
2466
+ },
2467
+ fromPartial(object) {
2468
+ const message = createBasePutSourceTargetRequest();
2469
+ message.orgId = object.orgId ?? "";
2470
+ message.name = object.name ?? "";
2471
+ message.repositoryId = object.repositoryId ?? "";
2472
+ message.branch = object.branch ?? "";
2473
+ message.config = (object.config !== undefined && object.config !== null)
2474
+ ? SourceBuildConfig.fromPartial(object.config)
2475
+ : undefined;
2476
+ message.autoBuild = object.autoBuild ?? false;
2477
+ message.expectedVersion = object.expectedVersion ?? "";
2478
+ return message;
2479
+ },
2480
+ };
2481
+ function createBaseSourceTarget() {
2482
+ return { id: "", name: "", repositoryId: "", branch: "", config: undefined, autoBuild: false, version: "" };
2483
+ }
2484
+ export const SourceTarget = {
2485
+ encode(message, writer = new BinaryWriter()) {
2486
+ if (message.id !== "") {
2487
+ writer.uint32(10).string(message.id);
2488
+ }
2489
+ if (message.name !== "") {
2490
+ writer.uint32(18).string(message.name);
2491
+ }
2492
+ if (message.repositoryId !== "") {
2493
+ writer.uint32(26).string(message.repositoryId);
2494
+ }
2495
+ if (message.branch !== "") {
2496
+ writer.uint32(34).string(message.branch);
2497
+ }
2498
+ if (message.config !== undefined) {
2499
+ SourceBuildConfig.encode(message.config, writer.uint32(42).fork()).join();
2500
+ }
2501
+ if (message.autoBuild !== false) {
2502
+ writer.uint32(48).bool(message.autoBuild);
2503
+ }
2504
+ if (message.version !== "") {
2505
+ writer.uint32(58).string(message.version);
2506
+ }
2507
+ return writer;
2508
+ },
2509
+ decode(input, length) {
2510
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2511
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2512
+ if (previousRecursionDepth >= 100) {
2513
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2514
+ }
2515
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2516
+ try {
2517
+ const end = length === undefined ? reader.len : reader.pos + length;
2518
+ const message = createBaseSourceTarget();
2519
+ while (reader.pos < end) {
2520
+ const tag = reader.uint32();
2521
+ switch (tag >>> 3) {
2522
+ case 1: {
2523
+ if (tag !== 10) {
2524
+ break;
2525
+ }
2526
+ message.id = reader.string();
2527
+ continue;
2528
+ }
2529
+ case 2: {
2530
+ if (tag !== 18) {
2531
+ break;
2532
+ }
2533
+ message.name = reader.string();
2534
+ continue;
2535
+ }
2536
+ case 3: {
2537
+ if (tag !== 26) {
2538
+ break;
2539
+ }
2540
+ message.repositoryId = reader.string();
2541
+ continue;
2542
+ }
2543
+ case 4: {
2544
+ if (tag !== 34) {
2545
+ break;
2546
+ }
2547
+ message.branch = reader.string();
2548
+ continue;
2549
+ }
2550
+ case 5: {
2551
+ if (tag !== 42) {
2552
+ break;
2553
+ }
2554
+ message.config = SourceBuildConfig.decode(reader, reader.uint32());
2555
+ continue;
2556
+ }
2557
+ case 6: {
2558
+ if (tag !== 48) {
2559
+ break;
2560
+ }
2561
+ message.autoBuild = reader.bool();
2562
+ continue;
2563
+ }
2564
+ case 7: {
2565
+ if (tag !== 58) {
2566
+ break;
2567
+ }
2568
+ message.version = reader.string();
2569
+ continue;
2570
+ }
2571
+ }
2572
+ if ((tag & 7) === 4 || tag === 0) {
2573
+ break;
2574
+ }
2575
+ reader.skip(tag & 7);
2576
+ }
2577
+ return message;
2578
+ }
2579
+ finally {
2580
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2581
+ }
2582
+ },
2583
+ fromJSON(object) {
2584
+ return {
2585
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2586
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2587
+ repositoryId: isSet(object.repositoryId)
2588
+ ? globalThis.String(object.repositoryId)
2589
+ : isSet(object.repository_id)
2590
+ ? globalThis.String(object.repository_id)
2591
+ : "",
2592
+ branch: isSet(object.branch) ? globalThis.String(object.branch) : "",
2593
+ config: isSet(object.config) ? SourceBuildConfig.fromJSON(object.config) : undefined,
2594
+ autoBuild: isSet(object.autoBuild)
2595
+ ? globalThis.Boolean(object.autoBuild)
2596
+ : isSet(object.auto_build)
2597
+ ? globalThis.Boolean(object.auto_build)
2598
+ : false,
2599
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
2600
+ };
2601
+ },
2602
+ toJSON(message) {
2603
+ const obj = {};
2604
+ if (message.id !== "") {
2605
+ obj.id = message.id;
2606
+ }
2607
+ if (message.name !== "") {
2608
+ obj.name = message.name;
2609
+ }
2610
+ if (message.repositoryId !== "") {
2611
+ obj.repositoryId = message.repositoryId;
2612
+ }
2613
+ if (message.branch !== "") {
2614
+ obj.branch = message.branch;
2615
+ }
2616
+ if (message.config !== undefined) {
2617
+ obj.config = SourceBuildConfig.toJSON(message.config);
2618
+ }
2619
+ if (message.autoBuild !== false) {
2620
+ obj.autoBuild = message.autoBuild;
2621
+ }
2622
+ if (message.version !== "") {
2623
+ obj.version = message.version;
2624
+ }
2625
+ return obj;
2626
+ },
2627
+ create(base) {
2628
+ return SourceTarget.fromPartial(base ?? {});
2629
+ },
2630
+ fromPartial(object) {
2631
+ const message = createBaseSourceTarget();
2632
+ message.id = object.id ?? "";
2633
+ message.name = object.name ?? "";
2634
+ message.repositoryId = object.repositoryId ?? "";
2635
+ message.branch = object.branch ?? "";
2636
+ message.config = (object.config !== undefined && object.config !== null)
2637
+ ? SourceBuildConfig.fromPartial(object.config)
2638
+ : undefined;
2639
+ message.autoBuild = object.autoBuild ?? false;
2640
+ message.version = object.version ?? "";
2641
+ return message;
2642
+ },
2643
+ };
2644
+ function createBaseListSourceTargetsRequest() {
2645
+ return { orgId: "" };
2646
+ }
2647
+ export const ListSourceTargetsRequest = {
2648
+ encode(message, writer = new BinaryWriter()) {
2649
+ if (message.orgId !== "") {
2650
+ writer.uint32(10).string(message.orgId);
2651
+ }
2652
+ return writer;
2653
+ },
2654
+ decode(input, length) {
2655
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2656
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2657
+ if (previousRecursionDepth >= 100) {
2658
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2659
+ }
2660
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2661
+ try {
2662
+ const end = length === undefined ? reader.len : reader.pos + length;
2663
+ const message = createBaseListSourceTargetsRequest();
2664
+ while (reader.pos < end) {
2665
+ const tag = reader.uint32();
2666
+ switch (tag >>> 3) {
2667
+ case 1: {
2668
+ if (tag !== 10) {
2669
+ break;
2670
+ }
2671
+ message.orgId = reader.string();
2672
+ continue;
2673
+ }
2674
+ }
2675
+ if ((tag & 7) === 4 || tag === 0) {
2676
+ break;
2677
+ }
2678
+ reader.skip(tag & 7);
2679
+ }
2680
+ return message;
2681
+ }
2682
+ finally {
2683
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2684
+ }
2685
+ },
2686
+ fromJSON(object) {
2687
+ return {
2688
+ orgId: isSet(object.orgId)
2689
+ ? globalThis.String(object.orgId)
2690
+ : isSet(object.org_id)
2691
+ ? globalThis.String(object.org_id)
2692
+ : "",
2693
+ };
2694
+ },
2695
+ toJSON(message) {
2696
+ const obj = {};
2697
+ if (message.orgId !== "") {
2698
+ obj.orgId = message.orgId;
2699
+ }
2700
+ return obj;
2701
+ },
2702
+ create(base) {
2703
+ return ListSourceTargetsRequest.fromPartial(base ?? {});
2704
+ },
2705
+ fromPartial(object) {
2706
+ const message = createBaseListSourceTargetsRequest();
2707
+ message.orgId = object.orgId ?? "";
2708
+ return message;
2709
+ },
2710
+ };
2711
+ function createBaseListSourceTargetsResponse() {
2712
+ return { targets: [] };
2713
+ }
2714
+ export const ListSourceTargetsResponse = {
2715
+ encode(message, writer = new BinaryWriter()) {
2716
+ for (const v of message.targets) {
2717
+ SourceTarget.encode(v, writer.uint32(10).fork()).join();
2718
+ }
2719
+ return writer;
2720
+ },
2721
+ decode(input, length) {
2722
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2723
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2724
+ if (previousRecursionDepth >= 100) {
2725
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2726
+ }
2727
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2728
+ try {
2729
+ const end = length === undefined ? reader.len : reader.pos + length;
2730
+ const message = createBaseListSourceTargetsResponse();
2731
+ while (reader.pos < end) {
2732
+ const tag = reader.uint32();
2733
+ switch (tag >>> 3) {
2734
+ case 1: {
2735
+ if (tag !== 10) {
2736
+ break;
2737
+ }
2738
+ message.targets.push(SourceTarget.decode(reader, reader.uint32()));
2739
+ continue;
2740
+ }
2741
+ }
2742
+ if ((tag & 7) === 4 || tag === 0) {
2743
+ break;
2744
+ }
2745
+ reader.skip(tag & 7);
2746
+ }
2747
+ return message;
2748
+ }
2749
+ finally {
2750
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2751
+ }
2752
+ },
2753
+ fromJSON(object) {
2754
+ return {
2755
+ targets: globalThis.Array.isArray(object?.targets)
2756
+ ? object.targets.map((e) => SourceTarget.fromJSON(e))
2757
+ : [],
2758
+ };
2759
+ },
2760
+ toJSON(message) {
2761
+ const obj = {};
2762
+ if (message.targets?.length) {
2763
+ obj.targets = message.targets.map((e) => SourceTarget.toJSON(e));
2764
+ }
2765
+ return obj;
2766
+ },
2767
+ create(base) {
2768
+ return ListSourceTargetsResponse.fromPartial(base ?? {});
2769
+ },
2770
+ fromPartial(object) {
2771
+ const message = createBaseListSourceTargetsResponse();
2772
+ message.targets = object.targets?.map((e) => SourceTarget.fromPartial(e)) || [];
2773
+ return message;
2774
+ },
2775
+ };
2776
+ function createBaseStartSourceBuildRequest() {
2777
+ return { orgId: "", targetId: "", commitSha: "", idempotencyKey: "" };
2778
+ }
2779
+ export const StartSourceBuildRequest = {
2780
+ encode(message, writer = new BinaryWriter()) {
2781
+ if (message.orgId !== "") {
2782
+ writer.uint32(10).string(message.orgId);
2783
+ }
2784
+ if (message.targetId !== "") {
2785
+ writer.uint32(18).string(message.targetId);
2786
+ }
2787
+ if (message.commitSha !== "") {
2788
+ writer.uint32(26).string(message.commitSha);
2789
+ }
2790
+ if (message.idempotencyKey !== "") {
2791
+ writer.uint32(34).string(message.idempotencyKey);
2792
+ }
2793
+ return writer;
2794
+ },
2795
+ decode(input, length) {
2796
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2797
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2798
+ if (previousRecursionDepth >= 100) {
2799
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2800
+ }
2801
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2802
+ try {
2803
+ const end = length === undefined ? reader.len : reader.pos + length;
2804
+ const message = createBaseStartSourceBuildRequest();
2805
+ while (reader.pos < end) {
2806
+ const tag = reader.uint32();
2807
+ switch (tag >>> 3) {
2808
+ case 1: {
2809
+ if (tag !== 10) {
2810
+ break;
2811
+ }
2812
+ message.orgId = reader.string();
2813
+ continue;
2814
+ }
2815
+ case 2: {
2816
+ if (tag !== 18) {
2817
+ break;
2818
+ }
2819
+ message.targetId = reader.string();
2820
+ continue;
2821
+ }
2822
+ case 3: {
2823
+ if (tag !== 26) {
2824
+ break;
2825
+ }
2826
+ message.commitSha = reader.string();
2827
+ continue;
2828
+ }
2829
+ case 4: {
2830
+ if (tag !== 34) {
2831
+ break;
2832
+ }
2833
+ message.idempotencyKey = reader.string();
2834
+ continue;
2835
+ }
2836
+ }
2837
+ if ((tag & 7) === 4 || tag === 0) {
2838
+ break;
2839
+ }
2840
+ reader.skip(tag & 7);
2841
+ }
2842
+ return message;
2843
+ }
2844
+ finally {
2845
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2846
+ }
2847
+ },
2848
+ fromJSON(object) {
2849
+ return {
2850
+ orgId: isSet(object.orgId)
2851
+ ? globalThis.String(object.orgId)
2852
+ : isSet(object.org_id)
2853
+ ? globalThis.String(object.org_id)
2854
+ : "",
2855
+ targetId: isSet(object.targetId)
2856
+ ? globalThis.String(object.targetId)
2857
+ : isSet(object.target_id)
2858
+ ? globalThis.String(object.target_id)
2859
+ : "",
2860
+ commitSha: isSet(object.commitSha)
2861
+ ? globalThis.String(object.commitSha)
2862
+ : isSet(object.commit_sha)
2863
+ ? globalThis.String(object.commit_sha)
2864
+ : "",
2865
+ idempotencyKey: isSet(object.idempotencyKey)
2866
+ ? globalThis.String(object.idempotencyKey)
2867
+ : isSet(object.idempotency_key)
2868
+ ? globalThis.String(object.idempotency_key)
2869
+ : "",
2870
+ };
2871
+ },
2872
+ toJSON(message) {
2873
+ const obj = {};
2874
+ if (message.orgId !== "") {
2875
+ obj.orgId = message.orgId;
2876
+ }
2877
+ if (message.targetId !== "") {
2878
+ obj.targetId = message.targetId;
2879
+ }
2880
+ if (message.commitSha !== "") {
2881
+ obj.commitSha = message.commitSha;
2882
+ }
2883
+ if (message.idempotencyKey !== "") {
2884
+ obj.idempotencyKey = message.idempotencyKey;
2885
+ }
2886
+ return obj;
2887
+ },
2888
+ create(base) {
2889
+ return StartSourceBuildRequest.fromPartial(base ?? {});
2890
+ },
2891
+ fromPartial(object) {
2892
+ const message = createBaseStartSourceBuildRequest();
2893
+ message.orgId = object.orgId ?? "";
2894
+ message.targetId = object.targetId ?? "";
2895
+ message.commitSha = object.commitSha ?? "";
2896
+ message.idempotencyKey = object.idempotencyKey ?? "";
2897
+ return message;
2898
+ },
2899
+ };
2900
+ function createBaseGetSourceBuildRequest() {
2901
+ return { orgId: "", buildId: "" };
2902
+ }
2903
+ export const GetSourceBuildRequest = {
2904
+ encode(message, writer = new BinaryWriter()) {
2905
+ if (message.orgId !== "") {
2906
+ writer.uint32(10).string(message.orgId);
2907
+ }
2908
+ if (message.buildId !== "") {
2909
+ writer.uint32(18).string(message.buildId);
2910
+ }
2911
+ return writer;
2912
+ },
2913
+ decode(input, length) {
2914
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2915
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2916
+ if (previousRecursionDepth >= 100) {
2917
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2918
+ }
2919
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2920
+ try {
2921
+ const end = length === undefined ? reader.len : reader.pos + length;
2922
+ const message = createBaseGetSourceBuildRequest();
2923
+ while (reader.pos < end) {
2924
+ const tag = reader.uint32();
2925
+ switch (tag >>> 3) {
2926
+ case 1: {
2927
+ if (tag !== 10) {
2928
+ break;
2929
+ }
2930
+ message.orgId = reader.string();
2931
+ continue;
2932
+ }
2933
+ case 2: {
2934
+ if (tag !== 18) {
2935
+ break;
2936
+ }
2937
+ message.buildId = reader.string();
2938
+ continue;
2939
+ }
2940
+ }
2941
+ if ((tag & 7) === 4 || tag === 0) {
2942
+ break;
2943
+ }
2944
+ reader.skip(tag & 7);
2945
+ }
2946
+ return message;
2947
+ }
2948
+ finally {
2949
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2950
+ }
2951
+ },
2952
+ fromJSON(object) {
2953
+ return {
2954
+ orgId: isSet(object.orgId)
2955
+ ? globalThis.String(object.orgId)
2956
+ : isSet(object.org_id)
2957
+ ? globalThis.String(object.org_id)
2958
+ : "",
2959
+ buildId: isSet(object.buildId)
2960
+ ? globalThis.String(object.buildId)
2961
+ : isSet(object.build_id)
2962
+ ? globalThis.String(object.build_id)
2963
+ : "",
2964
+ };
2965
+ },
2966
+ toJSON(message) {
2967
+ const obj = {};
2968
+ if (message.orgId !== "") {
2969
+ obj.orgId = message.orgId;
2970
+ }
2971
+ if (message.buildId !== "") {
2972
+ obj.buildId = message.buildId;
2973
+ }
2974
+ return obj;
2975
+ },
2976
+ create(base) {
2977
+ return GetSourceBuildRequest.fromPartial(base ?? {});
2978
+ },
2979
+ fromPartial(object) {
2980
+ const message = createBaseGetSourceBuildRequest();
2981
+ message.orgId = object.orgId ?? "";
2982
+ message.buildId = object.buildId ?? "";
2983
+ return message;
2984
+ },
2985
+ };
2986
+ function createBaseCancelSourceBuildRequest() {
2987
+ return { orgId: "", buildId: "" };
2988
+ }
2989
+ export const CancelSourceBuildRequest = {
2990
+ encode(message, writer = new BinaryWriter()) {
2991
+ if (message.orgId !== "") {
2992
+ writer.uint32(10).string(message.orgId);
2993
+ }
2994
+ if (message.buildId !== "") {
2995
+ writer.uint32(18).string(message.buildId);
2996
+ }
2997
+ return writer;
2998
+ },
2999
+ decode(input, length) {
3000
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3001
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3002
+ if (previousRecursionDepth >= 100) {
3003
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3004
+ }
3005
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3006
+ try {
3007
+ const end = length === undefined ? reader.len : reader.pos + length;
3008
+ const message = createBaseCancelSourceBuildRequest();
3009
+ while (reader.pos < end) {
3010
+ const tag = reader.uint32();
3011
+ switch (tag >>> 3) {
3012
+ case 1: {
3013
+ if (tag !== 10) {
3014
+ break;
3015
+ }
3016
+ message.orgId = reader.string();
3017
+ continue;
3018
+ }
3019
+ case 2: {
3020
+ if (tag !== 18) {
3021
+ break;
3022
+ }
3023
+ message.buildId = reader.string();
3024
+ continue;
3025
+ }
3026
+ }
3027
+ if ((tag & 7) === 4 || tag === 0) {
3028
+ break;
3029
+ }
3030
+ reader.skip(tag & 7);
3031
+ }
3032
+ return message;
3033
+ }
3034
+ finally {
3035
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3036
+ }
3037
+ },
3038
+ fromJSON(object) {
3039
+ return {
3040
+ orgId: isSet(object.orgId)
3041
+ ? globalThis.String(object.orgId)
3042
+ : isSet(object.org_id)
3043
+ ? globalThis.String(object.org_id)
3044
+ : "",
3045
+ buildId: isSet(object.buildId)
3046
+ ? globalThis.String(object.buildId)
3047
+ : isSet(object.build_id)
3048
+ ? globalThis.String(object.build_id)
3049
+ : "",
3050
+ };
3051
+ },
3052
+ toJSON(message) {
3053
+ const obj = {};
3054
+ if (message.orgId !== "") {
3055
+ obj.orgId = message.orgId;
3056
+ }
3057
+ if (message.buildId !== "") {
3058
+ obj.buildId = message.buildId;
3059
+ }
3060
+ return obj;
3061
+ },
3062
+ create(base) {
3063
+ return CancelSourceBuildRequest.fromPartial(base ?? {});
3064
+ },
3065
+ fromPartial(object) {
3066
+ const message = createBaseCancelSourceBuildRequest();
3067
+ message.orgId = object.orgId ?? "";
3068
+ message.buildId = object.buildId ?? "";
3069
+ return message;
3070
+ },
3071
+ };
3072
+ function createBaseListSourceBuildsRequest() {
3073
+ return { orgId: "", targetId: "" };
3074
+ }
3075
+ export const ListSourceBuildsRequest = {
3076
+ encode(message, writer = new BinaryWriter()) {
3077
+ if (message.orgId !== "") {
3078
+ writer.uint32(10).string(message.orgId);
3079
+ }
3080
+ if (message.targetId !== "") {
3081
+ writer.uint32(18).string(message.targetId);
3082
+ }
3083
+ return writer;
3084
+ },
3085
+ decode(input, length) {
3086
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3087
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3088
+ if (previousRecursionDepth >= 100) {
3089
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3090
+ }
3091
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3092
+ try {
3093
+ const end = length === undefined ? reader.len : reader.pos + length;
3094
+ const message = createBaseListSourceBuildsRequest();
3095
+ while (reader.pos < end) {
3096
+ const tag = reader.uint32();
3097
+ switch (tag >>> 3) {
3098
+ case 1: {
3099
+ if (tag !== 10) {
3100
+ break;
3101
+ }
3102
+ message.orgId = reader.string();
3103
+ continue;
3104
+ }
3105
+ case 2: {
3106
+ if (tag !== 18) {
3107
+ break;
3108
+ }
3109
+ message.targetId = reader.string();
3110
+ continue;
3111
+ }
3112
+ }
3113
+ if ((tag & 7) === 4 || tag === 0) {
3114
+ break;
3115
+ }
3116
+ reader.skip(tag & 7);
3117
+ }
3118
+ return message;
3119
+ }
3120
+ finally {
3121
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3122
+ }
3123
+ },
3124
+ fromJSON(object) {
3125
+ return {
3126
+ orgId: isSet(object.orgId)
3127
+ ? globalThis.String(object.orgId)
3128
+ : isSet(object.org_id)
3129
+ ? globalThis.String(object.org_id)
3130
+ : "",
3131
+ targetId: isSet(object.targetId)
3132
+ ? globalThis.String(object.targetId)
3133
+ : isSet(object.target_id)
3134
+ ? globalThis.String(object.target_id)
3135
+ : "",
3136
+ };
3137
+ },
3138
+ toJSON(message) {
3139
+ const obj = {};
3140
+ if (message.orgId !== "") {
3141
+ obj.orgId = message.orgId;
3142
+ }
3143
+ if (message.targetId !== "") {
3144
+ obj.targetId = message.targetId;
3145
+ }
3146
+ return obj;
3147
+ },
3148
+ create(base) {
3149
+ return ListSourceBuildsRequest.fromPartial(base ?? {});
3150
+ },
3151
+ fromPartial(object) {
3152
+ const message = createBaseListSourceBuildsRequest();
3153
+ message.orgId = object.orgId ?? "";
3154
+ message.targetId = object.targetId ?? "";
3155
+ return message;
3156
+ },
3157
+ };
3158
+ function createBaseListSourceBuildsResponse() {
3159
+ return { builds: [] };
3160
+ }
3161
+ export const ListSourceBuildsResponse = {
3162
+ encode(message, writer = new BinaryWriter()) {
3163
+ for (const v of message.builds) {
3164
+ SourceBuild.encode(v, writer.uint32(10).fork()).join();
3165
+ }
3166
+ return writer;
3167
+ },
3168
+ decode(input, length) {
3169
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3170
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3171
+ if (previousRecursionDepth >= 100) {
3172
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3173
+ }
3174
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3175
+ try {
3176
+ const end = length === undefined ? reader.len : reader.pos + length;
3177
+ const message = createBaseListSourceBuildsResponse();
3178
+ while (reader.pos < end) {
3179
+ const tag = reader.uint32();
3180
+ switch (tag >>> 3) {
3181
+ case 1: {
3182
+ if (tag !== 10) {
3183
+ break;
3184
+ }
3185
+ message.builds.push(SourceBuild.decode(reader, reader.uint32()));
3186
+ continue;
3187
+ }
3188
+ }
3189
+ if ((tag & 7) === 4 || tag === 0) {
3190
+ break;
3191
+ }
3192
+ reader.skip(tag & 7);
3193
+ }
3194
+ return message;
3195
+ }
3196
+ finally {
3197
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3198
+ }
3199
+ },
3200
+ fromJSON(object) {
3201
+ return {
3202
+ builds: globalThis.Array.isArray(object?.builds) ? object.builds.map((e) => SourceBuild.fromJSON(e)) : [],
3203
+ };
3204
+ },
3205
+ toJSON(message) {
3206
+ const obj = {};
3207
+ if (message.builds?.length) {
3208
+ obj.builds = message.builds.map((e) => SourceBuild.toJSON(e));
3209
+ }
3210
+ return obj;
3211
+ },
3212
+ create(base) {
3213
+ return ListSourceBuildsResponse.fromPartial(base ?? {});
3214
+ },
3215
+ fromPartial(object) {
3216
+ const message = createBaseListSourceBuildsResponse();
3217
+ message.builds = object.builds?.map((e) => SourceBuild.fromPartial(e)) || [];
3218
+ return message;
3219
+ },
3220
+ };
3221
+ function createBaseSourceBuild() {
3222
+ return {
3223
+ id: "",
3224
+ targetId: "",
3225
+ commitSha: "",
3226
+ branch: "",
3227
+ status: "",
3228
+ cancelRequested: false,
3229
+ errorCode: "",
3230
+ images: {},
3231
+ createdAt: undefined,
3232
+ startedAt: undefined,
3233
+ finishedAt: undefined,
3234
+ allowanceConsumed: false,
3235
+ };
3236
+ }
3237
+ export const SourceBuild = {
3238
+ encode(message, writer = new BinaryWriter()) {
3239
+ if (message.id !== "") {
3240
+ writer.uint32(10).string(message.id);
3241
+ }
3242
+ if (message.targetId !== "") {
3243
+ writer.uint32(18).string(message.targetId);
3244
+ }
3245
+ if (message.commitSha !== "") {
3246
+ writer.uint32(26).string(message.commitSha);
3247
+ }
3248
+ if (message.branch !== "") {
3249
+ writer.uint32(34).string(message.branch);
3250
+ }
3251
+ if (message.status !== "") {
3252
+ writer.uint32(42).string(message.status);
3253
+ }
3254
+ if (message.cancelRequested !== false) {
3255
+ writer.uint32(48).bool(message.cancelRequested);
3256
+ }
3257
+ if (message.errorCode !== "") {
3258
+ writer.uint32(58).string(message.errorCode);
3259
+ }
3260
+ globalThis.Object.entries(message.images).forEach(([key, value]) => {
3261
+ SourceBuild_ImagesEntry.encode({ key: key, value }, writer.uint32(66).fork()).join();
3262
+ });
3263
+ if (message.createdAt !== undefined) {
3264
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(74).fork()).join();
3265
+ }
3266
+ if (message.startedAt !== undefined) {
3267
+ Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(82).fork()).join();
3268
+ }
3269
+ if (message.finishedAt !== undefined) {
3270
+ Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(90).fork()).join();
3271
+ }
3272
+ if (message.allowanceConsumed !== false) {
3273
+ writer.uint32(96).bool(message.allowanceConsumed);
3274
+ }
3275
+ return writer;
3276
+ },
3277
+ decode(input, length) {
3278
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3279
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3280
+ if (previousRecursionDepth >= 100) {
3281
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3282
+ }
3283
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3284
+ try {
3285
+ const end = length === undefined ? reader.len : reader.pos + length;
3286
+ const message = createBaseSourceBuild();
3287
+ while (reader.pos < end) {
3288
+ const tag = reader.uint32();
3289
+ switch (tag >>> 3) {
3290
+ case 1: {
3291
+ if (tag !== 10) {
3292
+ break;
3293
+ }
3294
+ message.id = reader.string();
3295
+ continue;
3296
+ }
3297
+ case 2: {
3298
+ if (tag !== 18) {
3299
+ break;
3300
+ }
3301
+ message.targetId = reader.string();
3302
+ continue;
3303
+ }
3304
+ case 3: {
3305
+ if (tag !== 26) {
3306
+ break;
3307
+ }
3308
+ message.commitSha = reader.string();
3309
+ continue;
3310
+ }
3311
+ case 4: {
3312
+ if (tag !== 34) {
3313
+ break;
3314
+ }
3315
+ message.branch = reader.string();
3316
+ continue;
3317
+ }
3318
+ case 5: {
3319
+ if (tag !== 42) {
3320
+ break;
3321
+ }
3322
+ message.status = reader.string();
3323
+ continue;
3324
+ }
3325
+ case 6: {
3326
+ if (tag !== 48) {
3327
+ break;
3328
+ }
3329
+ message.cancelRequested = reader.bool();
3330
+ continue;
3331
+ }
3332
+ case 7: {
3333
+ if (tag !== 58) {
3334
+ break;
3335
+ }
3336
+ message.errorCode = reader.string();
3337
+ continue;
3338
+ }
3339
+ case 8: {
3340
+ if (tag !== 66) {
3341
+ break;
3342
+ }
3343
+ const entry8 = SourceBuild_ImagesEntry.decode(reader, reader.uint32());
3344
+ if (entry8.value !== undefined) {
3345
+ message.images[entry8.key] = entry8.value;
3346
+ }
3347
+ continue;
3348
+ }
3349
+ case 9: {
3350
+ if (tag !== 74) {
3351
+ break;
3352
+ }
3353
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3354
+ continue;
3355
+ }
3356
+ case 10: {
3357
+ if (tag !== 82) {
3358
+ break;
3359
+ }
3360
+ message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3361
+ continue;
3362
+ }
3363
+ case 11: {
3364
+ if (tag !== 90) {
3365
+ break;
3366
+ }
3367
+ message.finishedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3368
+ continue;
3369
+ }
3370
+ case 12: {
3371
+ if (tag !== 96) {
3372
+ break;
3373
+ }
3374
+ message.allowanceConsumed = reader.bool();
3375
+ continue;
3376
+ }
3377
+ }
3378
+ if ((tag & 7) === 4 || tag === 0) {
3379
+ break;
3380
+ }
3381
+ reader.skip(tag & 7);
3382
+ }
3383
+ return message;
3384
+ }
3385
+ finally {
3386
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3387
+ }
3388
+ },
3389
+ fromJSON(object) {
3390
+ return {
3391
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
3392
+ targetId: isSet(object.targetId)
3393
+ ? globalThis.String(object.targetId)
3394
+ : isSet(object.target_id)
3395
+ ? globalThis.String(object.target_id)
3396
+ : "",
3397
+ commitSha: isSet(object.commitSha)
3398
+ ? globalThis.String(object.commitSha)
3399
+ : isSet(object.commit_sha)
3400
+ ? globalThis.String(object.commit_sha)
3401
+ : "",
3402
+ branch: isSet(object.branch) ? globalThis.String(object.branch) : "",
3403
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
3404
+ cancelRequested: isSet(object.cancelRequested)
3405
+ ? globalThis.Boolean(object.cancelRequested)
3406
+ : isSet(object.cancel_requested)
3407
+ ? globalThis.Boolean(object.cancel_requested)
3408
+ : false,
3409
+ errorCode: isSet(object.errorCode)
3410
+ ? globalThis.String(object.errorCode)
3411
+ : isSet(object.error_code)
3412
+ ? globalThis.String(object.error_code)
3413
+ : "",
3414
+ images: isObject(object.images)
3415
+ ? globalThis.Object.entries(object.images).reduce((acc, [key, value]) => {
3416
+ globalThis.Object.defineProperty(acc, key, {
3417
+ value: globalThis.String(value),
3418
+ enumerable: true,
3419
+ configurable: true,
3420
+ writable: true,
3421
+ });
3422
+ return acc;
3423
+ }, {})
3424
+ : {},
3425
+ createdAt: isSet(object.createdAt)
3426
+ ? fromJsonTimestamp(object.createdAt)
3427
+ : isSet(object.created_at)
3428
+ ? fromJsonTimestamp(object.created_at)
3429
+ : undefined,
3430
+ startedAt: isSet(object.startedAt)
3431
+ ? fromJsonTimestamp(object.startedAt)
3432
+ : isSet(object.started_at)
3433
+ ? fromJsonTimestamp(object.started_at)
3434
+ : undefined,
3435
+ finishedAt: isSet(object.finishedAt)
3436
+ ? fromJsonTimestamp(object.finishedAt)
3437
+ : isSet(object.finished_at)
3438
+ ? fromJsonTimestamp(object.finished_at)
3439
+ : undefined,
3440
+ allowanceConsumed: isSet(object.allowanceConsumed)
3441
+ ? globalThis.Boolean(object.allowanceConsumed)
3442
+ : isSet(object.allowance_consumed)
3443
+ ? globalThis.Boolean(object.allowance_consumed)
3444
+ : false,
3445
+ };
3446
+ },
3447
+ toJSON(message) {
3448
+ const obj = {};
3449
+ if (message.id !== "") {
3450
+ obj.id = message.id;
3451
+ }
3452
+ if (message.targetId !== "") {
3453
+ obj.targetId = message.targetId;
3454
+ }
3455
+ if (message.commitSha !== "") {
3456
+ obj.commitSha = message.commitSha;
3457
+ }
3458
+ if (message.branch !== "") {
3459
+ obj.branch = message.branch;
3460
+ }
3461
+ if (message.status !== "") {
3462
+ obj.status = message.status;
3463
+ }
3464
+ if (message.cancelRequested !== false) {
3465
+ obj.cancelRequested = message.cancelRequested;
3466
+ }
3467
+ if (message.errorCode !== "") {
3468
+ obj.errorCode = message.errorCode;
3469
+ }
3470
+ if (message.images) {
3471
+ const entries = globalThis.Object.entries(message.images);
3472
+ if (entries.length > 0) {
3473
+ obj.images = {};
3474
+ entries.forEach(([k, v]) => {
3475
+ obj.images[k] = v;
3476
+ });
3477
+ }
3478
+ }
3479
+ if (message.createdAt !== undefined) {
3480
+ obj.createdAt = message.createdAt.toISOString();
3481
+ }
3482
+ if (message.startedAt !== undefined) {
3483
+ obj.startedAt = message.startedAt.toISOString();
3484
+ }
3485
+ if (message.finishedAt !== undefined) {
3486
+ obj.finishedAt = message.finishedAt.toISOString();
3487
+ }
3488
+ if (message.allowanceConsumed !== false) {
3489
+ obj.allowanceConsumed = message.allowanceConsumed;
3490
+ }
3491
+ return obj;
3492
+ },
3493
+ create(base) {
3494
+ return SourceBuild.fromPartial(base ?? {});
3495
+ },
3496
+ fromPartial(object) {
3497
+ const message = createBaseSourceBuild();
3498
+ message.id = object.id ?? "";
3499
+ message.targetId = object.targetId ?? "";
3500
+ message.commitSha = object.commitSha ?? "";
3501
+ message.branch = object.branch ?? "";
3502
+ message.status = object.status ?? "";
3503
+ message.cancelRequested = object.cancelRequested ?? false;
3504
+ message.errorCode = object.errorCode ?? "";
3505
+ message.images = globalThis.Object.entries(object.images ?? {}).reduce((acc, [key, value]) => {
3506
+ if (value !== undefined) {
3507
+ acc[key] = globalThis.String(value);
3508
+ }
3509
+ return acc;
3510
+ }, {});
3511
+ message.createdAt = object.createdAt ?? undefined;
3512
+ message.startedAt = object.startedAt ?? undefined;
3513
+ message.finishedAt = object.finishedAt ?? undefined;
3514
+ message.allowanceConsumed = object.allowanceConsumed ?? false;
3515
+ return message;
3516
+ },
3517
+ };
3518
+ function createBaseSourceBuild_ImagesEntry() {
3519
+ return { key: "", value: "" };
3520
+ }
3521
+ export const SourceBuild_ImagesEntry = {
3522
+ encode(message, writer = new BinaryWriter()) {
3523
+ if (message.key !== "") {
3524
+ writer.uint32(10).string(message.key);
3525
+ }
3526
+ if (message.value !== "") {
3527
+ writer.uint32(18).string(message.value);
3528
+ }
3529
+ return writer;
3530
+ },
3531
+ decode(input, length) {
3532
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3533
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3534
+ if (previousRecursionDepth >= 100) {
3535
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3536
+ }
3537
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3538
+ try {
3539
+ const end = length === undefined ? reader.len : reader.pos + length;
3540
+ const message = createBaseSourceBuild_ImagesEntry();
3541
+ while (reader.pos < end) {
3542
+ const tag = reader.uint32();
3543
+ switch (tag >>> 3) {
3544
+ case 1: {
3545
+ if (tag !== 10) {
3546
+ break;
3547
+ }
3548
+ message.key = reader.string();
3549
+ continue;
3550
+ }
3551
+ case 2: {
3552
+ if (tag !== 18) {
3553
+ break;
3554
+ }
3555
+ message.value = reader.string();
3556
+ continue;
3557
+ }
3558
+ }
3559
+ if ((tag & 7) === 4 || tag === 0) {
3560
+ break;
3561
+ }
3562
+ reader.skip(tag & 7);
3563
+ }
3564
+ return message;
3565
+ }
3566
+ finally {
3567
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3568
+ }
3569
+ },
3570
+ fromJSON(object) {
3571
+ return {
3572
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
3573
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
3574
+ };
3575
+ },
3576
+ toJSON(message) {
3577
+ const obj = {};
3578
+ if (message.key !== "") {
3579
+ obj.key = message.key;
3580
+ }
3581
+ if (message.value !== "") {
3582
+ obj.value = message.value;
3583
+ }
3584
+ return obj;
3585
+ },
3586
+ create(base) {
3587
+ return SourceBuild_ImagesEntry.fromPartial(base ?? {});
3588
+ },
3589
+ fromPartial(object) {
3590
+ const message = createBaseSourceBuild_ImagesEntry();
3591
+ message.key = object.key ?? "";
3592
+ message.value = object.value ?? "";
3593
+ return message;
3594
+ },
3595
+ };
3596
+ function createBaseGetSourceBuildLogsRequest() {
3597
+ return { orgId: "", buildId: "", fromSequence: 0n };
3598
+ }
3599
+ export const GetSourceBuildLogsRequest = {
3600
+ encode(message, writer = new BinaryWriter()) {
3601
+ if (message.orgId !== "") {
3602
+ writer.uint32(10).string(message.orgId);
3603
+ }
3604
+ if (message.buildId !== "") {
3605
+ writer.uint32(18).string(message.buildId);
3606
+ }
3607
+ if (message.fromSequence !== 0n) {
3608
+ if (BigInt.asIntN(64, message.fromSequence) !== message.fromSequence) {
3609
+ throw new globalThis.Error("value provided for field message.fromSequence of type int64 too large");
3610
+ }
3611
+ writer.uint32(24).int64(message.fromSequence);
3612
+ }
3613
+ return writer;
3614
+ },
3615
+ decode(input, length) {
3616
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3617
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3618
+ if (previousRecursionDepth >= 100) {
3619
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3620
+ }
3621
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3622
+ try {
3623
+ const end = length === undefined ? reader.len : reader.pos + length;
3624
+ const message = createBaseGetSourceBuildLogsRequest();
3625
+ while (reader.pos < end) {
3626
+ const tag = reader.uint32();
3627
+ switch (tag >>> 3) {
3628
+ case 1: {
3629
+ if (tag !== 10) {
3630
+ break;
3631
+ }
3632
+ message.orgId = reader.string();
3633
+ continue;
3634
+ }
3635
+ case 2: {
3636
+ if (tag !== 18) {
3637
+ break;
3638
+ }
3639
+ message.buildId = reader.string();
3640
+ continue;
3641
+ }
3642
+ case 3: {
3643
+ if (tag !== 24) {
3644
+ break;
3645
+ }
3646
+ message.fromSequence = reader.int64();
3647
+ continue;
3648
+ }
3649
+ }
3650
+ if ((tag & 7) === 4 || tag === 0) {
3651
+ break;
3652
+ }
3653
+ reader.skip(tag & 7);
3654
+ }
3655
+ return message;
3656
+ }
3657
+ finally {
3658
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3659
+ }
3660
+ },
3661
+ fromJSON(object) {
3662
+ return {
3663
+ orgId: isSet(object.orgId)
3664
+ ? globalThis.String(object.orgId)
3665
+ : isSet(object.org_id)
3666
+ ? globalThis.String(object.org_id)
3667
+ : "",
3668
+ buildId: isSet(object.buildId)
3669
+ ? globalThis.String(object.buildId)
3670
+ : isSet(object.build_id)
3671
+ ? globalThis.String(object.build_id)
3672
+ : "",
3673
+ fromSequence: isSet(object.fromSequence)
3674
+ ? BigInt(object.fromSequence)
3675
+ : isSet(object.from_sequence)
3676
+ ? BigInt(object.from_sequence)
3677
+ : 0n,
3678
+ };
3679
+ },
3680
+ toJSON(message) {
3681
+ const obj = {};
3682
+ if (message.orgId !== "") {
3683
+ obj.orgId = message.orgId;
3684
+ }
3685
+ if (message.buildId !== "") {
3686
+ obj.buildId = message.buildId;
3687
+ }
3688
+ if (message.fromSequence !== 0n) {
3689
+ obj.fromSequence = message.fromSequence.toString();
3690
+ }
3691
+ return obj;
3692
+ },
3693
+ create(base) {
3694
+ return GetSourceBuildLogsRequest.fromPartial(base ?? {});
3695
+ },
3696
+ fromPartial(object) {
3697
+ const message = createBaseGetSourceBuildLogsRequest();
3698
+ message.orgId = object.orgId ?? "";
3699
+ message.buildId = object.buildId ?? "";
3700
+ message.fromSequence = (object.fromSequence !== undefined && object.fromSequence !== null)
3701
+ ? BigInt(object.fromSequence)
3702
+ : 0n;
3703
+ return message;
3704
+ },
3705
+ };
3706
+ function createBaseSourceBuildLogChunk() {
3707
+ return { sequence: 0n, text: "" };
3708
+ }
3709
+ export const SourceBuildLogChunk = {
3710
+ encode(message, writer = new BinaryWriter()) {
3711
+ if (message.sequence !== 0n) {
3712
+ if (BigInt.asIntN(64, message.sequence) !== message.sequence) {
3713
+ throw new globalThis.Error("value provided for field message.sequence of type int64 too large");
3714
+ }
3715
+ writer.uint32(8).int64(message.sequence);
3716
+ }
3717
+ if (message.text !== "") {
3718
+ writer.uint32(18).string(message.text);
3719
+ }
3720
+ return writer;
3721
+ },
3722
+ decode(input, length) {
3723
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3724
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3725
+ if (previousRecursionDepth >= 100) {
3726
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3727
+ }
3728
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3729
+ try {
3730
+ const end = length === undefined ? reader.len : reader.pos + length;
3731
+ const message = createBaseSourceBuildLogChunk();
3732
+ while (reader.pos < end) {
3733
+ const tag = reader.uint32();
3734
+ switch (tag >>> 3) {
3735
+ case 1: {
3736
+ if (tag !== 8) {
3737
+ break;
3738
+ }
3739
+ message.sequence = reader.int64();
3740
+ continue;
3741
+ }
3742
+ case 2: {
3743
+ if (tag !== 18) {
3744
+ break;
3745
+ }
3746
+ message.text = reader.string();
3747
+ continue;
3748
+ }
3749
+ }
3750
+ if ((tag & 7) === 4 || tag === 0) {
3751
+ break;
3752
+ }
3753
+ reader.skip(tag & 7);
3754
+ }
3755
+ return message;
3756
+ }
3757
+ finally {
3758
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3759
+ }
3760
+ },
3761
+ fromJSON(object) {
3762
+ return {
3763
+ sequence: isSet(object.sequence) ? BigInt(object.sequence) : 0n,
3764
+ text: isSet(object.text) ? globalThis.String(object.text) : "",
3765
+ };
3766
+ },
3767
+ toJSON(message) {
3768
+ const obj = {};
3769
+ if (message.sequence !== 0n) {
3770
+ obj.sequence = message.sequence.toString();
3771
+ }
3772
+ if (message.text !== "") {
3773
+ obj.text = message.text;
3774
+ }
3775
+ return obj;
3776
+ },
3777
+ create(base) {
3778
+ return SourceBuildLogChunk.fromPartial(base ?? {});
3779
+ },
3780
+ fromPartial(object) {
3781
+ const message = createBaseSourceBuildLogChunk();
3782
+ message.sequence = (object.sequence !== undefined && object.sequence !== null) ? BigInt(object.sequence) : 0n;
3783
+ message.text = object.text ?? "";
3784
+ return message;
3785
+ },
3786
+ };
3787
+ function createBaseGetSourceBuildLogsResponse() {
3788
+ return { chunks: [], nextSequence: 0n, truncated: false };
3789
+ }
3790
+ export const GetSourceBuildLogsResponse = {
3791
+ encode(message, writer = new BinaryWriter()) {
3792
+ for (const v of message.chunks) {
3793
+ SourceBuildLogChunk.encode(v, writer.uint32(10).fork()).join();
3794
+ }
3795
+ if (message.nextSequence !== 0n) {
3796
+ if (BigInt.asIntN(64, message.nextSequence) !== message.nextSequence) {
3797
+ throw new globalThis.Error("value provided for field message.nextSequence of type int64 too large");
3798
+ }
3799
+ writer.uint32(16).int64(message.nextSequence);
3800
+ }
3801
+ if (message.truncated !== false) {
3802
+ writer.uint32(24).bool(message.truncated);
3803
+ }
3804
+ return writer;
3805
+ },
3806
+ decode(input, length) {
3807
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3808
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3809
+ if (previousRecursionDepth >= 100) {
3810
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3811
+ }
3812
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3813
+ try {
3814
+ const end = length === undefined ? reader.len : reader.pos + length;
3815
+ const message = createBaseGetSourceBuildLogsResponse();
3816
+ while (reader.pos < end) {
3817
+ const tag = reader.uint32();
3818
+ switch (tag >>> 3) {
3819
+ case 1: {
3820
+ if (tag !== 10) {
3821
+ break;
3822
+ }
3823
+ message.chunks.push(SourceBuildLogChunk.decode(reader, reader.uint32()));
3824
+ continue;
3825
+ }
3826
+ case 2: {
3827
+ if (tag !== 16) {
3828
+ break;
3829
+ }
3830
+ message.nextSequence = reader.int64();
3831
+ continue;
3832
+ }
3833
+ case 3: {
3834
+ if (tag !== 24) {
3835
+ break;
3836
+ }
3837
+ message.truncated = reader.bool();
3838
+ continue;
3839
+ }
3840
+ }
3841
+ if ((tag & 7) === 4 || tag === 0) {
3842
+ break;
3843
+ }
3844
+ reader.skip(tag & 7);
3845
+ }
3846
+ return message;
3847
+ }
3848
+ finally {
3849
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3850
+ }
3851
+ },
3852
+ fromJSON(object) {
3853
+ return {
3854
+ chunks: globalThis.Array.isArray(object?.chunks)
3855
+ ? object.chunks.map((e) => SourceBuildLogChunk.fromJSON(e))
3856
+ : [],
3857
+ nextSequence: isSet(object.nextSequence)
3858
+ ? BigInt(object.nextSequence)
3859
+ : isSet(object.next_sequence)
3860
+ ? BigInt(object.next_sequence)
3861
+ : 0n,
3862
+ truncated: isSet(object.truncated) ? globalThis.Boolean(object.truncated) : false,
3863
+ };
3864
+ },
3865
+ toJSON(message) {
3866
+ const obj = {};
3867
+ if (message.chunks?.length) {
3868
+ obj.chunks = message.chunks.map((e) => SourceBuildLogChunk.toJSON(e));
3869
+ }
3870
+ if (message.nextSequence !== 0n) {
3871
+ obj.nextSequence = message.nextSequence.toString();
3872
+ }
3873
+ if (message.truncated !== false) {
3874
+ obj.truncated = message.truncated;
3875
+ }
3876
+ return obj;
3877
+ },
3878
+ create(base) {
3879
+ return GetSourceBuildLogsResponse.fromPartial(base ?? {});
3880
+ },
3881
+ fromPartial(object) {
3882
+ const message = createBaseGetSourceBuildLogsResponse();
3883
+ message.chunks = object.chunks?.map((e) => SourceBuildLogChunk.fromPartial(e)) || [];
3884
+ message.nextSequence = (object.nextSequence !== undefined && object.nextSequence !== null)
3885
+ ? BigInt(object.nextSequence)
3886
+ : 0n;
3887
+ message.truncated = object.truncated ?? false;
3888
+ return message;
3889
+ },
3890
+ };
3891
+ function toTimestamp(date) {
3892
+ const seconds = BigInt(Math.trunc(date.getTime() / 1_000));
3893
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
3894
+ return { seconds, nanos };
3895
+ }
3896
+ function fromTimestamp(t) {
3897
+ let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1_000;
3898
+ millis += (t.nanos || 0) / 1_000_000;
3899
+ return new globalThis.Date(millis);
3900
+ }
3901
+ function fromJsonTimestamp(o) {
3902
+ if (o instanceof globalThis.Date) {
3903
+ return o;
3904
+ }
3905
+ else if (typeof o === "string") {
3906
+ return new globalThis.Date(o);
3907
+ }
3908
+ else {
3909
+ return fromTimestamp(Timestamp.fromJSON(o));
3910
+ }
3911
+ }
3912
+ function isObject(value) {
3913
+ return typeof value === "object" && value !== null;
3914
+ }
3915
+ function isSet(value) {
3916
+ return value !== null && value !== undefined;
3917
+ }