@stoker-platform/cli 0.5.127 → 0.5.128

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.126",
3
+ "version": "0.5.128",
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.2",
25
25
  "@google-cloud/storage": "^7.19.0",
26
26
  "@inquirer/prompts": "^8.5.2",
27
- "@stoker-platform/node-client": "0.5.79",
28
- "@stoker-platform/types": "0.5.58",
29
- "@stoker-platform/utils": "0.5.70",
27
+ "@stoker-platform/node-client": "0.5.81",
28
+ "@stoker-platform/types": "0.5.60",
29
+ "@stoker-platform/utils": "0.5.72",
30
30
  "algoliasearch": "^5.53.0",
31
31
  "commander": "^15.0.0",
32
32
  "cross-spawn": "^7.0.6",
@@ -300,11 +300,6 @@ export const lintSchema = async (noLog = false) => {
300
300
  errors.push(`Collection ${collectionName} has a relation list field ${relation.field} for collection ${relation.collection} with access restrictions`);
301
301
  }
302
302
  }
303
- if (relation.loadAll) {
304
- if (!["OneToOne", "OneToMany"].includes(relationField.type)) {
305
- errors.push(`Collection ${collectionName} has a relation list for collection ${relation.collection} that has loadAll enabled but is not a one to one or one to many field`);
306
- }
307
- }
308
303
  }
309
304
  }
310
305
  }
@@ -1519,6 +1514,20 @@ export const lintSchema = async (noLog = false) => {
1519
1514
  }
1520
1515
  }
1521
1516
  }
1517
+ if (hasArrayContains && preloadCache?.roles.includes(role)) {
1518
+ for (const [parentCollectionName, parentCollectionSchema] of collectionSchemas) {
1519
+ for (const relation of parentCollectionSchema.relationLists || []) {
1520
+ if (!relation.loadAll || relation.collection !== collectionName)
1521
+ continue;
1522
+ if (relation.roles && !relation.roles.includes(role))
1523
+ continue;
1524
+ const relationField = getField(fields, relation.field);
1525
+ if (!relationField || !["ManyToOne", "ManyToMany"].includes(relationField.type))
1526
+ continue;
1527
+ errors.push(`Collection ${parentCollectionName} has a loadAll relation list on collection ${collectionName} using field ${relation.field} of relation type ${relationField.type}, for role ${role}. An array-contains filter has already been used for that collection (for access restrictions).`);
1528
+ }
1529
+ }
1530
+ }
1522
1531
  const batchSize = disjunctions === 0 ? 30 : Math.max(1, Math.floor(30 / disjunctions));
1523
1532
  if (disjunctions > 30) {
1524
1533
  errors.push(`Collection ${collectionName} for role ${role} has ${disjunctions} disjunctions. The limit set by Firestore is 30.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.127",
3
+ "version": "0.5.128",
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.2",
25
25
  "@google-cloud/storage": "^7.19.0",
26
26
  "@inquirer/prompts": "^8.5.2",
27
- "@stoker-platform/node-client": "0.5.80",
28
- "@stoker-platform/types": "0.5.59",
29
- "@stoker-platform/utils": "0.5.71",
27
+ "@stoker-platform/node-client": "0.5.81",
28
+ "@stoker-platform/types": "0.5.60",
29
+ "@stoker-platform/utils": "0.5.72",
30
30
  "algoliasearch": "^5.53.0",
31
31
  "commander": "^15.0.0",
32
32
  "cross-spawn": "^7.0.6",