@conduitplatform/grpc-sdk 0.16.5 → 0.16.6

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 (137) hide show
  1. package/dist/classes/ConduitModule.d.ts +1 -1
  2. package/dist/index.cjs +13781 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.esm.js +13594 -0
  5. package/dist/index.esm.js.map +1 -0
  6. package/dist/modules/config/index.d.ts +1 -1
  7. package/package.json +24 -5
  8. package/dist/classes/ConduitAuthorizedResource.js +0 -24
  9. package/dist/classes/ConduitAuthorizedResource.js.map +0 -1
  10. package/dist/classes/ConduitModule.js +0 -112
  11. package/dist/classes/ConduitModule.js.map +0 -1
  12. package/dist/classes/ConduitSchema.js +0 -10
  13. package/dist/classes/ConduitSchema.js.map +0 -1
  14. package/dist/classes/Error.js +0 -24
  15. package/dist/classes/Error.js.map +0 -1
  16. package/dist/classes/HealthCheck.js +0 -30
  17. package/dist/classes/HealthCheck.js.map +0 -1
  18. package/dist/classes/index.js +0 -6
  19. package/dist/classes/index.js.map +0 -1
  20. package/dist/constants/enums/PlatformTypesEnum.js +0 -12
  21. package/dist/constants/enums/PlatformTypesEnum.js.map +0 -1
  22. package/dist/constants/enums/index.js +0 -2
  23. package/dist/constants/enums/index.js.map +0 -1
  24. package/dist/constants/index.js +0 -2
  25. package/dist/constants/index.js.map +0 -1
  26. package/dist/index.js +0 -472
  27. package/dist/index.js.map +0 -1
  28. package/dist/interceptors/grpcSignedToken.js +0 -12
  29. package/dist/interceptors/grpcSignedToken.js.map +0 -1
  30. package/dist/interceptors/index.js +0 -3
  31. package/dist/interceptors/index.js.map +0 -1
  32. package/dist/interceptors/moduleName.js +0 -12
  33. package/dist/interceptors/moduleName.js.map +0 -1
  34. package/dist/interfaces/ConduitMiddleware.js +0 -2
  35. package/dist/interfaces/ConduitMiddleware.js.map +0 -1
  36. package/dist/interfaces/ConduitRoute.js +0 -2
  37. package/dist/interfaces/ConduitRoute.js.map +0 -1
  38. package/dist/interfaces/ConduitRouteReturn.js +0 -61
  39. package/dist/interfaces/ConduitRouteReturn.js.map +0 -1
  40. package/dist/interfaces/ConduitSchemaExtension.js +0 -2
  41. package/dist/interfaces/ConduitSchemaExtension.js.map +0 -1
  42. package/dist/interfaces/GrpcCallback.js +0 -2
  43. package/dist/interfaces/GrpcCallback.js.map +0 -1
  44. package/dist/interfaces/IConduitLogger.js +0 -2
  45. package/dist/interfaces/IConduitLogger.js.map +0 -1
  46. package/dist/interfaces/IConduitMetrics.js +0 -2
  47. package/dist/interfaces/IConduitMetrics.js.map +0 -1
  48. package/dist/interfaces/Indexable.js +0 -2
  49. package/dist/interfaces/Indexable.js.map +0 -1
  50. package/dist/interfaces/Model.js +0 -49
  51. package/dist/interfaces/Model.js.map +0 -1
  52. package/dist/interfaces/Params.js +0 -2
  53. package/dist/interfaces/Params.js.map +0 -1
  54. package/dist/interfaces/ProxyRoute.js +0 -10
  55. package/dist/interfaces/ProxyRoute.js.map +0 -1
  56. package/dist/interfaces/RawQuery.js +0 -2
  57. package/dist/interfaces/RawQuery.js.map +0 -1
  58. package/dist/interfaces/Route.js +0 -9
  59. package/dist/interfaces/Route.js.map +0 -1
  60. package/dist/interfaces/Socket.js +0 -2
  61. package/dist/interfaces/Socket.js.map +0 -1
  62. package/dist/interfaces/UntypedArray.js +0 -2
  63. package/dist/interfaces/UntypedArray.js.map +0 -1
  64. package/dist/interfaces/index.js +0 -17
  65. package/dist/interfaces/index.js.map +0 -1
  66. package/dist/interfaces/types.js +0 -2
  67. package/dist/interfaces/types.js.map +0 -1
  68. package/dist/modules/admin/index.js +0 -24
  69. package/dist/modules/admin/index.js.map +0 -1
  70. package/dist/modules/authentication/index.js +0 -40
  71. package/dist/modules/authentication/index.js.map +0 -1
  72. package/dist/modules/authorization/index.js +0 -49
  73. package/dist/modules/authorization/index.js.map +0 -1
  74. package/dist/modules/chat/index.js +0 -19
  75. package/dist/modules/chat/index.js.map +0 -1
  76. package/dist/modules/config/index.js +0 -138
  77. package/dist/modules/config/index.js.map +0 -1
  78. package/dist/modules/core/index.js +0 -10
  79. package/dist/modules/core/index.js.map +0 -1
  80. package/dist/modules/database/index.js +0 -297
  81. package/dist/modules/database/index.js.map +0 -1
  82. package/dist/modules/email/index.js +0 -37
  83. package/dist/modules/email/index.js.map +0 -1
  84. package/dist/modules/index.js +0 -13
  85. package/dist/modules/index.js.map +0 -1
  86. package/dist/modules/pushNotifications/index.js +0 -51
  87. package/dist/modules/pushNotifications/index.js.map +0 -1
  88. package/dist/modules/router/index.js +0 -27
  89. package/dist/modules/router/index.js.map +0 -1
  90. package/dist/modules/sms/index.js +0 -19
  91. package/dist/modules/sms/index.js.map +0 -1
  92. package/dist/modules/storage/index.js +0 -70
  93. package/dist/modules/storage/index.js.map +0 -1
  94. package/dist/protoUtils/authentication.js +0 -1104
  95. package/dist/protoUtils/authentication.js.map +0 -1
  96. package/dist/protoUtils/authorization.js +0 -1480
  97. package/dist/protoUtils/authorization.js.map +0 -1
  98. package/dist/protoUtils/chat.js +0 -375
  99. package/dist/protoUtils/chat.js.map +0 -1
  100. package/dist/protoUtils/core.js +0 -1897
  101. package/dist/protoUtils/core.js.map +0 -1
  102. package/dist/protoUtils/database.js +0 -2379
  103. package/dist/protoUtils/database.js.map +0 -1
  104. package/dist/protoUtils/email.js +0 -437
  105. package/dist/protoUtils/email.js.map +0 -1
  106. package/dist/protoUtils/google/protobuf/empty.js +0 -40
  107. package/dist/protoUtils/google/protobuf/empty.js.map +0 -1
  108. package/dist/protoUtils/grpc_health_check.js +0 -173
  109. package/dist/protoUtils/grpc_health_check.js.map +0 -1
  110. package/dist/protoUtils/index.js +0 -13
  111. package/dist/protoUtils/index.js.map +0 -1
  112. package/dist/protoUtils/module.js +0 -868
  113. package/dist/protoUtils/module.js.map +0 -1
  114. package/dist/protoUtils/push-notifications.js +0 -689
  115. package/dist/protoUtils/push-notifications.js.map +0 -1
  116. package/dist/protoUtils/router.js +0 -929
  117. package/dist/protoUtils/router.js.map +0 -1
  118. package/dist/protoUtils/sms.js +0 -374
  119. package/dist/protoUtils/sms.js.map +0 -1
  120. package/dist/protoUtils/storage.js +0 -1207
  121. package/dist/protoUtils/storage.js.map +0 -1
  122. package/dist/types/db.js +0 -2
  123. package/dist/types/db.js.map +0 -1
  124. package/dist/types/index.js +0 -23
  125. package/dist/types/index.js.map +0 -1
  126. package/dist/utilities/EventBus.js +0 -71
  127. package/dist/utilities/EventBus.js.map +0 -1
  128. package/dist/utilities/RedisManager.js +0 -19
  129. package/dist/utilities/RedisManager.js.map +0 -1
  130. package/dist/utilities/StateManager.js +0 -70
  131. package/dist/utilities/StateManager.js.map +0 -1
  132. package/dist/utilities/env.js +0 -30
  133. package/dist/utilities/env.js.map +0 -1
  134. package/dist/utilities/index.js +0 -6
  135. package/dist/utilities/index.js.map +0 -1
  136. package/dist/utilities/sleep.js +0 -6
  137. package/dist/utilities/sleep.js.map +0 -1
@@ -1,1480 +0,0 @@
1
- /* eslint-disable */
2
- import _m0 from "protobufjs/minimal.js";
3
- import { Empty } from "./google/protobuf/empty.js";
4
- export var ResourceModificationAcknowledgement_Status;
5
- (function (ResourceModificationAcknowledgement_Status) {
6
- ResourceModificationAcknowledgement_Status[ResourceModificationAcknowledgement_Status["PROCESSED"] = 0] = "PROCESSED";
7
- ResourceModificationAcknowledgement_Status[ResourceModificationAcknowledgement_Status["ACKNOWLEDGED"] = 1] = "ACKNOWLEDGED";
8
- ResourceModificationAcknowledgement_Status[ResourceModificationAcknowledgement_Status["IGNORED"] = 2] = "IGNORED";
9
- ResourceModificationAcknowledgement_Status[ResourceModificationAcknowledgement_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
10
- })(ResourceModificationAcknowledgement_Status || (ResourceModificationAcknowledgement_Status = {}));
11
- export function resourceModificationAcknowledgement_StatusFromJSON(object) {
12
- switch (object) {
13
- case 0:
14
- case "PROCESSED":
15
- return ResourceModificationAcknowledgement_Status.PROCESSED;
16
- case 1:
17
- case "ACKNOWLEDGED":
18
- return ResourceModificationAcknowledgement_Status.ACKNOWLEDGED;
19
- case 2:
20
- case "IGNORED":
21
- return ResourceModificationAcknowledgement_Status.IGNORED;
22
- case -1:
23
- case "UNRECOGNIZED":
24
- default:
25
- return ResourceModificationAcknowledgement_Status.UNRECOGNIZED;
26
- }
27
- }
28
- export function resourceModificationAcknowledgement_StatusToJSON(object) {
29
- switch (object) {
30
- case ResourceModificationAcknowledgement_Status.PROCESSED:
31
- return "PROCESSED";
32
- case ResourceModificationAcknowledgement_Status.ACKNOWLEDGED:
33
- return "ACKNOWLEDGED";
34
- case ResourceModificationAcknowledgement_Status.IGNORED:
35
- return "IGNORED";
36
- case ResourceModificationAcknowledgement_Status.UNRECOGNIZED:
37
- default:
38
- return "UNRECOGNIZED";
39
- }
40
- }
41
- function createBaseResource() {
42
- return { name: "", relations: [], permissions: [], version: undefined };
43
- }
44
- export const Resource = {
45
- encode(message, writer = _m0.Writer.create()) {
46
- if (message.name !== "") {
47
- writer.uint32(10).string(message.name);
48
- }
49
- for (const v of message.relations) {
50
- Resource_Relation.encode(v, writer.uint32(18).fork()).ldelim();
51
- }
52
- for (const v of message.permissions) {
53
- Resource_Permission.encode(v, writer.uint32(26).fork()).ldelim();
54
- }
55
- if (message.version !== undefined) {
56
- writer.uint32(32).uint32(message.version);
57
- }
58
- return writer;
59
- },
60
- decode(input, length) {
61
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
62
- let end = length === undefined ? reader.len : reader.pos + length;
63
- const message = createBaseResource();
64
- while (reader.pos < end) {
65
- const tag = reader.uint32();
66
- switch (tag >>> 3) {
67
- case 1:
68
- if (tag !== 10) {
69
- break;
70
- }
71
- message.name = reader.string();
72
- continue;
73
- case 2:
74
- if (tag !== 18) {
75
- break;
76
- }
77
- message.relations.push(Resource_Relation.decode(reader, reader.uint32()));
78
- continue;
79
- case 3:
80
- if (tag !== 26) {
81
- break;
82
- }
83
- message.permissions.push(Resource_Permission.decode(reader, reader.uint32()));
84
- continue;
85
- case 4:
86
- if (tag !== 32) {
87
- break;
88
- }
89
- message.version = reader.uint32();
90
- continue;
91
- }
92
- if ((tag & 7) === 4 || tag === 0) {
93
- break;
94
- }
95
- reader.skipType(tag & 7);
96
- }
97
- return message;
98
- },
99
- fromJSON(object) {
100
- return {
101
- name: isSet(object.name) ? globalThis.String(object.name) : "",
102
- relations: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.relations)
103
- ? object.relations.map((e) => Resource_Relation.fromJSON(e))
104
- : [],
105
- permissions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.permissions)
106
- ? object.permissions.map((e) => Resource_Permission.fromJSON(e))
107
- : [],
108
- version: isSet(object.version) ? globalThis.Number(object.version) : undefined,
109
- };
110
- },
111
- toJSON(message) {
112
- var _a, _b;
113
- const obj = {};
114
- if (message.name !== "") {
115
- obj.name = message.name;
116
- }
117
- if ((_a = message.relations) === null || _a === void 0 ? void 0 : _a.length) {
118
- obj.relations = message.relations.map((e) => Resource_Relation.toJSON(e));
119
- }
120
- if ((_b = message.permissions) === null || _b === void 0 ? void 0 : _b.length) {
121
- obj.permissions = message.permissions.map((e) => Resource_Permission.toJSON(e));
122
- }
123
- if (message.version !== undefined) {
124
- obj.version = Math.round(message.version);
125
- }
126
- return obj;
127
- },
128
- create(base) {
129
- return Resource.fromPartial(base !== null && base !== void 0 ? base : {});
130
- },
131
- fromPartial(object) {
132
- var _a, _b, _c, _d;
133
- const message = createBaseResource();
134
- message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
135
- message.relations = ((_b = object.relations) === null || _b === void 0 ? void 0 : _b.map((e) => Resource_Relation.fromPartial(e))) || [];
136
- message.permissions = ((_c = object.permissions) === null || _c === void 0 ? void 0 : _c.map((e) => Resource_Permission.fromPartial(e))) || [];
137
- message.version = (_d = object.version) !== null && _d !== void 0 ? _d : undefined;
138
- return message;
139
- },
140
- };
141
- function createBaseResource_Relation() {
142
- return { name: "", resourceType: [] };
143
- }
144
- export const Resource_Relation = {
145
- encode(message, writer = _m0.Writer.create()) {
146
- if (message.name !== "") {
147
- writer.uint32(10).string(message.name);
148
- }
149
- for (const v of message.resourceType) {
150
- writer.uint32(18).string(v);
151
- }
152
- return writer;
153
- },
154
- decode(input, length) {
155
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
156
- let end = length === undefined ? reader.len : reader.pos + length;
157
- const message = createBaseResource_Relation();
158
- while (reader.pos < end) {
159
- const tag = reader.uint32();
160
- switch (tag >>> 3) {
161
- case 1:
162
- if (tag !== 10) {
163
- break;
164
- }
165
- message.name = reader.string();
166
- continue;
167
- case 2:
168
- if (tag !== 18) {
169
- break;
170
- }
171
- message.resourceType.push(reader.string());
172
- continue;
173
- }
174
- if ((tag & 7) === 4 || tag === 0) {
175
- break;
176
- }
177
- reader.skipType(tag & 7);
178
- }
179
- return message;
180
- },
181
- fromJSON(object) {
182
- return {
183
- name: isSet(object.name) ? globalThis.String(object.name) : "",
184
- resourceType: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.resourceType)
185
- ? object.resourceType.map((e) => globalThis.String(e))
186
- : [],
187
- };
188
- },
189
- toJSON(message) {
190
- var _a;
191
- const obj = {};
192
- if (message.name !== "") {
193
- obj.name = message.name;
194
- }
195
- if ((_a = message.resourceType) === null || _a === void 0 ? void 0 : _a.length) {
196
- obj.resourceType = message.resourceType;
197
- }
198
- return obj;
199
- },
200
- create(base) {
201
- return Resource_Relation.fromPartial(base !== null && base !== void 0 ? base : {});
202
- },
203
- fromPartial(object) {
204
- var _a, _b;
205
- const message = createBaseResource_Relation();
206
- message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
207
- message.resourceType = ((_b = object.resourceType) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
208
- return message;
209
- },
210
- };
211
- function createBaseResource_Permission() {
212
- return { name: "", roles: [] };
213
- }
214
- export const Resource_Permission = {
215
- encode(message, writer = _m0.Writer.create()) {
216
- if (message.name !== "") {
217
- writer.uint32(10).string(message.name);
218
- }
219
- for (const v of message.roles) {
220
- writer.uint32(18).string(v);
221
- }
222
- return writer;
223
- },
224
- decode(input, length) {
225
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
226
- let end = length === undefined ? reader.len : reader.pos + length;
227
- const message = createBaseResource_Permission();
228
- while (reader.pos < end) {
229
- const tag = reader.uint32();
230
- switch (tag >>> 3) {
231
- case 1:
232
- if (tag !== 10) {
233
- break;
234
- }
235
- message.name = reader.string();
236
- continue;
237
- case 2:
238
- if (tag !== 18) {
239
- break;
240
- }
241
- message.roles.push(reader.string());
242
- continue;
243
- }
244
- if ((tag & 7) === 4 || tag === 0) {
245
- break;
246
- }
247
- reader.skipType(tag & 7);
248
- }
249
- return message;
250
- },
251
- fromJSON(object) {
252
- return {
253
- name: isSet(object.name) ? globalThis.String(object.name) : "",
254
- roles: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.roles) ? object.roles.map((e) => globalThis.String(e)) : [],
255
- };
256
- },
257
- toJSON(message) {
258
- var _a;
259
- const obj = {};
260
- if (message.name !== "") {
261
- obj.name = message.name;
262
- }
263
- if ((_a = message.roles) === null || _a === void 0 ? void 0 : _a.length) {
264
- obj.roles = message.roles;
265
- }
266
- return obj;
267
- },
268
- create(base) {
269
- return Resource_Permission.fromPartial(base !== null && base !== void 0 ? base : {});
270
- },
271
- fromPartial(object) {
272
- var _a, _b;
273
- const message = createBaseResource_Permission();
274
- message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
275
- message.roles = ((_b = object.roles) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
276
- return message;
277
- },
278
- };
279
- function createBaseResourceModificationAcknowledgement() {
280
- return { status: 0 };
281
- }
282
- export const ResourceModificationAcknowledgement = {
283
- encode(message, writer = _m0.Writer.create()) {
284
- if (message.status !== 0) {
285
- writer.uint32(8).int32(message.status);
286
- }
287
- return writer;
288
- },
289
- decode(input, length) {
290
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
291
- let end = length === undefined ? reader.len : reader.pos + length;
292
- const message = createBaseResourceModificationAcknowledgement();
293
- while (reader.pos < end) {
294
- const tag = reader.uint32();
295
- switch (tag >>> 3) {
296
- case 1:
297
- if (tag !== 8) {
298
- break;
299
- }
300
- message.status = reader.int32();
301
- continue;
302
- }
303
- if ((tag & 7) === 4 || tag === 0) {
304
- break;
305
- }
306
- reader.skipType(tag & 7);
307
- }
308
- return message;
309
- },
310
- fromJSON(object) {
311
- return { status: isSet(object.status) ? resourceModificationAcknowledgement_StatusFromJSON(object.status) : 0 };
312
- },
313
- toJSON(message) {
314
- const obj = {};
315
- if (message.status !== 0) {
316
- obj.status = resourceModificationAcknowledgement_StatusToJSON(message.status);
317
- }
318
- return obj;
319
- },
320
- create(base) {
321
- return ResourceModificationAcknowledgement.fromPartial(base !== null && base !== void 0 ? base : {});
322
- },
323
- fromPartial(object) {
324
- var _a;
325
- const message = createBaseResourceModificationAcknowledgement();
326
- message.status = (_a = object.status) !== null && _a !== void 0 ? _a : 0;
327
- return message;
328
- },
329
- };
330
- function createBaseRelation() {
331
- return { subject: "", relation: "", resource: "" };
332
- }
333
- export const Relation = {
334
- encode(message, writer = _m0.Writer.create()) {
335
- if (message.subject !== "") {
336
- writer.uint32(10).string(message.subject);
337
- }
338
- if (message.relation !== "") {
339
- writer.uint32(18).string(message.relation);
340
- }
341
- if (message.resource !== "") {
342
- writer.uint32(26).string(message.resource);
343
- }
344
- return writer;
345
- },
346
- decode(input, length) {
347
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
348
- let end = length === undefined ? reader.len : reader.pos + length;
349
- const message = createBaseRelation();
350
- while (reader.pos < end) {
351
- const tag = reader.uint32();
352
- switch (tag >>> 3) {
353
- case 1:
354
- if (tag !== 10) {
355
- break;
356
- }
357
- message.subject = reader.string();
358
- continue;
359
- case 2:
360
- if (tag !== 18) {
361
- break;
362
- }
363
- message.relation = reader.string();
364
- continue;
365
- case 3:
366
- if (tag !== 26) {
367
- break;
368
- }
369
- message.resource = reader.string();
370
- continue;
371
- }
372
- if ((tag & 7) === 4 || tag === 0) {
373
- break;
374
- }
375
- reader.skipType(tag & 7);
376
- }
377
- return message;
378
- },
379
- fromJSON(object) {
380
- return {
381
- subject: isSet(object.subject) ? globalThis.String(object.subject) : "",
382
- relation: isSet(object.relation) ? globalThis.String(object.relation) : "",
383
- resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
384
- };
385
- },
386
- toJSON(message) {
387
- const obj = {};
388
- if (message.subject !== "") {
389
- obj.subject = message.subject;
390
- }
391
- if (message.relation !== "") {
392
- obj.relation = message.relation;
393
- }
394
- if (message.resource !== "") {
395
- obj.resource = message.resource;
396
- }
397
- return obj;
398
- },
399
- create(base) {
400
- return Relation.fromPartial(base !== null && base !== void 0 ? base : {});
401
- },
402
- fromPartial(object) {
403
- var _a, _b, _c;
404
- const message = createBaseRelation();
405
- message.subject = (_a = object.subject) !== null && _a !== void 0 ? _a : "";
406
- message.relation = (_b = object.relation) !== null && _b !== void 0 ? _b : "";
407
- message.resource = (_c = object.resource) !== null && _c !== void 0 ? _c : "";
408
- return message;
409
- },
410
- };
411
- function createBaseCreateRelationsRequest() {
412
- return { subject: "", relation: "", resources: [] };
413
- }
414
- export const CreateRelationsRequest = {
415
- encode(message, writer = _m0.Writer.create()) {
416
- if (message.subject !== "") {
417
- writer.uint32(10).string(message.subject);
418
- }
419
- if (message.relation !== "") {
420
- writer.uint32(18).string(message.relation);
421
- }
422
- for (const v of message.resources) {
423
- writer.uint32(26).string(v);
424
- }
425
- return writer;
426
- },
427
- decode(input, length) {
428
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
429
- let end = length === undefined ? reader.len : reader.pos + length;
430
- const message = createBaseCreateRelationsRequest();
431
- while (reader.pos < end) {
432
- const tag = reader.uint32();
433
- switch (tag >>> 3) {
434
- case 1:
435
- if (tag !== 10) {
436
- break;
437
- }
438
- message.subject = reader.string();
439
- continue;
440
- case 2:
441
- if (tag !== 18) {
442
- break;
443
- }
444
- message.relation = reader.string();
445
- continue;
446
- case 3:
447
- if (tag !== 26) {
448
- break;
449
- }
450
- message.resources.push(reader.string());
451
- continue;
452
- }
453
- if ((tag & 7) === 4 || tag === 0) {
454
- break;
455
- }
456
- reader.skipType(tag & 7);
457
- }
458
- return message;
459
- },
460
- fromJSON(object) {
461
- return {
462
- subject: isSet(object.subject) ? globalThis.String(object.subject) : "",
463
- relation: isSet(object.relation) ? globalThis.String(object.relation) : "",
464
- resources: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.resources)
465
- ? object.resources.map((e) => globalThis.String(e))
466
- : [],
467
- };
468
- },
469
- toJSON(message) {
470
- var _a;
471
- const obj = {};
472
- if (message.subject !== "") {
473
- obj.subject = message.subject;
474
- }
475
- if (message.relation !== "") {
476
- obj.relation = message.relation;
477
- }
478
- if ((_a = message.resources) === null || _a === void 0 ? void 0 : _a.length) {
479
- obj.resources = message.resources;
480
- }
481
- return obj;
482
- },
483
- create(base) {
484
- return CreateRelationsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
485
- },
486
- fromPartial(object) {
487
- var _a, _b, _c;
488
- const message = createBaseCreateRelationsRequest();
489
- message.subject = (_a = object.subject) !== null && _a !== void 0 ? _a : "";
490
- message.relation = (_b = object.relation) !== null && _b !== void 0 ? _b : "";
491
- message.resources = ((_c = object.resources) === null || _c === void 0 ? void 0 : _c.map((e) => e)) || [];
492
- return message;
493
- },
494
- };
495
- function createBaseDeleteAllRelationsRequest() {
496
- return { subject: undefined, resource: undefined };
497
- }
498
- export const DeleteAllRelationsRequest = {
499
- encode(message, writer = _m0.Writer.create()) {
500
- if (message.subject !== undefined) {
501
- writer.uint32(10).string(message.subject);
502
- }
503
- if (message.resource !== undefined) {
504
- writer.uint32(18).string(message.resource);
505
- }
506
- return writer;
507
- },
508
- decode(input, length) {
509
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
510
- let end = length === undefined ? reader.len : reader.pos + length;
511
- const message = createBaseDeleteAllRelationsRequest();
512
- while (reader.pos < end) {
513
- const tag = reader.uint32();
514
- switch (tag >>> 3) {
515
- case 1:
516
- if (tag !== 10) {
517
- break;
518
- }
519
- message.subject = reader.string();
520
- continue;
521
- case 2:
522
- if (tag !== 18) {
523
- break;
524
- }
525
- message.resource = reader.string();
526
- continue;
527
- }
528
- if ((tag & 7) === 4 || tag === 0) {
529
- break;
530
- }
531
- reader.skipType(tag & 7);
532
- }
533
- return message;
534
- },
535
- fromJSON(object) {
536
- return {
537
- subject: isSet(object.subject) ? globalThis.String(object.subject) : undefined,
538
- resource: isSet(object.resource) ? globalThis.String(object.resource) : undefined,
539
- };
540
- },
541
- toJSON(message) {
542
- const obj = {};
543
- if (message.subject !== undefined) {
544
- obj.subject = message.subject;
545
- }
546
- if (message.resource !== undefined) {
547
- obj.resource = message.resource;
548
- }
549
- return obj;
550
- },
551
- create(base) {
552
- return DeleteAllRelationsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
553
- },
554
- fromPartial(object) {
555
- var _a, _b;
556
- const message = createBaseDeleteAllRelationsRequest();
557
- message.subject = (_a = object.subject) !== null && _a !== void 0 ? _a : undefined;
558
- message.resource = (_b = object.resource) !== null && _b !== void 0 ? _b : undefined;
559
- return message;
560
- },
561
- };
562
- function createBaseDeleteResourceRequest() {
563
- return { name: "" };
564
- }
565
- export const DeleteResourceRequest = {
566
- encode(message, writer = _m0.Writer.create()) {
567
- if (message.name !== "") {
568
- writer.uint32(10).string(message.name);
569
- }
570
- return writer;
571
- },
572
- decode(input, length) {
573
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
574
- let end = length === undefined ? reader.len : reader.pos + length;
575
- const message = createBaseDeleteResourceRequest();
576
- while (reader.pos < end) {
577
- const tag = reader.uint32();
578
- switch (tag >>> 3) {
579
- case 1:
580
- if (tag !== 10) {
581
- break;
582
- }
583
- message.name = reader.string();
584
- continue;
585
- }
586
- if ((tag & 7) === 4 || tag === 0) {
587
- break;
588
- }
589
- reader.skipType(tag & 7);
590
- }
591
- return message;
592
- },
593
- fromJSON(object) {
594
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
595
- },
596
- toJSON(message) {
597
- const obj = {};
598
- if (message.name !== "") {
599
- obj.name = message.name;
600
- }
601
- return obj;
602
- },
603
- create(base) {
604
- return DeleteResourceRequest.fromPartial(base !== null && base !== void 0 ? base : {});
605
- },
606
- fromPartial(object) {
607
- var _a;
608
- const message = createBaseDeleteResourceRequest();
609
- message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
610
- return message;
611
- },
612
- };
613
- function createBaseFindRelationRequest() {
614
- return {
615
- subject: undefined,
616
- relation: undefined,
617
- resource: undefined,
618
- subjectType: undefined,
619
- resourceType: undefined,
620
- skip: undefined,
621
- limit: undefined,
622
- };
623
- }
624
- export const FindRelationRequest = {
625
- encode(message, writer = _m0.Writer.create()) {
626
- if (message.subject !== undefined) {
627
- writer.uint32(10).string(message.subject);
628
- }
629
- if (message.relation !== undefined) {
630
- writer.uint32(18).string(message.relation);
631
- }
632
- if (message.resource !== undefined) {
633
- writer.uint32(26).string(message.resource);
634
- }
635
- if (message.subjectType !== undefined) {
636
- writer.uint32(34).string(message.subjectType);
637
- }
638
- if (message.resourceType !== undefined) {
639
- writer.uint32(42).string(message.resourceType);
640
- }
641
- if (message.skip !== undefined) {
642
- writer.uint32(48).int32(message.skip);
643
- }
644
- if (message.limit !== undefined) {
645
- writer.uint32(56).int32(message.limit);
646
- }
647
- return writer;
648
- },
649
- decode(input, length) {
650
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
651
- let end = length === undefined ? reader.len : reader.pos + length;
652
- const message = createBaseFindRelationRequest();
653
- while (reader.pos < end) {
654
- const tag = reader.uint32();
655
- switch (tag >>> 3) {
656
- case 1:
657
- if (tag !== 10) {
658
- break;
659
- }
660
- message.subject = reader.string();
661
- continue;
662
- case 2:
663
- if (tag !== 18) {
664
- break;
665
- }
666
- message.relation = reader.string();
667
- continue;
668
- case 3:
669
- if (tag !== 26) {
670
- break;
671
- }
672
- message.resource = reader.string();
673
- continue;
674
- case 4:
675
- if (tag !== 34) {
676
- break;
677
- }
678
- message.subjectType = reader.string();
679
- continue;
680
- case 5:
681
- if (tag !== 42) {
682
- break;
683
- }
684
- message.resourceType = reader.string();
685
- continue;
686
- case 6:
687
- if (tag !== 48) {
688
- break;
689
- }
690
- message.skip = reader.int32();
691
- continue;
692
- case 7:
693
- if (tag !== 56) {
694
- break;
695
- }
696
- message.limit = reader.int32();
697
- continue;
698
- }
699
- if ((tag & 7) === 4 || tag === 0) {
700
- break;
701
- }
702
- reader.skipType(tag & 7);
703
- }
704
- return message;
705
- },
706
- fromJSON(object) {
707
- return {
708
- subject: isSet(object.subject) ? globalThis.String(object.subject) : undefined,
709
- relation: isSet(object.relation) ? globalThis.String(object.relation) : undefined,
710
- resource: isSet(object.resource) ? globalThis.String(object.resource) : undefined,
711
- subjectType: isSet(object.subjectType) ? globalThis.String(object.subjectType) : undefined,
712
- resourceType: isSet(object.resourceType) ? globalThis.String(object.resourceType) : undefined,
713
- skip: isSet(object.skip) ? globalThis.Number(object.skip) : undefined,
714
- limit: isSet(object.limit) ? globalThis.Number(object.limit) : undefined,
715
- };
716
- },
717
- toJSON(message) {
718
- const obj = {};
719
- if (message.subject !== undefined) {
720
- obj.subject = message.subject;
721
- }
722
- if (message.relation !== undefined) {
723
- obj.relation = message.relation;
724
- }
725
- if (message.resource !== undefined) {
726
- obj.resource = message.resource;
727
- }
728
- if (message.subjectType !== undefined) {
729
- obj.subjectType = message.subjectType;
730
- }
731
- if (message.resourceType !== undefined) {
732
- obj.resourceType = message.resourceType;
733
- }
734
- if (message.skip !== undefined) {
735
- obj.skip = Math.round(message.skip);
736
- }
737
- if (message.limit !== undefined) {
738
- obj.limit = Math.round(message.limit);
739
- }
740
- return obj;
741
- },
742
- create(base) {
743
- return FindRelationRequest.fromPartial(base !== null && base !== void 0 ? base : {});
744
- },
745
- fromPartial(object) {
746
- var _a, _b, _c, _d, _e, _f, _g;
747
- const message = createBaseFindRelationRequest();
748
- message.subject = (_a = object.subject) !== null && _a !== void 0 ? _a : undefined;
749
- message.relation = (_b = object.relation) !== null && _b !== void 0 ? _b : undefined;
750
- message.resource = (_c = object.resource) !== null && _c !== void 0 ? _c : undefined;
751
- message.subjectType = (_d = object.subjectType) !== null && _d !== void 0 ? _d : undefined;
752
- message.resourceType = (_e = object.resourceType) !== null && _e !== void 0 ? _e : undefined;
753
- message.skip = (_f = object.skip) !== null && _f !== void 0 ? _f : undefined;
754
- message.limit = (_g = object.limit) !== null && _g !== void 0 ? _g : undefined;
755
- return message;
756
- },
757
- };
758
- function createBaseFindRelationResponse() {
759
- return { relations: [], count: 0 };
760
- }
761
- export const FindRelationResponse = {
762
- encode(message, writer = _m0.Writer.create()) {
763
- for (const v of message.relations) {
764
- Relation.encode(v, writer.uint32(10).fork()).ldelim();
765
- }
766
- if (message.count !== 0) {
767
- writer.uint32(16).int32(message.count);
768
- }
769
- return writer;
770
- },
771
- decode(input, length) {
772
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
773
- let end = length === undefined ? reader.len : reader.pos + length;
774
- const message = createBaseFindRelationResponse();
775
- while (reader.pos < end) {
776
- const tag = reader.uint32();
777
- switch (tag >>> 3) {
778
- case 1:
779
- if (tag !== 10) {
780
- break;
781
- }
782
- message.relations.push(Relation.decode(reader, reader.uint32()));
783
- continue;
784
- case 2:
785
- if (tag !== 16) {
786
- break;
787
- }
788
- message.count = reader.int32();
789
- continue;
790
- }
791
- if ((tag & 7) === 4 || tag === 0) {
792
- break;
793
- }
794
- reader.skipType(tag & 7);
795
- }
796
- return message;
797
- },
798
- fromJSON(object) {
799
- return {
800
- relations: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.relations)
801
- ? object.relations.map((e) => Relation.fromJSON(e))
802
- : [],
803
- count: isSet(object.count) ? globalThis.Number(object.count) : 0,
804
- };
805
- },
806
- toJSON(message) {
807
- var _a;
808
- const obj = {};
809
- if ((_a = message.relations) === null || _a === void 0 ? void 0 : _a.length) {
810
- obj.relations = message.relations.map((e) => Relation.toJSON(e));
811
- }
812
- if (message.count !== 0) {
813
- obj.count = Math.round(message.count);
814
- }
815
- return obj;
816
- },
817
- create(base) {
818
- return FindRelationResponse.fromPartial(base !== null && base !== void 0 ? base : {});
819
- },
820
- fromPartial(object) {
821
- var _a, _b;
822
- const message = createBaseFindRelationResponse();
823
- message.relations = ((_a = object.relations) === null || _a === void 0 ? void 0 : _a.map((e) => Relation.fromPartial(e))) || [];
824
- message.count = (_b = object.count) !== null && _b !== void 0 ? _b : 0;
825
- return message;
826
- },
827
- };
828
- function createBaseAllowedResourcesRequest() {
829
- return { subject: "", action: "", resourceType: "", skip: 0, limit: 0 };
830
- }
831
- export const AllowedResourcesRequest = {
832
- encode(message, writer = _m0.Writer.create()) {
833
- if (message.subject !== "") {
834
- writer.uint32(10).string(message.subject);
835
- }
836
- if (message.action !== "") {
837
- writer.uint32(18).string(message.action);
838
- }
839
- if (message.resourceType !== "") {
840
- writer.uint32(42).string(message.resourceType);
841
- }
842
- if (message.skip !== 0) {
843
- writer.uint32(48).int32(message.skip);
844
- }
845
- if (message.limit !== 0) {
846
- writer.uint32(56).int32(message.limit);
847
- }
848
- return writer;
849
- },
850
- decode(input, length) {
851
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
852
- let end = length === undefined ? reader.len : reader.pos + length;
853
- const message = createBaseAllowedResourcesRequest();
854
- while (reader.pos < end) {
855
- const tag = reader.uint32();
856
- switch (tag >>> 3) {
857
- case 1:
858
- if (tag !== 10) {
859
- break;
860
- }
861
- message.subject = reader.string();
862
- continue;
863
- case 2:
864
- if (tag !== 18) {
865
- break;
866
- }
867
- message.action = reader.string();
868
- continue;
869
- case 5:
870
- if (tag !== 42) {
871
- break;
872
- }
873
- message.resourceType = reader.string();
874
- continue;
875
- case 6:
876
- if (tag !== 48) {
877
- break;
878
- }
879
- message.skip = reader.int32();
880
- continue;
881
- case 7:
882
- if (tag !== 56) {
883
- break;
884
- }
885
- message.limit = reader.int32();
886
- continue;
887
- }
888
- if ((tag & 7) === 4 || tag === 0) {
889
- break;
890
- }
891
- reader.skipType(tag & 7);
892
- }
893
- return message;
894
- },
895
- fromJSON(object) {
896
- return {
897
- subject: isSet(object.subject) ? globalThis.String(object.subject) : "",
898
- action: isSet(object.action) ? globalThis.String(object.action) : "",
899
- resourceType: isSet(object.resourceType) ? globalThis.String(object.resourceType) : "",
900
- skip: isSet(object.skip) ? globalThis.Number(object.skip) : 0,
901
- limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
902
- };
903
- },
904
- toJSON(message) {
905
- const obj = {};
906
- if (message.subject !== "") {
907
- obj.subject = message.subject;
908
- }
909
- if (message.action !== "") {
910
- obj.action = message.action;
911
- }
912
- if (message.resourceType !== "") {
913
- obj.resourceType = message.resourceType;
914
- }
915
- if (message.skip !== 0) {
916
- obj.skip = Math.round(message.skip);
917
- }
918
- if (message.limit !== 0) {
919
- obj.limit = Math.round(message.limit);
920
- }
921
- return obj;
922
- },
923
- create(base) {
924
- return AllowedResourcesRequest.fromPartial(base !== null && base !== void 0 ? base : {});
925
- },
926
- fromPartial(object) {
927
- var _a, _b, _c, _d, _e;
928
- const message = createBaseAllowedResourcesRequest();
929
- message.subject = (_a = object.subject) !== null && _a !== void 0 ? _a : "";
930
- message.action = (_b = object.action) !== null && _b !== void 0 ? _b : "";
931
- message.resourceType = (_c = object.resourceType) !== null && _c !== void 0 ? _c : "";
932
- message.skip = (_d = object.skip) !== null && _d !== void 0 ? _d : 0;
933
- message.limit = (_e = object.limit) !== null && _e !== void 0 ? _e : 0;
934
- return message;
935
- },
936
- };
937
- function createBaseAllowedResourcesResponse() {
938
- return { resources: [], count: 0 };
939
- }
940
- export const AllowedResourcesResponse = {
941
- encode(message, writer = _m0.Writer.create()) {
942
- for (const v of message.resources) {
943
- writer.uint32(10).string(v);
944
- }
945
- if (message.count !== 0) {
946
- writer.uint32(16).int32(message.count);
947
- }
948
- return writer;
949
- },
950
- decode(input, length) {
951
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
952
- let end = length === undefined ? reader.len : reader.pos + length;
953
- const message = createBaseAllowedResourcesResponse();
954
- while (reader.pos < end) {
955
- const tag = reader.uint32();
956
- switch (tag >>> 3) {
957
- case 1:
958
- if (tag !== 10) {
959
- break;
960
- }
961
- message.resources.push(reader.string());
962
- continue;
963
- case 2:
964
- if (tag !== 16) {
965
- break;
966
- }
967
- message.count = reader.int32();
968
- continue;
969
- }
970
- if ((tag & 7) === 4 || tag === 0) {
971
- break;
972
- }
973
- reader.skipType(tag & 7);
974
- }
975
- return message;
976
- },
977
- fromJSON(object) {
978
- return {
979
- resources: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.resources)
980
- ? object.resources.map((e) => globalThis.String(e))
981
- : [],
982
- count: isSet(object.count) ? globalThis.Number(object.count) : 0,
983
- };
984
- },
985
- toJSON(message) {
986
- var _a;
987
- const obj = {};
988
- if ((_a = message.resources) === null || _a === void 0 ? void 0 : _a.length) {
989
- obj.resources = message.resources;
990
- }
991
- if (message.count !== 0) {
992
- obj.count = Math.round(message.count);
993
- }
994
- return obj;
995
- },
996
- create(base) {
997
- return AllowedResourcesResponse.fromPartial(base !== null && base !== void 0 ? base : {});
998
- },
999
- fromPartial(object) {
1000
- var _a, _b;
1001
- const message = createBaseAllowedResourcesResponse();
1002
- message.resources = ((_a = object.resources) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
1003
- message.count = (_b = object.count) !== null && _b !== void 0 ? _b : 0;
1004
- return message;
1005
- },
1006
- };
1007
- function createBaseResourceAccessListRequest() {
1008
- return { subject: "", action: "", viewName: undefined, resourceType: "" };
1009
- }
1010
- export const ResourceAccessListRequest = {
1011
- encode(message, writer = _m0.Writer.create()) {
1012
- if (message.subject !== "") {
1013
- writer.uint32(10).string(message.subject);
1014
- }
1015
- if (message.action !== "") {
1016
- writer.uint32(18).string(message.action);
1017
- }
1018
- if (message.viewName !== undefined) {
1019
- writer.uint32(26).string(message.viewName);
1020
- }
1021
- if (message.resourceType !== "") {
1022
- writer.uint32(42).string(message.resourceType);
1023
- }
1024
- return writer;
1025
- },
1026
- decode(input, length) {
1027
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1028
- let end = length === undefined ? reader.len : reader.pos + length;
1029
- const message = createBaseResourceAccessListRequest();
1030
- while (reader.pos < end) {
1031
- const tag = reader.uint32();
1032
- switch (tag >>> 3) {
1033
- case 1:
1034
- if (tag !== 10) {
1035
- break;
1036
- }
1037
- message.subject = reader.string();
1038
- continue;
1039
- case 2:
1040
- if (tag !== 18) {
1041
- break;
1042
- }
1043
- message.action = reader.string();
1044
- continue;
1045
- case 3:
1046
- if (tag !== 26) {
1047
- break;
1048
- }
1049
- message.viewName = reader.string();
1050
- continue;
1051
- case 5:
1052
- if (tag !== 42) {
1053
- break;
1054
- }
1055
- message.resourceType = reader.string();
1056
- continue;
1057
- }
1058
- if ((tag & 7) === 4 || tag === 0) {
1059
- break;
1060
- }
1061
- reader.skipType(tag & 7);
1062
- }
1063
- return message;
1064
- },
1065
- fromJSON(object) {
1066
- return {
1067
- subject: isSet(object.subject) ? globalThis.String(object.subject) : "",
1068
- action: isSet(object.action) ? globalThis.String(object.action) : "",
1069
- viewName: isSet(object.viewName) ? globalThis.String(object.viewName) : undefined,
1070
- resourceType: isSet(object.resourceType) ? globalThis.String(object.resourceType) : "",
1071
- };
1072
- },
1073
- toJSON(message) {
1074
- const obj = {};
1075
- if (message.subject !== "") {
1076
- obj.subject = message.subject;
1077
- }
1078
- if (message.action !== "") {
1079
- obj.action = message.action;
1080
- }
1081
- if (message.viewName !== undefined) {
1082
- obj.viewName = message.viewName;
1083
- }
1084
- if (message.resourceType !== "") {
1085
- obj.resourceType = message.resourceType;
1086
- }
1087
- return obj;
1088
- },
1089
- create(base) {
1090
- return ResourceAccessListRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1091
- },
1092
- fromPartial(object) {
1093
- var _a, _b, _c, _d;
1094
- const message = createBaseResourceAccessListRequest();
1095
- message.subject = (_a = object.subject) !== null && _a !== void 0 ? _a : "";
1096
- message.action = (_b = object.action) !== null && _b !== void 0 ? _b : "";
1097
- message.viewName = (_c = object.viewName) !== null && _c !== void 0 ? _c : undefined;
1098
- message.resourceType = (_d = object.resourceType) !== null && _d !== void 0 ? _d : "";
1099
- return message;
1100
- },
1101
- };
1102
- function createBaseResourceAccessListResponse() {
1103
- return { viewName: "" };
1104
- }
1105
- export const ResourceAccessListResponse = {
1106
- encode(message, writer = _m0.Writer.create()) {
1107
- if (message.viewName !== "") {
1108
- writer.uint32(10).string(message.viewName);
1109
- }
1110
- return writer;
1111
- },
1112
- decode(input, length) {
1113
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1114
- let end = length === undefined ? reader.len : reader.pos + length;
1115
- const message = createBaseResourceAccessListResponse();
1116
- while (reader.pos < end) {
1117
- const tag = reader.uint32();
1118
- switch (tag >>> 3) {
1119
- case 1:
1120
- if (tag !== 10) {
1121
- break;
1122
- }
1123
- message.viewName = reader.string();
1124
- continue;
1125
- }
1126
- if ((tag & 7) === 4 || tag === 0) {
1127
- break;
1128
- }
1129
- reader.skipType(tag & 7);
1130
- }
1131
- return message;
1132
- },
1133
- fromJSON(object) {
1134
- return { viewName: isSet(object.viewName) ? globalThis.String(object.viewName) : "" };
1135
- },
1136
- toJSON(message) {
1137
- const obj = {};
1138
- if (message.viewName !== "") {
1139
- obj.viewName = message.viewName;
1140
- }
1141
- return obj;
1142
- },
1143
- create(base) {
1144
- return ResourceAccessListResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1145
- },
1146
- fromPartial(object) {
1147
- var _a;
1148
- const message = createBaseResourceAccessListResponse();
1149
- message.viewName = (_a = object.viewName) !== null && _a !== void 0 ? _a : "";
1150
- return message;
1151
- },
1152
- };
1153
- function createBasePermissionCheck() {
1154
- return { subject: "", actions: [], resource: "" };
1155
- }
1156
- export const PermissionCheck = {
1157
- encode(message, writer = _m0.Writer.create()) {
1158
- if (message.subject !== "") {
1159
- writer.uint32(10).string(message.subject);
1160
- }
1161
- for (const v of message.actions) {
1162
- writer.uint32(18).string(v);
1163
- }
1164
- if (message.resource !== "") {
1165
- writer.uint32(26).string(message.resource);
1166
- }
1167
- return writer;
1168
- },
1169
- decode(input, length) {
1170
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1171
- let end = length === undefined ? reader.len : reader.pos + length;
1172
- const message = createBasePermissionCheck();
1173
- while (reader.pos < end) {
1174
- const tag = reader.uint32();
1175
- switch (tag >>> 3) {
1176
- case 1:
1177
- if (tag !== 10) {
1178
- break;
1179
- }
1180
- message.subject = reader.string();
1181
- continue;
1182
- case 2:
1183
- if (tag !== 18) {
1184
- break;
1185
- }
1186
- message.actions.push(reader.string());
1187
- continue;
1188
- case 3:
1189
- if (tag !== 26) {
1190
- break;
1191
- }
1192
- message.resource = reader.string();
1193
- continue;
1194
- }
1195
- if ((tag & 7) === 4 || tag === 0) {
1196
- break;
1197
- }
1198
- reader.skipType(tag & 7);
1199
- }
1200
- return message;
1201
- },
1202
- fromJSON(object) {
1203
- return {
1204
- subject: isSet(object.subject) ? globalThis.String(object.subject) : "",
1205
- actions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.actions) ? object.actions.map((e) => globalThis.String(e)) : [],
1206
- resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
1207
- };
1208
- },
1209
- toJSON(message) {
1210
- var _a;
1211
- const obj = {};
1212
- if (message.subject !== "") {
1213
- obj.subject = message.subject;
1214
- }
1215
- if ((_a = message.actions) === null || _a === void 0 ? void 0 : _a.length) {
1216
- obj.actions = message.actions;
1217
- }
1218
- if (message.resource !== "") {
1219
- obj.resource = message.resource;
1220
- }
1221
- return obj;
1222
- },
1223
- create(base) {
1224
- return PermissionCheck.fromPartial(base !== null && base !== void 0 ? base : {});
1225
- },
1226
- fromPartial(object) {
1227
- var _a, _b, _c;
1228
- const message = createBasePermissionCheck();
1229
- message.subject = (_a = object.subject) !== null && _a !== void 0 ? _a : "";
1230
- message.actions = ((_b = object.actions) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
1231
- message.resource = (_c = object.resource) !== null && _c !== void 0 ? _c : "";
1232
- return message;
1233
- },
1234
- };
1235
- function createBasePermissionRequest() {
1236
- return { subject: "", action: "", resource: "" };
1237
- }
1238
- export const PermissionRequest = {
1239
- encode(message, writer = _m0.Writer.create()) {
1240
- if (message.subject !== "") {
1241
- writer.uint32(10).string(message.subject);
1242
- }
1243
- if (message.action !== "") {
1244
- writer.uint32(18).string(message.action);
1245
- }
1246
- if (message.resource !== "") {
1247
- writer.uint32(26).string(message.resource);
1248
- }
1249
- return writer;
1250
- },
1251
- decode(input, length) {
1252
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1253
- let end = length === undefined ? reader.len : reader.pos + length;
1254
- const message = createBasePermissionRequest();
1255
- while (reader.pos < end) {
1256
- const tag = reader.uint32();
1257
- switch (tag >>> 3) {
1258
- case 1:
1259
- if (tag !== 10) {
1260
- break;
1261
- }
1262
- message.subject = reader.string();
1263
- continue;
1264
- case 2:
1265
- if (tag !== 18) {
1266
- break;
1267
- }
1268
- message.action = reader.string();
1269
- continue;
1270
- case 3:
1271
- if (tag !== 26) {
1272
- break;
1273
- }
1274
- message.resource = reader.string();
1275
- continue;
1276
- }
1277
- if ((tag & 7) === 4 || tag === 0) {
1278
- break;
1279
- }
1280
- reader.skipType(tag & 7);
1281
- }
1282
- return message;
1283
- },
1284
- fromJSON(object) {
1285
- return {
1286
- subject: isSet(object.subject) ? globalThis.String(object.subject) : "",
1287
- action: isSet(object.action) ? globalThis.String(object.action) : "",
1288
- resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
1289
- };
1290
- },
1291
- toJSON(message) {
1292
- const obj = {};
1293
- if (message.subject !== "") {
1294
- obj.subject = message.subject;
1295
- }
1296
- if (message.action !== "") {
1297
- obj.action = message.action;
1298
- }
1299
- if (message.resource !== "") {
1300
- obj.resource = message.resource;
1301
- }
1302
- return obj;
1303
- },
1304
- create(base) {
1305
- return PermissionRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1306
- },
1307
- fromPartial(object) {
1308
- var _a, _b, _c;
1309
- const message = createBasePermissionRequest();
1310
- message.subject = (_a = object.subject) !== null && _a !== void 0 ? _a : "";
1311
- message.action = (_b = object.action) !== null && _b !== void 0 ? _b : "";
1312
- message.resource = (_c = object.resource) !== null && _c !== void 0 ? _c : "";
1313
- return message;
1314
- },
1315
- };
1316
- function createBaseDecision() {
1317
- return { allow: false };
1318
- }
1319
- export const Decision = {
1320
- encode(message, writer = _m0.Writer.create()) {
1321
- if (message.allow === true) {
1322
- writer.uint32(8).bool(message.allow);
1323
- }
1324
- return writer;
1325
- },
1326
- decode(input, length) {
1327
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1328
- let end = length === undefined ? reader.len : reader.pos + length;
1329
- const message = createBaseDecision();
1330
- while (reader.pos < end) {
1331
- const tag = reader.uint32();
1332
- switch (tag >>> 3) {
1333
- case 1:
1334
- if (tag !== 8) {
1335
- break;
1336
- }
1337
- message.allow = reader.bool();
1338
- continue;
1339
- }
1340
- if ((tag & 7) === 4 || tag === 0) {
1341
- break;
1342
- }
1343
- reader.skipType(tag & 7);
1344
- }
1345
- return message;
1346
- },
1347
- fromJSON(object) {
1348
- return { allow: isSet(object.allow) ? globalThis.Boolean(object.allow) : false };
1349
- },
1350
- toJSON(message) {
1351
- const obj = {};
1352
- if (message.allow === true) {
1353
- obj.allow = message.allow;
1354
- }
1355
- return obj;
1356
- },
1357
- create(base) {
1358
- return Decision.fromPartial(base !== null && base !== void 0 ? base : {});
1359
- },
1360
- fromPartial(object) {
1361
- var _a;
1362
- const message = createBaseDecision();
1363
- message.allow = (_a = object.allow) !== null && _a !== void 0 ? _a : false;
1364
- return message;
1365
- },
1366
- };
1367
- export const AuthorizationDefinition = {
1368
- name: "Authorization",
1369
- fullName: "authorization.Authorization",
1370
- methods: {
1371
- defineResource: {
1372
- name: "DefineResource",
1373
- requestType: Resource,
1374
- requestStream: false,
1375
- responseType: ResourceModificationAcknowledgement,
1376
- responseStream: false,
1377
- options: {},
1378
- },
1379
- deleteResource: {
1380
- name: "DeleteResource",
1381
- requestType: DeleteResourceRequest,
1382
- requestStream: false,
1383
- responseType: Empty,
1384
- responseStream: false,
1385
- options: {},
1386
- },
1387
- updateResource: {
1388
- name: "UpdateResource",
1389
- requestType: Resource,
1390
- requestStream: false,
1391
- responseType: ResourceModificationAcknowledgement,
1392
- responseStream: false,
1393
- options: {},
1394
- },
1395
- createRelation: {
1396
- name: "CreateRelation",
1397
- requestType: Relation,
1398
- requestStream: false,
1399
- responseType: Empty,
1400
- responseStream: false,
1401
- options: {},
1402
- },
1403
- createRelations: {
1404
- name: "CreateRelations",
1405
- requestType: CreateRelationsRequest,
1406
- requestStream: false,
1407
- responseType: Empty,
1408
- responseStream: false,
1409
- options: {},
1410
- },
1411
- deleteRelation: {
1412
- name: "DeleteRelation",
1413
- requestType: Relation,
1414
- requestStream: false,
1415
- responseType: Empty,
1416
- responseStream: false,
1417
- options: {},
1418
- },
1419
- grantPermission: {
1420
- name: "GrantPermission",
1421
- requestType: PermissionRequest,
1422
- requestStream: false,
1423
- responseType: Empty,
1424
- responseStream: false,
1425
- options: {},
1426
- },
1427
- removePermission: {
1428
- name: "RemovePermission",
1429
- requestType: PermissionRequest,
1430
- requestStream: false,
1431
- responseType: Empty,
1432
- responseStream: false,
1433
- options: {},
1434
- },
1435
- deleteAllRelations: {
1436
- name: "DeleteAllRelations",
1437
- requestType: DeleteAllRelationsRequest,
1438
- requestStream: false,
1439
- responseType: Empty,
1440
- responseStream: false,
1441
- options: {},
1442
- },
1443
- findRelation: {
1444
- name: "FindRelation",
1445
- requestType: FindRelationRequest,
1446
- requestStream: false,
1447
- responseType: FindRelationResponse,
1448
- responseStream: false,
1449
- options: {},
1450
- },
1451
- can: {
1452
- name: "Can",
1453
- requestType: PermissionCheck,
1454
- requestStream: false,
1455
- responseType: Decision,
1456
- responseStream: false,
1457
- options: {},
1458
- },
1459
- getAllowedResources: {
1460
- name: "GetAllowedResources",
1461
- requestType: AllowedResourcesRequest,
1462
- requestStream: false,
1463
- responseType: AllowedResourcesResponse,
1464
- responseStream: false,
1465
- options: {},
1466
- },
1467
- createResourceAccessList: {
1468
- name: "CreateResourceAccessList",
1469
- requestType: ResourceAccessListRequest,
1470
- requestStream: false,
1471
- responseType: ResourceAccessListResponse,
1472
- responseStream: false,
1473
- options: {},
1474
- },
1475
- },
1476
- };
1477
- function isSet(value) {
1478
- return value !== null && value !== undefined;
1479
- }
1480
- //# sourceMappingURL=authorization.js.map