@sonoransoftware/sonoran.js 1.0.59 → 1.0.60
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.
|
@@ -392,7 +392,7 @@ class CADManager extends BaseManager_1.BaseManager {
|
|
|
392
392
|
if (!Number.isInteger(entry.serverId)) {
|
|
393
393
|
throw new Error(`entries[${index}].serverId must be an integer.`);
|
|
394
394
|
}
|
|
395
|
-
if (!Array.isArray(entry.identIds) || entry.identIds.
|
|
395
|
+
if (!Array.isArray(entry.identIds) || entry.identIds.some((id) => !Number.isInteger(id))) {
|
|
396
396
|
throw new Error(`entries[${index}].identIds must be an array of integers.`);
|
|
397
397
|
}
|
|
398
398
|
if (typeof entry.groupName !== 'string') {
|
|
@@ -401,6 +401,9 @@ class CADManager extends BaseManager_1.BaseManager {
|
|
|
401
401
|
if (entry.account !== undefined && typeof entry.account !== 'string') {
|
|
402
402
|
throw new Error(`entries[${index}].account must be a string when provided.`);
|
|
403
403
|
}
|
|
404
|
+
if (entry.identIds.length === 0 && !entry.account) {
|
|
405
|
+
throw new Error(`entries[${index}] must include account or at least one identId.`);
|
|
406
|
+
}
|
|
404
407
|
});
|
|
405
408
|
return this.executeCadRequest('IDENTS_TO_GROUP', payload);
|
|
406
409
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonoransoftware/sonoran.js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.60",
|
|
4
4
|
"description": "Sonoran.js is a library that allows you to interact with the Sonoran CAD and Sonoran CMS API. Based off of and utilizes several Discord.js library techniques for ease of use.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -418,7 +418,7 @@ export class CADManager extends BaseManager {
|
|
|
418
418
|
if (!Number.isInteger(entry.serverId)) {
|
|
419
419
|
throw new Error(`entries[${index}].serverId must be an integer.`);
|
|
420
420
|
}
|
|
421
|
-
if (!Array.isArray(entry.identIds) || entry.identIds.
|
|
421
|
+
if (!Array.isArray(entry.identIds) || entry.identIds.some((id) => !Number.isInteger(id))) {
|
|
422
422
|
throw new Error(`entries[${index}].identIds must be an array of integers.`);
|
|
423
423
|
}
|
|
424
424
|
if (typeof entry.groupName !== 'string') {
|
|
@@ -427,6 +427,9 @@ export class CADManager extends BaseManager {
|
|
|
427
427
|
if (entry.account !== undefined && typeof entry.account !== 'string') {
|
|
428
428
|
throw new Error(`entries[${index}].account must be a string when provided.`);
|
|
429
429
|
}
|
|
430
|
+
if (entry.identIds.length === 0 && !entry.account) {
|
|
431
|
+
throw new Error(`entries[${index}] must include account or at least one identId.`);
|
|
432
|
+
}
|
|
430
433
|
});
|
|
431
434
|
return this.executeCadRequest('IDENTS_TO_GROUP', payload);
|
|
432
435
|
}
|