naijarea-ts 1.0.2

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.
@@ -0,0 +1,360 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.10.0
5
+ // protoc v6.33.2
6
+ // source: google/api/http.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.CustomHttpPattern = exports.HttpRule = exports.Http = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ exports.protobufPackage = "google.api";
12
+ function createBaseHttp() {
13
+ return { rules: [], fullyDecodeReservedExpansion: false };
14
+ }
15
+ exports.Http = {
16
+ encode(message, writer = new wire_1.BinaryWriter()) {
17
+ for (const v of message.rules) {
18
+ exports.HttpRule.encode(v, writer.uint32(10).fork()).join();
19
+ }
20
+ if (message.fullyDecodeReservedExpansion !== false) {
21
+ writer.uint32(16).bool(message.fullyDecodeReservedExpansion);
22
+ }
23
+ return writer;
24
+ },
25
+ decode(input, length) {
26
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
27
+ const end = length === undefined ? reader.len : reader.pos + length;
28
+ const message = createBaseHttp();
29
+ while (reader.pos < end) {
30
+ const tag = reader.uint32();
31
+ switch (tag >>> 3) {
32
+ case 1: {
33
+ if (tag !== 10) {
34
+ break;
35
+ }
36
+ message.rules.push(exports.HttpRule.decode(reader, reader.uint32()));
37
+ continue;
38
+ }
39
+ case 2: {
40
+ if (tag !== 16) {
41
+ break;
42
+ }
43
+ message.fullyDecodeReservedExpansion = reader.bool();
44
+ continue;
45
+ }
46
+ }
47
+ if ((tag & 7) === 4 || tag === 0) {
48
+ break;
49
+ }
50
+ reader.skip(tag & 7);
51
+ }
52
+ return message;
53
+ },
54
+ fromJSON(object) {
55
+ return {
56
+ rules: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.rules) ? object.rules.map((e) => exports.HttpRule.fromJSON(e)) : [],
57
+ fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion)
58
+ ? globalThis.Boolean(object.fullyDecodeReservedExpansion)
59
+ : false,
60
+ };
61
+ },
62
+ toJSON(message) {
63
+ var _a;
64
+ const obj = {};
65
+ if ((_a = message.rules) === null || _a === void 0 ? void 0 : _a.length) {
66
+ obj.rules = message.rules.map((e) => exports.HttpRule.toJSON(e));
67
+ }
68
+ if (message.fullyDecodeReservedExpansion !== false) {
69
+ obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion;
70
+ }
71
+ return obj;
72
+ },
73
+ create(base) {
74
+ return exports.Http.fromPartial(base !== null && base !== void 0 ? base : {});
75
+ },
76
+ fromPartial(object) {
77
+ var _a, _b;
78
+ const message = createBaseHttp();
79
+ message.rules = ((_a = object.rules) === null || _a === void 0 ? void 0 : _a.map((e) => exports.HttpRule.fromPartial(e))) || [];
80
+ message.fullyDecodeReservedExpansion = (_b = object.fullyDecodeReservedExpansion) !== null && _b !== void 0 ? _b : false;
81
+ return message;
82
+ },
83
+ };
84
+ function createBaseHttpRule() {
85
+ return {
86
+ selector: "",
87
+ get: undefined,
88
+ put: undefined,
89
+ post: undefined,
90
+ delete: undefined,
91
+ patch: undefined,
92
+ custom: undefined,
93
+ body: "",
94
+ responseBody: "",
95
+ additionalBindings: [],
96
+ };
97
+ }
98
+ exports.HttpRule = {
99
+ encode(message, writer = new wire_1.BinaryWriter()) {
100
+ if (message.selector !== "") {
101
+ writer.uint32(10).string(message.selector);
102
+ }
103
+ if (message.get !== undefined) {
104
+ writer.uint32(18).string(message.get);
105
+ }
106
+ if (message.put !== undefined) {
107
+ writer.uint32(26).string(message.put);
108
+ }
109
+ if (message.post !== undefined) {
110
+ writer.uint32(34).string(message.post);
111
+ }
112
+ if (message.delete !== undefined) {
113
+ writer.uint32(42).string(message.delete);
114
+ }
115
+ if (message.patch !== undefined) {
116
+ writer.uint32(50).string(message.patch);
117
+ }
118
+ if (message.custom !== undefined) {
119
+ exports.CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).join();
120
+ }
121
+ if (message.body !== "") {
122
+ writer.uint32(58).string(message.body);
123
+ }
124
+ if (message.responseBody !== "") {
125
+ writer.uint32(98).string(message.responseBody);
126
+ }
127
+ for (const v of message.additionalBindings) {
128
+ exports.HttpRule.encode(v, writer.uint32(90).fork()).join();
129
+ }
130
+ return writer;
131
+ },
132
+ decode(input, length) {
133
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
134
+ const end = length === undefined ? reader.len : reader.pos + length;
135
+ const message = createBaseHttpRule();
136
+ while (reader.pos < end) {
137
+ const tag = reader.uint32();
138
+ switch (tag >>> 3) {
139
+ case 1: {
140
+ if (tag !== 10) {
141
+ break;
142
+ }
143
+ message.selector = reader.string();
144
+ continue;
145
+ }
146
+ case 2: {
147
+ if (tag !== 18) {
148
+ break;
149
+ }
150
+ message.get = reader.string();
151
+ continue;
152
+ }
153
+ case 3: {
154
+ if (tag !== 26) {
155
+ break;
156
+ }
157
+ message.put = reader.string();
158
+ continue;
159
+ }
160
+ case 4: {
161
+ if (tag !== 34) {
162
+ break;
163
+ }
164
+ message.post = reader.string();
165
+ continue;
166
+ }
167
+ case 5: {
168
+ if (tag !== 42) {
169
+ break;
170
+ }
171
+ message.delete = reader.string();
172
+ continue;
173
+ }
174
+ case 6: {
175
+ if (tag !== 50) {
176
+ break;
177
+ }
178
+ message.patch = reader.string();
179
+ continue;
180
+ }
181
+ case 8: {
182
+ if (tag !== 66) {
183
+ break;
184
+ }
185
+ message.custom = exports.CustomHttpPattern.decode(reader, reader.uint32());
186
+ continue;
187
+ }
188
+ case 7: {
189
+ if (tag !== 58) {
190
+ break;
191
+ }
192
+ message.body = reader.string();
193
+ continue;
194
+ }
195
+ case 12: {
196
+ if (tag !== 98) {
197
+ break;
198
+ }
199
+ message.responseBody = reader.string();
200
+ continue;
201
+ }
202
+ case 11: {
203
+ if (tag !== 90) {
204
+ break;
205
+ }
206
+ message.additionalBindings.push(exports.HttpRule.decode(reader, reader.uint32()));
207
+ continue;
208
+ }
209
+ }
210
+ if ((tag & 7) === 4 || tag === 0) {
211
+ break;
212
+ }
213
+ reader.skip(tag & 7);
214
+ }
215
+ return message;
216
+ },
217
+ fromJSON(object) {
218
+ return {
219
+ selector: isSet(object.selector) ? globalThis.String(object.selector) : "",
220
+ get: isSet(object.get) ? globalThis.String(object.get) : undefined,
221
+ put: isSet(object.put) ? globalThis.String(object.put) : undefined,
222
+ post: isSet(object.post) ? globalThis.String(object.post) : undefined,
223
+ delete: isSet(object.delete) ? globalThis.String(object.delete) : undefined,
224
+ patch: isSet(object.patch) ? globalThis.String(object.patch) : undefined,
225
+ custom: isSet(object.custom) ? exports.CustomHttpPattern.fromJSON(object.custom) : undefined,
226
+ body: isSet(object.body) ? globalThis.String(object.body) : "",
227
+ responseBody: isSet(object.responseBody) ? globalThis.String(object.responseBody) : "",
228
+ additionalBindings: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.additionalBindings)
229
+ ? object.additionalBindings.map((e) => exports.HttpRule.fromJSON(e))
230
+ : [],
231
+ };
232
+ },
233
+ toJSON(message) {
234
+ var _a;
235
+ const obj = {};
236
+ if (message.selector !== "") {
237
+ obj.selector = message.selector;
238
+ }
239
+ if (message.get !== undefined) {
240
+ obj.get = message.get;
241
+ }
242
+ if (message.put !== undefined) {
243
+ obj.put = message.put;
244
+ }
245
+ if (message.post !== undefined) {
246
+ obj.post = message.post;
247
+ }
248
+ if (message.delete !== undefined) {
249
+ obj.delete = message.delete;
250
+ }
251
+ if (message.patch !== undefined) {
252
+ obj.patch = message.patch;
253
+ }
254
+ if (message.custom !== undefined) {
255
+ obj.custom = exports.CustomHttpPattern.toJSON(message.custom);
256
+ }
257
+ if (message.body !== "") {
258
+ obj.body = message.body;
259
+ }
260
+ if (message.responseBody !== "") {
261
+ obj.responseBody = message.responseBody;
262
+ }
263
+ if ((_a = message.additionalBindings) === null || _a === void 0 ? void 0 : _a.length) {
264
+ obj.additionalBindings = message.additionalBindings.map((e) => exports.HttpRule.toJSON(e));
265
+ }
266
+ return obj;
267
+ },
268
+ create(base) {
269
+ return exports.HttpRule.fromPartial(base !== null && base !== void 0 ? base : {});
270
+ },
271
+ fromPartial(object) {
272
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
273
+ const message = createBaseHttpRule();
274
+ message.selector = (_a = object.selector) !== null && _a !== void 0 ? _a : "";
275
+ message.get = (_b = object.get) !== null && _b !== void 0 ? _b : undefined;
276
+ message.put = (_c = object.put) !== null && _c !== void 0 ? _c : undefined;
277
+ message.post = (_d = object.post) !== null && _d !== void 0 ? _d : undefined;
278
+ message.delete = (_e = object.delete) !== null && _e !== void 0 ? _e : undefined;
279
+ message.patch = (_f = object.patch) !== null && _f !== void 0 ? _f : undefined;
280
+ message.custom = (object.custom !== undefined && object.custom !== null)
281
+ ? exports.CustomHttpPattern.fromPartial(object.custom)
282
+ : undefined;
283
+ message.body = (_g = object.body) !== null && _g !== void 0 ? _g : "";
284
+ message.responseBody = (_h = object.responseBody) !== null && _h !== void 0 ? _h : "";
285
+ message.additionalBindings = ((_j = object.additionalBindings) === null || _j === void 0 ? void 0 : _j.map((e) => exports.HttpRule.fromPartial(e))) || [];
286
+ return message;
287
+ },
288
+ };
289
+ function createBaseCustomHttpPattern() {
290
+ return { kind: "", path: "" };
291
+ }
292
+ exports.CustomHttpPattern = {
293
+ encode(message, writer = new wire_1.BinaryWriter()) {
294
+ if (message.kind !== "") {
295
+ writer.uint32(10).string(message.kind);
296
+ }
297
+ if (message.path !== "") {
298
+ writer.uint32(18).string(message.path);
299
+ }
300
+ return writer;
301
+ },
302
+ decode(input, length) {
303
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
304
+ const end = length === undefined ? reader.len : reader.pos + length;
305
+ const message = createBaseCustomHttpPattern();
306
+ while (reader.pos < end) {
307
+ const tag = reader.uint32();
308
+ switch (tag >>> 3) {
309
+ case 1: {
310
+ if (tag !== 10) {
311
+ break;
312
+ }
313
+ message.kind = reader.string();
314
+ continue;
315
+ }
316
+ case 2: {
317
+ if (tag !== 18) {
318
+ break;
319
+ }
320
+ message.path = reader.string();
321
+ continue;
322
+ }
323
+ }
324
+ if ((tag & 7) === 4 || tag === 0) {
325
+ break;
326
+ }
327
+ reader.skip(tag & 7);
328
+ }
329
+ return message;
330
+ },
331
+ fromJSON(object) {
332
+ return {
333
+ kind: isSet(object.kind) ? globalThis.String(object.kind) : "",
334
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
335
+ };
336
+ },
337
+ toJSON(message) {
338
+ const obj = {};
339
+ if (message.kind !== "") {
340
+ obj.kind = message.kind;
341
+ }
342
+ if (message.path !== "") {
343
+ obj.path = message.path;
344
+ }
345
+ return obj;
346
+ },
347
+ create(base) {
348
+ return exports.CustomHttpPattern.fromPartial(base !== null && base !== void 0 ? base : {});
349
+ },
350
+ fromPartial(object) {
351
+ var _a, _b;
352
+ const message = createBaseCustomHttpPattern();
353
+ message.kind = (_a = object.kind) !== null && _a !== void 0 ? _a : "";
354
+ message.path = (_b = object.path) !== null && _b !== void 0 ? _b : "";
355
+ return message;
356
+ },
357
+ };
358
+ function isSet(value) {
359
+ return value !== null && value !== undefined;
360
+ }
@@ -0,0 +1,78 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { Any } from "../protobuf/any";
3
+ export declare const protobufPackage = "google.api";
4
+ /**
5
+ * Message that represents an arbitrary HTTP body. It should only be used for
6
+ * payload formats that can't be represented as JSON, such as raw binary or
7
+ * an HTML page.
8
+ *
9
+ * This message can be used both in streaming and non-streaming API methods in
10
+ * the request as well as the response.
11
+ *
12
+ * It can be used as a top-level request field, which is convenient if one
13
+ * wants to extract parameters from either the URL or HTTP template into the
14
+ * request fields and also want access to the raw HTTP body.
15
+ *
16
+ * Example:
17
+ *
18
+ * message GetResourceRequest {
19
+ * // A unique request id.
20
+ * string request_id = 1;
21
+ *
22
+ * // The raw HTTP body is bound to this field.
23
+ * google.api.HttpBody http_body = 2;
24
+ *
25
+ * }
26
+ *
27
+ * service ResourceService {
28
+ * rpc GetResource(GetResourceRequest)
29
+ * returns (google.api.HttpBody);
30
+ * rpc UpdateResource(google.api.HttpBody)
31
+ * returns (google.protobuf.Empty);
32
+ *
33
+ * }
34
+ *
35
+ * Example with streaming methods:
36
+ *
37
+ * service CaldavService {
38
+ * rpc GetCalendar(stream google.api.HttpBody)
39
+ * returns (stream google.api.HttpBody);
40
+ * rpc UpdateCalendar(stream google.api.HttpBody)
41
+ * returns (stream google.api.HttpBody);
42
+ *
43
+ * }
44
+ *
45
+ * Use of this type only changes how the request and response bodies are
46
+ * handled, all other features will continue to work unchanged.
47
+ */
48
+ export interface HttpBody {
49
+ /** The HTTP Content-Type header value specifying the content type of the body. */
50
+ contentType: string;
51
+ /** The HTTP request/response body as raw binary. */
52
+ data: Uint8Array;
53
+ /**
54
+ * Application specific response metadata. Must be set in the first response
55
+ * for streaming APIs.
56
+ */
57
+ extensions: Any[];
58
+ }
59
+ export declare const HttpBody: MessageFns<HttpBody>;
60
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
61
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
62
+ [K in keyof T]?: DeepPartial<T[K]>;
63
+ } : Partial<T>;
64
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
65
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
66
+ [K in keyof P]: Exact<P[K], I[K]>;
67
+ } & {
68
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
69
+ };
70
+ export interface MessageFns<T> {
71
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
72
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
73
+ fromJSON(object: any): T;
74
+ toJSON(message: T): unknown;
75
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
76
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
77
+ }
78
+ export {};
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.10.0
5
+ // protoc v6.33.2
6
+ // source: google/api/httpbody.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.HttpBody = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ const any_1 = require("../protobuf/any");
12
+ exports.protobufPackage = "google.api";
13
+ function createBaseHttpBody() {
14
+ return { contentType: "", data: new Uint8Array(0), extensions: [] };
15
+ }
16
+ exports.HttpBody = {
17
+ encode(message, writer = new wire_1.BinaryWriter()) {
18
+ if (message.contentType !== "") {
19
+ writer.uint32(10).string(message.contentType);
20
+ }
21
+ if (message.data.length !== 0) {
22
+ writer.uint32(18).bytes(message.data);
23
+ }
24
+ for (const v of message.extensions) {
25
+ any_1.Any.encode(v, writer.uint32(26).fork()).join();
26
+ }
27
+ return writer;
28
+ },
29
+ decode(input, length) {
30
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
31
+ const end = length === undefined ? reader.len : reader.pos + length;
32
+ const message = createBaseHttpBody();
33
+ while (reader.pos < end) {
34
+ const tag = reader.uint32();
35
+ switch (tag >>> 3) {
36
+ case 1: {
37
+ if (tag !== 10) {
38
+ break;
39
+ }
40
+ message.contentType = reader.string();
41
+ continue;
42
+ }
43
+ case 2: {
44
+ if (tag !== 18) {
45
+ break;
46
+ }
47
+ message.data = reader.bytes();
48
+ continue;
49
+ }
50
+ case 3: {
51
+ if (tag !== 26) {
52
+ break;
53
+ }
54
+ message.extensions.push(any_1.Any.decode(reader, reader.uint32()));
55
+ continue;
56
+ }
57
+ }
58
+ if ((tag & 7) === 4 || tag === 0) {
59
+ break;
60
+ }
61
+ reader.skip(tag & 7);
62
+ }
63
+ return message;
64
+ },
65
+ fromJSON(object) {
66
+ return {
67
+ contentType: isSet(object.contentType) ? globalThis.String(object.contentType) : "",
68
+ data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
69
+ extensions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.extensions)
70
+ ? object.extensions.map((e) => any_1.Any.fromJSON(e))
71
+ : [],
72
+ };
73
+ },
74
+ toJSON(message) {
75
+ var _a;
76
+ const obj = {};
77
+ if (message.contentType !== "") {
78
+ obj.contentType = message.contentType;
79
+ }
80
+ if (message.data.length !== 0) {
81
+ obj.data = base64FromBytes(message.data);
82
+ }
83
+ if ((_a = message.extensions) === null || _a === void 0 ? void 0 : _a.length) {
84
+ obj.extensions = message.extensions.map((e) => any_1.Any.toJSON(e));
85
+ }
86
+ return obj;
87
+ },
88
+ create(base) {
89
+ return exports.HttpBody.fromPartial(base !== null && base !== void 0 ? base : {});
90
+ },
91
+ fromPartial(object) {
92
+ var _a, _b, _c;
93
+ const message = createBaseHttpBody();
94
+ message.contentType = (_a = object.contentType) !== null && _a !== void 0 ? _a : "";
95
+ message.data = (_b = object.data) !== null && _b !== void 0 ? _b : new Uint8Array(0);
96
+ message.extensions = ((_c = object.extensions) === null || _c === void 0 ? void 0 : _c.map((e) => any_1.Any.fromPartial(e))) || [];
97
+ return message;
98
+ },
99
+ };
100
+ function bytesFromBase64(b64) {
101
+ if (globalThis.Buffer) {
102
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
103
+ }
104
+ else {
105
+ const bin = globalThis.atob(b64);
106
+ const arr = new Uint8Array(bin.length);
107
+ for (let i = 0; i < bin.length; ++i) {
108
+ arr[i] = bin.charCodeAt(i);
109
+ }
110
+ return arr;
111
+ }
112
+ }
113
+ function base64FromBytes(arr) {
114
+ if (globalThis.Buffer) {
115
+ return globalThis.Buffer.from(arr).toString("base64");
116
+ }
117
+ else {
118
+ const bin = [];
119
+ arr.forEach((byte) => {
120
+ bin.push(globalThis.String.fromCharCode(byte));
121
+ });
122
+ return globalThis.btoa(bin.join(""));
123
+ }
124
+ }
125
+ function isSet(value) {
126
+ return value !== null && value !== undefined;
127
+ }