@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.
- package/dist/connect.js +17 -32
- package/dist/create.js +6 -21
- package/dist/createGlobal.js +6 -21
- package/dist/createGlobalVersion.js +10 -25
- package/dist/createMigration.js +11 -26
- package/dist/createVersion.js +10 -25
- package/dist/deleteMany.js +8 -23
- package/dist/deleteOne.js +10 -25
- package/dist/deleteVersions.js +10 -25
- package/dist/destroy.js +2 -12
- package/dist/find/buildFindManyArgs.js +6 -14
- package/dist/find/chainMethods.js +2 -11
- package/dist/find/findMany.js +14 -29
- package/dist/find/traverseFields.js +8 -23
- package/dist/find.js +6 -21
- package/dist/findGlobal.js +6 -21
- package/dist/findGlobalVersions.js +8 -23
- package/dist/findOne.js +6 -21
- package/dist/findVersions.js +8 -23
- package/dist/index.js +72 -87
- package/dist/init.js +17 -32
- package/dist/migrate.js +15 -30
- package/dist/migrateDown.js +12 -22
- package/dist/migrateFresh.js +15 -28
- package/dist/migrateRefresh.js +18 -26
- package/dist/migrateReset.js +13 -21
- package/dist/migrateStatus.js +9 -19
- package/dist/queries/buildAndOrConditions.js +4 -14
- package/dist/queries/buildQuery.js +10 -20
- package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +4 -14
- package/dist/queries/createJSONQuery/formatJSONPathSegment.js +2 -12
- package/dist/queries/createJSONQuery/index.js +6 -16
- package/dist/queries/getTableColumnFromPath.js +38 -49
- package/dist/queries/operatorMap.js +17 -27
- package/dist/queries/parseParams.js +32 -42
- package/dist/queries/sanitizeQueryValue.js +8 -18
- package/dist/queryDrafts.js +10 -25
- package/dist/schema/build.js +49 -64
- package/dist/schema/createIndex.js +5 -15
- package/dist/schema/idToUUID.js +2 -12
- package/dist/schema/parentIDColumnMap.js +7 -17
- package/dist/schema/setColumnID.js +10 -20
- package/dist/schema/traverseFields.js +62 -77
- package/dist/schema/validateExistingBlockIsIdentical.js +9 -19
- package/dist/transactions/beginTransaction.js +4 -14
- package/dist/transactions/commitTransaction.js +2 -12
- package/dist/transactions/rollbackTransaction.js +2 -12
- package/dist/transform/read/hasManyNumber.js +2 -12
- package/dist/transform/read/hasManyText.js +2 -12
- package/dist/transform/read/index.js +12 -20
- package/dist/transform/read/relationship.js +2 -12
- package/dist/transform/read/traverseFields.js +15 -23
- package/dist/transform/write/array.js +6 -16
- package/dist/transform/write/blocks.js +6 -21
- package/dist/transform/write/index.js +4 -14
- package/dist/transform/write/numbers.js +2 -12
- package/dist/transform/write/relationships.js +4 -14
- package/dist/transform/write/selects.js +4 -14
- package/dist/transform/write/texts.js +2 -12
- package/dist/transform/write/traverseFields.js +30 -45
- package/dist/transform/write/types.js +2 -5
- package/dist/types.js +2 -5
- package/dist/update.js +11 -26
- package/dist/updateGlobal.js +6 -21
- package/dist/updateGlobalVersion.js +10 -25
- package/dist/updateVersion.js +10 -25
- package/dist/upsertRow/deleteExistingArrayRows.js +5 -15
- package/dist/upsertRow/deleteExistingRowsByPath.js +9 -19
- package/dist/upsertRow/index.js +24 -34
- package/dist/upsertRow/insertArrays.js +2 -12
- package/dist/upsertRow/types.js +2 -5
- package/dist/utilities/appendPrefixToKeys.js +2 -12
- package/dist/utilities/createBlocksMap.js +2 -12
- package/dist/utilities/createMigrationTable.js +4 -14
- package/dist/utilities/createRelationshipMap.js +2 -12
- package/dist/utilities/hasLocalesTable.js +5 -15
- package/dist/utilities/isArrayOfRows.js +2 -12
- package/dist/utilities/migrationTableExists.js +4 -14
- package/dist/utilities/parseError.js +6 -14
- package/package.json +5 -4
@@ -1,23 +1,13 @@
|
|
1
|
-
/* eslint-disable no-await-in-loop */
|
2
|
-
|
3
|
-
|
4
|
-
}
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
})
|
11
|
-
const _drizzleorm = require("drizzle-orm");
|
12
|
-
const _errors = require("payload/errors");
|
13
|
-
const _types = require("payload/types");
|
14
|
-
const _buildAndOrConditions = require("./buildAndOrConditions");
|
15
|
-
const _createJSONQuery = require("./createJSONQuery");
|
16
|
-
const _convertPathToJSONTraversal = require("./createJSONQuery/convertPathToJSONTraversal");
|
17
|
-
const _getTableColumnFromPath = require("./getTableColumnFromPath");
|
18
|
-
const _operatorMap = require("./operatorMap");
|
19
|
-
const _sanitizeQueryValue = require("./sanitizeQueryValue");
|
20
|
-
async function parseParams({ adapter, fields, joinAliases, joins, locale, selectFields, tableName, where }) {
|
1
|
+
/* eslint-disable no-await-in-loop */ import { and, ilike, isNotNull, isNull, ne, notInArray, or, sql } from 'drizzle-orm';
|
2
|
+
import { QueryError } from 'payload/errors';
|
3
|
+
import { validOperators } from 'payload/types';
|
4
|
+
import { buildAndOrConditions } from './buildAndOrConditions';
|
5
|
+
import { createJSONQuery } from './createJSONQuery';
|
6
|
+
import { convertPathToJSONTraversal } from './createJSONQuery/convertPathToJSONTraversal';
|
7
|
+
import { getTableColumnFromPath } from './getTableColumnFromPath';
|
8
|
+
import { operatorMap } from './operatorMap';
|
9
|
+
import { sanitizeQueryValue } from './sanitizeQueryValue';
|
10
|
+
export async function parseParams({ adapter, fields, joinAliases, joins, locale, selectFields, tableName, where }) {
|
21
11
|
let result;
|
22
12
|
const constraints = [];
|
23
13
|
if (typeof where === 'object' && Object.keys(where).length > 0) {
|
@@ -32,7 +22,7 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
32
22
|
conditionOperator = 'or';
|
33
23
|
}
|
34
24
|
if (Array.isArray(condition)) {
|
35
|
-
const builtConditions = await
|
25
|
+
const builtConditions = await buildAndOrConditions({
|
36
26
|
adapter,
|
37
27
|
fields,
|
38
28
|
joinAliases,
|
@@ -43,7 +33,7 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
43
33
|
where: condition
|
44
34
|
});
|
45
35
|
if (builtConditions.length > 0) {
|
46
|
-
result =
|
36
|
+
result = operatorMap[conditionOperator](...builtConditions);
|
47
37
|
}
|
48
38
|
} else {
|
49
39
|
// It's a path - and there can be multiple comparisons on a single path.
|
@@ -52,9 +42,9 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
52
42
|
const pathOperators = where[relationOrPath];
|
53
43
|
if (typeof pathOperators === 'object') {
|
54
44
|
for (const operator of Object.keys(pathOperators)){
|
55
|
-
if (
|
45
|
+
if (validOperators.includes(operator)) {
|
56
46
|
const val = where[relationOrPath][operator];
|
57
|
-
const { columnName, constraints: queryConstraints, field, getNotNullColumnByValue, pathSegments, rawColumn, table } =
|
47
|
+
const { columnName, constraints: queryConstraints, field, getNotNullColumnByValue, pathSegments, rawColumn, table } = getTableColumnFromPath({
|
58
48
|
adapter,
|
59
49
|
collectionPath: relationOrPath,
|
60
50
|
fields,
|
@@ -68,9 +58,9 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
68
58
|
});
|
69
59
|
queryConstraints.forEach(({ columnName: col, table: constraintTable, value })=>{
|
70
60
|
if (typeof value === 'string' && value.indexOf('%') > -1) {
|
71
|
-
constraints.push(
|
61
|
+
constraints.push(operatorMap.like(constraintTable[col], value));
|
72
62
|
} else {
|
73
|
-
constraints.push(
|
63
|
+
constraints.push(operatorMap.equals(constraintTable[col], value));
|
74
64
|
}
|
75
65
|
});
|
76
66
|
if ([
|
@@ -80,7 +70,7 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
80
70
|
const segments = pathSegments.slice(1);
|
81
71
|
segments.unshift(table[columnName].name);
|
82
72
|
if (field.type === 'richText') {
|
83
|
-
const jsonQuery =
|
73
|
+
const jsonQuery = createJSONQuery({
|
84
74
|
operator,
|
85
75
|
pathSegments: segments,
|
86
76
|
treatAsArray: [
|
@@ -89,10 +79,10 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
89
79
|
treatRootAsArray: true,
|
90
80
|
value: val
|
91
81
|
});
|
92
|
-
constraints.push(
|
82
|
+
constraints.push(sql.raw(jsonQuery));
|
93
83
|
break;
|
94
84
|
}
|
95
|
-
const jsonQuery =
|
85
|
+
const jsonQuery = convertPathToJSONTraversal(pathSegments);
|
96
86
|
const operatorKeys = {
|
97
87
|
contains: {
|
98
88
|
operator: 'ilike',
|
@@ -118,15 +108,15 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
118
108
|
if (operator === 'exists') {
|
119
109
|
formattedValue = '';
|
120
110
|
}
|
121
|
-
constraints.push(
|
111
|
+
constraints.push(sql.raw(`${table[columnName].name}${jsonQuery} ${operatorKeys[operator].operator} ${formattedValue}`));
|
122
112
|
break;
|
123
113
|
}
|
124
114
|
if (getNotNullColumnByValue) {
|
125
115
|
const columnName = getNotNullColumnByValue(val);
|
126
116
|
if (columnName) {
|
127
|
-
constraints.push(
|
117
|
+
constraints.push(isNotNull(table[columnName]));
|
128
118
|
} else {
|
129
|
-
throw new
|
119
|
+
throw new QueryError([
|
130
120
|
{
|
131
121
|
path: relationOrPath
|
132
122
|
}
|
@@ -135,10 +125,10 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
135
125
|
break;
|
136
126
|
}
|
137
127
|
if (operator === 'like') {
|
138
|
-
constraints.push(
|
128
|
+
constraints.push(and(...val.split(' ').map((word)=>ilike(table[columnName], `%${word}%`))));
|
139
129
|
break;
|
140
130
|
}
|
141
|
-
const sanitizedQueryValue =
|
131
|
+
const sanitizedQueryValue = sanitizeQueryValue({
|
142
132
|
adapter,
|
143
133
|
field,
|
144
134
|
operator,
|
@@ -150,25 +140,25 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
150
140
|
}
|
151
141
|
const { operator: queryOperator, value: queryValue } = sanitizedQueryValue;
|
152
142
|
if (queryOperator === 'not_equals' && queryValue !== null) {
|
153
|
-
constraints.push(
|
143
|
+
constraints.push(or(isNull(rawColumn || table[columnName]), /* eslint-disable @typescript-eslint/no-explicit-any */ ne(rawColumn || table[columnName], queryValue)));
|
154
144
|
break;
|
155
145
|
}
|
156
146
|
if ((field.type === 'relationship' || field.type === 'upload') && Array.isArray(queryValue) && operator === 'not_in') {
|
157
|
-
constraints.push(
|
147
|
+
constraints.push(sql`${notInArray(table[columnName], queryValue)} OR
|
158
148
|
${table[columnName]}
|
159
149
|
IS
|
160
150
|
NULL`);
|
161
151
|
break;
|
162
152
|
}
|
163
153
|
if (operator === 'equals' && queryValue === null) {
|
164
|
-
constraints.push(
|
154
|
+
constraints.push(isNull(rawColumn || table[columnName]));
|
165
155
|
break;
|
166
156
|
}
|
167
157
|
if (operator === 'not_equals' && queryValue === null) {
|
168
|
-
constraints.push(
|
158
|
+
constraints.push(isNotNull(rawColumn || table[columnName]));
|
169
159
|
break;
|
170
160
|
}
|
171
|
-
constraints.push(
|
161
|
+
constraints.push(operatorMap[queryOperator](rawColumn || table[columnName], queryValue));
|
172
162
|
}
|
173
163
|
}
|
174
164
|
}
|
@@ -178,9 +168,9 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
178
168
|
}
|
179
169
|
if (constraints.length > 0) {
|
180
170
|
if (result) {
|
181
|
-
result =
|
171
|
+
result = and(result, ...constraints);
|
182
172
|
} else {
|
183
|
-
result =
|
173
|
+
result = and(...constraints);
|
184
174
|
}
|
185
175
|
}
|
186
176
|
if (constraints.length === 1 && !result) {
|
@@ -189,4 +179,4 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
|
|
189
179
|
return result;
|
190
180
|
}
|
191
181
|
|
192
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9xdWVyaWVzL3BhcnNlUGFyYW1zLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgU1FMIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgdHlwZSB7IEZpZWxkLCBPcGVyYXRvciwgV2hlcmUgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBhbmQsI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0eXBlb2YgcGF0aE9wZXJhdG9ycyA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgIGZvciAoY29uc3Qgb3BlcmF0b3Igb2YgT2JqZWN0LmtleXMocGF0aE9wZXJhdG9ycykpIHtcbiAgICAgICAgICAgICAgaWYgKHZhbGlkT3BlcmF0b3JzLmluY2x1ZGVzKG9wZXJhdG9yIGFzIE9wZXJhdG9yKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IHdoZXJlW3JlbGF0aW9uT3JQYXRoXVtvcGVyYXRvcl1cbiAgICAgICAgICAgICAgICBjb25zdCB7XG4gICAgICAgICAgICAgICAgICBjb2x1bW5OYW1lLFxuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHM6IHF1ZXJ5Q29uc3RyYWludHMsXG4gICAgICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgICAgIGdldE5vdE51bGxDb2x1bW5CeVZhbHVlLFxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzLFxuICAgICAgICAgICAgICAgICAgcmF3Q29sdW1uLFxuICAgICAgICAgICAgICAgICAgdGFibGUsXG4gICAgICAgICAgICAgICAgfSA9IGdldFRhYmxlQ29sdW1uRnJvbVBhdGgoe1xuICAgICAgICAgICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICAgICAgICAgIGNvbGxlY3Rpb25QYXRoOiByZWxhdGlvbk9yUGF0aCxcbiAgICAgICAgICAgICAgICAgIGZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIGpvaW5BbGlhc2VzLFxuICAgICAgICAgICAgICAgICAgam9pbnMsXG4gICAgICAgICAgICAgICAgICBsb2NhbGUsXG4gICAgICAgICAgICAgICAgICBwYXRoU2VnbWVudHM6IHJlbGF0aW9uT3JQYXRoLnJlcGxhY2UoL19fL2csICcuJykuc3BsaXQoJy4nKSxcbiAgICAgICAgICAgICAgICAgIHNlbGVjdEZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIHRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWwsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIHF1ZXJ5Q29uc3RyYWludHMuZm9yRWFjaCgoeyBjb2x1bW5OYW1lOiBjb2wsIHRhYmxlOiBjb25zdHJhaW50VGFibGUsIHZhbHVlIH0pID0+IHtcbiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICdzdHJpbmcnICYmIHZhbHVlLmluZGV4T2YoJyUnKSA+IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2gob3BlcmF0b3JNYXAubGlrZShjb25zdHJhaW50VGFibGVbY29sXSwgdmFsdWUpKVxuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChvcGVyYXRvck1hcC5lcXVhbHMoY29uc3RyYWludFRhYmxlW2NvbF0sIHZhbHVlKSlcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgWydqc29uJywgJ3JpY2hUZXh0J10uaW5jbHVkZXMoZmllbGQudHlwZSkgJiZcbiAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocGF0aFNlZ21lbnRzKSAmJlxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzLmxlbmd0aCA+IDFcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IHNlZ21lbnRzID0gcGF0aFNlZ21lbnRzLnNsaWNlKDEpXG4gICAgICAgICAgICAgICAgICBzZWdtZW50cy51bnNoaWZ0KHRhYmxlW2NvbHVtbk5hbWVdLm5hbWUpXG5cbiAgICAgICAgICAgICAgICAgIGlmIChmaWVsZC50eXBlID09PSAncmljaFRleHQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNyZWF0ZUpTT05RdWVyeSh7XG4gICAgICAgICAgICAgICAgICAgICAgb3BlcmF0b3IsXG4gICAgICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzOiBzZWdtZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdEFzQXJyYXk6IFsnY2hpbGRyZW4nXSxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdFJvb3RBc0FycmF5OiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWwsXG4gICAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChzcWwucmF3KGpzb25RdWVyeSkpXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNvbnZlcnRQYXRoVG9KU09OVHJhdmVyc2FsKHBhdGhTZWdtZW50cylcbiAgICAgICAgICAgICAgICAgIGNvbnN0IG9wZXJhdG9yS2V5cyA9IHtcbiAgICAgICAgICAgICAgICAgICAgY29udGFpbnM6IHsgb3BlcmF0b3I6ICdpbGlrZScsIHdpbGRjYXJkOiAnJScgfSxcbiAgICAgICAgICAgICAgICAgICAgZXF1YWxzOiB7IG9wZXJhdG9yOiAnPScsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgICBleGlzdHM6IHsgb3BlcmF0b3I6IHZhbCA9PT0gdHJ1ZSA/ICdpcyBub3QgbnVsbCcgOiAnaXMgbnVsbCcgfSxcbiAgICAgICAgICAgICAgICAgICAgbGlrZTogeyBvcGVyYXRvcjogJ2xpa2UnLCB3aWxkY2FyZDogJyUnIH0sXG4gICAgICAgICAgICAgICAgICAgIG5vdF9lcXVhbHM6IHsgb3BlcmF0b3I6ICc8PicsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgbGV0IGZvcm1hdHRlZFZhbHVlID0gYCcke29wZXJhdG9yS2V5c1tvcGVyYXRvcl0ud2lsZGNhcmR9JHt2YWx9JHtvcGVyYXRvcktleXNbb3BlcmF0b3JdLndpbGRjYXJkfSdgXG5cbiAgICAgICAgICAgICAgICAgIGlmIChvcGVyYXRvciA9PT0gJ2V4aXN0cycpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0dGVkVmFsdWUgPSAnJ1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICBzcWwucmF3KFxuICAgICAgICAgICAgICAgICAgICAgIGAke3RhYmxlW2NvbHVtbk5hbWVdLm5hbWV9JHtqc29uUXVlcnl9ICR7b3BlcmF0b3JLZXlzW29wZXJhdG9yXS5vcGVyYXRvcn0gJHtmb3JtYXR0ZWRWYWx1ZX1gLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChnZXROb3ROdWxsQ29sdW1uQnlWYWx1ZSkge1xuICAgICAgICAgICAgICAgICAgY29uc3QgY29sdW1uTmFtZSA9IGdldE5vdE51bGxDb2x1bW5CeVZhbHVlKHZhbClcbiAgICAgICAgICAgICAgICAgIGlmIChjb2x1bW5OYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goaXNOb3ROdWxsKHRhYmxlW2NvbHVtbk5hbWVdKSlcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBRdWVyeUVycm9yKFt7IHBhdGg6IHJlbGF0aW9uT3JQYXRoIH1dKVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAob3BlcmF0b3IgPT09ICdsaWtlJykge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgYW5kKC4uLnZhbC5zcGxpdCgnICcpLm1hcCgod29yZCkgPT4gaWxpa2UodGFibGVbY29sdW1uTmFtZV0sIGAlJHt3b3JkfSVgKSkpLFxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCBzYW5pdGl6ZWRRdWVyeVZhbHVlID0gc2FuaXRpemVRdWVyeVZhbHVlKHtcbiAgICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25PclBhdGgsXG4gICAgICAgICAgICAgICAgICB2YWwsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIGlmIChzYW5pdGl6ZWRRdWVyeVZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnN0IHsgb3BlcmF0b3I6IHF1ZXJ5T3BlcmF0b3IsIHZhbHVlOiBxdWVyeVZhbHVlIH0gPSBzYW5pdGl6ZWRRdWVyeVZhbHVlXG5cbiAgICAgICAgICAgICAgICBpZiAocXVlcnlPcGVyYXRvciA9PT0gJ25vdF9lcXVhbHMnICYmIHF1ZXJ5VmFsdWUgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIG9yKFxuICAgICAgICAgICAgICAgICAgICAgIGlzTnVsbChyYXdDb2x1bW4gfHwgdGFibGVbY29sdW1uTmFtZV0pLFxuICAgICAgICAgICAgICAgICAgICAgIC8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnkgKi9cbiAgICAgICAgICAgICAgICAgICAgICBuZTxhbnk+KHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSksXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgIChmaWVsZC50eXBlID09PSAncmVsYXRpb25zaGlwJyB8fCBmaWVsZC50eXBlID09PSAndXBsb2FkJykgJiZcbiAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocXVlcnlWYWx1ZSkgJiZcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yID09PSAnbm90X2luJ1xuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgc3FsYCR7bm90SW5BcnJheSh0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSl9IE9SXG4gICAgICAgICAgICAgICAgICAgICR7dGFibGVbY29sdW1uTmFtZV19XG4gICAgICAgICAgICAgICAgICAgIElTXG4gICAgICAgICAgICAgICAgICAgIE5VTExgLFxuICAgICAgICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChvcGVyYXRvciA9PT0gJ2VxdWFscycgJiYgcXVlcnlWYWx1ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChpc051bGwocmF3Q29sdW1uIHx8IHRhYmxlW2NvbHVtbk5hbWVdKSlcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKG9wZXJhdG9yID09PSAnbm90X2VxdWFscycgJiYgcXVlcnlWYWx1ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChpc05vdE51bGwocmF3Q29sdW1uIHx8IHRhYmxlW2NvbHVtbk5hbWVdKSlcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yTWFwW3F1ZXJ5T3BlcmF0b3JdKHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSksXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIGlmIChjb25zdHJhaW50cy5sZW5ndGggPiAwKSB7XG4gICAgaWYgKHJlc3VsdCkge1xuICAgICAgcmVzdWx0ID0gYW5kKHJlc3VsdCwgLi4uY29uc3RyYWludHMpXG4gICAgfSBlbHNlIHtcbiAgICAgIHJlc3VsdCA9IGFuZCguLi5jb25zdHJhaW50cylcbiAgICB9XG4gIH1cbiAgaWYgKGNvbnN0cmFpbnRzLmxlbmd0aCA9PT0gMSAmJiAhcmVzdWx0KSB7XG4gICAgO1tyZXN1bHRdID0gY29uc3RyYWludHNcbiAgfVxuXG4gIHJldHVybiByZXN1bHRcbn1cbiJdLCJuYW1lcyI6WyJwYXJzZVBhcmFtcyIsImFkYXB0ZXIiLCJmaWVsZHMiLCJqb2luQWxpYXNlcyIsImpvaW5zIiwibG9jYWxlIiwic2VsZWN0RmllbGRzIiwidGFibGVOYW1lIiwid2hlcmUiLCJyZXN1bHQiLCJjb25zd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JlbGF0aW9uT3JQYXRoXVxuICAgICAgICAgIGlmICh0eXBlb2YgcGF0aE9wZXJhdG9ycyA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgIGZvciAoY29uc3Qgb3BlcmF0b3Igb2YgT2JqZWN0LmtleXMocGF0aE9wZXJhdG9ycykpIHtcbiAgICAgICAgICAgICAgaWYgKHZhbGlkT3BlcmF0b3JzLmluY2x1ZGVzKG9wZXJhdG9yIGFzIE9wZXJhdG9yKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IHdoZXJlW3JlbGF0aW9uT3JQYXRoXVtvcGVyYXRvcl1cbiAgICAgICAgICAgICAgICBjb25zdCB7XG4gICAgICAgICAgICAgICAgICBjb2x1bW5OYW1lLFxuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHM6IHF1ZXJ5Q29uc3RyYWludHMsXG4gICAgICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgICAgIGdldE5vdE51bGxDb2x1bW5CeVZhbHVlLFxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzLFxuICAgICAgICAgICAgICAgICAgcmF3Q29sdW1uLFxuICAgICAgICAgICAgICAgICAgdGFibGUsXG4gICAgICAgICAgICAgICAgfSA9IGdldFRhYmxlQ29sdW1uRnJvbVBhdGgoe1xuICAgICAgICAgICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICAgICAgICAgIGNvbGxlY3Rpb25QYXRoOiByZWxhdGlvbk9yUGF0aCxcbiAgICAgICAgICAgICAgICAgIGZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIGpvaW5BbGlhc2VzLFxuICAgICAgICAgICAgICAgICAgam9pbnMsXG4gICAgICAgICAgICAgICAgICBsb2NhbGUsXG4gICAgICAgICAgICAgICAgICBwYXRoU2VnbWVudHM6IHJlbGF0aW9uT3JQYXRoLnJlcGxhY2UoL19fL2csICcuJykuc3BsaXQoJy4nKSxcbiAgICAgICAgICAgICAgICAgIHNlbGVjdEZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIHRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWwsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIHF1ZXJ5Q29uc3RyYWludHMuZm9yRWFjaCgoeyBjb2x1bW5OYW1lOiBjb2wsIHRhYmxlOiBjb25zdHJhaW50VGFibGUsIHZhbHVlIH0pID0+IHtcbiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICdzdHJpbmcnICYmIHZhbHVlLmluZGV4T2YoJyUnKSA+IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2gob3BlcmF0b3JNYXAubGlrZShjb25zdHJhaW50VGFibGVbY29sXSwgdmFsdWUpKVxuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChvcGVyYXRvck1hcC5lcXVhbHMoY29uc3RyYWludFRhYmxlW2NvbF0sIHZhbHVlKSlcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgWydqc29uJywgJ3JpY2hUZXh0J10uaW5jbHVkZXMoZmllbGQudHlwZSkgJiZcbiAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocGF0aFNlZ21lbnRzKSAmJlxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzLmxlbmd0aCA+IDFcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IHNlZ21lbnRzID0gcGF0aFNlZ21lbnRzLnNsaWNlKDEpXG4gICAgICAgICAgICAgICAgICBzZWdtZW50cy51bnNoaWZ0KHRhYmxlW2NvbHVtbk5hbWVdLm5hbWUpXG5cbiAgICAgICAgICAgICAgICAgIGlmIChmaWVsZC50eXBlID09PSAncmljaFRleHQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNyZWF0ZUpTT05RdWVyeSh7XG4gICAgICAgICAgICAgICAgICAgICAgb3BlcmF0b3IsXG4gICAgICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzOiBzZWdtZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdEFzQXJyYXk6IFsnY2hpbGRyZW4nXSxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdFJvb3RBc0FycmF5OiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWwsXG4gICAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChzcWwucmF3KGpzb25RdWVyeSkpXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNvbnZlcnRQYXRoVG9KU09OVHJhdmVyc2FsKHBhdGhTZWdtZW50cylcbiAgICAgICAgICAgICAgICAgIGNvbnN0IG9wZXJhdG9yS2V5cyA9IHtcbiAgICAgICAgICAgICAgICAgICAgY29udGFpbnM6IHsgb3BlcmF0b3I6ICdpbGlrZScsIHdpbGRjYXJkOiAnJScgfSxcbiAgICAgICAgICAgICAgICAgICAgZXF1YWxzOiB7IG9wZXJhdG9yOiAnPScsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgICBleGlzdHM6IHsgb3BlcmF0b3I6IHZhbCA9PT0gdHJ1ZSA/ICdpcyBub3QgbnVsbCcgOiAnaXMgbnVsbCcgfSxcbiAgICAgICAgICAgICAgICAgICAgbGlrZTogeyBvcGVyYXRvcjogJ2xpa2UnLCB3aWxkY2FyZDogJyUnIH0sXG4gICAgICAgICAgICAgICAgICAgIG5vdF9lcXVhbHM6IHsgb3BlcmF0b3I6ICc8PicsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgbGV0IGZvcm1hdHRlZFZhbHVlID0gYCcke29wZXJhdG9yS2V5c1tvcGVyYXRvcl0ud2lsZGNhcmR9JHt2YWx9JHtvcGVyYXRvcktleXNbb3BlcmF0b3JdLndpbGRjYXJkfSdgXG5cbiAgICAgICAgICAgICAgICAgIGlmIChvcGVyYXRvciA9PT0gJ2V4aXN0cycpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0dGVkVmFsdWUgPSAnJ1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICBzcWwucmF3KFxuICAgICAgICAgICAgICAgICAgICAgIGAke3RhYmxlW2NvbHVtbk5hbWVdLm5hbWV9JHtqc29uUXVlcnl9ICR7b3BlcmF0b3JLZXlzW29wZXJhdG9yXS5vcGVyYXRvcn0gJHtmb3JtYXR0ZWRWYWx1ZX1gLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChnZXROb3ROdWxsQ29sdW1uQnlWYWx1ZSkge1xuICAgICAgICAgICAgICAgICAgY29uc3QgY29sdW1uTmFtZSA9IGdldE5vdE51bGxDb2x1bW5CeVZhbHVlKHZhbClcbiAgICAgICAgICAgICAgICAgIGlmIChjb2x1bW5OYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goaXNOb3ROdWxsKHRhYmxlW2NvbHVtbk5hbWVdKSlcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBRdWVyeUVycm9yKFt7IHBhdGg6IHJlbGF0aW9uT3JQYXRoIH1dKVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAob3BlcmF0b3IgPT09ICdsaWtlJykge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgYW5kKC4uLnZhbC5zcGxpdCgnICcpLm1hcCgod29yZCkgPT4gaWxpa2UodGFibGVbY29sdW1uTmFtZV0sIGAlJHt3b3JkfSVgKSkpLFxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCBzYW5pdGl6ZWRRdWVyeVZhbHVlID0gc2FuaXRpemVRdWVyeVZhbHVlKHtcbiAgICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25PclBhdGgsXG4gICAgICAgICAgICAgICAgICB2YWwsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIGlmIChzYW5pdGl6ZWRRdWVyeVZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnN0IHsgb3BlcmF0b3I6IHF1ZXJ5T3BlcmF0b3IsIHZhbHVlOiBxdWVyeVZhbHVlIH0gPSBzYW5pdGl6ZWRRdWVyeVZhbHVlXG5cbiAgICAgICAgICAgICAgICBpZiAocXVlcnlPcGVyYXRvciA9PT0gJ25vdF9lcXVhbHMnICYmIHF1ZXJ5VmFsdWUgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIG9yKFxuICAgICAgICAgICAgICAgICAgICAgIGlzTnVsbChyYXdDb2x1bW4gfHwgdGFibGVbY29sdW1uTmFtZV0pLFxuICAgICAgICAgICAgICAgICAgICAgIC8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnkgKi9cbiAgICAgICAgICAgICAgICAgICAgICBuZTxhbnk+KHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSksXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgIChmaWVsZC50eXBlID09PSAncmVsYXRpb25zaGlwJyB8fCBmaWVsZC50eXBlID09PSAndXBsb2FkJykgJiZcbiAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocXVlcnlWYWx1ZSkgJiZcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yID09PSAnbm90X2luJ1xuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgc3FsYCR7bm90SW5BcnJheSh0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSl9IE9SXG4gICAgICAgICAgICAgICAgICAgICR7dGFibGVbY29sdW1uTmFtZV19XG4gICAgICAgICAgICAgICAgICAgIElTXG4gICAgICAgICAgICAgICAgICAgIE5VTExgLFxuICAgICAgICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChvcGVyYXRvciA9PT0gJ2VxdWFscycgJiYgcXVlcnlWYWx1ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChpc051bGwocmF3Q29sdW1uIHx8IHRhYmxlW2NvbHVtbk5hbWVdKSlcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKG9wZXJhdG9yID09PSAnbm90X2VxdWFscycgJiYgcXVlcnlWYWx1ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChpc05vdE51bGwocmF3Q29sdW1uIHx8IHRhYmxlW2NvbHVtbk5hbWVdKSlcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yTWFwW3F1ZXJ5T3BlcmF0b3JdKHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSksXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIGlmIChjb25zdHJhaW50cy5sZW5ndGggPiAwKSB7XG4gICAgaWYgKHJlc3VsdCkge1xuICAgICAgcmVzdWx0ID0gYW5kKHJlc3VsdCwgLi4uY29uc3RyYWludHMpXG4gICAgfSBlbHNlIHtcbiAgICAgIHJlc3VsdCA9IGFuZCguLi5jb25zdHJhaW50cylcbiAgICB9XG4gIH1cbiAgaWYgKGNvbnN0cmFpbnRzLmxlbmd0aCA9PT0gMSAmJiAhcmVzdWx0KSB7XG4gICAgO1tyZXN1bHRdID0gY29uc3RyYWludHNcbiAgfVxuXG4gIHJldHVybiByZXN1bHRcbn1cbiJdLCJuYW1lcyI6WyJhbmQiLCJpbGlrZSIsImlzTm90TnVsbCIsImlzTnVsbCIsIm5lIiwibm90SW5BcnJheSIsIm9yIiwic3FsIiwiUXVlcnlFcnJvciIsInZhbGlkT3Bl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LENBQUMsRUFBRUYsV0FBVzBDLEtBQUssQ0FBQ04sV0FBVyxFQUFFc0MsWUFBWTtvQkFDaEQsRUFBRWhDLEtBQUssQ0FBQ04sV0FBVyxDQUFDOzt3QkFFaEIsQ0FBQztvQ0FHUDtnQ0FDRjtnQ0FFQSxJQUFJSCxhQUFhLFlBQVl5QyxlQUFlLE1BQU07b0NBQ2hEckQsWUFBWThCLElBQUksQ0FBQ3JELE9BQU8yQyxhQUFhQyxLQUFLLENBQUNOLFdBQVc7b0NBQ3REO2dDQUNGO2dDQUVBLElBQUlILGFBQWEsZ0JBQWdCeUMsZUFBZSxNQUFNO29DQUNwRHJELFlBQVk4QixJQUFJLENBQUN0RCxVQUFVNEMsYUFBYUMsS0FBSyxDQUFDTixXQUFXO29DQUN6RDtnQ0FDRjtnQ0FFQWYsWUFBWThCLElBQUksQ0FDZDFDLFdBQVcsQ0FBQ2dFLGNBQWMsQ0FBQ2hDLGFBQWFDLEtBQUssQ0FBQ04sV0FBVyxFQUFFc0M7NEJBRS9EO3dCQUNGO29CQUNGO2dCQUNGO1lBQ0Y7UUFDRjtJQUNGO0lBQ0EsSUFBSXJELFlBQVlHLE1BQU0sR0FBRyxHQUFHO1FBQzFCLElBQUlKLFFBQVE7WUFDVkEsU0FBU3pCLElBQUl5QixXQUFXQztRQUMxQixPQUFPO1lBQ0xELFNBQVN6QixPQUFPMEI7UUFDbEI7SUFDRjtJQUNBLElBQUlBLFlBQVlHLE1BQU0sS0FBSyxLQUFLLENBQUNKLFFBQVE7UUFDdEMsQ0FBQ0EsT0FBTyxHQUFHQztJQUNkO0lBRUEsT0FBT0Q7QUFDVCJ9
|
@@ -1,20 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
})
|
5
|
-
Object.defineProperty(exports, "sanitizeQueryValue", {
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return sanitizeQueryValue;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const _errors = require("payload/errors");
|
12
|
-
const _types = require("payload/types");
|
13
|
-
const _utilities = require("payload/utilities");
|
14
|
-
const sanitizeQueryValue = ({ adapter, field, operator: operatorArg, relationOrPath, val })=>{
|
1
|
+
import { APIError } from 'payload/errors';
|
2
|
+
import { fieldAffectsData } from 'payload/types';
|
3
|
+
import { createArrayFromCommaDelineated } from 'payload/utilities';
|
4
|
+
export const sanitizeQueryValue = ({ adapter, field, operator: operatorArg, relationOrPath, val })=>{
|
15
5
|
let operator = operatorArg;
|
16
6
|
let formattedValue = val;
|
17
|
-
if (!
|
7
|
+
if (!fieldAffectsData(field)) return {
|
18
8
|
operator,
|
19
9
|
value: formattedValue
|
20
10
|
};
|
@@ -42,7 +32,7 @@ const sanitizeQueryValue = ({ adapter, field, operator: operatorArg, relationOrP
|
|
42
32
|
'not_in'
|
43
33
|
].includes(operator)) {
|
44
34
|
if (typeof formattedValue === 'string') {
|
45
|
-
formattedValue =
|
35
|
+
formattedValue = createArrayFromCommaDelineated(formattedValue);
|
46
36
|
if (field.type === 'number') {
|
47
37
|
formattedValue = formattedValue.map((arrayVal)=>parseFloat(arrayVal));
|
48
38
|
}
|
@@ -77,7 +67,7 @@ const sanitizeQueryValue = ({ adapter, field, operator: operatorArg, relationOrP
|
|
77
67
|
}
|
78
68
|
}
|
79
69
|
if (operator === 'near' || operator === 'within' || operator === 'intersects') {
|
80
|
-
throw new
|
70
|
+
throw new APIError(`Querying with '${operator}' is not supported with the postgres database adapter.`);
|
81
71
|
}
|
82
72
|
if (operator === 'contains') {
|
83
73
|
formattedValue = `%${formattedValue}%`;
|
@@ -94,4 +84,4 @@ const sanitizeQueryValue = ({ adapter, field, operator: operatorArg, relationOrP
|
|
94
84
|
};
|
95
85
|
};
|
96
86
|
|
97
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9xdWVyaWVzL3Nhbml0aXplUXVlcnlWYWx1ZS50cyJdLCJzb3VyY2V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JQSxtQkFBbUIsT0FBTztZQUM1QkosV0FBVztRQUNiO0lBQ0Y7SUFFQSxPQUFPO1FBQUVBO1FBQVVLLE9BQU9EO0lBQWU7QUFDM0MsRUFBQyJ9
|
package/dist/queryDrafts.js
CHANGED
@@ -1,32 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
}
|
5
|
-
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return queryDrafts;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const _database = require("payload/database");
|
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 queryDrafts = async function queryDrafts({ collection, limit, locale, page = 1, pagination, req = {}, sort, where }) {
|
1
|
+
import { combineQueries } from 'payload/database';
|
2
|
+
import { buildVersionCollectionFields } from 'payload/versions';
|
3
|
+
import toSnakeCase from 'to-snake-case';
|
4
|
+
import { findMany } from './find/findMany';
|
5
|
+
export const queryDrafts = async function queryDrafts({ collection, limit, locale, page = 1, pagination, req = {}, sort, where }) {
|
21
6
|
const collectionConfig = this.payload.collections[collection].config;
|
22
|
-
const tableName = `_${(
|
23
|
-
const fields =
|
24
|
-
const combinedWhere =
|
7
|
+
const tableName = `_${toSnakeCase(collection)}_v`;
|
8
|
+
const fields = buildVersionCollectionFields(collectionConfig);
|
9
|
+
const combinedWhere = combineQueries({
|
25
10
|
latest: {
|
26
11
|
equals: true
|
27
12
|
}
|
28
13
|
}, where);
|
29
|
-
const result = await
|
14
|
+
const result = await findMany({
|
30
15
|
adapter: this,
|
31
16
|
fields,
|
32
17
|
limit,
|
@@ -53,4 +38,4 @@ const queryDrafts = async function queryDrafts({ collection, limit, locale, page
|
|
53
38
|
};
|
54
39
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