@webiny/api-file-manager 6.4.0-beta.0 → 6.4.0-beta.2

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/index.d.ts CHANGED
@@ -2,6 +2,6 @@ import type { ApiCoreContext } from "@webiny/api-core/types/core.js";
2
2
  import { ContextPlugin } from "@webiny/api";
3
3
  export * from "./modelModifier/CmsModelModifier.js";
4
4
  export * from "./delivery/index.js";
5
- export declare const createFileManagerContext: () => ContextPlugin<ApiCoreContext>;
5
+ export declare const createFileManagerContext: () => (ContextPlugin<ApiCoreContext> | import("@webiny/handler").RegisterExtensionPlugin<import("@webiny/handler/types.js").Context>)[];
6
6
  export declare const createFileManagerGraphQL: () => (import("@webiny/handler-graphql/index.js").GraphQLSchemaPlugin<ApiCoreContext> | ContextPlugin<ApiCoreContext>)[];
7
- export declare const createAssetDelivery: () => (import("./index.js").AssetDeliveryConfigModifierPlugin | import("@webiny/handler/index.js").ModifyFastifyPlugin)[];
7
+ export declare const createAssetDelivery: () => (import("./index.js").AssetDeliveryConfigModifierPlugin | import("@webiny/handler").ModifyFastifyPlugin)[];
package/index.js CHANGED
@@ -7,14 +7,14 @@ import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/
7
7
  import { FileModel } from "./domain/file/abstractions.js";
8
8
  import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
9
9
  import { FILE_MODEL_ID, FileModel as file_model_js_FileModel } from "./domain/file/file.model.js";
10
+ import { createRegisterExtensionPlugin } from "@webiny/handler";
10
11
  export * from "./modelModifier/CmsModelModifier.js";
11
12
  export * from "./delivery/index.js";
12
13
  const createFileManagerContext = ()=>{
13
- const plugin = new ContextPlugin(async (context)=>{
14
+ const fileManagerContextPlugin = new ContextPlugin(async (context)=>{
14
15
  const tenantContext = context.container.resolve(TenantContext);
15
16
  const getModel = context.container.resolve(GetModelUseCase);
16
17
  if (!tenantContext.getTenant()) return;
17
- context.container.register(file_model_js_FileModel);
18
18
  await context.security.withoutAuthorization(async ()=>{
19
19
  const fileModel = await getModel.execute(FILE_MODEL_ID);
20
20
  context.container.registerInstance(FileModel, fileModel.value);
@@ -22,8 +22,14 @@ const createFileManagerContext = ()=>{
22
22
  FmPermissionsFeature.register(context.container);
23
23
  FileManagerFeature.register(context.container);
24
24
  });
25
- plugin.name = "file-manager.createContext";
26
- return plugin;
25
+ fileManagerContextPlugin.name = "file-manager.createContext";
26
+ const modelsPlugin = createRegisterExtensionPlugin((context)=>{
27
+ context.container.register(file_model_js_FileModel);
28
+ });
29
+ return [
30
+ fileManagerContextPlugin,
31
+ modelsPlugin
32
+ ];
27
33
  };
28
34
  const createFileManagerGraphQL = ()=>createGraphQLSchemaPlugin();
29
35
  const createAssetDelivery = ()=>setupAssetDelivery();
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import type { ApiCoreContext } from \"@webiny/api-core/types/core.js\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { setupAssetDelivery } from \"./delivery/setupAssetDelivery.js\";\nimport { createGraphQLSchemaPlugin } from \"./graphql/index.js\";\nimport { FileManagerFeature } from \"~/features/FileManagerFeature.js\";\nimport { FmPermissionsFeature } from \"~/features/permissions/feature.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { FileModel as FileModelAbstraction } from \"~/domain/file/abstractions.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { FileModel, FILE_MODEL_ID } from \"~/domain/file/file.model.js\";\n\nexport * from \"./modelModifier/CmsModelModifier.js\";\nexport * from \"./delivery/index.js\";\n\nexport const createFileManagerContext = () => {\n const plugin = new ContextPlugin<ApiCoreContext>(async context => {\n const tenantContext = context.container.resolve(TenantContext);\n const getModel = context.container.resolve(GetModelUseCase);\n\n if (!tenantContext.getTenant()) {\n return;\n }\n\n context.container.register(FileModel);\n\n await context.security.withoutAuthorization(async () => {\n const fileModel = await getModel.execute(FILE_MODEL_ID);\n context.container.registerInstance(FileModelAbstraction, fileModel.value);\n });\n\n FmPermissionsFeature.register(context.container);\n FileManagerFeature.register(context.container);\n });\n\n plugin.name = \"file-manager.createContext\";\n\n return plugin;\n};\n\nexport const createFileManagerGraphQL = () => {\n return createGraphQLSchemaPlugin();\n};\n\nexport const createAssetDelivery = () => {\n return setupAssetDelivery();\n};\n"],"names":["createFileManagerContext","plugin","ContextPlugin","context","tenantContext","TenantContext","getModel","GetModelUseCase","FileModel","fileModel","FILE_MODEL_ID","FileModelAbstraction","FmPermissionsFeature","FileManagerFeature","createFileManagerGraphQL","createGraphQLSchemaPlugin","createAssetDelivery","setupAssetDelivery"],"mappings":";;;;;;;;;;;AAcO,MAAMA,2BAA2B;IACpC,MAAMC,SAAS,IAAIC,cAA8B,OAAMC;QACnD,MAAMC,gBAAgBD,QAAQ,SAAS,CAAC,OAAO,CAACE;QAChD,MAAMC,WAAWH,QAAQ,SAAS,CAAC,OAAO,CAACI;QAE3C,IAAI,CAACH,cAAc,SAAS,IACxB;QAGJD,QAAQ,SAAS,CAAC,QAAQ,CAACK;QAE3B,MAAML,QAAQ,QAAQ,CAAC,oBAAoB,CAAC;YACxC,MAAMM,YAAY,MAAMH,SAAS,OAAO,CAACI;YACzCP,QAAQ,SAAS,CAAC,gBAAgB,CAACQ,WAAsBF,UAAU,KAAK;QAC5E;QAEAG,qBAAqB,QAAQ,CAACT,QAAQ,SAAS;QAC/CU,mBAAmB,QAAQ,CAACV,QAAQ,SAAS;IACjD;IAEAF,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX;AAEO,MAAMa,2BAA2B,IAC7BC;AAGJ,MAAMC,sBAAsB,IACxBC"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import type { ApiCoreContext } from \"@webiny/api-core/types/core.js\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { setupAssetDelivery } from \"./delivery/setupAssetDelivery.js\";\nimport { createGraphQLSchemaPlugin } from \"./graphql/index.js\";\nimport { FileManagerFeature } from \"~/features/FileManagerFeature.js\";\nimport { FmPermissionsFeature } from \"~/features/permissions/feature.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { FileModel as FileModelAbstraction } from \"~/domain/file/abstractions.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { FileModel, FILE_MODEL_ID } from \"~/domain/file/file.model.js\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\n\nexport * from \"./modelModifier/CmsModelModifier.js\";\nexport * from \"./delivery/index.js\";\n\nexport const createFileManagerContext = () => {\n const fileManagerContextPlugin = new ContextPlugin<ApiCoreContext>(async context => {\n const tenantContext = context.container.resolve(TenantContext);\n const getModel = context.container.resolve(GetModelUseCase);\n\n if (!tenantContext.getTenant()) {\n return;\n }\n\n await context.security.withoutAuthorization(async () => {\n const fileModel = await getModel.execute(FILE_MODEL_ID);\n context.container.registerInstance(FileModelAbstraction, fileModel.value);\n });\n\n FmPermissionsFeature.register(context.container);\n FileManagerFeature.register(context.container);\n });\n\n fileManagerContextPlugin.name = \"file-manager.createContext\";\n\n const modelsPlugin = createRegisterExtensionPlugin(context => {\n context.container.register(FileModel);\n });\n\n return [fileManagerContextPlugin, modelsPlugin];\n};\n\nexport const createFileManagerGraphQL = () => {\n return createGraphQLSchemaPlugin();\n};\n\nexport const createAssetDelivery = () => {\n return setupAssetDelivery();\n};\n"],"names":["createFileManagerContext","fileManagerContextPlugin","ContextPlugin","context","tenantContext","TenantContext","getModel","GetModelUseCase","fileModel","FILE_MODEL_ID","FileModelAbstraction","FmPermissionsFeature","FileManagerFeature","modelsPlugin","createRegisterExtensionPlugin","FileModel","createFileManagerGraphQL","createGraphQLSchemaPlugin","createAssetDelivery","setupAssetDelivery"],"mappings":";;;;;;;;;;;;AAeO,MAAMA,2BAA2B;IACpC,MAAMC,2BAA2B,IAAIC,cAA8B,OAAMC;QACrE,MAAMC,gBAAgBD,QAAQ,SAAS,CAAC,OAAO,CAACE;QAChD,MAAMC,WAAWH,QAAQ,SAAS,CAAC,OAAO,CAACI;QAE3C,IAAI,CAACH,cAAc,SAAS,IACxB;QAGJ,MAAMD,QAAQ,QAAQ,CAAC,oBAAoB,CAAC;YACxC,MAAMK,YAAY,MAAMF,SAAS,OAAO,CAACG;YACzCN,QAAQ,SAAS,CAAC,gBAAgB,CAACO,WAAsBF,UAAU,KAAK;QAC5E;QAEAG,qBAAqB,QAAQ,CAACR,QAAQ,SAAS;QAC/CS,mBAAmB,QAAQ,CAACT,QAAQ,SAAS;IACjD;IAEAF,yBAAyB,IAAI,GAAG;IAEhC,MAAMY,eAAeC,8BAA8BX,CAAAA;QAC/CA,QAAQ,SAAS,CAAC,QAAQ,CAACY;IAC/B;IAEA,OAAO;QAACd;QAA0BY;KAAa;AACnD;AAEO,MAAMG,2BAA2B,IAC7BC;AAGJ,MAAMC,sBAAsB,IACxBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-file-manager",
3
- "version": "6.4.0-beta.0",
3
+ "version": "6.4.0-beta.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -22,26 +22,26 @@
22
22
  ],
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@webiny/api": "6.4.0-beta.0",
26
- "@webiny/api-core": "6.4.0-beta.0",
27
- "@webiny/api-headless-cms": "6.4.0-beta.0",
28
- "@webiny/build-tools": "6.4.0-beta.0",
29
- "@webiny/di": "0.2.3",
30
- "@webiny/error": "6.4.0-beta.0",
31
- "@webiny/feature": "6.4.0-beta.0",
32
- "@webiny/handler": "6.4.0-beta.0",
33
- "@webiny/handler-graphql": "6.4.0-beta.0",
34
- "@webiny/plugins": "6.4.0-beta.0",
35
- "@webiny/tasks": "6.4.0-beta.0",
36
- "@webiny/wcp": "6.4.0-beta.0",
25
+ "@webiny/api": "6.4.0-beta.2",
26
+ "@webiny/api-core": "6.4.0-beta.2",
27
+ "@webiny/api-headless-cms": "6.4.0-beta.2",
28
+ "@webiny/build-tools": "6.4.0-beta.2",
29
+ "@webiny/di": "1.0.1",
30
+ "@webiny/error": "6.4.0-beta.2",
31
+ "@webiny/feature": "6.4.0-beta.2",
32
+ "@webiny/handler": "6.4.0-beta.2",
33
+ "@webiny/handler-graphql": "6.4.0-beta.2",
34
+ "@webiny/plugins": "6.4.0-beta.2",
35
+ "@webiny/tasks": "6.4.0-beta.2",
36
+ "@webiny/wcp": "6.4.0-beta.2",
37
37
  "cache-control-parser": "2.2.0",
38
38
  "zod": "4.4.3"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/object-hash": "3.0.6",
42
- "@webiny/handler-aws": "6.4.0-beta.0",
43
- "@webiny/project-utils": "6.4.0-beta.0",
44
- "@webiny/utils": "6.4.0-beta.0",
42
+ "@webiny/handler-aws": "6.4.0-beta.2",
43
+ "@webiny/project-utils": "6.4.0-beta.2",
44
+ "@webiny/utils": "6.4.0-beta.2",
45
45
  "@webiny/wcp": "0.0.0",
46
46
  "rimraf": "6.1.3",
47
47
  "typescript": "6.0.3"
@@ -63,5 +63,5 @@
63
63
  ]
64
64
  }
65
65
  },
66
- "gitHead": "a545d7529828af07d08d49c3da1bcb967483b9ce"
66
+ "gitHead": "872f9f50baa1ff6915a5f338216f84bf0b6dfd24"
67
67
  }