@stoker-platform/cli 0.5.61 → 0.5.64

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.
@@ -69,13 +69,13 @@ const Inbox: GenerateSchema = (sdk, utils, context): CollectionSchema => {
69
69
  retentionPeriod: 7,
70
70
  },
71
71
  custom: {
72
- async postRead(_context, _refs, record?: StokerRecord) {
72
+ async postRead({ doc }) {
73
73
  if (sdk === "web") {
74
- if (record && record.Status === "Unread" && !record.Notified && !toasted.includes(record.id)) {
75
- toasted.push(record.id)
74
+ if (doc && doc.Status === "Unread" && !doc.Notified && !toasted.includes(doc.id)) {
75
+ toasted.push(doc.id)
76
76
  const { updateRecord } = await import("@stoker-platform/web-client")
77
- toast({ title: "New Message", description: record.Subject, duration: 10000000 })
78
- updateRecord(["Inbox"], record.id, {
77
+ toast({ title: "New Message", description: doc.Subject, duration: 10000000 })
78
+ updateRecord(["Inbox"], doc.id, {
79
79
  Notified: true,
80
80
  })
81
81
  }
@@ -41,12 +41,12 @@ const Outbox: GenerateSchema = (sdk: "web" | "node"): CollectionSchema => {
41
41
  retentionPeriod: 7,
42
42
  },
43
43
  custom: {
44
- async preWrite(operation, data) {
44
+ async preWrite({ operation, data }) {
45
45
  if (operation === "create") {
46
46
  data.Status = "Sending"
47
47
  }
48
48
  },
49
- async postWrite(operation, data) {
49
+ async postWrite({ operation, data }) {
50
50
  if (operation === "create") {
51
51
  if (sdk === "web") {
52
52
  const { addRecord, updateRecord, getCurrentUser } = await import("@stoker-platform/web-client")
@@ -163,7 +163,7 @@ const globalConfig: GenerateGlobalConfig = (sdk, utils, context): GlobalConfig =
163
163
  }
164
164
  },
165
165
  },
166
- async postWriteError(operation, _data, docId, context, error) {
166
+ async postWriteError({ operation, docId, context, error }) {
167
167
  if (sdk === "web") {
168
168
  const { sendAdminEmail } = await import("@stoker-platform/web-client")
169
169
  const { getAuth } = await import("firebase/auth")
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.60",
3
+ "version": "0.5.63",
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.3.2",
27
- "@stoker-platform/node-client": "0.5.45",
28
- "@stoker-platform/types": "0.5.28",
29
- "@stoker-platform/utils": "0.5.37",
27
+ "@stoker-platform/node-client": "0.5.46",
28
+ "@stoker-platform/types": "0.5.29",
29
+ "@stoker-platform/utils": "0.5.38",
30
30
  "algoliasearch": "^5.50.0",
31
31
  "commander": "^14.0.0",
32
32
  "cross-spawn": "^7.0.6",
@@ -1489,12 +1489,12 @@ export const lintSchema = async (noLog = false) => {
1489
1489
  if (filter.roles && !filter.roles.includes(role))
1490
1490
  continue;
1491
1491
  if (filter.type === "relation" && hasArrayContains) {
1492
- errors.push(`Collection ${collectionName} has a relation filter for role ${role} on field ${filter.field} that uses an array contains filter, but an array-contains filter has already been used. This can be resolved by using the preload cache.`);
1492
+ errors.push(`Collection ${collectionName} has a relation filter for role ${role} on field ${filter.field} that uses an array-contains filter, but an array-contains filter has already been used. This can be resolved by using the preload cache.`);
1493
1493
  }
1494
1494
  if (filter.type === "select") {
1495
1495
  const field = getField(fields, filter.field);
1496
1496
  if (field.type === "Array" && hasArrayContains) {
1497
- errors.push(`Collection ${collectionName} has a select filter for role ${role} on field ${filter.field} that uses an array contains filter, but an array-contains filter has already been used. This can be resolved by using the preload cache.`);
1497
+ errors.push(`Collection ${collectionName} has a select filter for role ${role} on field ${filter.field} that uses an array-contains filter, but an array-contains filter has already been used. This can be resolved by using the preload cache.`);
1498
1498
  }
1499
1499
  }
1500
1500
  }
@@ -59,9 +59,7 @@ export const securityReport = async () => {
59
59
  roles[role] = {};
60
60
  for (const [collectionName, collectionSchema] of Object.entries(schema.collections)) {
61
61
  const { fields, access } = collectionSchema;
62
- if (access.operations.assignable === true ||
63
- (typeof access.operations.assignable === "object" && access.operations.assignable.includes(role)) ||
64
- access.operations.read?.includes(role)) {
62
+ if (access.operations.read?.includes(role)) {
65
63
  for (const field of fields) {
66
64
  if (field.access)
67
65
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.61",
3
+ "version": "0.5.64",
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.3.2",
27
- "@stoker-platform/node-client": "0.5.45",
28
- "@stoker-platform/types": "0.5.28",
29
- "@stoker-platform/utils": "0.5.37",
27
+ "@stoker-platform/node-client": "0.5.46",
28
+ "@stoker-platform/types": "0.5.29",
29
+ "@stoker-platform/utils": "0.5.38",
30
30
  "algoliasearch": "^5.50.0",
31
31
  "commander": "^14.0.0",
32
32
  "cross-spawn": "^7.0.6",