@webiny/api-headless-cms-aco 5.43.3 → 6.0.0-alpha.1

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.
@@ -1,3 +1,3 @@
1
1
  export { onEntryBeforeRestoreFromBinHook } from "./onEntryBeforeRestoreFromBin.hook";
2
- import { HcmsAcoContext } from "../../types";
2
+ import type { HcmsAcoContext } from "../../types";
3
3
  export declare const createEntryHooks: (context: HcmsAcoContext) => void;
@@ -1 +1 @@
1
- {"version":3,"names":["_onEntryBeforeRestoreFromBin","require","createEntryHooks","context","onEntryBeforeRestoreFromBinHook","exports"],"sources":["index.ts"],"sourcesContent":["import { onEntryBeforeRestoreFromBinHook } from \"~/hooks/entry/onEntryBeforeRestoreFromBin.hook\";\n\nexport { onEntryBeforeRestoreFromBinHook } from \"./onEntryBeforeRestoreFromBin.hook\";\n\nimport { HcmsAcoContext } from \"~/types\";\n\nexport const createEntryHooks = (context: HcmsAcoContext) => {\n onEntryBeforeRestoreFromBinHook(context);\n};\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AAMO,MAAMC,gBAAgB,GAAIC,OAAuB,IAAK;EACzD,IAAAC,4DAA+B,EAACD,OAAO,CAAC;AAC5C,CAAC;AAACE,OAAA,CAAAH,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_onEntryBeforeRestoreFromBin","require","createEntryHooks","context","onEntryBeforeRestoreFromBinHook","exports"],"sources":["index.ts"],"sourcesContent":["import { onEntryBeforeRestoreFromBinHook } from \"~/hooks/entry/onEntryBeforeRestoreFromBin.hook\";\n\nexport { onEntryBeforeRestoreFromBinHook } from \"./onEntryBeforeRestoreFromBin.hook\";\n\nimport type { HcmsAcoContext } from \"~/types\";\n\nexport const createEntryHooks = (context: HcmsAcoContext) => {\n onEntryBeforeRestoreFromBinHook(context);\n};\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AAMO,MAAMC,gBAAgB,GAAIC,OAAuB,IAAK;EACzD,IAAAC,4DAA+B,EAACD,OAAO,CAAC;AAC5C,CAAC;AAACE,OAAA,CAAAH,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { HcmsAcoContext } from "../../types";
1
+ import type { HcmsAcoContext } from "../../types";
2
2
  export declare const onEntryBeforeRestoreFromBinHook: (context: HcmsAcoContext) => void;
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_constants","onEntryBeforeRestoreFromBinHook","context","aco","cms","onEntryBeforeRestoreFromBin","subscribe","entry","location","folderId","ROOT_FOLDER","folder","get","error","code","WebinyError","from","message","exports"],"sources":["onEntryBeforeRestoreFromBin.hook.ts"],"sourcesContent":["import { HcmsAcoContext } from \"~/types\";\nimport WebinyError from \"@webiny/error\";\nimport { ROOT_FOLDER } from \"@webiny/api-headless-cms/constants\";\n\nexport const onEntryBeforeRestoreFromBinHook = (context: HcmsAcoContext) => {\n const { aco, cms } = context;\n\n cms.onEntryBeforeRestoreFromBin.subscribe(async ({ entry }) => {\n /**\n * Skip further execution if folderId is falsy or equals ROOT_FOLDER.\n */\n if (!entry.location?.folderId || entry.location.folderId === ROOT_FOLDER) {\n return;\n }\n\n try {\n /**\n * Retrieve the folder: if it exists, no additional operations are necessary.\n */\n await aco.folder.get(entry.location.folderId);\n return;\n } catch (error) {\n /**\n * If the folder is not found, set ROOT_FOLDER as the location.\n */\n if (error.code === \"NOT_FOUND\") {\n entry.location.folderId = ROOT_FOLDER;\n return;\n }\n\n throw WebinyError.from(error, {\n message: \"Error while executing onEntryBeforeRestoreFromBin hook\",\n code: \"HCMS_ACO_BEFORE_RESTORE_FROM_BIN_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,+BAA+B,GAAIC,OAAuB,IAAK;EACxE,MAAM;IAAEC,GAAG;IAAEC;EAAI,CAAC,GAAGF,OAAO;EAE5BE,GAAG,CAACC,2BAA2B,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAM,CAAC,KAAK;IAC3D;AACR;AACA;IACQ,IAAI,CAACA,KAAK,CAACC,QAAQ,EAAEC,QAAQ,IAAIF,KAAK,CAACC,QAAQ,CAACC,QAAQ,KAAKC,sBAAW,EAAE;MACtE;IACJ;IAEA,IAAI;MACA;AACZ;AACA;MACY,MAAMP,GAAG,CAACQ,MAAM,CAACC,GAAG,CAACL,KAAK,CAACC,QAAQ,CAACC,QAAQ,CAAC;MAC7C;IACJ,CAAC,CAAC,OAAOI,KAAK,EAAE;MACZ;AACZ;AACA;MACY,IAAIA,KAAK,CAACC,IAAI,KAAK,WAAW,EAAE;QAC5BP,KAAK,CAACC,QAAQ,CAACC,QAAQ,GAAGC,sBAAW;QACrC;MACJ;MAEA,MAAMK,cAAW,CAACC,IAAI,CAACH,KAAK,EAAE;QAC1BI,OAAO,EAAE,wDAAwD;QACjEH,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACI,OAAA,CAAAjB,+BAAA,GAAAA,+BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_error","_interopRequireDefault","require","_constants","onEntryBeforeRestoreFromBinHook","context","aco","cms","onEntryBeforeRestoreFromBin","subscribe","entry","location","folderId","ROOT_FOLDER","folder","get","error","code","WebinyError","from","message","exports"],"sources":["onEntryBeforeRestoreFromBin.hook.ts"],"sourcesContent":["import type { HcmsAcoContext } from \"~/types\";\nimport WebinyError from \"@webiny/error\";\nimport { ROOT_FOLDER } from \"@webiny/api-headless-cms/constants\";\n\nexport const onEntryBeforeRestoreFromBinHook = (context: HcmsAcoContext) => {\n const { aco, cms } = context;\n\n cms.onEntryBeforeRestoreFromBin.subscribe(async ({ entry }) => {\n /**\n * Skip further execution if folderId is falsy or equals ROOT_FOLDER.\n */\n if (!entry.location?.folderId || entry.location.folderId === ROOT_FOLDER) {\n return;\n }\n\n try {\n /**\n * Retrieve the folder: if it exists, no additional operations are necessary.\n */\n await aco.folder.get(entry.location.folderId);\n return;\n } catch (error) {\n /**\n * If the folder is not found, set ROOT_FOLDER as the location.\n */\n if (error.code === \"NOT_FOUND\") {\n entry.location.folderId = ROOT_FOLDER;\n return;\n }\n\n throw WebinyError.from(error, {\n message: \"Error while executing onEntryBeforeRestoreFromBin hook\",\n code: \"HCMS_ACO_BEFORE_RESTORE_FROM_BIN_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,+BAA+B,GAAIC,OAAuB,IAAK;EACxE,MAAM;IAAEC,GAAG;IAAEC;EAAI,CAAC,GAAGF,OAAO;EAE5BE,GAAG,CAACC,2BAA2B,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAM,CAAC,KAAK;IAC3D;AACR;AACA;IACQ,IAAI,CAACA,KAAK,CAACC,QAAQ,EAAEC,QAAQ,IAAIF,KAAK,CAACC,QAAQ,CAACC,QAAQ,KAAKC,sBAAW,EAAE;MACtE;IACJ;IAEA,IAAI;MACA;AACZ;AACA;MACY,MAAMP,GAAG,CAACQ,MAAM,CAACC,GAAG,CAACL,KAAK,CAACC,QAAQ,CAACC,QAAQ,CAAC;MAC7C;IACJ,CAAC,CAAC,OAAOI,KAAK,EAAE;MACZ;AACZ;AACA;MACY,IAAIA,KAAK,CAACC,IAAI,KAAK,WAAW,EAAE;QAC5BP,KAAK,CAACC,QAAQ,CAACC,QAAQ,GAAGC,sBAAW;QACrC;MACJ;MAEA,MAAMK,cAAW,CAACC,IAAI,CAACH,KAAK,EAAE;QAC1BI,OAAO,EAAE,wDAAwD;QACjEH,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACI,OAAA,CAAAjB,+BAAA,GAAAA,+BAAA","ignoreList":[]}
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { ContextPlugin } from "@webiny/api";
2
- import { HcmsAcoContext } from "./types";
2
+ import type { HcmsAcoContext } from "./types";
3
3
  export declare const createAcoHcmsContext: () => ContextPlugin<HcmsAcoContext>;
4
4
  export * from "./plugins";
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_api","require","_entry","_plugins","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","createAcoHcmsContext","plugin","ContextPlugin","context","aco","console","log","createEntryHooks","name"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { createEntryHooks } from \"~/hooks/entry\";\nimport { HcmsAcoContext } from \"~/types\";\n\nexport const createAcoHcmsContext = () => {\n const plugin = new ContextPlugin<HcmsAcoContext>(async context => {\n if (!context.aco) {\n console.log(`There is no ACO initialized so we will not initialize the HCMS ACO.`);\n return;\n }\n createEntryHooks(context);\n });\n\n plugin.name = \"hcms-aco.createContext\";\n\n return plugin;\n};\n\nexport * from \"./plugins\";\n"],"mappings":";;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAiBA,IAAAE,QAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,QAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,QAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,QAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAdO,MAAMS,oBAAoB,GAAGA,CAAA,KAAM;EACtC,MAAMC,MAAM,GAAG,IAAIC,kBAAa,CAAiB,MAAMC,OAAO,IAAI;IAC9D,IAAI,CAACA,OAAO,CAACC,GAAG,EAAE;MACdC,OAAO,CAACC,GAAG,CAAC,qEAAqE,CAAC;MAClF;IACJ;IACA,IAAAC,uBAAgB,EAACJ,OAAO,CAAC;EAC7B,CAAC,CAAC;EAEFF,MAAM,CAACO,IAAI,GAAG,wBAAwB;EAEtC,OAAOP,MAAM;AACjB,CAAC;AAACL,OAAA,CAAAI,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_api","require","_entry","_plugins","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","createAcoHcmsContext","plugin","ContextPlugin","context","aco","console","log","createEntryHooks","name"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { createEntryHooks } from \"~/hooks/entry\";\nimport type { HcmsAcoContext } from \"~/types\";\n\nexport const createAcoHcmsContext = () => {\n const plugin = new ContextPlugin<HcmsAcoContext>(async context => {\n if (!context.aco) {\n console.log(`There is no ACO initialized so we will not initialize the HCMS ACO.`);\n return;\n }\n createEntryHooks(context);\n });\n\n plugin.name = \"hcms-aco.createContext\";\n\n return plugin;\n};\n\nexport * from \"./plugins\";\n"],"mappings":";;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAiBA,IAAAE,QAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,QAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,QAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,QAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAdO,MAAMS,oBAAoB,GAAGA,CAAA,KAAM;EACtC,MAAMC,MAAM,GAAG,IAAIC,kBAAa,CAAiB,MAAMC,OAAO,IAAI;IAC9D,IAAI,CAACA,OAAO,CAACC,GAAG,EAAE;MACdC,OAAO,CAACC,GAAG,CAAC,qEAAqE,CAAC;MAClF;IACJ;IACA,IAAAC,uBAAgB,EAACJ,OAAO,CAAC;EAC7B,CAAC,CAAC;EAEFF,MAAM,CAACO,IAAI,GAAG,wBAAwB;EAEtC,OAAOP,MAAM;AACjB,CAAC;AAACL,OAAA,CAAAI,oBAAA,GAAAA,oBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms-aco",
3
- "version": "5.43.3",
3
+ "version": "6.0.0-alpha.1",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "api-headless-cms-aco-aco:base"
@@ -22,25 +22,25 @@
22
22
  "directory": "dist"
23
23
  },
24
24
  "devDependencies": {
25
- "@webiny/api-admin-users": "5.43.3",
26
- "@webiny/api-i18n": "5.43.3",
27
- "@webiny/api-security": "5.43.3",
28
- "@webiny/api-tenancy": "5.43.3",
29
- "@webiny/api-wcp": "5.43.3",
30
- "@webiny/handler-aws": "5.43.3",
31
- "@webiny/handler-graphql": "5.43.3",
32
- "@webiny/plugins": "5.43.3",
33
- "@webiny/project-utils": "5.43.3",
34
- "@webiny/wcp": "5.43.3",
25
+ "@webiny/api-admin-users": "6.0.0-alpha.1",
26
+ "@webiny/api-i18n": "6.0.0-alpha.1",
27
+ "@webiny/api-security": "6.0.0-alpha.1",
28
+ "@webiny/api-tenancy": "6.0.0-alpha.1",
29
+ "@webiny/api-wcp": "6.0.0-alpha.1",
30
+ "@webiny/handler-aws": "6.0.0-alpha.1",
31
+ "@webiny/handler-graphql": "6.0.0-alpha.1",
32
+ "@webiny/plugins": "6.0.0-alpha.1",
33
+ "@webiny/project-utils": "6.0.0-alpha.1",
34
+ "@webiny/wcp": "6.0.0-alpha.1",
35
35
  "graphql": "15.9.0",
36
36
  "typescript": "5.3.3"
37
37
  },
38
38
  "dependencies": {
39
- "@webiny/api": "5.43.3",
40
- "@webiny/api-aco": "5.43.3",
41
- "@webiny/api-headless-cms": "5.43.3",
42
- "@webiny/error": "5.43.3",
43
- "@webiny/handler": "5.43.3"
39
+ "@webiny/api": "6.0.0-alpha.1",
40
+ "@webiny/api-aco": "6.0.0-alpha.1",
41
+ "@webiny/api-headless-cms": "6.0.0-alpha.1",
42
+ "@webiny/error": "6.0.0-alpha.1",
43
+ "@webiny/handler": "6.0.0-alpha.1"
44
44
  },
45
- "gitHead": "c6d623eb1b715f3731434a8d3107b8fd8a1d6792"
45
+ "gitHead": "9bd236cf5e689f209a11bec089207dcc2d41a53c"
46
46
  }
package/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { AcoContext } from "@webiny/api-aco/types";
2
- import { CmsContext } from "@webiny/api-headless-cms/types";
3
- import { Context as BaseContext } from "@webiny/handler/types";
1
+ import type { AcoContext } from "@webiny/api-aco/types";
2
+ import type { CmsContext } from "@webiny/api-headless-cms/types";
3
+ import type { Context as BaseContext } from "@webiny/handler/types";
4
4
  export interface HcmsAcoContext extends BaseContext, AcoContext, CmsContext {
5
5
  }
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { AcoContext } from \"@webiny/api-aco/types\";\nimport { CmsContext } from \"@webiny/api-headless-cms/types\";\nimport { Context as BaseContext } from \"@webiny/handler/types\";\n\nexport interface HcmsAcoContext extends BaseContext, AcoContext, CmsContext {}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { AcoContext } from \"@webiny/api-aco/types\";\nimport type { CmsContext } from \"@webiny/api-headless-cms/types\";\nimport type { Context as BaseContext } from \"@webiny/handler/types\";\n\nexport interface HcmsAcoContext extends BaseContext, AcoContext, CmsContext {}\n"],"mappings":"","ignoreList":[]}