@notifi-network/fusion-sdk 0.0.1-canary10
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/LICENSE +21 -0
- package/dist/fusion_wrappers/blockchain_proxies.d.ts +24 -0
- package/dist/fusion_wrappers/blockchain_proxies.js +131 -0
- package/dist/fusion_wrappers/fetch_proxy.d.ts +9 -0
- package/dist/fusion_wrappers/fetch_proxy.js +31 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -0
- package/dist/protos_gen/google/protobuf/duration.d.ts +99 -0
- package/dist/protos_gen/google/protobuf/duration.js +89 -0
- package/dist/protos_gen/google/protobuf/empty.d.ts +33 -0
- package/dist/protos_gen/google/protobuf/empty.js +45 -0
- package/dist/protos_gen/google/protobuf/struct.d.ts +107 -0
- package/dist/protos_gen/google/protobuf/struct.js +451 -0
- package/dist/protos_gen/google/protobuf/timestamp.d.ts +128 -0
- package/dist/protos_gen/google/protobuf/timestamp.js +89 -0
- package/dist/protos_gen/google/protobuf/wrappers.d.ts +138 -0
- package/dist/protos_gen/google/protobuf/wrappers.js +505 -0
- package/dist/protos_gen/notifi/common/v1/types.d.ts +752 -0
- package/dist/protos_gen/notifi/common/v1/types.js +7300 -0
- package/dist/protos_gen/services/blockchain_manager/v1/blockchain_manager.d.ts +587 -0
- package/dist/protos_gen/services/blockchain_manager/v1/blockchain_manager.js +3482 -0
- package/dist/protos_gen/services/fetch_proxy/v1/fetch_proxy.d.ts +87 -0
- package/dist/protos_gen/services/fetch_proxy/v1/fetch_proxy.js +427 -0
- package/dist/protos_gen/services/scheduler/v1/scheduler.d.ts +398 -0
- package/dist/protos_gen/services/scheduler/v1/scheduler.js +2175 -0
- package/dist/protos_gen/services/storage_manager/v1/storage_manager.d.ts +342 -0
- package/dist/protos_gen/services/storage_manager/v1/storage_manager.js +1953 -0
- package/dist/protos_gen/services/subscription_manager/v1/subscription_manager.d.ts +62 -0
- package/dist/protos_gen/services/subscription_manager/v1/subscription_manager.js +233 -0
- package/package.json +48 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { type CallOptions, ChannelCredentials, Client, type ClientOptions, type ClientUnaryCall, type handleUnaryCall, Metadata, type ServiceError, type UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
3
|
+
export declare const protobufPackage = "services.fetch_proxy.v1";
|
|
4
|
+
export declare enum HttpMethod {
|
|
5
|
+
HTTP_METHOD_UNDEFINED = 0,
|
|
6
|
+
HTTP_METHOD_GET = 1,
|
|
7
|
+
HTTP_METHOD_POST = 2,
|
|
8
|
+
HTTP_METHOD_PUT = 3,
|
|
9
|
+
HTTP_METHOD_DELETE = 4,
|
|
10
|
+
HTTP_METHOD_HEAD = 5,
|
|
11
|
+
UNRECOGNIZED = -1
|
|
12
|
+
}
|
|
13
|
+
export declare function httpMethodFromJSON(object: any): HttpMethod;
|
|
14
|
+
export declare function httpMethodToJSON(object: HttpMethod): string;
|
|
15
|
+
export declare enum Region {
|
|
16
|
+
REGION_UNDEFINED = 0,
|
|
17
|
+
REGION_US_WEST_2 = 1,
|
|
18
|
+
REGION_EU_WEST_1 = 2,
|
|
19
|
+
UNRECOGNIZED = -1
|
|
20
|
+
}
|
|
21
|
+
export declare function regionFromJSON(object: any): Region;
|
|
22
|
+
export declare function regionToJSON(object: Region): string;
|
|
23
|
+
export interface FetchRequest {
|
|
24
|
+
url: string;
|
|
25
|
+
headers: {
|
|
26
|
+
[key: string]: string;
|
|
27
|
+
};
|
|
28
|
+
httpMethod: HttpMethod;
|
|
29
|
+
bodyJson?: Uint8Array | undefined;
|
|
30
|
+
region?: Region | undefined;
|
|
31
|
+
contextId: string;
|
|
32
|
+
}
|
|
33
|
+
export interface FetchRequest_HeadersEntry {
|
|
34
|
+
key: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
37
|
+
export interface FetchResponse {
|
|
38
|
+
response: Uint8Array;
|
|
39
|
+
statusCode: number;
|
|
40
|
+
}
|
|
41
|
+
export declare const FetchRequest: MessageFns<FetchRequest>;
|
|
42
|
+
export declare const FetchRequest_HeadersEntry: MessageFns<FetchRequest_HeadersEntry>;
|
|
43
|
+
export declare const FetchResponse: MessageFns<FetchResponse>;
|
|
44
|
+
export type FusionFetchProxyService = typeof FusionFetchProxyService;
|
|
45
|
+
export declare const FusionFetchProxyService: {
|
|
46
|
+
readonly fetch: {
|
|
47
|
+
readonly path: "/services.fetch_proxy.v1.FusionFetchProxy/Fetch";
|
|
48
|
+
readonly requestStream: false;
|
|
49
|
+
readonly responseStream: false;
|
|
50
|
+
readonly requestSerialize: (value: FetchRequest) => Buffer<ArrayBuffer>;
|
|
51
|
+
readonly requestDeserialize: (value: Buffer) => FetchRequest;
|
|
52
|
+
readonly responseSerialize: (value: FetchResponse) => Buffer<ArrayBuffer>;
|
|
53
|
+
readonly responseDeserialize: (value: Buffer) => FetchResponse;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export interface FusionFetchProxyServer extends UntypedServiceImplementation {
|
|
57
|
+
fetch: handleUnaryCall<FetchRequest, FetchResponse>;
|
|
58
|
+
}
|
|
59
|
+
export interface FusionFetchProxyClient extends Client {
|
|
60
|
+
fetch(request: FetchRequest, callback: (error: ServiceError | null, response: FetchResponse) => void): ClientUnaryCall;
|
|
61
|
+
fetch(request: FetchRequest, metadata: Metadata, callback: (error: ServiceError | null, response: FetchResponse) => void): ClientUnaryCall;
|
|
62
|
+
fetch(request: FetchRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: FetchResponse) => void): ClientUnaryCall;
|
|
63
|
+
}
|
|
64
|
+
export declare const FusionFetchProxyClient: {
|
|
65
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): FusionFetchProxyClient;
|
|
66
|
+
service: typeof FusionFetchProxyService;
|
|
67
|
+
serviceName: string;
|
|
68
|
+
};
|
|
69
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
70
|
+
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 {} ? {
|
|
71
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
72
|
+
} : Partial<T>;
|
|
73
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
74
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
75
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
76
|
+
} & {
|
|
77
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
78
|
+
};
|
|
79
|
+
export interface MessageFns<T> {
|
|
80
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
81
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
82
|
+
fromJSON(object: any): T;
|
|
83
|
+
toJSON(message: T): unknown;
|
|
84
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
85
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
86
|
+
}
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.7.0
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: services/fetch_proxy/v1/fetch_proxy.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { makeGenericClientConstructor, } from "@grpc/grpc-js";
|
|
9
|
+
export const protobufPackage = "services.fetch_proxy.v1";
|
|
10
|
+
export var HttpMethod;
|
|
11
|
+
(function (HttpMethod) {
|
|
12
|
+
HttpMethod[HttpMethod["HTTP_METHOD_UNDEFINED"] = 0] = "HTTP_METHOD_UNDEFINED";
|
|
13
|
+
HttpMethod[HttpMethod["HTTP_METHOD_GET"] = 1] = "HTTP_METHOD_GET";
|
|
14
|
+
HttpMethod[HttpMethod["HTTP_METHOD_POST"] = 2] = "HTTP_METHOD_POST";
|
|
15
|
+
HttpMethod[HttpMethod["HTTP_METHOD_PUT"] = 3] = "HTTP_METHOD_PUT";
|
|
16
|
+
HttpMethod[HttpMethod["HTTP_METHOD_DELETE"] = 4] = "HTTP_METHOD_DELETE";
|
|
17
|
+
HttpMethod[HttpMethod["HTTP_METHOD_HEAD"] = 5] = "HTTP_METHOD_HEAD";
|
|
18
|
+
HttpMethod[HttpMethod["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(HttpMethod || (HttpMethod = {}));
|
|
20
|
+
export function httpMethodFromJSON(object) {
|
|
21
|
+
switch (object) {
|
|
22
|
+
case 0:
|
|
23
|
+
case "HTTP_METHOD_UNDEFINED":
|
|
24
|
+
return HttpMethod.HTTP_METHOD_UNDEFINED;
|
|
25
|
+
case 1:
|
|
26
|
+
case "HTTP_METHOD_GET":
|
|
27
|
+
return HttpMethod.HTTP_METHOD_GET;
|
|
28
|
+
case 2:
|
|
29
|
+
case "HTTP_METHOD_POST":
|
|
30
|
+
return HttpMethod.HTTP_METHOD_POST;
|
|
31
|
+
case 3:
|
|
32
|
+
case "HTTP_METHOD_PUT":
|
|
33
|
+
return HttpMethod.HTTP_METHOD_PUT;
|
|
34
|
+
case 4:
|
|
35
|
+
case "HTTP_METHOD_DELETE":
|
|
36
|
+
return HttpMethod.HTTP_METHOD_DELETE;
|
|
37
|
+
case 5:
|
|
38
|
+
case "HTTP_METHOD_HEAD":
|
|
39
|
+
return HttpMethod.HTTP_METHOD_HEAD;
|
|
40
|
+
case -1:
|
|
41
|
+
case "UNRECOGNIZED":
|
|
42
|
+
default:
|
|
43
|
+
return HttpMethod.UNRECOGNIZED;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function httpMethodToJSON(object) {
|
|
47
|
+
switch (object) {
|
|
48
|
+
case HttpMethod.HTTP_METHOD_UNDEFINED:
|
|
49
|
+
return "HTTP_METHOD_UNDEFINED";
|
|
50
|
+
case HttpMethod.HTTP_METHOD_GET:
|
|
51
|
+
return "HTTP_METHOD_GET";
|
|
52
|
+
case HttpMethod.HTTP_METHOD_POST:
|
|
53
|
+
return "HTTP_METHOD_POST";
|
|
54
|
+
case HttpMethod.HTTP_METHOD_PUT:
|
|
55
|
+
return "HTTP_METHOD_PUT";
|
|
56
|
+
case HttpMethod.HTTP_METHOD_DELETE:
|
|
57
|
+
return "HTTP_METHOD_DELETE";
|
|
58
|
+
case HttpMethod.HTTP_METHOD_HEAD:
|
|
59
|
+
return "HTTP_METHOD_HEAD";
|
|
60
|
+
case HttpMethod.UNRECOGNIZED:
|
|
61
|
+
default:
|
|
62
|
+
return "UNRECOGNIZED";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export var Region;
|
|
66
|
+
(function (Region) {
|
|
67
|
+
Region[Region["REGION_UNDEFINED"] = 0] = "REGION_UNDEFINED";
|
|
68
|
+
Region[Region["REGION_US_WEST_2"] = 1] = "REGION_US_WEST_2";
|
|
69
|
+
Region[Region["REGION_EU_WEST_1"] = 2] = "REGION_EU_WEST_1";
|
|
70
|
+
Region[Region["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
71
|
+
})(Region || (Region = {}));
|
|
72
|
+
export function regionFromJSON(object) {
|
|
73
|
+
switch (object) {
|
|
74
|
+
case 0:
|
|
75
|
+
case "REGION_UNDEFINED":
|
|
76
|
+
return Region.REGION_UNDEFINED;
|
|
77
|
+
case 1:
|
|
78
|
+
case "REGION_US_WEST_2":
|
|
79
|
+
return Region.REGION_US_WEST_2;
|
|
80
|
+
case 2:
|
|
81
|
+
case "REGION_EU_WEST_1":
|
|
82
|
+
return Region.REGION_EU_WEST_1;
|
|
83
|
+
case -1:
|
|
84
|
+
case "UNRECOGNIZED":
|
|
85
|
+
default:
|
|
86
|
+
return Region.UNRECOGNIZED;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export function regionToJSON(object) {
|
|
90
|
+
switch (object) {
|
|
91
|
+
case Region.REGION_UNDEFINED:
|
|
92
|
+
return "REGION_UNDEFINED";
|
|
93
|
+
case Region.REGION_US_WEST_2:
|
|
94
|
+
return "REGION_US_WEST_2";
|
|
95
|
+
case Region.REGION_EU_WEST_1:
|
|
96
|
+
return "REGION_EU_WEST_1";
|
|
97
|
+
case Region.UNRECOGNIZED:
|
|
98
|
+
default:
|
|
99
|
+
return "UNRECOGNIZED";
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function createBaseFetchRequest() {
|
|
103
|
+
return { url: "", headers: {}, httpMethod: 0, bodyJson: undefined, region: undefined, contextId: "" };
|
|
104
|
+
}
|
|
105
|
+
export const FetchRequest = {
|
|
106
|
+
encode(message, writer = new BinaryWriter()) {
|
|
107
|
+
if (message.url !== "") {
|
|
108
|
+
writer.uint32(10).string(message.url);
|
|
109
|
+
}
|
|
110
|
+
Object.entries(message.headers).forEach(([key, value]) => {
|
|
111
|
+
FetchRequest_HeadersEntry.encode({ key: key, value }, writer.uint32(18).fork()).join();
|
|
112
|
+
});
|
|
113
|
+
if (message.httpMethod !== 0) {
|
|
114
|
+
writer.uint32(24).int32(message.httpMethod);
|
|
115
|
+
}
|
|
116
|
+
if (message.bodyJson !== undefined) {
|
|
117
|
+
writer.uint32(34).bytes(message.bodyJson);
|
|
118
|
+
}
|
|
119
|
+
if (message.region !== undefined) {
|
|
120
|
+
writer.uint32(40).int32(message.region);
|
|
121
|
+
}
|
|
122
|
+
if (message.contextId !== "") {
|
|
123
|
+
writer.uint32(50).string(message.contextId);
|
|
124
|
+
}
|
|
125
|
+
return writer;
|
|
126
|
+
},
|
|
127
|
+
decode(input, length) {
|
|
128
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
129
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
130
|
+
const message = createBaseFetchRequest();
|
|
131
|
+
while (reader.pos < end) {
|
|
132
|
+
const tag = reader.uint32();
|
|
133
|
+
switch (tag >>> 3) {
|
|
134
|
+
case 1: {
|
|
135
|
+
if (tag !== 10) {
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
message.url = reader.string();
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
case 2: {
|
|
142
|
+
if (tag !== 18) {
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
const entry2 = FetchRequest_HeadersEntry.decode(reader, reader.uint32());
|
|
146
|
+
if (entry2.value !== undefined) {
|
|
147
|
+
message.headers[entry2.key] = entry2.value;
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
case 3: {
|
|
152
|
+
if (tag !== 24) {
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
message.httpMethod = reader.int32();
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
case 4: {
|
|
159
|
+
if (tag !== 34) {
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
message.bodyJson = reader.bytes();
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
case 5: {
|
|
166
|
+
if (tag !== 40) {
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
message.region = reader.int32();
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
case 6: {
|
|
173
|
+
if (tag !== 50) {
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
message.contextId = reader.string();
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
reader.skip(tag & 7);
|
|
184
|
+
}
|
|
185
|
+
return message;
|
|
186
|
+
},
|
|
187
|
+
fromJSON(object) {
|
|
188
|
+
return {
|
|
189
|
+
url: isSet(object.url) ? globalThis.String(object.url) : "",
|
|
190
|
+
headers: isObject(object.headers)
|
|
191
|
+
? Object.entries(object.headers).reduce((acc, [key, value]) => {
|
|
192
|
+
acc[key] = String(value);
|
|
193
|
+
return acc;
|
|
194
|
+
}, {})
|
|
195
|
+
: {},
|
|
196
|
+
httpMethod: isSet(object.httpMethod) ? httpMethodFromJSON(object.httpMethod) : 0,
|
|
197
|
+
bodyJson: isSet(object.bodyJson) ? bytesFromBase64(object.bodyJson) : undefined,
|
|
198
|
+
region: isSet(object.region) ? regionFromJSON(object.region) : undefined,
|
|
199
|
+
contextId: isSet(object.contextId) ? globalThis.String(object.contextId) : "",
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
toJSON(message) {
|
|
203
|
+
const obj = {};
|
|
204
|
+
if (message.url !== "") {
|
|
205
|
+
obj.url = message.url;
|
|
206
|
+
}
|
|
207
|
+
if (message.headers) {
|
|
208
|
+
const entries = Object.entries(message.headers);
|
|
209
|
+
if (entries.length > 0) {
|
|
210
|
+
obj.headers = {};
|
|
211
|
+
entries.forEach(([k, v]) => {
|
|
212
|
+
obj.headers[k] = v;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (message.httpMethod !== 0) {
|
|
217
|
+
obj.httpMethod = httpMethodToJSON(message.httpMethod);
|
|
218
|
+
}
|
|
219
|
+
if (message.bodyJson !== undefined) {
|
|
220
|
+
obj.bodyJson = base64FromBytes(message.bodyJson);
|
|
221
|
+
}
|
|
222
|
+
if (message.region !== undefined) {
|
|
223
|
+
obj.region = regionToJSON(message.region);
|
|
224
|
+
}
|
|
225
|
+
if (message.contextId !== "") {
|
|
226
|
+
obj.contextId = message.contextId;
|
|
227
|
+
}
|
|
228
|
+
return obj;
|
|
229
|
+
},
|
|
230
|
+
create(base) {
|
|
231
|
+
return FetchRequest.fromPartial(base ?? {});
|
|
232
|
+
},
|
|
233
|
+
fromPartial(object) {
|
|
234
|
+
const message = createBaseFetchRequest();
|
|
235
|
+
message.url = object.url ?? "";
|
|
236
|
+
message.headers = Object.entries(object.headers ?? {}).reduce((acc, [key, value]) => {
|
|
237
|
+
if (value !== undefined) {
|
|
238
|
+
acc[key] = globalThis.String(value);
|
|
239
|
+
}
|
|
240
|
+
return acc;
|
|
241
|
+
}, {});
|
|
242
|
+
message.httpMethod = object.httpMethod ?? 0;
|
|
243
|
+
message.bodyJson = object.bodyJson ?? undefined;
|
|
244
|
+
message.region = object.region ?? undefined;
|
|
245
|
+
message.contextId = object.contextId ?? "";
|
|
246
|
+
return message;
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
function createBaseFetchRequest_HeadersEntry() {
|
|
250
|
+
return { key: "", value: "" };
|
|
251
|
+
}
|
|
252
|
+
export const FetchRequest_HeadersEntry = {
|
|
253
|
+
encode(message, writer = new BinaryWriter()) {
|
|
254
|
+
if (message.key !== "") {
|
|
255
|
+
writer.uint32(10).string(message.key);
|
|
256
|
+
}
|
|
257
|
+
if (message.value !== "") {
|
|
258
|
+
writer.uint32(18).string(message.value);
|
|
259
|
+
}
|
|
260
|
+
return writer;
|
|
261
|
+
},
|
|
262
|
+
decode(input, length) {
|
|
263
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
264
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
265
|
+
const message = createBaseFetchRequest_HeadersEntry();
|
|
266
|
+
while (reader.pos < end) {
|
|
267
|
+
const tag = reader.uint32();
|
|
268
|
+
switch (tag >>> 3) {
|
|
269
|
+
case 1: {
|
|
270
|
+
if (tag !== 10) {
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
message.key = reader.string();
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
case 2: {
|
|
277
|
+
if (tag !== 18) {
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
message.value = reader.string();
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
reader.skip(tag & 7);
|
|
288
|
+
}
|
|
289
|
+
return message;
|
|
290
|
+
},
|
|
291
|
+
fromJSON(object) {
|
|
292
|
+
return {
|
|
293
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
294
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
295
|
+
};
|
|
296
|
+
},
|
|
297
|
+
toJSON(message) {
|
|
298
|
+
const obj = {};
|
|
299
|
+
if (message.key !== "") {
|
|
300
|
+
obj.key = message.key;
|
|
301
|
+
}
|
|
302
|
+
if (message.value !== "") {
|
|
303
|
+
obj.value = message.value;
|
|
304
|
+
}
|
|
305
|
+
return obj;
|
|
306
|
+
},
|
|
307
|
+
create(base) {
|
|
308
|
+
return FetchRequest_HeadersEntry.fromPartial(base ?? {});
|
|
309
|
+
},
|
|
310
|
+
fromPartial(object) {
|
|
311
|
+
const message = createBaseFetchRequest_HeadersEntry();
|
|
312
|
+
message.key = object.key ?? "";
|
|
313
|
+
message.value = object.value ?? "";
|
|
314
|
+
return message;
|
|
315
|
+
},
|
|
316
|
+
};
|
|
317
|
+
function createBaseFetchResponse() {
|
|
318
|
+
return { response: new Uint8Array(0), statusCode: 0 };
|
|
319
|
+
}
|
|
320
|
+
export const FetchResponse = {
|
|
321
|
+
encode(message, writer = new BinaryWriter()) {
|
|
322
|
+
if (message.response.length !== 0) {
|
|
323
|
+
writer.uint32(10).bytes(message.response);
|
|
324
|
+
}
|
|
325
|
+
if (message.statusCode !== 0) {
|
|
326
|
+
writer.uint32(16).int32(message.statusCode);
|
|
327
|
+
}
|
|
328
|
+
return writer;
|
|
329
|
+
},
|
|
330
|
+
decode(input, length) {
|
|
331
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
332
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
333
|
+
const message = createBaseFetchResponse();
|
|
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
|
+
message.response = reader.bytes();
|
|
342
|
+
continue;
|
|
343
|
+
}
|
|
344
|
+
case 2: {
|
|
345
|
+
if (tag !== 16) {
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
message.statusCode = reader.int32();
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
reader.skip(tag & 7);
|
|
356
|
+
}
|
|
357
|
+
return message;
|
|
358
|
+
},
|
|
359
|
+
fromJSON(object) {
|
|
360
|
+
return {
|
|
361
|
+
response: isSet(object.response) ? bytesFromBase64(object.response) : new Uint8Array(0),
|
|
362
|
+
statusCode: isSet(object.statusCode) ? globalThis.Number(object.statusCode) : 0,
|
|
363
|
+
};
|
|
364
|
+
},
|
|
365
|
+
toJSON(message) {
|
|
366
|
+
const obj = {};
|
|
367
|
+
if (message.response.length !== 0) {
|
|
368
|
+
obj.response = base64FromBytes(message.response);
|
|
369
|
+
}
|
|
370
|
+
if (message.statusCode !== 0) {
|
|
371
|
+
obj.statusCode = Math.round(message.statusCode);
|
|
372
|
+
}
|
|
373
|
+
return obj;
|
|
374
|
+
},
|
|
375
|
+
create(base) {
|
|
376
|
+
return FetchResponse.fromPartial(base ?? {});
|
|
377
|
+
},
|
|
378
|
+
fromPartial(object) {
|
|
379
|
+
const message = createBaseFetchResponse();
|
|
380
|
+
message.response = object.response ?? new Uint8Array(0);
|
|
381
|
+
message.statusCode = object.statusCode ?? 0;
|
|
382
|
+
return message;
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
export const FusionFetchProxyService = {
|
|
386
|
+
fetch: {
|
|
387
|
+
path: "/services.fetch_proxy.v1.FusionFetchProxy/Fetch",
|
|
388
|
+
requestStream: false,
|
|
389
|
+
responseStream: false,
|
|
390
|
+
requestSerialize: (value) => Buffer.from(FetchRequest.encode(value).finish()),
|
|
391
|
+
requestDeserialize: (value) => FetchRequest.decode(value),
|
|
392
|
+
responseSerialize: (value) => Buffer.from(FetchResponse.encode(value).finish()),
|
|
393
|
+
responseDeserialize: (value) => FetchResponse.decode(value),
|
|
394
|
+
},
|
|
395
|
+
};
|
|
396
|
+
export const FusionFetchProxyClient = makeGenericClientConstructor(FusionFetchProxyService, "services.fetch_proxy.v1.FusionFetchProxy");
|
|
397
|
+
function bytesFromBase64(b64) {
|
|
398
|
+
if (globalThis.Buffer) {
|
|
399
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
const bin = globalThis.atob(b64);
|
|
403
|
+
const arr = new Uint8Array(bin.length);
|
|
404
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
405
|
+
arr[i] = bin.charCodeAt(i);
|
|
406
|
+
}
|
|
407
|
+
return arr;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
function base64FromBytes(arr) {
|
|
411
|
+
if (globalThis.Buffer) {
|
|
412
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
const bin = [];
|
|
416
|
+
arr.forEach((byte) => {
|
|
417
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
418
|
+
});
|
|
419
|
+
return globalThis.btoa(bin.join(""));
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
function isObject(value) {
|
|
423
|
+
return typeof value === "object" && value !== null;
|
|
424
|
+
}
|
|
425
|
+
function isSet(value) {
|
|
426
|
+
return value !== null && value !== undefined;
|
|
427
|
+
}
|