payload 3.0.0-alpha.56 → 3.0.0-alpha.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/auth/getAccessResults.d.ts.map +1 -1
- package/dist/auth/getAccessResults.js +1 -2
- package/dist/auth/getAccessResults.js.map +1 -1
- package/dist/auth/operations/local/index.d.ts +1 -1
- package/dist/auth/strategies/local/generatePasswordSaltHash.d.ts.map +1 -1
- package/dist/bin/loader/index.d.ts.map +1 -1
- package/dist/bin/loader/index.js +34 -26
- package/dist/bin/loader/index.js.map +1 -1
- package/dist/collections/config/client.d.ts +32 -30
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/defaults.d.ts +5 -5
- package/dist/collections/config/types.d.ts +3 -1
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/operations/local/index.d.ts +6 -6
- package/dist/database/migrations/readMigrationFiles.d.ts.map +1 -1
- package/dist/exports/node.d.ts +1 -3
- package/dist/exports/node.d.ts.map +1 -1
- package/dist/exports/node.js +1 -3
- package/dist/exports/node.js.map +1 -1
- package/dist/exports/uploads.d.ts +2 -0
- package/dist/exports/uploads.d.ts.map +1 -0
- package/dist/exports/uploads.js +3 -0
- package/dist/exports/uploads.js.map +1 -0
- package/dist/fields/config/client.d.ts +68 -68
- package/dist/fields/validations.d.ts +3 -3
- package/dist/translations/getLocalI18n.d.ts.map +1 -1
- package/dist/utilities/formatLabels.d.ts +0 -2
- package/dist/utilities/formatLabels.d.ts.map +1 -1
- package/dist/utilities/importWithoutClientFiles.d.ts +5 -0
- package/dist/utilities/importWithoutClientFiles.d.ts.map +1 -1
- package/dist/utilities/importWithoutClientFiles.js +29 -1
- package/dist/utilities/importWithoutClientFiles.js.map +1 -1
- package/dist/utilities/isEntityHidden.d.ts.map +1 -1
- package/dist/versions/getLatestGlobalVersion.d.ts.map +1 -1
- package/node.d.ts +1 -3
- package/node.js +1 -3
- package/package.json +2 -2
- package/uploads.d.ts +2 -0
- package/uploads.js +3 -0
- package/dist/utilities/importConfig.d.ts +0 -6
- package/dist/utilities/importConfig.d.ts.map +0 -1
- package/dist/utilities/importConfig.js +0 -32
- package/dist/utilities/importConfig.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAccessResults.d.ts","sourceRoot":"","sources":["../../src/auth/getAccessResults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAK7C,KAAK,oBAAoB,GAAG;IAC1B,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AACD,wBAAsB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"getAccessResults.d.ts","sourceRoot":"","sources":["../../src/auth/getAccessResults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAK7C,KAAK,oBAAoB,GAAG;IAC1B,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AACD,wBAAsB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CAyE1F"}
|
|
@@ -7,8 +7,7 @@ export async function getAccessResults({ req }) {
|
|
|
7
7
|
const userCollectionConfig = user && user.collection ? payload.config.collections.find((collection)=>collection.slug === user.collection) : null;
|
|
8
8
|
if (userCollectionConfig) {
|
|
9
9
|
results.canAccessAdmin = userCollectionConfig.access.admin ? await userCollectionConfig.access.admin({
|
|
10
|
-
|
|
11
|
-
user
|
|
10
|
+
req
|
|
12
11
|
}) : isLoggedIn;
|
|
13
12
|
} else {
|
|
14
13
|
results.canAccessAdmin = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/getAccessResults.ts"],"sourcesContent":["import type { AllOperations, PayloadRequest } from '../types/index.js'\nimport type { Permissions } from './types.js'\n\nimport { getEntityPolicies } from '../utilities/getEntityPolicies.js'\nimport isolateObjectProperty from '../utilities/isolateObjectProperty.js'\n\ntype GetAccessResultsArgs = {\n req: PayloadRequest\n}\nexport async function getAccessResults({ req }: GetAccessResultsArgs): Promise<Permissions> {\n const results = {} as Permissions\n const { payload, user } = req\n\n const isLoggedIn = !!user\n const userCollectionConfig =\n user && user.collection\n ? payload.config.collections.find((collection) => collection.slug === user.collection)\n : null\n\n if (userCollectionConfig) {\n results.canAccessAdmin = userCollectionConfig.access.admin\n ? await userCollectionConfig.access.admin({
|
|
1
|
+
{"version":3,"sources":["../../src/auth/getAccessResults.ts"],"sourcesContent":["import type { AllOperations, PayloadRequest } from '../types/index.js'\nimport type { Permissions } from './types.js'\n\nimport { getEntityPolicies } from '../utilities/getEntityPolicies.js'\nimport isolateObjectProperty from '../utilities/isolateObjectProperty.js'\n\ntype GetAccessResultsArgs = {\n req: PayloadRequest\n}\nexport async function getAccessResults({ req }: GetAccessResultsArgs): Promise<Permissions> {\n const results = {} as Permissions\n const { payload, user } = req\n\n const isLoggedIn = !!user\n const userCollectionConfig =\n user && user.collection\n ? payload.config.collections.find((collection) => collection.slug === user.collection)\n : null\n\n if (userCollectionConfig) {\n results.canAccessAdmin = userCollectionConfig.access.admin\n ? await userCollectionConfig.access.admin({ req })\n : isLoggedIn\n } else {\n results.canAccessAdmin = false\n }\n\n await Promise.all(\n payload.config.collections.map(async (collection) => {\n const collectionOperations: AllOperations[] = ['create', 'read', 'update', 'delete']\n\n if (\n collection.auth &&\n typeof collection.auth.maxLoginAttempts !== 'undefined' &&\n collection.auth.maxLoginAttempts !== 0\n ) {\n collectionOperations.push('unlock')\n }\n\n if (collection.versions) {\n collectionOperations.push('readVersions')\n }\n\n const collectionPolicy = await getEntityPolicies({\n type: 'collection',\n entity: collection,\n operations: collectionOperations,\n // Do not re-use our existing req object, as we need a new req.transactionID. Cannot re-use our existing one, as this is run in parallel (Promise.all above) which is\n // not supported on the same transaction ID. Not passing a transaction ID here creates a new transaction ID.\n req: isolateObjectProperty(req, 'transactionID'),\n })\n results.collections = {\n ...results.collections,\n [collection.slug]: collectionPolicy,\n }\n }),\n )\n\n await Promise.all(\n payload.config.globals.map(async (global) => {\n const globalOperations: AllOperations[] = ['read', 'update']\n\n if (global.versions) {\n globalOperations.push('readVersions')\n }\n\n const globalPolicy = await getEntityPolicies({\n type: 'global',\n entity: global,\n operations: globalOperations,\n // Do not re-use our existing req object, as we need a new req.transactionID. Cannot re-use our existing one, as this is run in parallel (Promise.all above) which is\n // not supported on the same transaction ID. Not passing a transaction ID here creates a new transaction ID.\n req: isolateObjectProperty(req, 'transactionID'),\n })\n results.globals = {\n ...results.globals,\n [global.slug]: globalPolicy,\n }\n }),\n )\n\n return results\n}\n"],"names":["getEntityPolicies","isolateObjectProperty","getAccessResults","req","results","payload","user","isLoggedIn","userCollectionConfig","collection","config","collections","find","slug","canAccessAdmin","access","admin","Promise","all","map","collectionOperations","auth","maxLoginAttempts","push","versions","collectionPolicy","type","entity","operations","globals","global","globalOperations","globalPolicy"],"mappings":"AAGA,SAASA,iBAAiB,QAAQ,oCAAmC;AACrE,OAAOC,2BAA2B,wCAAuC;AAKzE,OAAO,eAAeC,iBAAiB,EAAEC,GAAG,EAAwB;IAClE,MAAMC,UAAU,CAAC;IACjB,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGH;IAE1B,MAAMI,aAAa,CAAC,CAACD;IACrB,MAAME,uBACJF,QAAQA,KAAKG,UAAU,GACnBJ,QAAQK,MAAM,CAACC,WAAW,CAACC,IAAI,CAAC,CAACH,aAAeA,WAAWI,IAAI,KAAKP,KAAKG,UAAU,IACnF;IAEN,IAAID,sBAAsB;QACxBJ,QAAQU,cAAc,GAAGN,qBAAq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,7 @@ import resetPassword from './resetPassword.js';
|
|
|
4
4
|
import unlock from './unlock.js';
|
|
5
5
|
import verifyEmail from './verifyEmail.js';
|
|
6
6
|
declare const _default: {
|
|
7
|
-
auth: (payload: import("
|
|
7
|
+
auth: (payload: import("../../../index.js").Payload, options: import("../auth.js").AuthArgs) => Promise<import("../auth.js").AuthResult>;
|
|
8
8
|
forgotPassword: typeof forgotPassword;
|
|
9
9
|
login: typeof login;
|
|
10
10
|
resetPassword: typeof resetPassword;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePasswordSaltHash.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/generatePasswordSaltHash.ts"],"names":[],"mappings":"AAyBA,KAAK,IAAI,GAAG;IACV,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,wBAAwB,kBAElC,IAAI;
|
|
1
|
+
{"version":3,"file":"generatePasswordSaltHash.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/generatePasswordSaltHash.ts"],"names":[],"mappings":"AAyBA,KAAK,IAAI,GAAG;IACV,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,wBAAwB,kBAElC,IAAI,KAAG,QAAQ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAc/C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/loader/index.ts"],"names":[],"mappings":"AASA,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B;AACD,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,GAAG,EAAE,MAAM,CAAA;CACZ;AACD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAA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AC,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,UAAU,CAAC;CACtD,CAAA;AACD,KAAK,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;AAelE,eAAO,MAAM,IAAI,EAAE,MAuBlB,CAAA"}
|
package/dist/bin/loader/index.js
CHANGED
|
@@ -6,12 +6,10 @@ import { CLIENT_EXTENSIONS } from './clientExtensions.js';
|
|
|
6
6
|
import { compile } from './compile.js';
|
|
7
7
|
const locatedConfig = getTsconfig();
|
|
8
8
|
const tsconfig = locatedConfig.config.compilerOptions;
|
|
9
|
-
tsconfig.module = ts.ModuleKind.ESNext;
|
|
10
|
-
// Specify bundler resolution for Next.js compatibility.
|
|
11
|
-
// We will use TS to resolve file paths for most flexibility
|
|
12
|
-
tsconfig.moduleResolution = ts.ModuleResolutionKind.Bundler;
|
|
13
9
|
// Don't resolve d.ts files, because we aren't type-checking
|
|
14
10
|
tsconfig.noDtsResolution = true;
|
|
11
|
+
tsconfig.module = ts.ModuleKind.ESNext;
|
|
12
|
+
tsconfig.moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
15
13
|
const moduleResolutionCache = ts.createModuleResolutionCache(ts.sys.getCurrentDirectory(), (x)=>x, tsconfig);
|
|
16
14
|
const host = {
|
|
17
15
|
fileExists: ts.sys.fileExists,
|
|
@@ -26,11 +24,13 @@ const TS_EXTENSIONS = [
|
|
|
26
24
|
export const resolve = async (specifier, context, nextResolve)=>{
|
|
27
25
|
const isTS = TS_EXTENSIONS.some((ext)=>specifier.endsWith(ext));
|
|
28
26
|
const isClient = CLIENT_EXTENSIONS.some((ext)=>specifier.endsWith(ext));
|
|
27
|
+
// If a client file is resolved, we'll set `format: client`
|
|
28
|
+
// and short circuit, so the load step
|
|
29
|
+
// will return source code of empty object
|
|
29
30
|
if (isClient) {
|
|
30
31
|
const nextResult = await nextResolve(specifier, context, nextResolve);
|
|
31
|
-
const specifierSegments = specifier.split('.');
|
|
32
32
|
return {
|
|
33
|
-
format: '
|
|
33
|
+
format: 'client',
|
|
34
34
|
shortCircuit: true,
|
|
35
35
|
url: nextResult.url
|
|
36
36
|
};
|
|
@@ -43,31 +43,39 @@ export const resolve = async (specifier, context, nextResolve)=>{
|
|
|
43
43
|
url: specifier
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
// Try and resolve normally
|
|
47
|
+
// This could fail, so we need to swallow that error
|
|
48
|
+
// and keep going
|
|
49
|
+
let nextResult;
|
|
50
|
+
// First, try to
|
|
51
|
+
if (!isTS) {
|
|
52
|
+
try {
|
|
53
|
+
nextResult = await nextResolve(specifier, context, nextResolve);
|
|
54
|
+
} catch (_) {
|
|
55
|
+
// swallow error
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (nextResult) {
|
|
59
|
+
const nextResultIsTS = TS_EXTENSIONS.some((ext)=>nextResult.url.endsWith(ext));
|
|
60
|
+
return {
|
|
61
|
+
...nextResult,
|
|
62
|
+
format: nextResultIsTS ? 'ts' : nextResult.format,
|
|
63
|
+
shortCircuit: true
|
|
64
|
+
};
|
|
49
65
|
}
|
|
50
66
|
const { resolvedModule } = ts.resolveModuleName(specifier, fileURLToPath(context.parentURL), tsconfig, host, moduleResolutionCache);
|
|
51
|
-
// import from local project to local project TS file
|
|
52
67
|
if (resolvedModule) {
|
|
53
|
-
const resolvedIsNodeModule = resolvedModule.resolvedFileName.includes('/node_modules/');
|
|
54
68
|
const resolvedIsTS = TS_EXTENSIONS.includes(resolvedModule.extension);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
// We want to use TS "Bundler" moduleResolution for just about all files
|
|
63
|
-
// so we pass the TS result here
|
|
64
|
-
return nextResolve(pathToFileURL(resolvedModule.resolvedFileName).href);
|
|
69
|
+
return {
|
|
70
|
+
format: resolvedIsTS ? 'ts' : undefined,
|
|
71
|
+
shortCircuit: true,
|
|
72
|
+
url: pathToFileURL(resolvedModule.resolvedFileName).href
|
|
73
|
+
};
|
|
65
74
|
}
|
|
66
75
|
// import from local project to either:
|
|
67
76
|
// - something TS couldn't resolve
|
|
68
|
-
// - external library
|
|
69
77
|
// - local project non-TS file
|
|
70
|
-
return nextResolve(specifier);
|
|
78
|
+
return nextResolve(specifier, context, nextResolve);
|
|
71
79
|
};
|
|
72
80
|
const swcOptions = {
|
|
73
81
|
...tsconfig,
|
|
@@ -81,10 +89,10 @@ if (tsconfig.paths) {
|
|
|
81
89
|
}
|
|
82
90
|
}
|
|
83
91
|
export const load = async (url, context, nextLoad)=>{
|
|
84
|
-
if (
|
|
85
|
-
const rawSource = '{}';
|
|
92
|
+
if (context.format === 'client') {
|
|
93
|
+
const rawSource = 'export default {}';
|
|
86
94
|
return {
|
|
87
|
-
format: '
|
|
95
|
+
format: 'module',
|
|
88
96
|
shortCircuit: true,
|
|
89
97
|
source: rawSource
|
|
90
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/bin/loader/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/unbound-method */\nimport { getTsconfig } from 'get-tsconfig'\nimport path from 'path'\nimport ts from 'typescript'\nimport { fileURLToPath, pathToFileURL } from 'url'\n\nimport { CLIENT_EXTENSIONS } from './clientExtensions.js'\nimport { compile } from './compile.js'\n\ninterface ResolveContext {\n conditions: string[]\n parentURL: string | undefined\n}\ninterface ResolveResult {\n format?: string\n shortCircuit?: boolean\n url: string\n}\ntype ResolveArgs = [\n specifier: string,\n context?: ResolveContext,\n nextResolve?: (...args: ResolveArgs) => Promise<ResolveResult>,\n]\ntype ResolveFn = (...args: Required<ResolveArgs>) => Promise<ResolveResult>\n\nconst locatedConfig = getTsconfig()\nconst tsconfig = locatedConfig.config.compilerOptions as unknown as ts.CompilerOptions\n\
|
|
1
|
+
{"version":3,"sources":["../../../src/bin/loader/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/unbound-method */\nimport { getTsconfig } from 'get-tsconfig'\nimport path from 'path'\nimport ts from 'typescript'\nimport { fileURLToPath, pathToFileURL } from 'url'\n\nimport { CLIENT_EXTENSIONS } from './clientExtensions.js'\nimport { compile } from './compile.js'\n\ninterface ResolveContext {\n conditions: string[]\n parentURL: string | undefined\n}\ninterface ResolveResult {\n format?: string\n shortCircuit?: boolean\n url: string\n}\ntype ResolveArgs = [\n specifier: string,\n context?: ResolveContext,\n nextResolve?: (...args: ResolveArgs) => Promise<ResolveResult>,\n]\ntype ResolveFn = (...args: Required<ResolveArgs>) => Promise<ResolveResult>\n\nconst locatedConfig = getTsconfig()\nconst tsconfig = locatedConfig.config.compilerOptions as unknown as ts.CompilerOptions\n\n// Don't resolve d.ts files, because we aren't type-checking\ntsconfig.noDtsResolution = true\ntsconfig.module = ts.ModuleKind.ESNext\ntsconfig.moduleResolution = ts.ModuleResolutionKind.NodeNext\n\nconst moduleResolutionCache = ts.createModuleResolutionCache(\n ts.sys.getCurrentDirectory(),\n (x) => x,\n tsconfig,\n)\nconst host: ts.ModuleResolutionHost = {\n fileExists: ts.sys.fileExists,\n readFile: ts.sys.readFile,\n}\nconst TS_EXTENSIONS: string[] = [\n ts.Extension.Ts,\n ts.Extension.Tsx,\n ts.Extension.Dts,\n ts.Extension.Mts,\n]\n\nexport const resolve: ResolveFn = async (specifier, context, nextResolve) => {\n const isTS = TS_EXTENSIONS.some((ext) => specifier.endsWith(ext))\n const isClient = CLIENT_EXTENSIONS.some((ext) => specifier.endsWith(ext))\n\n // If a client file is resolved, we'll set `format: client`\n // and short circuit, so the load step\n // will return source code of empty object\n if (isClient) {\n const nextResult = await nextResolve(specifier, context, nextResolve)\n\n return {\n format: 'client',\n shortCircuit: true,\n url: nextResult.url,\n }\n }\n\n // entrypoint\n if (!context.parentURL) {\n return {\n format: isTS ? 'ts' : undefined,\n shortCircuit: true,\n url: specifier,\n }\n }\n\n // Try and resolve normally\n // This could fail, so we need to swallow that error\n // and keep going\n let nextResult: ResolveResult\n\n // First, try to\n if (!isTS) {\n try {\n nextResult = await nextResolve(specifier, context, nextResolve)\n } catch (_) {\n // swallow error\n }\n }\n\n if (nextResult) {\n const nextResultIsTS = TS_EXTENSIONS.some((ext) => nextResult.url.endsWith(ext))\n\n return {\n ...nextResult,\n format: nextResultIsTS ? 'ts' : nextResult.format,\n shortCircuit: true,\n }\n }\n\n const { resolvedModule } = ts.resolveModuleName(\n specifier,\n fileURLToPath(context.parentURL),\n tsconfig,\n host,\n moduleResolutionCache,\n )\n\n if (resolvedModule) {\n const resolvedIsTS = TS_EXTENSIONS.includes(resolvedModule.extension)\n\n return {\n format: resolvedIsTS ? 'ts' : undefined,\n shortCircuit: true,\n url: pathToFileURL(resolvedModule.resolvedFileName).href,\n }\n }\n\n // import from local project to either:\n // - something TS couldn't resolve\n // - local project non-TS file\n return nextResolve(specifier, context, nextResolve)\n}\n\ninterface LoadContext {\n conditions: string[]\n format: null | string | undefined\n}\ninterface LoadResult {\n format: string\n shortCircuit?: boolean\n source: ArrayBuffer | SharedArrayBuffer | Uint8Array | string\n}\ntype LoadArgs = [\n url: string,\n context: LoadContext,\n nextLoad?: (...args: LoadArgs) => Promise<LoadResult>,\n]\ntype LoadFn = (...args: Required<LoadArgs>) => Promise<LoadResult>\n\nconst swcOptions = {\n ...tsconfig,\n baseUrl: path.resolve(''),\n paths: undefined,\n}\n\nif (tsconfig.paths) {\n swcOptions.paths = tsconfig.paths\n if (tsconfig.baseUrl) {\n swcOptions.baseUrl = path.resolve(tsconfig.baseUrl)\n }\n}\n\nexport const load: LoadFn = async (url, context, nextLoad) => {\n if (context.format === 'client') {\n const rawSource = 'export default {}'\n\n return {\n format: 'module',\n shortCircuit: true,\n source: rawSource,\n }\n }\n\n if (context.format === 'ts') {\n const { source } = await nextLoad(url, context)\n const code = typeof source === 'string' ? source : Buffer.from(source).toString()\n const compiled = await compile(code, fileURLToPath(url), swcOptions)\n return {\n format: 'module',\n shortCircuit: true,\n source: compiled,\n }\n } else {\n return nextLoad(url, context)\n }\n}\n"],"names":["getTsconfig","path","ts","fileURLToPath","pathToFileURL","CLIENT_EXTENSIONS","compile","locatedConfig","tsconfig","config","compilerOptions","noDtsResolution","module","ModuleKind","ESNext","moduleResolution","ModuleResolutionKind","NodeNext","moduleResolutionCache","createModuleResolutionCache","sys","getCurrentDirectory","x","host","fileExists","readFile","TS_EXTENSIONS","Extension","Ts","Tsx","Dts","Mts","resolve","specifier","context","nextResolve","isTS","some","ext","endsWith","isClient","nextResult","format","shortCircuit","url","parentURL","undefined","_","nextResultIsTS","resolvedModule","resolveModuleName","resolvedIsTS","includes","extension","resolvedFileName","href","swcOptions","baseUrl","paths","load","nextLoad","rawSource","source","code","Buffer","from","toString","compiled"],"mappings":"AAAA,oDAAoD,GACpD,SAASA,WAAW,QAAQ,eAAc;AAC1C,OAAOC,UAAU,OAAM;AACvB,OAAOC,QAAQ,aAAY;AAC3B,SAASC,aAAa,EAAEC,aAAa,QAAQ,MAAK;AAElD,SAASC,iBAAiB,QAAQ,wBAAuB;AACzD,SAASC,OAAO,QAAQ,eAAc;AAkBtC,MAAMC,gBAAgBP;AACtB,MAAMQ,WAAWD,cAAcE,MAAM,CAACC,eAAe;AAErD,4DAA4D;AAC5DF,SAASG,eAAe,GAAG;AAC3BH,SAASI,MAAM,GAAGV,GAAGW,UAAU,CAACC,MAAM;AACtCN,SAASO,gBAAgB,GAAGb,GAAGc,oBAAoB,CAACC,QAAQ;AAE5D,MAAMC,wBAAwBhB,GAAGiB,2BAA2B,CAC1DjB,GAAGkB,GAAG,CAACC,mBAAmB,IAC1B,CAACC,IAAMA,GACPd;AAEF,MAAMe,OAAgC;IACpCC,YAAYtB,GAAGkB,GAAG,CAACI,UAAU;IAC7BC,UAAUvB,GAAGkB,GAAG,CAACK,QAAQ;AAC3B;AACA,MAAMC,gBAA0B;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,CAACH,eAAeI,SAAS;QAEpE,OAAO;YACLX,QAAQS,eAAe,OAAOL;YAC9BH,cAAc;YACdC,KAAKxC,cAAc6C,eAAeK,gBAAgB,EAAEC,IAAI;QAC1D;IACF;IAEA,uCAAuC;IACvC,kCAAkC;IAClC,8BAA8B;IAC9B,OAAOpB,YAAYF,WAAWC,SAASC;AACzC,EAAC;AAkBD,MAAMqB,aAAa;IACjB,GAAGhD,QAAQ;IACXiD,SAASxD,KAAK+B,OAAO,CAAC;IACtB0B,OAAOZ;AACT;AAEA,IAAItC,SAASkD,KAAK,EAAE;IAClBF,WAAWE,KAAK,GAAGlD,SAASkD,KAAK;IACjC,IAAIlD,SAASiD,OAAO,EAAE;QACpBD,WAAWC,OAAO,GAAGxD,KAAK+B,OAAO,CAACxB,SAASiD,OAAO;IACpD;AACF;AAEA,OAAO,MAAME,OAAe,OAAOf,KAAKV,SAAS0B;IAC/C,IAAI1B,QAAQQ,MAAM,KAAK,UAAU;QAC/B,MAAMmB,YAAY;QAElB,OAAO;YACLnB,QAAQ;YACRC,cAAc;YACdmB,QAAQD;QACV;IACF;IAEA,IAAI3B,QAAQQ,MAAM,KAAK,MAAM;QAC3B,MAAM,EAAEoB,MAAM,EAAE,GAAG,MAAMF,SAAShB,KAAKV;QACvC,MAAM6B,OAAO,OAAOD,WAAW,WAAWA,SAASE,OAAOC,IAAI,CAACH,QAAQI,QAAQ;QAC/E,MAAMC,WAAW,MAAM7D,QAAQyD,MAAM5D,cAAcyC,MAAMY;QACzD,OAAO;YACLd,QAAQ;YACRC,cAAc;YACdmB,QAAQK;QACV;IACF,OAAO;QACL,OAAOP,SAAShB,KAAKV;IACvB;AACF,EAAC"}
|
|
@@ -10,11 +10,11 @@ export type ClientCollectionConfig = Omit<SanitizedCollectionConfig, 'admin' | '
|
|
|
10
10
|
import type { ClientFieldConfig } from '../../fields/config/client.js';
|
|
11
11
|
import type { SanitizedCollectionConfig } from './types.js';
|
|
12
12
|
export declare const createClientCollectionConfig: (collection: SanitizedCollectionConfig) => {
|
|
13
|
-
auth: import("
|
|
13
|
+
auth: import("../../auth/types.js").Auth;
|
|
14
14
|
endpoints: false | import("../../config/types.js").Endpoint[];
|
|
15
|
-
fields: import("
|
|
16
|
-
upload: import("
|
|
17
|
-
versions: import("
|
|
15
|
+
fields: import("../../exports/types.js").Field[];
|
|
16
|
+
upload: import("../../uploads/types.js").SanitizedUploadConfig;
|
|
17
|
+
versions: import("../../versions/types.js").SanitizedCollectionVersions;
|
|
18
18
|
admin: {
|
|
19
19
|
components: {
|
|
20
20
|
AfterList: import("react").ComponentType<any>[];
|
|
@@ -22,21 +22,21 @@ export declare const createClientCollectionConfig: (collection: SanitizedCollect
|
|
|
22
22
|
BeforeList: import("react").ComponentType<any>[];
|
|
23
23
|
BeforeListTable: import("react").ComponentType<any>[];
|
|
24
24
|
edit: {
|
|
25
|
-
PreviewButton: import("
|
|
26
|
-
PublishButton: import("
|
|
27
|
-
SaveButton: import("
|
|
28
|
-
SaveDraftButton: import("
|
|
25
|
+
PreviewButton: import("../../admin/types.js").CustomPreviewButton;
|
|
26
|
+
PublishButton: import("../../admin/types.js").CustomPublishButton;
|
|
27
|
+
SaveButton: import("../../admin/types.js").CustomSaveButton;
|
|
28
|
+
SaveDraftButton: import("../../admin/types.js").CustomSaveDraftButton;
|
|
29
29
|
};
|
|
30
30
|
views: {
|
|
31
31
|
Edit: import("../../config/types.js").EditViewComponent | {
|
|
32
32
|
API: import("../../config/types.js").EditViewComponent | {
|
|
33
|
-
Tab: import("
|
|
33
|
+
Tab: import("../../admin/types.js").DocumentTabComponent | {
|
|
34
34
|
Pill: import("react").ComponentType<{}>;
|
|
35
|
-
condition: import("
|
|
35
|
+
condition: import("../../admin/types.js").DocumentTabCondition;
|
|
36
36
|
href: string | ((args: {
|
|
37
37
|
apiURL: string;
|
|
38
38
|
collection: SanitizedCollectionConfig;
|
|
39
|
-
global: import("
|
|
39
|
+
global: import("../../exports/types.js").SanitizedGlobalConfig;
|
|
40
40
|
id?: string;
|
|
41
41
|
routes: {
|
|
42
42
|
admin: string;
|
|
@@ -61,13 +61,13 @@ export declare const createClientCollectionConfig: (collection: SanitizedCollect
|
|
|
61
61
|
actions: import("react").ComponentType<any>[];
|
|
62
62
|
};
|
|
63
63
|
Default: import("../../config/types.js").EditViewComponent | {
|
|
64
|
-
Tab: import("
|
|
64
|
+
Tab: import("../../admin/types.js").DocumentTabComponent | {
|
|
65
65
|
Pill: import("react").ComponentType<{}>;
|
|
66
|
-
condition: import("
|
|
66
|
+
condition: import("../../admin/types.js").DocumentTabCondition;
|
|
67
67
|
href: string | ((args: {
|
|
68
68
|
apiURL: string;
|
|
69
69
|
collection: SanitizedCollectionConfig;
|
|
70
|
-
global: import("
|
|
70
|
+
global: import("../../exports/types.js").SanitizedGlobalConfig;
|
|
71
71
|
id?: string;
|
|
72
72
|
routes: {
|
|
73
73
|
admin: string;
|
|
@@ -92,13 +92,13 @@ export declare const createClientCollectionConfig: (collection: SanitizedCollect
|
|
|
92
92
|
actions: import("react").ComponentType<any>[];
|
|
93
93
|
};
|
|
94
94
|
LivePreview: import("../../config/types.js").EditViewComponent | {
|
|
95
|
-
Tab: import("
|
|
95
|
+
Tab: import("../../admin/types.js").DocumentTabComponent | {
|
|
96
96
|
Pill: import("react").ComponentType<{}>;
|
|
97
|
-
condition: import("
|
|
97
|
+
condition: import("../../admin/types.js").DocumentTabCondition;
|
|
98
98
|
href: string | ((args: {
|
|
99
99
|
apiURL: string;
|
|
100
100
|
collection: SanitizedCollectionConfig;
|
|
101
|
-
global: import("
|
|
101
|
+
global: import("../../exports/types.js").SanitizedGlobalConfig;
|
|
102
102
|
id?: string;
|
|
103
103
|
routes: {
|
|
104
104
|
admin: string;
|
|
@@ -123,13 +123,13 @@ export declare const createClientCollectionConfig: (collection: SanitizedCollect
|
|
|
123
123
|
actions: import("react").ComponentType<any>[];
|
|
124
124
|
};
|
|
125
125
|
Version: import("../../config/types.js").EditViewComponent | {
|
|
126
|
-
Tab: import("
|
|
126
|
+
Tab: import("../../admin/types.js").DocumentTabComponent | {
|
|
127
127
|
Pill: import("react").ComponentType<{}>;
|
|
128
|
-
condition: import("
|
|
128
|
+
condition: import("../../admin/types.js").DocumentTabCondition;
|
|
129
129
|
href: string | ((args: {
|
|
130
130
|
apiURL: string;
|
|
131
131
|
collection: SanitizedCollectionConfig;
|
|
132
|
-
global: import("
|
|
132
|
+
global: import("../../exports/types.js").SanitizedGlobalConfig;
|
|
133
133
|
id?: string;
|
|
134
134
|
routes: {
|
|
135
135
|
admin: string;
|
|
@@ -154,13 +154,13 @@ export declare const createClientCollectionConfig: (collection: SanitizedCollect
|
|
|
154
154
|
actions: import("react").ComponentType<any>[];
|
|
155
155
|
};
|
|
156
156
|
Versions: import("../../config/types.js").EditViewComponent | {
|
|
157
|
-
Tab: import("
|
|
157
|
+
Tab: import("../../admin/types.js").DocumentTabComponent | {
|
|
158
158
|
Pill: import("react").ComponentType<{}>;
|
|
159
|
-
condition: import("
|
|
159
|
+
condition: import("../../admin/types.js").DocumentTabCondition;
|
|
160
160
|
href: string | ((args: {
|
|
161
161
|
apiURL: string;
|
|
162
162
|
collection: SanitizedCollectionConfig;
|
|
163
|
-
global: import("
|
|
163
|
+
global: import("../../exports/types.js").SanitizedGlobalConfig;
|
|
164
164
|
id?: string;
|
|
165
165
|
routes: {
|
|
166
166
|
admin: string;
|
|
@@ -186,13 +186,13 @@ export declare const createClientCollectionConfig: (collection: SanitizedCollect
|
|
|
186
186
|
};
|
|
187
187
|
} | {
|
|
188
188
|
[x: string]: {
|
|
189
|
-
Tab: import("
|
|
189
|
+
Tab: import("../../admin/types.js").DocumentTabComponent | {
|
|
190
190
|
Pill: import("react").ComponentType<{}>;
|
|
191
|
-
condition: import("
|
|
191
|
+
condition: import("../../admin/types.js").DocumentTabCondition;
|
|
192
192
|
href: string | ((args: {
|
|
193
193
|
apiURL: string;
|
|
194
194
|
collection: SanitizedCollectionConfig;
|
|
195
|
-
global: import("
|
|
195
|
+
global: import("../../exports/types.js").SanitizedGlobalConfig;
|
|
196
196
|
id?: string;
|
|
197
197
|
routes: {
|
|
198
198
|
admin: string;
|
|
@@ -233,7 +233,7 @@ export declare const createClientCollectionConfig: (collection: SanitizedCollect
|
|
|
233
233
|
[x: string]: string;
|
|
234
234
|
};
|
|
235
235
|
hidden: boolean | ((args: {
|
|
236
|
-
user: import("
|
|
236
|
+
user: import("../../auth/types.js").ClientUser;
|
|
237
237
|
}) => boolean);
|
|
238
238
|
hideAPIURL: boolean;
|
|
239
239
|
listSearchableFields: string[];
|
|
@@ -247,9 +247,9 @@ export declare const createClientCollectionConfig: (collection: SanitizedCollect
|
|
|
247
247
|
url: string | ((args: {
|
|
248
248
|
collectionConfig?: SanitizedCollectionConfig;
|
|
249
249
|
data: Record<string, any>;
|
|
250
|
-
globalConfig?: import("
|
|
250
|
+
globalConfig?: import("../../exports/types.js").SanitizedGlobalConfig;
|
|
251
251
|
locale: import("../../config/types.js").Locale;
|
|
252
|
-
payload: import("
|
|
252
|
+
payload: import("../../index.js").Payload;
|
|
253
253
|
}) => string | Promise<string>);
|
|
254
254
|
};
|
|
255
255
|
pagination: {
|
|
@@ -288,7 +288,9 @@ export declare const createClientCollectionConfig: (collection: SanitizedCollect
|
|
|
288
288
|
interface: string;
|
|
289
289
|
};
|
|
290
290
|
access: {
|
|
291
|
-
admin: (
|
|
291
|
+
admin: ({ req }: {
|
|
292
|
+
req: import("../../types/index.js").PayloadRequest;
|
|
293
|
+
}) => boolean | Promise<boolean>;
|
|
292
294
|
create: import("../../config/types.js").Access;
|
|
293
295
|
delete: import("../../config/types.js").Access;
|
|
294
296
|
read: import("../../config/types.js").Access;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/collections/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAA;AAE/F,MAAM,MAAM,8BAA8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yBAAyB,CAAC,OAAO,CAAC,EAClC,QAAQ,GAAG,aAAa,GAAG,mCAAmC,CAC/D,GAAG;QACF,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,+BAA+B,CAAC,CAAA;KACvE,CAAA;IACD,MAAM,EAAE,iBAAiB,EAAE,CAAA;CAC5B,CAAA;AAED,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAI3D,eAAO,MAAM,4BAA4B,eAAgB,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDjF,CAAA;AAED,eAAO,MAAM,6BAA6B,gBAC3B,yBAAyB,EAAE,KACvC,sBAAsB,EACkD,CAAA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const defaults: {
|
|
2
2
|
access: {
|
|
3
3
|
create: ({ req: { user } }: {
|
|
4
|
-
req: import("
|
|
4
|
+
req: import("../../types/index.js").PayloadRequest;
|
|
5
5
|
}) => boolean;
|
|
6
6
|
delete: ({ req: { user } }: {
|
|
7
|
-
req: import("
|
|
7
|
+
req: import("../../types/index.js").PayloadRequest;
|
|
8
8
|
}) => boolean;
|
|
9
9
|
read: ({ req: { user } }: {
|
|
10
|
-
req: import("
|
|
10
|
+
req: import("../../types/index.js").PayloadRequest;
|
|
11
11
|
}) => boolean;
|
|
12
12
|
unlock: ({ req: { user } }: {
|
|
13
|
-
req: import("
|
|
13
|
+
req: import("../../types/index.js").PayloadRequest;
|
|
14
14
|
}) => boolean;
|
|
15
15
|
update: ({ req: { user } }: {
|
|
16
|
-
req: import("
|
|
16
|
+
req: import("../../types/index.js").PayloadRequest;
|
|
17
17
|
}) => boolean;
|
|
18
18
|
};
|
|
19
19
|
admin: {
|
|
@@ -250,7 +250,9 @@ export type CollectionConfig = {
|
|
|
250
250
|
* Access control
|
|
251
251
|
*/
|
|
252
252
|
access?: {
|
|
253
|
-
admin?: (
|
|
253
|
+
admin?: ({ req }: {
|
|
254
|
+
req: PayloadRequest;
|
|
255
|
+
}) => Promise<boolean> | boolean;
|
|
254
256
|
create?: Access;
|
|
255
257
|
delete?: Access;
|
|
256
258
|
read?: Access;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/collections/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,KAAK,EACV,MAAM,EACN,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,E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c,GAAG;IAC3B,MAAM,EAAE,yBAAyB,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["import type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n} from '../../admin/types.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n EditConfig,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LivePreviewConfig,\n} from '../../config/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { GeneratedTypes } from '../../index.js'\nimport type { PayloadRequest, RequestContext } from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type HookOperationType =\n | 'autosave'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'refresh'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequest\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<T extends TypeWithID = any> = (\n arg: AfterOperationArg<T>,\n) => Promise<ReturnType<AfterOperationMap<T>[keyof AfterOperationMap<T>]>>\n\nexport type AfterErrorHook = (\n err: Error,\n res: unknown,\n context: RequestContext,\n /** The collection which this hook is being run on. This is null if the AfterError hook was be added to the payload-wide config */\n collection: SanitizedCollectionConfig | null,\n) => { response: any; status: number } | void\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type CollectionAdminOptions = {\n /**\n * Custom admin components\n */\n components?: {\n AfterList?: React.ComponentType<any>[]\n AfterListTable?: React.ComponentType<any>[]\n BeforeList?: React.ComponentType<any>[]\n BeforeListTable?: React.ComponentType<any>[]\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomPreviewButton\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomPublishButton\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomSaveButton\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomSaveDraftButton\n }\n views?: {\n /**\n * Set to a React component to replace the entire \"Edit\" view, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n Edit?: EditConfig\n List?:\n | {\n Component?: React.ComponentType<any>\n actions?: React.ComponentType<any>[]\n }\n | React.ComponentType<any>\n }\n }\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Place collections into a navigational group\n * */\n group?: Record<string, string> | string\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit view and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig = {\n /**\n * Access control\n */\n access?: {\n admin?: (args?: any) => Promise<boolean> | boolean\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: IncomingAuthType | boolean\n /** Extension point to add your custom data. */\n custom?: Record<string, any>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: string\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: Omit<Endpoint, 'root'>[] | false\n fields: Field[]\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n }\n /**\n * Label configuration\n */\n labels?: {\n plural?: Record<string, string> | string\n singular?: Record<string, string> | string\n }\n slug: string\n /**\n * Add `createdAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: UploadConfig | boolean\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable versioning\n */\n versions?: IncomingCollectionVersions | boolean\n}\n\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'auth' | 'endpoints' | 'fields' | 'upload' | 'versions'\n > {\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n graphQL?: {\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends keyof GeneratedTypes['collections']> = {\n docs: GeneratedTypes['collections'][TSlug][]\n errors: {\n id: GeneratedTypes['collections'][TSlug]['id']\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n id: number | string\n updatedAt: string\n}\n"],"names":[],"mappings":"AAobA,WAKC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["import type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n} from '../../admin/types.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n EditConfig,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LivePreviewConfig,\n} from '../../config/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { GeneratedTypes } from '../../index.js'\nimport type { PayloadRequest, RequestContext } from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type HookOperationType =\n | 'autosave'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'refresh'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequest\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<T extends TypeWithID = any> = (\n arg: AfterOperationArg<T>,\n) => Promise<ReturnType<AfterOperationMap<T>[keyof AfterOperationMap<T>]>>\n\nexport type AfterErrorHook = (\n err: Error,\n res: unknown,\n context: RequestContext,\n /** The collection which this hook is being run on. This is null if the AfterError hook was be added to the payload-wide config */\n collection: SanitizedCollectionConfig | null,\n) => { response: any; status: number } | void\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type CollectionAdminOptions = {\n /**\n * Custom admin components\n */\n components?: {\n AfterList?: React.ComponentType<any>[]\n AfterListTable?: React.ComponentType<any>[]\n BeforeList?: React.ComponentType<any>[]\n BeforeListTable?: React.ComponentType<any>[]\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomPreviewButton\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomPublishButton\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomSaveButton\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomSaveDraftButton\n }\n views?: {\n /**\n * Set to a React component to replace the entire \"Edit\" view, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n Edit?: EditConfig\n List?:\n | {\n Component?: React.ComponentType<any>\n actions?: React.ComponentType<any>[]\n }\n | React.ComponentType<any>\n }\n }\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Place collections into a navigational group\n * */\n group?: Record<string, string> | string\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit view and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig = {\n /**\n * Access control\n */\n access?: {\n admin?: ({ req }: { req: PayloadRequest }) => Promise<boolean> | boolean\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: IncomingAuthType | boolean\n /** Extension point to add your custom data. */\n custom?: Record<string, any>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: string\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: Omit<Endpoint, 'root'>[] | false\n fields: Field[]\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n }\n /**\n * Label configuration\n */\n labels?: {\n plural?: Record<string, string> | string\n singular?: Record<string, string> | string\n }\n slug: string\n /**\n * Add `createdAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: UploadConfig | boolean\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable versioning\n */\n versions?: IncomingCollectionVersions | boolean\n}\n\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'auth' | 'endpoints' | 'fields' | 'upload' | 'versions'\n > {\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n graphQL?: {\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends keyof GeneratedTypes['collections']> = {\n docs: GeneratedTypes['collections'][TSlug][]\n errors: {\n id: GeneratedTypes['collections'][TSlug]['id']\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n id: number | string\n updatedAt: string\n}\n"],"names":[],"mappings":"AAobA,WAKC"}
|
|
@@ -9,12 +9,12 @@ import restoreVersion from './restoreVersion.js';
|
|
|
9
9
|
import update from './update.js';
|
|
10
10
|
declare const _default: {
|
|
11
11
|
auth: {
|
|
12
|
-
auth: (payload: import("
|
|
13
|
-
forgotPassword: typeof import("
|
|
14
|
-
login: typeof import("
|
|
15
|
-
resetPassword: typeof import("
|
|
16
|
-
unlock: typeof import("
|
|
17
|
-
verifyEmail: typeof import("
|
|
12
|
+
auth: (payload: import("../../../index.js").Payload, options: import("../../../auth/operations/auth.js").AuthArgs) => Promise<import("../../../auth/operations/auth.js").AuthResult>;
|
|
13
|
+
forgotPassword: typeof import("../../../auth/operations/local/forgotPassword.js").default;
|
|
14
|
+
login: typeof import("../../../auth/operations/local/login.js").default;
|
|
15
|
+
resetPassword: typeof import("../../../auth/operations/local/resetPassword.js").default;
|
|
16
|
+
unlock: typeof import("../../../auth/operations/local/unlock.js").default;
|
|
17
|
+
verifyEmail: typeof import("../../../auth/operations/local/verifyEmail.js").default;
|
|
18
18
|
};
|
|
19
19
|
create: typeof create;
|
|
20
20
|
deleteLocal: typeof deleteLocal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readMigrationFiles.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/readMigrationFiles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"readMigrationFiles.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/readMigrationFiles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,eAAO,MAAM,kBAAkB,iBAE5B;IACD,OAAO,EAAE,OAAO,CAAA;CACjB,KAAG,QAAQ,SAAS,EAAE,CAuCtB,CAAA"}
|
package/dist/exports/node.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { importConfig } from '../utilities/importConfig.js';
|
|
3
|
-
export { importWithoutClientFiles } from '../utilities/importWithoutClientFiles.js';
|
|
1
|
+
export { importConfig, importWithoutClientFiles } from '../utilities/importWithoutClientFiles.js';
|
|
4
2
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/exports/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/exports/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAA"}
|
package/dist/exports/node.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { importConfig } from '../utilities/importConfig.js';
|
|
3
|
-
export { importWithoutClientFiles } from '../utilities/importWithoutClientFiles.js';
|
|
1
|
+
export { importConfig, importWithoutClientFiles } from '../utilities/importWithoutClientFiles.js';
|
|
4
2
|
|
|
5
3
|
//# sourceMappingURL=node.js.map
|
package/dist/exports/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/node.ts"],"sourcesContent":["export {
|
|
1
|
+
{"version":3,"sources":["../../src/exports/node.ts"],"sourcesContent":["export { importConfig, importWithoutClientFiles } from '../utilities/importWithoutClientFiles.js'\n"],"names":["importConfig","importWithoutClientFiles"],"mappings":"AAAA,SAASA,YAAY,EAAEC,wBAAwB,QAAQ,2CAA0C"}
|