@webiny/api-record-locking 6.5.0-beta.4 → 6.5.0-beta.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-record-locking",
|
|
3
|
-
"version": "6.5.0-beta.
|
|
3
|
+
"version": "6.5.0-beta.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -16,26 +16,26 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@webiny/api": "6.5.0-beta.
|
|
20
|
-
"@webiny/api-headless-cms": "6.5.0-beta.
|
|
21
|
-
"@webiny/api-websockets": "6.5.0-beta.
|
|
22
|
-
"@webiny/feature": "6.5.0-beta.
|
|
23
|
-
"@webiny/handler": "6.5.0-beta.
|
|
24
|
-
"@webiny/handler-aws": "6.5.0-beta.
|
|
25
|
-
"@webiny/handler-graphql": "6.5.0-beta.
|
|
26
|
-
"@webiny/plugins": "6.5.0-beta.
|
|
27
|
-
"@webiny/utils": "6.5.0-beta.
|
|
19
|
+
"@webiny/api": "6.5.0-beta.6",
|
|
20
|
+
"@webiny/api-headless-cms": "6.5.0-beta.6",
|
|
21
|
+
"@webiny/api-websockets": "6.5.0-beta.6",
|
|
22
|
+
"@webiny/feature": "6.5.0-beta.6",
|
|
23
|
+
"@webiny/handler": "6.5.0-beta.6",
|
|
24
|
+
"@webiny/handler-aws": "6.5.0-beta.6",
|
|
25
|
+
"@webiny/handler-graphql": "6.5.0-beta.6",
|
|
26
|
+
"@webiny/plugins": "6.5.0-beta.6",
|
|
27
|
+
"@webiny/utils": "6.5.0-beta.6"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@webiny/api-core": "6.5.0-beta.
|
|
31
|
-
"@webiny/build-tools": "6.5.0-beta.
|
|
32
|
-
"@webiny/project-utils": "6.5.0-beta.
|
|
33
|
-
"@webiny/wcp": "6.5.0-beta.
|
|
30
|
+
"@webiny/api-core": "6.5.0-beta.6",
|
|
31
|
+
"@webiny/build-tools": "6.5.0-beta.6",
|
|
32
|
+
"@webiny/project-utils": "6.5.0-beta.6",
|
|
33
|
+
"@webiny/wcp": "6.5.0-beta.6",
|
|
34
34
|
"graphql": "16.14.2",
|
|
35
35
|
"rimraf": "6.1.3",
|
|
36
|
-
"type-fest": "5.
|
|
36
|
+
"type-fest": "5.10.0",
|
|
37
37
|
"typescript": "7.0.2",
|
|
38
|
-
"vitest": "
|
|
38
|
+
"vitest": "5.0.2"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -11,8 +11,7 @@ const convertWhereCondition = (where)=>{
|
|
|
11
11
|
if (!value) continue;
|
|
12
12
|
for(const subKey in value)value[subKey] = convertWhereCondition(value[subKey]);
|
|
13
13
|
continue;
|
|
14
|
-
}
|
|
15
|
-
if (false === key.startsWith("id")) continue;
|
|
14
|
+
} else if (false === key.startsWith("id")) continue;
|
|
16
15
|
const value = where[key];
|
|
17
16
|
if (!value) continue;
|
|
18
17
|
const newKey = key.replace("id", "entryId");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils/convertWhereCondition.js","sources":["../../src/utils/convertWhereCondition.ts"],"sourcesContent":["import type { IRecordLockingListLockRecordsParams } from \"~/types.js\";\nimport { createLockRecordDatabaseId } from \"~/utils/lockRecordDatabaseId.js\";\n\ntype IWhere = IRecordLockingListLockRecordsParams[\"where\"] | undefined;\n\nconst attachPrefix = (value: string | string[]) => {\n if (Array.isArray(value)) {\n return value.map(createLockRecordDatabaseId);\n }\n return createLockRecordDatabaseId(value);\n};\n\nexport const convertWhereCondition = (where: IWhere): IWhere => {\n if (!where) {\n return where;\n }\n for (const key in where) {\n if (key.startsWith(\"AND\") || key.startsWith(\"OR\")) {\n const value = where[key as keyof typeof where] as IWhere[] | undefined;\n if (!value) {\n continue;\n }\n for (const subKey in value) {\n value[subKey] = convertWhereCondition(value[subKey]);\n }\n continue;\n } else if (key.startsWith(\"id\") === false) {\n continue;\n }\n const value = where[key as keyof typeof where];\n if (!value) {\n continue;\n }\n\n const newKey = key.replace(\"id\", \"entryId\") as keyof typeof where;\n // @ts-expect-error\n where[newKey] = attachPrefix(where[key]);\n // @ts-expect-error\n delete where[key];\n }\n return where;\n};\n"],"names":["attachPrefix","value","Array","createLockRecordDatabaseId","convertWhereCondition","where","key","subKey","newKey"],"mappings":";AAKA,MAAMA,eAAe,CAACC;IAClB,IAAIC,MAAM,OAAO,CAACD,QACd,OAAOA,MAAM,GAAG,CAACE;IAErB,OAAOA,2BAA2BF;AACtC;AAEO,MAAMG,wBAAwB,CAACC;IAClC,IAAI,CAACA,OACD,OAAOA;IAEX,IAAK,MAAMC,OAAOD,MAAO;QACrB,IAAIC,IAAI,UAAU,CAAC,UAAUA,IAAI,UAAU,CAAC,OAAO;YAC/C,MAAML,QAAQI,KAAK,CAACC,IAA0B;YAC9C,IAAI,CAACL,OACD;YAEJ,IAAK,MAAMM,UAAUN,MACjBA,KAAK,CAACM,OAAO,GAAGH,sBAAsBH,KAAK,CAACM,OAAO;YAEvD;QACJ
|
|
1
|
+
{"version":3,"file":"utils/convertWhereCondition.js","sources":["../../src/utils/convertWhereCondition.ts"],"sourcesContent":["import type { IRecordLockingListLockRecordsParams } from \"~/types.js\";\nimport { createLockRecordDatabaseId } from \"~/utils/lockRecordDatabaseId.js\";\n\ntype IWhere = IRecordLockingListLockRecordsParams[\"where\"] | undefined;\n\nconst attachPrefix = (value: string | string[]) => {\n if (Array.isArray(value)) {\n return value.map(createLockRecordDatabaseId);\n }\n return createLockRecordDatabaseId(value);\n};\n\nexport const convertWhereCondition = (where: IWhere): IWhere => {\n if (!where) {\n return where;\n }\n for (const key in where) {\n if (key.startsWith(\"AND\") || key.startsWith(\"OR\")) {\n const value = where[key as keyof typeof where] as IWhere[] | undefined;\n if (!value) {\n continue;\n }\n for (const subKey in value) {\n value[subKey] = convertWhereCondition(value[subKey]);\n }\n continue;\n } else if (key.startsWith(\"id\") === false) {\n continue;\n }\n const value = where[key as keyof typeof where];\n if (!value) {\n continue;\n }\n\n const newKey = key.replace(\"id\", \"entryId\") as keyof typeof where;\n // @ts-expect-error\n where[newKey] = attachPrefix(where[key]);\n // @ts-expect-error\n delete where[key];\n }\n return where;\n};\n"],"names":["attachPrefix","value","Array","createLockRecordDatabaseId","convertWhereCondition","where","key","subKey","newKey"],"mappings":";AAKA,MAAMA,eAAe,CAACC;IAClB,IAAIC,MAAM,OAAO,CAACD,QACd,OAAOA,MAAM,GAAG,CAACE;IAErB,OAAOA,2BAA2BF;AACtC;AAEO,MAAMG,wBAAwB,CAACC;IAClC,IAAI,CAACA,OACD,OAAOA;IAEX,IAAK,MAAMC,OAAOD,MAAO;QACrB,IAAIC,IAAI,UAAU,CAAC,UAAUA,IAAI,UAAU,CAAC,OAAO;YAC/C,MAAML,QAAQI,KAAK,CAACC,IAA0B;YAC9C,IAAI,CAACL,OACD;YAEJ,IAAK,MAAMM,UAAUN,MACjBA,KAAK,CAACM,OAAO,GAAGH,sBAAsBH,KAAK,CAACM,OAAO;YAEvD;QACJ,OAAO,IAAID,AAAyB,UAAzBA,IAAI,UAAU,CAAC,OACtB;QAEJ,MAAML,QAAQI,KAAK,CAACC,IAA0B;QAC9C,IAAI,CAACL,OACD;QAGJ,MAAMO,SAASF,IAAI,OAAO,CAAC,MAAM;QAEjCD,KAAK,CAACG,OAAO,GAAGR,aAAaK,KAAK,CAACC,IAAI;QAEvC,OAAOD,KAAK,CAACC,IAAI;IACrB;IACA,OAAOD;AACX"}
|