@tinacms/datalayer 0.0.0-ecea7ac-20241011043815 → 0.0.0-ee8d9a3-20250429131017
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.js +10 -5
- package/dist/index.mjs +7 -2
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -17,8 +17,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
AuditFileSystemBridge: () => import_graphql.AuditFileSystemBridge,
|
|
23
23
|
FilesystemBridge: () => import_graphql.FilesystemBridge,
|
|
24
24
|
IsomorphicBridge: () => import_graphql.IsomorphicBridge,
|
|
@@ -29,7 +29,7 @@ __export(src_exports, {
|
|
|
29
29
|
createLocalDatabase: () => import_graphql.createLocalDatabase,
|
|
30
30
|
resolve: () => import_graphql.resolve
|
|
31
31
|
});
|
|
32
|
-
module.exports = __toCommonJS(
|
|
32
|
+
module.exports = __toCommonJS(index_exports);
|
|
33
33
|
var import_graphql = require("@tinacms/graphql");
|
|
34
34
|
|
|
35
35
|
// src/backend/index.ts
|
|
@@ -69,7 +69,9 @@ function MakeNodeApiHandler({
|
|
|
69
69
|
const url = new URL(path, `http://${((_b = req.headers) == null ? void 0 : _b.host) || "localhost"}`);
|
|
70
70
|
const routes = (_d = (_c = url.pathname) == null ? void 0 : _c.replace(opts.basePath, "")) == null ? void 0 : _d.split("/");
|
|
71
71
|
if (typeof routes === "string") {
|
|
72
|
-
throw new Error(
|
|
72
|
+
throw new Error(
|
|
73
|
+
"Please name your next api route [...routes] not [route]"
|
|
74
|
+
);
|
|
73
75
|
}
|
|
74
76
|
if (!(routes == null ? void 0 : routes.length)) {
|
|
75
77
|
console.error(
|
|
@@ -119,6 +121,7 @@ function MakeNodeApiHandler({
|
|
|
119
121
|
const result = await databaseClient.request({
|
|
120
122
|
query,
|
|
121
123
|
variables,
|
|
124
|
+
// @ts-ignore
|
|
122
125
|
user: (_a2 = req2 == null ? void 0 : req2.session) == null ? void 0 : _a2.user
|
|
123
126
|
});
|
|
124
127
|
res2.statusCode = 200;
|
|
@@ -145,7 +148,9 @@ function MakeNodeApiHandler({
|
|
|
145
148
|
const isAuth = await isAuthorized(req, res);
|
|
146
149
|
if (isAuth.isAuthorized === false) {
|
|
147
150
|
res.statusCode = isAuth.errorCode;
|
|
148
|
-
res.write(
|
|
151
|
+
res.write(
|
|
152
|
+
JSON.stringify({ error: isAuth.errorMessage || "not found" })
|
|
153
|
+
);
|
|
149
154
|
res.end();
|
|
150
155
|
return;
|
|
151
156
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -45,7 +45,9 @@ function MakeNodeApiHandler({
|
|
|
45
45
|
const url = new URL(path, `http://${req.headers?.host || "localhost"}`);
|
|
46
46
|
const routes = url.pathname?.replace(opts.basePath, "")?.split("/");
|
|
47
47
|
if (typeof routes === "string") {
|
|
48
|
-
throw new Error(
|
|
48
|
+
throw new Error(
|
|
49
|
+
"Please name your next api route [...routes] not [route]"
|
|
50
|
+
);
|
|
49
51
|
}
|
|
50
52
|
if (!routes?.length) {
|
|
51
53
|
console.error(
|
|
@@ -94,6 +96,7 @@ function MakeNodeApiHandler({
|
|
|
94
96
|
const result = await databaseClient.request({
|
|
95
97
|
query,
|
|
96
98
|
variables,
|
|
99
|
+
// @ts-ignore
|
|
97
100
|
user: req2?.session?.user
|
|
98
101
|
});
|
|
99
102
|
res2.statusCode = 200;
|
|
@@ -120,7 +123,9 @@ function MakeNodeApiHandler({
|
|
|
120
123
|
const isAuth = await isAuthorized(req, res);
|
|
121
124
|
if (isAuth.isAuthorized === false) {
|
|
122
125
|
res.statusCode = isAuth.errorCode;
|
|
123
|
-
res.write(
|
|
126
|
+
res.write(
|
|
127
|
+
JSON.stringify({ error: isAuth.errorMessage || "not found" })
|
|
128
|
+
);
|
|
124
129
|
res.end();
|
|
125
130
|
return;
|
|
126
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/datalayer",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-ee8d9a3-20250429131017",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"typings": "dist/index",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
13
14
|
"import": "./dist/index.mjs",
|
|
14
|
-
"require": "./dist/index.js"
|
|
15
|
-
"types": "./dist/index.d.ts"
|
|
15
|
+
"require": "./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./dist/*": {
|
|
18
|
+
"types": "./dist/*.d.ts",
|
|
18
19
|
"import": "./dist/*.mjs",
|
|
19
|
-
"require": "./dist/*.js"
|
|
20
|
-
"types": "./dist/*.d.ts"
|
|
20
|
+
"require": "./dist/*.js"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@tinacms/graphql": "0.0.0-
|
|
34
|
+
"@tinacms/graphql": "0.0.0-ee8d9a3-20250429131017"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"registry": "https://registry.npmjs.org"
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"@types/level": "^6.0.3",
|
|
48
48
|
"@types/lodash.camelcase": "^4.3.9",
|
|
49
49
|
"@types/lodash.upperfirst": "^4.3.9",
|
|
50
|
-
"@types/node": "^22.
|
|
50
|
+
"@types/node": "^22.13.1",
|
|
51
51
|
"@types/normalize-path": "^3.0.2",
|
|
52
52
|
"@types/yup": "^0.29.14",
|
|
53
53
|
"jest": "^29.7.0",
|
|
54
54
|
"jest-diff": "^29.7.0",
|
|
55
55
|
"jest-file-snapshot": "^0.5.0",
|
|
56
56
|
"jest-matcher-utils": "^29.7.0",
|
|
57
|
-
"typescript": "^5.
|
|
58
|
-
"@tinacms/scripts": "
|
|
57
|
+
"typescript": "^5.7.3",
|
|
58
|
+
"@tinacms/scripts": "1.3.4"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"types": "pnpm tsc",
|