@alacard-project/config-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/workspace.xml +45 -0
- package/README.md +107 -0
- package/dist/config-client.d.ts +33 -0
- package/dist/config-client.js +172 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/proto/config.d.ts +116 -0
- package/dist/proto/config.js +624 -0
- package/dist/types/types.d.ts +11 -0
- package/dist/types/types.js +2 -0
- package/dist/vault-client.d.ts +21 -0
- package/dist/vault-client.js +72 -0
- package/package.json +25 -0
- package/proto/config.proto +39 -0
- package/src/config-client.ts +180 -0
- package/src/index.ts +1 -0
- package/src/proto/config.ts +835 -0
- package/src/types/types.ts +12 -0
- package/src/vault-client.ts +84 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
3
|
+
import {
|
|
4
|
+
type CallOptions,
|
|
5
|
+
type ChannelCredentials,
|
|
6
|
+
Client,
|
|
7
|
+
type ClientOptions,
|
|
8
|
+
type ClientUnaryCall,
|
|
9
|
+
type handleUnaryCall,
|
|
10
|
+
makeGenericClientConstructor,
|
|
11
|
+
type Metadata,
|
|
12
|
+
type ServiceError,
|
|
13
|
+
type UntypedServiceImplementation,
|
|
14
|
+
} from "@grpc/grpc-js";
|
|
15
|
+
|
|
16
|
+
export interface GetConfigRequest {
|
|
17
|
+
serviceName: string;
|
|
18
|
+
environment: string;
|
|
19
|
+
version: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ConfigResponse {
|
|
23
|
+
values: { [key: string]: string };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ConfigResponse_ValuesEntry {
|
|
27
|
+
key: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface SetConfigRequest {
|
|
32
|
+
serviceName: string;
|
|
33
|
+
environment: string;
|
|
34
|
+
key: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ListConfigsRequest {
|
|
39
|
+
environment: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ServiceConfig {
|
|
43
|
+
serviceName: string;
|
|
44
|
+
values: { [key: string]: string };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ServiceConfig_ValuesEntry {
|
|
48
|
+
key: string;
|
|
49
|
+
value: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ListConfigsResponse {
|
|
53
|
+
configs: ServiceConfig[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function createBaseGetConfigRequest(): GetConfigRequest {
|
|
57
|
+
return { serviceName: "", environment: "", version: "" };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const GetConfigRequest: MessageFns<GetConfigRequest> = {
|
|
61
|
+
encode(message: GetConfigRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
62
|
+
if (message.serviceName !== "") {
|
|
63
|
+
writer.uint32(10).string(message.serviceName);
|
|
64
|
+
}
|
|
65
|
+
if (message.environment !== "") {
|
|
66
|
+
writer.uint32(18).string(message.environment);
|
|
67
|
+
}
|
|
68
|
+
if (message.version !== "") {
|
|
69
|
+
writer.uint32(26).string(message.version);
|
|
70
|
+
}
|
|
71
|
+
return writer;
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetConfigRequest {
|
|
75
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
76
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
77
|
+
const message = createBaseGetConfigRequest();
|
|
78
|
+
while (reader.pos < end) {
|
|
79
|
+
const tag = reader.uint32();
|
|
80
|
+
switch (tag >>> 3) {
|
|
81
|
+
case 1: {
|
|
82
|
+
if (tag !== 10) {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message.serviceName = reader.string();
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
case 2: {
|
|
90
|
+
if (tag !== 18) {
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message.environment = reader.string();
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
case 3: {
|
|
98
|
+
if (tag !== 26) {
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message.version = reader.string();
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
reader.skip(tag & 7);
|
|
110
|
+
}
|
|
111
|
+
return message;
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
fromJSON(object: any): GetConfigRequest {
|
|
115
|
+
return {
|
|
116
|
+
serviceName: isSet(object.serviceName) ? globalThis.String(object.serviceName) : "",
|
|
117
|
+
environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
|
|
118
|
+
version: isSet(object.version) ? globalThis.String(object.version) : "",
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
toJSON(message: GetConfigRequest): unknown {
|
|
123
|
+
const obj: any = {};
|
|
124
|
+
if (message.serviceName !== "") {
|
|
125
|
+
obj.serviceName = message.serviceName;
|
|
126
|
+
}
|
|
127
|
+
if (message.environment !== "") {
|
|
128
|
+
obj.environment = message.environment;
|
|
129
|
+
}
|
|
130
|
+
if (message.version !== "") {
|
|
131
|
+
obj.version = message.version;
|
|
132
|
+
}
|
|
133
|
+
return obj;
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
create<I extends Exact<DeepPartial<GetConfigRequest>, I>>(base?: I): GetConfigRequest {
|
|
137
|
+
return GetConfigRequest.fromPartial(base ?? ({} as any));
|
|
138
|
+
},
|
|
139
|
+
fromPartial<I extends Exact<DeepPartial<GetConfigRequest>, I>>(object: I): GetConfigRequest {
|
|
140
|
+
const message = createBaseGetConfigRequest();
|
|
141
|
+
message.serviceName = object.serviceName ?? "";
|
|
142
|
+
message.environment = object.environment ?? "";
|
|
143
|
+
message.version = object.version ?? "";
|
|
144
|
+
return message;
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
function createBaseConfigResponse(): ConfigResponse {
|
|
149
|
+
return { values: {} };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const ConfigResponse: MessageFns<ConfigResponse> = {
|
|
153
|
+
encode(message: ConfigResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
154
|
+
globalThis.Object.entries(message.values).forEach(([key, value]: [string, string]) => {
|
|
155
|
+
ConfigResponse_ValuesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
|
156
|
+
});
|
|
157
|
+
return writer;
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfigResponse {
|
|
161
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
162
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
163
|
+
const message = createBaseConfigResponse();
|
|
164
|
+
while (reader.pos < end) {
|
|
165
|
+
const tag = reader.uint32();
|
|
166
|
+
switch (tag >>> 3) {
|
|
167
|
+
case 1: {
|
|
168
|
+
if (tag !== 10) {
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const entry1 = ConfigResponse_ValuesEntry.decode(reader, reader.uint32());
|
|
173
|
+
if (entry1.value !== undefined) {
|
|
174
|
+
message.values[entry1.key] = entry1.value;
|
|
175
|
+
}
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
reader.skip(tag & 7);
|
|
183
|
+
}
|
|
184
|
+
return message;
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
fromJSON(object: any): ConfigResponse {
|
|
188
|
+
return {
|
|
189
|
+
values: isObject(object.values)
|
|
190
|
+
? (globalThis.Object.entries(object.values) as [string, any][]).reduce(
|
|
191
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
192
|
+
acc[key] = globalThis.String(value);
|
|
193
|
+
return acc;
|
|
194
|
+
},
|
|
195
|
+
{},
|
|
196
|
+
)
|
|
197
|
+
: {},
|
|
198
|
+
};
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
toJSON(message: ConfigResponse): unknown {
|
|
202
|
+
const obj: any = {};
|
|
203
|
+
if (message.values) {
|
|
204
|
+
const entries = globalThis.Object.entries(message.values) as [string, string][];
|
|
205
|
+
if (entries.length > 0) {
|
|
206
|
+
obj.values = {};
|
|
207
|
+
entries.forEach(([k, v]) => {
|
|
208
|
+
obj.values[k] = v;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return obj;
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
create<I extends Exact<DeepPartial<ConfigResponse>, I>>(base?: I): ConfigResponse {
|
|
216
|
+
return ConfigResponse.fromPartial(base ?? ({} as any));
|
|
217
|
+
},
|
|
218
|
+
fromPartial<I extends Exact<DeepPartial<ConfigResponse>, I>>(object: I): ConfigResponse {
|
|
219
|
+
const message = createBaseConfigResponse();
|
|
220
|
+
message.values = (globalThis.Object.entries(object.values ?? {}) as [string, string][]).reduce(
|
|
221
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
222
|
+
if (value !== undefined) {
|
|
223
|
+
acc[key] = globalThis.String(value);
|
|
224
|
+
}
|
|
225
|
+
return acc;
|
|
226
|
+
},
|
|
227
|
+
{},
|
|
228
|
+
);
|
|
229
|
+
return message;
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
function createBaseConfigResponse_ValuesEntry(): ConfigResponse_ValuesEntry {
|
|
234
|
+
return { key: "", value: "" };
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export const ConfigResponse_ValuesEntry: MessageFns<ConfigResponse_ValuesEntry> = {
|
|
238
|
+
encode(message: ConfigResponse_ValuesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
239
|
+
if (message.key !== "") {
|
|
240
|
+
writer.uint32(10).string(message.key);
|
|
241
|
+
}
|
|
242
|
+
if (message.value !== "") {
|
|
243
|
+
writer.uint32(18).string(message.value);
|
|
244
|
+
}
|
|
245
|
+
return writer;
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfigResponse_ValuesEntry {
|
|
249
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
250
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
251
|
+
const message = createBaseConfigResponse_ValuesEntry();
|
|
252
|
+
while (reader.pos < end) {
|
|
253
|
+
const tag = reader.uint32();
|
|
254
|
+
switch (tag >>> 3) {
|
|
255
|
+
case 1: {
|
|
256
|
+
if (tag !== 10) {
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
message.key = reader.string();
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
case 2: {
|
|
264
|
+
if (tag !== 18) {
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
message.value = reader.string();
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
reader.skip(tag & 7);
|
|
276
|
+
}
|
|
277
|
+
return message;
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
fromJSON(object: any): ConfigResponse_ValuesEntry {
|
|
281
|
+
return {
|
|
282
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
283
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
284
|
+
};
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
toJSON(message: ConfigResponse_ValuesEntry): unknown {
|
|
288
|
+
const obj: any = {};
|
|
289
|
+
if (message.key !== "") {
|
|
290
|
+
obj.key = message.key;
|
|
291
|
+
}
|
|
292
|
+
if (message.value !== "") {
|
|
293
|
+
obj.value = message.value;
|
|
294
|
+
}
|
|
295
|
+
return obj;
|
|
296
|
+
},
|
|
297
|
+
|
|
298
|
+
create<I extends Exact<DeepPartial<ConfigResponse_ValuesEntry>, I>>(base?: I): ConfigResponse_ValuesEntry {
|
|
299
|
+
return ConfigResponse_ValuesEntry.fromPartial(base ?? ({} as any));
|
|
300
|
+
},
|
|
301
|
+
fromPartial<I extends Exact<DeepPartial<ConfigResponse_ValuesEntry>, I>>(object: I): ConfigResponse_ValuesEntry {
|
|
302
|
+
const message = createBaseConfigResponse_ValuesEntry();
|
|
303
|
+
message.key = object.key ?? "";
|
|
304
|
+
message.value = object.value ?? "";
|
|
305
|
+
return message;
|
|
306
|
+
},
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
function createBaseSetConfigRequest(): SetConfigRequest {
|
|
310
|
+
return { serviceName: "", environment: "", key: "", value: "" };
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export const SetConfigRequest: MessageFns<SetConfigRequest> = {
|
|
314
|
+
encode(message: SetConfigRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
315
|
+
if (message.serviceName !== "") {
|
|
316
|
+
writer.uint32(10).string(message.serviceName);
|
|
317
|
+
}
|
|
318
|
+
if (message.environment !== "") {
|
|
319
|
+
writer.uint32(18).string(message.environment);
|
|
320
|
+
}
|
|
321
|
+
if (message.key !== "") {
|
|
322
|
+
writer.uint32(26).string(message.key);
|
|
323
|
+
}
|
|
324
|
+
if (message.value !== "") {
|
|
325
|
+
writer.uint32(34).string(message.value);
|
|
326
|
+
}
|
|
327
|
+
return writer;
|
|
328
|
+
},
|
|
329
|
+
|
|
330
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SetConfigRequest {
|
|
331
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
332
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
333
|
+
const message = createBaseSetConfigRequest();
|
|
334
|
+
while (reader.pos < end) {
|
|
335
|
+
const tag = reader.uint32();
|
|
336
|
+
switch (tag >>> 3) {
|
|
337
|
+
case 1: {
|
|
338
|
+
if (tag !== 10) {
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
message.serviceName = reader.string();
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
case 2: {
|
|
346
|
+
if (tag !== 18) {
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
message.environment = reader.string();
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
case 3: {
|
|
354
|
+
if (tag !== 26) {
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
message.key = reader.string();
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
case 4: {
|
|
362
|
+
if (tag !== 34) {
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
message.value = reader.string();
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
reader.skip(tag & 7);
|
|
374
|
+
}
|
|
375
|
+
return message;
|
|
376
|
+
},
|
|
377
|
+
|
|
378
|
+
fromJSON(object: any): SetConfigRequest {
|
|
379
|
+
return {
|
|
380
|
+
serviceName: isSet(object.serviceName) ? globalThis.String(object.serviceName) : "",
|
|
381
|
+
environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
|
|
382
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
383
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
384
|
+
};
|
|
385
|
+
},
|
|
386
|
+
|
|
387
|
+
toJSON(message: SetConfigRequest): unknown {
|
|
388
|
+
const obj: any = {};
|
|
389
|
+
if (message.serviceName !== "") {
|
|
390
|
+
obj.serviceName = message.serviceName;
|
|
391
|
+
}
|
|
392
|
+
if (message.environment !== "") {
|
|
393
|
+
obj.environment = message.environment;
|
|
394
|
+
}
|
|
395
|
+
if (message.key !== "") {
|
|
396
|
+
obj.key = message.key;
|
|
397
|
+
}
|
|
398
|
+
if (message.value !== "") {
|
|
399
|
+
obj.value = message.value;
|
|
400
|
+
}
|
|
401
|
+
return obj;
|
|
402
|
+
},
|
|
403
|
+
|
|
404
|
+
create<I extends Exact<DeepPartial<SetConfigRequest>, I>>(base?: I): SetConfigRequest {
|
|
405
|
+
return SetConfigRequest.fromPartial(base ?? ({} as any));
|
|
406
|
+
},
|
|
407
|
+
fromPartial<I extends Exact<DeepPartial<SetConfigRequest>, I>>(object: I): SetConfigRequest {
|
|
408
|
+
const message = createBaseSetConfigRequest();
|
|
409
|
+
message.serviceName = object.serviceName ?? "";
|
|
410
|
+
message.environment = object.environment ?? "";
|
|
411
|
+
message.key = object.key ?? "";
|
|
412
|
+
message.value = object.value ?? "";
|
|
413
|
+
return message;
|
|
414
|
+
},
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
function createBaseListConfigsRequest(): ListConfigsRequest {
|
|
418
|
+
return { environment: "" };
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export const ListConfigsRequest: MessageFns<ListConfigsRequest> = {
|
|
422
|
+
encode(message: ListConfigsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
423
|
+
if (message.environment !== "") {
|
|
424
|
+
writer.uint32(10).string(message.environment);
|
|
425
|
+
}
|
|
426
|
+
return writer;
|
|
427
|
+
},
|
|
428
|
+
|
|
429
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ListConfigsRequest {
|
|
430
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
431
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
432
|
+
const message = createBaseListConfigsRequest();
|
|
433
|
+
while (reader.pos < end) {
|
|
434
|
+
const tag = reader.uint32();
|
|
435
|
+
switch (tag >>> 3) {
|
|
436
|
+
case 1: {
|
|
437
|
+
if (tag !== 10) {
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
message.environment = reader.string();
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
reader.skip(tag & 7);
|
|
449
|
+
}
|
|
450
|
+
return message;
|
|
451
|
+
},
|
|
452
|
+
|
|
453
|
+
fromJSON(object: any): ListConfigsRequest {
|
|
454
|
+
return { environment: isSet(object.environment) ? globalThis.String(object.environment) : "" };
|
|
455
|
+
},
|
|
456
|
+
|
|
457
|
+
toJSON(message: ListConfigsRequest): unknown {
|
|
458
|
+
const obj: any = {};
|
|
459
|
+
if (message.environment !== "") {
|
|
460
|
+
obj.environment = message.environment;
|
|
461
|
+
}
|
|
462
|
+
return obj;
|
|
463
|
+
},
|
|
464
|
+
|
|
465
|
+
create<I extends Exact<DeepPartial<ListConfigsRequest>, I>>(base?: I): ListConfigsRequest {
|
|
466
|
+
return ListConfigsRequest.fromPartial(base ?? ({} as any));
|
|
467
|
+
},
|
|
468
|
+
fromPartial<I extends Exact<DeepPartial<ListConfigsRequest>, I>>(object: I): ListConfigsRequest {
|
|
469
|
+
const message = createBaseListConfigsRequest();
|
|
470
|
+
message.environment = object.environment ?? "";
|
|
471
|
+
return message;
|
|
472
|
+
},
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
function createBaseServiceConfig(): ServiceConfig {
|
|
476
|
+
return { serviceName: "", values: {} };
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export const ServiceConfig: MessageFns<ServiceConfig> = {
|
|
480
|
+
encode(message: ServiceConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
481
|
+
if (message.serviceName !== "") {
|
|
482
|
+
writer.uint32(10).string(message.serviceName);
|
|
483
|
+
}
|
|
484
|
+
globalThis.Object.entries(message.values).forEach(([key, value]: [string, string]) => {
|
|
485
|
+
ServiceConfig_ValuesEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
|
|
486
|
+
});
|
|
487
|
+
return writer;
|
|
488
|
+
},
|
|
489
|
+
|
|
490
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ServiceConfig {
|
|
491
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
492
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
493
|
+
const message = createBaseServiceConfig();
|
|
494
|
+
while (reader.pos < end) {
|
|
495
|
+
const tag = reader.uint32();
|
|
496
|
+
switch (tag >>> 3) {
|
|
497
|
+
case 1: {
|
|
498
|
+
if (tag !== 10) {
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
message.serviceName = reader.string();
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
case 2: {
|
|
506
|
+
if (tag !== 18) {
|
|
507
|
+
break;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
const entry2 = ServiceConfig_ValuesEntry.decode(reader, reader.uint32());
|
|
511
|
+
if (entry2.value !== undefined) {
|
|
512
|
+
message.values[entry2.key] = entry2.value;
|
|
513
|
+
}
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
reader.skip(tag & 7);
|
|
521
|
+
}
|
|
522
|
+
return message;
|
|
523
|
+
},
|
|
524
|
+
|
|
525
|
+
fromJSON(object: any): ServiceConfig {
|
|
526
|
+
return {
|
|
527
|
+
serviceName: isSet(object.serviceName) ? globalThis.String(object.serviceName) : "",
|
|
528
|
+
values: isObject(object.values)
|
|
529
|
+
? (globalThis.Object.entries(object.values) as [string, any][]).reduce(
|
|
530
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
531
|
+
acc[key] = globalThis.String(value);
|
|
532
|
+
return acc;
|
|
533
|
+
},
|
|
534
|
+
{},
|
|
535
|
+
)
|
|
536
|
+
: {},
|
|
537
|
+
};
|
|
538
|
+
},
|
|
539
|
+
|
|
540
|
+
toJSON(message: ServiceConfig): unknown {
|
|
541
|
+
const obj: any = {};
|
|
542
|
+
if (message.serviceName !== "") {
|
|
543
|
+
obj.serviceName = message.serviceName;
|
|
544
|
+
}
|
|
545
|
+
if (message.values) {
|
|
546
|
+
const entries = globalThis.Object.entries(message.values) as [string, string][];
|
|
547
|
+
if (entries.length > 0) {
|
|
548
|
+
obj.values = {};
|
|
549
|
+
entries.forEach(([k, v]) => {
|
|
550
|
+
obj.values[k] = v;
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
return obj;
|
|
555
|
+
},
|
|
556
|
+
|
|
557
|
+
create<I extends Exact<DeepPartial<ServiceConfig>, I>>(base?: I): ServiceConfig {
|
|
558
|
+
return ServiceConfig.fromPartial(base ?? ({} as any));
|
|
559
|
+
},
|
|
560
|
+
fromPartial<I extends Exact<DeepPartial<ServiceConfig>, I>>(object: I): ServiceConfig {
|
|
561
|
+
const message = createBaseServiceConfig();
|
|
562
|
+
message.serviceName = object.serviceName ?? "";
|
|
563
|
+
message.values = (globalThis.Object.entries(object.values ?? {}) as [string, string][]).reduce(
|
|
564
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
565
|
+
if (value !== undefined) {
|
|
566
|
+
acc[key] = globalThis.String(value);
|
|
567
|
+
}
|
|
568
|
+
return acc;
|
|
569
|
+
},
|
|
570
|
+
{},
|
|
571
|
+
);
|
|
572
|
+
return message;
|
|
573
|
+
},
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
function createBaseServiceConfig_ValuesEntry(): ServiceConfig_ValuesEntry {
|
|
577
|
+
return { key: "", value: "" };
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export const ServiceConfig_ValuesEntry: MessageFns<ServiceConfig_ValuesEntry> = {
|
|
581
|
+
encode(message: ServiceConfig_ValuesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
582
|
+
if (message.key !== "") {
|
|
583
|
+
writer.uint32(10).string(message.key);
|
|
584
|
+
}
|
|
585
|
+
if (message.value !== "") {
|
|
586
|
+
writer.uint32(18).string(message.value);
|
|
587
|
+
}
|
|
588
|
+
return writer;
|
|
589
|
+
},
|
|
590
|
+
|
|
591
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ServiceConfig_ValuesEntry {
|
|
592
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
593
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
594
|
+
const message = createBaseServiceConfig_ValuesEntry();
|
|
595
|
+
while (reader.pos < end) {
|
|
596
|
+
const tag = reader.uint32();
|
|
597
|
+
switch (tag >>> 3) {
|
|
598
|
+
case 1: {
|
|
599
|
+
if (tag !== 10) {
|
|
600
|
+
break;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
message.key = reader.string();
|
|
604
|
+
continue;
|
|
605
|
+
}
|
|
606
|
+
case 2: {
|
|
607
|
+
if (tag !== 18) {
|
|
608
|
+
break;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
message.value = reader.string();
|
|
612
|
+
continue;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
reader.skip(tag & 7);
|
|
619
|
+
}
|
|
620
|
+
return message;
|
|
621
|
+
},
|
|
622
|
+
|
|
623
|
+
fromJSON(object: any): ServiceConfig_ValuesEntry {
|
|
624
|
+
return {
|
|
625
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
626
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
627
|
+
};
|
|
628
|
+
},
|
|
629
|
+
|
|
630
|
+
toJSON(message: ServiceConfig_ValuesEntry): unknown {
|
|
631
|
+
const obj: any = {};
|
|
632
|
+
if (message.key !== "") {
|
|
633
|
+
obj.key = message.key;
|
|
634
|
+
}
|
|
635
|
+
if (message.value !== "") {
|
|
636
|
+
obj.value = message.value;
|
|
637
|
+
}
|
|
638
|
+
return obj;
|
|
639
|
+
},
|
|
640
|
+
|
|
641
|
+
create<I extends Exact<DeepPartial<ServiceConfig_ValuesEntry>, I>>(base?: I): ServiceConfig_ValuesEntry {
|
|
642
|
+
return ServiceConfig_ValuesEntry.fromPartial(base ?? ({} as any));
|
|
643
|
+
},
|
|
644
|
+
fromPartial<I extends Exact<DeepPartial<ServiceConfig_ValuesEntry>, I>>(object: I): ServiceConfig_ValuesEntry {
|
|
645
|
+
const message = createBaseServiceConfig_ValuesEntry();
|
|
646
|
+
message.key = object.key ?? "";
|
|
647
|
+
message.value = object.value ?? "";
|
|
648
|
+
return message;
|
|
649
|
+
},
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
function createBaseListConfigsResponse(): ListConfigsResponse {
|
|
653
|
+
return { configs: [] };
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
export const ListConfigsResponse: MessageFns<ListConfigsResponse> = {
|
|
657
|
+
encode(message: ListConfigsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
658
|
+
for (const v of message.configs) {
|
|
659
|
+
ServiceConfig.encode(v!, writer.uint32(10).fork()).join();
|
|
660
|
+
}
|
|
661
|
+
return writer;
|
|
662
|
+
},
|
|
663
|
+
|
|
664
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ListConfigsResponse {
|
|
665
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
666
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
667
|
+
const message = createBaseListConfigsResponse();
|
|
668
|
+
while (reader.pos < end) {
|
|
669
|
+
const tag = reader.uint32();
|
|
670
|
+
switch (tag >>> 3) {
|
|
671
|
+
case 1: {
|
|
672
|
+
if (tag !== 10) {
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
message.configs.push(ServiceConfig.decode(reader, reader.uint32()));
|
|
677
|
+
continue;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
681
|
+
break;
|
|
682
|
+
}
|
|
683
|
+
reader.skip(tag & 7);
|
|
684
|
+
}
|
|
685
|
+
return message;
|
|
686
|
+
},
|
|
687
|
+
|
|
688
|
+
fromJSON(object: any): ListConfigsResponse {
|
|
689
|
+
return {
|
|
690
|
+
configs: globalThis.Array.isArray(object?.configs)
|
|
691
|
+
? object.configs.map((e: any) => ServiceConfig.fromJSON(e))
|
|
692
|
+
: [],
|
|
693
|
+
};
|
|
694
|
+
},
|
|
695
|
+
|
|
696
|
+
toJSON(message: ListConfigsResponse): unknown {
|
|
697
|
+
const obj: any = {};
|
|
698
|
+
if (message.configs?.length) {
|
|
699
|
+
obj.configs = message.configs.map((e) => ServiceConfig.toJSON(e));
|
|
700
|
+
}
|
|
701
|
+
return obj;
|
|
702
|
+
},
|
|
703
|
+
|
|
704
|
+
create<I extends Exact<DeepPartial<ListConfigsResponse>, I>>(base?: I): ListConfigsResponse {
|
|
705
|
+
return ListConfigsResponse.fromPartial(base ?? ({} as any));
|
|
706
|
+
},
|
|
707
|
+
fromPartial<I extends Exact<DeepPartial<ListConfigsResponse>, I>>(object: I): ListConfigsResponse {
|
|
708
|
+
const message = createBaseListConfigsResponse();
|
|
709
|
+
message.configs = object.configs?.map((e) => ServiceConfig.fromPartial(e)) || [];
|
|
710
|
+
return message;
|
|
711
|
+
},
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
export type ConfigServiceService = typeof ConfigServiceService;
|
|
715
|
+
export const ConfigServiceService = {
|
|
716
|
+
getConfig: {
|
|
717
|
+
path: "/config.ConfigService/GetConfig",
|
|
718
|
+
requestStream: false,
|
|
719
|
+
responseStream: false,
|
|
720
|
+
requestSerialize: (value: GetConfigRequest): Buffer => Buffer.from(GetConfigRequest.encode(value).finish()),
|
|
721
|
+
requestDeserialize: (value: Buffer): GetConfigRequest => GetConfigRequest.decode(value),
|
|
722
|
+
responseSerialize: (value: ConfigResponse): Buffer => Buffer.from(ConfigResponse.encode(value).finish()),
|
|
723
|
+
responseDeserialize: (value: Buffer): ConfigResponse => ConfigResponse.decode(value),
|
|
724
|
+
},
|
|
725
|
+
setConfig: {
|
|
726
|
+
path: "/config.ConfigService/SetConfig",
|
|
727
|
+
requestStream: false,
|
|
728
|
+
responseStream: false,
|
|
729
|
+
requestSerialize: (value: SetConfigRequest): Buffer => Buffer.from(SetConfigRequest.encode(value).finish()),
|
|
730
|
+
requestDeserialize: (value: Buffer): SetConfigRequest => SetConfigRequest.decode(value),
|
|
731
|
+
responseSerialize: (value: ConfigResponse): Buffer => Buffer.from(ConfigResponse.encode(value).finish()),
|
|
732
|
+
responseDeserialize: (value: Buffer): ConfigResponse => ConfigResponse.decode(value),
|
|
733
|
+
},
|
|
734
|
+
listConfigs: {
|
|
735
|
+
path: "/config.ConfigService/ListConfigs",
|
|
736
|
+
requestStream: false,
|
|
737
|
+
responseStream: false,
|
|
738
|
+
requestSerialize: (value: ListConfigsRequest): Buffer => Buffer.from(ListConfigsRequest.encode(value).finish()),
|
|
739
|
+
requestDeserialize: (value: Buffer): ListConfigsRequest => ListConfigsRequest.decode(value),
|
|
740
|
+
responseSerialize: (value: ListConfigsResponse): Buffer => Buffer.from(ListConfigsResponse.encode(value).finish()),
|
|
741
|
+
responseDeserialize: (value: Buffer): ListConfigsResponse => ListConfigsResponse.decode(value),
|
|
742
|
+
},
|
|
743
|
+
} as const;
|
|
744
|
+
|
|
745
|
+
export interface ConfigServiceServer extends UntypedServiceImplementation {
|
|
746
|
+
getConfig: handleUnaryCall<GetConfigRequest, ConfigResponse>;
|
|
747
|
+
setConfig: handleUnaryCall<SetConfigRequest, ConfigResponse>;
|
|
748
|
+
listConfigs: handleUnaryCall<ListConfigsRequest, ListConfigsResponse>;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
export interface ConfigServiceClient extends Client {
|
|
752
|
+
getConfig(
|
|
753
|
+
request: GetConfigRequest,
|
|
754
|
+
callback: (error: ServiceError | null, response: ConfigResponse) => void,
|
|
755
|
+
): ClientUnaryCall;
|
|
756
|
+
getConfig(
|
|
757
|
+
request: GetConfigRequest,
|
|
758
|
+
metadata: Metadata,
|
|
759
|
+
callback: (error: ServiceError | null, response: ConfigResponse) => void,
|
|
760
|
+
): ClientUnaryCall;
|
|
761
|
+
getConfig(
|
|
762
|
+
request: GetConfigRequest,
|
|
763
|
+
metadata: Metadata,
|
|
764
|
+
options: Partial<CallOptions>,
|
|
765
|
+
callback: (error: ServiceError | null, response: ConfigResponse) => void,
|
|
766
|
+
): ClientUnaryCall;
|
|
767
|
+
setConfig(
|
|
768
|
+
request: SetConfigRequest,
|
|
769
|
+
callback: (error: ServiceError | null, response: ConfigResponse) => void,
|
|
770
|
+
): ClientUnaryCall;
|
|
771
|
+
setConfig(
|
|
772
|
+
request: SetConfigRequest,
|
|
773
|
+
metadata: Metadata,
|
|
774
|
+
callback: (error: ServiceError | null, response: ConfigResponse) => void,
|
|
775
|
+
): ClientUnaryCall;
|
|
776
|
+
setConfig(
|
|
777
|
+
request: SetConfigRequest,
|
|
778
|
+
metadata: Metadata,
|
|
779
|
+
options: Partial<CallOptions>,
|
|
780
|
+
callback: (error: ServiceError | null, response: ConfigResponse) => void,
|
|
781
|
+
): ClientUnaryCall;
|
|
782
|
+
listConfigs(
|
|
783
|
+
request: ListConfigsRequest,
|
|
784
|
+
callback: (error: ServiceError | null, response: ListConfigsResponse) => void,
|
|
785
|
+
): ClientUnaryCall;
|
|
786
|
+
listConfigs(
|
|
787
|
+
request: ListConfigsRequest,
|
|
788
|
+
metadata: Metadata,
|
|
789
|
+
callback: (error: ServiceError | null, response: ListConfigsResponse) => void,
|
|
790
|
+
): ClientUnaryCall;
|
|
791
|
+
listConfigs(
|
|
792
|
+
request: ListConfigsRequest,
|
|
793
|
+
metadata: Metadata,
|
|
794
|
+
options: Partial<CallOptions>,
|
|
795
|
+
callback: (error: ServiceError | null, response: ListConfigsResponse) => void,
|
|
796
|
+
): ClientUnaryCall;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
export const ConfigServiceClient = makeGenericClientConstructor(
|
|
800
|
+
ConfigServiceService,
|
|
801
|
+
"config.ConfigService",
|
|
802
|
+
) as unknown as {
|
|
803
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): ConfigServiceClient;
|
|
804
|
+
service: typeof ConfigServiceService;
|
|
805
|
+
serviceName: string;
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
809
|
+
|
|
810
|
+
type DeepPartial<T> = T extends Builtin ? T
|
|
811
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
812
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
813
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
814
|
+
: Partial<T>;
|
|
815
|
+
|
|
816
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
817
|
+
type Exact<P, I extends P> = P extends Builtin ? P
|
|
818
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
819
|
+
|
|
820
|
+
function isObject(value: any): boolean {
|
|
821
|
+
return typeof value === "object" && value !== null;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
function isSet(value: any): boolean {
|
|
825
|
+
return value !== null && value !== undefined;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
interface MessageFns<T> {
|
|
829
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
830
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
831
|
+
fromJSON(object: any): T;
|
|
832
|
+
toJSON(message: T): unknown;
|
|
833
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
834
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
835
|
+
}
|