@nextsparkjs/core 0.1.0-beta.155 → 0.1.0-beta.156
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-handler.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/entity/generic-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAyhBvD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CA+fnF;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"generic-handler.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/entity/generic-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAyhBvD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CA+fnF;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAmZrF;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAmMpJ;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAyXtJ;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAoJtJ;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAEtF"}
|
|
@@ -681,7 +681,14 @@ async function handleGenericCreate(request) {
|
|
|
681
681
|
let values;
|
|
682
682
|
let paramCount;
|
|
683
683
|
const isSharedEntity = ((_b = entityConfig.access) == null ? void 0 : _b.shared) === true;
|
|
684
|
-
|
|
684
|
+
let userIdToUse = authResult.user.id;
|
|
685
|
+
if (isSharedEntity && Object.prototype.hasOwnProperty.call(entityData, "userId")) {
|
|
686
|
+
if (rawUserId === null) {
|
|
687
|
+
userIdToUse = null;
|
|
688
|
+
} else if (typeof rawUserId === "string" && rawUserId.trim() !== "") {
|
|
689
|
+
userIdToUse = rawUserId;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
685
692
|
const teamValidation = await validateTeamContextWithBypass(request, authResult, authResult.user.id);
|
|
686
693
|
if (!teamValidation.valid) {
|
|
687
694
|
return teamValidation.error;
|
|
@@ -35,7 +35,7 @@ class UserService {
|
|
|
35
35
|
"emailVerified",
|
|
36
36
|
"createdAt",
|
|
37
37
|
"updatedAt"
|
|
38
|
-
FROM "
|
|
38
|
+
FROM "users"
|
|
39
39
|
WHERE id = $1 OR email = $1`,
|
|
40
40
|
[identifier],
|
|
41
41
|
currentUserId
|
|
@@ -81,7 +81,7 @@ class UserService {
|
|
|
81
81
|
"emailVerified",
|
|
82
82
|
"createdAt",
|
|
83
83
|
"updatedAt"
|
|
84
|
-
FROM "
|
|
84
|
+
FROM "users"
|
|
85
85
|
WHERE email = $1`,
|
|
86
86
|
[email],
|
|
87
87
|
currentUserId
|
|
@@ -127,7 +127,7 @@ class UserService {
|
|
|
127
127
|
"emailVerified",
|
|
128
128
|
"createdAt",
|
|
129
129
|
"updatedAt"
|
|
130
|
-
FROM "
|
|
130
|
+
FROM "users"
|
|
131
131
|
WHERE id = $1`,
|
|
132
132
|
[userId],
|
|
133
133
|
currentUserId
|
|
@@ -174,7 +174,7 @@ class UserService {
|
|
|
174
174
|
"emailVerified",
|
|
175
175
|
"createdAt",
|
|
176
176
|
"updatedAt"
|
|
177
|
-
FROM "
|
|
177
|
+
FROM "users"
|
|
178
178
|
WHERE id IN (${placeholders})`,
|
|
179
179
|
userIds,
|
|
180
180
|
currentUserId
|
|
@@ -238,7 +238,7 @@ class UserService {
|
|
|
238
238
|
updateFields.push(`"updatedAt" = CURRENT_TIMESTAMP`);
|
|
239
239
|
values.push(userId);
|
|
240
240
|
const query = `
|
|
241
|
-
UPDATE "
|
|
241
|
+
UPDATE "users"
|
|
242
242
|
SET ${updateFields.join(", ")}
|
|
243
243
|
WHERE id = $${paramCount}
|
|
244
244
|
RETURNING
|
package/dist/styles/classes.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextsparkjs/core",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.156",
|
|
4
4
|
"description": "NextSpark - The complete SaaS framework for Next.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "NextSpark <hello@nextspark.dev>",
|
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
"tailwind-merge": "^3.3.1",
|
|
468
468
|
"uuid": "^13.0.0",
|
|
469
469
|
"zod": "^4.1.5",
|
|
470
|
-
"@nextsparkjs/testing": "0.1.0-beta.
|
|
470
|
+
"@nextsparkjs/testing": "0.1.0-beta.156"
|
|
471
471
|
},
|
|
472
472
|
"scripts": {
|
|
473
473
|
"postinstall": "node scripts/postinstall.mjs || true",
|