nextjs-cms 0.5.10 → 0.5.12
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/auth/hooks/index.d.ts +2 -2
- package/dist/auth/hooks/index.d.ts.map +1 -1
- package/dist/auth/hooks/index.js +2 -2
- package/dist/auth/hooks/useAxiosPrivate.js +3 -3
- package/dist/auth/hooks/useRefreshToken.js +1 -1
- package/dist/auth/lib/actions.js +1 -1
- package/dist/auth/lib/client.js +1 -1
- package/dist/auth/react.d.ts +2 -2
- package/dist/auth/react.d.ts.map +1 -1
- package/dist/auth/react.js +3 -3
- package/dist/auth/trpc.js +1 -1
- package/dist/core/factories/SectionFactory.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import useAxiosPrivate from './useAxiosPrivate.
|
|
2
|
-
import useRefreshToken from './useRefreshToken.
|
|
1
|
+
import useAxiosPrivate from './useAxiosPrivate.js';
|
|
2
|
+
import useRefreshToken from './useRefreshToken.js';
|
|
3
3
|
export { useAxiosPrivate, useRefreshToken };
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAA;AAClD,OAAO,eAAe,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA"}
|
package/dist/auth/hooks/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import useAxiosPrivate from './useAxiosPrivate.
|
|
2
|
-
import useRefreshToken from './useRefreshToken.
|
|
1
|
+
import useAxiosPrivate from './useAxiosPrivate.js';
|
|
2
|
+
import useRefreshToken from './useRefreshToken.js';
|
|
3
3
|
export { useAxiosPrivate, useRefreshToken };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { axiosPrivate } from '../axios/axiosInstance.
|
|
1
|
+
import { axiosPrivate } from '../axios/axiosInstance.js';
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
|
-
import useRefreshToken from './useRefreshToken.
|
|
3
|
+
import useRefreshToken from './useRefreshToken.js';
|
|
4
4
|
import axios from 'axios';
|
|
5
|
-
import { getCsrfToken } from '../react.
|
|
5
|
+
import { getCsrfToken } from '../react.js';
|
|
6
6
|
const useAxiosPrivate = (options) => {
|
|
7
7
|
const refresh = useRefreshToken();
|
|
8
8
|
const { refreshTokenOn = 401 } = options || {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logout, refreshSession } from '../react.
|
|
1
|
+
import { logout, refreshSession } from '../react.js';
|
|
2
2
|
/**
|
|
3
3
|
* This hook is used to refresh the access token when it expires.
|
|
4
4
|
* It is used in the useAxiosPrivate hook to refresh the access token when a request returns a 401 error.
|
package/dist/auth/lib/actions.js
CHANGED
|
@@ -2,7 +2,7 @@ import { db } from '../../db/client.js';
|
|
|
2
2
|
import { AccessTokensTable, AdminsTable } from '../../db/schema.js';
|
|
3
3
|
import { and, eq } from 'drizzle-orm';
|
|
4
4
|
import bcrypt from 'bcrypt';
|
|
5
|
-
import { decodeRefreshToken, encodeJWT, encodeRefreshToken } from '../jwt';
|
|
5
|
+
import { decodeRefreshToken, encodeJWT, encodeRefreshToken } from '../jwt.js';
|
|
6
6
|
import { cookies } from 'next/headers';
|
|
7
7
|
export const authRefresh = async (refreshToken) => {
|
|
8
8
|
if (!refreshToken) {
|
package/dist/auth/lib/client.js
CHANGED
package/dist/auth/react.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import type { Session } from './index.js';
|
|
6
|
-
import useAxiosPrivate from './hooks/useAxiosPrivate.
|
|
7
|
-
import useRefreshToken from './hooks/useRefreshToken.
|
|
6
|
+
import useAxiosPrivate from './hooks/useAxiosPrivate.js';
|
|
7
|
+
import useRefreshToken from './hooks/useRefreshToken.js';
|
|
8
8
|
export type UpdateSession = (data?: any) => Promise<Session | null>;
|
|
9
9
|
export interface SessionProviderProps {
|
|
10
10
|
children: React.ReactNode;
|
package/dist/auth/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/auth/react.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,eAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/auth/react.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,eAAe,MAAM,4BAA4B,CAAA;AACxD,OAAO,eAAe,MAAM,4BAA4B,CAAA;AAGxD,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;AACnE,MAAM,WAAW,oBAAoB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC7B;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,OAAO;IAChD,QAAQ,EAAE,CA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AAE,OAAO,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,GACjE;IACI,MAAM,EAAE,aAAa,CAAA;IACrB,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAA;CACxC,CAAA;AAEb,eAAO,MAAM,cAAc;YAPL,aAAa;UAAQ,OAAO;YAAU,eAAe;;YAEnD,aAAa;UACf,IAAI;YACF,iBAAiB,GAAG,SAAS;cAG0C,CAAA;AAE/F,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CA6BpG;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAiN1D;AAED,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA"}
|
package/dist/auth/react.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use client';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { fetchData, now, useOnline } from './lib/client.
|
|
6
|
+
import { fetchData, now, useOnline } from './lib/client.js';
|
|
7
7
|
import { useRouter } from 'next/navigation';
|
|
8
|
-
import useAxiosPrivate from './hooks/useAxiosPrivate.
|
|
9
|
-
import useRefreshToken from './hooks/useRefreshToken.
|
|
8
|
+
import useAxiosPrivate from './hooks/useAxiosPrivate.js';
|
|
9
|
+
import useRefreshToken from './hooks/useRefreshToken.js';
|
|
10
10
|
export const __AUTH = {
|
|
11
11
|
_lastSync: 0,
|
|
12
12
|
_session: undefined,
|
package/dist/auth/trpc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { observable } from '@trpc/server/observable';
|
|
2
2
|
// import type { AppRouter } from '../api'
|
|
3
|
-
import { logout, refreshSession } from './react.
|
|
3
|
+
import { logout, refreshSession } from './react.js';
|
|
4
4
|
/**
|
|
5
5
|
* tRPC link that refreshes the token if it's expired
|
|
6
6
|
*/
|
|
@@ -270,7 +270,7 @@ export class SectionFactory {
|
|
|
270
270
|
}
|
|
271
271
|
const sections = [];
|
|
272
272
|
try {
|
|
273
|
-
const sectionFiles = await glob('**/*.section.
|
|
273
|
+
const sectionFiles = await glob('**/*.section.ts', {
|
|
274
274
|
cwd: cmsConfig.sectionsFolder,
|
|
275
275
|
});
|
|
276
276
|
for (const file of sectionFiles) {
|
|
@@ -349,7 +349,7 @@ export class SectionFactory {
|
|
|
349
349
|
if (!this.isDev || this.watcherStarted)
|
|
350
350
|
return;
|
|
351
351
|
this.watcherStarted = true;
|
|
352
|
-
const watcher = chokidar.watch('**/*.section.
|
|
352
|
+
const watcher = chokidar.watch('**/*.section.ts', {
|
|
353
353
|
cwd: cmsConfig.sectionsFolder,
|
|
354
354
|
ignoreInitial: true,
|
|
355
355
|
});
|