payload 3.67.0-internal.1ea538b → 3.67.0-internal.87c53da
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/dist/index.bundled.d.ts +1 -0
- package/dist/query-presets/config.d.ts.map +1 -1
- package/dist/query-presets/config.js +13 -1
- package/dist/query-presets/config.js.map +1 -1
- package/dist/query-presets/types.d.ts +1 -0
- package/dist/query-presets/types.d.ts.map +1 -1
- package/dist/query-presets/types.js.map +1 -1
- package/package.json +2 -2
package/dist/index.bundled.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/query-presets/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAShD,eAAO,MAAM,0BAA0B,0BAA0B,CAAA;AAEjE,eAAO,MAAM,qBAAqB,WAAY,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/query-presets/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAShD,eAAO,MAAM,0BAA0B,0BAA0B,CAAA;AAEjE,eAAO,MAAM,qBAAqB,WAAY,MAAM,KAAG,gBA4KrD,CAAA"}
|
|
@@ -13,7 +13,8 @@ export const getQueryPresetsConfig = (config)=>({
|
|
|
13
13
|
'isShared',
|
|
14
14
|
'access',
|
|
15
15
|
'where',
|
|
16
|
-
'columns'
|
|
16
|
+
'columns',
|
|
17
|
+
'groupBy'
|
|
17
18
|
],
|
|
18
19
|
hidden: true,
|
|
19
20
|
useAsTitle: 'title'
|
|
@@ -87,6 +88,17 @@ export const getQueryPresetsConfig = (config)=>({
|
|
|
87
88
|
return true;
|
|
88
89
|
}
|
|
89
90
|
},
|
|
91
|
+
{
|
|
92
|
+
name: 'groupBy',
|
|
93
|
+
type: 'text',
|
|
94
|
+
admin: {
|
|
95
|
+
components: {
|
|
96
|
+
Cell: '@payloadcms/ui#QueryPresetsGroupByCell',
|
|
97
|
+
Field: '@payloadcms/ui#QueryPresetsGroupByField'
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
label: 'Group By'
|
|
101
|
+
},
|
|
90
102
|
{
|
|
91
103
|
name: 'relatedCollection',
|
|
92
104
|
type: 'select',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/query-presets/config.ts"],"sourcesContent":["import type { CollectionConfig } from '../collections/config/types.js'\nimport type { Config } from '../config/types.js'\nimport type { Option } from '../fields/config/types.js'\n\nimport { transformWhereQuery } from '../utilities/transformWhereQuery.js'\nimport { validateWhereQuery } from '../utilities/validateWhereQuery.js'\nimport { getAccess } from './access.js'\nimport { getConstraints } from './constraints.js'\nimport { operations, type QueryPreset } from './types.js'\n\nexport const queryPresetsCollectionSlug = 'payload-query-presets'\n\nexport const getQueryPresetsConfig = (config: Config): CollectionConfig => ({\n slug: queryPresetsCollectionSlug,\n access: getAccess(config),\n admin: {\n defaultColumns: ['title', 'isShared', 'access', 'where', 'columns'],\n hidden: true,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'isShared',\n type: 'checkbox',\n defaultValue: false,\n validate: (isShared, { data }) => {\n const typedData = data as QueryPreset\n\n // ensure the `isShared` is only true if all constraints are 'onlyMe'\n if (typedData?.access) {\n const someOperationsAreShared = Object.values(typedData.access).some(\n (operation) => operation.constraint !== 'onlyMe',\n )\n\n if (!isShared && someOperationsAreShared) {\n return 'If any constraint is not \"onlyMe\", the preset must be shared'\n }\n }\n\n return true\n },\n },\n getConstraints(config),\n {\n name: 'where',\n type: 'json',\n admin: {\n components: {\n Cell: '@payloadcms/ui#QueryPresetsWhereCell',\n Field: '@payloadcms/ui#QueryPresetsWhereField',\n },\n },\n hooks: {\n beforeValidate: [\n ({ data }) => {\n // transform the \"where\" query here so that the client-side doesn't have to\n if (data?.where) {\n if (validateWhereQuery(data.where)) {\n return data.where\n } else {\n return transformWhereQuery(data.where)\n }\n }\n\n return data?.where\n },\n ],\n },\n label: 'Filters',\n },\n {\n name: 'columns',\n type: 'json',\n admin: {\n components: {\n Cell: '@payloadcms/ui#QueryPresetsColumnsCell',\n Field: '@payloadcms/ui#QueryPresetsColumnField',\n },\n },\n validate: (value) => {\n if (value) {\n try {\n JSON.parse(JSON.stringify(value))\n } catch {\n return 'Invalid JSON'\n }\n }\n\n return true\n },\n },\n {\n name: 'relatedCollection',\n type: 'select',\n admin: {\n hidden: true,\n },\n options: config.collections\n ? config.collections.reduce((acc, collection) => {\n if (collection.enableQueryPresets) {\n acc.push({\n label: collection.labels?.plural || collection.slug,\n value: collection.slug,\n })\n }\n return acc\n }, [] as Option[])\n : [],\n required: true,\n },\n {\n name: 'isTemp',\n type: 'checkbox',\n admin: {\n description:\n \"This is a temporary field used to determine if updating the preset would remove the user's access to it. When `true`, this record will be deleted after running the preset's `validate` function.\",\n disabled: true,\n hidden: true,\n },\n },\n ],\n hooks: {\n beforeValidate: [\n ({ data, operation }) => {\n // TODO: type this\n const typedData = data as any\n\n if (operation === 'create' || operation === 'update') {\n // Ensure all operations have a constraint\n operations.forEach((operation) => {\n if (!typedData.access) {\n typedData.access = {}\n }\n\n if (!typedData.access?.[operation]) {\n typedData[operation] = {}\n }\n\n // Ensure all operations have a constraint\n if (!typedData.access[operation]?.constraint) {\n typedData.access[operation] = {\n ...typedData.access[operation],\n constraint: 'onlyMe',\n }\n }\n })\n\n // If at least one constraint is not `onlyMe` then `isShared` must be true\n if (typedData?.access) {\n const someOperationsAreShared = Object.values(typedData.access).some(\n // TODO: remove the `any` here\n (operation: any) => operation.constraint !== 'onlyMe',\n )\n\n typedData.isShared = someOperationsAreShared\n }\n }\n\n return typedData\n },\n ],\n },\n labels: {\n plural: 'Presets',\n singular: 'Preset',\n ...(config.queryPresets?.labels || {}),\n },\n lockDocuments: false,\n})\n"],"names":["transformWhereQuery","validateWhereQuery","getAccess","getConstraints","operations","queryPresetsCollectionSlug","getQueryPresetsConfig","config","slug","access","admin","defaultColumns","hidden","useAsTitle","fields","name","type","required","defaultValue","validate","isShared","data","typedData","someOperationsAreShared","Object","values","some","operation","constraint","components","Cell","Field","hooks","beforeValidate","where","label","value","JSON","parse","stringify","options","collections","reduce","acc","collection","enableQueryPresets","push","labels","plural","description","disabled","forEach","singular","queryPresets","lockDocuments"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,sCAAqC;AACzE,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,SAAS,QAAQ,cAAa;AACvC,SAASC,cAAc,QAAQ,mBAAkB;AACjD,SAASC,UAAU,QAA0B,aAAY;AAEzD,OAAO,MAAMC,6BAA6B,wBAAuB;AAEjE,OAAO,MAAMC,wBAAwB,CAACC,SAAsC,CAAA;QAC1EC,MAAMH;QACNI,QAAQP,UAAUK;QAClBG,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAY;gBAAU;gBAAS;aAAU;
|
|
1
|
+
{"version":3,"sources":["../../src/query-presets/config.ts"],"sourcesContent":["import type { CollectionConfig } from '../collections/config/types.js'\nimport type { Config } from '../config/types.js'\nimport type { Option } from '../fields/config/types.js'\n\nimport { transformWhereQuery } from '../utilities/transformWhereQuery.js'\nimport { validateWhereQuery } from '../utilities/validateWhereQuery.js'\nimport { getAccess } from './access.js'\nimport { getConstraints } from './constraints.js'\nimport { operations, type QueryPreset } from './types.js'\n\nexport const queryPresetsCollectionSlug = 'payload-query-presets'\n\nexport const getQueryPresetsConfig = (config: Config): CollectionConfig => ({\n slug: queryPresetsCollectionSlug,\n access: getAccess(config),\n admin: {\n defaultColumns: ['title', 'isShared', 'access', 'where', 'columns', 'groupBy'],\n hidden: true,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'isShared',\n type: 'checkbox',\n defaultValue: false,\n validate: (isShared, { data }) => {\n const typedData = data as QueryPreset\n\n // ensure the `isShared` is only true if all constraints are 'onlyMe'\n if (typedData?.access) {\n const someOperationsAreShared = Object.values(typedData.access).some(\n (operation) => operation.constraint !== 'onlyMe',\n )\n\n if (!isShared && someOperationsAreShared) {\n return 'If any constraint is not \"onlyMe\", the preset must be shared'\n }\n }\n\n return true\n },\n },\n getConstraints(config),\n {\n name: 'where',\n type: 'json',\n admin: {\n components: {\n Cell: '@payloadcms/ui#QueryPresetsWhereCell',\n Field: '@payloadcms/ui#QueryPresetsWhereField',\n },\n },\n hooks: {\n beforeValidate: [\n ({ data }) => {\n // transform the \"where\" query here so that the client-side doesn't have to\n if (data?.where) {\n if (validateWhereQuery(data.where)) {\n return data.where\n } else {\n return transformWhereQuery(data.where)\n }\n }\n\n return data?.where\n },\n ],\n },\n label: 'Filters',\n },\n {\n name: 'columns',\n type: 'json',\n admin: {\n components: {\n Cell: '@payloadcms/ui#QueryPresetsColumnsCell',\n Field: '@payloadcms/ui#QueryPresetsColumnField',\n },\n },\n validate: (value) => {\n if (value) {\n try {\n JSON.parse(JSON.stringify(value))\n } catch {\n return 'Invalid JSON'\n }\n }\n\n return true\n },\n },\n {\n name: 'groupBy',\n type: 'text',\n admin: {\n components: {\n Cell: '@payloadcms/ui#QueryPresetsGroupByCell',\n Field: '@payloadcms/ui#QueryPresetsGroupByField',\n },\n },\n label: 'Group By',\n },\n {\n name: 'relatedCollection',\n type: 'select',\n admin: {\n hidden: true,\n },\n options: config.collections\n ? config.collections.reduce((acc, collection) => {\n if (collection.enableQueryPresets) {\n acc.push({\n label: collection.labels?.plural || collection.slug,\n value: collection.slug,\n })\n }\n return acc\n }, [] as Option[])\n : [],\n required: true,\n },\n {\n name: 'isTemp',\n type: 'checkbox',\n admin: {\n description:\n \"This is a temporary field used to determine if updating the preset would remove the user's access to it. When `true`, this record will be deleted after running the preset's `validate` function.\",\n disabled: true,\n hidden: true,\n },\n },\n ],\n hooks: {\n beforeValidate: [\n ({ data, operation }) => {\n // TODO: type this\n const typedData = data as any\n\n if (operation === 'create' || operation === 'update') {\n // Ensure all operations have a constraint\n operations.forEach((operation) => {\n if (!typedData.access) {\n typedData.access = {}\n }\n\n if (!typedData.access?.[operation]) {\n typedData[operation] = {}\n }\n\n // Ensure all operations have a constraint\n if (!typedData.access[operation]?.constraint) {\n typedData.access[operation] = {\n ...typedData.access[operation],\n constraint: 'onlyMe',\n }\n }\n })\n\n // If at least one constraint is not `onlyMe` then `isShared` must be true\n if (typedData?.access) {\n const someOperationsAreShared = Object.values(typedData.access).some(\n // TODO: remove the `any` here\n (operation: any) => operation.constraint !== 'onlyMe',\n )\n\n typedData.isShared = someOperationsAreShared\n }\n }\n\n return typedData\n },\n ],\n },\n labels: {\n plural: 'Presets',\n singular: 'Preset',\n ...(config.queryPresets?.labels || {}),\n },\n lockDocuments: false,\n})\n"],"names":["transformWhereQuery","validateWhereQuery","getAccess","getConstraints","operations","queryPresetsCollectionSlug","getQueryPresetsConfig","config","slug","access","admin","defaultColumns","hidden","useAsTitle","fields","name","type","required","defaultValue","validate","isShared","data","typedData","someOperationsAreShared","Object","values","some","operation","constraint","components","Cell","Field","hooks","beforeValidate","where","label","value","JSON","parse","stringify","options","collections","reduce","acc","collection","enableQueryPresets","push","labels","plural","description","disabled","forEach","singular","queryPresets","lockDocuments"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,sCAAqC;AACzE,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,SAAS,QAAQ,cAAa;AACvC,SAASC,cAAc,QAAQ,mBAAkB;AACjD,SAASC,UAAU,QAA0B,aAAY;AAEzD,OAAO,MAAMC,6BAA6B,wBAAuB;AAEjE,OAAO,MAAMC,wBAAwB,CAACC,SAAsC,CAAA;QAC1EC,MAAMH;QACNI,QAAQP,UAAUK;QAClBG,O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AAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;IAC3B,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/query-presets/types.ts"],"sourcesContent":["import type { Field } from '../fields/config/types.js'\nimport type { Access, CollectionSlug } from '../index.js'\nimport type { CollectionPreferences } from '../preferences/types.js'\nimport type { Where } from '../types/index.js'\n\n// Note: order matters here as it will change the rendered order in the UI\nexport const operations = ['read', 'update', 'delete'] as const\n\nexport type ConstraintOperation = (typeof operations)[number]\n\nexport type DefaultConstraint = 'everyone' | 'onlyMe' | 'specificUsers'\n\nexport type Constraint = DefaultConstraint | string // TODO: type `string` as the custom constraints provided by the config\n\nexport type QueryPreset = {\n access: {\n [operation in ConstraintOperation]: {\n constraint: DefaultConstraint\n users?: string[]\n }\n }\n columns: CollectionPreferences['columns']\n id: number | string\n isShared: boolean\n relatedCollection: CollectionSlug\n title: string\n where: Where\n}\n\nexport type QueryPresetConstraint = {\n access: Access<QueryPreset>\n fields?: Field[]\n label: string\n value: string\n}\n\nexport type QueryPresetConstraints = QueryPresetConstraint[]\n"],"names":["operations"],"mappings":"AAKA,0EAA0E;AAC1E,OAAO,MAAMA,aAAa;IAAC;IAAQ;IAAU;CAAS,CAAS"}
|
|
1
|
+
{"version":3,"sources":["../../src/query-presets/types.ts"],"sourcesContent":["import type { Field } from '../fields/config/types.js'\nimport type { Access, CollectionSlug } from '../index.js'\nimport type { CollectionPreferences } from '../preferences/types.js'\nimport type { Where } from '../types/index.js'\n\n// Note: order matters here as it will change the rendered order in the UI\nexport const operations = ['read', 'update', 'delete'] as const\n\nexport type ConstraintOperation = (typeof operations)[number]\n\nexport type DefaultConstraint = 'everyone' | 'onlyMe' | 'specificUsers'\n\nexport type Constraint = DefaultConstraint | string // TODO: type `string` as the custom constraints provided by the config\n\nexport type QueryPreset = {\n access: {\n [operation in ConstraintOperation]: {\n constraint: DefaultConstraint\n users?: string[]\n }\n }\n columns: CollectionPreferences['columns']\n groupBy?: string\n id: number | string\n isShared: boolean\n relatedCollection: CollectionSlug\n title: string\n where: Where\n}\n\nexport type QueryPresetConstraint = {\n access: Access<QueryPreset>\n fields?: Field[]\n label: string\n value: string\n}\n\nexport type QueryPresetConstraints = QueryPresetConstraint[]\n"],"names":["operations"],"mappings":"AAKA,0EAA0E;AAC1E,OAAO,MAAMA,aAAa;IAAC;IAAQ;IAAU;CAAS,CAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload",
|
|
3
|
-
"version": "3.67.0-internal.
|
|
3
|
+
"version": "3.67.0-internal.87c53da",
|
|
4
4
|
"description": "Node, React, Headless CMS and Application Framework built on Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin panel",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"undici": "7.10.0",
|
|
107
107
|
"uuid": "10.0.0",
|
|
108
108
|
"ws": "^8.16.0",
|
|
109
|
-
"@payloadcms/translations": "3.67.0-internal.
|
|
109
|
+
"@payloadcms/translations": "3.67.0-internal.87c53da"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
|