@strapi/core 5.0.0-rc.8 → 5.0.0-rc.9
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/middlewares/query.js.map +1 -1
- package/dist/middlewares/query.mjs.map +1 -1
- package/dist/registries/policies.d.ts +1 -1
- package/dist/registries/policies.d.ts.map +1 -1
- package/dist/registries/policies.js +1 -1
- package/dist/registries/policies.js.map +1 -1
- package/dist/registries/policies.mjs +1 -1
- package/dist/registries/policies.mjs.map +1 -1
- package/dist/services/content-api/index.d.ts +6 -12
- package/dist/services/content-api/index.d.ts.map +1 -1
- package/dist/services/content-api/permissions/index.d.ts +6 -12
- package/dist/services/content-api/permissions/index.d.ts.map +1 -1
- package/dist/services/content-api/permissions/providers/action.d.ts +3 -6
- package/dist/services/content-api/permissions/providers/action.d.ts.map +1 -1
- package/dist/services/content-api/permissions/providers/condition.d.ts +3 -6
- package/dist/services/content-api/permissions/providers/condition.d.ts.map +1 -1
- package/package.json +13 -13
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"query.js","sources":["../../src/middlewares/query.ts"],"sourcesContent":["import qs from 'qs';\nimport type Koa from 'koa';\nimport type { Core } from '@strapi/types';\n\ntype Config = Parameters<typeof qs.parse>[1];\n\nconst defaults: Config = {\n strictNullHandling: true,\n arrayLimit: 100,\n depth: 20,\n};\n\n/**\n * Body parser hook\n */\nconst addQsParser = (app: Koa, settings: Config) => {\n Object.defineProperty(app.request, 'query', {\n configurable: false,\n enumerable: true,\n /*\n * Get parsed query-string.\n */\n get() {\n const qstr = this.querystring;\n\n this._querycache = this._querycache || {};\n const cache = this._querycache;\n\n if (!cache[qstr]) {\n cache[qstr] = qs.parse(qstr, settings);\n }\n\n return cache[qstr];\n },\n\n /*\n * Set query-string as an object.\n */\n set(obj) {\n this.querystring = qs.stringify(obj);\n },\n } satisfies PropertyDescriptor & ThisType<Koa.BaseRequest>);\n\n return app;\n};\n\nexport const query: Core.MiddlewareFactory = (\n config: Partial<Config>,\n { strapi }: { strapi: Core.Strapi }\n) => {\n addQsParser(strapi.server.app, { ...defaults, ...config });\n};\n"],"names":["qs"],"mappings":";;;;;AAMA,MAAM,WAAmB;AAAA,EACvB,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AACT;AAKA,MAAM,cAAc,CAAC,KAAU,aAAqB;AAC3C,SAAA,eAAe,IAAI,SAAS,SAAS;AAAA,IAC1C,cAAc;AAAA,IACd,YAAY;AAAA;AAAA;AAAA;AAAA,IAIZ,MAAM;AACJ,YAAM,OAAO,KAAK;AAEb,WAAA,cAAc,KAAK,eAAe,CAAA;AACvC,YAAM,QAAQ,KAAK;AAEf,UAAA,CAAC,MAAM,IAAI,GAAG;AAChB,cAAM,IAAI,IAAIA,YAAAA,QAAG,MAAM,MAAM,QAAQ;AAAA,MACvC;AAEA,aAAO,MAAM,IAAI;AAAA,IACnB;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,KAAK;AACF,WAAA,cAAcA,YAAAA,QAAG,UAAU,GAAG;AAAA,IACrC;AAAA,EAAA,CACwD;AAEnD,SAAA;AACT;AAEO,MAAM,QAAgC,CAC3C,QACA,EAAE,aACC;AACS,cAAA,OAAO,OAAO,KAAK,EAAE,GAAG,UAAU,GAAG,
|
1
|
+
{"version":3,"file":"query.js","sources":["../../src/middlewares/query.ts"],"sourcesContent":["import qs from 'qs';\nimport type Koa from 'koa';\nimport type { Core } from '@strapi/types';\n\ntype Config = Parameters<typeof qs.parse>[1];\n\nconst defaults: Config = {\n strictNullHandling: true,\n arrayLimit: 100,\n depth: 20,\n};\n\n/**\n * Body parser hook\n */\nconst addQsParser = (app: Koa, settings: Config) => {\n Object.defineProperty(app.request, 'query', {\n configurable: false,\n enumerable: true,\n /*\n * Get parsed query-string.\n */\n get() {\n const qstr = this.querystring;\n\n this._querycache = this._querycache || {};\n const cache = this._querycache;\n\n if (!cache[qstr]) {\n cache[qstr] = qs.parse(qstr, settings);\n }\n\n return cache[qstr];\n },\n\n /*\n * Set query-string as an object.\n */\n set(obj) {\n this.querystring = qs.stringify(obj);\n },\n } satisfies PropertyDescriptor & ThisType<Koa.BaseRequest>);\n\n return app;\n};\n\nexport const query: Core.MiddlewareFactory = (\n config: Partial<Config>,\n { strapi }: { strapi: Core.Strapi }\n) => {\n addQsParser(strapi.server.app, { ...defaults, ...config } as Config);\n};\n"],"names":["qs"],"mappings":";;;;;AAMA,MAAM,WAAmB;AAAA,EACvB,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AACT;AAKA,MAAM,cAAc,CAAC,KAAU,aAAqB;AAC3C,SAAA,eAAe,IAAI,SAAS,SAAS;AAAA,IAC1C,cAAc;AAAA,IACd,YAAY;AAAA;AAAA;AAAA;AAAA,IAIZ,MAAM;AACJ,YAAM,OAAO,KAAK;AAEb,WAAA,cAAc,KAAK,eAAe,CAAA;AACvC,YAAM,QAAQ,KAAK;AAEf,UAAA,CAAC,MAAM,IAAI,GAAG;AAChB,cAAM,IAAI,IAAIA,YAAAA,QAAG,MAAM,MAAM,QAAQ;AAAA,MACvC;AAEA,aAAO,MAAM,IAAI;AAAA,IACnB;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,KAAK;AACF,WAAA,cAAcA,YAAAA,QAAG,UAAU,GAAG;AAAA,IACrC;AAAA,EAAA,CACwD;AAEnD,SAAA;AACT;AAEO,MAAM,QAAgC,CAC3C,QACA,EAAE,aACC;AACS,cAAA,OAAO,OAAO,KAAK,EAAE,GAAG,UAAU,GAAG,QAAkB;AACrE;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"query.mjs","sources":["../../src/middlewares/query.ts"],"sourcesContent":["import qs from 'qs';\nimport type Koa from 'koa';\nimport type { Core } from '@strapi/types';\n\ntype Config = Parameters<typeof qs.parse>[1];\n\nconst defaults: Config = {\n strictNullHandling: true,\n arrayLimit: 100,\n depth: 20,\n};\n\n/**\n * Body parser hook\n */\nconst addQsParser = (app: Koa, settings: Config) => {\n Object.defineProperty(app.request, 'query', {\n configurable: false,\n enumerable: true,\n /*\n * Get parsed query-string.\n */\n get() {\n const qstr = this.querystring;\n\n this._querycache = this._querycache || {};\n const cache = this._querycache;\n\n if (!cache[qstr]) {\n cache[qstr] = qs.parse(qstr, settings);\n }\n\n return cache[qstr];\n },\n\n /*\n * Set query-string as an object.\n */\n set(obj) {\n this.querystring = qs.stringify(obj);\n },\n } satisfies PropertyDescriptor & ThisType<Koa.BaseRequest>);\n\n return app;\n};\n\nexport const query: Core.MiddlewareFactory = (\n config: Partial<Config>,\n { strapi }: { strapi: Core.Strapi }\n) => {\n addQsParser(strapi.server.app, { ...defaults, ...config });\n};\n"],"names":[],"mappings":";AAMA,MAAM,WAAmB;AAAA,EACvB,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AACT;AAKA,MAAM,cAAc,CAAC,KAAU,aAAqB;AAC3C,SAAA,eAAe,IAAI,SAAS,SAAS;AAAA,IAC1C,cAAc;AAAA,IACd,YAAY;AAAA;AAAA;AAAA;AAAA,IAIZ,MAAM;AACJ,YAAM,OAAO,KAAK;AAEb,WAAA,cAAc,KAAK,eAAe,CAAA;AACvC,YAAM,QAAQ,KAAK;AAEf,UAAA,CAAC,MAAM,IAAI,GAAG;AAChB,cAAM,IAAI,IAAI,GAAG,MAAM,MAAM,QAAQ;AAAA,MACvC;AAEA,aAAO,MAAM,IAAI;AAAA,IACnB;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,KAAK;AACF,WAAA,cAAc,GAAG,UAAU,GAAG;AAAA,IACrC;AAAA,EAAA,CACwD;AAEnD,SAAA;AACT;AAEO,MAAM,QAAgC,CAC3C,QACA,EAAE,aACC;AACS,cAAA,OAAO,OAAO,KAAK,EAAE,GAAG,UAAU,GAAG,
|
1
|
+
{"version":3,"file":"query.mjs","sources":["../../src/middlewares/query.ts"],"sourcesContent":["import qs from 'qs';\nimport type Koa from 'koa';\nimport type { Core } from '@strapi/types';\n\ntype Config = Parameters<typeof qs.parse>[1];\n\nconst defaults: Config = {\n strictNullHandling: true,\n arrayLimit: 100,\n depth: 20,\n};\n\n/**\n * Body parser hook\n */\nconst addQsParser = (app: Koa, settings: Config) => {\n Object.defineProperty(app.request, 'query', {\n configurable: false,\n enumerable: true,\n /*\n * Get parsed query-string.\n */\n get() {\n const qstr = this.querystring;\n\n this._querycache = this._querycache || {};\n const cache = this._querycache;\n\n if (!cache[qstr]) {\n cache[qstr] = qs.parse(qstr, settings);\n }\n\n return cache[qstr];\n },\n\n /*\n * Set query-string as an object.\n */\n set(obj) {\n this.querystring = qs.stringify(obj);\n },\n } satisfies PropertyDescriptor & ThisType<Koa.BaseRequest>);\n\n return app;\n};\n\nexport const query: Core.MiddlewareFactory = (\n config: Partial<Config>,\n { strapi }: { strapi: Core.Strapi }\n) => {\n addQsParser(strapi.server.app, { ...defaults, ...config } as Config);\n};\n"],"names":[],"mappings":";AAMA,MAAM,WAAmB;AAAA,EACvB,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AACT;AAKA,MAAM,cAAc,CAAC,KAAU,aAAqB;AAC3C,SAAA,eAAe,IAAI,SAAS,SAAS;AAAA,IAC1C,cAAc;AAAA,IACd,YAAY;AAAA;AAAA;AAAA;AAAA,IAIZ,MAAM;AACJ,YAAM,OAAO,KAAK;AAEb,WAAA,cAAc,KAAK,eAAe,CAAA;AACvC,YAAM,QAAQ,KAAK;AAEf,UAAA,CAAC,MAAM,IAAI,GAAG;AAChB,cAAM,IAAI,IAAI,GAAG,MAAM,MAAM,QAAQ;AAAA,MACvC;AAEA,aAAO,MAAM,IAAI;AAAA,IACnB;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,KAAK;AACF,WAAA,cAAc,GAAG,UAAU,GAAG;AAAA,IACrC;AAAA,EAAA,CACwD;AAEnD,SAAA;AACT;AAEO,MAAM,QAAgC,CAC3C,QACA,EAAE,aACC;AACS,cAAA,OAAO,OAAO,KAAK,EAAE,GAAG,UAAU,GAAG,QAAkB;AACrE;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../src/registries/policies.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAM1C,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,KAAK,YAAY,GAAG,MAAM,GAAG,UAAU,CAAC;AAExC,UAAU,aAAa;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAWD,QAAA,MAAM,gBAAgB;IAyDlB;;OAEG;;
|
1
|
+
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../src/registries/policies.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAM1C,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,KAAK,YAAY,GAAG,MAAM,GAAG,UAAU,CAAC;AAExC,UAAU,aAAa;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAWD,QAAA,MAAM,gBAAgB;IAyDlB;;OAEG;;IAMH;;OAEG;cACO,MAAM,kBAAkB,aAAa;IAG/C;;OAEG;cACO,MAAM,kBAAkB,aAAa;IAK/C;;OAEG;sBACe,MAAM;IAIxB;;OAEG;aACM,MAAM,UAAU,KAAK,MAAM;IAKpC;;OAEG;mBACY,MAAM,eAAe,OAAO,MAAM,EAAE,KAAK,MAAM,CAAC;IAa/D;;OAEG;oBACa,YAAY,GAAG,YAAY,EAAE,kBAAkB,aAAa;;;;CAW/E,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
@@ -49,7 +49,7 @@ const policiesRegistry = () => {
|
|
49
49
|
* Returns this list of registered policies uids
|
50
50
|
*/
|
51
51
|
keys() {
|
52
|
-
return policies.keys();
|
52
|
+
return Array.from(policies.keys());
|
53
53
|
},
|
54
54
|
/**
|
55
55
|
* Returns the instance of a policy. Instantiate the policy if not already done
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"policies.js","sources":["../../src/registries/policies.ts"],"sourcesContent":["import { pickBy, has, castArray } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\nimport { addNamespace, hasNamespace } from './namespace';\n\nconst PLUGIN_PREFIX = 'plugin::';\nconst API_PREFIX = 'api::';\n\ninterface PolicyInfo {\n name: string;\n config: unknown;\n}\n\ntype PolicyConfig = string | PolicyInfo;\n\ninterface NamespaceInfo {\n pluginName?: string;\n apiName?: string;\n}\n\nconst parsePolicy = (policy: string | PolicyInfo) => {\n if (typeof policy === 'string') {\n return { policyName: policy, config: {} };\n }\n\n const { name, config } = policy;\n return { policyName: name, config };\n};\n\nconst policiesRegistry = () => {\n const policies = new Map<string, Core.Policy>();\n\n const find = (name: string, namespaceInfo?: NamespaceInfo) => {\n const { pluginName, apiName } = namespaceInfo ?? {};\n\n // try to resolve a full name to avoid extra prefixing\n const policy = policies.get(name);\n\n if (policy) {\n return policy;\n }\n\n if (pluginName) {\n return policies.get(`${PLUGIN_PREFIX}${pluginName}.${name}`);\n }\n\n if (apiName) {\n return policies.get(`${API_PREFIX}${apiName}.${name}`);\n }\n };\n\n function resolveHandler(policyConfig: PolicyConfig, namespaceInfo?: NamespaceInfo): Core.Policy;\n function resolveHandler(\n policyConfig: PolicyConfig[],\n namespaceInfo?: NamespaceInfo\n ): Core.Policy[];\n function resolveHandler(\n policyConfig: PolicyConfig | PolicyConfig[],\n namespaceInfo?: NamespaceInfo\n ): Core.Policy | Core.Policy[] {\n if (Array.isArray(policyConfig)) {\n return policyConfig.map((config) => {\n return resolveHandler(config, namespaceInfo);\n });\n }\n\n const { policyName, config } = parsePolicy(policyConfig);\n\n const policy = find(policyName, namespaceInfo);\n\n if (!policy) {\n throw new Error(`Policy ${policyName} not found.`);\n }\n\n if (typeof policy === 'function') {\n return policy;\n }\n\n if (policy.validator) {\n policy.validator(config);\n }\n\n return policy.handler;\n }\n\n return {\n /**\n * Returns this list of registered policies uids\n */\n keys() {\n return policies.keys();\n },\n\n /**\n * Returns the instance of a policy. Instantiate the policy if not already done\n */\n get(name: string, namespaceInfo?: NamespaceInfo) {\n return find(name, namespaceInfo);\n },\n /**\n * Checks if a policy is registered\n */\n has(name: string, namespaceInfo?: NamespaceInfo) {\n const res = find(name, namespaceInfo);\n return !!res;\n },\n\n /**\n * Returns a map with all the policies in a namespace\n */\n getAll(namespace: string) {\n return pickBy((_, uid) => hasNamespace(uid, namespace))(Object.fromEntries(policies));\n },\n\n /**\n * Registers a policy\n */\n set(uid: string, policy: Core.Policy) {\n policies.set(uid, policy);\n return this;\n },\n\n /**\n * Registers a map of policies for a specific namespace\n */\n add(namespace: string, newPolicies: Record<string, Core.Policy>) {\n for (const policyName of Object.keys(newPolicies)) {\n const policy = newPolicies[policyName];\n const uid = addNamespace(policyName, namespace);\n\n if (has(uid, policies)) {\n throw new Error(`Policy ${uid} has already been registered.`);\n }\n\n policies.set(uid, policy);\n }\n },\n\n /**\n * Resolves a list of policies\n */\n resolve(config: PolicyConfig | PolicyConfig[], namespaceInfo?: NamespaceInfo) {\n const { pluginName, apiName } = namespaceInfo ?? {};\n\n return castArray(config).map((policyConfig) => {\n return {\n handler: resolveHandler(policyConfig, { pluginName, apiName }),\n config: (typeof policyConfig === 'object' && policyConfig.config) || {},\n };\n });\n },\n };\n};\n\nexport default policiesRegistry;\n"],"names":["config","namespace","pickBy","hasNamespace","addNamespace","has","castArray"],"mappings":";;;AAIA,MAAM,gBAAgB;AACtB,MAAM,aAAa;AAcnB,MAAM,cAAc,CAAC,WAAgC;AAC/C,MAAA,OAAO,WAAW,UAAU;AAC9B,WAAO,EAAE,YAAY,QAAQ,QAAQ,CAAG,EAAA;AAAA,EAC1C;AAEM,QAAA,EAAE,MAAM,OAAW,IAAA;AAClB,SAAA,EAAE,YAAY,MAAM;AAC7B;AAEA,MAAM,mBAAmB,MAAM;AACvB,QAAA,+BAAe;AAEf,QAAA,OAAO,CAAC,MAAc,kBAAkC;AAC5D,UAAM,EAAE,YAAY,YAAY,iBAAiB,CAAA;AAG3C,UAAA,SAAS,SAAS,IAAI,IAAI;AAEhC,QAAI,QAAQ;AACH,aAAA;AAAA,IACT;AAEA,QAAI,YAAY;AACP,aAAA,SAAS,IAAI,GAAG,aAAa,GAAG,UAAU,IAAI,IAAI,EAAE;AAAA,IAC7D;AAEA,QAAI,SAAS;AACJ,aAAA,SAAS,IAAI,GAAG,UAAU,GAAG,OAAO,IAAI,IAAI,EAAE;AAAA,IACvD;AAAA,EAAA;AAQO,WAAA,eACP,cACA,eAC6B;AACzB,QAAA,MAAM,QAAQ,YAAY,GAAG;AACxB,aAAA,aAAa,IAAI,CAACA,YAAW;AAC3B,eAAA,eAAeA,SAAQ,aAAa;AAAA,MAAA,CAC5C;AAAA,IACH;AAEA,UAAM,EAAE,YAAY,OAAO,IAAI,YAAY,YAAY;AAEjD,UAAA,SAAS,KAAK,YAAY,aAAa;AAE7C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,UAAU,UAAU,aAAa;AAAA,IACnD;AAEI,QAAA,OAAO,WAAW,YAAY;AACzB,aAAA;AAAA,IACT;AAEA,QAAI,OAAO,WAAW;AACpB,aAAO,UAAU,MAAM;AAAA,IACzB;AAEA,WAAO,OAAO;AAAA,EAChB;AAEO,SAAA;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO;
|
1
|
+
{"version":3,"file":"policies.js","sources":["../../src/registries/policies.ts"],"sourcesContent":["import { pickBy, has, castArray } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\nimport { addNamespace, hasNamespace } from './namespace';\n\nconst PLUGIN_PREFIX = 'plugin::';\nconst API_PREFIX = 'api::';\n\ninterface PolicyInfo {\n name: string;\n config: unknown;\n}\n\ntype PolicyConfig = string | PolicyInfo;\n\ninterface NamespaceInfo {\n pluginName?: string;\n apiName?: string;\n}\n\nconst parsePolicy = (policy: string | PolicyInfo) => {\n if (typeof policy === 'string') {\n return { policyName: policy, config: {} };\n }\n\n const { name, config } = policy;\n return { policyName: name, config };\n};\n\nconst policiesRegistry = () => {\n const policies = new Map<string, Core.Policy>();\n\n const find = (name: string, namespaceInfo?: NamespaceInfo) => {\n const { pluginName, apiName } = namespaceInfo ?? {};\n\n // try to resolve a full name to avoid extra prefixing\n const policy = policies.get(name);\n\n if (policy) {\n return policy;\n }\n\n if (pluginName) {\n return policies.get(`${PLUGIN_PREFIX}${pluginName}.${name}`);\n }\n\n if (apiName) {\n return policies.get(`${API_PREFIX}${apiName}.${name}`);\n }\n };\n\n function resolveHandler(policyConfig: PolicyConfig, namespaceInfo?: NamespaceInfo): Core.Policy;\n function resolveHandler(\n policyConfig: PolicyConfig[],\n namespaceInfo?: NamespaceInfo\n ): Core.Policy[];\n function resolveHandler(\n policyConfig: PolicyConfig | PolicyConfig[],\n namespaceInfo?: NamespaceInfo\n ): Core.Policy | Core.Policy[] {\n if (Array.isArray(policyConfig)) {\n return policyConfig.map((config) => {\n return resolveHandler(config, namespaceInfo);\n });\n }\n\n const { policyName, config } = parsePolicy(policyConfig);\n\n const policy = find(policyName, namespaceInfo);\n\n if (!policy) {\n throw new Error(`Policy ${policyName} not found.`);\n }\n\n if (typeof policy === 'function') {\n return policy;\n }\n\n if (policy.validator) {\n policy.validator(config);\n }\n\n return policy.handler;\n }\n\n return {\n /**\n * Returns this list of registered policies uids\n */\n keys() {\n // Return an array so format stays the same as controllers, services, etc\n return Array.from(policies.keys());\n },\n\n /**\n * Returns the instance of a policy. Instantiate the policy if not already done\n */\n get(name: string, namespaceInfo?: NamespaceInfo) {\n return find(name, namespaceInfo);\n },\n /**\n * Checks if a policy is registered\n */\n has(name: string, namespaceInfo?: NamespaceInfo) {\n const res = find(name, namespaceInfo);\n return !!res;\n },\n\n /**\n * Returns a map with all the policies in a namespace\n */\n getAll(namespace: string) {\n return pickBy((_, uid) => hasNamespace(uid, namespace))(Object.fromEntries(policies));\n },\n\n /**\n * Registers a policy\n */\n set(uid: string, policy: Core.Policy) {\n policies.set(uid, policy);\n return this;\n },\n\n /**\n * Registers a map of policies for a specific namespace\n */\n add(namespace: string, newPolicies: Record<string, Core.Policy>) {\n for (const policyName of Object.keys(newPolicies)) {\n const policy = newPolicies[policyName];\n const uid = addNamespace(policyName, namespace);\n\n if (has(uid, policies)) {\n throw new Error(`Policy ${uid} has already been registered.`);\n }\n\n policies.set(uid, policy);\n }\n },\n\n /**\n * Resolves a list of policies\n */\n resolve(config: PolicyConfig | PolicyConfig[], namespaceInfo?: NamespaceInfo) {\n const { pluginName, apiName } = namespaceInfo ?? {};\n\n return castArray(config).map((policyConfig) => {\n return {\n handler: resolveHandler(policyConfig, { pluginName, apiName }),\n config: (typeof policyConfig === 'object' && policyConfig.config) || {},\n };\n });\n },\n };\n};\n\nexport default policiesRegistry;\n"],"names":["config","namespace","pickBy","hasNamespace","addNamespace","has","castArray"],"mappings":";;;AAIA,MAAM,gBAAgB;AACtB,MAAM,aAAa;AAcnB,MAAM,cAAc,CAAC,WAAgC;AAC/C,MAAA,OAAO,WAAW,UAAU;AAC9B,WAAO,EAAE,YAAY,QAAQ,QAAQ,CAAG,EAAA;AAAA,EAC1C;AAEM,QAAA,EAAE,MAAM,OAAW,IAAA;AAClB,SAAA,EAAE,YAAY,MAAM;AAC7B;AAEA,MAAM,mBAAmB,MAAM;AACvB,QAAA,+BAAe;AAEf,QAAA,OAAO,CAAC,MAAc,kBAAkC;AAC5D,UAAM,EAAE,YAAY,YAAY,iBAAiB,CAAA;AAG3C,UAAA,SAAS,SAAS,IAAI,IAAI;AAEhC,QAAI,QAAQ;AACH,aAAA;AAAA,IACT;AAEA,QAAI,YAAY;AACP,aAAA,SAAS,IAAI,GAAG,aAAa,GAAG,UAAU,IAAI,IAAI,EAAE;AAAA,IAC7D;AAEA,QA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K,WAAW,GAAG;AAC3C,cAAA,SAAS,YAAY,UAAU;AAC/B,cAAA,MAAMG,UAAAA,aAAa,YAAYH,WAAS;AAE1C,YAAAI,GAAA,IAAI,KAAK,QAAQ,GAAG;AACtB,gBAAM,IAAI,MAAM,UAAU,GAAG,+BAA+B;AAAA,QAC9D;AAES,iBAAA,IAAI,KAAK,MAAM;AAAA,MAC1B;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKA,QAAQ,QAAuC,eAA+B;AAC5E,YAAM,EAAE,YAAY,YAAY,iBAAiB,CAAA;AAEjD,aAAOC,GAAU,UAAA,MAAM,EAAE,IAAI,CAAC,iBAAiB;AACtC,eAAA;AAAA,UACL,SAAS,eAAe,cAAc,EAAE,YAAY,SAAS;AAAA,UAC7D,QAAS,OAAO,iBAAiB,YAAY,aAAa,UAAW,CAAC;AAAA,QAAA;AAAA,MACxE,CACD;AAAA,IACH;AAAA,EAAA;AAEJ;;"}
|
@@ -48,7 +48,7 @@ const policiesRegistry = () => {
|
|
48
48
|
* Returns this list of registered policies uids
|
49
49
|
*/
|
50
50
|
keys() {
|
51
|
-
return policies.keys();
|
51
|
+
return Array.from(policies.keys());
|
52
52
|
},
|
53
53
|
/**
|
54
54
|
* Returns the instance of a policy. Instantiate the policy if not already done
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"policies.mjs","sources":["../../src/registries/policies.ts"],"sourcesContent":["import { pickBy, has, castArray } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\nimport { addNamespace, hasNamespace } from './namespace';\n\nconst PLUGIN_PREFIX = 'plugin::';\nconst API_PREFIX = 'api::';\n\ninterface PolicyInfo {\n name: string;\n config: unknown;\n}\n\ntype PolicyConfig = string | PolicyInfo;\n\ninterface NamespaceInfo {\n pluginName?: string;\n apiName?: string;\n}\n\nconst parsePolicy = (policy: string | PolicyInfo) => {\n if (typeof policy === 'string') {\n return { policyName: policy, config: {} };\n }\n\n const { name, config } = policy;\n return { policyName: name, config };\n};\n\nconst policiesRegistry = () => {\n const policies = new Map<string, Core.Policy>();\n\n const find = (name: string, namespaceInfo?: NamespaceInfo) => {\n const { pluginName, apiName } = namespaceInfo ?? {};\n\n // try to resolve a full name to avoid extra prefixing\n const policy = policies.get(name);\n\n if (policy) {\n return policy;\n }\n\n if (pluginName) {\n return policies.get(`${PLUGIN_PREFIX}${pluginName}.${name}`);\n }\n\n if (apiName) {\n return policies.get(`${API_PREFIX}${apiName}.${name}`);\n }\n };\n\n function resolveHandler(policyConfig: PolicyConfig, namespaceInfo?: NamespaceInfo): Core.Policy;\n function resolveHandler(\n policyConfig: PolicyConfig[],\n namespaceInfo?: NamespaceInfo\n ): Core.Policy[];\n function resolveHandler(\n policyConfig: PolicyConfig | PolicyConfig[],\n namespaceInfo?: NamespaceInfo\n ): Core.Policy | Core.Policy[] {\n if (Array.isArray(policyConfig)) {\n return policyConfig.map((config) => {\n return resolveHandler(config, namespaceInfo);\n });\n }\n\n const { policyName, config } = parsePolicy(policyConfig);\n\n const policy = find(policyName, namespaceInfo);\n\n if (!policy) {\n throw new Error(`Policy ${policyName} not found.`);\n }\n\n if (typeof policy === 'function') {\n return policy;\n }\n\n if (policy.validator) {\n policy.validator(config);\n }\n\n return policy.handler;\n }\n\n return {\n /**\n * Returns this list of registered policies uids\n */\n keys() {\n return policies.keys();\n },\n\n /**\n * Returns the instance of a policy. Instantiate the policy if not already done\n */\n get(name: string, namespaceInfo?: NamespaceInfo) {\n return find(name, namespaceInfo);\n },\n /**\n * Checks if a policy is registered\n */\n has(name: string, namespaceInfo?: NamespaceInfo) {\n const res = find(name, namespaceInfo);\n return !!res;\n },\n\n /**\n * Returns a map with all the policies in a namespace\n */\n getAll(namespace: string) {\n return pickBy((_, uid) => hasNamespace(uid, namespace))(Object.fromEntries(policies));\n },\n\n /**\n * Registers a policy\n */\n set(uid: string, policy: Core.Policy) {\n policies.set(uid, policy);\n return this;\n },\n\n /**\n * Registers a map of policies for a specific namespace\n */\n add(namespace: string, newPolicies: Record<string, Core.Policy>) {\n for (const policyName of Object.keys(newPolicies)) {\n const policy = newPolicies[policyName];\n const uid = addNamespace(policyName, namespace);\n\n if (has(uid, policies)) {\n throw new Error(`Policy ${uid} has already been registered.`);\n }\n\n policies.set(uid, policy);\n }\n },\n\n /**\n * Resolves a list of policies\n */\n resolve(config: PolicyConfig | PolicyConfig[], namespaceInfo?: NamespaceInfo) {\n const { pluginName, apiName } = namespaceInfo ?? {};\n\n return castArray(config).map((policyConfig) => {\n return {\n handler: resolveHandler(policyConfig, { pluginName, apiName }),\n config: (typeof policyConfig === 'object' && policyConfig.config) || {},\n };\n });\n },\n };\n};\n\nexport default policiesRegistry;\n"],"names":["config"],"mappings":";;AAIA,MAAM,gBAAgB;AACtB,MAAM,aAAa;AAcnB,MAAM,cAAc,CAAC,WAAgC;AAC/C,MAAA,OAAO,WAAW,UAAU;AAC9B,WAAO,EAAE,YAAY,QAAQ,QAAQ,CAAG,EAAA;AAAA,EAC1C;AAEM,QAAA,EAAE,MAAM,OAAW,IAAA;AAClB,SAAA,EAAE,YAAY,MAAM;AAC7B;AAEA,MAAM,mBAAmB,MAAM;AACvB,QAAA,+BAAe;AAEf,QAAA,OAAO,CAAC,MAAc,kBAAkC;AAC5D,UAAM,EAAE,YAAY,YAAY,iBAAiB,CAAA;AAG3C,UAAA,SAAS,SAAS,IAAI,IAAI;AAEhC,QAAI,QAAQ;AACH,aAAA;AAAA,IACT;AAEA,QAAI,YAAY;AACP,aAAA,SAAS,IAAI,GAAG,aAAa,GAAG,UAAU,IAAI,IAAI,EAAE;AAAA,IAC7D;AAEA,QAAI,SAAS;AACJ,aAAA,SAAS,IAAI,GAAG,UAAU,GAAG,OAAO,IAAI,IAAI,EAAE;AAAA,IACvD;AAAA,EAAA;AAQO,WAAA,eACP,cACA,eAC6B;AACzB,QAAA,MAAM,QAAQ,YAAY,GAAG;AACxB,aAAA,aAAa,IAAI,CAACA,YAAW;AAC3B,eAAA,eAAeA,SAAQ,aAAa;AAAA,MAAA,CAC5C;AAAA,IACH;AAEA,UAAM,EAAE,YAAY,OAAO,IAAI,YAAY,YAAY;AAEjD,UAAA,SAAS,KAAK,YAAY,aAAa;AAE7C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,UAAU,UAAU,aAAa;AAAA,IACnD;AAEI,QAAA,OAAO,WAAW,YAAY;AACzB,aAAA;AAAA,IACT;AAEA,QAAI,OAAO,WAAW;AACpB,aAAO,UAAU,MAAM;AAAA,IACzB;AAEA,WAAO,OAAO;AAAA,EAChB;AAEO,SAAA;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO;
|
1
|
+
{"version":3,"file":"policies.mjs","sources":["../../src/registries/policies.ts"],"sourcesContent":["import { pickBy, has, castArray } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\nimport { addNamespace, hasNamespace } from './namespace';\n\nconst PLUGIN_PREFIX = 'plugin::';\nconst API_PREFIX = 'api::';\n\ninterface PolicyInfo {\n name: string;\n config: unknown;\n}\n\ntype PolicyConfig = string | PolicyInfo;\n\ninterface NamespaceInfo {\n pluginName?: string;\n apiName?: string;\n}\n\nconst parsePolicy = (policy: string | PolicyInfo) => {\n if (typeof policy === 'string') {\n return { policyName: policy, config: {} };\n }\n\n const { name, config } = policy;\n return { policyName: name, config };\n};\n\nconst policiesRegistry = () => {\n const policies = new Map<string, Core.Policy>();\n\n const find = (name: string, namespaceInfo?: NamespaceInfo) => {\n const { pluginName, apiName } = namespaceInfo ?? {};\n\n // try to resolve a full name to avoid extra prefixing\n const policy = policies.get(name);\n\n if (policy) {\n return policy;\n }\n\n if (pluginName) {\n return policies.get(`${PLUGIN_PREFIX}${pluginName}.${name}`);\n }\n\n if (apiName) {\n return policies.get(`${API_PREFIX}${apiName}.${name}`);\n }\n };\n\n function resolveHandler(policyConfig: PolicyConfig, namespaceInfo?: NamespaceInfo): Core.Policy;\n function resolveHandler(\n policyConfig: PolicyConfig[],\n namespaceInfo?: NamespaceInfo\n ): Core.Policy[];\n function resolveHandler(\n policyConfig: PolicyConfig | PolicyConfig[],\n namespaceInfo?: NamespaceInfo\n ): Core.Policy | Core.Policy[] {\n if (Array.isArray(policyConfig)) {\n return policyConfig.map((config) => {\n return resolveHandler(config, namespaceInfo);\n });\n }\n\n const { policyName, config } = parsePolicy(policyConfig);\n\n const policy = find(policyName, namespaceInfo);\n\n if (!policy) {\n throw new Error(`Policy ${policyName} not found.`);\n }\n\n if (typeof policy === 'function') {\n return policy;\n }\n\n if (policy.validator) {\n policy.validator(config);\n }\n\n return policy.handler;\n }\n\n return {\n /**\n * Returns this list of registered policies uids\n */\n keys() {\n // Return an array so format stays the same as controllers, services, etc\n return Array.from(policies.keys());\n },\n\n /**\n * Returns the instance of a policy. Instantiate the policy if not already done\n */\n get(name: string, namespaceInfo?: NamespaceInfo) {\n return find(name, namespaceInfo);\n },\n /**\n * Checks if a policy is registered\n */\n has(name: string, namespaceInfo?: NamespaceInfo) {\n const res = find(name, namespaceInfo);\n return !!res;\n },\n\n /**\n * Returns a map with all the policies in a namespace\n */\n getAll(namespace: string) {\n return pickBy((_, uid) => hasNamespace(uid, namespace))(Object.fromEntries(policies));\n },\n\n /**\n * Registers a policy\n */\n set(uid: string, policy: Core.Policy) {\n policies.set(uid, policy);\n return this;\n },\n\n /**\n * Registers a map of policies for a specific namespace\n */\n add(namespace: string, newPolicies: Record<string, Core.Policy>) {\n for (const policyName of Object.keys(newPolicies)) {\n const policy = newPolicies[policyName];\n const uid = addNamespace(policyName, namespace);\n\n if (has(uid, policies)) {\n throw new Error(`Policy ${uid} has already been registered.`);\n }\n\n policies.set(uid, policy);\n }\n },\n\n /**\n * Resolves a list of policies\n */\n resolve(config: PolicyConfig | PolicyConfig[], namespaceInfo?: NamespaceInfo) {\n const { pluginName, apiName } = namespaceInfo ?? {};\n\n return castArray(config).map((policyConfig) => {\n return {\n handler: resolveHandler(policyConfig, { pluginName, apiName }),\n config: (typeof policyConfig === 'object' && policyConfig.config) || {},\n };\n });\n },\n };\n};\n\nexport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
|
9
9
|
providers: {
|
10
10
|
action: {
|
11
|
-
register(action: string, payload: Record<string, unknown>): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
11
|
+
register(action: string, payload: Record<string, unknown>): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
12
12
|
hooks: import("@strapi/utils/dist/provider-factory").ProviderHooksMap;
|
13
|
-
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
13
|
+
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
14
14
|
get(key: string): {
|
15
15
|
[x: string]: unknown;
|
16
16
|
} | undefined;
|
17
|
-
getWhere(filters?: Record<string, unknown> | undefined): {
|
18
|
-
[x: string]: unknown;
|
19
|
-
}[];
|
20
17
|
values(): {
|
21
18
|
[x: string]: unknown;
|
22
19
|
}[];
|
23
20
|
keys(): string[];
|
24
21
|
has(key: string): boolean;
|
25
22
|
size(): number;
|
26
|
-
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
23
|
+
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
27
24
|
};
|
28
25
|
condition: {
|
29
|
-
register(condition: import("./permissions/providers/condition").Condition): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
26
|
+
register(condition: import("./permissions/providers/condition").Condition): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
30
27
|
hooks: import("@strapi/utils/dist/provider-factory").ProviderHooksMap;
|
31
|
-
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
28
|
+
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
32
29
|
get(key: string): {
|
33
30
|
[x: string]: unknown;
|
34
31
|
} | undefined;
|
35
|
-
getWhere(filters?: Record<string, unknown> | undefined): {
|
36
|
-
[x: string]: unknown;
|
37
|
-
}[];
|
38
32
|
values(): {
|
39
33
|
[x: string]: unknown;
|
40
34
|
}[];
|
41
35
|
keys(): string[];
|
42
36
|
has(key: string): boolean;
|
43
37
|
size(): number;
|
44
|
-
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
38
|
+
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
45
39
|
};
|
46
40
|
};
|
47
41
|
registerActions: () => Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/content-api/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,IAAI,EAAO,MAAM,eAAe,CAAC;AAgB/C;;GAEG;AACH,QAAA,MAAM,gBAAgB,WAAY,KAAK,MAAM
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/content-api/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,IAAI,EAAO,MAAM,eAAe,CAAC;AAgB/C;;GAEG;AACH,QAAA,MAAM,gBAAgB,WAAY,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgF5C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
@@ -7,40 +7,34 @@ declare const _default: (strapi: Core.Strapi) => {
|
|
7
7
|
engine: import("@strapi/permissions/dist/engine").Engine;
|
8
8
|
providers: {
|
9
9
|
action: {
|
10
|
-
register(action: string, payload: Record<string, unknown>): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
10
|
+
register(action: string, payload: Record<string, unknown>): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
11
11
|
hooks: import("@strapi/utils/dist/provider-factory").ProviderHooksMap;
|
12
|
-
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
12
|
+
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
13
13
|
get(key: string): {
|
14
14
|
[x: string]: unknown;
|
15
15
|
} | undefined;
|
16
|
-
getWhere(filters?: Record<string, unknown> | undefined): {
|
17
|
-
[x: string]: unknown;
|
18
|
-
}[];
|
19
16
|
values(): {
|
20
17
|
[x: string]: unknown;
|
21
18
|
}[];
|
22
19
|
keys(): string[];
|
23
20
|
has(key: string): boolean;
|
24
21
|
size(): number;
|
25
|
-
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
22
|
+
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
26
23
|
};
|
27
24
|
condition: {
|
28
|
-
register(condition: import("./providers/condition").Condition): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
25
|
+
register(condition: import("./providers/condition").Condition): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
29
26
|
hooks: import("@strapi/utils/dist/provider-factory").ProviderHooksMap;
|
30
|
-
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
27
|
+
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
31
28
|
get(key: string): {
|
32
29
|
[x: string]: unknown;
|
33
30
|
} | undefined;
|
34
|
-
getWhere(filters?: Record<string, unknown> | undefined): {
|
35
|
-
[x: string]: unknown;
|
36
|
-
}[];
|
37
31
|
values(): {
|
38
32
|
[x: string]: unknown;
|
39
33
|
}[];
|
40
34
|
keys(): string[];
|
41
35
|
has(key: string): boolean;
|
42
36
|
size(): number;
|
43
|
-
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
37
|
+
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
44
38
|
};
|
45
39
|
};
|
46
40
|
registerActions: () => Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/content-api/permissions/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AA8B1C;;;GAGG;iCACqB,KAAK,MAAM
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/content-api/permissions/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AA8B1C;;;GAGG;iCACqB,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkBd,OAAO,MAAM,EAAE,MAAM,EAAE,CAAC;;;AAlB7C,wBAmHE"}
|
@@ -1,20 +1,17 @@
|
|
1
1
|
declare const _default: (options?: {}) => {
|
2
|
-
register(action: string, payload: Record<string, unknown>): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
2
|
+
register(action: string, payload: Record<string, unknown>): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
3
3
|
hooks: import("@strapi/utils/dist/provider-factory").ProviderHooksMap;
|
4
|
-
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
4
|
+
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
5
5
|
get(key: string): {
|
6
6
|
[x: string]: unknown;
|
7
7
|
} | undefined;
|
8
|
-
getWhere(filters?: Record<string, unknown> | undefined): {
|
9
|
-
[x: string]: unknown;
|
10
|
-
}[];
|
11
8
|
values(): {
|
12
9
|
[x: string]: unknown;
|
13
10
|
}[];
|
14
11
|
keys(): string[];
|
15
12
|
has(key: string): boolean;
|
16
13
|
size(): number;
|
17
|
-
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
14
|
+
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
18
15
|
};
|
19
16
|
export default _default;
|
20
17
|
//# sourceMappingURL=action.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../../src/services/content-api/permissions/providers/action.ts"],"names":[],"mappings":";qBAQ2B,MAAM,WAAW,OAAO,MAAM,EAAE,OAAO,CAAC
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../../src/services/content-api/permissions/providers/action.ts"],"names":[],"mappings":";qBAQ2B,MAAM,WAAW,OAAO,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;AANnE,wBAcE"}
|
@@ -3,22 +3,19 @@ export interface Condition {
|
|
3
3
|
[key: string]: unknown;
|
4
4
|
}
|
5
5
|
declare const _default: (options?: {}) => {
|
6
|
-
register(condition: Condition): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
6
|
+
register(condition: Condition): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
7
7
|
hooks: import("@strapi/utils/dist/provider-factory").ProviderHooksMap;
|
8
|
-
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
8
|
+
delete(key: string): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
9
9
|
get(key: string): {
|
10
10
|
[x: string]: unknown;
|
11
11
|
} | undefined;
|
12
|
-
getWhere(filters?: Record<string, unknown> | undefined): {
|
13
|
-
[x: string]: unknown;
|
14
|
-
}[];
|
15
12
|
values(): {
|
16
13
|
[x: string]: unknown;
|
17
14
|
}[];
|
18
15
|
keys(): string[];
|
19
16
|
has(key: string): boolean;
|
20
17
|
size(): number;
|
21
|
-
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider
|
18
|
+
clear(): Promise<import("@strapi/utils/dist/provider-factory").Provider<unknown>>;
|
22
19
|
};
|
23
20
|
export default _default;
|
24
21
|
//# sourceMappingURL=condition.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../../../src/services/content-api/permissions/providers/condition.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;;wBAQ6B,SAAS
|
1
|
+
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../../../src/services/content-api/permissions/providers/condition.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;;wBAQ6B,SAAS;;;;;;;;;;;;;;AANvC,wBAcE"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@strapi/core",
|
3
|
-
"version": "5.0.0-rc.
|
3
|
+
"version": "5.0.0-rc.9",
|
4
4
|
"description": "Core of Strapi",
|
5
5
|
"homepage": "https://strapi.io",
|
6
6
|
"bugs": {
|
@@ -55,16 +55,16 @@
|
|
55
55
|
"@koa/cors": "5.0.0",
|
56
56
|
"@koa/router": "12.0.1",
|
57
57
|
"@paralleldrive/cuid2": "2.2.2",
|
58
|
-
"@strapi/admin": "5.0.0-rc.
|
59
|
-
"@strapi/database": "5.0.0-rc.
|
60
|
-
"@strapi/generate-new": "5.0.0-rc.
|
61
|
-
"@strapi/generators": "5.0.0-rc.
|
62
|
-
"@strapi/logger": "5.0.0-rc.
|
58
|
+
"@strapi/admin": "5.0.0-rc.9",
|
59
|
+
"@strapi/database": "5.0.0-rc.9",
|
60
|
+
"@strapi/generate-new": "5.0.0-rc.9",
|
61
|
+
"@strapi/generators": "5.0.0-rc.9",
|
62
|
+
"@strapi/logger": "5.0.0-rc.9",
|
63
63
|
"@strapi/pack-up": "5.0.0",
|
64
|
-
"@strapi/permissions": "5.0.0-rc.
|
65
|
-
"@strapi/types": "5.0.0-rc.
|
66
|
-
"@strapi/typescript-utils": "5.0.0-rc.
|
67
|
-
"@strapi/utils": "5.0.0-rc.
|
64
|
+
"@strapi/permissions": "5.0.0-rc.9",
|
65
|
+
"@strapi/types": "5.0.0-rc.9",
|
66
|
+
"@strapi/typescript-utils": "5.0.0-rc.9",
|
67
|
+
"@strapi/utils": "5.0.0-rc.9",
|
68
68
|
"bcryptjs": "2.4.3",
|
69
69
|
"boxen": "5.1.2",
|
70
70
|
"chalk": "4.1.2",
|
@@ -126,13 +126,13 @@
|
|
126
126
|
"@types/node": "18.19.24",
|
127
127
|
"@types/node-schedule": "2.1.0",
|
128
128
|
"@types/statuses": "2.0.1",
|
129
|
-
"eslint-config-custom": "5.0.0-rc.
|
129
|
+
"eslint-config-custom": "5.0.0-rc.9",
|
130
130
|
"supertest": "6.3.3",
|
131
|
-
"tsconfig": "5.0.0-rc.
|
131
|
+
"tsconfig": "5.0.0-rc.9"
|
132
132
|
},
|
133
133
|
"engines": {
|
134
134
|
"node": ">=18.0.0 <=20.x.x",
|
135
135
|
"npm": ">=6.0.0"
|
136
136
|
},
|
137
|
-
"gitHead": "
|
137
|
+
"gitHead": "e281ba8e37693c2fc24795be4df4f2ed516063fc"
|
138
138
|
}
|