@webiny/api-aco 5.40.5 → 5.40.6-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-aco",
3
- "version": "5.40.5",
3
+ "version": "5.40.6-beta.0",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "aco:base"
@@ -22,18 +22,18 @@
22
22
  "directory": "dist"
23
23
  },
24
24
  "dependencies": {
25
- "@webiny/api": "5.40.5",
26
- "@webiny/api-authentication": "5.40.5",
27
- "@webiny/api-headless-cms": "5.40.5",
28
- "@webiny/api-i18n": "5.40.5",
29
- "@webiny/api-security": "5.40.5",
30
- "@webiny/api-tenancy": "5.40.5",
31
- "@webiny/error": "5.40.5",
32
- "@webiny/handler": "5.40.5",
33
- "@webiny/handler-graphql": "5.40.5",
34
- "@webiny/pubsub": "5.40.5",
35
- "@webiny/utils": "5.40.5",
36
- "@webiny/validation": "5.40.5",
25
+ "@webiny/api": "5.40.6-beta.0",
26
+ "@webiny/api-authentication": "5.40.6-beta.0",
27
+ "@webiny/api-headless-cms": "5.40.6-beta.0",
28
+ "@webiny/api-i18n": "5.40.6-beta.0",
29
+ "@webiny/api-security": "5.40.6-beta.0",
30
+ "@webiny/api-tenancy": "5.40.6-beta.0",
31
+ "@webiny/error": "5.40.6-beta.0",
32
+ "@webiny/handler": "5.40.6-beta.0",
33
+ "@webiny/handler-graphql": "5.40.6-beta.0",
34
+ "@webiny/pubsub": "5.40.6-beta.0",
35
+ "@webiny/utils": "5.40.6-beta.0",
36
+ "@webiny/validation": "5.40.6-beta.0",
37
37
  "lodash": "4.17.21"
38
38
  },
39
39
  "devDependencies": {
@@ -42,22 +42,22 @@
42
42
  "@babel/preset-env": "7.24.3",
43
43
  "@babel/preset-typescript": "7.24.1",
44
44
  "@babel/runtime": "7.24.1",
45
- "@webiny/api-admin-users": "5.40.5",
46
- "@webiny/api-file-manager": "5.40.5",
47
- "@webiny/api-i18n-ddb": "5.40.5",
48
- "@webiny/api-security-so-ddb": "5.40.5",
49
- "@webiny/api-tenancy-so-ddb": "5.40.5",
50
- "@webiny/api-wcp": "5.40.5",
51
- "@webiny/cli": "5.40.5",
52
- "@webiny/handler-aws": "5.40.5",
53
- "@webiny/plugins": "5.40.5",
54
- "@webiny/project-utils": "5.40.5",
55
- "@webiny/wcp": "5.40.5",
45
+ "@webiny/api-admin-users": "5.40.6-beta.0",
46
+ "@webiny/api-file-manager": "5.40.6-beta.0",
47
+ "@webiny/api-i18n-ddb": "5.40.6-beta.0",
48
+ "@webiny/api-security-so-ddb": "5.40.6-beta.0",
49
+ "@webiny/api-tenancy-so-ddb": "5.40.6-beta.0",
50
+ "@webiny/api-wcp": "5.40.6-beta.0",
51
+ "@webiny/cli": "5.40.6-beta.0",
52
+ "@webiny/handler-aws": "5.40.6-beta.0",
53
+ "@webiny/plugins": "5.40.6-beta.0",
54
+ "@webiny/project-utils": "5.40.6-beta.0",
55
+ "@webiny/wcp": "5.40.6-beta.0",
56
56
  "graphql": "15.8.0",
57
57
  "prettier": "2.8.8",
58
58
  "rimraf": "5.0.5",
59
59
  "ttypescript": "1.5.15",
60
60
  "typescript": "4.7.4"
61
61
  },
62
- "gitHead": "f67778732392ed88f28da869ddacbf08a98cdec6"
62
+ "gitHead": "c0bf7d9bfe72b0689b29c84506f3168515a78517"
63
63
  }
@@ -14,7 +14,7 @@ declare type FilterModelMethods<T> = {
14
14
  * E.g., `getEntryManager` has `model` typed as `CmsModel | string`.
15
15
  * Ideally, we would filter those out in the previous utility type, but I'm not sure how to achieve that.
16
16
  */
17
- declare type ModelMethods<T> = Omit<FilterModelMethods<T>, "getEntryManager">;
17
+ declare type ModelMethods<T> = Omit<FilterModelMethods<T>, "getEntryManager" | "getSingletonEntryManager">;
18
18
  /**
19
19
  * Decorator takes the decoratee as the _first_ parameter, and then forwards the rest of the parameters.
20
20
  */
@@ -1 +1 @@
1
- {"version":3,"names":["modelAuthorizationDisabled","model","authorization","flp","decorateIfModelAuthorizationEnabled","root","method","decorator","decoratee","bind","params","rest","exports"],"sources":["decorateIfModelAuthorizationEnabled.ts"],"sourcesContent":["import { CmsModel, HeadlessCms } from \"@webiny/api-headless-cms/types\";\n\n/**\n * This type matches any function that has a CmsModel as the first parameter.\n */\ntype ModelCallable = (model: CmsModel, ...params: any[]) => any;\n\n/**\n * This type filters only `ModelCallable` methods.\n */\ntype FilterModelMethods<T> = {\n [K in keyof T as ModelCallable extends T[K] ? K : never]: T[K];\n};\n\n/**\n * This type omits methods that have a more complex `model` type.\n * E.g., `getEntryManager` has `model` typed as `CmsModel | string`.\n * Ideally, we would filter those out in the previous utility type, but I'm not sure how to achieve that.\n */\ntype ModelMethods<T> = Omit<FilterModelMethods<T>, \"getEntryManager\">;\n\n/**\n * Decorator takes the decoratee as the _first_ parameter, and then forwards the rest of the parameters.\n */\ntype Decorator<T extends ModelCallable> = (decoratee: T, ...args: Parameters<T>) => ReturnType<T>;\n\nconst modelAuthorizationDisabled = (model: CmsModel) => {\n if (typeof model.authorization === \"object\") {\n return model?.authorization?.flp === false;\n }\n\n return model.authorization === false;\n};\n\nexport const decorateIfModelAuthorizationEnabled = <\n /**\n * This allows us to only have an auto-complete of `ModelCallable` methods.\n */\n M extends keyof ModelMethods<HeadlessCms>,\n D extends Decorator<ModelMethods<HeadlessCms>[M]>\n>(\n root: ModelMethods<HeadlessCms>,\n method: M,\n decorator: D\n) => {\n /**\n * We cast to `ModelCallable` because within the generic function, we only know that the first\n * parameter is a `CmsModel`, and we forward the rest.\n */\n const decoratee = root[method].bind(root) as ModelCallable;\n root[method] = ((...params: Parameters<ModelMethods<HeadlessCms>[M]>) => {\n const [model, ...rest] = params;\n if (modelAuthorizationDisabled(model)) {\n return decoratee(model, ...rest);\n }\n\n return decorator(decoratee, ...params);\n }) as ModelCallable;\n};\n"],"mappings":";;;;;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAMA,0BAA0B,GAAIC,KAAe,IAAK;EACpD,IAAI,OAAOA,KAAK,CAACC,aAAa,KAAK,QAAQ,EAAE;IACzC,OAAOD,KAAK,EAAEC,aAAa,EAAEC,GAAG,KAAK,KAAK;EAC9C;EAEA,OAAOF,KAAK,CAACC,aAAa,KAAK,KAAK;AACxC,CAAC;AAEM,MAAME,mCAAmC,GAAGA,CAO/CC,IAA+B,EAC/BC,MAAS,EACTC,SAAY,KACX;EACD;AACJ;AACA;AACA;EACI,MAAMC,SAAS,GAAGH,IAAI,CAACC,MAAM,CAAC,CAACG,IAAI,CAACJ,IAAI,CAAkB;EAC1DA,IAAI,CAACC,MAAM,CAAC,GAAI,CAAC,GAAGI,MAAgD,KAAK;IACrE,MAAM,CAACT,KAAK,EAAE,GAAGU,IAAI,CAAC,GAAGD,MAAM;IAC/B,IAAIV,0BAA0B,CAACC,KAAK,CAAC,EAAE;MACnC,OAAOO,SAAS,CAACP,KAAK,EAAE,GAAGU,IAAI,CAAC;IACpC;IAEA,OAAOJ,SAAS,CAACC,SAAS,EAAE,GAAGE,MAAM,CAAC;EAC1C,CAAmB;AACvB,CAAC;AAACE,OAAA,CAAAR,mCAAA,GAAAA,mCAAA","ignoreList":[]}
1
+ {"version":3,"names":["modelAuthorizationDisabled","model","authorization","flp","decorateIfModelAuthorizationEnabled","root","method","decorator","decoratee","bind","params","rest","exports"],"sources":["decorateIfModelAuthorizationEnabled.ts"],"sourcesContent":["import { CmsModel, HeadlessCms } from \"@webiny/api-headless-cms/types\";\n\n/**\n * This type matches any function that has a CmsModel as the first parameter.\n */\ntype ModelCallable = (model: CmsModel, ...params: any[]) => any;\n\n/**\n * This type filters only `ModelCallable` methods.\n */\ntype FilterModelMethods<T> = {\n [K in keyof T as ModelCallable extends T[K] ? K : never]: T[K];\n};\n\n/**\n * This type omits methods that have a more complex `model` type.\n * E.g., `getEntryManager` has `model` typed as `CmsModel | string`.\n * Ideally, we would filter those out in the previous utility type, but I'm not sure how to achieve that.\n */\ntype ModelMethods<T> = Omit<FilterModelMethods<T>, \"getEntryManager\" | \"getSingletonEntryManager\">;\n\n/**\n * Decorator takes the decoratee as the _first_ parameter, and then forwards the rest of the parameters.\n */\ntype Decorator<T extends ModelCallable> = (decoratee: T, ...args: Parameters<T>) => ReturnType<T>;\n\nconst modelAuthorizationDisabled = (model: CmsModel) => {\n if (typeof model.authorization === \"object\") {\n return model?.authorization?.flp === false;\n }\n\n return model.authorization === false;\n};\n\nexport const decorateIfModelAuthorizationEnabled = <\n /**\n * This allows us to only have an auto-complete of `ModelCallable` methods.\n */\n M extends keyof ModelMethods<HeadlessCms>,\n D extends Decorator<ModelMethods<HeadlessCms>[M]>\n>(\n root: ModelMethods<HeadlessCms>,\n method: M,\n decorator: D\n) => {\n /**\n * We cast to `ModelCallable` because within the generic function, we only know that the first\n * parameter is a `CmsModel`, and we forward the rest.\n */\n const decoratee = root[method].bind(root) as ModelCallable;\n root[method] = ((...params: Parameters<ModelMethods<HeadlessCms>[M]>) => {\n const [model, ...rest] = params;\n if (modelAuthorizationDisabled(model)) {\n return decoratee(model, ...rest);\n }\n\n return decorator(decoratee, ...params);\n }) as ModelCallable;\n};\n"],"mappings":";;;;;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAMA,0BAA0B,GAAIC,KAAe,IAAK;EACpD,IAAI,OAAOA,KAAK,CAACC,aAAa,KAAK,QAAQ,EAAE;IACzC,OAAOD,KAAK,EAAEC,aAAa,EAAEC,GAAG,KAAK,KAAK;EAC9C;EAEA,OAAOF,KAAK,CAACC,aAAa,KAAK,KAAK;AACxC,CAAC;AAEM,MAAME,mCAAmC,GAAGA,CAO/CC,IAA+B,EAC/BC,MAAS,EACTC,SAAY,KACX;EACD;AACJ;AACA;AACA;EACI,MAAMC,SAAS,GAAGH,IAAI,CAACC,MAAM,CAAC,CAACG,IAAI,CAACJ,IAAI,CAAkB;EAC1DA,IAAI,CAACC,MAAM,CAAC,GAAI,CAAC,GAAGI,MAAgD,KAAK;IACrE,MAAM,CAACT,KAAK,EAAE,GAAGU,IAAI,CAAC,GAAGD,MAAM;IAC/B,IAAIV,0BAA0B,CAACC,KAAK,CAAC,EAAE;MACnC,OAAOO,SAAS,CAACP,KAAK,EAAE,GAAGU,IAAI,CAAC;IACpC;IAEA,OAAOJ,SAAS,CAACC,SAAS,EAAE,GAAGE,MAAM,CAAC;EAC1C,CAAmB;AACvB,CAAC;AAACE,OAAA,CAAAR,mCAAA,GAAAA,mCAAA","ignoreList":[]}