macrocosmos 1.4.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -40
- package/dist/README.md +0 -40
- package/dist/__tests__/sn13/client.test.js +10 -4
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +1 -2
- package/dist/generated/billing/v1/billing.d.ts +97 -5
- package/dist/generated/billing/v1/billing.js +547 -3
- package/dist/generated/google/protobuf/empty.js +1 -1
- package/dist/generated/google/protobuf/struct.js +1 -1
- package/dist/generated/google/protobuf/timestamp.d.ts +7 -6
- package/dist/generated/google/protobuf/timestamp.js +1 -1
- package/dist/generated/gravity/v1/gravity.d.ts +408 -14
- package/dist/generated/gravity/v1/gravity.js +3867 -2102
- package/dist/generated/logger/v1/logger.js +1 -1
- package/dist/generated/sn13/v1/sn13_validator.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -4
- package/dist/__tests__/apex/client-chat.test.d.ts +0 -1
- package/dist/__tests__/apex/client-chat.test.js +0 -324
- package/dist/__tests__/apex/client-web-search.test.d.ts +0 -1
- package/dist/__tests__/apex/client-web-search.test.js +0 -38
- package/dist/generated/apex/v1/apex.d.ts +0 -941
- package/dist/generated/apex/v1/apex.js +0 -5422
- package/dist/lib/apex/Client.d.ts +0 -104
- package/dist/lib/apex/Client.js +0 -444
- package/dist/lib/apex/Stream.d.ts +0 -31
- package/dist/lib/apex/Stream.js +0 -162
- package/dist/lib/apex/index.d.ts +0 -2
- package/dist/lib/apex/index.js +0 -19
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.7.0
|
|
5
|
-
// protoc v6.
|
|
5
|
+
// protoc v6.33.0
|
|
6
6
|
// source: billing/v1/billing.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.BillingServiceClient = exports.BillingServiceService = exports.GetUsageResponse = exports.BillingRate = exports.GetUsageRequest = exports.protobufPackage = void 0;
|
|
8
|
+
exports.BillingServiceClient = exports.BillingServiceService = exports.UserHasEnoughAllowanceAndCreditsResponse = exports.UserHasEnoughAllowanceAndCreditsRequest = exports.ChargeUserForUsageResponse = exports.ChargeUserForUsageRequest = exports.GetUsageResponse = exports.SubscriptionInfo = exports.BillingRate = exports.GetUsageRequest = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const grpc_js_1 = require("@grpc/grpc-js");
|
|
@@ -192,12 +192,158 @@ exports.BillingRate = {
|
|
|
192
192
|
return message;
|
|
193
193
|
},
|
|
194
194
|
};
|
|
195
|
+
function createBaseSubscriptionInfo() {
|
|
196
|
+
return {
|
|
197
|
+
externalId: "",
|
|
198
|
+
planCode: "",
|
|
199
|
+
planTier: 0,
|
|
200
|
+
freeAllowanceUsd: 0,
|
|
201
|
+
freeAllowanceRemainingUsd: 0,
|
|
202
|
+
usageInUsd: 0,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
exports.SubscriptionInfo = {
|
|
206
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
207
|
+
if (message.externalId !== "") {
|
|
208
|
+
writer.uint32(10).string(message.externalId);
|
|
209
|
+
}
|
|
210
|
+
if (message.planCode !== "") {
|
|
211
|
+
writer.uint32(18).string(message.planCode);
|
|
212
|
+
}
|
|
213
|
+
if (message.planTier !== 0) {
|
|
214
|
+
writer.uint32(24).int32(message.planTier);
|
|
215
|
+
}
|
|
216
|
+
if (message.freeAllowanceUsd !== 0) {
|
|
217
|
+
writer.uint32(37).float(message.freeAllowanceUsd);
|
|
218
|
+
}
|
|
219
|
+
if (message.freeAllowanceRemainingUsd !== 0) {
|
|
220
|
+
writer.uint32(45).float(message.freeAllowanceRemainingUsd);
|
|
221
|
+
}
|
|
222
|
+
if (message.usageInUsd !== 0) {
|
|
223
|
+
writer.uint32(53).float(message.usageInUsd);
|
|
224
|
+
}
|
|
225
|
+
return writer;
|
|
226
|
+
},
|
|
227
|
+
decode(input, length) {
|
|
228
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
229
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
230
|
+
const message = createBaseSubscriptionInfo();
|
|
231
|
+
while (reader.pos < end) {
|
|
232
|
+
const tag = reader.uint32();
|
|
233
|
+
switch (tag >>> 3) {
|
|
234
|
+
case 1: {
|
|
235
|
+
if (tag !== 10) {
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
message.externalId = reader.string();
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
case 2: {
|
|
242
|
+
if (tag !== 18) {
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
message.planCode = reader.string();
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
case 3: {
|
|
249
|
+
if (tag !== 24) {
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
message.planTier = reader.int32();
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
case 4: {
|
|
256
|
+
if (tag !== 37) {
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
message.freeAllowanceUsd = reader.float();
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
case 5: {
|
|
263
|
+
if (tag !== 45) {
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
message.freeAllowanceRemainingUsd = reader.float();
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
case 6: {
|
|
270
|
+
if (tag !== 53) {
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
message.usageInUsd = reader.float();
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
reader.skip(tag & 7);
|
|
281
|
+
}
|
|
282
|
+
return message;
|
|
283
|
+
},
|
|
284
|
+
fromJSON(object) {
|
|
285
|
+
return {
|
|
286
|
+
externalId: isSet(object.externalId)
|
|
287
|
+
? globalThis.String(object.externalId)
|
|
288
|
+
: "",
|
|
289
|
+
planCode: isSet(object.planCode)
|
|
290
|
+
? globalThis.String(object.planCode)
|
|
291
|
+
: "",
|
|
292
|
+
planTier: isSet(object.planTier) ? globalThis.Number(object.planTier) : 0,
|
|
293
|
+
freeAllowanceUsd: isSet(object.freeAllowanceUsd)
|
|
294
|
+
? globalThis.Number(object.freeAllowanceUsd)
|
|
295
|
+
: 0,
|
|
296
|
+
freeAllowanceRemainingUsd: isSet(object.freeAllowanceRemainingUsd)
|
|
297
|
+
? globalThis.Number(object.freeAllowanceRemainingUsd)
|
|
298
|
+
: 0,
|
|
299
|
+
usageInUsd: isSet(object.usageInUsd)
|
|
300
|
+
? globalThis.Number(object.usageInUsd)
|
|
301
|
+
: 0,
|
|
302
|
+
};
|
|
303
|
+
},
|
|
304
|
+
toJSON(message) {
|
|
305
|
+
const obj = {};
|
|
306
|
+
if (message.externalId !== "") {
|
|
307
|
+
obj.externalId = message.externalId;
|
|
308
|
+
}
|
|
309
|
+
if (message.planCode !== "") {
|
|
310
|
+
obj.planCode = message.planCode;
|
|
311
|
+
}
|
|
312
|
+
if (message.planTier !== 0) {
|
|
313
|
+
obj.planTier = Math.round(message.planTier);
|
|
314
|
+
}
|
|
315
|
+
if (message.freeAllowanceUsd !== 0) {
|
|
316
|
+
obj.freeAllowanceUsd = message.freeAllowanceUsd;
|
|
317
|
+
}
|
|
318
|
+
if (message.freeAllowanceRemainingUsd !== 0) {
|
|
319
|
+
obj.freeAllowanceRemainingUsd = message.freeAllowanceRemainingUsd;
|
|
320
|
+
}
|
|
321
|
+
if (message.usageInUsd !== 0) {
|
|
322
|
+
obj.usageInUsd = message.usageInUsd;
|
|
323
|
+
}
|
|
324
|
+
return obj;
|
|
325
|
+
},
|
|
326
|
+
create(base) {
|
|
327
|
+
return exports.SubscriptionInfo.fromPartial(base ?? {});
|
|
328
|
+
},
|
|
329
|
+
fromPartial(object) {
|
|
330
|
+
const message = createBaseSubscriptionInfo();
|
|
331
|
+
message.externalId = object.externalId ?? "";
|
|
332
|
+
message.planCode = object.planCode ?? "";
|
|
333
|
+
message.planTier = object.planTier ?? 0;
|
|
334
|
+
message.freeAllowanceUsd = object.freeAllowanceUsd ?? 0;
|
|
335
|
+
message.freeAllowanceRemainingUsd = object.freeAllowanceRemainingUsd ?? 0;
|
|
336
|
+
message.usageInUsd = object.usageInUsd ?? 0;
|
|
337
|
+
return message;
|
|
338
|
+
},
|
|
339
|
+
};
|
|
195
340
|
function createBaseGetUsageResponse() {
|
|
196
341
|
return {
|
|
197
342
|
availableCredits: 0,
|
|
198
343
|
usedCredits: 0,
|
|
199
344
|
remainingCredits: 0,
|
|
200
345
|
billingRates: [],
|
|
346
|
+
activeSubscription: undefined,
|
|
201
347
|
};
|
|
202
348
|
}
|
|
203
349
|
exports.GetUsageResponse = {
|
|
@@ -214,6 +360,9 @@ exports.GetUsageResponse = {
|
|
|
214
360
|
for (const v of message.billingRates) {
|
|
215
361
|
exports.BillingRate.encode(v, writer.uint32(34).fork()).join();
|
|
216
362
|
}
|
|
363
|
+
if (message.activeSubscription !== undefined) {
|
|
364
|
+
exports.SubscriptionInfo.encode(message.activeSubscription, writer.uint32(42).fork()).join();
|
|
365
|
+
}
|
|
217
366
|
return writer;
|
|
218
367
|
},
|
|
219
368
|
decode(input, length) {
|
|
@@ -251,6 +400,13 @@ exports.GetUsageResponse = {
|
|
|
251
400
|
message.billingRates.push(exports.BillingRate.decode(reader, reader.uint32()));
|
|
252
401
|
continue;
|
|
253
402
|
}
|
|
403
|
+
case 5: {
|
|
404
|
+
if (tag !== 42) {
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
message.activeSubscription = exports.SubscriptionInfo.decode(reader, reader.uint32());
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
254
410
|
}
|
|
255
411
|
if ((tag & 7) === 4 || tag === 0) {
|
|
256
412
|
break;
|
|
@@ -273,6 +429,9 @@ exports.GetUsageResponse = {
|
|
|
273
429
|
billingRates: globalThis.Array.isArray(object?.billingRates)
|
|
274
430
|
? object.billingRates.map((e) => exports.BillingRate.fromJSON(e))
|
|
275
431
|
: [],
|
|
432
|
+
activeSubscription: isSet(object.activeSubscription)
|
|
433
|
+
? exports.SubscriptionInfo.fromJSON(object.activeSubscription)
|
|
434
|
+
: undefined,
|
|
276
435
|
};
|
|
277
436
|
},
|
|
278
437
|
toJSON(message) {
|
|
@@ -289,6 +448,9 @@ exports.GetUsageResponse = {
|
|
|
289
448
|
if (message.billingRates?.length) {
|
|
290
449
|
obj.billingRates = message.billingRates.map(e => exports.BillingRate.toJSON(e));
|
|
291
450
|
}
|
|
451
|
+
if (message.activeSubscription !== undefined) {
|
|
452
|
+
obj.activeSubscription = exports.SubscriptionInfo.toJSON(message.activeSubscription);
|
|
453
|
+
}
|
|
292
454
|
return obj;
|
|
293
455
|
},
|
|
294
456
|
create(base) {
|
|
@@ -301,11 +463,373 @@ exports.GetUsageResponse = {
|
|
|
301
463
|
message.remainingCredits = object.remainingCredits ?? 0;
|
|
302
464
|
message.billingRates =
|
|
303
465
|
object.billingRates?.map(e => exports.BillingRate.fromPartial(e)) || [];
|
|
466
|
+
message.activeSubscription =
|
|
467
|
+
object.activeSubscription !== undefined &&
|
|
468
|
+
object.activeSubscription !== null
|
|
469
|
+
? exports.SubscriptionInfo.fromPartial(object.activeSubscription)
|
|
470
|
+
: undefined;
|
|
471
|
+
return message;
|
|
472
|
+
},
|
|
473
|
+
};
|
|
474
|
+
function createBaseChargeUserForUsageRequest() {
|
|
475
|
+
return { transactionId: "", channel: "", rows: 0 };
|
|
476
|
+
}
|
|
477
|
+
exports.ChargeUserForUsageRequest = {
|
|
478
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
479
|
+
if (message.transactionId !== "") {
|
|
480
|
+
writer.uint32(10).string(message.transactionId);
|
|
481
|
+
}
|
|
482
|
+
if (message.channel !== "") {
|
|
483
|
+
writer.uint32(18).string(message.channel);
|
|
484
|
+
}
|
|
485
|
+
if (message.rows !== 0) {
|
|
486
|
+
writer.uint32(24).int64(message.rows);
|
|
487
|
+
}
|
|
488
|
+
return writer;
|
|
489
|
+
},
|
|
490
|
+
decode(input, length) {
|
|
491
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
492
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
493
|
+
const message = createBaseChargeUserForUsageRequest();
|
|
494
|
+
while (reader.pos < end) {
|
|
495
|
+
const tag = reader.uint32();
|
|
496
|
+
switch (tag >>> 3) {
|
|
497
|
+
case 1: {
|
|
498
|
+
if (tag !== 10) {
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
message.transactionId = reader.string();
|
|
502
|
+
continue;
|
|
503
|
+
}
|
|
504
|
+
case 2: {
|
|
505
|
+
if (tag !== 18) {
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
message.channel = reader.string();
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
case 3: {
|
|
512
|
+
if (tag !== 24) {
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
message.rows = longToNumber(reader.int64());
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
reader.skip(tag & 7);
|
|
523
|
+
}
|
|
524
|
+
return message;
|
|
525
|
+
},
|
|
526
|
+
fromJSON(object) {
|
|
527
|
+
return {
|
|
528
|
+
transactionId: isSet(object.transactionId)
|
|
529
|
+
? globalThis.String(object.transactionId)
|
|
530
|
+
: "",
|
|
531
|
+
channel: isSet(object.channel) ? globalThis.String(object.channel) : "",
|
|
532
|
+
rows: isSet(object.rows) ? globalThis.Number(object.rows) : 0,
|
|
533
|
+
};
|
|
534
|
+
},
|
|
535
|
+
toJSON(message) {
|
|
536
|
+
const obj = {};
|
|
537
|
+
if (message.transactionId !== "") {
|
|
538
|
+
obj.transactionId = message.transactionId;
|
|
539
|
+
}
|
|
540
|
+
if (message.channel !== "") {
|
|
541
|
+
obj.channel = message.channel;
|
|
542
|
+
}
|
|
543
|
+
if (message.rows !== 0) {
|
|
544
|
+
obj.rows = Math.round(message.rows);
|
|
545
|
+
}
|
|
546
|
+
return obj;
|
|
547
|
+
},
|
|
548
|
+
create(base) {
|
|
549
|
+
return exports.ChargeUserForUsageRequest.fromPartial(base ?? {});
|
|
550
|
+
},
|
|
551
|
+
fromPartial(object) {
|
|
552
|
+
const message = createBaseChargeUserForUsageRequest();
|
|
553
|
+
message.transactionId = object.transactionId ?? "";
|
|
554
|
+
message.channel = object.channel ?? "";
|
|
555
|
+
message.rows = object.rows ?? 0;
|
|
556
|
+
return message;
|
|
557
|
+
},
|
|
558
|
+
};
|
|
559
|
+
function createBaseChargeUserForUsageResponse() {
|
|
560
|
+
return { chargeCents: 0, transactionId: "", channel: "", rows: 0 };
|
|
561
|
+
}
|
|
562
|
+
exports.ChargeUserForUsageResponse = {
|
|
563
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
564
|
+
if (message.chargeCents !== 0) {
|
|
565
|
+
writer.uint32(13).float(message.chargeCents);
|
|
566
|
+
}
|
|
567
|
+
if (message.transactionId !== "") {
|
|
568
|
+
writer.uint32(18).string(message.transactionId);
|
|
569
|
+
}
|
|
570
|
+
if (message.channel !== "") {
|
|
571
|
+
writer.uint32(26).string(message.channel);
|
|
572
|
+
}
|
|
573
|
+
if (message.rows !== 0) {
|
|
574
|
+
writer.uint32(32).int64(message.rows);
|
|
575
|
+
}
|
|
576
|
+
return writer;
|
|
577
|
+
},
|
|
578
|
+
decode(input, length) {
|
|
579
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
580
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
581
|
+
const message = createBaseChargeUserForUsageResponse();
|
|
582
|
+
while (reader.pos < end) {
|
|
583
|
+
const tag = reader.uint32();
|
|
584
|
+
switch (tag >>> 3) {
|
|
585
|
+
case 1: {
|
|
586
|
+
if (tag !== 13) {
|
|
587
|
+
break;
|
|
588
|
+
}
|
|
589
|
+
message.chargeCents = reader.float();
|
|
590
|
+
continue;
|
|
591
|
+
}
|
|
592
|
+
case 2: {
|
|
593
|
+
if (tag !== 18) {
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
message.transactionId = reader.string();
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
case 3: {
|
|
600
|
+
if (tag !== 26) {
|
|
601
|
+
break;
|
|
602
|
+
}
|
|
603
|
+
message.channel = reader.string();
|
|
604
|
+
continue;
|
|
605
|
+
}
|
|
606
|
+
case 4: {
|
|
607
|
+
if (tag !== 32) {
|
|
608
|
+
break;
|
|
609
|
+
}
|
|
610
|
+
message.rows = longToNumber(reader.int64());
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
reader.skip(tag & 7);
|
|
618
|
+
}
|
|
619
|
+
return message;
|
|
620
|
+
},
|
|
621
|
+
fromJSON(object) {
|
|
622
|
+
return {
|
|
623
|
+
chargeCents: isSet(object.chargeCents)
|
|
624
|
+
? globalThis.Number(object.chargeCents)
|
|
625
|
+
: 0,
|
|
626
|
+
transactionId: isSet(object.transactionId)
|
|
627
|
+
? globalThis.String(object.transactionId)
|
|
628
|
+
: "",
|
|
629
|
+
channel: isSet(object.channel) ? globalThis.String(object.channel) : "",
|
|
630
|
+
rows: isSet(object.rows) ? globalThis.Number(object.rows) : 0,
|
|
631
|
+
};
|
|
632
|
+
},
|
|
633
|
+
toJSON(message) {
|
|
634
|
+
const obj = {};
|
|
635
|
+
if (message.chargeCents !== 0) {
|
|
636
|
+
obj.chargeCents = message.chargeCents;
|
|
637
|
+
}
|
|
638
|
+
if (message.transactionId !== "") {
|
|
639
|
+
obj.transactionId = message.transactionId;
|
|
640
|
+
}
|
|
641
|
+
if (message.channel !== "") {
|
|
642
|
+
obj.channel = message.channel;
|
|
643
|
+
}
|
|
644
|
+
if (message.rows !== 0) {
|
|
645
|
+
obj.rows = Math.round(message.rows);
|
|
646
|
+
}
|
|
647
|
+
return obj;
|
|
648
|
+
},
|
|
649
|
+
create(base) {
|
|
650
|
+
return exports.ChargeUserForUsageResponse.fromPartial(base ?? {});
|
|
651
|
+
},
|
|
652
|
+
fromPartial(object) {
|
|
653
|
+
const message = createBaseChargeUserForUsageResponse();
|
|
654
|
+
message.chargeCents = object.chargeCents ?? 0;
|
|
655
|
+
message.transactionId = object.transactionId ?? "";
|
|
656
|
+
message.channel = object.channel ?? "";
|
|
657
|
+
message.rows = object.rows ?? 0;
|
|
658
|
+
return message;
|
|
659
|
+
},
|
|
660
|
+
};
|
|
661
|
+
function createBaseUserHasEnoughAllowanceAndCreditsRequest() {
|
|
662
|
+
return { channel: "", rows: 0 };
|
|
663
|
+
}
|
|
664
|
+
exports.UserHasEnoughAllowanceAndCreditsRequest = {
|
|
665
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
666
|
+
if (message.channel !== "") {
|
|
667
|
+
writer.uint32(10).string(message.channel);
|
|
668
|
+
}
|
|
669
|
+
if (message.rows !== 0) {
|
|
670
|
+
writer.uint32(16).int64(message.rows);
|
|
671
|
+
}
|
|
672
|
+
return writer;
|
|
673
|
+
},
|
|
674
|
+
decode(input, length) {
|
|
675
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
676
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
677
|
+
const message = createBaseUserHasEnoughAllowanceAndCreditsRequest();
|
|
678
|
+
while (reader.pos < end) {
|
|
679
|
+
const tag = reader.uint32();
|
|
680
|
+
switch (tag >>> 3) {
|
|
681
|
+
case 1: {
|
|
682
|
+
if (tag !== 10) {
|
|
683
|
+
break;
|
|
684
|
+
}
|
|
685
|
+
message.channel = reader.string();
|
|
686
|
+
continue;
|
|
687
|
+
}
|
|
688
|
+
case 2: {
|
|
689
|
+
if (tag !== 16) {
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
message.rows = longToNumber(reader.int64());
|
|
693
|
+
continue;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
697
|
+
break;
|
|
698
|
+
}
|
|
699
|
+
reader.skip(tag & 7);
|
|
700
|
+
}
|
|
701
|
+
return message;
|
|
702
|
+
},
|
|
703
|
+
fromJSON(object) {
|
|
704
|
+
return {
|
|
705
|
+
channel: isSet(object.channel) ? globalThis.String(object.channel) : "",
|
|
706
|
+
rows: isSet(object.rows) ? globalThis.Number(object.rows) : 0,
|
|
707
|
+
};
|
|
708
|
+
},
|
|
709
|
+
toJSON(message) {
|
|
710
|
+
const obj = {};
|
|
711
|
+
if (message.channel !== "") {
|
|
712
|
+
obj.channel = message.channel;
|
|
713
|
+
}
|
|
714
|
+
if (message.rows !== 0) {
|
|
715
|
+
obj.rows = Math.round(message.rows);
|
|
716
|
+
}
|
|
717
|
+
return obj;
|
|
718
|
+
},
|
|
719
|
+
create(base) {
|
|
720
|
+
return exports.UserHasEnoughAllowanceAndCreditsRequest.fromPartial(base ?? {});
|
|
721
|
+
},
|
|
722
|
+
fromPartial(object) {
|
|
723
|
+
const message = createBaseUserHasEnoughAllowanceAndCreditsRequest();
|
|
724
|
+
message.channel = object.channel ?? "";
|
|
725
|
+
message.rows = object.rows ?? 0;
|
|
726
|
+
return message;
|
|
727
|
+
},
|
|
728
|
+
};
|
|
729
|
+
function createBaseUserHasEnoughAllowanceAndCreditsResponse() {
|
|
730
|
+
return { hasEnough: false, chargeCents: 0, channel: "", rows: 0 };
|
|
731
|
+
}
|
|
732
|
+
exports.UserHasEnoughAllowanceAndCreditsResponse = {
|
|
733
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
734
|
+
if (message.hasEnough !== false) {
|
|
735
|
+
writer.uint32(8).bool(message.hasEnough);
|
|
736
|
+
}
|
|
737
|
+
if (message.chargeCents !== 0) {
|
|
738
|
+
writer.uint32(21).float(message.chargeCents);
|
|
739
|
+
}
|
|
740
|
+
if (message.channel !== "") {
|
|
741
|
+
writer.uint32(26).string(message.channel);
|
|
742
|
+
}
|
|
743
|
+
if (message.rows !== 0) {
|
|
744
|
+
writer.uint32(32).int64(message.rows);
|
|
745
|
+
}
|
|
746
|
+
return writer;
|
|
747
|
+
},
|
|
748
|
+
decode(input, length) {
|
|
749
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
750
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
751
|
+
const message = createBaseUserHasEnoughAllowanceAndCreditsResponse();
|
|
752
|
+
while (reader.pos < end) {
|
|
753
|
+
const tag = reader.uint32();
|
|
754
|
+
switch (tag >>> 3) {
|
|
755
|
+
case 1: {
|
|
756
|
+
if (tag !== 8) {
|
|
757
|
+
break;
|
|
758
|
+
}
|
|
759
|
+
message.hasEnough = reader.bool();
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
case 2: {
|
|
763
|
+
if (tag !== 21) {
|
|
764
|
+
break;
|
|
765
|
+
}
|
|
766
|
+
message.chargeCents = reader.float();
|
|
767
|
+
continue;
|
|
768
|
+
}
|
|
769
|
+
case 3: {
|
|
770
|
+
if (tag !== 26) {
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
message.channel = reader.string();
|
|
774
|
+
continue;
|
|
775
|
+
}
|
|
776
|
+
case 4: {
|
|
777
|
+
if (tag !== 32) {
|
|
778
|
+
break;
|
|
779
|
+
}
|
|
780
|
+
message.rows = longToNumber(reader.int64());
|
|
781
|
+
continue;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
785
|
+
break;
|
|
786
|
+
}
|
|
787
|
+
reader.skip(tag & 7);
|
|
788
|
+
}
|
|
789
|
+
return message;
|
|
790
|
+
},
|
|
791
|
+
fromJSON(object) {
|
|
792
|
+
return {
|
|
793
|
+
hasEnough: isSet(object.hasEnough)
|
|
794
|
+
? globalThis.Boolean(object.hasEnough)
|
|
795
|
+
: false,
|
|
796
|
+
chargeCents: isSet(object.chargeCents)
|
|
797
|
+
? globalThis.Number(object.chargeCents)
|
|
798
|
+
: 0,
|
|
799
|
+
channel: isSet(object.channel) ? globalThis.String(object.channel) : "",
|
|
800
|
+
rows: isSet(object.rows) ? globalThis.Number(object.rows) : 0,
|
|
801
|
+
};
|
|
802
|
+
},
|
|
803
|
+
toJSON(message) {
|
|
804
|
+
const obj = {};
|
|
805
|
+
if (message.hasEnough !== false) {
|
|
806
|
+
obj.hasEnough = message.hasEnough;
|
|
807
|
+
}
|
|
808
|
+
if (message.chargeCents !== 0) {
|
|
809
|
+
obj.chargeCents = message.chargeCents;
|
|
810
|
+
}
|
|
811
|
+
if (message.channel !== "") {
|
|
812
|
+
obj.channel = message.channel;
|
|
813
|
+
}
|
|
814
|
+
if (message.rows !== 0) {
|
|
815
|
+
obj.rows = Math.round(message.rows);
|
|
816
|
+
}
|
|
817
|
+
return obj;
|
|
818
|
+
},
|
|
819
|
+
create(base) {
|
|
820
|
+
return exports.UserHasEnoughAllowanceAndCreditsResponse.fromPartial(base ?? {});
|
|
821
|
+
},
|
|
822
|
+
fromPartial(object) {
|
|
823
|
+
const message = createBaseUserHasEnoughAllowanceAndCreditsResponse();
|
|
824
|
+
message.hasEnough = object.hasEnough ?? false;
|
|
825
|
+
message.chargeCents = object.chargeCents ?? 0;
|
|
826
|
+
message.channel = object.channel ?? "";
|
|
827
|
+
message.rows = object.rows ?? 0;
|
|
304
828
|
return message;
|
|
305
829
|
},
|
|
306
830
|
};
|
|
307
831
|
exports.BillingServiceService = {
|
|
308
|
-
/** Get the usage of the user's credits */
|
|
832
|
+
/** Get the usage of the user's credits with subscription-aware billing */
|
|
309
833
|
getUsage: {
|
|
310
834
|
path: "/billing.v1.BillingService/GetUsage",
|
|
311
835
|
requestStream: false,
|
|
@@ -315,6 +839,26 @@ exports.BillingServiceService = {
|
|
|
315
839
|
responseSerialize: (value) => Buffer.from(exports.GetUsageResponse.encode(value).finish()),
|
|
316
840
|
responseDeserialize: (value) => exports.GetUsageResponse.decode(value),
|
|
317
841
|
},
|
|
842
|
+
/** ChargeUserForUsage charges a user for gravity data usage (testing endpoint) */
|
|
843
|
+
chargeUserForUsage: {
|
|
844
|
+
path: "/billing.v1.BillingService/ChargeUserForUsage",
|
|
845
|
+
requestStream: false,
|
|
846
|
+
responseStream: false,
|
|
847
|
+
requestSerialize: (value) => Buffer.from(exports.ChargeUserForUsageRequest.encode(value).finish()),
|
|
848
|
+
requestDeserialize: (value) => exports.ChargeUserForUsageRequest.decode(value),
|
|
849
|
+
responseSerialize: (value) => Buffer.from(exports.ChargeUserForUsageResponse.encode(value).finish()),
|
|
850
|
+
responseDeserialize: (value) => exports.ChargeUserForUsageResponse.decode(value),
|
|
851
|
+
},
|
|
852
|
+
/** Check if a user has enough allowance and credits to cover a charge (testing endpoint) */
|
|
853
|
+
userHasEnoughAllowanceAndCredits: {
|
|
854
|
+
path: "/billing.v1.BillingService/UserHasEnoughAllowanceAndCredits",
|
|
855
|
+
requestStream: false,
|
|
856
|
+
responseStream: false,
|
|
857
|
+
requestSerialize: (value) => Buffer.from(exports.UserHasEnoughAllowanceAndCreditsRequest.encode(value).finish()),
|
|
858
|
+
requestDeserialize: (value) => exports.UserHasEnoughAllowanceAndCreditsRequest.decode(value),
|
|
859
|
+
responseSerialize: (value) => Buffer.from(exports.UserHasEnoughAllowanceAndCreditsResponse.encode(value).finish()),
|
|
860
|
+
responseDeserialize: (value) => exports.UserHasEnoughAllowanceAndCreditsResponse.decode(value),
|
|
861
|
+
},
|
|
318
862
|
};
|
|
319
863
|
exports.BillingServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.BillingServiceService, "billing.v1.BillingService");
|
|
320
864
|
function longToNumber(int64) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.7.0
|
|
5
|
-
// protoc v6.
|
|
5
|
+
// protoc v6.33.0
|
|
6
6
|
// source: google/protobuf/empty.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.Empty = exports.protobufPackage = void 0;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.7.0
|
|
5
|
-
// protoc v6.
|
|
5
|
+
// protoc v6.33.0
|
|
6
6
|
// source: google/protobuf/struct.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.ListValue = exports.Value = exports.Struct_FieldsEntry = exports.Struct = exports.NullValue = exports.protobufPackage = void 0;
|
|
@@ -93,15 +93,16 @@ export declare const protobufPackage = "google.protobuf";
|
|
|
93
93
|
*/
|
|
94
94
|
export interface Timestamp {
|
|
95
95
|
/**
|
|
96
|
-
* Represents seconds of UTC time since Unix epoch
|
|
97
|
-
*
|
|
98
|
-
* 9999-12-31T23:59:59Z
|
|
96
|
+
* Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
|
|
97
|
+
* be between -315576000000 and 315576000000 inclusive (which corresponds to
|
|
98
|
+
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
|
|
99
99
|
*/
|
|
100
100
|
seconds: number;
|
|
101
101
|
/**
|
|
102
|
-
* Non-negative fractions of a second at nanosecond resolution.
|
|
103
|
-
*
|
|
104
|
-
*
|
|
102
|
+
* Non-negative fractions of a second at nanosecond resolution. This field is
|
|
103
|
+
* the nanosecond portion of the duration, not an alternative to seconds.
|
|
104
|
+
* Negative second values with fractions must still have non-negative nanos
|
|
105
|
+
* values that count forward in time. Must be between 0 and 999,999,999
|
|
105
106
|
* inclusive.
|
|
106
107
|
*/
|
|
107
108
|
nanos: number;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.7.0
|
|
5
|
-
// protoc v6.
|
|
5
|
+
// protoc v6.33.0
|
|
6
6
|
// source: google/protobuf/timestamp.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.Timestamp = exports.protobufPackage = void 0;
|