@payloadcms/db-postgres 3.0.0-alpha.18 → 3.0.0-alpha.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/dist/connect.js +17 -32
  2. package/dist/create.js +6 -21
  3. package/dist/createGlobal.js +6 -21
  4. package/dist/createGlobalVersion.js +10 -25
  5. package/dist/createMigration.js +11 -26
  6. package/dist/createVersion.js +10 -25
  7. package/dist/deleteMany.js +8 -23
  8. package/dist/deleteOne.js +10 -25
  9. package/dist/deleteVersions.js +10 -25
  10. package/dist/destroy.js +2 -12
  11. package/dist/find/buildFindManyArgs.js +6 -14
  12. package/dist/find/chainMethods.js +2 -11
  13. package/dist/find/findMany.js +14 -29
  14. package/dist/find/traverseFields.js +8 -23
  15. package/dist/find.js +6 -21
  16. package/dist/findGlobal.js +6 -21
  17. package/dist/findGlobalVersions.js +8 -23
  18. package/dist/findOne.js +6 -21
  19. package/dist/findVersions.js +8 -23
  20. package/dist/index.js +72 -87
  21. package/dist/init.js +17 -32
  22. package/dist/migrate.js +15 -30
  23. package/dist/migrateDown.js +12 -22
  24. package/dist/migrateFresh.js +15 -28
  25. package/dist/migrateRefresh.js +18 -26
  26. package/dist/migrateReset.js +13 -21
  27. package/dist/migrateStatus.js +9 -19
  28. package/dist/queries/buildAndOrConditions.js +4 -14
  29. package/dist/queries/buildQuery.js +10 -20
  30. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +4 -14
  31. package/dist/queries/createJSONQuery/formatJSONPathSegment.js +2 -12
  32. package/dist/queries/createJSONQuery/index.js +6 -16
  33. package/dist/queries/getTableColumnFromPath.js +38 -49
  34. package/dist/queries/operatorMap.js +17 -27
  35. package/dist/queries/parseParams.js +32 -42
  36. package/dist/queries/sanitizeQueryValue.js +8 -18
  37. package/dist/queryDrafts.js +10 -25
  38. package/dist/schema/build.js +49 -64
  39. package/dist/schema/createIndex.js +5 -15
  40. package/dist/schema/idToUUID.js +2 -12
  41. package/dist/schema/parentIDColumnMap.js +7 -17
  42. package/dist/schema/setColumnID.js +10 -20
  43. package/dist/schema/traverseFields.js +62 -77
  44. package/dist/schema/validateExistingBlockIsIdentical.js +9 -19
  45. package/dist/transactions/beginTransaction.js +4 -14
  46. package/dist/transactions/commitTransaction.js +2 -12
  47. package/dist/transactions/rollbackTransaction.js +2 -12
  48. package/dist/transform/read/hasManyNumber.js +2 -12
  49. package/dist/transform/read/hasManyText.js +2 -12
  50. package/dist/transform/read/index.js +12 -20
  51. package/dist/transform/read/relationship.js +2 -12
  52. package/dist/transform/read/traverseFields.js +15 -23
  53. package/dist/transform/write/array.js +6 -16
  54. package/dist/transform/write/blocks.js +6 -21
  55. package/dist/transform/write/index.js +4 -14
  56. package/dist/transform/write/numbers.js +2 -12
  57. package/dist/transform/write/relationships.js +4 -14
  58. package/dist/transform/write/selects.js +4 -14
  59. package/dist/transform/write/texts.js +2 -12
  60. package/dist/transform/write/traverseFields.js +30 -45
  61. package/dist/transform/write/types.js +2 -5
  62. package/dist/types.js +2 -5
  63. package/dist/update.js +11 -26
  64. package/dist/updateGlobal.js +6 -21
  65. package/dist/updateGlobalVersion.js +10 -25
  66. package/dist/updateVersion.js +10 -25
  67. package/dist/upsertRow/deleteExistingArrayRows.js +5 -15
  68. package/dist/upsertRow/deleteExistingRowsByPath.js +9 -19
  69. package/dist/upsertRow/index.js +24 -34
  70. package/dist/upsertRow/insertArrays.js +2 -12
  71. package/dist/upsertRow/types.js +2 -5
  72. package/dist/utilities/appendPrefixToKeys.js +2 -12
  73. package/dist/utilities/createBlocksMap.js +2 -12
  74. package/dist/utilities/createMigrationTable.js +4 -14
  75. package/dist/utilities/createRelationshipMap.js +2 -12
  76. package/dist/utilities/hasLocalesTable.js +5 -15
  77. package/dist/utilities/isArrayOfRows.js +2 -12
  78. package/dist/utilities/migrationTableExists.js +4 -14
  79. package/dist/utilities/parseError.js +6 -14
  80. package/package.json +5 -4
@@ -1,28 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "deleteVersions", {
6
- enumerable: true,
7
- get: function() {
8
- return deleteVersions;
9
- }
10
- });
11
- const _drizzleorm = require("drizzle-orm");
12
- const _versions = require("payload/versions");
13
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
14
- const _findMany = require("./find/findMany");
15
- function _interop_require_default(obj) {
16
- return obj && obj.__esModule ? obj : {
17
- default: obj
18
- };
19
- }
20
- const deleteVersions = async function deleteVersion({ collection, locale, req = {}, where: where }) {
1
+ import { inArray } from 'drizzle-orm';
2
+ import { buildVersionCollectionFields } from 'payload/versions';
3
+ import toSnakeCase from 'to-snake-case';
4
+ import { findMany } from './find/findMany';
5
+ export const deleteVersions = async function deleteVersion({ collection, locale, req = {}, where: where }) {
21
6
  const db = this.sessions[req.transactionID]?.db || this.drizzle;
22
7
  const collectionConfig = this.payload.collections[collection].config;
23
- const tableName = `_${(0, _tosnakecase.default)(collection)}_v`;
24
- const fields = (0, _versions.buildVersionCollectionFields)(collectionConfig);
25
- const { docs } = await (0, _findMany.findMany)({
8
+ const tableName = `_${toSnakeCase(collection)}_v`;
9
+ const fields = buildVersionCollectionFields(collectionConfig);
10
+ const { docs } = await findMany({
26
11
  adapter: this,
27
12
  fields,
28
13
  limit: 0,
@@ -38,9 +23,9 @@ const deleteVersions = async function deleteVersion({ collection, locale, req =
38
23
  ids.push(doc.id);
39
24
  });
40
25
  if (ids.length > 0) {
41
- await db.delete(this.tables[tableName]).where((0, _drizzleorm.inArray)(this.tables[tableName].id, ids));
26
+ await db.delete(this.tables[tableName]).where(inArray(this.tables[tableName].id, ids));
42
27
  }
43
28
  return docs;
44
29
  };
45
30
 
46
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWxldGVWZXJzaW9ucy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IERlbGV0ZVZlcnNpb25zIH0gZnJvbSAncGF5bG9h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ElBQUksQ0FBQ0QsSUFBSUUsRUFBRTtJQUNqQjtJQUVBLElBQUlKLElBQUlLLE1BQU0sR0FBRyxHQUFHO1FBQ2xCLE1BQU1wQixHQUFHcUIsTUFBTSxDQUFDLElBQUksQ0FBQ0MsTUFBTSxDQUFDZCxVQUFVLEVBQUVULEtBQUssQ0FBQ1QsUUFBUSxJQUFJLENBQUNnQyxNQUFNLENBQUNkLFVBQVUsQ0FBQ1csRUFBRSxFQUFFSjtJQUNuRjtJQUVBLE9BQU9MO0FBQ1QsRUFBQyJ9
package/dist/destroy.js CHANGED
@@ -1,16 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "destroy", {
6
- enumerable: true,
7
- get: function() {
8
- return destroy;
9
- }
10
- });
11
- const destroy = async function destroy() {
1
+ export const destroy = async function destroy() {
12
2
  // TODO: this hangs test suite for some reason
13
3
  // await this.pool.end()
14
4
  };
15
5
 
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZXN0cm95LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRGVzdHJveSB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi90eXBlcydcblxuZXhwb3J0IGNvbnN0IGRlc3Ryb3k6IERlc3Ryb3kgPSBhc3luYyBmdW5jdGlvbiBkZXN0cm95KHRoaXM6IFBvc3RncmVzQWRhcHRlcikge1xuICAvLyBUT0RPOiB0aGlzIGhhbmdzIHRlc3Qgc3VpdGUgZm9yIHNvbWUgcmVhc29uXG4gIC8vIGF3YWl0IHRoaXMucG9vbC5lbmQoKVxufVxuIl0sIm5hbWVzIjpbImRlc3Ryb3kiXSwibWFwcGluZ3MiOiI7Ozs7K0JBSWFBOzs7ZUFBQUE7OztBQUFOLE1BQU1BLFVBQW1CLGVBQWVBO0FBQzdDLDhDQUE4QztBQUM5Qyx3QkFBd0I7QUFDMUIifQ==
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZXN0cm95LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRGVzdHJveSB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi90eXBlcydcblxuZXhwb3J0IGNvbnN0IGRlc3Ryb3k6IERlc3Ryb3kgPSBhc3luYyBmdW5jdGlvbiBkZXN0cm95KHRoaXM6IFBvc3RncmVzQWRhcHRlcikge1xuICAvLyBUT0RPOiB0aGlzIGhhbmdzIHRlc3Qgc3VpdGUgZm9yIHNvbWUgcmVhc29uXG4gIC8vIGF3YWl0IHRoaXMucG9vbC5lbmQoKVxufVxuIl0sIm5hbWVzIjpbImRlc3Ryb3kiXSwibWFwcGluZ3MiOiJBQUlBLE9BQU8sTUFBTUEsVUFBbUIsZUFBZUE7QUFDN0MsOENBQThDO0FBQzlDLHdCQUF3QjtBQUMxQixFQUFDIn0=
@@ -1,15 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "buildFindManyArgs", {
6
- enumerable: true,
7
- get: function() {
8
- return buildFindManyArgs;
9
- }
10
- });
11
- const _traverseFields = require("./traverseFields");
12
- const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
1
+ import { traverseFields } from './traverseFields';
2
+ // Generate the Drizzle query for findMany based on
3
+ // a collection field structure
4
+ export const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
13
5
  const result = {
14
6
  with: {}
15
7
  };
@@ -55,7 +47,7 @@ const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
55
47
  if (adapter.tables[`${tableName}_locales`]) {
56
48
  result.with._locales = _locales;
57
49
  }
58
- (0, _traverseFields.traverseFields)({
50
+ traverseFields({
59
51
  _locales,
60
52
  adapter,
61
53
  currentArgs: result,
@@ -69,4 +61,4 @@ const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
69
61
  return result;
70
62
  };
71
63
 
72
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2J1aWxkRmluZE1hbnlBcmdzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgREJRdWVyeUNvbmZpZyB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuaW1wb3J0IHR5cGUgeyBGaWVsZCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMnXG5cbmltcG9ydCB7IHRyYXZlcnNlRmllbGRzIH0gZnJvbSAnLi90cmF2ZXJzZUZpZWxkcydcblxudHlwZSBCdWlsZEZpbmRRdWVyeUFyZ3MgPSB7XG4gIGFkYXB0ZXI6IFBvc3RncmVzQWRhcHRlclxuICBkZXB0aDogbnVtYmVyXG4gIGZpZWxkczogRmllbGRbXVxuICB0YWJsZU5hbWU6IHN0cmluZ1xufVxuXG5leHBvcnQgdHlwZSBSZXN1bHQgPSBEQlF1ZXJ5Q29uZmlnPCdtYW55JywgdHJ1ZSwgYW55LCBhbnk+XG5cbi8vIEdlbmVyYXRlIHRoZSBEcml6emxlIHF1ZXJ5IGZvciBmaW5kTWFueSBiYXNlZCBvblxuLy8gYSBjb2xsZWN0aW9uIGZpZWxkIHN0cnVjdHVyZVxuZXhwb3J0IGNvbnN0IGJ1aWxkRmluZE1hbnlBcmdzID0gKHtcbiAgYWRhcHRlcixcbiAgZGVwdGgsXG4gIGZpZWxkcyxcbiAgdGFibGVOYW1lLFxufTogQnVpbGRGaW5kU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UFPQyxJQUFJLENBQUNhLEtBQUssR0FBRztZQUNsQlgsU0FBUztnQkFDUEMsSUFBSTtnQkFDSkksUUFBUTtZQUNWO1lBQ0FDLFNBQVMsQ0FBQyxFQUFFQyxLQUFLLEVBQUUsRUFBRSxFQUFFQyxLQUFLQyxHQUFHLEVBQUUsR0FBSztvQkFBQ0EsSUFBSUY7aUJBQU87UUFDcEQ7SUFDRjtJQUVBLElBQUlkLFFBQVFVLE1BQU0sQ0FBQyxDQUFDLEVBQUVQLFVBQVUsUUFBUSxDQUFDLENBQUMsRUFBRTtRQUMxQ0MsT0FBT0MsSUFBSSxDQUFDQyxRQUFRLEdBQUdBO0lBQ3pCO0lBRUFSLGVBQWU7UUFDYlE7UUFDQU47UUFDQW1CLGFBQWFmO1FBQ2JnQixrQkFBa0JqQjtRQUNsQkY7UUFDQUM7UUFDQW1CLE1BQU07UUFDTkMsY0FBY2xCO1FBQ2RtQixtQkFBbUJwQjtJQUNyQjtJQUVBLE9BQU9DO0FBQ1QsRUFBQyJ9
@@ -1,13 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "chainMethods", {
6
- enumerable: true,
7
- get: function() {
8
- return chainMethods;
9
- }
10
- });
11
1
  /**
12
2
  * Call and returning methods that would normally be chained together but cannot be because of control logic
13
3
  * @param methods
@@ -17,5 +7,6 @@ Object.defineProperty(exports, "chainMethods", {
17
7
  return query[method](...args);
18
8
  }, query);
19
9
  };
10
+ export { chainMethods };
20
11
 
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2NoYWluTWV0aG9kcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBDaGFpbmVkTWV0aG9kcyA9IHtcbiAgYXJnczogdW5rbm93bltdXG4gIG1ldGhvZDogc3RyaW5nXG59W11cblxuLyoqXG4gKiBDYWxsI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5nXG59W11cblxuLyoqXG4gKiBDYWxsIGFuZCByZXR1cm5pbmcgbWV0aG9kcyB0aGF0IHdvdWxkIG5vcm1hbGx5IGJlIGNoYWluZWQgdG9nZXRoZXIgYnV0IGNhbm5vdCBiZSBiZWNhdXNlIG9mIGNvbnRyb2wgbG9naWNcbiAqIEBwYXJhbSBtZXRob2RzXG4gKiBAcGFyYW0gcXVlcnlcbiAqL1xuY29uc3QgY2hhaW5NZXRob2RzID0gKHsgbWV0aG9kcywgcXVlcnkgfSk6IFByb21pc2U8dW5rbm93bj4gPT4ge1xuICByZXR1cm4gbWV0aG9kcy5yZWR1Y2UoKHF1ZXJ5LCB7IGFyZ3MsIG1ldGhvZCB9KSA9PiB7XG4gICAgcmV0dXJuIHF1ZXJ5W21ldGhvZF0oLi4uYXJncylcbiAgfSwgcXVlcnkpXG59XG5cbmV4cG9ydCB7IGNoYWluTWV0aG9kcyB9XG4iXSwibmFtZXMiOlsiY2hhaW5NZXRob2RzIiwibWV0aG9kcyIsInF1ZXJ5IiwicmVkdWNlIiwiYXJncyIsIm1ldGhvZCJdLCJtYXBwaW5ncyI6IkFBS0E7Ozs7Q0FJQyxHQUNELE1BQU1BLGVBQWUsQ0FBQyxFQUFFQyxPQUFPLEVBQUVDLEtBQUssRUFBRTtJQUN0QyxPQUFPRCxRQUFRRSxNQUFNLENBQUMsQ0FBQ0QsT0FBTyxFQUFFRSxJQUFJLEVBQUVDLE1BQU0sRUFBRTtRQUM1QyxPQUFPSCxLQUFLLENBQUNHLE9BQU8sSUFBSUQ7SUFDMUIsR0FBR0Y7QUFDTDtBQUVBLFNBQVNGLFlBQVksR0FBRSJ9
@@ -1,24 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "findMany", {
6
- enumerable: true,
7
- get: function() {
8
- return findMany;
9
- }
10
- });
11
- const _drizzleorm = require("drizzle-orm");
12
- const _buildQuery = /*#__PURE__*/ _interop_require_default(require("../queries/buildQuery"));
13
- const _read = require("../transform/read");
14
- const _buildFindManyArgs = require("./buildFindManyArgs");
15
- const _chainMethods = require("./chainMethods");
16
- function _interop_require_default(obj) {
17
- return obj && obj.__esModule ? obj : {
18
- default: obj
19
- };
20
- }
21
- const findMany = async function find({ adapter, fields, limit: limitArg, locale, page = 1, pagination, req = {}, skip, sort, tableName, where: whereArg }) {
1
+ import { inArray, sql } from 'drizzle-orm';
2
+ import buildQuery from '../queries/buildQuery';
3
+ import { transform } from '../transform/read';
4
+ import { buildFindManyArgs } from './buildFindManyArgs';
5
+ import { chainMethods } from './chainMethods';
6
+ export const findMany = async function find({ adapter, fields, limit: limitArg, locale, page = 1, pagination, req = {}, skip, sort, tableName, where: whereArg }) {
22
7
  const db = adapter.sessions[req.transactionID]?.db || adapter.drizzle;
23
8
  const table = adapter.tables[tableName];
24
9
  const limit = limitArg ?? 10;
@@ -28,7 +13,7 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
28
13
  let hasNextPage;
29
14
  let pagingCounter;
30
15
  let selectDistinctResult;
31
- const { joinAliases, joins, orderBy, selectFields, where } = await (0, _buildQuery.default)({
16
+ const { joinAliases, joins, orderBy, selectFields, where } = await buildQuery({
32
17
  adapter,
33
18
  fields,
34
19
  locale,
@@ -47,7 +32,7 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
47
32
  method: 'orderBy'
48
33
  });
49
34
  }
50
- const findManyArgs = (0, _buildFindManyArgs.buildFindManyArgs)({
35
+ const findManyArgs = buildFindManyArgs({
51
36
  adapter,
52
37
  depth: 0,
53
38
  fields,
@@ -95,7 +80,7 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
95
80
  ],
96
81
  method: 'limit'
97
82
  });
98
- selectDistinctResult = await (0, _chainMethods.chainMethods)({
83
+ selectDistinctResult = await chainMethods({
99
84
  methods: selectDistinctMethods,
100
85
  query: db.selectDistinct(selectFields).from(table)
101
86
  });
@@ -118,7 +103,7 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
118
103
  orderedIDMap[id] = i;
119
104
  });
120
105
  orderedIDs = Object.keys(orderedIDMap);
121
- findManyArgs.where = (0, _drizzleorm.inArray)(adapter.tables[tableName].id, orderedIDs);
106
+ findManyArgs.where = inArray(adapter.tables[tableName].id, orderedIDs);
122
107
  } else {
123
108
  findManyArgs.limit = limitArg === 0 ? undefined : limitArg;
124
109
  const offset = skip || (page - 1) * limitArg;
@@ -151,10 +136,10 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
151
136
  });
152
137
  }
153
138
  });
154
- const countResult = await (0, _chainMethods.chainMethods)({
139
+ const countResult = await chainMethods({
155
140
  methods: selectCountMethods,
156
141
  query: db.select({
157
- count: (0, _drizzleorm.sql)`count
142
+ count: sql`count
158
143
  (DISTINCT ${adapter.tables[tableName].id})`
159
144
  }).from(table).where(where)
160
145
  });
@@ -177,7 +162,7 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
177
162
  hasNextPage = false;
178
163
  }
179
164
  const docs = rawDocs.map((data)=>{
180
- return (0, _read.transform)({
165
+ return transform({
181
166
  config: adapter.payload.config,
182
167
  data,
183
168
  fields
@@ -197,4 +182,4 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
197
182
  };
198
183
  };
199
184
 
200
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2ZpbmRNYW55LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRmluZEFyZ3MgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBGaWVsZCwgUGF5bG9hZFJlcXVlc3QsIFR5cGVXaXRoSUQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBpbkFycmF5LCBzcWwgfSBmcm9tICdkcml6emxlLW9ybSdcblxuaW1wb3J0IHR5cGUgeyBQb3N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nRSxVQUFVLE1BQU1QO0lBQ3RCLGdDQUFnQztJQUNoQyxJQUFJcEIsT0FBT0MsSUFBSSxDQUFDWCxjQUFjWSxNQUFNLEdBQUcsR0FBRztRQUN4Q3lCLFFBQVF6RCxJQUFJLENBQUMsQ0FBQzBELEdBQUdDLElBQU12QyxZQUFZLENBQUNzQyxFQUFFYixFQUFFLENBQUMsR0FBR3pCLFlBQVksQ0FBQ3VDLEVBQUVkLEVBQUUsQ0FBQztJQUNoRTtJQUVBLElBQUloRCxlQUFlLFNBQVMsQ0FBQ2EsV0FBVztRQUN0Q0EsWUFBWStDLFFBQVF6QixNQUFNO1FBQzFCckIsYUFBYTtRQUNiRyxnQkFBZ0I7UUFDaEJGLGNBQWM7UUFDZEMsY0FBYztJQUNoQjtJQUVBLE1BQU02QixPQUFPZSxRQUFRRyxHQUFHLENBQUMsQ0FBQ0M7UUFDeEIsT0FBTzNFLFVBQVU7WUFDZjRFLFFBQVF2RSxRQUFRd0UsT0FBTyxDQUFDRCxNQUFNO1lBQzlCRDtZQUNBckU7UUFDRjtJQUNGO0lBRUEsT0FBTztRQUNMa0Q7UUFDQTdCO1FBQ0FEO1FBQ0FuQjtRQUNBa0QsVUFBVTlCLGNBQWNqQixPQUFPLElBQUk7UUFDbkNBO1FBQ0FrQjtRQUNBOEIsVUFBVWhDLGNBQWNoQixPQUFPLElBQUk7UUFDbkNjO1FBQ0FDO0lBQ0Y7QUFDRixFQUFDIn0=
@@ -1,21 +1,6 @@
1
- /* eslint-disable no-param-reassign */ "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "traverseFields", {
6
- enumerable: true,
7
- get: function() {
8
- return traverseFields;
9
- }
10
- });
11
- const _types = require("payload/types");
12
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, depth, fields, path, topLevelArgs, topLevelTableName })=>{
1
+ /* eslint-disable no-param-reassign */ import { fieldAffectsData, tabHasName } from 'payload/types';
2
+ import toSnakeCase from 'to-snake-case';
3
+ export const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, depth, fields, path, topLevelArgs, topLevelTableName })=>{
19
4
  fields.forEach((field)=>{
20
5
  if (field.type === 'collapsible' || field.type === 'row') {
21
6
  traverseFields({
@@ -33,7 +18,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
33
18
  }
34
19
  if (field.type === 'tabs') {
35
20
  field.tabs.forEach((tab)=>{
36
- const tabPath = (0, _types.tabHasName)(tab) ? `${path}${tab.name}_` : path;
21
+ const tabPath = tabHasName(tab) ? `${path}${tab.name}_` : path;
37
22
  traverseFields({
38
23
  _locales,
39
24
  adapter,
@@ -48,7 +33,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
48
33
  });
49
34
  return;
50
35
  }
51
- if ((0, _types.fieldAffectsData)(field)) {
36
+ if (fieldAffectsData(field)) {
52
37
  switch(field.type){
53
38
  case 'array':
54
39
  {
@@ -61,7 +46,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
61
46
  ],
62
47
  with: {}
63
48
  };
64
- const arrayTableName = `${currentTableName}_${path}${(0, _tosnakecase.default)(field.name)}`;
49
+ const arrayTableName = `${currentTableName}_${path}${toSnakeCase(field.name)}`;
65
50
  if (adapter.tables[`${arrayTableName}_locales`]) withArray.with._locales = _locales;
66
51
  currentArgs.with[`${path}${field.name}`] = withArray;
67
52
  traverseFields({
@@ -107,7 +92,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
107
92
  ],
108
93
  with: {}
109
94
  };
110
- const tableName = `${topLevelTableName}_blocks_${(0, _tosnakecase.default)(block.slug)}`;
95
+ const tableName = `${topLevelTableName}_blocks_${toSnakeCase(block.slug)}`;
111
96
  if (adapter.tables[`${tableName}_locales`]) withBlock.with._locales = _locales;
112
97
  topLevelArgs.with[blockKey] = withBlock;
113
98
  traverseFields({
@@ -147,4 +132,4 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
147
132
  return topLevelArgs;
148
133
  };
149
134
 
150
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL3RyYXZlcnNlRmllbGRzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEZpZWxkIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgZmllbGRBZmZlY3RzRGF0YSwgdGFiSGFzTmFtZSB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuLi90eXBlcydcbmltcG9ydCB0eXBlIHsgUmVzdWx0IH0gZnJvbSAnLi9idWlsZEZpbmRNYW55QXJncydcblxudHlwZSBUcmF2ZXJzZUZpZWxkQXJncyA9IHtcbiAgX2xvY2FsZXM6IFJlY29yZDxzdHJpbmcsIHVua25vd24+XG4gIGFkYXB0ZXI6IFBvc3RncmVzQWRhcHRlclxuICBjdXJyZW50QXJnczogUmVjb3JkPHN0cmluZywgdW5rbm93bj5cbiAgY3VycmVudFRhYmxlTmFtZTogc3RyaW5nXG4gIGRlcHRoPzogbnVtYmVyXG4gIGZpZWxkczogRmllbGRbXVxuICBwYXRoOiBzdHJpbmdcbiAgdG9wTGV2ZWxBcmdzOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPlxuICB0b3BMZXZlbFRhYmxlTmFtZTogc3RyaW5nXG59XG5cbmV4cG9ydCBjb25zdCB0cmF2ZXJzZUZpZWxkcyA9ICh7XG4gIF9sb2NhbGVzLFxuICBhZGFwdGVyLFxuICBjdXJyZW50QXJncyxcbiAgY3VycmVudFRhYmxlTmFtZSxcbiAgZGVwdGgsXG4gIGZpZWxkcyxcbiAgcGF0aCxcbiAgdG9wTGV2ZWxBcmdzLFxuICB0b3BMZXZlbFRhYmxlTmFtZSxcbn06IFRyYXZlcnNlRmllbGRBcmdzKSA9PiB7XG4gIGZpZWxkcy5mb3JFYWNoKChmaWVsZCkgPT4ge1xuICAgIGlmIChmaWVsZC50eXBlID09PSAnY29sbGFwc2libGUnIHx8IGZpZWxkLnR5cGUgPT09ICdyb3cnKSB7XG4gICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgIF9sb2NhbGVzLFxuICAgICAgICBhZGFwdGVyLFxuICAgICAgICBjdXJyZW50QXJncyxcbiAgICAgICAgY3VycmVudFRhYmxlTmFtZSxcbiAgICAgICAgZGVwdGgsXG4gICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICBwYXRoLFxuICAgICAgICB0b3BMZXZlbEFyZ3MsXG4gICAgICAgIHRvcExldmVsVGFibGVOYW1lLFxuICAgICAgfSlcblxuICAgICAgcmV0dXJuXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkLnR5cGUgPT09ICd0YWJzJykge1xuICAgICAgZmllbGQudGFicy5mb3JFYWNoKCh0YWIpID0+IHtcbiAgICAgICAgY29uc3QgdGFiUGF0aCA9IHRhYkhhc05hbWUodGFiKSA/IGAke3BhdGh9JHt0YWIubmFtZX1fYCA6IHBhdGhcblxuICAgICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgX2xvY2FsZXMsXG4gICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICBjdXJyZW50QXJncyxcbiAgICAgICAgICBjdXJyZW50VGFibGVOYW1lLFxuICAgICAgICAgIGRlcHRoLFxuICAgICAgICAgIGZpZWxkczogdGFiLmZpZWxkcyxcbiAgICAgICAgICBwYXRoOiB0YWJQYXRoLFxuICAgICAgICAgIHRvcExldmVsQXJncyxcbiAgICAgICAgICB0b3BMZXZlbFRhYmxlTmFtZSxcbiAgICAgICAgfSlcbiAgICAgIH0pXG5cbiAgICAgIHJldHVyblxuICAgIH1cblxuICAgIGlmIChmaWVsZEFmZmVjdHNEYXRhKGZpZWxkKSkge1xuICAgICAgc3dpdGNoIChmaWVsZC50eXBlKSB7XG4gICAgICAgIGNhc2UgJ2FycmF5Jzoge1xuICAgICAgICAgIGNvbnN0IHdpdGhBcnJheTogUmVzdWx0ID0ge1xuICAgICAgICAgICAgY29sdW1uczoge1xuICAgICAgICAgICAgICBfcGFyZW50SUQ6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG9yZGVyQnk6ICh7IF9vcmRlciB9LCB7IGFzYyB9KSA9PiBbYXNjKF9vcmRlcildLFxuICAgICAgICAgICAgd2l0aDoge30sXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29uc3QgYXJyYXlUYWJsZU5hbWUgPSBgJHtjdXJyZW50VGFibGVOYW1lfV8ke3BhdGh9JHt0b1NuYWtlQ2FzZShmaWVsZC5uYW1lKX1gXG5cbiAgICAgICAgICBpZiAoYWRhcHRlci50YWJsZXNbYCR7YXJyYXlUYWJsZU5hbWV9X2xvY2FsZXNgXSkgd2l0aEFycmF5LndpdGguX2xvY2FsZXMgPSBfbG9jYWxlc1xuICAgICAgICAgIGN1cnJlbnRBcmdzLndpdGhbYCR7cGF0aH0ke2ZpZWxkLm5hbWV9YF0gPSB3aXRoQXJyYXlcblxuICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgIF9sb2NhbGVzLFxuICAgICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICAgIGN1cnJlbnRBcmdzOiB3aXRoQXJyYXksXG4gICAgICAgICAgICBjdXJyZW50VGFibGVOYW1lOiBhcnJheVRhYmxlTmFtZSxcbiAgICAgICAgICAgIGRlcHRoLFxuICAgICAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgICAgICBwYXRoOiAnJyxcbiAgICAgICAgICAgIHRvcExldmVsQXJncyxcbiAgICAgICAgICAgIHRvcExldmVsVGFibGVOYW1lLFxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG5cbiAgICAgICAgY2FzZSAnc2VsZWN0Jzoge1xuICAgICAgICAgIGlmIChmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgICAgICBjb25zdCB3aXRoU2VsZWN0OiBSZXN1bHQgPSB7XG4gICAgICAgICAgICAgIGNvbHVtbnM6IHtcbiAgICAgICAgICAgICAgICBpZDogZmFsc2UsXG4gICAgICAgICAgICAgICAgb3JkZXI6IGZhbHNlLFxuICAgICAgICAgICAgICAgIHBhcmVudDogZmFsc2UsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIG9yZGVyQnk6ICh7IG9yZGVyIH0sIHsgYXNjIH0pID0+IFthc2Mob3JkZXIpXSxcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3VycmVudEFyZ3Mud2l0aFtgJHtwYXRofSR7ZmllbGQubmFtZX1gXSA9IHdpdGhTZWxlY3RcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG5cbiAgICAgICAgY2FzZSAnYmxvY2tzJzpcbiAgICAgICAgICBmaWVsZC5ibG9ja3MuZm9yRWFjaCgoYmxvY2spID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGJsb2NrS2V5ID0gYF9ibG9ja3NfJHtibG9jay5zbHVnfWBcblxuICAgICAgICAgICAgaWYgKCF0b3BMZXZlbEFyZ3NbYmxvY2tLZXldKSB7XG4gICAgICAgICAgICAgIGNvbnN0IHdpdGhCbG9jazogUmVzdWx0ID0ge1xuICAgICAgICAgICAgICAgIGNvbHVtbnM6IHtcbiAgICAgICAgICAgICAgICAgIF9wYXJlbnRJRDogZmFsc2UsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBvcmRlckJ5OiAoeyBfb3JkZXIgfSwgeyBhc2MgfSkgPT4gW2FzYyhfb3JkZXIpXSxcbiAgICAgICAgICAgICAgICB3aXRoOiB7fSxcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGNvbnN0IHRhYmxlTmFtZSA9IGAke3RvcExldmVsVGFibGVOYW1lfV9ibG9ja3NfJHt0b1NuYWtlQ2FzZShibG9jay5zbHVnKX1gXG5cbiAgICAgICAgICAgICAgaWYgKGFkYXB0ZXIudGFibGVzW2Ake3RhYmxlTmFtZX1fbG9jYWxlc2BdKSB3aXRoQmxvY2sud2l0aC5fbG9jYWxlcyA9IF9sb2NhbGVzXG4gICAgICAgICAgICAgIHRvcExldmVsQXJncy53aXRoW2Jsb2NrS2V5XSA9IHdpdGhCbG9ja1xuXG4gICAgICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgICAgICBfbG9jYWxlcyxcbiAgICAgICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgICAgIGN1cnJlbnRBcmdzOiB3aXRoQmxvY2ssXG4gICAgICAgICAgICAgICAgY3VycmVudFRhYmxlTmFtZTogdGFibGVOYW1lLFxuICAgICAgICAgICAgICAgIGRlcHRoLFxuICAgICAgICAgICAgICAgIGZpZWxkczogYmxvY2suZmllbGRzLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcnLFxuICAgICAgICAgICAgICAgIHRvcExldmVsQXJncyxcbiAgICAgICAgICAgICAgICB0b3BMZXZlbFRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgYnJlYWtcblxuICAgICAgICBjYXNlICdncm91cCc6XG4gICAgICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICAgICAgX2xvY2FsZXMsXG4gICAgICAgICAgICBhZGFwdGVyLFxuICAg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gICAgICBjdXJyZW50VGFibGVOYW1lLFxuICAgICAgICAgIGRlcHRoLFxuICAgICAgICAgIGZpZWxkczogdGFiLmZpZWxkcyxcbiAgICAgICAgICBwYXRoOiB0YWJQYXRoLFxuICAgICAgICAgIHRvcExldmVsQXJncyxcbiAgICAgICAgICB0b3BMZXZlbFRhYmxlTmFtZSxcbiAgICAgICAgfSlcbiAgICAgIH0pXG5cbiAgICAgIHJldHVyblxuICAgIH1cblxuICAgIGlmIChmaWVsZEFmZmVjdHNEYXRhKGZpZWxkKSkge1xuICAgICAgc3dpdGNoIChmaWVsZC50eXBlKSB7XG4gICAgICAgIGNhc2UgJ2FycmF5Jzoge1xuICAgICAgICAgIGNvbnN0IHdpdGhBcnJheTogUmVzdWx0ID0ge1xuICAgICAgICAgICAgY29sdW1uczoge1xuICAgICAgICAgICAgICBfcGFyZW50SUQ6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG9yZGVyQnk6ICh7IF9vcmRlciB9LCB7IGFzYyB9KSA9PiBbYXNjKF9vcmRlcildLFxuICAgICAgICAgICAgd2l0aDoge30sXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29uc3QgYXJyYXlUYWJsZU5hbWUgPSBgJHtjdXJyZW50VGFibGVOYW1lfV8ke3BhdGh9JHt0b1NuYWtlQ2FzZShmaWVsZC5uYW1lKX1gXG5cbiAgICAgICAgICBpZiAoYWRhcHRlci50YWJsZXNbYCR7YXJyYXlUYWJsZU5hbWV9X2xvY2FsZXNgXSkgd2l0aEFycmF5LndpdGguX2xvY2FsZXMgPSBfbG9jYWxlc1xuICAgICAgICAgIGN1cnJlbnRBcmdzLndpdGhbYCR7cGF0aH0ke2ZpZWxkLm5hbWV9YF0gPSB3aXRoQXJyYXlcblxuICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgIF9sb2NhbGVzLFxuICAgICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICAgIGN1cnJlbnRBcmdzOiB3aXRoQXJyYXksXG4gICAgICAgICAgICBjdXJyZW50VGFibGVOYW1lOiBhcnJheVRhYmxlTmFtZSxcbiAgICAgICAgICAgIGRlcHRoLFxuICAgICAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgICAgICBwYXRoOiAnJyxcbiAgICAgICAgICAgIHRvcExldmVsQXJncyxcbiAgICAgICAgICAgIHRvcExldmVsVGFibGVOYW1lLFxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG5cbiAgICAgICAgY2FzZSAnc2VsZWN0Jzoge1xuICAgICAgICAgIGlmIChmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgICAgICBjb25zdCB3aXRoU2VsZWN0OiBSZXN1bHQgPSB7XG4gICAgICAgICAgICAgIGNvbHVtbnM6IHtcbiAgICAgICAgICAgICAgICBpZDogZmFsc2UsXG4gICAgICAgICAgICAgICAgb3JkZXI6IGZhbHNlLFxuICAgICAgICAgICAgICAgIHBhcmVudDogZmFsc2UsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIG9yZGVyQnk6ICh7IG9yZGVyIH0sIHsgYXNjIH0pID0+IFthc2Mob3JkZXIpXSxcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3VycmVudEFyZ3Mud2l0aFtgJHtwYXRofSR7ZmllbGQubmFtZX1gXSA9IHdpdGhTZWxlY3RcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG5cbiAgICAgICAgY2FzZSAnYmxvY2tzJzpcbiAgICAgICAgICBmaWVsZC5ibG9ja3MuZm9yRWFjaCgoYmxvY2spID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGJsb2NrS2V5ID0gYF9ibG9ja3NfJHtibG9jay5zbHVnfWBcblxuICAgICAgICAgICAgaWYgKCF0b3BMZXZlbEFyZ3NbYmxvY2tLZXldKSB7XG4gICAgICAgICAgICAgIGNvbnN0IHdpdGhCbG9jazogUmVzdWx0ID0ge1xuICAgICAgICAgICAgICAgIGNvbHVtbnM6IHtcbiAgICAgICAgICAgICAgICAgIF9wYXJlbnRJRDogZmFsc2UsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBvcmRlckJ5OiAoeyBfb3JkZXIgfSwgeyBhc2MgfSkgPT4gW2FzYyhfb3JkZXIpXSxcbiAgICAgICAgICAgICAgICB3aXRoOiB7fSxcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGNvbnN0IHRhYmxlTmFtZSA9IGAke3RvcExldmVsVGFibGVOYW1lfV9ibG9ja3NfJHt0b1NuYWtlQ2FzZShibG9jay5zbHVnKX1gXG5cbiAgICAgICAgICAgICAgaWYgKGFkYXB0ZXIudGFibGVzW2Ake3RhYmxlTmFtZX1fbG9jYWxlc2BdKSB3aXRoQmxvY2sud2l0aC5fbG9jYWxlcyA9IF9sb2NhbGVzXG4gICAgICAgICAgICAgIHRvcExldmVsQXJncy53aXRoW2Jsb2NrS2V5XSA9IHdpdGhCbG9ja1xuXG4gICAgICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgICAgICBfbG9jYWxlcyxcbiAgICAgICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgICAgIGN1cnJlbnRBcmdzOiB3aXRoQmxvY2ssXG4gICAgICAgICAgICAgICAgY3VycmVudFRhYmxlTmFtZTogdGFibGVOYW1lLFxuICAgICAgICAgICAgICAgIGRlcHRoLFxuICAgICAgICAgICAgICAgIGZpZWxkczogYmxvY2suZmllbGRzLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcnLFxuICAgICAgICAgICAgICAgIHRvcExldmVsQXJncyxcbiAgICAgICAgICAgICAgICB0b3BMZXZlbFRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgYnJlYWtcblxuICAgICAgICBjYXNlIC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dCQUVGLEtBQUs7b0JBQ0hULGVBQWU7d0JBQ2JDO3dCQUNBQzt3QkFDQUM7d0JBQ0FDO3dCQUNBQzt3QkFDQUMsUUFBUUssTUFBTUwsTUFBTTt3QkFDcEJDLE1BQU0sQ0FBQyxFQUFFQSxLQUFLLEVBQUVJLE1BQU1LLElBQUksQ0FBQyxDQUFDLENBQUM7d0JBQzdCUjt3QkFDQUM7b0JBQ0Y7b0JBRUE7Z0JBRUY7b0JBQVM7d0JBQ1A7b0JBQ0Y7WUFDRjtRQUNGO0lBQ0Y7SUFFQSxPQUFPRDtBQUNULEVBQUMifQ==
package/dist/find.js CHANGED
@@ -1,24 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "find", {
6
- enumerable: true,
7
- get: function() {
8
- return find;
9
- }
10
- });
11
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
12
- const _findMany = require("./find/findMany");
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- const find = async function find({ collection, limit: limitArg, locale, page = 1, pagination, req = {}, sort: sortArg, where: whereArg }) {
1
+ import toSnakeCase from 'to-snake-case';
2
+ import { findMany } from './find/findMany';
3
+ export const find = async function find({ collection, limit: limitArg, locale, page = 1, pagination, req = {}, sort: sortArg, where: whereArg }) {
19
4
  const collectionConfig = this.payload.collections[collection].config;
20
5
  const sort = typeof sortArg === 'string' ? sortArg : collectionConfig.defaultSort;
21
- return (0, _findMany.findMany)({
6
+ return findMany({
22
7
  adapter: this,
23
8
  fields: collectionConfig.fields,
24
9
  limit: limitArg,
@@ -27,9 +12,9 @@ const find = async function find({ collection, limit: limitArg, locale, page = 1
27
12
  pagination,
28
13
  req,
29
14
  sort,
30
- tableName: (0, _tosnakecase.default)(collection),
15
+ tableName: toSnakeCase(collection),
31
16
  where: whereArg
32
17
  });
33
18
  };
34
19
 
35
- //# sourceMappingUR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MsT0FBTyxFQUNiQyxPQUFPQyxRQUFRLEVBQ2hCO0lBRUQsTUFBTUMsbUJBQThDLElBQUksQ0FBQ0MsT0FBTyxDQUFDQyxXQUFXLENBQUNiLFdBQVcsQ0FBQ2MsTUFBTTtJQUMvRixNQUFNUCxPQUFPLE9BQU9DLFlBQVksV0FBV0EsVUFBVUcsaUJBQWlCSSxXQUFXO0lBRWpGLE9BQU9qQixTQUFTO1FBQ2RrQixTQUFTLElBQUk7UUFDYkMsUUFBUU4saUJBQWlCTSxNQUFNO1FBQy9CaEIsT0FBT0M7UUFDUEM7UUFDQUM7UUFDQUM7UUFDQUM7UUFDQUM7UUFDQVcsV0FBV3JCLFlBQVlHO1FBQ3ZCUyxPQUFPQztJQUNUO0FBQ0YsRUFBQyJ9
@@ -1,24 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "findGlobal", {
6
- enumerable: true,
7
- get: function() {
8
- return findGlobal;
9
- }
10
- });
11
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
12
- const _findMany = require("./find/findMany");
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- const findGlobal = async function findGlobal({ locale, req, slug, where }) {
1
+ import toSnakeCase from 'to-snake-case';
2
+ import { findMany } from './find/findMany';
3
+ export const findGlobal = async function findGlobal({ locale, req, slug, where }) {
19
4
  const globalConfig = this.payload.globals.config.find((config)=>config.slug === slug);
20
- const tableName = (0, _tosnakecase.default)(slug);
21
- const { docs: [doc] } = await (0, _findMany.findMany)({
5
+ const tableName = toSnakeCase(slug);
6
+ const { docs: [doc] } = await findMany({
22
7
  adapter: this,
23
8
  fields: globalConfig.fields,
24
9
  limit: 1,
@@ -35,4 +20,4 @@ const findGlobal = async function findGlobal({ locale, req, slug, where }) {
35
20
  return {};
36
21
  };
37
22
 
38
- //# sourceMappingURL=data:application/json;base64,eyJ2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x1ZyIsIndoZXJlIiwiZ2xvYmFsQ29uZmlnIiwicGF5bG9hZCIsImdsb2JhbHMiLCJjb25maWciLCJmaW5kIiwidGFibGVOYW1lIiwiZG9jcyIsImRvYyIsImFkYXB0ZXIiLCJmaWVsZHMiLCJsaW1pdCIsInBhZ2luYXRpb24iLCJnbG9iYWxUeXBlIl0sIm1hcHBpbmdzIjoiQUFFQSxPQUFPQSxpQkFBaUIsZ0JBQWU7QUFJdkMsU0FBU0MsUUFBUSxRQUFRLGtCQUFpQjtBQUUxQyxPQUFPLE1BQU1DLGFBQXlCLGVBQWVBLFdBRW5ELEVBQUVDLE1BQU0sRUFBRUMsR0FBRyxFQUFFQyxJQUFJLEVBQUVDLEtBQUssRUFBRTtJQUU1QixNQUFNQyxlQUFlLElBQUksQ0FBQ0MsT0FBTyxDQUFDQyxPQUFPLENBQUNDLE1BQU0sQ0FBQ0MsSUFBSSxDQUFDLENBQUNELFNBQVdBLE9BQU9MLElBQUksS0FBS0E7SUFDbEYsTUFBTU8sWUFBWVosWUFBWUs7SUFFOUIsTUFBTSxFQUNKUSxNQUFNLENBQUNDLElBQUksRUFDWixHQUFHLE1BQU1iLFNBQVM7UUFDakJjLFNBQVMsSUFBSTtRQUNiQyxRQUFRVCxhQUFhUyxNQUFNO1FBQzNCQyxPQUFPO1FBQ1BkO1FBQ0FlLFlBQVk7UUFDWmQ7UUFDQVE7UUFDQU47SUFDRjtJQUVBLElBQUlRLEtBQUs7UUFDUEEsSUFBSUssVUFBVSxHQUFHZDtRQUNqQixPQUFPUztJQUNUO0lBRUEsT0FBTyxDQUFDO0FBQ1YsRUFBQyJ9
@@ -1,27 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "findGlobalVersions", {
6
- enumerable: true,
7
- get: function() {
8
- return findGlobalVersions;
9
- }
10
- });
11
- const _versions = require("payload/versions");
12
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
13
- const _findMany = require("./find/findMany");
14
- function _interop_require_default(obj) {
15
- return obj && obj.__esModule ? obj : {
16
- default: obj
17
- };
18
- }
19
- const findGlobalVersions = async function findGlobalVersions({ global, limit, locale, page, pagination, req = {}, skip, sort: sortArg, where }) {
1
+ import { buildVersionGlobalFields } from 'payload/versions';
2
+ import toSnakeCase from 'to-snake-case';
3
+ import { findMany } from './find/findMany';
4
+ export const findGlobalVersions = async function findGlobalVersions({ global, limit, locale, page, pagination, req = {}, skip, sort: sortArg, where }) {
20
5
  const globalConfig = this.payload.globals.config.find(({ slug })=>slug === global);
21
6
  const sort = typeof sortArg === 'string' ? sortArg : '-createdAt';
22
- const tableName = `_${(0, _tosnakecase.default)(global)}_v`;
23
- const fields = (0, _versions.buildVersionGlobalFields)(globalConfig);
24
- return (0, _findMany.findMany)({
7
+ const tableName = `_${toSnakeCase(global)}_v`;
8
+ const fields = buildVersionGlobalFields(globalConfig);
9
+ return findMany({
25
10
  adapter: this,
26
11
  fields,
27
12
  limit,
@@ -36,4 +21,4 @@ const findGlobalVersions = async function findGlobalVersions({ global, limit, lo
36
21
  });
37
22
  };
38
23
 
39
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9maW5kR2xvYmFsVmVyc2lvbnMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBGaW5kR2xvYmFsVmVyc2lvbnMgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBQYXlsb2FkUmVxdWVzdCwgU2FuaXRpemVkR2xvYmFsQ29uZmlnIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgYnVpbGRWZXJzaW9uR2xvYmFsRmllbGRzIH0gZnJvbSAncGF5bG9hZC92ZXJzaW9ucydcbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG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UFTQyxRQUFRLFFBQVEsa0JBQWlCO0FBRTFDLE9BQU8sTUFBTUMscUJBQXlDLGVBQWVBLG1CQUVuRSxFQUNFQyxNQUFNLEVBQ05DLEtBQUssRUFDTEMsTUFBTSxFQUNOQyxJQUFJLEVBQ0pDLFVBQVUsRUFDVkMsTUFBTSxDQUFDLENBQW1CLEVBQzFCQyxJQUFJLEVBQ0pDLE1BQU1DLE9BQU8sRUFDYkMsS0FBSyxFQUNOO0lBRUQsTUFBTUMsZUFBc0MsSUFBSSxDQUFDQyxPQUFPLENBQUNDLE9BQU8sQ0FBQ0MsTUFBTSxDQUFDQyxJQUFJLENBQzFFLENBQUMsRUFBRUMsSUFBSSxFQUFFLEdBQUtBLFNBQVNmO0lBRXpCLE1BQU1PLE9BQU8sT0FBT0MsWUFBWSxXQUFXQSxVQUFVO0lBRXJELE1BQU1RLFlBQVksQ0FBQyxDQUFDLEVBQUVuQixZQUFZRyxRQUFRLEVBQUUsQ0FBQztJQUM3QyxNQUFNaUIsU0FBU3JCLHlCQUF5QmM7SUFFeEMsT0FBT1osU0FBUztRQUNkb0IsU0FBUyxJQUFJO1FBQ2JEO1FBQ0FoQjtRQUNBQztRQUNBQztRQUNBQztRQUNBQztRQUNBQztRQUNBQztRQUNBUztRQUNBUDtJQUNGO0FBQ0YsRUFBQyJ9
package/dist/findOne.js CHANGED
@@ -1,23 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "findOne", {
6
- enumerable: true,
7
- get: function() {
8
- return findOne;
9
- }
10
- });
11
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
12
- const _findMany = require("./find/findMany");
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- async function findOne({ collection, locale, req = {}, where: incomingWhere }) {
1
+ import toSnakeCase from 'to-snake-case';
2
+ import { findMany } from './find/findMany';
3
+ export async function findOne({ collection, locale, req = {}, where: incomingWhere }) {
19
4
  const collectionConfig = this.payload.collections[collection].config;
20
- const { docs } = await (0, _findMany.findMany)({
5
+ const { docs } = await findMany({
21
6
  adapter: this,
22
7
  fields: collectionConfig.fields,
23
8
  limit: 1,
@@ -26,10 +11,10 @@ async function findOne({ collection, locale, req = {}, where: incomingWhere }) {
26
11
  pagination: false,
27
12
  req,
28
13
  sort: undefined,
29
- tableName: (0, _tosnakecase.default)(collection),
14
+ tableName: toSnakeCase(collection),
30
15
  where: incomingWhere
31
16
  });
32
17
  return docs?.[0] || null;
33
18
  }
34
19
 
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9maW5kT25lLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRmluZE9uZUFyZ3MgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBQYXlsb2FkUmVxdWVzdCwgU2FuaXRpemVkQ29sbGVjdGlvbkNvbmZpZywgVHlwZVdpdGhJRCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IGZpbmRNYW55IH0gZnJvbSAnLi9maW5kL2ZpbmRNYW55J1xuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gZmluZE9uZTxUIGV4dGVuZHMgVHlwZVdpdGhJRD4oXG4gIHRoaXM6IFBvc3RncmVzQWRhcHRlcixcbiAgeyBjb2xsZWN0aW9uLCBsb2NhbGUsIHJlcSA9IHt9IGFzIFBheWxvYWRSZXF1ZXN0LCB3aGVyZTogaW5jb21pbmdXaGVyZSB9OiBGaW5kT25lQXJncyxcbik6IFByb21pc2U8VD4ge1xuICBjb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