@webiny/api-audit-logs-ddb 6.5.2-beta.0 → 6.5.2-beta.2
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/cursorSchema.js +2 -1
- package/cursorSchema.js.map +1 -1
- package/package.json +11 -11
package/cursorSchema.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { parseJson } from "@webiny/utils/parseJson.js";
|
|
1
2
|
import zod from "zod";
|
|
2
3
|
import { decodeCursor } from "@webiny/db-dynamodb";
|
|
3
4
|
const schema = zod.string().transform((value)=>{
|
|
4
5
|
const decoded = decodeCursor(value);
|
|
5
6
|
if (!decoded) throw new Error("Invalid cursor.");
|
|
6
7
|
try {
|
|
7
|
-
return
|
|
8
|
+
return parseJson(decoded);
|
|
8
9
|
} catch {
|
|
9
10
|
return decoded;
|
|
10
11
|
}
|
package/cursorSchema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursorSchema.js","sources":["../src/cursorSchema.ts"],"sourcesContent":["import zod from \"zod\";\nimport { decodeCursor } from \"@webiny/db-dynamodb\";\n\nconst schema = zod\n .string()\n .transform(value => {\n const decoded = decodeCursor(value);\n if (!decoded) {\n throw new Error(\"Invalid cursor.\");\n }\n try {\n return
|
|
1
|
+
{"version":3,"file":"cursorSchema.js","sources":["../src/cursorSchema.ts"],"sourcesContent":["import { parseJson } from \"@webiny/utils/parseJson.js\";\nimport zod from \"zod\";\nimport { decodeCursor } from \"@webiny/db-dynamodb\";\n\nconst schema = zod\n .string()\n .transform(value => {\n const decoded = decodeCursor(value);\n if (!decoded) {\n throw new Error(\"Invalid cursor.\");\n }\n try {\n return parseJson(decoded);\n } catch {\n return decoded;\n }\n })\n .pipe(\n zod\n .object({\n PK: zod.string(),\n SK: zod.string()\n })\n .passthrough()\n );\n\nexport const fetchCursor = (input: unknown) => {\n const result = schema.safeParse(input);\n if (!result.success) {\n return undefined;\n }\n return result.data;\n};\n"],"names":["schema","zod","value","decoded","decodeCursor","Error","parseJson","fetchCursor","input","result"],"mappings":";;;AAIA,MAAMA,SAASC,IAAAA,MACJ,GACN,SAAS,CAACC,CAAAA;IACP,MAAMC,UAAUC,aAAaF;IAC7B,IAAI,CAACC,SACD,MAAM,IAAIE,MAAM;IAEpB,IAAI;QACA,OAAOC,UAAUH;IACrB,EAAE,OAAM;QACJ,OAAOA;IACX;AACJ,GACC,IAAI,CACDF,IAAAA,MACW,CAAC;IACJ,IAAIA,IAAI,MAAM;IACd,IAAIA,IAAI,MAAM;AAClB,GACC,WAAW;AAGjB,MAAMM,cAAc,CAACC;IACxB,MAAMC,SAAST,OAAO,SAAS,CAACQ;IAChC,IAAI,CAACC,OAAO,OAAO,EACf;IAEJ,OAAOA,OAAO,IAAI;AACtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-audit-logs-ddb",
|
|
3
|
-
"version": "6.5.2-beta.
|
|
3
|
+
"version": "6.5.2-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-audit-logs",
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"./*": "./*"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@webiny/api": "6.5.2-beta.
|
|
25
|
-
"@webiny/api-audit-logs": "6.5.2-beta.
|
|
26
|
-
"@webiny/aws-sdk": "6.5.2-beta.
|
|
27
|
-
"@webiny/db-dynamodb": "6.5.2-beta.
|
|
28
|
-
"@webiny/error": "6.5.2-beta.
|
|
29
|
-
"@webiny/handler": "6.5.2-beta.
|
|
30
|
-
"@webiny/utils": "6.5.2-beta.
|
|
24
|
+
"@webiny/api": "6.5.2-beta.2",
|
|
25
|
+
"@webiny/api-audit-logs": "6.5.2-beta.2",
|
|
26
|
+
"@webiny/aws-sdk": "6.5.2-beta.2",
|
|
27
|
+
"@webiny/db-dynamodb": "6.5.2-beta.2",
|
|
28
|
+
"@webiny/error": "6.5.2-beta.2",
|
|
29
|
+
"@webiny/handler": "6.5.2-beta.2",
|
|
30
|
+
"@webiny/utils": "6.5.2-beta.2",
|
|
31
31
|
"zod": "4.6.7"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@webiny/build-tools": "6.5.2-beta.
|
|
35
|
-
"@webiny/project-utils": "6.5.2-beta.
|
|
36
|
-
"rimraf": "6.1.
|
|
34
|
+
"@webiny/build-tools": "6.5.2-beta.2",
|
|
35
|
+
"@webiny/project-utils": "6.5.2-beta.2",
|
|
36
|
+
"rimraf": "6.1.4",
|
|
37
37
|
"typescript": "7.0.2"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|