payload 3.40.0-canary.5 → 3.40.0-internal.9e8d70e
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/executeAuthStrategies.d.ts.map +1 -1
- package/dist/auth/executeAuthStrategies.js +2 -0
- package/dist/auth/executeAuthStrategies.js.map +1 -1
- package/dist/auth/operations/auth.d.ts +4 -0
- package/dist/auth/operations/auth.d.ts.map +1 -1
- package/dist/auth/operations/auth.js +2 -1
- package/dist/auth/operations/auth.js.map +1 -1
- package/dist/auth/operations/local/auth.d.ts.map +1 -1
- package/dist/auth/operations/local/auth.js +1 -0
- package/dist/auth/operations/local/auth.js.map +1 -1
- package/dist/auth/types.d.ts +4 -0
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/versions/payloadPackageList.js +1 -1
- package/dist/versions/payloadPackageList.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeAuthStrategies.d.ts","sourceRoot":"","sources":["../../src/auth/executeAuthStrategies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAI9E,eAAO,MAAM,qBAAqB,SAC1B,wBAAwB,KAC7B,OAAO,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"executeAuthStrategies.d.ts","sourceRoot":"","sources":["../../src/auth/executeAuthStrategies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAI9E,eAAO,MAAM,qBAAqB,SAC1B,wBAAwB,KAC7B,OAAO,CAAC,kBAAkB,CA+B5B,CAAA"}
|
|
@@ -10,6 +10,8 @@ export const executeAuthStrategies = async (args)=>{
|
|
|
10
10
|
for (const strategy of args.payload.authStrategies){
|
|
11
11
|
// add the configured AuthStrategy `name` to the strategy function args
|
|
12
12
|
args.strategyName = strategy.name;
|
|
13
|
+
args.isGraphQL = Boolean(args.isGraphQL);
|
|
14
|
+
args.isAdmin = Boolean(args.isAdmin);
|
|
13
15
|
try {
|
|
14
16
|
const authResult = await strategy.authenticate(args);
|
|
15
17
|
if (authResult.responseHeaders) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/executeAuthStrategies.ts"],"sourcesContent":["import type { AuthStrategyFunctionArgs, AuthStrategyResult } from './index.js'\n\nimport { logError } from '../utilities/logError.js'\nimport { mergeHeaders } from '../utilities/mergeHeaders.js'\nexport const executeAuthStrategies = async (\n args: AuthStrategyFunctionArgs,\n): Promise<AuthStrategyResult> => {\n let result: AuthStrategyResult = { user: null }\n\n if (!args.payload.authStrategies?.length) {\n return result\n }\n\n for (const strategy of args.payload.authStrategies) {\n // add the configured AuthStrategy `name` to the strategy function args\n args.strategyName = strategy.name\n\n try {\n const authResult = await strategy.authenticate(args)\n if (authResult.responseHeaders) {\n authResult.responseHeaders = mergeHeaders(\n result.responseHeaders || new Headers(),\n authResult.responseHeaders || new Headers(),\n )\n }\n result = authResult\n } catch (err) {\n logError({ err, payload: args.payload })\n }\n\n if (result.user) {\n return result\n }\n }\n return result\n}\n"],"names":["logError","mergeHeaders","executeAuthStrategies","args","result","user","payload","authStrategies","length","strategy","strategyName","name","authResult","authenticate","responseHeaders","Headers","err"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,YAAY,QAAQ,+BAA8B;AAC3D,OAAO,MAAMC,wBAAwB,OACnCC;IAEA,IAAIC,SAA6B;QAAEC,MAAM;IAAK;IAE9C,IAAI,CAACF,KAAKG,OAAO,CAACC,cAAc,EAAEC,QAAQ;QACxC,OAAOJ;IACT;IAEA,KAAK,MAAMK,YAAYN,KAAKG,OAAO,CAACC,cAAc,CAAE;QAClD,uEAAuE;QACvEJ,KAAKO,YAAY,GAAGD,SAASE,IAAI;
|
|
1
|
+
{"version":3,"sources":["../../src/auth/executeAuthStrategies.ts"],"sourcesContent":["import type { AuthStrategyFunctionArgs, AuthStrategyResult } from './index.js'\n\nimport { logError } from '../utilities/logError.js'\nimport { mergeHeaders } from '../utilities/mergeHeaders.js'\nexport const executeAuthStrategies = async (\n args: AuthStrategyFunctionArgs,\n): Promise<AuthStrategyResult> => {\n let result: AuthStrategyResult = { user: null }\n\n if (!args.payload.authStrategies?.length) {\n return result\n }\n\n for (const strategy of args.payload.authStrategies) {\n // add the configured AuthStrategy `name` to the strategy function args\n args.strategyName = strategy.name\n args.isGraphQL = Boolean(args.isGraphQL)\n args.isAdmin = Boolean(args.isAdmin)\n\n try {\n const authResult = await strategy.authenticate(args)\n if (authResult.responseHeaders) {\n authResult.responseHeaders = mergeHeaders(\n result.responseHeaders || new Headers(),\n authResult.responseHeaders || new Headers(),\n )\n }\n result = authResult\n } catch (err) {\n logError({ err, payload: args.payload })\n }\n\n if (result.user) {\n return result\n }\n }\n return result\n}\n"],"names":["logError","mergeHeaders","executeAuthStrategies","args","result","user","payload","authStrategies","length","strategy","strategyName","name","isGraphQL","Boolean","isAdmin","authResult","authenticate","responseHeaders","Headers","err"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,YAAY,QAAQ,+BAA8B;AAC3D,OAAO,MAAMC,wBAAwB,OACnCC;IAEA,IAAIC,SAA6B;QAAEC,MAAM;IAAK;IAE9C,IAAI,CAACF,KAAKG,OAAO,CAACC,cAAc,EAAEC,QAAQ;QACxC,OAAOJ;IACT;IAEA,KAAK,MAAMK,YAAYN,KAAKG,OAAO,CAACC,cAAc,CAAE;QAClD,uEAAuE;QACvEJ,KAAKO,YAAY,GAAGD,SAASE,IAAI;QACjCR,KAAKS,SAAS,GAAGC,QAAQV,KAAKS,SAAS;QACvCT,KAAKW,OAAO,GAAGD,QAAQV,KAAKW,OAAO;QAEnC,IAAI;YACF,MAAMC,aAAa,MAAMN,SAASO,YAAY,CAACb;YAC/C,IAAIY,WAAWE,eAAe,EAAE;gBAC9BF,WAAWE,eAAe,GAAGhB,aAC3BG,OAAOa,eAAe,IAAI,IAAIC,WAC9BH,WAAWE,eAAe,IAAI,IAAIC;YAEtC;YACAd,SAASW;QACX,EAAE,OAAOI,KAAK;YACZnB,SAAS;gBAAEmB;gBAAKb,SAASH,KAAKG,OAAO;YAAC;QACxC;QAEA,IAAIF,OAAOC,IAAI,EAAE;YACf,OAAOD;QACT;IACF;IACA,OAAOA;AACT,EAAC"}
|
|
@@ -2,6 +2,10 @@ import type { SanitizedPermissions, TypedUser } from '../../index.js';
|
|
|
2
2
|
import type { PayloadRequest } from '../../types/index.js';
|
|
3
3
|
export type AuthArgs = {
|
|
4
4
|
headers: Request['headers'];
|
|
5
|
+
/**
|
|
6
|
+
* Specify if you are calling this function from within the admin UI or not.
|
|
7
|
+
*/
|
|
8
|
+
isAdmin?: boolean;
|
|
5
9
|
req?: Omit<PayloadRequest, 'user'>;
|
|
6
10
|
};
|
|
7
11
|
export type AuthResult = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAM1D,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3B,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,oBAAoB,CAAA;IACjC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,IAAI,SAAgB,QAAQ,CAAC,QAAQ,CAAC,KAAG,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAM1D,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,oBAAoB,CAAA;IACjC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,IAAI,SAAgB,QAAQ,CAAC,QAAQ,CAAC,KAAG,OAAO,CAAC,UAAU,CA4BvE,CAAA"}
|
|
@@ -2,12 +2,13 @@ import { killTransaction } from '../../utilities/killTransaction.js';
|
|
|
2
2
|
import { executeAuthStrategies } from '../executeAuthStrategies.js';
|
|
3
3
|
import { getAccessResults } from '../getAccessResults.js';
|
|
4
4
|
export const auth = async (args)=>{
|
|
5
|
-
const { headers } = args;
|
|
5
|
+
const { headers, isAdmin } = args;
|
|
6
6
|
const req = args.req;
|
|
7
7
|
const { payload } = req;
|
|
8
8
|
try {
|
|
9
9
|
const { responseHeaders, user } = await executeAuthStrategies({
|
|
10
10
|
headers,
|
|
11
|
+
isAdmin,
|
|
11
12
|
payload
|
|
12
13
|
});
|
|
13
14
|
req.user = user;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/auth.ts"],"sourcesContent":["import type { SanitizedPermissions, TypedUser } from '../../index.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { executeAuthStrategies } from '../executeAuthStrategies.js'\nimport { getAccessResults } from '../getAccessResults.js'\n\nexport type AuthArgs = {\n headers: Request['headers']\n req?: Omit<PayloadRequest, 'user'>\n}\n\nexport type AuthResult = {\n permissions: SanitizedPermissions\n responseHeaders?: Headers\n user: null | TypedUser\n}\n\nexport const auth = async (args: Required<AuthArgs>): Promise<AuthResult> => {\n const { headers } = args\n const req = args.req as PayloadRequest\n const { payload } = req\n\n try {\n const { responseHeaders, user } = await executeAuthStrategies({\n headers,\n payload,\n })\n\n req.user = user\n req.responseHeaders = responseHeaders\n\n const permissions = await getAccessResults({\n req,\n })\n\n return {\n permissions,\n responseHeaders,\n user,\n }\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["killTransaction","executeAuthStrategies","getAccessResults","auth","args","headers","req","payload","responseHeaders","user","permissions","error"],"mappings":"AAGA,SAASA,eAAe,QAAQ,qCAAoC;AACpE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gBAAgB,QAAQ,yBAAwB;
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/auth.ts"],"sourcesContent":["import type { SanitizedPermissions, TypedUser } from '../../index.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { executeAuthStrategies } from '../executeAuthStrategies.js'\nimport { getAccessResults } from '../getAccessResults.js'\n\nexport type AuthArgs = {\n headers: Request['headers']\n /**\n * Specify if you are calling this function from within the admin UI or not.\n */\n isAdmin?: boolean\n req?: Omit<PayloadRequest, 'user'>\n}\n\nexport type AuthResult = {\n permissions: SanitizedPermissions\n responseHeaders?: Headers\n user: null | TypedUser\n}\n\nexport const auth = async (args: Required<AuthArgs>): Promise<AuthResult> => {\n const { headers, isAdmin } = args\n const req = args.req as PayloadRequest\n const { payload } = req\n\n try {\n const { responseHeaders, user } = await executeAuthStrategies({\n headers,\n isAdmin,\n payload,\n })\n\n req.user = user\n req.responseHeaders = responseHeaders\n\n const permissions = await getAccessResults({\n req,\n })\n\n return {\n permissions,\n responseHeaders,\n user,\n }\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["killTransaction","executeAuthStrategies","getAccessResults","auth","args","headers","isAdmin","req","payload","responseHeaders","user","permissions","error"],"mappings":"AAGA,SAASA,eAAe,QAAQ,qCAAoC;AACpE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gBAAgB,QAAQ,yBAAwB;AAiBzD,OAAO,MAAMC,OAAO,OAAOC;IACzB,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGF;IAC7B,MAAMG,MAAMH,KAAKG,GAAG;IACpB,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,IAAI;QACF,MAAM,EAAEE,eAAe,EAAEC,IAAI,EAAE,GAAG,MAAMT,sBAAsB;YAC5DI;YACAC;YACAE;QACF;QAEAD,IAAIG,IAAI,GAAGA;QACXH,IAAIE,eAAe,GAAGA;QAEtB,MAAME,cAAc,MAAMT,iBAAiB;YACzCK;QACF;QAEA,OAAO;YACLI;YACAF;YACAC;QACF;IACF,EAAE,OAAOE,OAAgB;QACvB,MAAMZ,gBAAgBO;QACtB,MAAMK;IACR;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/auth/operations/local/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAKtD,eAAO,MAAM,IAAI,YAAmB,OAAO,WAAW,QAAQ,KAAG,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/auth/operations/local/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAKtD,eAAO,MAAM,IAAI,YAAmB,OAAO,WAAW,QAAQ,KAAG,OAAO,CAAC,UAAU,CAQlF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/auth/operations/local/auth.ts"],"sourcesContent":["import type { Payload } from '../../../index.js'\nimport type { AuthArgs, AuthResult } from '../auth.js'\n\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { auth as authOperation } from '../auth.js'\n\nexport const auth = async (payload: Payload, options: AuthArgs): Promise<AuthResult> => {\n const { headers, req } = options\n\n return await authOperation({\n headers,\n req: await createLocalReq({ req }, payload),\n })\n}\n"],"names":["createLocalReq","auth","authOperation","payload","options","headers","req"],"mappings":"AAGA,SAASA,cAAc,QAAQ,uCAAsC;AACrE,SAASC,QAAQC,aAAa,QAAQ,aAAY;AAElD,OAAO,MAAMD,OAAO,OAAOE,SAAkBC;IAC3C,MAAM,EAAEC,OAAO,EAAEC,GAAG,EAAE,GAAGF;IAEzB,OAAO,MAAMF,cAAc;QACzBG;
|
|
1
|
+
{"version":3,"sources":["../../../../src/auth/operations/local/auth.ts"],"sourcesContent":["import type { Payload } from '../../../index.js'\nimport type { AuthArgs, AuthResult } from '../auth.js'\n\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { auth as authOperation } from '../auth.js'\n\nexport const auth = async (payload: Payload, options: AuthArgs): Promise<AuthResult> => {\n const { headers, req } = options\n\n return await authOperation({\n headers,\n isAdmin: Boolean(options.isAdmin),\n req: await createLocalReq({ req }, payload),\n })\n}\n"],"names":["createLocalReq","auth","authOperation","payload","options","headers","req","isAdmin","Boolean"],"mappings":"AAGA,SAASA,cAAc,QAAQ,uCAAsC;AACrE,SAASC,QAAQC,aAAa,QAAQ,aAAY;AAElD,OAAO,MAAMD,OAAO,OAAOE,SAAkBC;IAC3C,MAAM,EAAEC,OAAO,EAAEC,GAAG,EAAE,GAAGF;IAEzB,OAAO,MAAMF,cAAc;QACzBG;QACAE,SAASC,QAAQJ,QAAQG,OAAO;QAChCD,KAAK,MAAMN,eAAe;YAAEM;QAAI,GAAGH;IACrC;AACF,EAAC"}
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -125,6 +125,10 @@ type GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {
|
|
|
125
125
|
}) => Promise<string> | string;
|
|
126
126
|
export type AuthStrategyFunctionArgs = {
|
|
127
127
|
headers: Request['headers'];
|
|
128
|
+
/**
|
|
129
|
+
* Specify if you are calling this function from within the admin UI or not.
|
|
130
|
+
*/
|
|
131
|
+
isAdmin?: boolean;
|
|
128
132
|
isGraphQL?: boolean;
|
|
129
133
|
payload: Payload;
|
|
130
134
|
/**
|
package/dist/auth/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,EAAE,iBAAiB,CAAA;IACzB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE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IACnB;;;OAGG;IACH,MAAM,CAAC,EACH;QACE,iBAAiB,CAAC,EAAE,uBAAuB,CAAA;QAC3C,oBAAoB,CAAC,EAAE,0BAA0B,CAAA;KAClD,GACD,OAAO,CAAA;CACZ;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,iBAAiB,CAAC,EAAE,uBAAuB,CAAA;IAC3C,oBAAoB,CAAC,EAAE,0BAA0B,CAAA;CAClD,CAAA;AAED,MAAM,WAAW,IACf,SAAQ,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,mBAAmB,GAAG,QAAQ,CAAC;IAC/F,cAAc,CAAC,EAAE;QACf,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,iBAAiB,CAAC,EAAE,+BAA+B,CAAA;QACnD,oBAAoB,CAAC,EAAE,kCAAkC,CAAA;KAC1D,CAAA;IACD,iBAAiB,EAAE,KAAK,GAAG,wBAAwB,CAAA;IACnD,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAA;CAChC;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,IAAI,KAAK,CAE7E"}
|
package/dist/auth/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/types.ts"],"sourcesContent":["import type { DeepRequired } from 'ts-essentials'\n\nimport type { CollectionSlug, GlobalSlug, Payload } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\n\n/**\n * A permission object that can be used to determine if a user has access to a specific operation.\n */\nexport type Permission = {\n permission: boolean\n where?: Where\n}\n\nexport type FieldsPermissions = {\n [fieldName: string]: FieldPermissions\n}\n\nexport type BlockPermissions = {\n create: Permission\n fields: FieldsPermissions\n read: Permission\n update: Permission\n}\n\nexport type SanitizedBlockPermissions =\n | {\n fields: SanitizedFieldsPermissions\n }\n | true\n\nexport type BlocksPermissions = {\n [blockSlug: string]: BlockPermissions\n}\n\nexport type SanitizedBlocksPermissions =\n | {\n [blockSlug: string]: SanitizedBlockPermissions\n }\n | true\n\nexport type FieldPermissions = {\n blocks?: BlocksPermissions\n create: Permission\n fields?: FieldsPermissions\n read: Permission\n update: Permission\n}\n\nexport type SanitizedFieldPermissions =\n | {\n blocks?: SanitizedBlocksPermissions\n create: true\n fields?: SanitizedFieldsPermissions\n read: true\n update: true\n }\n | true\n\nexport type SanitizedFieldsPermissions =\n | {\n [fieldName: string]: SanitizedFieldPermissions\n }\n | true\n\nexport type CollectionPermission = {\n create: Permission\n delete: Permission\n fields: FieldsPermissions\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type SanitizedCollectionPermission = {\n create?: true\n delete?: true\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n update?: true\n}\n\nexport type GlobalPermission = {\n fields: FieldsPermissions\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type SanitizedGlobalPermission = {\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n update?: true\n}\n\nexport type DocumentPermissions = CollectionPermission | GlobalPermission\n\nexport type SanitizedDocumentPermissions = SanitizedCollectionPermission | SanitizedGlobalPermission\n\nexport type Permissions = {\n canAccessAdmin: boolean\n collections?: Record<CollectionSlug, CollectionPermission>\n globals?: Record<GlobalSlug, GlobalPermission>\n}\n\nexport type SanitizedPermissions = {\n canAccessAdmin?: boolean\n collections?: {\n [collectionSlug: string]: SanitizedCollectionPermission\n }\n globals?: {\n [globalSlug: string]: SanitizedGlobalPermission\n }\n}\n\ntype BaseUser = {\n collection: string\n email?: string\n id: number | string\n username?: string\n}\n\nexport type User = {\n [key: string]: any\n} & BaseUser\n\n/**\n * `collection` is not available one the client. It's only available on the server (req.user)\n * On the client, you can access the collection via config.admin.user. Config can be accessed using the useConfig() hook\n */\nexport type ClientUser = {\n [key: string]: any\n} & BaseUser\n\ntype GenerateVerifyEmailHTML<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateVerifyEmailSubject<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\nexport type AuthStrategyFunctionArgs = {\n headers: Request['headers']\n isGraphQL?: boolean\n payload: Payload\n /**\n * The AuthStrategy name property from the payload config.\n */\n strategyName?: string\n}\n\nexport type AuthStrategyResult = {\n responseHeaders?: Headers\n user:\n | ({\n _strategy?: string\n collection?: string\n } & User)\n | null\n}\n\nexport type AuthStrategyFunction = (\n args: AuthStrategyFunctionArgs,\n) => AuthStrategyResult | Promise<AuthStrategyResult>\nexport type AuthStrategy = {\n authenticate: AuthStrategyFunction\n name: string\n}\n\nexport type LoginWithUsernameOptions =\n | {\n allowEmailLogin?: false\n requireEmail?: boolean\n // If `allowEmailLogin` is false, `requireUsername` must be true (default: true)\n requireUsername?: true\n }\n | {\n allowEmailLogin?: true\n requireEmail?: boolean\n requireUsername?: boolean\n }\n\nexport interface IncomingAuthType {\n /**\n * Set cookie options, including secure, sameSite, and domain. For advanced users.\n */\n cookies?: {\n domain?: string\n sameSite?: 'Lax' | 'None' | 'Strict' | boolean\n secure?: boolean\n }\n /**\n * How many levels deep a user document should be populated when creating the JWT and binding the user to the req. Defaults to 0 and should only be modified if absolutely necessary, as this will affect performance.\n * @default 0\n */\n depth?: number\n /**\n * Advanced - disable Payload's built-in local auth strategy. Only use this property if you have replaced Payload's auth mechanisms with your own.\n */\n disableLocalStrategy?:\n | {\n /**\n * Include auth fields on the collection even though the local strategy is disabled.\n * Useful when you do not want the database or types to vary depending on the auth configuration.\n */\n enableFields?: true\n optionalPassword?: true\n }\n | true\n /**\n * Customize the way that the forgotPassword operation functions.\n * @link https://payloadcms.com/docs/authentication/email#forgot-password\n */\n forgotPassword?: {\n /**\n * The number of milliseconds that the forgot password token should be valid for.\n * @default 3600000 // 1 hour\n */\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n /**\n * Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than maxLoginAttempts allows for.\n */\n lockTime?: number\n /**\n * Ability to allow users to login with username/password.\n *\n * @link https://payloadcms.com/docs/authentication/overview#login-with-username\n */\n loginWithUsername?: boolean | LoginWithUsernameOptions\n /**\n * Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to 0 to disable.\n */\n maxLoginAttempts?: number\n /***\n * Set to true if you want to remove the token from the returned authentication API responses such as login or refresh.\n */\n removeTokenFromResponses?: true\n /**\n * Advanced - an array of custom authentification strategies to extend this collection's authentication with.\n * @link https://payloadcms.com/docs/authentication/custom-strategies\n */\n strategies?: AuthStrategy[]\n /**\n * Controls how many seconds the token will be valid for. Default is 2 hours.\n * @default 7200\n * @link https://payloadcms.com/docs/authentication/overview#config-options\n */\n tokenExpiration?: number\n /**\n * Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection.\n * @default false\n * @link https://payloadcms.com/docs/authentication/api-keys\n */\n useAPIKey?: boolean\n /**\n * Set to true or pass an object with verification options to require users to verify by email before they are allowed to log into your app.\n * @link https://payloadcms.com/docs/authentication/email#email-verification\n */\n verify?:\n | {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n }\n | boolean\n}\n\nexport type VerifyConfig = {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n}\n\nexport interface Auth\n extends Omit<DeepRequired<IncomingAuthType>, 'forgotPassword' | 'loginWithUsername' | 'verify'> {\n forgotPassword?: {\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n loginWithUsername: false | LoginWithUsernameOptions\n verify?: boolean | VerifyConfig\n}\n\nexport function hasWhereAccessResult(result: boolean | Where): result is Where {\n return result && typeof result === 'object'\n}\n"],"names":["hasWhereAccessResult","result"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/auth/types.ts"],"sourcesContent":["import type { DeepRequired } from 'ts-essentials'\n\nimport type { CollectionSlug, GlobalSlug, Payload } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\n\n/**\n * A permission object that can be used to determine if a user has access to a specific operation.\n */\nexport type Permission = {\n permission: boolean\n where?: Where\n}\n\nexport type FieldsPermissions = {\n [fieldName: string]: FieldPermissions\n}\n\nexport type BlockPermissions = {\n create: Permission\n fields: FieldsPermissions\n read: Permission\n update: Permission\n}\n\nexport type SanitizedBlockPermissions =\n | {\n fields: SanitizedFieldsPermissions\n }\n | true\n\nexport type BlocksPermissions = {\n [blockSlug: string]: BlockPermissions\n}\n\nexport type SanitizedBlocksPermissions =\n | {\n [blockSlug: string]: SanitizedBlockPermissions\n }\n | true\n\nexport type FieldPermissions = {\n blocks?: BlocksPermissions\n create: Permission\n fields?: FieldsPermissions\n read: Permission\n update: Permission\n}\n\nexport type SanitizedFieldPermissions =\n | {\n blocks?: SanitizedBlocksPermissions\n create: true\n fields?: SanitizedFieldsPermissions\n read: true\n update: true\n }\n | true\n\nexport type SanitizedFieldsPermissions =\n | {\n [fieldName: string]: SanitizedFieldPermissions\n }\n | true\n\nexport type CollectionPermission = {\n create: Permission\n delete: Permission\n fields: FieldsPermissions\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type SanitizedCollectionPermission = {\n create?: true\n delete?: true\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n update?: true\n}\n\nexport type GlobalPermission = {\n fields: FieldsPermissions\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type SanitizedGlobalPermission = {\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n update?: true\n}\n\nexport type DocumentPermissions = CollectionPermission | GlobalPermission\n\nexport type SanitizedDocumentPermissions = SanitizedCollectionPermission | SanitizedGlobalPermission\n\nexport type Permissions = {\n canAccessAdmin: boolean\n collections?: Record<CollectionSlug, CollectionPermission>\n globals?: Record<GlobalSlug, GlobalPermission>\n}\n\nexport type SanitizedPermissions = {\n canAccessAdmin?: boolean\n collections?: {\n [collectionSlug: string]: SanitizedCollectionPermission\n }\n globals?: {\n [globalSlug: string]: SanitizedGlobalPermission\n }\n}\n\ntype BaseUser = {\n collection: string\n email?: string\n id: number | string\n username?: string\n}\n\nexport type User = {\n [key: string]: any\n} & BaseUser\n\n/**\n * `collection` is not available one the client. It's only available on the server (req.user)\n * On the client, you can access the collection via config.admin.user. Config can be accessed using the useConfig() hook\n */\nexport type ClientUser = {\n [key: string]: any\n} & BaseUser\n\ntype GenerateVerifyEmailHTML<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateVerifyEmailSubject<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\nexport type AuthStrategyFunctionArgs = {\n headers: Request['headers']\n /**\n * Specify if you are calling this function from within the admin UI or not.\n */\n isAdmin?: boolean\n isGraphQL?: boolean\n payload: Payload\n /**\n * The AuthStrategy name property from the payload config.\n */\n strategyName?: string\n}\n\nexport type AuthStrategyResult = {\n responseHeaders?: Headers\n user:\n | ({\n _strategy?: string\n collection?: string\n } & User)\n | null\n}\n\nexport type AuthStrategyFunction = (\n args: AuthStrategyFunctionArgs,\n) => AuthStrategyResult | Promise<AuthStrategyResult>\nexport type AuthStrategy = {\n authenticate: AuthStrategyFunction\n name: string\n}\n\nexport type LoginWithUsernameOptions =\n | {\n allowEmailLogin?: false\n requireEmail?: boolean\n // If `allowEmailLogin` is false, `requireUsername` must be true (default: true)\n requireUsername?: true\n }\n | {\n allowEmailLogin?: true\n requireEmail?: boolean\n requireUsername?: boolean\n }\n\nexport interface IncomingAuthType {\n /**\n * Set cookie options, including secure, sameSite, and domain. For advanced users.\n */\n cookies?: {\n domain?: string\n sameSite?: 'Lax' | 'None' | 'Strict' | boolean\n secure?: boolean\n }\n /**\n * How many levels deep a user document should be populated when creating the JWT and binding the user to the req. Defaults to 0 and should only be modified if absolutely necessary, as this will affect performance.\n * @default 0\n */\n depth?: number\n /**\n * Advanced - disable Payload's built-in local auth strategy. Only use this property if you have replaced Payload's auth mechanisms with your own.\n */\n disableLocalStrategy?:\n | {\n /**\n * Include auth fields on the collection even though the local strategy is disabled.\n * Useful when you do not want the database or types to vary depending on the auth configuration.\n */\n enableFields?: true\n optionalPassword?: true\n }\n | true\n /**\n * Customize the way that the forgotPassword operation functions.\n * @link https://payloadcms.com/docs/authentication/email#forgot-password\n */\n forgotPassword?: {\n /**\n * The number of milliseconds that the forgot password token should be valid for.\n * @default 3600000 // 1 hour\n */\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n /**\n * Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than maxLoginAttempts allows for.\n */\n lockTime?: number\n /**\n * Ability to allow users to login with username/password.\n *\n * @link https://payloadcms.com/docs/authentication/overview#login-with-username\n */\n loginWithUsername?: boolean | LoginWithUsernameOptions\n /**\n * Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to 0 to disable.\n */\n maxLoginAttempts?: number\n /***\n * Set to true if you want to remove the token from the returned authentication API responses such as login or refresh.\n */\n removeTokenFromResponses?: true\n /**\n * Advanced - an array of custom authentification strategies to extend this collection's authentication with.\n * @link https://payloadcms.com/docs/authentication/custom-strategies\n */\n strategies?: AuthStrategy[]\n /**\n * Controls how many seconds the token will be valid for. Default is 2 hours.\n * @default 7200\n * @link https://payloadcms.com/docs/authentication/overview#config-options\n */\n tokenExpiration?: number\n /**\n * Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection.\n * @default false\n * @link https://payloadcms.com/docs/authentication/api-keys\n */\n useAPIKey?: boolean\n /**\n * Set to true or pass an object with verification options to require users to verify by email before they are allowed to log into your app.\n * @link https://payloadcms.com/docs/authentication/email#email-verification\n */\n verify?:\n | {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n }\n | boolean\n}\n\nexport type VerifyConfig = {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n}\n\nexport interface Auth\n extends Omit<DeepRequired<IncomingAuthType>, 'forgotPassword' | 'loginWithUsername' | 'verify'> {\n forgotPassword?: {\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n loginWithUsername: false | LoginWithUsernameOptions\n verify?: boolean | VerifyConfig\n}\n\nexport function hasWhereAccessResult(result: boolean | Where): result is Where {\n return result && typeof result === 'object'\n}\n"],"names":["hasWhereAccessResult","result"],"mappings":"AAmTA,OAAO,SAASA,qBAAqBC,MAAuB;IAC1D,OAAOA,UAAU,OAAOA,WAAW;AACrC"}
|
|
@@ -14,7 +14,7 @@ export const PAYLOAD_PACKAGE_LIST = [
|
|
|
14
14
|
'@payloadcms/payload-cloud',
|
|
15
15
|
'@payloadcms/plugin-form-builder',
|
|
16
16
|
'@payloadcms/plugin-import-export',
|
|
17
|
-
|
|
17
|
+
'@payloadcms/plugin-multi-tenant',
|
|
18
18
|
'@payloadcms/plugin-nested-docs',
|
|
19
19
|
'@payloadcms/plugin-redirects',
|
|
20
20
|
'@payloadcms/plugin-search',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/versions/payloadPackageList.ts"],"sourcesContent":["export const PAYLOAD_PACKAGE_LIST = [\n 'payload',\n '@payloadcms/bundler-vite',\n '@payloadcms/bundler-webpack',\n '@payloadcms/db-mongodb',\n '@payloadcms/db-postgres',\n '@payloadcms/email-nodemailer',\n '@payloadcms/email-resend',\n '@payloadcms/graphql',\n '@payloadcms/live-preview-react',\n '@payloadcms/live-preview',\n '@payloadcms/next/utilities',\n '@payloadcms/plugin-cloud-storage',\n '@payloadcms/payload-cloud',\n '@payloadcms/plugin-form-builder',\n '@payloadcms/plugin-import-export',\n
|
|
1
|
+
{"version":3,"sources":["../../src/versions/payloadPackageList.ts"],"sourcesContent":["export const PAYLOAD_PACKAGE_LIST = [\n 'payload',\n '@payloadcms/bundler-vite',\n '@payloadcms/bundler-webpack',\n '@payloadcms/db-mongodb',\n '@payloadcms/db-postgres',\n '@payloadcms/email-nodemailer',\n '@payloadcms/email-resend',\n '@payloadcms/graphql',\n '@payloadcms/live-preview-react',\n '@payloadcms/live-preview',\n '@payloadcms/next/utilities',\n '@payloadcms/plugin-cloud-storage',\n '@payloadcms/payload-cloud',\n '@payloadcms/plugin-form-builder',\n '@payloadcms/plugin-import-export',\n '@payloadcms/plugin-multi-tenant',\n '@payloadcms/plugin-nested-docs',\n '@payloadcms/plugin-redirects',\n '@payloadcms/plugin-search',\n '@payloadcms/plugin-seo',\n '@payloadcms/plugin-stripe',\n '@payloadcms/plugin-zapier',\n '@payloadcms/richtext-lexical',\n '@payloadcms/richtext-slate',\n '@payloadcms/storage-azure',\n '@payloadcms/storage-gcs',\n '@payloadcms/storage-s3',\n '@payloadcms/storage-uploadthing',\n '@payloadcms/storage-vercel-blob',\n '@payloadcms/translations',\n '@payloadcms/ui/shared',\n]\n"],"names":["PAYLOAD_PACKAGE_LIST"],"mappings":"AAAA,OAAO,MAAMA,uBAAuB;IAClC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload",
|
|
3
|
-
"version": "3.40.0-
|
|
3
|
+
"version": "3.40.0-internal.9e8d70e",
|
|
4
4
|
"description": "Node, React, Headless CMS and Application Framework built on Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin panel",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"tsx": "4.19.2",
|
|
100
100
|
"uuid": "10.0.0",
|
|
101
101
|
"ws": "^8.16.0",
|
|
102
|
-
"@payloadcms/translations": "3.40.0-
|
|
102
|
+
"@payloadcms/translations": "3.40.0-internal.9e8d70e"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@hyrious/esbuild-plugin-commonjs": "^0.2.4",
|