bitbadgesjs-sdk 0.3.49 → 0.3.51
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/api-indexer/BitBadgesAddressList.d.ts +4 -4
- package/dist/api-indexer/BitBadgesAddressList.d.ts.map +1 -1
- package/dist/api-indexer/BitBadgesAddressList.js +540 -8
- package/dist/api-indexer/BitBadgesAddressList.js.map +1 -1
- package/dist/api-indexer/BitBadgesApi.d.ts +8 -6
- package/dist/api-indexer/BitBadgesApi.d.ts.map +1 -1
- package/dist/api-indexer/BitBadgesApi.js +6266 -12
- package/dist/api-indexer/BitBadgesApi.js.map +1 -1
- package/dist/api-indexer/BitBadgesCollection.d.ts.map +1 -1
- package/dist/api-indexer/BitBadgesCollection.js +557 -0
- package/dist/api-indexer/BitBadgesCollection.js.map +1 -1
- package/dist/api-indexer/BitBadgesUserInfo.d.ts +8 -8
- package/dist/api-indexer/BitBadgesUserInfo.d.ts.map +1 -1
- package/dist/api-indexer/BitBadgesUserInfo.js +230 -12
- package/dist/api-indexer/BitBadgesUserInfo.js.map +1 -1
- package/dist/api-indexer/docs/docs.d.ts +8 -8
- package/dist/api-indexer/docs/docs.d.ts.map +1 -1
- package/dist/api-indexer/docs/docs.js +9 -9
- package/dist/api-indexer/docs/docs.js.map +1 -1
- package/dist/api-indexer/docs/interfaces.d.ts +3 -3
- package/dist/api-indexer/docs/interfaces.d.ts.map +1 -1
- package/dist/api-indexer/metadata/metadataIds.d.ts.map +1 -1
- package/dist/api-indexer/requests/collections.d.ts +18 -0
- package/dist/api-indexer/requests/collections.d.ts.map +1 -1
- package/dist/api-indexer/requests/collections.js +9 -1
- package/dist/api-indexer/requests/collections.js.map +1 -1
- package/dist/api-indexer/requests/requests.d.ts +27 -36
- package/dist/api-indexer/requests/requests.d.ts.map +1 -1
- package/dist/api-indexer/requests/requests.js +12 -20
- package/dist/api-indexer/requests/requests.js.map +1 -1
- package/dist/api-indexer/requests/routes.d.ts +3 -2
- package/dist/api-indexer/requests/routes.d.ts.map +1 -1
- package/dist/api-indexer/requests/routes.js +3 -2
- package/dist/api-indexer/requests/routes.js.map +1 -1
- package/dist/core/approval-utils.d.ts.map +1 -1
- package/dist/core/balances.d.ts.map +1 -1
- package/dist/core/blockin.d.ts +8 -8
- package/dist/core/blockin.d.ts.map +1 -1
- package/dist/core/blockin.js +17 -17
- package/dist/core/blockin.js.map +1 -1
- package/dist/core/secrets.d.ts +9 -9
- package/dist/core/secrets.d.ts.map +1 -1
- package/dist/core/secrets.js +11 -11
- package/dist/core/secrets.js.map +1 -1
- package/dist/core/transfers.d.ts.map +1 -1
- package/dist/core/transfers.js +2 -2
- package/dist/core/transfers.js.map +1 -1
- package/dist/interfaces/badges/core.d.ts +5 -5
- package/dist/interfaces/badges/core.d.ts.map +1 -1
- package/dist/transactions/amino/registry.js +16 -16
- package/dist/transactions/amino/registry.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -4
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.DeleteAddressListsSuccessResponse = exports.CreateAddressListsSuccessResponse = exports.UpdateAddressListsSuccessResponse = exports.GetAddressListsSuccessResponse = exports.BitBadgesAddressList = void 0;
|
|
4
7
|
const base_1 = require("../common/base");
|
|
@@ -7,6 +10,7 @@ const activity_1 = require("./docs/activity");
|
|
|
7
10
|
const docs_1 = require("./docs/docs");
|
|
8
11
|
const metadata_1 = require("./metadata/metadata");
|
|
9
12
|
const routes_1 = require("./requests/routes");
|
|
13
|
+
const typia_1 = __importDefault(require("typia"));
|
|
10
14
|
class BitBadgesAddressList extends docs_1.AddressListDoc {
|
|
11
15
|
metadata;
|
|
12
16
|
listsActivity;
|
|
@@ -104,9 +108,96 @@ class BitBadgesAddressList extends docs_1.AddressListDoc {
|
|
|
104
108
|
return;
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
|
-
static async GetAddressLists(api,
|
|
111
|
+
static async GetAddressLists(api, payload) {
|
|
108
112
|
try {
|
|
109
|
-
const
|
|
113
|
+
const validateRes = (input => {
|
|
114
|
+
const errors = [];
|
|
115
|
+
const __is = input => {
|
|
116
|
+
const $io0 = input => Array.isArray(input.listsToFetch) && input.listsToFetch.every(elem => "object" === typeof elem && null !== elem && $io1(elem));
|
|
117
|
+
const $io1 = input => "string" === typeof input.listId && (undefined === input.viewsToFetch || Array.isArray(input.viewsToFetch) && input.viewsToFetch.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && (undefined === input.fetchPrivateParams || "boolean" === typeof input.fetchPrivateParams);
|
|
118
|
+
const $io2 = input => "string" === typeof input.viewId && "listActivity" === input.viewType && "string" === typeof input.bookmark;
|
|
119
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
120
|
+
};
|
|
121
|
+
if (false === __is(input)) {
|
|
122
|
+
const $report = typia_1.default.validate.report(errors);
|
|
123
|
+
((input, _path, _exceptionable = true) => {
|
|
124
|
+
const $vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.listsToFetch) || $report(_exceptionable, {
|
|
125
|
+
path: _path + ".listsToFetch",
|
|
126
|
+
expected: "Array<__type>",
|
|
127
|
+
value: input.listsToFetch
|
|
128
|
+
})) && input.listsToFetch.map((elem, _index1) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
129
|
+
path: _path + ".listsToFetch[" + _index1 + "]",
|
|
130
|
+
expected: "__type",
|
|
131
|
+
value: elem
|
|
132
|
+
})) && $vo1(elem, _path + ".listsToFetch[" + _index1 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
133
|
+
path: _path + ".listsToFetch[" + _index1 + "]",
|
|
134
|
+
expected: "__type",
|
|
135
|
+
value: elem
|
|
136
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
137
|
+
path: _path + ".listsToFetch",
|
|
138
|
+
expected: "Array<__type>",
|
|
139
|
+
value: input.listsToFetch
|
|
140
|
+
})].every(flag => flag);
|
|
141
|
+
const $vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.listId || $report(_exceptionable, {
|
|
142
|
+
path: _path + ".listId",
|
|
143
|
+
expected: "string",
|
|
144
|
+
value: input.listId
|
|
145
|
+
}), undefined === input.viewsToFetch || (Array.isArray(input.viewsToFetch) || $report(_exceptionable, {
|
|
146
|
+
path: _path + ".viewsToFetch",
|
|
147
|
+
expected: "(Array<__type>.o1 | undefined)",
|
|
148
|
+
value: input.viewsToFetch
|
|
149
|
+
})) && input.viewsToFetch.map((elem, _index2) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
150
|
+
path: _path + ".viewsToFetch[" + _index2 + "]",
|
|
151
|
+
expected: "__type.o1",
|
|
152
|
+
value: elem
|
|
153
|
+
})) && $vo2(elem, _path + ".viewsToFetch[" + _index2 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
154
|
+
path: _path + ".viewsToFetch[" + _index2 + "]",
|
|
155
|
+
expected: "__type.o1",
|
|
156
|
+
value: elem
|
|
157
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
158
|
+
path: _path + ".viewsToFetch",
|
|
159
|
+
expected: "(Array<__type>.o1 | undefined)",
|
|
160
|
+
value: input.viewsToFetch
|
|
161
|
+
}), undefined === input.fetchPrivateParams || "boolean" === typeof input.fetchPrivateParams || $report(_exceptionable, {
|
|
162
|
+
path: _path + ".fetchPrivateParams",
|
|
163
|
+
expected: "(boolean | undefined)",
|
|
164
|
+
value: input.fetchPrivateParams
|
|
165
|
+
})].every(flag => flag);
|
|
166
|
+
const $vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.viewId || $report(_exceptionable, {
|
|
167
|
+
path: _path + ".viewId",
|
|
168
|
+
expected: "string",
|
|
169
|
+
value: input.viewId
|
|
170
|
+
}), "listActivity" === input.viewType || $report(_exceptionable, {
|
|
171
|
+
path: _path + ".viewType",
|
|
172
|
+
expected: "\"listActivity\"",
|
|
173
|
+
value: input.viewType
|
|
174
|
+
}), "string" === typeof input.bookmark || $report(_exceptionable, {
|
|
175
|
+
path: _path + ".bookmark",
|
|
176
|
+
expected: "string",
|
|
177
|
+
value: input.bookmark
|
|
178
|
+
})].every(flag => flag);
|
|
179
|
+
return ("object" === typeof input && null !== input || $report(true, {
|
|
180
|
+
path: _path + "",
|
|
181
|
+
expected: "GetAddressListsPayload",
|
|
182
|
+
value: input
|
|
183
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
184
|
+
path: _path + "",
|
|
185
|
+
expected: "GetAddressListsPayload",
|
|
186
|
+
value: input
|
|
187
|
+
});
|
|
188
|
+
})(input, "$input", true);
|
|
189
|
+
}
|
|
190
|
+
const success = 0 === errors.length;
|
|
191
|
+
return {
|
|
192
|
+
success,
|
|
193
|
+
errors,
|
|
194
|
+
data: success ? input : undefined
|
|
195
|
+
};
|
|
196
|
+
})(payload ?? {});
|
|
197
|
+
if (!validateRes.success) {
|
|
198
|
+
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
199
|
+
}
|
|
200
|
+
const response = await api.axios.post(`${api.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetAddressListsRoute()}`, payload);
|
|
110
201
|
return new GetAddressListsSuccessResponse(response.data);
|
|
111
202
|
}
|
|
112
203
|
catch (error) {
|
|
@@ -114,9 +205,208 @@ class BitBadgesAddressList extends docs_1.AddressListDoc {
|
|
|
114
205
|
return Promise.reject(error);
|
|
115
206
|
}
|
|
116
207
|
}
|
|
117
|
-
static async CreateAddressList(api,
|
|
208
|
+
static async CreateAddressList(api, payload) {
|
|
118
209
|
try {
|
|
119
|
-
const
|
|
210
|
+
const validateRes = (input => {
|
|
211
|
+
const errors = [];
|
|
212
|
+
const __is = input => {
|
|
213
|
+
const $io0 = input => Array.isArray(input.addressLists) && input.addressLists.every(elem => "object" === typeof elem && null !== elem && $io1(elem));
|
|
214
|
+
const $io1 = input => "string" === typeof input.listId && (Array.isArray(input.addresses) && input.addresses.every(elem => "string" === typeof elem)) && "boolean" === typeof input.whitelist && "string" === typeof input.uri && "string" === typeof input.customData && (undefined === input.createdBy || "string" === typeof input.createdBy) && (undefined === input.aliasAddress || "string" === typeof input.aliasAddress) && (undefined === input.updateAddresses || "boolean" === typeof input.updateAddresses) && (undefined === input.private || "boolean" === typeof input.private) && (undefined === input.viewableWithLink || "boolean" === typeof input.viewableWithLink) && (Array.isArray(input.claims) && input.claims.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
215
|
+
const $io2 = input => "string" === typeof input.claimId && (Array.isArray(input.plugins) && input.plugins.every(elem => "object" === typeof elem && null !== elem && $io3(elem))) && (undefined === input.approach || "string" === typeof input.approach);
|
|
216
|
+
const $io3 = input => "object" === typeof input.publicState && null !== input.publicState && true && (undefined === input.privateState || "object" === typeof input.privateState && null !== input.privateState && false === Array.isArray(input.privateState) && $io4(input.privateState)) && (undefined === input.resetState || "boolean" === typeof input.resetState) && (undefined === input.newState || "object" === typeof input.newState && null !== input.newState && false === Array.isArray(input.newState) && $io4(input.newState)) && (undefined === input.onlyUpdateProvidedNewState || "boolean" === typeof input.onlyUpdateProvidedNewState) && "string" === typeof input.instanceId && "string" === typeof input.pluginId && ("object" === typeof input.publicParams && null !== input.publicParams && true) && ("object" === typeof input.privateParams && null !== input.privateParams && true);
|
|
217
|
+
const $io4 = input => true;
|
|
218
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
219
|
+
};
|
|
220
|
+
if (false === __is(input)) {
|
|
221
|
+
const $report = typia_1.default.validate.report(errors);
|
|
222
|
+
((input, _path, _exceptionable = true) => {
|
|
223
|
+
const $vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.addressLists) || $report(_exceptionable, {
|
|
224
|
+
path: _path + ".addressLists",
|
|
225
|
+
expected: "Array<iAddressListCreateObject>",
|
|
226
|
+
value: input.addressLists
|
|
227
|
+
})) && input.addressLists.map((elem, _index1) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
228
|
+
path: _path + ".addressLists[" + _index1 + "]",
|
|
229
|
+
expected: "iAddressListCreateObject",
|
|
230
|
+
value: elem
|
|
231
|
+
})) && $vo1(elem, _path + ".addressLists[" + _index1 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
232
|
+
path: _path + ".addressLists[" + _index1 + "]",
|
|
233
|
+
expected: "iAddressListCreateObject",
|
|
234
|
+
value: elem
|
|
235
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
236
|
+
path: _path + ".addressLists",
|
|
237
|
+
expected: "Array<iAddressListCreateObject>",
|
|
238
|
+
value: input.addressLists
|
|
239
|
+
})].every(flag => flag);
|
|
240
|
+
const $vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.listId || $report(_exceptionable, {
|
|
241
|
+
path: _path + ".listId",
|
|
242
|
+
expected: "string",
|
|
243
|
+
value: input.listId
|
|
244
|
+
}), (Array.isArray(input.addresses) || $report(_exceptionable, {
|
|
245
|
+
path: _path + ".addresses",
|
|
246
|
+
expected: "Array<string>",
|
|
247
|
+
value: input.addresses
|
|
248
|
+
})) && input.addresses.map((elem, _index2) => "string" === typeof elem || $report(_exceptionable, {
|
|
249
|
+
path: _path + ".addresses[" + _index2 + "]",
|
|
250
|
+
expected: "string",
|
|
251
|
+
value: elem
|
|
252
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
253
|
+
path: _path + ".addresses",
|
|
254
|
+
expected: "Array<string>",
|
|
255
|
+
value: input.addresses
|
|
256
|
+
}), "boolean" === typeof input.whitelist || $report(_exceptionable, {
|
|
257
|
+
path: _path + ".whitelist",
|
|
258
|
+
expected: "boolean",
|
|
259
|
+
value: input.whitelist
|
|
260
|
+
}), "string" === typeof input.uri || $report(_exceptionable, {
|
|
261
|
+
path: _path + ".uri",
|
|
262
|
+
expected: "string",
|
|
263
|
+
value: input.uri
|
|
264
|
+
}), "string" === typeof input.customData || $report(_exceptionable, {
|
|
265
|
+
path: _path + ".customData",
|
|
266
|
+
expected: "string",
|
|
267
|
+
value: input.customData
|
|
268
|
+
}), undefined === input.createdBy || "string" === typeof input.createdBy || $report(_exceptionable, {
|
|
269
|
+
path: _path + ".createdBy",
|
|
270
|
+
expected: "(string | undefined)",
|
|
271
|
+
value: input.createdBy
|
|
272
|
+
}), undefined === input.aliasAddress || "string" === typeof input.aliasAddress || $report(_exceptionable, {
|
|
273
|
+
path: _path + ".aliasAddress",
|
|
274
|
+
expected: "(string | undefined)",
|
|
275
|
+
value: input.aliasAddress
|
|
276
|
+
}), undefined === input.updateAddresses || "boolean" === typeof input.updateAddresses || $report(_exceptionable, {
|
|
277
|
+
path: _path + ".updateAddresses",
|
|
278
|
+
expected: "(boolean | undefined)",
|
|
279
|
+
value: input.updateAddresses
|
|
280
|
+
}), undefined === input.private || "boolean" === typeof input.private || $report(_exceptionable, {
|
|
281
|
+
path: _path + ".private",
|
|
282
|
+
expected: "(boolean | undefined)",
|
|
283
|
+
value: input.private
|
|
284
|
+
}), undefined === input.viewableWithLink || "boolean" === typeof input.viewableWithLink || $report(_exceptionable, {
|
|
285
|
+
path: _path + ".viewableWithLink",
|
|
286
|
+
expected: "(boolean | undefined)",
|
|
287
|
+
value: input.viewableWithLink
|
|
288
|
+
}), (Array.isArray(input.claims) || $report(_exceptionable, {
|
|
289
|
+
path: _path + ".claims",
|
|
290
|
+
expected: "Array<__type>",
|
|
291
|
+
value: input.claims
|
|
292
|
+
})) && input.claims.map((elem, _index3) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
293
|
+
path: _path + ".claims[" + _index3 + "]",
|
|
294
|
+
expected: "__type",
|
|
295
|
+
value: elem
|
|
296
|
+
})) && $vo2(elem, _path + ".claims[" + _index3 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
297
|
+
path: _path + ".claims[" + _index3 + "]",
|
|
298
|
+
expected: "__type",
|
|
299
|
+
value: elem
|
|
300
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
301
|
+
path: _path + ".claims",
|
|
302
|
+
expected: "Array<__type>",
|
|
303
|
+
value: input.claims
|
|
304
|
+
})].every(flag => flag);
|
|
305
|
+
const $vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.claimId || $report(_exceptionable, {
|
|
306
|
+
path: _path + ".claimId",
|
|
307
|
+
expected: "string",
|
|
308
|
+
value: input.claimId
|
|
309
|
+
}), (Array.isArray(input.plugins) || $report(_exceptionable, {
|
|
310
|
+
path: _path + ".plugins",
|
|
311
|
+
expected: "Array<IntegrationPluginDetails<string>>",
|
|
312
|
+
value: input.plugins
|
|
313
|
+
})) && input.plugins.map((elem, _index4) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
314
|
+
path: _path + ".plugins[" + _index4 + "]",
|
|
315
|
+
expected: "IntegrationPluginDetails<string>",
|
|
316
|
+
value: elem
|
|
317
|
+
})) && $vo3(elem, _path + ".plugins[" + _index4 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
318
|
+
path: _path + ".plugins[" + _index4 + "]",
|
|
319
|
+
expected: "IntegrationPluginDetails<string>",
|
|
320
|
+
value: elem
|
|
321
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
322
|
+
path: _path + ".plugins",
|
|
323
|
+
expected: "Array<IntegrationPluginDetails<string>>",
|
|
324
|
+
value: input.plugins
|
|
325
|
+
}), undefined === input.approach || "string" === typeof input.approach || $report(_exceptionable, {
|
|
326
|
+
path: _path + ".approach",
|
|
327
|
+
expected: "(string | undefined)",
|
|
328
|
+
value: input.approach
|
|
329
|
+
})].every(flag => flag);
|
|
330
|
+
const $vo3 = (input, _path, _exceptionable = true) => [("object" === typeof input.publicState && null !== input.publicState && false === Array.isArray(input.publicState) || $report(_exceptionable, {
|
|
331
|
+
path: _path + ".publicState",
|
|
332
|
+
expected: "__type.o1",
|
|
333
|
+
value: input.publicState
|
|
334
|
+
})) && $vo4(input.publicState, _path + ".publicState", true && _exceptionable) || $report(_exceptionable, {
|
|
335
|
+
path: _path + ".publicState",
|
|
336
|
+
expected: "__type.o1",
|
|
337
|
+
value: input.publicState
|
|
338
|
+
}), undefined === input.privateState || ("object" === typeof input.privateState && null !== input.privateState && false === Array.isArray(input.privateState) || $report(_exceptionable, {
|
|
339
|
+
path: _path + ".privateState",
|
|
340
|
+
expected: "(__type.o1 | undefined)",
|
|
341
|
+
value: input.privateState
|
|
342
|
+
})) && $vo4(input.privateState, _path + ".privateState", true && _exceptionable) || $report(_exceptionable, {
|
|
343
|
+
path: _path + ".privateState",
|
|
344
|
+
expected: "(__type.o1 | undefined)",
|
|
345
|
+
value: input.privateState
|
|
346
|
+
}), undefined === input.resetState || "boolean" === typeof input.resetState || $report(_exceptionable, {
|
|
347
|
+
path: _path + ".resetState",
|
|
348
|
+
expected: "(boolean | undefined)",
|
|
349
|
+
value: input.resetState
|
|
350
|
+
}), undefined === input.newState || ("object" === typeof input.newState && null !== input.newState && false === Array.isArray(input.newState) || $report(_exceptionable, {
|
|
351
|
+
path: _path + ".newState",
|
|
352
|
+
expected: "(__type.o1 | undefined)",
|
|
353
|
+
value: input.newState
|
|
354
|
+
})) && $vo4(input.newState, _path + ".newState", true && _exceptionable) || $report(_exceptionable, {
|
|
355
|
+
path: _path + ".newState",
|
|
356
|
+
expected: "(__type.o1 | undefined)",
|
|
357
|
+
value: input.newState
|
|
358
|
+
}), undefined === input.onlyUpdateProvidedNewState || "boolean" === typeof input.onlyUpdateProvidedNewState || $report(_exceptionable, {
|
|
359
|
+
path: _path + ".onlyUpdateProvidedNewState",
|
|
360
|
+
expected: "(boolean | undefined)",
|
|
361
|
+
value: input.onlyUpdateProvidedNewState
|
|
362
|
+
}), "string" === typeof input.instanceId || $report(_exceptionable, {
|
|
363
|
+
path: _path + ".instanceId",
|
|
364
|
+
expected: "string",
|
|
365
|
+
value: input.instanceId
|
|
366
|
+
}), "string" === typeof input.pluginId || $report(_exceptionable, {
|
|
367
|
+
path: _path + ".pluginId",
|
|
368
|
+
expected: "string",
|
|
369
|
+
value: input.pluginId
|
|
370
|
+
}), ("object" === typeof input.publicParams && null !== input.publicParams && false === Array.isArray(input.publicParams) || $report(_exceptionable, {
|
|
371
|
+
path: _path + ".publicParams",
|
|
372
|
+
expected: "__type.o1",
|
|
373
|
+
value: input.publicParams
|
|
374
|
+
})) && $vo4(input.publicParams, _path + ".publicParams", true && _exceptionable) || $report(_exceptionable, {
|
|
375
|
+
path: _path + ".publicParams",
|
|
376
|
+
expected: "__type.o1",
|
|
377
|
+
value: input.publicParams
|
|
378
|
+
}), ("object" === typeof input.privateParams && null !== input.privateParams && false === Array.isArray(input.privateParams) || $report(_exceptionable, {
|
|
379
|
+
path: _path + ".privateParams",
|
|
380
|
+
expected: "__type.o1",
|
|
381
|
+
value: input.privateParams
|
|
382
|
+
})) && $vo4(input.privateParams, _path + ".privateParams", true && _exceptionable) || $report(_exceptionable, {
|
|
383
|
+
path: _path + ".privateParams",
|
|
384
|
+
expected: "__type.o1",
|
|
385
|
+
value: input.privateParams
|
|
386
|
+
})].every(flag => flag);
|
|
387
|
+
const $vo4 = (input, _path, _exceptionable = true) => true;
|
|
388
|
+
return ("object" === typeof input && null !== input || $report(true, {
|
|
389
|
+
path: _path + "",
|
|
390
|
+
expected: "CreateAddressListsPayload",
|
|
391
|
+
value: input
|
|
392
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
393
|
+
path: _path + "",
|
|
394
|
+
expected: "CreateAddressListsPayload",
|
|
395
|
+
value: input
|
|
396
|
+
});
|
|
397
|
+
})(input, "$input", true);
|
|
398
|
+
}
|
|
399
|
+
const success = 0 === errors.length;
|
|
400
|
+
return {
|
|
401
|
+
success,
|
|
402
|
+
errors,
|
|
403
|
+
data: success ? input : undefined
|
|
404
|
+
};
|
|
405
|
+
})(payload ?? {});
|
|
406
|
+
if (!validateRes.success) {
|
|
407
|
+
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
408
|
+
}
|
|
409
|
+
const response = await api.axios.post(`${api.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CRUDAddressListsRoute()}`, payload);
|
|
120
410
|
return new CreateAddressListsSuccessResponse(response.data);
|
|
121
411
|
}
|
|
122
412
|
catch (error) {
|
|
@@ -124,9 +414,208 @@ class BitBadgesAddressList extends docs_1.AddressListDoc {
|
|
|
124
414
|
return Promise.reject(error);
|
|
125
415
|
}
|
|
126
416
|
}
|
|
127
|
-
static async UpdateAddressList(api,
|
|
417
|
+
static async UpdateAddressList(api, payload) {
|
|
128
418
|
try {
|
|
129
|
-
const
|
|
419
|
+
const validateRes = (input => {
|
|
420
|
+
const errors = [];
|
|
421
|
+
const __is = input => {
|
|
422
|
+
const $io0 = input => Array.isArray(input.addressLists) && input.addressLists.every(elem => "object" === typeof elem && null !== elem && $io1(elem));
|
|
423
|
+
const $io1 = input => "string" === typeof input.listId && (Array.isArray(input.addresses) && input.addresses.every(elem => "string" === typeof elem)) && "boolean" === typeof input.whitelist && "string" === typeof input.uri && "string" === typeof input.customData && (undefined === input.createdBy || "string" === typeof input.createdBy) && (undefined === input.aliasAddress || "string" === typeof input.aliasAddress) && (undefined === input.updateAddresses || "boolean" === typeof input.updateAddresses) && (undefined === input.private || "boolean" === typeof input.private) && (undefined === input.viewableWithLink || "boolean" === typeof input.viewableWithLink) && (Array.isArray(input.claims) && input.claims.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
424
|
+
const $io2 = input => "string" === typeof input.claimId && (Array.isArray(input.plugins) && input.plugins.every(elem => "object" === typeof elem && null !== elem && $io3(elem))) && (undefined === input.approach || "string" === typeof input.approach);
|
|
425
|
+
const $io3 = input => "object" === typeof input.publicState && null !== input.publicState && true && (undefined === input.privateState || "object" === typeof input.privateState && null !== input.privateState && false === Array.isArray(input.privateState) && $io4(input.privateState)) && (undefined === input.resetState || "boolean" === typeof input.resetState) && (undefined === input.newState || "object" === typeof input.newState && null !== input.newState && false === Array.isArray(input.newState) && $io4(input.newState)) && (undefined === input.onlyUpdateProvidedNewState || "boolean" === typeof input.onlyUpdateProvidedNewState) && "string" === typeof input.instanceId && "string" === typeof input.pluginId && ("object" === typeof input.publicParams && null !== input.publicParams && true) && ("object" === typeof input.privateParams && null !== input.privateParams && true);
|
|
426
|
+
const $io4 = input => true;
|
|
427
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
428
|
+
};
|
|
429
|
+
if (false === __is(input)) {
|
|
430
|
+
const $report = typia_1.default.validate.report(errors);
|
|
431
|
+
((input, _path, _exceptionable = true) => {
|
|
432
|
+
const $vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.addressLists) || $report(_exceptionable, {
|
|
433
|
+
path: _path + ".addressLists",
|
|
434
|
+
expected: "Array<iAddressListCreateObject>",
|
|
435
|
+
value: input.addressLists
|
|
436
|
+
})) && input.addressLists.map((elem, _index1) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
437
|
+
path: _path + ".addressLists[" + _index1 + "]",
|
|
438
|
+
expected: "iAddressListCreateObject",
|
|
439
|
+
value: elem
|
|
440
|
+
})) && $vo1(elem, _path + ".addressLists[" + _index1 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
441
|
+
path: _path + ".addressLists[" + _index1 + "]",
|
|
442
|
+
expected: "iAddressListCreateObject",
|
|
443
|
+
value: elem
|
|
444
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
445
|
+
path: _path + ".addressLists",
|
|
446
|
+
expected: "Array<iAddressListCreateObject>",
|
|
447
|
+
value: input.addressLists
|
|
448
|
+
})].every(flag => flag);
|
|
449
|
+
const $vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.listId || $report(_exceptionable, {
|
|
450
|
+
path: _path + ".listId",
|
|
451
|
+
expected: "string",
|
|
452
|
+
value: input.listId
|
|
453
|
+
}), (Array.isArray(input.addresses) || $report(_exceptionable, {
|
|
454
|
+
path: _path + ".addresses",
|
|
455
|
+
expected: "Array<string>",
|
|
456
|
+
value: input.addresses
|
|
457
|
+
})) && input.addresses.map((elem, _index2) => "string" === typeof elem || $report(_exceptionable, {
|
|
458
|
+
path: _path + ".addresses[" + _index2 + "]",
|
|
459
|
+
expected: "string",
|
|
460
|
+
value: elem
|
|
461
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
462
|
+
path: _path + ".addresses",
|
|
463
|
+
expected: "Array<string>",
|
|
464
|
+
value: input.addresses
|
|
465
|
+
}), "boolean" === typeof input.whitelist || $report(_exceptionable, {
|
|
466
|
+
path: _path + ".whitelist",
|
|
467
|
+
expected: "boolean",
|
|
468
|
+
value: input.whitelist
|
|
469
|
+
}), "string" === typeof input.uri || $report(_exceptionable, {
|
|
470
|
+
path: _path + ".uri",
|
|
471
|
+
expected: "string",
|
|
472
|
+
value: input.uri
|
|
473
|
+
}), "string" === typeof input.customData || $report(_exceptionable, {
|
|
474
|
+
path: _path + ".customData",
|
|
475
|
+
expected: "string",
|
|
476
|
+
value: input.customData
|
|
477
|
+
}), undefined === input.createdBy || "string" === typeof input.createdBy || $report(_exceptionable, {
|
|
478
|
+
path: _path + ".createdBy",
|
|
479
|
+
expected: "(string | undefined)",
|
|
480
|
+
value: input.createdBy
|
|
481
|
+
}), undefined === input.aliasAddress || "string" === typeof input.aliasAddress || $report(_exceptionable, {
|
|
482
|
+
path: _path + ".aliasAddress",
|
|
483
|
+
expected: "(string | undefined)",
|
|
484
|
+
value: input.aliasAddress
|
|
485
|
+
}), undefined === input.updateAddresses || "boolean" === typeof input.updateAddresses || $report(_exceptionable, {
|
|
486
|
+
path: _path + ".updateAddresses",
|
|
487
|
+
expected: "(boolean | undefined)",
|
|
488
|
+
value: input.updateAddresses
|
|
489
|
+
}), undefined === input.private || "boolean" === typeof input.private || $report(_exceptionable, {
|
|
490
|
+
path: _path + ".private",
|
|
491
|
+
expected: "(boolean | undefined)",
|
|
492
|
+
value: input.private
|
|
493
|
+
}), undefined === input.viewableWithLink || "boolean" === typeof input.viewableWithLink || $report(_exceptionable, {
|
|
494
|
+
path: _path + ".viewableWithLink",
|
|
495
|
+
expected: "(boolean | undefined)",
|
|
496
|
+
value: input.viewableWithLink
|
|
497
|
+
}), (Array.isArray(input.claims) || $report(_exceptionable, {
|
|
498
|
+
path: _path + ".claims",
|
|
499
|
+
expected: "Array<__type>",
|
|
500
|
+
value: input.claims
|
|
501
|
+
})) && input.claims.map((elem, _index3) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
502
|
+
path: _path + ".claims[" + _index3 + "]",
|
|
503
|
+
expected: "__type",
|
|
504
|
+
value: elem
|
|
505
|
+
})) && $vo2(elem, _path + ".claims[" + _index3 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
506
|
+
path: _path + ".claims[" + _index3 + "]",
|
|
507
|
+
expected: "__type",
|
|
508
|
+
value: elem
|
|
509
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
510
|
+
path: _path + ".claims",
|
|
511
|
+
expected: "Array<__type>",
|
|
512
|
+
value: input.claims
|
|
513
|
+
})].every(flag => flag);
|
|
514
|
+
const $vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.claimId || $report(_exceptionable, {
|
|
515
|
+
path: _path + ".claimId",
|
|
516
|
+
expected: "string",
|
|
517
|
+
value: input.claimId
|
|
518
|
+
}), (Array.isArray(input.plugins) || $report(_exceptionable, {
|
|
519
|
+
path: _path + ".plugins",
|
|
520
|
+
expected: "Array<IntegrationPluginDetails<string>>",
|
|
521
|
+
value: input.plugins
|
|
522
|
+
})) && input.plugins.map((elem, _index4) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
523
|
+
path: _path + ".plugins[" + _index4 + "]",
|
|
524
|
+
expected: "IntegrationPluginDetails<string>",
|
|
525
|
+
value: elem
|
|
526
|
+
})) && $vo3(elem, _path + ".plugins[" + _index4 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
527
|
+
path: _path + ".plugins[" + _index4 + "]",
|
|
528
|
+
expected: "IntegrationPluginDetails<string>",
|
|
529
|
+
value: elem
|
|
530
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
531
|
+
path: _path + ".plugins",
|
|
532
|
+
expected: "Array<IntegrationPluginDetails<string>>",
|
|
533
|
+
value: input.plugins
|
|
534
|
+
}), undefined === input.approach || "string" === typeof input.approach || $report(_exceptionable, {
|
|
535
|
+
path: _path + ".approach",
|
|
536
|
+
expected: "(string | undefined)",
|
|
537
|
+
value: input.approach
|
|
538
|
+
})].every(flag => flag);
|
|
539
|
+
const $vo3 = (input, _path, _exceptionable = true) => [("object" === typeof input.publicState && null !== input.publicState && false === Array.isArray(input.publicState) || $report(_exceptionable, {
|
|
540
|
+
path: _path + ".publicState",
|
|
541
|
+
expected: "__type.o1",
|
|
542
|
+
value: input.publicState
|
|
543
|
+
})) && $vo4(input.publicState, _path + ".publicState", true && _exceptionable) || $report(_exceptionable, {
|
|
544
|
+
path: _path + ".publicState",
|
|
545
|
+
expected: "__type.o1",
|
|
546
|
+
value: input.publicState
|
|
547
|
+
}), undefined === input.privateState || ("object" === typeof input.privateState && null !== input.privateState && false === Array.isArray(input.privateState) || $report(_exceptionable, {
|
|
548
|
+
path: _path + ".privateState",
|
|
549
|
+
expected: "(__type.o1 | undefined)",
|
|
550
|
+
value: input.privateState
|
|
551
|
+
})) && $vo4(input.privateState, _path + ".privateState", true && _exceptionable) || $report(_exceptionable, {
|
|
552
|
+
path: _path + ".privateState",
|
|
553
|
+
expected: "(__type.o1 | undefined)",
|
|
554
|
+
value: input.privateState
|
|
555
|
+
}), undefined === input.resetState || "boolean" === typeof input.resetState || $report(_exceptionable, {
|
|
556
|
+
path: _path + ".resetState",
|
|
557
|
+
expected: "(boolean | undefined)",
|
|
558
|
+
value: input.resetState
|
|
559
|
+
}), undefined === input.newState || ("object" === typeof input.newState && null !== input.newState && false === Array.isArray(input.newState) || $report(_exceptionable, {
|
|
560
|
+
path: _path + ".newState",
|
|
561
|
+
expected: "(__type.o1 | undefined)",
|
|
562
|
+
value: input.newState
|
|
563
|
+
})) && $vo4(input.newState, _path + ".newState", true && _exceptionable) || $report(_exceptionable, {
|
|
564
|
+
path: _path + ".newState",
|
|
565
|
+
expected: "(__type.o1 | undefined)",
|
|
566
|
+
value: input.newState
|
|
567
|
+
}), undefined === input.onlyUpdateProvidedNewState || "boolean" === typeof input.onlyUpdateProvidedNewState || $report(_exceptionable, {
|
|
568
|
+
path: _path + ".onlyUpdateProvidedNewState",
|
|
569
|
+
expected: "(boolean | undefined)",
|
|
570
|
+
value: input.onlyUpdateProvidedNewState
|
|
571
|
+
}), "string" === typeof input.instanceId || $report(_exceptionable, {
|
|
572
|
+
path: _path + ".instanceId",
|
|
573
|
+
expected: "string",
|
|
574
|
+
value: input.instanceId
|
|
575
|
+
}), "string" === typeof input.pluginId || $report(_exceptionable, {
|
|
576
|
+
path: _path + ".pluginId",
|
|
577
|
+
expected: "string",
|
|
578
|
+
value: input.pluginId
|
|
579
|
+
}), ("object" === typeof input.publicParams && null !== input.publicParams && false === Array.isArray(input.publicParams) || $report(_exceptionable, {
|
|
580
|
+
path: _path + ".publicParams",
|
|
581
|
+
expected: "__type.o1",
|
|
582
|
+
value: input.publicParams
|
|
583
|
+
})) && $vo4(input.publicParams, _path + ".publicParams", true && _exceptionable) || $report(_exceptionable, {
|
|
584
|
+
path: _path + ".publicParams",
|
|
585
|
+
expected: "__type.o1",
|
|
586
|
+
value: input.publicParams
|
|
587
|
+
}), ("object" === typeof input.privateParams && null !== input.privateParams && false === Array.isArray(input.privateParams) || $report(_exceptionable, {
|
|
588
|
+
path: _path + ".privateParams",
|
|
589
|
+
expected: "__type.o1",
|
|
590
|
+
value: input.privateParams
|
|
591
|
+
})) && $vo4(input.privateParams, _path + ".privateParams", true && _exceptionable) || $report(_exceptionable, {
|
|
592
|
+
path: _path + ".privateParams",
|
|
593
|
+
expected: "__type.o1",
|
|
594
|
+
value: input.privateParams
|
|
595
|
+
})].every(flag => flag);
|
|
596
|
+
const $vo4 = (input, _path, _exceptionable = true) => true;
|
|
597
|
+
return ("object" === typeof input && null !== input || $report(true, {
|
|
598
|
+
path: _path + "",
|
|
599
|
+
expected: "UpdateAddressListsPayload",
|
|
600
|
+
value: input
|
|
601
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
602
|
+
path: _path + "",
|
|
603
|
+
expected: "UpdateAddressListsPayload",
|
|
604
|
+
value: input
|
|
605
|
+
});
|
|
606
|
+
})(input, "$input", true);
|
|
607
|
+
}
|
|
608
|
+
const success = 0 === errors.length;
|
|
609
|
+
return {
|
|
610
|
+
success,
|
|
611
|
+
errors,
|
|
612
|
+
data: success ? input : undefined
|
|
613
|
+
};
|
|
614
|
+
})(payload ?? {});
|
|
615
|
+
if (!validateRes.success) {
|
|
616
|
+
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
617
|
+
}
|
|
618
|
+
const response = await api.axios.put(`${api.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CRUDAddressListsRoute()}`, payload);
|
|
130
619
|
return new UpdateAddressListsSuccessResponse(response.data);
|
|
131
620
|
}
|
|
132
621
|
catch (error) {
|
|
@@ -134,10 +623,53 @@ class BitBadgesAddressList extends docs_1.AddressListDoc {
|
|
|
134
623
|
return Promise.reject(error);
|
|
135
624
|
}
|
|
136
625
|
}
|
|
137
|
-
static async DeleteAddressList(api,
|
|
626
|
+
static async DeleteAddressList(api, payload) {
|
|
138
627
|
try {
|
|
628
|
+
const validateRes = (input => {
|
|
629
|
+
const errors = [];
|
|
630
|
+
const __is = input => {
|
|
631
|
+
const $io0 = input => Array.isArray(input.listIds) && input.listIds.every(elem => "string" === typeof elem);
|
|
632
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
633
|
+
};
|
|
634
|
+
if (false === __is(input)) {
|
|
635
|
+
const $report = typia_1.default.validate.report(errors);
|
|
636
|
+
((input, _path, _exceptionable = true) => {
|
|
637
|
+
const $vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.listIds) || $report(_exceptionable, {
|
|
638
|
+
path: _path + ".listIds",
|
|
639
|
+
expected: "Array<string>",
|
|
640
|
+
value: input.listIds
|
|
641
|
+
})) && input.listIds.map((elem, _index1) => "string" === typeof elem || $report(_exceptionable, {
|
|
642
|
+
path: _path + ".listIds[" + _index1 + "]",
|
|
643
|
+
expected: "string",
|
|
644
|
+
value: elem
|
|
645
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
646
|
+
path: _path + ".listIds",
|
|
647
|
+
expected: "Array<string>",
|
|
648
|
+
value: input.listIds
|
|
649
|
+
})].every(flag => flag);
|
|
650
|
+
return ("object" === typeof input && null !== input || $report(true, {
|
|
651
|
+
path: _path + "",
|
|
652
|
+
expected: "DeleteAddressListsPayload",
|
|
653
|
+
value: input
|
|
654
|
+
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
655
|
+
path: _path + "",
|
|
656
|
+
expected: "DeleteAddressListsPayload",
|
|
657
|
+
value: input
|
|
658
|
+
});
|
|
659
|
+
})(input, "$input", true);
|
|
660
|
+
}
|
|
661
|
+
const success = 0 === errors.length;
|
|
662
|
+
return {
|
|
663
|
+
success,
|
|
664
|
+
errors,
|
|
665
|
+
data: success ? input : undefined
|
|
666
|
+
};
|
|
667
|
+
})(payload ?? {});
|
|
668
|
+
if (!validateRes.success) {
|
|
669
|
+
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
670
|
+
}
|
|
139
671
|
const response = await api.axios.delete(`${api.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CRUDAddressListsRoute()}`, {
|
|
140
|
-
data:
|
|
672
|
+
data: payload
|
|
141
673
|
});
|
|
142
674
|
return new DeleteAddressListsSuccessResponse(response.data);
|
|
143
675
|
}
|