@stoker-platform/cli 0.5.41 → 0.5.43
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/lib/package.json +4 -4
- package/lib/src/lint/lintSchema.js +18 -0
- package/package.json +4 -4
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoker-platform/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.43",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"main": "./lib/src/main.js",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@google-cloud/secret-manager": "^6.1.1",
|
|
25
25
|
"@google-cloud/storage": "^7.19.0",
|
|
26
26
|
"@inquirer/prompts": "^8.2.0",
|
|
27
|
-
"@stoker-platform/node-client": "0.5.
|
|
28
|
-
"@stoker-platform/types": "0.5.
|
|
29
|
-
"@stoker-platform/utils": "0.5.
|
|
27
|
+
"@stoker-platform/node-client": "0.5.32",
|
|
28
|
+
"@stoker-platform/types": "0.5.20",
|
|
29
|
+
"@stoker-platform/utils": "0.5.26",
|
|
30
30
|
"algoliasearch": "^5.48.0",
|
|
31
31
|
"commander": "^14.0.0",
|
|
32
32
|
"cross-spawn": "^7.0.6",
|
|
@@ -648,6 +648,24 @@ export const lintSchema = async (noLog = false) => {
|
|
|
648
648
|
if (rangeFilters && rangeFilters.length > 1) {
|
|
649
649
|
errors.push(`Collection ${collectionName} has more than one range filter`);
|
|
650
650
|
}
|
|
651
|
+
const assignable = (await tryPromise(customization?.admin?.assignable));
|
|
652
|
+
if (assignable) {
|
|
653
|
+
for (const assignableItem of assignable) {
|
|
654
|
+
if (!collectionNames.includes(assignableItem.collection)) {
|
|
655
|
+
errors.push(`Collection ${collectionName} has an assignable collection ${assignableItem.collection} that does not exist`);
|
|
656
|
+
}
|
|
657
|
+
else if (assignableItem.unavailableField) {
|
|
658
|
+
const relationCollection = schema.collections[assignableItem.collection];
|
|
659
|
+
const unavailableFieldSchema = getField(relationCollection.fields, assignableItem.unavailableField);
|
|
660
|
+
if (!unavailableFieldSchema) {
|
|
661
|
+
errors.push(`Collection ${collectionName} has an assignable unavailable field ${assignableItem.unavailableField} that does not exist`);
|
|
662
|
+
}
|
|
663
|
+
else if (unavailableFieldSchema.type !== "String" || !unavailableFieldSchema.values) {
|
|
664
|
+
errors.push(`Collection ${collectionName} has an assignable unavailable field ${assignableItem.unavailableField} that is not a string field with values set`);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
651
669
|
const { auth: authAccess, operations, attributeRestrictions, entityRestrictions, permissionWriteRestrictions, serverReadOnly, serverWriteOnly, files, } = access;
|
|
652
670
|
if (authAccess) {
|
|
653
671
|
for (const role of authAccess) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoker-platform/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.43",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"main": "./lib/src/main.js",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@google-cloud/secret-manager": "^6.1.1",
|
|
25
25
|
"@google-cloud/storage": "^7.19.0",
|
|
26
26
|
"@inquirer/prompts": "^8.2.0",
|
|
27
|
-
"@stoker-platform/node-client": "0.5.
|
|
28
|
-
"@stoker-platform/types": "0.5.
|
|
29
|
-
"@stoker-platform/utils": "0.5.
|
|
27
|
+
"@stoker-platform/node-client": "0.5.32",
|
|
28
|
+
"@stoker-platform/types": "0.5.20",
|
|
29
|
+
"@stoker-platform/utils": "0.5.26",
|
|
30
30
|
"algoliasearch": "^5.48.0",
|
|
31
31
|
"commander": "^14.0.0",
|
|
32
32
|
"cross-spawn": "^7.0.6",
|