bitbadgesjs-sdk 0.3.145 → 0.3.147
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/dist/cjs/address-converter/converter.js +10 -9
- package/dist/cjs/address-converter/converter.js.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesAddressList.d.ts.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesAddressList.js +552 -4
- package/dist/cjs/api-indexer/BitBadgesAddressList.js.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesApi.js +6579 -52
- package/dist/cjs/api-indexer/BitBadgesApi.js.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesCollection.d.ts.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesCollection.js +537 -8
- package/dist/cjs/api-indexer/BitBadgesCollection.js.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesUserInfo.d.ts.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesUserInfo.js +162 -3
- package/dist/cjs/api-indexer/BitBadgesUserInfo.js.map +1 -1
- package/dist/cjs/api-indexer/docs/docs.d.ts +0 -2
- package/dist/cjs/api-indexer/docs/docs.d.ts.map +1 -1
- package/dist/cjs/api-indexer/docs/docs.js +0 -12
- package/dist/cjs/api-indexer/docs/docs.js.map +1 -1
- package/dist/cjs/api-indexer/docs/interfaces.d.ts +0 -2
- package/dist/cjs/api-indexer/docs/interfaces.d.ts.map +1 -1
- package/dist/cjs/api-indexer/metadata/badgeMetadata.d.ts.map +1 -1
- package/dist/cjs/api-indexer/metadata/metadataIds.d.ts.map +1 -1
- package/dist/cjs/api-indexer/metadata/metadataIds.js +4 -4
- package/dist/cjs/api-indexer/metadata/metadataIds.js.map +1 -1
- package/dist/cjs/api-indexer/requests/requests.d.ts +0 -1
- package/dist/cjs/api-indexer/requests/requests.d.ts.map +1 -1
- package/dist/cjs/api-indexer/requests/requests.js.map +1 -1
- package/dist/cjs/auth/auth.js +1 -1
- package/dist/cjs/auth/auth.js.map +1 -1
- package/dist/cjs/chain-drivers/verifySig.js +2 -2
- package/dist/cjs/chain-drivers/verifySig.js.map +1 -1
- package/dist/cjs/common/base.js +8 -8
- package/dist/cjs/common/base.js.map +1 -1
- package/dist/cjs/common/math.js +13 -13
- package/dist/cjs/common/math.js.map +1 -1
- package/dist/cjs/common/string-numbers.d.ts +1 -1
- package/dist/cjs/common/string-numbers.d.ts.map +1 -1
- package/dist/cjs/core/aliases.d.ts +1 -0
- package/dist/cjs/core/aliases.d.ts.map +1 -1
- package/dist/cjs/core/aliases.js +5 -4
- package/dist/cjs/core/aliases.js.map +1 -1
- package/dist/cjs/core/approval-utils.d.ts.map +1 -1
- package/dist/cjs/core/approval-utils.js +6 -6
- package/dist/cjs/core/approval-utils.js.map +1 -1
- package/dist/cjs/core/approvals.js +4 -4
- package/dist/cjs/core/approvals.js.map +1 -1
- package/dist/cjs/core/attestations.d.ts +1 -1
- package/dist/cjs/core/attestations.d.ts.map +1 -1
- package/dist/cjs/core/balances.d.ts.map +1 -1
- package/dist/cjs/core/balances.js +18 -18
- package/dist/cjs/core/balances.js.map +1 -1
- package/dist/cjs/core/blockin.d.ts +0 -1
- package/dist/cjs/core/blockin.d.ts.map +1 -1
- package/dist/cjs/core/blockin.js.map +1 -1
- package/dist/cjs/core/misc.js +15 -15
- package/dist/cjs/core/misc.js.map +1 -1
- package/dist/cjs/core/overlaps.js +10 -10
- package/dist/cjs/core/overlaps.js.map +1 -1
- package/dist/cjs/core/timelines.js +12 -11
- package/dist/cjs/core/timelines.js.map +1 -1
- package/dist/cjs/core/transfers.d.ts.map +1 -1
- package/dist/cjs/core/transfers.js +2 -2
- package/dist/cjs/core/transfers.js.map +1 -1
- package/dist/cjs/core/validate-utils.js +3 -3
- package/dist/cjs/core/validate-utils.js.map +1 -1
- package/dist/cjs/node-rest-api/account.js +2 -1
- package/dist/cjs/node-rest-api/account.js.map +1 -1
- package/dist/cjs/node-rest-api/balances.js +2 -1
- package/dist/cjs/node-rest-api/balances.js.map +1 -1
- package/dist/cjs/node-rest-api/broadcast.js +3 -3
- package/dist/cjs/node-rest-api/broadcast.js.map +1 -1
- package/dist/cjs/node-rest-api/gov.js +3 -3
- package/dist/cjs/node-rest-api/gov.js.map +1 -1
- package/dist/cjs/node-rest-api/ibc.js +2 -1
- package/dist/cjs/node-rest-api/ibc.js.map +1 -1
- package/dist/cjs/node-rest-api/staking.js +5 -4
- package/dist/cjs/node-rest-api/staking.js.map +1 -1
- package/dist/cjs/transactions/amino/objectConverter.js +7 -7
- package/dist/cjs/transactions/amino/objectConverter.js.map +1 -1
- package/dist/cjs/transactions/amino/registry.js +7 -7
- package/dist/cjs/transactions/amino/registry.js.map +1 -1
- package/dist/cjs/transactions/eip712/payload/createTypes/parsePayload.d.ts.map +1 -1
- package/dist/cjs/transactions/eip712/payload/samples/getSampleMsg.js +7 -6
- package/dist/cjs/transactions/eip712/payload/samples/getSampleMsg.js.map +1 -1
- package/dist/cjs/transactions/messages/base.js +2 -2
- package/dist/cjs/transactions/messages/base.js.map +1 -1
- package/dist/cjs/transactions/messages/signDoc.js +6 -5
- package/dist/cjs/transactions/messages/signDoc.js.map +1 -1
- package/dist/cjs/transactions/messages/transaction.js +14 -14
- package/dist/cjs/transactions/messages/transaction.js.map +1 -1
- package/dist/cjs/transactions/messages/txRaw.js +6 -5
- package/dist/cjs/transactions/messages/txRaw.js.map +1 -1
- package/dist/cjs/transactions/messages/utils.js +2 -1
- package/dist/cjs/transactions/messages/utils.js.map +1 -1
- package/dist/cjs/transactions/messages/web3Extension.js +7 -6
- package/dist/cjs/transactions/messages/web3Extension.js.map +1 -1
- package/dist/esm/api-indexer/BitBadgesAddressList.d.ts.map +1 -1
- package/dist/esm/api-indexer/BitBadgesAddressList.js +552 -4
- package/dist/esm/api-indexer/BitBadgesAddressList.js.map +1 -1
- package/dist/esm/api-indexer/BitBadgesApi.js +6579 -52
- package/dist/esm/api-indexer/BitBadgesApi.js.map +1 -1
- package/dist/esm/api-indexer/BitBadgesCollection.d.ts.map +1 -1
- package/dist/esm/api-indexer/BitBadgesCollection.js +535 -6
- package/dist/esm/api-indexer/BitBadgesCollection.js.map +1 -1
- package/dist/esm/api-indexer/BitBadgesUserInfo.d.ts.map +1 -1
- package/dist/esm/api-indexer/BitBadgesUserInfo.js +160 -1
- package/dist/esm/api-indexer/BitBadgesUserInfo.js.map +1 -1
- package/dist/esm/api-indexer/docs/docs.d.ts +0 -2
- package/dist/esm/api-indexer/docs/docs.d.ts.map +1 -1
- package/dist/esm/api-indexer/docs/docs.js +0 -13
- package/dist/esm/api-indexer/docs/docs.js.map +1 -1
- package/dist/esm/api-indexer/docs/interfaces.d.ts +0 -2
- package/dist/esm/api-indexer/docs/interfaces.d.ts.map +1 -1
- package/dist/esm/api-indexer/metadata/badgeMetadata.d.ts.map +1 -1
- package/dist/esm/api-indexer/metadata/metadataIds.d.ts.map +1 -1
- package/dist/esm/api-indexer/requests/requests.d.ts +0 -1
- package/dist/esm/api-indexer/requests/requests.d.ts.map +1 -1
- package/dist/esm/api-indexer/requests/requests.js.map +1 -1
- package/dist/esm/common/string-numbers.d.ts +1 -1
- package/dist/esm/common/string-numbers.d.ts.map +1 -1
- package/dist/esm/core/aliases.d.ts +1 -0
- package/dist/esm/core/aliases.d.ts.map +1 -1
- package/dist/esm/core/approval-utils.d.ts.map +1 -1
- package/dist/esm/core/attestations.d.ts +1 -1
- package/dist/esm/core/attestations.d.ts.map +1 -1
- package/dist/esm/core/balances.d.ts.map +1 -1
- package/dist/esm/core/blockin.d.ts +0 -1
- package/dist/esm/core/blockin.d.ts.map +1 -1
- package/dist/esm/core/blockin.js.map +1 -1
- package/dist/esm/core/transfers.d.ts.map +1 -1
- package/dist/esm/transactions/eip712/payload/createTypes/parsePayload.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BitBadgesCollection = void 0;
|
|
7
|
-
exports.convertCollectionMap = convertCollectionMap;
|
|
6
|
+
exports.convertCollectionMap = exports.BitBadgesCollection = void 0;
|
|
8
7
|
const base_js_1 = require("../common/base.js");
|
|
9
8
|
const string_numbers_js_1 = require("../common/string-numbers.js");
|
|
10
9
|
const addressLists_js_1 = require("../core/addressLists.js");
|
|
@@ -240,7 +239,302 @@ class BitBadgesCollection extends docs_js_1.CollectionDoc {
|
|
|
240
239
|
}
|
|
241
240
|
static async GetCollections(api, body) {
|
|
242
241
|
try {
|
|
243
|
-
const validateRes =
|
|
242
|
+
const validateRes = (input => {
|
|
243
|
+
const errors = [];
|
|
244
|
+
const __is = input => {
|
|
245
|
+
const $ip0 = input => {
|
|
246
|
+
const array = input;
|
|
247
|
+
const top = input[0];
|
|
248
|
+
if (0 === input.length)
|
|
249
|
+
return true;
|
|
250
|
+
const arrayPredicators = [
|
|
251
|
+
[
|
|
252
|
+
top => "object" === typeof top && null !== top && $io6(top),
|
|
253
|
+
entire => entire.every(elem => "object" === typeof elem && null !== elem && $io6(elem))
|
|
254
|
+
],
|
|
255
|
+
[
|
|
256
|
+
top => "string" === typeof top || "number" === typeof top || "bigint" === typeof top,
|
|
257
|
+
entire => entire.every(elem => "string" === typeof elem || "number" === typeof elem || "bigint" === typeof elem)
|
|
258
|
+
]
|
|
259
|
+
];
|
|
260
|
+
const passed = arrayPredicators.filter(pred => pred[0](top));
|
|
261
|
+
if (1 === passed.length)
|
|
262
|
+
return passed[0][1](array);
|
|
263
|
+
else if (1 < passed.length)
|
|
264
|
+
for (const pred of passed)
|
|
265
|
+
if (array.every(value => true === pred[0](value)))
|
|
266
|
+
return pred[1](array);
|
|
267
|
+
return false;
|
|
268
|
+
};
|
|
269
|
+
const $io0 = input => Array.isArray(input.collectionsToFetch) && input.collectionsToFetch.every(elem => "object" === typeof elem && null !== elem && $io1(elem));
|
|
270
|
+
const $io1 = input => (undefined === input.viewsToFetch || Array.isArray(input.viewsToFetch) && input.viewsToFetch.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && (undefined === input.fetchTotalBalances || "boolean" === typeof input.fetchTotalBalances) && (undefined === input.challengeTrackersToFetch || Array.isArray(input.challengeTrackersToFetch) && input.challengeTrackersToFetch.every(elem => "object" === typeof elem && null !== elem && $io3(elem))) && (undefined === input.approvalTrackersToFetch || Array.isArray(input.approvalTrackersToFetch) && input.approvalTrackersToFetch.every(elem => "object" === typeof elem && null !== elem && $io4(elem))) && (undefined === input.handleAllAndAppendDefaults || "boolean" === typeof input.handleAllAndAppendDefaults) && (undefined === input.fetchPrivateParams || "boolean" === typeof input.fetchPrivateParams) && (undefined === input.metadataToFetch || "object" === typeof input.metadataToFetch && null !== input.metadataToFetch && false === Array.isArray(input.metadataToFetch) && $io5(input.metadataToFetch)) && ("string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId);
|
|
271
|
+
const $io2 = input => ("transferActivity" === input.viewType || "reviews" === input.viewType || "owners" === input.viewType || "amountTrackers" === input.viewType || "challengeTrackers" === input.viewType) && "string" === typeof input.viewId && "string" === typeof input.bookmark && (undefined === input.oldestFirst || "boolean" === typeof input.oldestFirst) && (undefined === input.cosmosAddress || "string" === typeof input.cosmosAddress);
|
|
272
|
+
const $io3 = input => ("string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId) && "string" === typeof input.approvalId && "string" === typeof input.challengeTrackerId && ("" === input.approvalLevel || "collection" === input.approvalLevel || "incoming" === input.approvalLevel || "outgoing" === input.approvalLevel) && "string" === typeof input.approverAddress;
|
|
273
|
+
const $io4 = input => ("string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId) && "string" === typeof input.approvalId && "string" === typeof input.amountTrackerId && "string" === typeof input.approvalLevel && "string" === typeof input.approverAddress && "string" === typeof input.trackerType && "string" === typeof input.approvedAddress;
|
|
274
|
+
const $io5 = input => (undefined === input.doNotFetchCollectionMetadata || "boolean" === typeof input.doNotFetchCollectionMetadata) && (undefined === input.uris || Array.isArray(input.uris) && input.uris.every(elem => "string" === typeof elem)) && (undefined === input.badgeIds || Array.isArray(input.badgeIds) && ($ip0(input.badgeIds) || false));
|
|
275
|
+
const $io6 = input => ("string" === typeof input.start || "number" === typeof input.start || "bigint" === typeof input.start) && ("string" === typeof input.end || "number" === typeof input.end || "bigint" === typeof input.end);
|
|
276
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
277
|
+
};
|
|
278
|
+
if (false === __is(input)) {
|
|
279
|
+
const $report = typia_1.default.validate.report(errors);
|
|
280
|
+
((input, _path, _exceptionable = true) => {
|
|
281
|
+
const $vp0 = (input, _path, _exceptionable = true) => {
|
|
282
|
+
const array = input;
|
|
283
|
+
const top = input[0];
|
|
284
|
+
if (0 === input.length)
|
|
285
|
+
return true;
|
|
286
|
+
const arrayPredicators = [
|
|
287
|
+
[
|
|
288
|
+
top => "object" === typeof top && null !== top && $vo6(top, _path, false && _exceptionable),
|
|
289
|
+
entire => entire.map((elem, _index8) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
290
|
+
path: _path + "[" + _index8 + "]",
|
|
291
|
+
expected: "iUintRange<NumberType>",
|
|
292
|
+
value: elem
|
|
293
|
+
})) && $vo6(elem, _path + "[" + _index8 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
294
|
+
path: _path + "[" + _index8 + "]",
|
|
295
|
+
expected: "iUintRange<NumberType>",
|
|
296
|
+
value: elem
|
|
297
|
+
})).every(flag => flag)
|
|
298
|
+
],
|
|
299
|
+
[
|
|
300
|
+
top => "string" === typeof top || "number" === typeof top || "bigint" === typeof top,
|
|
301
|
+
entire => entire.map((elem, _index9) => "string" === typeof elem || "number" === typeof elem || "bigint" === typeof elem || $report(_exceptionable, {
|
|
302
|
+
path: _path + "[" + _index9 + "]",
|
|
303
|
+
expected: "(bigint | number | string)",
|
|
304
|
+
value: elem
|
|
305
|
+
})).every(flag => flag)
|
|
306
|
+
]
|
|
307
|
+
];
|
|
308
|
+
const passed = arrayPredicators.filter(pred => pred[0](top));
|
|
309
|
+
if (1 === passed.length)
|
|
310
|
+
return passed[0][1](array);
|
|
311
|
+
else if (1 < passed.length)
|
|
312
|
+
for (const pred of passed)
|
|
313
|
+
if (array.every(value => true === pred[0](value)))
|
|
314
|
+
return pred[1](array);
|
|
315
|
+
return $report(_exceptionable, {
|
|
316
|
+
path: _path,
|
|
317
|
+
expected: "(Array<iUintRange<NumberType>> | Array<NumberType>)",
|
|
318
|
+
value: input
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
const $vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.collectionsToFetch) || $report(_exceptionable, {
|
|
322
|
+
path: _path + ".collectionsToFetch",
|
|
323
|
+
expected: "Array<GetCollectionRequestBody>",
|
|
324
|
+
value: input.collectionsToFetch
|
|
325
|
+
})) && input.collectionsToFetch.map((elem, _index1) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
326
|
+
path: _path + ".collectionsToFetch[" + _index1 + "]",
|
|
327
|
+
expected: "GetCollectionRequestBody",
|
|
328
|
+
value: elem
|
|
329
|
+
})) && $vo1(elem, _path + ".collectionsToFetch[" + _index1 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
330
|
+
path: _path + ".collectionsToFetch[" + _index1 + "]",
|
|
331
|
+
expected: "GetCollectionRequestBody",
|
|
332
|
+
value: elem
|
|
333
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
334
|
+
path: _path + ".collectionsToFetch",
|
|
335
|
+
expected: "Array<GetCollectionRequestBody>",
|
|
336
|
+
value: input.collectionsToFetch
|
|
337
|
+
})].every(flag => flag);
|
|
338
|
+
const $vo1 = (input, _path, _exceptionable = true) => [undefined === input.viewsToFetch || (Array.isArray(input.viewsToFetch) || $report(_exceptionable, {
|
|
339
|
+
path: _path + ".viewsToFetch",
|
|
340
|
+
expected: "(Array<__type> | undefined)",
|
|
341
|
+
value: input.viewsToFetch
|
|
342
|
+
})) && input.viewsToFetch.map((elem, _index2) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
343
|
+
path: _path + ".viewsToFetch[" + _index2 + "]",
|
|
344
|
+
expected: "__type",
|
|
345
|
+
value: elem
|
|
346
|
+
})) && $vo2(elem, _path + ".viewsToFetch[" + _index2 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
347
|
+
path: _path + ".viewsToFetch[" + _index2 + "]",
|
|
348
|
+
expected: "__type",
|
|
349
|
+
value: elem
|
|
350
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
351
|
+
path: _path + ".viewsToFetch",
|
|
352
|
+
expected: "(Array<__type> | undefined)",
|
|
353
|
+
value: input.viewsToFetch
|
|
354
|
+
}), undefined === input.fetchTotalBalances || "boolean" === typeof input.fetchTotalBalances || $report(_exceptionable, {
|
|
355
|
+
path: _path + ".fetchTotalBalances",
|
|
356
|
+
expected: "(boolean | undefined)",
|
|
357
|
+
value: input.fetchTotalBalances
|
|
358
|
+
}), undefined === input.challengeTrackersToFetch || (Array.isArray(input.challengeTrackersToFetch) || $report(_exceptionable, {
|
|
359
|
+
path: _path + ".challengeTrackersToFetch",
|
|
360
|
+
expected: "(Array<iChallengeTrackerIdDetails<NumberType>> | undefined)",
|
|
361
|
+
value: input.challengeTrackersToFetch
|
|
362
|
+
})) && input.challengeTrackersToFetch.map((elem, _index3) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
363
|
+
path: _path + ".challengeTrackersToFetch[" + _index3 + "]",
|
|
364
|
+
expected: "iChallengeTrackerIdDetails<NumberType>",
|
|
365
|
+
value: elem
|
|
366
|
+
})) && $vo3(elem, _path + ".challengeTrackersToFetch[" + _index3 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
367
|
+
path: _path + ".challengeTrackersToFetch[" + _index3 + "]",
|
|
368
|
+
expected: "iChallengeTrackerIdDetails<NumberType>",
|
|
369
|
+
value: elem
|
|
370
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
371
|
+
path: _path + ".challengeTrackersToFetch",
|
|
372
|
+
expected: "(Array<iChallengeTrackerIdDetails<NumberType>> | undefined)",
|
|
373
|
+
value: input.challengeTrackersToFetch
|
|
374
|
+
}), undefined === input.approvalTrackersToFetch || (Array.isArray(input.approvalTrackersToFetch) || $report(_exceptionable, {
|
|
375
|
+
path: _path + ".approvalTrackersToFetch",
|
|
376
|
+
expected: "(Array<iAmountTrackerIdDetails<NumberType>> | undefined)",
|
|
377
|
+
value: input.approvalTrackersToFetch
|
|
378
|
+
})) && input.approvalTrackersToFetch.map((elem, _index4) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
379
|
+
path: _path + ".approvalTrackersToFetch[" + _index4 + "]",
|
|
380
|
+
expected: "iAmountTrackerIdDetails<NumberType>",
|
|
381
|
+
value: elem
|
|
382
|
+
})) && $vo4(elem, _path + ".approvalTrackersToFetch[" + _index4 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
383
|
+
path: _path + ".approvalTrackersToFetch[" + _index4 + "]",
|
|
384
|
+
expected: "iAmountTrackerIdDetails<NumberType>",
|
|
385
|
+
value: elem
|
|
386
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
387
|
+
path: _path + ".approvalTrackersToFetch",
|
|
388
|
+
expected: "(Array<iAmountTrackerIdDetails<NumberType>> | undefined)",
|
|
389
|
+
value: input.approvalTrackersToFetch
|
|
390
|
+
}), undefined === input.handleAllAndAppendDefaults || "boolean" === typeof input.handleAllAndAppendDefaults || $report(_exceptionable, {
|
|
391
|
+
path: _path + ".handleAllAndAppendDefaults",
|
|
392
|
+
expected: "(boolean | undefined)",
|
|
393
|
+
value: input.handleAllAndAppendDefaults
|
|
394
|
+
}), undefined === input.fetchPrivateParams || "boolean" === typeof input.fetchPrivateParams || $report(_exceptionable, {
|
|
395
|
+
path: _path + ".fetchPrivateParams",
|
|
396
|
+
expected: "(boolean | undefined)",
|
|
397
|
+
value: input.fetchPrivateParams
|
|
398
|
+
}), undefined === input.metadataToFetch || ("object" === typeof input.metadataToFetch && null !== input.metadataToFetch && false === Array.isArray(input.metadataToFetch) || $report(_exceptionable, {
|
|
399
|
+
path: _path + ".metadataToFetch",
|
|
400
|
+
expected: "(MetadataFetchOptions | undefined)",
|
|
401
|
+
value: input.metadataToFetch
|
|
402
|
+
})) && $vo5(input.metadataToFetch, _path + ".metadataToFetch", true && _exceptionable) || $report(_exceptionable, {
|
|
403
|
+
path: _path + ".metadataToFetch",
|
|
404
|
+
expected: "(MetadataFetchOptions | undefined)",
|
|
405
|
+
value: input.metadataToFetch
|
|
406
|
+
}), "string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId || $report(_exceptionable, {
|
|
407
|
+
path: _path + ".collectionId",
|
|
408
|
+
expected: "(bigint | number | string)",
|
|
409
|
+
value: input.collectionId
|
|
410
|
+
})].every(flag => flag);
|
|
411
|
+
const $vo2 = (input, _path, _exceptionable = true) => ["transferActivity" === input.viewType || "reviews" === input.viewType || "owners" === input.viewType || "amountTrackers" === input.viewType || "challengeTrackers" === input.viewType || $report(_exceptionable, {
|
|
412
|
+
path: _path + ".viewType",
|
|
413
|
+
expected: "(\"amountTrackers\" | \"challengeTrackers\" | \"owners\" | \"reviews\" | \"transferActivity\")",
|
|
414
|
+
value: input.viewType
|
|
415
|
+
}), "string" === typeof input.viewId || $report(_exceptionable, {
|
|
416
|
+
path: _path + ".viewId",
|
|
417
|
+
expected: "string",
|
|
418
|
+
value: input.viewId
|
|
419
|
+
}), "string" === typeof input.bookmark || $report(_exceptionable, {
|
|
420
|
+
path: _path + ".bookmark",
|
|
421
|
+
expected: "string",
|
|
422
|
+
value: input.bookmark
|
|
423
|
+
}), undefined === input.oldestFirst || "boolean" === typeof input.oldestFirst || $report(_exceptionable, {
|
|
424
|
+
path: _path + ".oldestFirst",
|
|
425
|
+
expected: "(boolean | undefined)",
|
|
426
|
+
value: input.oldestFirst
|
|
427
|
+
}), undefined === input.cosmosAddress || "string" === typeof input.cosmosAddress || $report(_exceptionable, {
|
|
428
|
+
path: _path + ".cosmosAddress",
|
|
429
|
+
expected: "(string | undefined)",
|
|
430
|
+
value: input.cosmosAddress
|
|
431
|
+
})].every(flag => flag);
|
|
432
|
+
const $vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId || $report(_exceptionable, {
|
|
433
|
+
path: _path + ".collectionId",
|
|
434
|
+
expected: "(bigint | number | string)",
|
|
435
|
+
value: input.collectionId
|
|
436
|
+
}), "string" === typeof input.approvalId || $report(_exceptionable, {
|
|
437
|
+
path: _path + ".approvalId",
|
|
438
|
+
expected: "string",
|
|
439
|
+
value: input.approvalId
|
|
440
|
+
}), "string" === typeof input.challengeTrackerId || $report(_exceptionable, {
|
|
441
|
+
path: _path + ".challengeTrackerId",
|
|
442
|
+
expected: "string",
|
|
443
|
+
value: input.challengeTrackerId
|
|
444
|
+
}), "" === input.approvalLevel || "collection" === input.approvalLevel || "incoming" === input.approvalLevel || "outgoing" === input.approvalLevel || $report(_exceptionable, {
|
|
445
|
+
path: _path + ".approvalLevel",
|
|
446
|
+
expected: "(\"\" | \"collection\" | \"incoming\" | \"outgoing\")",
|
|
447
|
+
value: input.approvalLevel
|
|
448
|
+
}), "string" === typeof input.approverAddress || $report(_exceptionable, {
|
|
449
|
+
path: _path + ".approverAddress",
|
|
450
|
+
expected: "string",
|
|
451
|
+
value: input.approverAddress
|
|
452
|
+
})].every(flag => flag);
|
|
453
|
+
const $vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId || $report(_exceptionable, {
|
|
454
|
+
path: _path + ".collectionId",
|
|
455
|
+
expected: "(bigint | number | string)",
|
|
456
|
+
value: input.collectionId
|
|
457
|
+
}), "string" === typeof input.approvalId || $report(_exceptionable, {
|
|
458
|
+
path: _path + ".approvalId",
|
|
459
|
+
expected: "string",
|
|
460
|
+
value: input.approvalId
|
|
461
|
+
}), "string" === typeof input.amountTrackerId || $report(_exceptionable, {
|
|
462
|
+
path: _path + ".amountTrackerId",
|
|
463
|
+
expected: "string",
|
|
464
|
+
value: input.amountTrackerId
|
|
465
|
+
}), "string" === typeof input.approvalLevel || $report(_exceptionable, {
|
|
466
|
+
path: _path + ".approvalLevel",
|
|
467
|
+
expected: "string",
|
|
468
|
+
value: input.approvalLevel
|
|
469
|
+
}), "string" === typeof input.approverAddress || $report(_exceptionable, {
|
|
470
|
+
path: _path + ".approverAddress",
|
|
471
|
+
expected: "string",
|
|
472
|
+
value: input.approverAddress
|
|
473
|
+
}), "string" === typeof input.trackerType || $report(_exceptionable, {
|
|
474
|
+
path: _path + ".trackerType",
|
|
475
|
+
expected: "string",
|
|
476
|
+
value: input.trackerType
|
|
477
|
+
}), "string" === typeof input.approvedAddress || $report(_exceptionable, {
|
|
478
|
+
path: _path + ".approvedAddress",
|
|
479
|
+
expected: "string",
|
|
480
|
+
value: input.approvedAddress
|
|
481
|
+
})].every(flag => flag);
|
|
482
|
+
const $vo5 = (input, _path, _exceptionable = true) => [undefined === input.doNotFetchCollectionMetadata || "boolean" === typeof input.doNotFetchCollectionMetadata || $report(_exceptionable, {
|
|
483
|
+
path: _path + ".doNotFetchCollectionMetadata",
|
|
484
|
+
expected: "(boolean | undefined)",
|
|
485
|
+
value: input.doNotFetchCollectionMetadata
|
|
486
|
+
}), undefined === input.uris || (Array.isArray(input.uris) || $report(_exceptionable, {
|
|
487
|
+
path: _path + ".uris",
|
|
488
|
+
expected: "(Array<string> | undefined)",
|
|
489
|
+
value: input.uris
|
|
490
|
+
})) && input.uris.map((elem, _index5) => "string" === typeof elem || $report(_exceptionable, {
|
|
491
|
+
path: _path + ".uris[" + _index5 + "]",
|
|
492
|
+
expected: "string",
|
|
493
|
+
value: elem
|
|
494
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
495
|
+
path: _path + ".uris",
|
|
496
|
+
expected: "(Array<string> | undefined)",
|
|
497
|
+
value: input.uris
|
|
498
|
+
}), undefined === input.badgeIds || (Array.isArray(input.badgeIds) || $report(_exceptionable, {
|
|
499
|
+
path: _path + ".badgeIds",
|
|
500
|
+
expected: "(Array<NumberType> | Array<iUintRange<NumberType>> | undefined)",
|
|
501
|
+
value: input.badgeIds
|
|
502
|
+
})) && ($vp0(input.badgeIds, _path + ".badgeIds", true && _exceptionable) || $report(_exceptionable, {
|
|
503
|
+
path: _path + ".badgeIds",
|
|
504
|
+
expected: "Array<iUintRange<NumberType>> | Array<NumberType>",
|
|
505
|
+
value: input.badgeIds
|
|
506
|
+
})) || $report(_exceptionable, {
|
|
507
|
+
path: _path + ".badgeIds",
|
|
508
|
+
expected: "(Array<NumberType> | Array<iUintRange<NumberType>> | undefined)",
|
|
509
|
+
value: input.badgeIds
|
|
510
|
+
})].every(flag => flag);
|
|
511
|
+
const $vo6 = (input, _path, _exceptionable = true) => ["string" === typeof input.start || "number" === typeof input.start || "bigint" === typeof input.start || $report(_exceptionable, {
|
|
512
|
+
path: _path + ".start",
|
|
513
|
+
expected: "(bigint | number | string)",
|
|
514
|
+
value: input.start
|
|
515
|
+
}), "string" === typeof input.end || "number" === typeof input.end || "bigint" === typeof input.end || $report(_exceptionable, {
|
|
516
|
+
path: _path + ".end",
|
|
517
|
+
expected: "(bigint | number | string)",
|
|
518
|
+
value: input.end
|
|
519
|
+
})].every(flag => flag);
|
|
520
|
+
return ("object" === typeof input && null !== input || $report(true, {
|
|
521
|
+
path: _path + "",
|
|
522
|
+
expected: "GetCollectionsPayload",
|
|
523
|
+
value: input
|
|
524
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
525
|
+
path: _path + "",
|
|
526
|
+
expected: "GetCollectionsPayload",
|
|
527
|
+
value: input
|
|
528
|
+
});
|
|
529
|
+
})(input, "$input", true);
|
|
530
|
+
}
|
|
531
|
+
const success = 0 === errors.length;
|
|
532
|
+
return {
|
|
533
|
+
success,
|
|
534
|
+
errors,
|
|
535
|
+
data: success ? input : undefined
|
|
536
|
+
};
|
|
537
|
+
})(body ?? {});
|
|
244
538
|
if (!validateRes.success) {
|
|
245
539
|
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
246
540
|
}
|
|
@@ -254,7 +548,38 @@ class BitBadgesCollection extends docs_js_1.CollectionDoc {
|
|
|
254
548
|
}
|
|
255
549
|
static async GetBadgeBalanceByAddress(api, collectionId, address, body) {
|
|
256
550
|
try {
|
|
257
|
-
const validateRes =
|
|
551
|
+
const validateRes = (input => {
|
|
552
|
+
const errors = [];
|
|
553
|
+
const __is = input => {
|
|
554
|
+
const $io0 = input => undefined === input.fetchPrivateParams || "boolean" === typeof input.fetchPrivateParams;
|
|
555
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
556
|
+
};
|
|
557
|
+
if (false === __is(input)) {
|
|
558
|
+
const $report = typia_1.default.validate.report(errors);
|
|
559
|
+
((input, _path, _exceptionable = true) => {
|
|
560
|
+
const $vo0 = (input, _path, _exceptionable = true) => [undefined === input.fetchPrivateParams || "boolean" === typeof input.fetchPrivateParams || $report(_exceptionable, {
|
|
561
|
+
path: _path + ".fetchPrivateParams",
|
|
562
|
+
expected: "(boolean | undefined)",
|
|
563
|
+
value: input.fetchPrivateParams
|
|
564
|
+
})].every(flag => flag);
|
|
565
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $report(true, {
|
|
566
|
+
path: _path + "",
|
|
567
|
+
expected: "GetBadgeBalanceByAddressPayload",
|
|
568
|
+
value: input
|
|
569
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
570
|
+
path: _path + "",
|
|
571
|
+
expected: "GetBadgeBalanceByAddressPayload",
|
|
572
|
+
value: input
|
|
573
|
+
});
|
|
574
|
+
})(input, "$input", true);
|
|
575
|
+
}
|
|
576
|
+
const success = 0 === errors.length;
|
|
577
|
+
return {
|
|
578
|
+
success,
|
|
579
|
+
errors,
|
|
580
|
+
data: success ? input : undefined
|
|
581
|
+
};
|
|
582
|
+
})(body ?? {});
|
|
258
583
|
if (!validateRes.success) {
|
|
259
584
|
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
260
585
|
}
|
|
@@ -468,7 +793,33 @@ class BitBadgesCollection extends docs_js_1.CollectionDoc {
|
|
|
468
793
|
}
|
|
469
794
|
static async RefreshMetadata(api, collectionId, body) {
|
|
470
795
|
try {
|
|
471
|
-
const validateRes =
|
|
796
|
+
const validateRes = (input => {
|
|
797
|
+
const errors = [];
|
|
798
|
+
const __is = input => {
|
|
799
|
+
return "object" === typeof input && null !== input && true;
|
|
800
|
+
};
|
|
801
|
+
if (false === __is(input)) {
|
|
802
|
+
const $report = typia_1.default.validate.report(errors);
|
|
803
|
+
((input, _path, _exceptionable = true) => {
|
|
804
|
+
const $vo0 = (input, _path, _exceptionable = true) => true;
|
|
805
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $report(true, {
|
|
806
|
+
path: _path + "",
|
|
807
|
+
expected: "RefreshMetadataPayload",
|
|
808
|
+
value: input
|
|
809
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
810
|
+
path: _path + "",
|
|
811
|
+
expected: "RefreshMetadataPayload",
|
|
812
|
+
value: input
|
|
813
|
+
});
|
|
814
|
+
})(input, "$input", true);
|
|
815
|
+
}
|
|
816
|
+
const success = 0 === errors.length;
|
|
817
|
+
return {
|
|
818
|
+
success,
|
|
819
|
+
errors,
|
|
820
|
+
data: success ? input : undefined
|
|
821
|
+
};
|
|
822
|
+
})(body ?? {});
|
|
472
823
|
if (!validateRes.success) {
|
|
473
824
|
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
474
825
|
}
|
|
@@ -486,7 +837,42 @@ class BitBadgesCollection extends docs_js_1.CollectionDoc {
|
|
|
486
837
|
}
|
|
487
838
|
static async GetBadgeActivity(api, collectionId, badgeId, body) {
|
|
488
839
|
try {
|
|
489
|
-
const validateRes =
|
|
840
|
+
const validateRes = (input => {
|
|
841
|
+
const errors = [];
|
|
842
|
+
const __is = input => {
|
|
843
|
+
const $io0 = input => (undefined === input.bookmark || "string" === typeof input.bookmark) && (undefined === input.cosmosAddress || "string" === typeof input.cosmosAddress);
|
|
844
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
845
|
+
};
|
|
846
|
+
if (false === __is(input)) {
|
|
847
|
+
const $report = typia_1.default.validate.report(errors);
|
|
848
|
+
((input, _path, _exceptionable = true) => {
|
|
849
|
+
const $vo0 = (input, _path, _exceptionable = true) => [undefined === input.bookmark || "string" === typeof input.bookmark || $report(_exceptionable, {
|
|
850
|
+
path: _path + ".bookmark",
|
|
851
|
+
expected: "(string | undefined)",
|
|
852
|
+
value: input.bookmark
|
|
853
|
+
}), undefined === input.cosmosAddress || "string" === typeof input.cosmosAddress || $report(_exceptionable, {
|
|
854
|
+
path: _path + ".cosmosAddress",
|
|
855
|
+
expected: "(string | undefined)",
|
|
856
|
+
value: input.cosmosAddress
|
|
857
|
+
})].every(flag => flag);
|
|
858
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $report(true, {
|
|
859
|
+
path: _path + "",
|
|
860
|
+
expected: "GetBadgeActivityPayload",
|
|
861
|
+
value: input
|
|
862
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
863
|
+
path: _path + "",
|
|
864
|
+
expected: "GetBadgeActivityPayload",
|
|
865
|
+
value: input
|
|
866
|
+
});
|
|
867
|
+
})(input, "$input", true);
|
|
868
|
+
}
|
|
869
|
+
const success = 0 === errors.length;
|
|
870
|
+
return {
|
|
871
|
+
success,
|
|
872
|
+
errors,
|
|
873
|
+
data: success ? input : undefined
|
|
874
|
+
};
|
|
875
|
+
})(body ?? {});
|
|
490
876
|
if (!validateRes.success) {
|
|
491
877
|
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
492
878
|
}
|
|
@@ -505,7 +891,38 @@ class BitBadgesCollection extends docs_js_1.CollectionDoc {
|
|
|
505
891
|
}
|
|
506
892
|
static async GetOwnersForBadge(api, collectionId, badgeId, body) {
|
|
507
893
|
try {
|
|
508
|
-
const validateRes =
|
|
894
|
+
const validateRes = (input => {
|
|
895
|
+
const errors = [];
|
|
896
|
+
const __is = input => {
|
|
897
|
+
const $io0 = input => undefined === input.bookmark || "string" === typeof input.bookmark;
|
|
898
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
899
|
+
};
|
|
900
|
+
if (false === __is(input)) {
|
|
901
|
+
const $report = typia_1.default.validate.report(errors);
|
|
902
|
+
((input, _path, _exceptionable = true) => {
|
|
903
|
+
const $vo0 = (input, _path, _exceptionable = true) => [undefined === input.bookmark || "string" === typeof input.bookmark || $report(_exceptionable, {
|
|
904
|
+
path: _path + ".bookmark",
|
|
905
|
+
expected: "(string | undefined)",
|
|
906
|
+
value: input.bookmark
|
|
907
|
+
})].every(flag => flag);
|
|
908
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $report(true, {
|
|
909
|
+
path: _path + "",
|
|
910
|
+
expected: "GetOwnersForBadgePayload",
|
|
911
|
+
value: input
|
|
912
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
913
|
+
path: _path + "",
|
|
914
|
+
expected: "GetOwnersForBadgePayload",
|
|
915
|
+
value: input
|
|
916
|
+
});
|
|
917
|
+
})(input, "$input", true);
|
|
918
|
+
}
|
|
919
|
+
const success = 0 === errors.length;
|
|
920
|
+
return {
|
|
921
|
+
success,
|
|
922
|
+
errors,
|
|
923
|
+
data: success ? input : undefined
|
|
924
|
+
};
|
|
925
|
+
})(body ?? {});
|
|
509
926
|
if (!validateRes.success) {
|
|
510
927
|
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
511
928
|
}
|
|
@@ -524,7 +941,118 @@ class BitBadgesCollection extends docs_js_1.CollectionDoc {
|
|
|
524
941
|
}
|
|
525
942
|
static async FilterBadgesInCollection(api, collectionId, body) {
|
|
526
943
|
try {
|
|
527
|
-
const validateRes =
|
|
944
|
+
const validateRes = (input => {
|
|
945
|
+
const errors = [];
|
|
946
|
+
const __is = input => {
|
|
947
|
+
const $io0 = input => (undefined === input.badgeIds || Array.isArray(input.badgeIds) && input.badgeIds.every(elem => "object" === typeof elem && null !== elem && $io1(elem))) && (undefined === input.categories || Array.isArray(input.categories) && input.categories.every(elem => "string" === typeof elem)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (undefined === input.mostViewed || "daily" === input.mostViewed || "allTime" === input.mostViewed || "weekly" === input.mostViewed || "monthly" === input.mostViewed || "yearly" === input.mostViewed) && (undefined === input.bookmark || "string" === typeof input.bookmark) && (undefined === input.attributes || Array.isArray(input.attributes) && input.attributes.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
948
|
+
const $io1 = input => ("string" === typeof input.start || "number" === typeof input.start || "bigint" === typeof input.start) && ("string" === typeof input.end || "number" === typeof input.end || "bigint" === typeof input.end);
|
|
949
|
+
const $io2 = input => "string" === typeof input.name && ("string" === typeof input.value || "number" === typeof input.value || "boolean" === typeof input.value);
|
|
950
|
+
return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
|
|
951
|
+
};
|
|
952
|
+
if (false === __is(input)) {
|
|
953
|
+
const $report = typia_1.default.validate.report(errors);
|
|
954
|
+
((input, _path, _exceptionable = true) => {
|
|
955
|
+
const $vo0 = (input, _path, _exceptionable = true) => [undefined === input.badgeIds || (Array.isArray(input.badgeIds) || $report(_exceptionable, {
|
|
956
|
+
path: _path + ".badgeIds",
|
|
957
|
+
expected: "(Array<iUintRange<NumberType>> | undefined)",
|
|
958
|
+
value: input.badgeIds
|
|
959
|
+
})) && input.badgeIds.map((elem, _index1) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
960
|
+
path: _path + ".badgeIds[" + _index1 + "]",
|
|
961
|
+
expected: "iUintRange<NumberType>",
|
|
962
|
+
value: elem
|
|
963
|
+
})) && $vo1(elem, _path + ".badgeIds[" + _index1 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
964
|
+
path: _path + ".badgeIds[" + _index1 + "]",
|
|
965
|
+
expected: "iUintRange<NumberType>",
|
|
966
|
+
value: elem
|
|
967
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
968
|
+
path: _path + ".badgeIds",
|
|
969
|
+
expected: "(Array<iUintRange<NumberType>> | undefined)",
|
|
970
|
+
value: input.badgeIds
|
|
971
|
+
}), undefined === input.categories || (Array.isArray(input.categories) || $report(_exceptionable, {
|
|
972
|
+
path: _path + ".categories",
|
|
973
|
+
expected: "(Array<string> | undefined)",
|
|
974
|
+
value: input.categories
|
|
975
|
+
})) && input.categories.map((elem, _index2) => "string" === typeof elem || $report(_exceptionable, {
|
|
976
|
+
path: _path + ".categories[" + _index2 + "]",
|
|
977
|
+
expected: "string",
|
|
978
|
+
value: elem
|
|
979
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
980
|
+
path: _path + ".categories",
|
|
981
|
+
expected: "(Array<string> | undefined)",
|
|
982
|
+
value: input.categories
|
|
983
|
+
}), undefined === input.tags || (Array.isArray(input.tags) || $report(_exceptionable, {
|
|
984
|
+
path: _path + ".tags",
|
|
985
|
+
expected: "(Array<string> | undefined)",
|
|
986
|
+
value: input.tags
|
|
987
|
+
})) && input.tags.map((elem, _index3) => "string" === typeof elem || $report(_exceptionable, {
|
|
988
|
+
path: _path + ".tags[" + _index3 + "]",
|
|
989
|
+
expected: "string",
|
|
990
|
+
value: elem
|
|
991
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
992
|
+
path: _path + ".tags",
|
|
993
|
+
expected: "(Array<string> | undefined)",
|
|
994
|
+
value: input.tags
|
|
995
|
+
}), undefined === input.mostViewed || "daily" === input.mostViewed || "allTime" === input.mostViewed || "weekly" === input.mostViewed || "monthly" === input.mostViewed || "yearly" === input.mostViewed || $report(_exceptionable, {
|
|
996
|
+
path: _path + ".mostViewed",
|
|
997
|
+
expected: "(\"allTime\" | \"daily\" | \"monthly\" | \"weekly\" | \"yearly\" | undefined)",
|
|
998
|
+
value: input.mostViewed
|
|
999
|
+
}), undefined === input.bookmark || "string" === typeof input.bookmark || $report(_exceptionable, {
|
|
1000
|
+
path: _path + ".bookmark",
|
|
1001
|
+
expected: "(string | undefined)",
|
|
1002
|
+
value: input.bookmark
|
|
1003
|
+
}), undefined === input.attributes || (Array.isArray(input.attributes) || $report(_exceptionable, {
|
|
1004
|
+
path: _path + ".attributes",
|
|
1005
|
+
expected: "(Array<__type> | undefined)",
|
|
1006
|
+
value: input.attributes
|
|
1007
|
+
})) && input.attributes.map((elem, _index4) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
1008
|
+
path: _path + ".attributes[" + _index4 + "]",
|
|
1009
|
+
expected: "__type",
|
|
1010
|
+
value: elem
|
|
1011
|
+
})) && $vo2(elem, _path + ".attributes[" + _index4 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
1012
|
+
path: _path + ".attributes[" + _index4 + "]",
|
|
1013
|
+
expected: "__type",
|
|
1014
|
+
value: elem
|
|
1015
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
1016
|
+
path: _path + ".attributes",
|
|
1017
|
+
expected: "(Array<__type> | undefined)",
|
|
1018
|
+
value: input.attributes
|
|
1019
|
+
})].every(flag => flag);
|
|
1020
|
+
const $vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.start || "number" === typeof input.start || "bigint" === typeof input.start || $report(_exceptionable, {
|
|
1021
|
+
path: _path + ".start",
|
|
1022
|
+
expected: "(bigint | number | string)",
|
|
1023
|
+
value: input.start
|
|
1024
|
+
}), "string" === typeof input.end || "number" === typeof input.end || "bigint" === typeof input.end || $report(_exceptionable, {
|
|
1025
|
+
path: _path + ".end",
|
|
1026
|
+
expected: "(bigint | number | string)",
|
|
1027
|
+
value: input.end
|
|
1028
|
+
})].every(flag => flag);
|
|
1029
|
+
const $vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || $report(_exceptionable, {
|
|
1030
|
+
path: _path + ".name",
|
|
1031
|
+
expected: "string",
|
|
1032
|
+
value: input.name
|
|
1033
|
+
}), "string" === typeof input.value || "number" === typeof input.value || "boolean" === typeof input.value || $report(_exceptionable, {
|
|
1034
|
+
path: _path + ".value",
|
|
1035
|
+
expected: "(boolean | number | string)",
|
|
1036
|
+
value: input.value
|
|
1037
|
+
})].every(flag => flag);
|
|
1038
|
+
return ("object" === typeof input && null !== input && false === Array.isArray(input) || $report(true, {
|
|
1039
|
+
path: _path + "",
|
|
1040
|
+
expected: "FilterBadgesInCollectionPayload",
|
|
1041
|
+
value: input
|
|
1042
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
1043
|
+
path: _path + "",
|
|
1044
|
+
expected: "FilterBadgesInCollectionPayload",
|
|
1045
|
+
value: input
|
|
1046
|
+
});
|
|
1047
|
+
})(input, "$input", true);
|
|
1048
|
+
}
|
|
1049
|
+
const success = 0 === errors.length;
|
|
1050
|
+
return {
|
|
1051
|
+
success,
|
|
1052
|
+
errors,
|
|
1053
|
+
data: success ? input : undefined
|
|
1054
|
+
};
|
|
1055
|
+
})(body ?? {});
|
|
528
1056
|
if (!validateRes.success) {
|
|
529
1057
|
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
530
1058
|
}
|
|
@@ -546,6 +1074,7 @@ function convertCollectionMap(item, convertFunction) {
|
|
|
546
1074
|
return [key, value ? value.convert(convertFunction) : undefined];
|
|
547
1075
|
}));
|
|
548
1076
|
}
|
|
1077
|
+
exports.convertCollectionMap = convertCollectionMap;
|
|
549
1078
|
const pruneMetadataToFetch = (cachedCollection, metadataFetchReq) => {
|
|
550
1079
|
if (!cachedCollection)
|
|
551
1080
|
throw new Error('Collection does not exist');
|