nextjs-cms 0.5.55 → 0.5.58
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/api/index.d.ts +90 -45
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/lib/serverActions.d.ts +68 -5
- package/dist/api/lib/serverActions.d.ts.map +1 -1
- package/dist/api/lib/serverActions.js +33 -8
- package/dist/api/root.d.ts +961 -44
- package/dist/api/root.d.ts.map +1 -1
- package/dist/api/root.js +2 -1
- package/dist/api/routers/accountSettings.d.ts +1 -3
- package/dist/api/routers/accountSettings.d.ts.map +1 -1
- package/dist/api/routers/admins.d.ts +1 -3
- package/dist/api/routers/admins.d.ts.map +1 -1
- package/dist/api/routers/admins.js +1 -1
- package/dist/api/routers/auth.d.ts +9 -3
- package/dist/api/routers/auth.d.ts.map +1 -1
- package/dist/api/routers/categorySection.d.ts +1 -3
- package/dist/api/routers/categorySection.d.ts.map +1 -1
- package/dist/api/routers/cmsSettings.d.ts +1 -3
- package/dist/api/routers/cmsSettings.d.ts.map +1 -1
- package/dist/api/routers/cpanel.d.ts +1 -3
- package/dist/api/routers/cpanel.d.ts.map +1 -1
- package/dist/api/routers/files.d.ts +1 -3
- package/dist/api/routers/files.d.ts.map +1 -1
- package/dist/api/routers/gallery.d.ts +1 -3
- package/dist/api/routers/gallery.d.ts.map +1 -1
- package/dist/api/routers/gallery.js +7 -6
- package/dist/api/routers/googleAnalytics.d.ts +1 -3
- package/dist/api/routers/googleAnalytics.d.ts.map +1 -1
- package/dist/api/routers/hasItemsSection.d.ts +49 -5
- package/dist/api/routers/hasItemsSection.d.ts.map +1 -1
- package/dist/api/routers/navigation.d.ts +1 -3
- package/dist/api/routers/navigation.d.ts.map +1 -1
- package/dist/api/routers/simpleSection.d.ts +21 -4
- package/dist/api/routers/simpleSection.d.ts.map +1 -1
- package/dist/api/trpc/query-client.d.ts +3 -0
- package/dist/api/trpc/query-client.d.ts.map +1 -0
- package/dist/api/trpc/query-client.js +23 -0
- package/dist/api/trpc/server.d.ts +8 -0
- package/dist/api/trpc/server.d.ts.map +1 -0
- package/dist/api/trpc/server.js +23 -0
- package/dist/api/trpc.d.ts +6 -17
- package/dist/api/trpc.d.ts.map +1 -1
- package/dist/api/trpc.js +6 -9
- package/dist/auth/hooks/useRefreshToken.d.ts.map +1 -1
- package/dist/auth/hooks/useRefreshToken.js +11 -9
- package/dist/auth/lib/actions.d.ts +10 -0
- package/dist/auth/lib/actions.d.ts.map +1 -1
- package/dist/auth/lib/actions.js +50 -20
- package/dist/auth/react.d.ts +7 -1
- package/dist/auth/react.d.ts.map +1 -1
- package/dist/auth/react.js +51 -29
- package/dist/auth/trpc.d.ts.map +1 -1
- package/dist/auth/trpc.js +2 -1
- package/dist/core/config/config-loader.d.ts +1 -1
- package/dist/core/config/config-loader.d.ts.map +1 -1
- package/dist/core/config/config-loader.js +9 -6
- package/dist/core/config/index.d.ts +1 -0
- package/dist/core/config/index.d.ts.map +1 -1
- package/dist/core/config/index.js +1 -0
- package/dist/core/config/loader-with-esbuild.d.ts +7 -0
- package/dist/core/config/loader-with-esbuild.d.ts.map +1 -0
- package/dist/core/config/loader-with-esbuild.js +98 -0
- package/dist/core/config/loader-with-jiti.d.ts +13 -0
- package/dist/core/config/loader-with-jiti.d.ts.map +1 -0
- package/dist/core/config/loader-with-jiti.js +162 -0
- package/dist/core/config/loader.d.ts +1 -1
- package/dist/core/config/loader.d.ts.map +1 -1
- package/dist/core/config/loader.js +1 -75
- package/dist/core/factories/SectionFactory.d.ts +1 -109
- package/dist/core/factories/SectionFactory.d.ts.map +1 -1
- package/dist/core/factories/SectionFactory.js +1 -452
- package/dist/core/factories/section-factory-with-esbuild.d.ts +110 -0
- package/dist/core/factories/section-factory-with-esbuild.d.ts.map +1 -0
- package/dist/core/factories/section-factory-with-esbuild.js +509 -0
- package/dist/core/factories/section-factory-with-jiti.d.ts +113 -0
- package/dist/core/factories/section-factory-with-jiti.d.ts.map +1 -0
- package/dist/core/factories/section-factory-with-jiti.js +556 -0
- package/dist/core/fields/document.d.ts +0 -1
- package/dist/core/fields/document.d.ts.map +1 -1
- package/dist/core/fields/document.js +5 -4
- package/dist/core/fields/photo.d.ts +10 -7
- package/dist/core/fields/photo.d.ts.map +1 -1
- package/dist/core/fields/photo.js +44 -17
- package/dist/core/fields/richText.d.ts +0 -1
- package/dist/core/fields/richText.d.ts.map +1 -1
- package/dist/core/fields/richText.js +5 -4
- package/dist/core/fields/video.d.ts +0 -1
- package/dist/core/fields/video.d.ts.map +1 -1
- package/dist/core/fields/video.js +5 -4
- package/dist/core/sections/section.d.ts +17 -15
- package/dist/core/sections/section.d.ts.map +1 -1
- package/dist/core/sections/section.js +28 -5
- package/dist/core/submit/submit.d.ts.map +1 -1
- package/dist/core/submit/submit.js +13 -12
- package/dist/translations/dictionaries/ar.json +1 -0
- package/dist/translations/dictionaries/en.json +1 -0
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/index.js +1 -3
- package/package.json +16 -7
package/dist/api/root.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/api/root.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/api/root.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBpB,CAAA;AAIF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAA;AAExC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiC,CAAA"}
|
package/dist/api/root.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { privateProcedure, router } from './trpc.js';
|
|
1
|
+
import { createCallerFactory, privateProcedure, router } from './trpc.js';
|
|
2
2
|
import { adminsRouter } from './routers/admins.js';
|
|
3
3
|
import { hasItemsSectionRouter } from './routers/hasItemsSection.js';
|
|
4
4
|
import { filesRouter } from './routers/files.js';
|
|
@@ -28,3 +28,4 @@ export const appRouter = router({
|
|
|
28
28
|
return ctx;
|
|
29
29
|
}),
|
|
30
30
|
});
|
|
31
|
+
export const createCaller = createCallerFactory(appRouter);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const accountSettings: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountSettings.d.ts","sourceRoot":"","sources":["../../../src/api/routers/accountSettings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"accountSettings.d.ts","sourceRoot":"","sources":["../../../src/api/routers/accountSettings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkBxB;;;OAGG;;;;;;;;;;;;;;;;;;;GA4FL,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const adminsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins.d.ts","sourceRoot":"","sources":["../../../src/api/routers/admins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAaxB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"admins.d.ts","sourceRoot":"","sources":["../../../src/api/routers/admins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAaxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+OvB,CAAA"}
|
|
@@ -179,7 +179,7 @@ export const adminsRouter = router({
|
|
|
179
179
|
id: z.string(),
|
|
180
180
|
}))
|
|
181
181
|
.mutation(async ({ input }) => {
|
|
182
|
-
const uploadsFolder = getCMSConfig().media.upload.path;
|
|
182
|
+
const uploadsFolder = (await getCMSConfig()).media.upload.path;
|
|
183
183
|
/**
|
|
184
184
|
* Check if the admin is not the master admin
|
|
185
185
|
*/
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const authRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -29,6 +27,14 @@ export declare const authRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
29
27
|
password: string;
|
|
30
28
|
};
|
|
31
29
|
output: {
|
|
30
|
+
status: number;
|
|
31
|
+
session: {
|
|
32
|
+
user: {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
locale: string | null;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
32
38
|
user: {
|
|
33
39
|
id: string;
|
|
34
40
|
username: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/api/routers/auth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/api/routers/auth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsBrB,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const categorySectionRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categorySection.d.ts","sourceRoot":"","sources":["../../../src/api/routers/categorySection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"categorySection.d.ts","sourceRoot":"","sources":["../../../src/api/routers/categorySection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0ChC,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const cmsSettings: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmsSettings.d.ts","sourceRoot":"","sources":["../../../src/api/routers/cmsSettings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"cmsSettings.d.ts","sourceRoot":"","sources":["../../../src/api/routers/cmsSettings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmBpB;;;OAGG;;;;;;;;;;GA2BL,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const cpanelRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cpanel.d.ts","sourceRoot":"","sources":["../../../src/api/routers/cpanel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"cpanel.d.ts","sourceRoot":"","sources":["../../../src/api/routers/cpanel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0QvB,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const filesRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/api/routers/files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/api/routers/files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwBtB,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const galleryRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../../src/api/routers/gallery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAWxB,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../../src/api/routers/gallery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAWxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DxB,CAAA"}
|
|
@@ -17,7 +17,7 @@ export const galleryRouter = router({
|
|
|
17
17
|
referenceId: z.string(),
|
|
18
18
|
}))
|
|
19
19
|
.mutation(async ({ ctx, input }) => {
|
|
20
|
-
const uploadsFolder = getCMSConfig().media.upload.path;
|
|
20
|
+
const uploadsFolder = (await getCMSConfig()).media.upload.path;
|
|
21
21
|
/**
|
|
22
22
|
* Get the section information
|
|
23
23
|
*/
|
|
@@ -37,11 +37,12 @@ export const galleryRouter = router({
|
|
|
37
37
|
/**
|
|
38
38
|
* Delete the photo from the database
|
|
39
39
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const gallery = await section.getGallery();
|
|
41
|
+
if (gallery?.db.tableName) {
|
|
42
|
+
const columns = await MysqlTableChecker.getColumns(gallery.db.tableName);
|
|
43
|
+
if (columns.includes(gallery.db.photoNameField) &&
|
|
44
|
+
columns.includes(gallery.db.referenceIdentifierField)) {
|
|
45
|
+
await db.execute(sql `DELETE FROM ${sql.raw(gallery.db.tableName)} WHERE ${sql.raw(gallery.db.photoNameField)} = ${input.photoName} AND ${sql.raw(gallery.db.referenceIdentifierField)} = ${input.referenceId}`);
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
export declare const googleAnalyticsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
2
2
|
ctx: {
|
|
3
|
+
headers: Headers;
|
|
3
4
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
4
5
|
$client: import("mysql2/promise").Pool;
|
|
5
6
|
};
|
|
6
7
|
session: import("../../index.js").Session | null;
|
|
7
|
-
opts: {
|
|
8
|
-
headers: Headers;
|
|
9
|
-
};
|
|
10
8
|
};
|
|
11
9
|
meta: object;
|
|
12
10
|
errorShape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"googleAnalytics.d.ts","sourceRoot":"","sources":["../../../src/api/routers/googleAnalytics.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"googleAnalytics.d.ts","sourceRoot":"","sources":["../../../src/api/routers/googleAnalytics.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIhC,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const hasItemsSectionRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -66,7 +64,30 @@ export declare const hasItemsSectionRouter: import("@trpc/server").TRPCBuiltRout
|
|
|
66
64
|
section?: undefined;
|
|
67
65
|
inputGroups?: undefined;
|
|
68
66
|
} | {
|
|
69
|
-
section:
|
|
67
|
+
section: {
|
|
68
|
+
name: string;
|
|
69
|
+
title: {
|
|
70
|
+
section: string;
|
|
71
|
+
singular: string;
|
|
72
|
+
plural: string;
|
|
73
|
+
};
|
|
74
|
+
gallery: {
|
|
75
|
+
db: {
|
|
76
|
+
tableName: string;
|
|
77
|
+
referenceIdentifierField: string;
|
|
78
|
+
photoNameField: string;
|
|
79
|
+
metaField: string;
|
|
80
|
+
};
|
|
81
|
+
watermark?: boolean;
|
|
82
|
+
thumbnail?: {
|
|
83
|
+
width: number;
|
|
84
|
+
height: number;
|
|
85
|
+
crop: boolean;
|
|
86
|
+
quality: number;
|
|
87
|
+
};
|
|
88
|
+
} | undefined;
|
|
89
|
+
variants: import("../../core/types/index.js").Variant[] | undefined;
|
|
90
|
+
};
|
|
70
91
|
inputGroups: {
|
|
71
92
|
groupId: number;
|
|
72
93
|
groupTitle: string;
|
|
@@ -99,7 +120,30 @@ export declare const hasItemsSectionRouter: import("@trpc/server").TRPCBuiltRout
|
|
|
99
120
|
inputGroups?: undefined;
|
|
100
121
|
gallery?: undefined;
|
|
101
122
|
} | {
|
|
102
|
-
section:
|
|
123
|
+
section: {
|
|
124
|
+
name: string;
|
|
125
|
+
title: {
|
|
126
|
+
section: string;
|
|
127
|
+
singular: string;
|
|
128
|
+
plural: string;
|
|
129
|
+
};
|
|
130
|
+
gallery: {
|
|
131
|
+
db: {
|
|
132
|
+
tableName: string;
|
|
133
|
+
referenceIdentifierField: string;
|
|
134
|
+
photoNameField: string;
|
|
135
|
+
metaField: string;
|
|
136
|
+
};
|
|
137
|
+
watermark?: boolean;
|
|
138
|
+
thumbnail?: {
|
|
139
|
+
width: number;
|
|
140
|
+
height: number;
|
|
141
|
+
crop: boolean;
|
|
142
|
+
quality: number;
|
|
143
|
+
};
|
|
144
|
+
} | undefined;
|
|
145
|
+
variants: import("../../core/types/index.js").Variant[] | undefined;
|
|
146
|
+
};
|
|
103
147
|
inputGroups: {
|
|
104
148
|
groupId: number;
|
|
105
149
|
groupTitle: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasItemsSection.d.ts","sourceRoot":"","sources":["../../../src/api/routers/hasItemsSection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"hasItemsSection.d.ts","sourceRoot":"","sources":["../../../src/api/routers/hasItemsSection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqChC,CAAA"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
export declare const navRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
2
2
|
ctx: {
|
|
3
|
+
headers: Headers;
|
|
3
4
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
4
5
|
$client: import("mysql2/promise").Pool;
|
|
5
6
|
};
|
|
6
7
|
session: import("../../index.js").Session | null;
|
|
7
|
-
opts: {
|
|
8
|
-
headers: Headers;
|
|
9
|
-
};
|
|
10
8
|
};
|
|
11
9
|
meta: object;
|
|
12
10
|
errorShape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/api/routers/navigation.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/api/routers/navigation.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQpB,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const simpleSectionRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: {
|
|
4
|
+
headers: Headers;
|
|
4
5
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
5
6
|
$client: import("mysql2/promise").Pool;
|
|
6
7
|
};
|
|
7
8
|
session: import("../../index.js").Session | null;
|
|
8
|
-
opts: {
|
|
9
|
-
headers: Headers;
|
|
10
|
-
};
|
|
11
9
|
};
|
|
12
10
|
meta: object;
|
|
13
11
|
errorShape: {
|
|
@@ -34,7 +32,26 @@ export declare const simpleSectionRouter: import("@trpc/server").TRPCBuiltRouter
|
|
|
34
32
|
section?: undefined;
|
|
35
33
|
inputGroups?: undefined;
|
|
36
34
|
} | {
|
|
37
|
-
section:
|
|
35
|
+
section: {
|
|
36
|
+
name: string;
|
|
37
|
+
title: string;
|
|
38
|
+
gallery: {
|
|
39
|
+
db: {
|
|
40
|
+
tableName: string;
|
|
41
|
+
referenceIdentifierField: string;
|
|
42
|
+
photoNameField: string;
|
|
43
|
+
metaField: string;
|
|
44
|
+
};
|
|
45
|
+
watermark?: boolean;
|
|
46
|
+
thumbnail?: {
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
crop: boolean;
|
|
50
|
+
quality: number;
|
|
51
|
+
};
|
|
52
|
+
} | undefined;
|
|
53
|
+
variants: import("../../core/types/index.js").Variant[] | undefined;
|
|
54
|
+
};
|
|
38
55
|
inputGroups: {
|
|
39
56
|
groupId: number;
|
|
40
57
|
groupTitle: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simpleSection.d.ts","sourceRoot":"","sources":["../../../src/api/routers/simpleSection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"simpleSection.d.ts","sourceRoot":"","sources":["../../../src/api/routers/simpleSection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAU9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-client.d.ts","sourceRoot":"","sources":["../../../src/api/trpc/query-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGhF,eAAO,MAAM,iBAAiB,mBAqBxB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defaultShouldDehydrateQuery, QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import SuperJSON from 'superjson';
|
|
3
|
+
export const createQueryClient = () => new QueryClient({
|
|
4
|
+
defaultOptions: {
|
|
5
|
+
queries: {
|
|
6
|
+
// With SSR, we usually want to set some default staleTime
|
|
7
|
+
// above 0 to avoid refetching immediately on the client
|
|
8
|
+
/**
|
|
9
|
+
* We want to refetch on window focus in development only
|
|
10
|
+
*/
|
|
11
|
+
staleTime: 30 * 1000,
|
|
12
|
+
refetchOnWindowFocus: process.env.NODE_ENV === 'development' ? true : false,
|
|
13
|
+
retry: 1, // default: 3
|
|
14
|
+
},
|
|
15
|
+
dehydrate: {
|
|
16
|
+
serializeData: SuperJSON.serialize,
|
|
17
|
+
shouldDehydrateQuery: (query) => defaultShouldDehydrateQuery(query) || query.state.status === 'pending',
|
|
18
|
+
},
|
|
19
|
+
hydrate: {
|
|
20
|
+
deserializeData: SuperJSON.deserialize,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
import { createHydrationHelpers } from '@trpc/react-query/rsc';
|
|
3
|
+
import { type AppRouter } from '../root.js';
|
|
4
|
+
export declare const api: ReturnType<typeof createHydrationHelpers<AppRouter>>["trpc"];
|
|
5
|
+
export declare const HydrateClient: (props: {
|
|
6
|
+
children: import("react").ReactNode;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/api/trpc/server.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAI9D,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAqBzD,eAAO,MAAM,GAAG,EAAc,UAAU,CAAC,OAAO,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAC1F,eAAO,MAAM,aAAa;;iCAAmB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
import { createHydrationHelpers } from '@trpc/react-query/rsc';
|
|
3
|
+
import { headers } from 'next/headers';
|
|
4
|
+
import { cache } from 'react';
|
|
5
|
+
import { createCaller } from '../root.js';
|
|
6
|
+
import { createTRPCContext } from '../trpc.js';
|
|
7
|
+
import { createQueryClient } from './query-client.js';
|
|
8
|
+
/**
|
|
9
|
+
* This wraps the `createTRPCContext` helper and provides the required context for the tRPC API when
|
|
10
|
+
* handling a tRPC call from a React Server Component.
|
|
11
|
+
*/
|
|
12
|
+
const createContext = cache(async () => {
|
|
13
|
+
const heads = new Headers(await headers());
|
|
14
|
+
heads.set('x-trpc-source', 'rsc');
|
|
15
|
+
return createTRPCContext({
|
|
16
|
+
headers: heads,
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
const getQueryClient = cache(createQueryClient);
|
|
20
|
+
const caller = createCaller(createContext);
|
|
21
|
+
const _t = createHydrationHelpers(caller, getQueryClient);
|
|
22
|
+
export const api = _t.trpc;
|
|
23
|
+
export const HydrateClient = _t.HydrateClient;
|
package/dist/api/trpc.d.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import superjson from 'superjson';
|
|
2
|
-
import type { NextRequest } from 'next/server';
|
|
3
2
|
/**
|
|
4
3
|
* Creates context for an incoming request
|
|
5
4
|
* @link https://trpc.io/docs/v11/context
|
|
6
5
|
*/
|
|
7
6
|
export declare const createTRPCContext: (opts: {
|
|
8
|
-
|
|
7
|
+
headers: Headers;
|
|
9
8
|
}) => Promise<{
|
|
9
|
+
headers: Headers;
|
|
10
10
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
11
11
|
$client: import("mysql2/promise").Pool;
|
|
12
12
|
};
|
|
13
13
|
session: import("../index.js").Session | null;
|
|
14
|
-
opts: {
|
|
15
|
-
headers: Headers;
|
|
16
|
-
};
|
|
17
14
|
}>;
|
|
18
15
|
export declare const transformer: {
|
|
19
16
|
input: typeof superjson;
|
|
@@ -25,13 +22,11 @@ export declare const transformer: {
|
|
|
25
22
|
*/
|
|
26
23
|
export declare const createCallerFactory: import("@trpc/server").TRPCRouterCallerFactory<{
|
|
27
24
|
ctx: {
|
|
25
|
+
headers: Headers;
|
|
28
26
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
29
27
|
$client: import("mysql2/promise").Pool;
|
|
30
28
|
};
|
|
31
29
|
session: import("../index.js").Session | null;
|
|
32
|
-
opts: {
|
|
33
|
-
headers: Headers;
|
|
34
|
-
};
|
|
35
30
|
};
|
|
36
31
|
meta: object;
|
|
37
32
|
errorShape: {
|
|
@@ -53,13 +48,11 @@ export declare const createCallerFactory: import("@trpc/server").TRPCRouterCalle
|
|
|
53
48
|
*/
|
|
54
49
|
export declare const router: import("@trpc/server").TRPCRouterBuilder<{
|
|
55
50
|
ctx: {
|
|
51
|
+
headers: Headers;
|
|
56
52
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
57
53
|
$client: import("mysql2/promise").Pool;
|
|
58
54
|
};
|
|
59
55
|
session: import("../index.js").Session | null;
|
|
60
|
-
opts: {
|
|
61
|
-
headers: Headers;
|
|
62
|
-
};
|
|
63
56
|
};
|
|
64
57
|
meta: object;
|
|
65
58
|
errorShape: {
|
|
@@ -79,26 +72,22 @@ export declare const router: import("@trpc/server").TRPCRouterBuilder<{
|
|
|
79
72
|
* Public procedure that doesn't require authentication
|
|
80
73
|
*/
|
|
81
74
|
export declare const publicProcedure: import("@trpc/server").TRPCProcedureBuilder<{
|
|
75
|
+
headers: Headers;
|
|
82
76
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
83
77
|
$client: import("mysql2/promise").Pool;
|
|
84
78
|
};
|
|
85
79
|
session: import("../index.js").Session | null;
|
|
86
|
-
opts: {
|
|
87
|
-
headers: Headers;
|
|
88
|
-
};
|
|
89
80
|
}, object, object, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
90
81
|
/**
|
|
91
82
|
* Private procedure that uses the `isAuthedMiddleware` middleware to require authentication
|
|
92
83
|
* @see https://trpc.io/docs/procedures
|
|
93
84
|
*/
|
|
94
85
|
export declare const privateProcedure: import("@trpc/server").TRPCProcedureBuilder<{
|
|
86
|
+
headers: Headers;
|
|
95
87
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
96
88
|
$client: import("mysql2/promise").Pool;
|
|
97
89
|
};
|
|
98
90
|
session: import("../index.js").Session | null;
|
|
99
|
-
opts: {
|
|
100
|
-
headers: Headers;
|
|
101
|
-
};
|
|
102
91
|
}, object, {
|
|
103
92
|
session: {
|
|
104
93
|
user: import("../index.js").User;
|
package/dist/api/trpc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trpc.d.ts","sourceRoot":"","sources":["../../src/api/trpc.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"trpc.d.ts","sourceRoot":"","sources":["../../src/api/trpc.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,WAAW,CAAA;AAKjC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAU,MAAM;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE;aAAT,OAAO;;;;;EAQ/D,CAAA;AAID,eAAO,MAAM,WAAW;;;CAGvB,CAAA;AAkBD;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;iBArCyB,OAAO;;;;;;;;;;;;;;;;;;;EAqCR,CAAA;AAiBxD;;;GAGG;AACH,eAAO,MAAM,MAAM;;iBA1DsC,OAAO;;;;;;;;;;;;;;;;;;;EA0DlC,CAAA;AAE9B;;GAEG;AACH,eAAO,MAAM,eAAe;aA/D6B,OAAO;;;;;yLA+DtB,CAAA;AAE1C;;;GAGG;AACH,eAAO,MAAM,gBAAgB;aArE4B,OAAO;;;;;;;;;yKAqEG,CAAA"}
|
package/dist/api/trpc.js
CHANGED
|
@@ -9,13 +9,10 @@ import { db } from '../db/client.js';
|
|
|
9
9
|
*/
|
|
10
10
|
export const createTRPCContext = async (opts) => {
|
|
11
11
|
const session = await auth();
|
|
12
|
-
const headers = opts.req.headers;
|
|
13
12
|
return {
|
|
14
13
|
db,
|
|
15
14
|
session,
|
|
16
|
-
opts
|
|
17
|
-
headers,
|
|
18
|
-
},
|
|
15
|
+
...opts,
|
|
19
16
|
};
|
|
20
17
|
};
|
|
21
18
|
export const transformer = {
|
|
@@ -37,6 +34,11 @@ const t = initTRPC.context().create({
|
|
|
37
34
|
return shape
|
|
38
35
|
},*/
|
|
39
36
|
});
|
|
37
|
+
/**
|
|
38
|
+
* Create a server-side caller
|
|
39
|
+
* @see https://trpc.io/docs/server/server-side-calls
|
|
40
|
+
*/
|
|
41
|
+
export const createCallerFactory = t.createCallerFactory;
|
|
40
42
|
const isAuthedMiddleware = t.middleware(async ({ ctx, next }) => {
|
|
41
43
|
if (!ctx.session || !ctx.session.user)
|
|
42
44
|
throw new TRPCError({ code: 'UNAUTHORIZED', message: 'No token provided' });
|
|
@@ -51,11 +53,6 @@ const isAuthedMiddleware = t.middleware(async ({ ctx, next }) => {
|
|
|
51
53
|
},
|
|
52
54
|
});
|
|
53
55
|
});
|
|
54
|
-
/**
|
|
55
|
-
* Create a server-side caller
|
|
56
|
-
* @see https://trpc.io/docs/server/server-side-calls
|
|
57
|
-
*/
|
|
58
|
-
export const createCallerFactory = t.createCallerFactory;
|
|
59
56
|
/**
|
|
60
57
|
* This is how you create new routers and sub-routers in your tRPC API
|
|
61
58
|
* @see https://trpc.io/docs/router
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRefreshToken.d.ts","sourceRoot":"","sources":["../../../src/auth/hooks/useRefreshToken.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRefreshToken.d.ts","sourceRoot":"","sources":["../../../src/auth/hooks/useRefreshToken.tsx"],"names":[],"mappings":"AAGA;;;GAGG;AACH,QAAA,MAAM,eAAe,8BA8EpB,CAAA;AAED,eAAe,eAAe,CAAA"}
|