@sonoransoftware/sonoran.js 1.0.58 → 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,12 +392,18 @@ 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') {
|
|
399
399
|
throw new Error(`entries[${index}].groupName must be a string (use '' to clear).`);
|
|
400
400
|
}
|
|
401
|
+
if (entry.account !== undefined && typeof entry.account !== 'string') {
|
|
402
|
+
throw new Error(`entries[${index}].account must be a string when provided.`);
|
|
403
|
+
}
|
|
404
|
+
if (entry.identIds.length === 0 && !entry.account) {
|
|
405
|
+
throw new Error(`entries[${index}] must include account or at least one identId.`);
|
|
406
|
+
}
|
|
401
407
|
});
|
|
402
408
|
return this.executeCadRequest('IDENTS_TO_GROUP', payload);
|
|
403
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,12 +418,18 @@ 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') {
|
|
425
425
|
throw new Error(`entries[${index}].groupName must be a string (use '' to clear).`);
|
|
426
426
|
}
|
|
427
|
+
if (entry.account !== undefined && typeof entry.account !== 'string') {
|
|
428
|
+
throw new Error(`entries[${index}].account must be a string when provided.`);
|
|
429
|
+
}
|
|
430
|
+
if (entry.identIds.length === 0 && !entry.account) {
|
|
431
|
+
throw new Error(`entries[${index}] must include account or at least one identId.`);
|
|
432
|
+
}
|
|
427
433
|
});
|
|
428
434
|
return this.executeCadRequest('IDENTS_TO_GROUP', payload);
|
|
429
435
|
}
|