@webiny/api-aco 6.2.0 → 6.3.0-beta.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.
- package/createAcoContext.js +2 -6
- package/createAcoContext.js.map +1 -1
- package/features/cms/feature.d.ts +4 -1
- package/features/flp/CreateFlp/feature.d.ts +5 -1
- package/features/flp/CreateFlpOnFolderCreated/feature.d.ts +4 -1
- package/features/flp/DeleteFlp/feature.d.ts +5 -1
- package/features/flp/DeleteFlpOnFolderDeleted/feature.d.ts +4 -1
- package/features/flp/FolderLevelPermissions/feature.d.ts +5 -1
- package/features/flp/GetFlp/feature.d.ts +4 -1
- package/features/flp/GetFlp/feature.js.map +1 -1
- package/features/flp/ListFlps/feature.d.ts +4 -1
- package/features/flp/ListFlps/feature.js.map +1 -1
- package/features/flp/UpdateFlp/feature.d.ts +5 -1
- package/features/flp/UpdateFlpOnFolderUpdated/feature.d.ts +4 -1
- package/features/folder/CreateFolder/feature.d.ts +5 -1
- package/features/folder/DeleteFolder/feature.d.ts +5 -1
- package/features/folder/EnsureFolderIsEmpty/feature.d.ts +4 -1
- package/features/folder/EnsureFolderIsEmptyOnDelete/feature.d.ts +4 -1
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/feature.d.ts +4 -1
- package/features/folder/GetAncestors/feature.d.ts +5 -1
- package/features/folder/GetFolder/feature.d.ts +5 -1
- package/features/folder/GetFolderHierarchy/feature.d.ts +5 -1
- package/features/folder/ListFolderLevelPermissionsTargets/feature.d.ts +4 -1
- package/features/folder/ListFolders/feature.d.ts +5 -1
- package/features/folder/UpdateFolder/feature.d.ts +5 -1
- package/flp/flp.so.js.map +1 -1
- package/package.json +23 -24
package/createAcoContext.js
CHANGED
|
@@ -92,12 +92,8 @@ const setupAcoContext = async (context, setupAcoContextParams) => {
|
|
|
92
92
|
ListFlpsFeature.register(context.container, flpCrudMethods);
|
|
93
93
|
GetFlpFeature.register(context.container, flpCrudMethods);
|
|
94
94
|
CreateFlpOnFolderCreatedFeature.register(context.container);
|
|
95
|
-
UpdateFlpOnFolderUpdatedFeature.register(context.container
|
|
96
|
-
|
|
97
|
-
});
|
|
98
|
-
DeleteFlpOnFolderDeletedFeature.register(context.container, {
|
|
99
|
-
tasks: context.tasks
|
|
100
|
-
});
|
|
95
|
+
UpdateFlpOnFolderUpdatedFeature.register(context.container);
|
|
96
|
+
DeleteFlpOnFolderDeletedFeature.register(context.container);
|
|
101
97
|
|
|
102
98
|
/**
|
|
103
99
|
* Register folder event handlers
|
package/createAcoContext.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ContextPlugin","isHeadlessCmsReady","createAcoStorageOperations","createFilterCrudMethods","createFlpCrudMethods","FolderLevelPermissions","FolderLevelPermissionsFeature","UpdateFolderFeature","DeleteFolderFeature","CreateFolderFeature","GetFolderFeature","ListFoldersFeature","GetFolderHierarchyFeature","GetAncestorsFeature","UpdateFlpOnFolderUpdatedFeature","DeleteFlpOnFolderDeletedFeature","EnsureHcmsFolderIsEmptyOnDeleteFeature","CreateFlpFeature","DeleteFlpFeature","UpdateFlpFeature","EnsureFolderIsEmptyOnDeleteFeature","FilterStorageOperations","ListFlpsFeature","GetFlpFeature","ListFolderLevelPermissionsTargetsFeature","CmsFlpFeature","GetModelUseCase","FolderModel","FolderModelAbstraction","CreateFlpOnFolderCreatedFeature","EnsureFolderIsEmptyFeature","FOLDER_MODEL_ID","FilterPrivateModel","setupAcoContext","context","setupAcoContextParams","tenancy","security","container","register","getModel","resolve","withoutAuthorization","folderModel","execute","registerInstance","value","getTenant","getCurrentTenant","storageOperations","cms","documentClient","flpCrudMethods","filter","tasks","folderLevelPermissions","aco","flp","wcp","canUseFolderLevelPermissions","createAcoContext","params","plugin","benchmark","measure","name"],"sources":["createAcoContext.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { isHeadlessCmsReady } from \"@webiny/api-headless-cms\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createAcoStorageOperations } from \"~/createAcoStorageOperations.js\";\nimport type { AcoContext } from \"~/types.js\";\nimport { createFilterCrudMethods } from \"~/filter/filter.crud.js\";\nimport { createFlpCrudMethods } from \"~/flp/index.js\";\nimport {\n FolderLevelPermissions,\n FolderLevelPermissionsFeature\n} from \"~/features/flp/FolderLevelPermissions/index.js\";\nimport { UpdateFolderFeature } from \"~/features/folder/UpdateFolder/index.js\";\nimport { DeleteFolderFeature } from \"~/features/folder/DeleteFolder/index.js\";\nimport { CreateFolderFeature } from \"~/features/folder/CreateFolder/index.js\";\nimport { GetFolderFeature } from \"~/features/folder/GetFolder/index.js\";\nimport { ListFoldersFeature } from \"~/features/folder/ListFolders/index.js\";\nimport { GetFolderHierarchyFeature } from \"~/features/folder/GetFolderHierarchy/index.js\";\nimport { GetAncestorsFeature } from \"~/features/folder/GetAncestors/index.js\";\nimport { UpdateFlpOnFolderUpdatedFeature } from \"~/features/flp/UpdateFlpOnFolderUpdated/index.js\";\nimport { DeleteFlpOnFolderDeletedFeature } from \"~/features/flp/DeleteFlpOnFolderDeleted/index.js\";\nimport { EnsureHcmsFolderIsEmptyOnDeleteFeature } from \"~/features/folder/EnsureHcmsFolderIsEmptyOnDelete/index.js\";\nimport { CreateFlpFeature } from \"~/features/flp/CreateFlp/index.js\";\nimport { DeleteFlpFeature } from \"~/features/flp/DeleteFlp/index.js\";\nimport { UpdateFlpFeature } from \"~/features/flp/UpdateFlp/index.js\";\nimport { EnsureFolderIsEmptyOnDeleteFeature } from \"~/features/folder/EnsureFolderIsEmptyOnDelete/index.js\";\nimport { FilterStorageOperations } from \"~/features/folder/shared/abstractions.js\";\nimport { ListFlpsFeature } from \"~/features/flp/ListFlps/feature.js\";\nimport { GetFlpFeature } from \"~/features/flp/GetFlp/feature.js\";\nimport { ListFolderLevelPermissionsTargetsFeature } from \"~/features/folder/ListFolderLevelPermissionsTargets/feature.js\";\nimport { Tenant } from \"@webiny/api-core/types/tenancy\";\nimport { CmsFlpFeature } from \"~/features/cms/index.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { FolderModel as FolderModelAbstraction } from \"~/domain/folder/abstractions.js\";\nimport { CreateFlpOnFolderCreatedFeature } from \"~/features/flp/CreateFlpOnFolderCreated/index.js\";\nimport { EnsureFolderIsEmptyFeature } from \"~/features/folder/EnsureFolderIsEmpty/feature.js\";\nimport { FOLDER_MODEL_ID, FolderModel } from \"~/domain/folder/folder.model.js\";\nimport { FilterPrivateModel } from \"~/filter/filter.model.js\";\n\ninterface CreateAcoContextParams {\n useFolderLevelPermissions?: boolean;\n documentClient: DynamoDBDocument;\n}\n\nconst setupAcoContext = async (\n context: AcoContext,\n setupAcoContextParams: CreateAcoContextParams\n): Promise<void> => {\n const { tenancy, security } = context;\n\n context.container.register(FolderModel);\n context.container.register(FilterPrivateModel);\n\n const getModel = context.container.resolve(GetModelUseCase);\n\n await context.security.withoutAuthorization(async () => {\n const folderModel = await getModel.execute(FOLDER_MODEL_ID);\n context.container.registerInstance(FolderModelAbstraction, folderModel.value);\n });\n\n const getTenant = (): Tenant => {\n return tenancy.getCurrentTenant();\n };\n\n const storageOperations = await createAcoStorageOperations({\n /**\n * TODO: We need to figure out a way to pass \"cms\" from outside (e.g. apps/api/graphql)\n */\n cms: context.cms,\n container: context.container,\n documentClient: setupAcoContextParams.documentClient,\n security\n });\n\n const flpCrudMethods = createFlpCrudMethods({\n getTenant,\n storageOperations\n });\n\n FolderLevelPermissionsFeature.register(context.container);\n\n /**\n * Register legacy dependencies via abstractions\n */\n context.container.registerInstance(FilterStorageOperations, storageOperations.filter);\n\n /**\n * Register folder features into DI container\n */\n CreateFolderFeature.register(context.container);\n\n UpdateFolderFeature.register(context.container);\n\n DeleteFolderFeature.register(context.container);\n\n GetFolderFeature.register(context.container);\n\n ListFoldersFeature.register(context.container);\n\n ListFolderLevelPermissionsTargetsFeature.register(context.container);\n\n GetFolderHierarchyFeature.register(context.container);\n\n GetAncestorsFeature.register(context.container);\n\n EnsureFolderIsEmptyFeature.register(context.container);\n\n /**\n * Register FLP use cases and event handlers\n */\n CreateFlpFeature.register(context.container, { context });\n UpdateFlpFeature.register(context.container, { context });\n DeleteFlpFeature.register(context.container, { context });\n ListFlpsFeature.register(context.container, flpCrudMethods);\n GetFlpFeature.register(context.container, flpCrudMethods);\n\n CreateFlpOnFolderCreatedFeature.register(context.container);\n\n UpdateFlpOnFolderUpdatedFeature.register(context.container, {\n tasks: context.tasks\n });\n\n DeleteFlpOnFolderDeletedFeature.register(context.container, {\n tasks: context.tasks\n });\n\n /**\n * Register folder event handlers\n */\n EnsureFolderIsEmptyOnDeleteFeature.register(context.container);\n EnsureHcmsFolderIsEmptyOnDeleteFeature.register(context.container);\n\n /**\n * Setup legacy context\n */\n const folderLevelPermissions = context.container.resolve(FolderLevelPermissions);\n\n context.aco = {\n filter: createFilterCrudMethods({\n container: context.container,\n getTenant,\n storageOperations,\n folderLevelPermissions\n }),\n flp: flpCrudMethods\n };\n\n if (context.wcp.canUseFolderLevelPermissions()) {\n CmsFlpFeature.register(context.container);\n }\n};\n\nexport const createAcoContext = (params: CreateAcoContextParams) => {\n const plugin = new ContextPlugin<AcoContext>(async context => {\n /**\n * We can skip the ACO initialization if the installation is pending.\n */\n if (!(await isHeadlessCmsReady(context))) {\n return;\n }\n\n await context.benchmark.measure(\"aco.context.setup\", async () => {\n await setupAcoContext(context, params);\n });\n });\n\n plugin.name = \"aco.createContext\";\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,aAAa;AAC3C,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7D,SAASC,0BAA0B;AAEnC,SAASC,uBAAuB;AAChC,SAASC,oBAAoB;AAC7B,SACIC,sBAAsB,EACtBC,6BAA6B;AAEjC,SAASC,mBAAmB;AAC5B,SAASC,mBAAmB;AAC5B,SAASC,mBAAmB;AAC5B,SAASC,gBAAgB;AACzB,SAASC,k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AC6B,SAAS,CAACC,OAAO,CAAC,mBAAmB,EAAE,YAAY;MAC7D,MAAM/B,eAAe,CAACC,OAAO,EAAE2B,MAAM,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC,CAAC;EAEFC,MAAM,CAACG,IAAI,GAAG,mBAAmB;EAEjC,OAAOH,MAAM;AACjB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ContextPlugin","isHeadlessCmsReady","createAcoStorageOperations","createFilterCrudMethods","createFlpCrudMethods","FolderLevelPermissions","FolderLevelPermissionsFeature","UpdateFolderFeature","DeleteFolderFeature","CreateFolderFeature","GetFolderFeature","ListFoldersFeature","GetFolderHierarchyFeature","GetAncestorsFeature","UpdateFlpOnFolderUpdatedFeature","DeleteFlpOnFolderDeletedFeature","EnsureHcmsFolderIsEmptyOnDeleteFeature","CreateFlpFeature","DeleteFlpFeature","UpdateFlpFeature","EnsureFolderIsEmptyOnDeleteFeature","FilterStorageOperations","ListFlpsFeature","GetFlpFeature","ListFolderLevelPermissionsTargetsFeature","CmsFlpFeature","GetModelUseCase","FolderModel","FolderModelAbstraction","CreateFlpOnFolderCreatedFeature","EnsureFolderIsEmptyFeature","FOLDER_MODEL_ID","FilterPrivateModel","setupAcoContext","context","setupAcoContextParams","tenancy","security","container","register","getModel","resolve","withoutAuthorization","folderModel","execute","registerInstance","value","getTenant","getCurrentTenant","storageOperations","cms","documentClient","flpCrudMethods","filter","folderLevelPermissions","aco","flp","wcp","canUseFolderLevelPermissions","createAcoContext","params","plugin","benchmark","measure","name"],"sources":["createAcoContext.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { isHeadlessCmsReady } from \"@webiny/api-headless-cms\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createAcoStorageOperations } from \"~/createAcoStorageOperations.js\";\nimport type { AcoContext } from \"~/types.js\";\nimport { createFilterCrudMethods } from \"~/filter/filter.crud.js\";\nimport { createFlpCrudMethods } from \"~/flp/index.js\";\nimport {\n FolderLevelPermissions,\n FolderLevelPermissionsFeature\n} from \"~/features/flp/FolderLevelPermissions/index.js\";\nimport { UpdateFolderFeature } from \"~/features/folder/UpdateFolder/index.js\";\nimport { DeleteFolderFeature } from \"~/features/folder/DeleteFolder/index.js\";\nimport { CreateFolderFeature } from \"~/features/folder/CreateFolder/index.js\";\nimport { GetFolderFeature } from \"~/features/folder/GetFolder/index.js\";\nimport { ListFoldersFeature } from \"~/features/folder/ListFolders/index.js\";\nimport { GetFolderHierarchyFeature } from \"~/features/folder/GetFolderHierarchy/index.js\";\nimport { GetAncestorsFeature } from \"~/features/folder/GetAncestors/index.js\";\nimport { UpdateFlpOnFolderUpdatedFeature } from \"~/features/flp/UpdateFlpOnFolderUpdated/index.js\";\nimport { DeleteFlpOnFolderDeletedFeature } from \"~/features/flp/DeleteFlpOnFolderDeleted/index.js\";\nimport { EnsureHcmsFolderIsEmptyOnDeleteFeature } from \"~/features/folder/EnsureHcmsFolderIsEmptyOnDelete/index.js\";\nimport { CreateFlpFeature } from \"~/features/flp/CreateFlp/index.js\";\nimport { DeleteFlpFeature } from \"~/features/flp/DeleteFlp/index.js\";\nimport { UpdateFlpFeature } from \"~/features/flp/UpdateFlp/index.js\";\nimport { EnsureFolderIsEmptyOnDeleteFeature } from \"~/features/folder/EnsureFolderIsEmptyOnDelete/index.js\";\nimport { FilterStorageOperations } from \"~/features/folder/shared/abstractions.js\";\nimport { ListFlpsFeature } from \"~/features/flp/ListFlps/feature.js\";\nimport { GetFlpFeature } from \"~/features/flp/GetFlp/feature.js\";\nimport { ListFolderLevelPermissionsTargetsFeature } from \"~/features/folder/ListFolderLevelPermissionsTargets/feature.js\";\nimport { Tenant } from \"@webiny/api-core/types/tenancy\";\nimport { CmsFlpFeature } from \"~/features/cms/index.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { FolderModel as FolderModelAbstraction } from \"~/domain/folder/abstractions.js\";\nimport { CreateFlpOnFolderCreatedFeature } from \"~/features/flp/CreateFlpOnFolderCreated/index.js\";\nimport { EnsureFolderIsEmptyFeature } from \"~/features/folder/EnsureFolderIsEmpty/feature.js\";\nimport { FOLDER_MODEL_ID, FolderModel } from \"~/domain/folder/folder.model.js\";\nimport { FilterPrivateModel } from \"~/filter/filter.model.js\";\n\ninterface CreateAcoContextParams {\n useFolderLevelPermissions?: boolean;\n documentClient: DynamoDBDocument;\n}\n\nconst setupAcoContext = async (\n context: AcoContext,\n setupAcoContextParams: CreateAcoContextParams\n): Promise<void> => {\n const { tenancy, security } = context;\n\n context.container.register(FolderModel);\n context.container.register(FilterPrivateModel);\n\n const getModel = context.container.resolve(GetModelUseCase);\n\n await context.security.withoutAuthorization(async () => {\n const folderModel = await getModel.execute(FOLDER_MODEL_ID);\n context.container.registerInstance(FolderModelAbstraction, folderModel.value);\n });\n\n const getTenant = (): Tenant => {\n return tenancy.getCurrentTenant();\n };\n\n const storageOperations = await createAcoStorageOperations({\n /**\n * TODO: We need to figure out a way to pass \"cms\" from outside (e.g. apps/api/graphql)\n */\n cms: context.cms,\n container: context.container,\n documentClient: setupAcoContextParams.documentClient,\n security\n });\n\n const flpCrudMethods = createFlpCrudMethods({\n getTenant,\n storageOperations\n });\n\n FolderLevelPermissionsFeature.register(context.container);\n\n /**\n * Register legacy dependencies via abstractions\n */\n context.container.registerInstance(FilterStorageOperations, storageOperations.filter);\n\n /**\n * Register folder features into DI container\n */\n CreateFolderFeature.register(context.container);\n\n UpdateFolderFeature.register(context.container);\n\n DeleteFolderFeature.register(context.container);\n\n GetFolderFeature.register(context.container);\n\n ListFoldersFeature.register(context.container);\n\n ListFolderLevelPermissionsTargetsFeature.register(context.container);\n\n GetFolderHierarchyFeature.register(context.container);\n\n GetAncestorsFeature.register(context.container);\n\n EnsureFolderIsEmptyFeature.register(context.container);\n\n /**\n * Register FLP use cases and event handlers\n */\n CreateFlpFeature.register(context.container, { context });\n UpdateFlpFeature.register(context.container, { context });\n DeleteFlpFeature.register(context.container, { context });\n ListFlpsFeature.register(context.container, flpCrudMethods);\n GetFlpFeature.register(context.container, flpCrudMethods);\n\n CreateFlpOnFolderCreatedFeature.register(context.container);\n\n UpdateFlpOnFolderUpdatedFeature.register(context.container);\n\n DeleteFlpOnFolderDeletedFeature.register(context.container);\n\n /**\n * Register folder event handlers\n */\n EnsureFolderIsEmptyOnDeleteFeature.register(context.container);\n EnsureHcmsFolderIsEmptyOnDeleteFeature.register(context.container);\n\n /**\n * Setup legacy context\n */\n const folderLevelPermissions = context.container.resolve(FolderLevelPermissions);\n\n context.aco = {\n filter: createFilterCrudMethods({\n container: context.container,\n getTenant,\n storageOperations,\n folderLevelPermissions\n }),\n flp: flpCrudMethods\n };\n\n if (context.wcp.canUseFolderLevelPermissions()) {\n CmsFlpFeature.register(context.container);\n }\n};\n\nexport const createAcoContext = (params: CreateAcoContextParams) => {\n const plugin = new ContextPlugin<AcoContext>(async context => {\n /**\n * We can skip the ACO initialization if the installation is pending.\n */\n if (!(await isHeadlessCmsReady(context))) {\n return;\n }\n\n await context.benchmark.measure(\"aco.context.setup\", async () => {\n await setupAcoContext(context, params);\n });\n });\n\n plugin.name = \"aco.createContext\";\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,aAAa;AAC3C,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7D,SAASC,0BAA0B;AAEnC,SAASC,uBAAuB;AAChC,SAASC,oBAAoB;AAC7B,SACIC,sBAAsB,EACtBC,6BAA6B;AAEjC,SAASC,mBAAmB;AAC5B,SAASC,mBAAmB;AAC5B,SAASC,mBAAmB;AAC5B,SAASC,gBAAgB;AACzB,SAASC,kBAAkB;AAC3B,SAASC,yBAAyB;AAClC,SAASC,mBAAmB;AAC5B,SAASC,+BAA+B;AACxC,SAASC,+BAA+B;AACxC,SAASC,sCAAsC;AAC/C,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AACzB,SAASC,kC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
import type { AcoContext } from "../../../types.js";
|
|
2
3
|
interface LegacyDeps {
|
|
3
4
|
context: AcoContext;
|
|
4
5
|
}
|
|
5
|
-
export declare const CreateFlpFeature:
|
|
6
|
+
export declare const CreateFlpFeature: {
|
|
7
|
+
name: string;
|
|
8
|
+
register(container: Container, context: LegacyDeps): void;
|
|
9
|
+
};
|
|
6
10
|
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
1
2
|
import type { AcoContext } from "../../../types.js";
|
|
2
3
|
interface LegacyDeps {
|
|
3
4
|
context: AcoContext;
|
|
4
5
|
}
|
|
5
|
-
export declare const DeleteFlpFeature:
|
|
6
|
+
export declare const DeleteFlpFeature: {
|
|
7
|
+
name: string;
|
|
8
|
+
register(container: Container, context: LegacyDeps): void;
|
|
9
|
+
};
|
|
6
10
|
export {};
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
2
|
+
export declare const FolderLevelPermissionsFeature: {
|
|
3
|
+
name: string;
|
|
4
|
+
register(container: Container): void;
|
|
5
|
+
};
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare const GetFlpFeature:
|
|
1
|
+
export declare const GetFlpFeature: {
|
|
2
|
+
name: string;
|
|
3
|
+
register(container: import("@webiny/di").Container, context: import("~/types.js").AcoFolderLevelPermissionsCrud): void;
|
|
4
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createFeature","GetFlpUseCase","UseCaseAbstraction","GetFlpFeature","name","register","container","context","registerFactory","get"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFlpUseCase } from \"./GetFlpUseCase.js\";\nimport { GetFlpUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { AcoContext } from \"~/types.js\";\n\nexport const GetFlpFeature = createFeature({\n name: \"GetFlpFeature\",\n register(container, context
|
|
1
|
+
{"version":3,"names":["createFeature","GetFlpUseCase","UseCaseAbstraction","GetFlpFeature","name","register","container","context","registerFactory","get"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFlpUseCase } from \"./GetFlpUseCase.js\";\nimport { GetFlpUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { AcoContext } from \"~/types.js\";\n\nexport const GetFlpFeature = createFeature<AcoContext[\"aco\"][\"flp\"]>({\n name: \"GetFlpFeature\",\n register(container, context) {\n container.registerFactory(UseCaseAbstraction, () => {\n return new GetFlpUseCase(context.get);\n });\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,aAAa;AACtB,SAASA,aAAa,IAAIC,kBAAkB;AAG5C,OAAO,MAAMC,aAAa,GAAGH,aAAa,CAA2B;EACjEI,IAAI,EAAE,eAAe;EACrBC,QAAQA,CAACC,SAAS,EAAEC,OAAO,EAAE;IACzBD,SAAS,CAACE,eAAe,CAACN,kBAAkB,EAAE,MAAM;MAChD,OAAO,IAAID,aAAa,CAACM,OAAO,CAACE,GAAG,CAAC;IACzC,CAAC,CAAC;EACN;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare const ListFlpsFeature:
|
|
1
|
+
export declare const ListFlpsFeature: {
|
|
2
|
+
name: string;
|
|
3
|
+
register(container: import("@webiny/di").Container, context: import("~/types.js").AcoFolderLevelPermissionsCrud): void;
|
|
4
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createFeature","ListFlpsUseCase","UseCaseAbstraction","ListFlpsFeature","name","register","container","context","registerFactory","list"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListFlpsUseCase } from \"./ListFlpsUseCase.js\";\nimport { ListFlpsUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { AcoContext } from \"~/types.js\";\n\nexport const ListFlpsFeature = createFeature({\n name: \"ListFlpsFeature\",\n register(container, context
|
|
1
|
+
{"version":3,"names":["createFeature","ListFlpsUseCase","UseCaseAbstraction","ListFlpsFeature","name","register","container","context","registerFactory","list"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListFlpsUseCase } from \"./ListFlpsUseCase.js\";\nimport { ListFlpsUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { AcoContext } from \"~/types.js\";\n\nexport const ListFlpsFeature = createFeature<AcoContext[\"aco\"][\"flp\"]>({\n name: \"ListFlpsFeature\",\n register(container, context) {\n container.registerFactory(UseCaseAbstraction, () => {\n return new ListFlpsUseCase(context.list);\n });\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,eAAe;AACxB,SAASA,eAAe,IAAIC,kBAAkB;AAG9C,OAAO,MAAMC,eAAe,GAAGH,aAAa,CAA2B;EACnEI,IAAI,EAAE,iBAAiB;EACvBC,QAAQA,CAACC,SAAS,EAAEC,OAAO,EAAE;IACzBD,SAAS,CAACE,eAAe,CAACN,kBAAkB,EAAE,MAAM;MAChD,OAAO,IAAID,eAAe,CAACM,OAAO,CAACE,IAAI,CAAC;IAC5C,CAAC,CAAC;EACN;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
1
2
|
import type { AcoContext } from "../../../types.js";
|
|
2
3
|
interface LegacyDeps {
|
|
3
4
|
context: AcoContext;
|
|
4
5
|
}
|
|
5
|
-
export declare const UpdateFlpFeature:
|
|
6
|
+
export declare const UpdateFlpFeature: {
|
|
7
|
+
name: string;
|
|
8
|
+
register(container: Container, context: LegacyDeps): void;
|
|
9
|
+
};
|
|
6
10
|
export {};
|
|
@@ -4,4 +4,7 @@
|
|
|
4
4
|
* Actual content cannot be checked, as folders do not have information about their records.
|
|
5
5
|
* Individual apps (like File Manager, Headless CMS, etc.) need to implement their own event handlers.
|
|
6
6
|
*/
|
|
7
|
-
export declare const EnsureFolderIsEmptyOnDeleteFeature:
|
|
7
|
+
export declare const EnsureFolderIsEmptyOnDeleteFeature: {
|
|
8
|
+
name: string;
|
|
9
|
+
register(container: import("@webiny/di").Container): void;
|
|
10
|
+
};
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare const EnsureHcmsFolderIsEmptyOnDeleteFeature:
|
|
1
|
+
export declare const EnsureHcmsFolderIsEmptyOnDeleteFeature: {
|
|
2
|
+
name: string;
|
|
3
|
+
register(container: import("@webiny/di").Container): void;
|
|
4
|
+
};
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
2
|
+
export declare const GetFolderHierarchyFeature: {
|
|
3
|
+
name: string;
|
|
4
|
+
register(container: Container): void;
|
|
5
|
+
};
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare const ListFolderLevelPermissionsTargetsFeature:
|
|
1
|
+
export declare const ListFolderLevelPermissionsTargetsFeature: {
|
|
2
|
+
name: string;
|
|
3
|
+
register(container: import("@webiny/di").Container): void;
|
|
4
|
+
};
|
package/flp/flp.so.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createStandardEntity","createTable","WebinyError","executeWithRetry","FolderLevelPermissionsStorageOperations","constructor","documentClient","table","name","String","process","env","DB_TABLE","entity","list","where","tenant","type","path_startsWith","parentId","entries","queryAll","partitionKey","options","index","eq","map","entry","data","beginsWith","err","from","message","code","get","id","createKeys","create","keys","createGsiKeys","put","update","inputData","original","delete","flp","batchUpdate","items","batch","createEntityWriter","updatedItems","push","execute","PK","SK","TYPE","path","GSI1_PK","GSI1_SK","GSI2_PK","GSI2_SK","GSI_TENANT","createFlpOperations","params"],"sources":["flp.so.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createStandardEntity, createTable } from \"@webiny/db-dynamodb\";\n\nimport { WebinyError } from \"@webiny/error\";\nimport type {\n AcoFolderLevelPermissionsStorageOperations as IAcoFolderLevelPermissionsStorageOperations,\n FolderLevelPermission,\n StorageOperationsBatchUpdateFlpParams,\n StorageOperationsCreateFlpParams,\n StorageOperationsDeleteFlpParams,\n StorageOperationsGetFlpParams,\n StorageOperationsListFlpsParams,\n StorageOperationsUpdateFlpParams\n} from \"~/flp/flp.types.js\";\nimport { executeWithRetry } from \"@webiny/utils\";\n\ninterface StorageOperationsConfig {\n documentClient: DynamoDBDocument;\n}\n\ninterface CreateKeysParams {\n tenant: string;\n id: string;\n}\n\ninterface CreateGsiKeysParams {\n tenant: string;\n id: string;\n type: string;\n path: string;\n parentId: string;\n}\n\nclass FolderLevelPermissionsStorageOperations\n implements IAcoFolderLevelPermissionsStorageOperations\n{\n private readonly entity;\n private readonly table;\n\n constructor({ documentClient }: StorageOperationsConfig) {\n this.table = createTable({\n name: String(process.env.DB_TABLE),\n documentClient\n });\n\n this.entity = createStandardEntity<FolderLevelPermission>({\n table: this.table.table,\n name: \"ACO.flp\"\n });\n }\n\n public async list({\n where: { tenant, type, path_startsWith, parentId }\n }: StorageOperationsListFlpsParams): Promise<FolderLevelPermission[]> {\n try {\n if (parentId) {\n const entries = await this.entity.queryAll({\n partitionKey: `T#${tenant}#FLP`,\n options: {\n index: \"GSI2\",\n eq: parentId\n }\n });\n return entries.map(entry => entry.data);\n }\n\n if (path_startsWith) {\n const entries = await this.entity.queryAll({\n partitionKey: `T#${tenant}#AT#${type}#FLP`,\n options: {\n index: \"GSI1\",\n beginsWith: path_startsWith\n }\n });\n return entries.map(entry => entry.data);\n }\n\n throw new WebinyError(\"Missing required parameters.\", \"LIST_FLP_MISSING_PARAMETERS\", {\n tenant,\n type,\n path_startsWith,\n parentId\n });\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not list folder level permissions.\",\n code: \"LIST_FLP_ERROR\"\n });\n }\n }\n\n public async get({\n tenant,\n id\n }: StorageOperationsGetFlpParams): Promise<FolderLevelPermission | null> {\n try {\n const entry = await this.entity.get(this.createKeys({ tenant, id }));\n\n if (!entry) {\n return null;\n }\n\n return entry.data;\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not load folder level permission.\",\n code: \"GET_FLP_ERROR\",\n data: { tenant, id }\n });\n }\n }\n\n public async create({\n data\n }: StorageOperationsCreateFlpParams): Promise<FolderLevelPermission> {\n const keys = {\n ...this.createKeys(data),\n ...this.createGsiKeys(data)\n };\n\n try {\n await this.entity.put({\n ...keys,\n data\n });\n\n return data;\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not create folder level permission.\",\n code: \"CREATE_FLP_ERROR\",\n data: { keys, data }\n });\n }\n }\n\n public async update({\n data: inputData,\n original\n }: StorageOperationsUpdateFlpParams): Promise<FolderLevelPermission> {\n try {\n const data = {\n ...original,\n ...inputData\n };\n\n const keys = {\n ...this.createKeys(data),\n ...this.createGsiKeys(data)\n };\n\n await this.entity.put({\n ...keys,\n data\n });\n\n return data;\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not update folder level permission.\",\n code: \"UPDATE_FLP_ERROR\",\n data: { inputData, original }\n });\n }\n }\n\n public async delete({ flp }: StorageOperationsDeleteFlpParams): Promise<void> {\n const keys = this.createKeys(flp);\n\n try {\n await this.entity.delete(keys);\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not delete folder level permission.\",\n code: \"DELETE_FLP_ERROR\",\n data: {\n keys,\n flp\n }\n });\n }\n }\n\n public async batchUpdate({\n items\n }: StorageOperationsBatchUpdateFlpParams): Promise<FolderLevelPermission[]> {\n try {\n const batch = this.entity.createEntityWriter();\n\n const updatedItems: FolderLevelPermission[] = [];\n\n for (const { original, data: inputData } of items) {\n const data = {\n ...original,\n ...inputData\n };\n\n const keys = {\n ...this.createKeys(data),\n ...this.createGsiKeys(data)\n };\n\n batch.put({\n ...keys,\n data\n });\n\n updatedItems.push(data);\n }\n\n await executeWithRetry(async () => {\n return await batch.execute();\n });\n\n return updatedItems;\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not batch update folder level permissions.\",\n code: \"BATCH_UPDATE_FLP_ERROR\",\n data: { items }\n });\n }\n }\n\n private createKeys({ id, tenant }: CreateKeysParams) {\n return {\n PK: `T#${tenant}#FLP#${id}`,\n SK: `A`,\n TYPE: \"aco.flp\"\n };\n }\n\n private createGsiKeys({ tenant, type, path, parentId }: CreateGsiKeysParams) {\n return {\n GSI1_PK: `T#${tenant}#AT#${type}#FLP`,\n GSI1_SK: path,\n GSI2_PK: `T#${tenant}#FLP`,\n GSI2_SK: parentId,\n GSI_TENANT: tenant\n };\n }\n}\n\nexport const createFlpOperations = (params: StorageOperationsConfig) => {\n return new FolderLevelPermissionsStorageOperations(params);\n};\n"],"mappings":"AACA,SAASA,oBAAoB,EAAEC,WAAW,QAAQ,qBAAqB;AAEvE,SAASC,WAAW,QAAQ,eAAe;AAW3C,SAASC,gBAAgB,QAAQ,eAAe;AAmBhD,MAAMC,uCAAuC,CAE7C;EAIIC,WAAWA,CAAC;IAAEC;EAAwC,CAAC,EAAE;IACrD,IAAI,CAACC,KAAK,GAAGN,WAAW,CAAC;MACrBO,IAAI,EAAEC,MAAM,CAACC,OAAO,CAACC,GAAG,CAACC,QAAQ,CAAC;MAClCN;IACJ,CAAC,CAAC;IAEF,IAAI,CAACO,MAAM,GAAGb,oBAAoB,CAAwB;MACtDO,KAAK,EAAE,IAAI,CAACA,KAAK,CAACA,KAAK;MACvBC,IAAI,EAAE;IACV,CAAC,CAAC;EACN;EAEA,MAAaM,IAAIA,CAAC;IACdC,KAAK,EAAE;MAAEC,MAAM;MAAEC,IAAI;MAAEC,eAAe;MAAEC;IAAS;EACpB,CAAC,EAAoC;IAClE,IAAI;MACA,IAAIA,QAAQ,EAAE;QACV,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACP,MAAM,CAACQ,QAAQ,CAAC;UACvCC,YAAY,EAAE,KAAKN,MAAM,MAAM;UAC/BO,OAAO,EAAE;YACLC,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,CAAC,CAAC;IACN;EACJ;EAEQX,UAAUA,CAAC;IAAED,EAAE;IAAEnB;EAAyB,CAAC,EAAE;IACjD,OAAO;MACHqC,EAAE,EAAE,KAAKrC,MAAM,QAAQmB,EAAE,EAAE;MAC3BmB,EAAE,EAAE,GAAG;MACPC,IAAI,EAAE;IACV,CAAC;EACL;EAEQhB,aAAaA,CAAC;IAAEvB,MAAM;IAAEC,IAAI;IAAEuC,IAAI;IAAErC;EAA8B,CAAC,EAAE;IACzE,OAAO;MACHsC,OAAO,EAAE,KAAKzC,MAAM,OAAOC,IAAI,MAAM;MACrCyC,OAAO,EAAEF,IAAI;MACbG,OAAO,EAAE,KAAK3C,MAAM,MAAM;MAC1B4C,OAAO,EAAEzC,QAAQ;MACjB0C,UAAU,EAAE7C;IAChB,CAAC;EACL;AACJ;AAEA,OAAO,MAAM8C,mBAAmB,GAAIC,MAA+B,IAAK;EACpE,OAAO,IAAI3D,uCAAuC,CAAC2D,MAAM,CAAC;AAC9D,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["createStandardEntity","createTable","WebinyError","executeWithRetry","FolderLevelPermissionsStorageOperations","constructor","documentClient","table","name","String","process","env","DB_TABLE","entity","list","where","tenant","type","path_startsWith","parentId","entries","queryAll","partitionKey","options","index","eq","map","entry","data","beginsWith","err","from","message","code","get","id","createKeys","create","keys","createGsiKeys","put","update","inputData","original","delete","flp","batchUpdate","items","batch","createEntityWriter","updatedItems","push","execute","PK","SK","TYPE","path","GSI1_PK","GSI1_SK","GSI2_PK","GSI2_SK","GSI_TENANT","createFlpOperations","params"],"sources":["flp.so.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createStandardEntity, createTable } from \"@webiny/db-dynamodb\";\n\nimport { WebinyError } from \"@webiny/error\";\nimport type {\n AcoFolderLevelPermissionsStorageOperations as IAcoFolderLevelPermissionsStorageOperations,\n FolderLevelPermission,\n StorageOperationsBatchUpdateFlpParams,\n StorageOperationsCreateFlpParams,\n StorageOperationsDeleteFlpParams,\n StorageOperationsGetFlpParams,\n StorageOperationsListFlpsParams,\n StorageOperationsUpdateFlpParams\n} from \"~/flp/flp.types.js\";\nimport { executeWithRetry } from \"@webiny/utils\";\n\ninterface StorageOperationsConfig {\n documentClient: DynamoDBDocument;\n}\n\ninterface CreateKeysParams {\n tenant: string;\n id: string;\n}\n\ninterface CreateGsiKeysParams {\n tenant: string;\n id: string;\n type: string;\n path: string;\n parentId: string;\n}\n\nclass FolderLevelPermissionsStorageOperations implements IAcoFolderLevelPermissionsStorageOperations {\n private readonly entity;\n private readonly table;\n\n constructor({ documentClient }: StorageOperationsConfig) {\n this.table = createTable({\n name: String(process.env.DB_TABLE),\n documentClient\n });\n\n this.entity = createStandardEntity<FolderLevelPermission>({\n table: this.table.table,\n name: \"ACO.flp\"\n });\n }\n\n public async list({\n where: { tenant, type, path_startsWith, parentId }\n }: StorageOperationsListFlpsParams): Promise<FolderLevelPermission[]> {\n try {\n if (parentId) {\n const entries = await this.entity.queryAll({\n partitionKey: `T#${tenant}#FLP`,\n options: {\n index: \"GSI2\",\n eq: parentId\n }\n });\n return entries.map(entry => entry.data);\n }\n\n if (path_startsWith) {\n const entries = await this.entity.queryAll({\n partitionKey: `T#${tenant}#AT#${type}#FLP`,\n options: {\n index: \"GSI1\",\n beginsWith: path_startsWith\n }\n });\n return entries.map(entry => entry.data);\n }\n\n throw new WebinyError(\"Missing required parameters.\", \"LIST_FLP_MISSING_PARAMETERS\", {\n tenant,\n type,\n path_startsWith,\n parentId\n });\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not list folder level permissions.\",\n code: \"LIST_FLP_ERROR\"\n });\n }\n }\n\n public async get({\n tenant,\n id\n }: StorageOperationsGetFlpParams): Promise<FolderLevelPermission | null> {\n try {\n const entry = await this.entity.get(this.createKeys({ tenant, id }));\n\n if (!entry) {\n return null;\n }\n\n return entry.data;\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not load folder level permission.\",\n code: \"GET_FLP_ERROR\",\n data: { tenant, id }\n });\n }\n }\n\n public async create({\n data\n }: StorageOperationsCreateFlpParams): Promise<FolderLevelPermission> {\n const keys = {\n ...this.createKeys(data),\n ...this.createGsiKeys(data)\n };\n\n try {\n await this.entity.put({\n ...keys,\n data\n });\n\n return data;\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not create folder level permission.\",\n code: \"CREATE_FLP_ERROR\",\n data: { keys, data }\n });\n }\n }\n\n public async update({\n data: inputData,\n original\n }: StorageOperationsUpdateFlpParams): Promise<FolderLevelPermission> {\n try {\n const data = {\n ...original,\n ...inputData\n };\n\n const keys = {\n ...this.createKeys(data),\n ...this.createGsiKeys(data)\n };\n\n await this.entity.put({\n ...keys,\n data\n });\n\n return data;\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not update folder level permission.\",\n code: \"UPDATE_FLP_ERROR\",\n data: { inputData, original }\n });\n }\n }\n\n public async delete({ flp }: StorageOperationsDeleteFlpParams): Promise<void> {\n const keys = this.createKeys(flp);\n\n try {\n await this.entity.delete(keys);\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not delete folder level permission.\",\n code: \"DELETE_FLP_ERROR\",\n data: {\n keys,\n flp\n }\n });\n }\n }\n\n public async batchUpdate({\n items\n }: StorageOperationsBatchUpdateFlpParams): Promise<FolderLevelPermission[]> {\n try {\n const batch = this.entity.createEntityWriter();\n\n const updatedItems: FolderLevelPermission[] = [];\n\n for (const { original, data: inputData } of items) {\n const data = {\n ...original,\n ...inputData\n };\n\n const keys = {\n ...this.createKeys(data),\n ...this.createGsiKeys(data)\n };\n\n batch.put({\n ...keys,\n data\n });\n\n updatedItems.push(data);\n }\n\n await executeWithRetry(async () => {\n return await batch.execute();\n });\n\n return updatedItems;\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not batch update folder level permissions.\",\n code: \"BATCH_UPDATE_FLP_ERROR\",\n data: { items }\n });\n }\n }\n\n private createKeys({ id, tenant }: CreateKeysParams) {\n return {\n PK: `T#${tenant}#FLP#${id}`,\n SK: `A`,\n TYPE: \"aco.flp\"\n };\n }\n\n private createGsiKeys({ tenant, type, path, parentId }: CreateGsiKeysParams) {\n return {\n GSI1_PK: `T#${tenant}#AT#${type}#FLP`,\n GSI1_SK: path,\n GSI2_PK: `T#${tenant}#FLP`,\n GSI2_SK: parentId,\n GSI_TENANT: tenant\n };\n }\n}\n\nexport const createFlpOperations = (params: StorageOperationsConfig) => {\n return new FolderLevelPermissionsStorageOperations(params);\n};\n"],"mappings":"AACA,SAASA,oBAAoB,EAAEC,WAAW,QAAQ,qBAAqB;AAEvE,SAASC,WAAW,QAAQ,eAAe;AAW3C,SAASC,gBAAgB,QAAQ,eAAe;AAmBhD,MAAMC,uCAAuC,CAAwD;EAIjGC,WAAWA,CAAC;IAAEC;EAAwC,CAAC,EAAE;IACrD,IAAI,CAACC,KAAK,GAAGN,WAAW,CAAC;MACrBO,IAAI,EAAEC,MAAM,CAACC,OAAO,CAACC,GAAG,CAACC,QAAQ,CAAC;MAClCN;IACJ,CAAC,CAAC;IAEF,IAAI,CAACO,MAAM,GAAGb,oBAAoB,CAAwB;MACtDO,KAAK,EAAE,IAAI,CAACA,KAAK,CAACA,KAAK;MACvBC,IAAI,EAAE;IACV,CAAC,CAAC;EACN;EAEA,MAAaM,IAAIA,CAAC;IACdC,KAAK,EAAE;MAAEC,MAAM;MAAEC,IAAI;MAAEC,eAAe;MAAEC;IAAS;EACpB,CAAC,EAAoC;IAClE,IAAI;MACA,IAAIA,QAAQ,EAAE;QACV,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACP,MAAM,CAACQ,QAAQ,CAAC;UACvCC,YAAY,EAAE,KAAKN,MAAM,MAAM;UAC/BO,OAAO,EAAE;YACLC,KAAK,EAAE,MAAM;YACbC,EAAE,EAAEN;UACR;QACJ,CAAC,CAAC;QACF,OAAOC,OAAO,CAACM,GAAG,CAACC,KAAK,IAAIA,KAAK,CAACC,IA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MAAM,QAAQmB,EAAE,EAAE;MAC3BmB,EAAE,EAAE,GAAG;MACPC,IAAI,EAAE;IACV,CAAC;EACL;EAEQhB,aAAaA,CAAC;IAAEvB,MAAM;IAAEC,IAAI;IAAEuC,IAAI;IAAErC;EAA8B,CAAC,EAAE;IACzE,OAAO;MACHsC,OAAO,EAAE,KAAKzC,MAAM,OAAOC,IAAI,MAAM;MACrCyC,OAAO,EAAEF,IAAI;MACbG,OAAO,EAAE,KAAK3C,MAAM,MAAM;MAC1B4C,OAAO,EAAEzC,QAAQ;MACjB0C,UAAU,EAAE7C;IAChB,CAAC;EACL;AACJ;AAEA,OAAO,MAAM8C,mBAAmB,GAAIC,MAA+B,IAAK;EACpE,OAAO,IAAI3D,uCAAuC,CAAC2D,MAAM,CAAC;AAC9D,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-aco",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -23,35 +23,34 @@
|
|
|
23
23
|
".": "./index.js"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@webiny/api": "6.
|
|
27
|
-
"@webiny/api-core": "6.
|
|
28
|
-
"@webiny/api-headless-cms": "6.
|
|
29
|
-
"@webiny/aws-sdk": "6.
|
|
30
|
-
"@webiny/db-dynamodb": "6.
|
|
26
|
+
"@webiny/api": "6.3.0-beta.1",
|
|
27
|
+
"@webiny/api-core": "6.3.0-beta.1",
|
|
28
|
+
"@webiny/api-headless-cms": "6.3.0-beta.1",
|
|
29
|
+
"@webiny/aws-sdk": "6.3.0-beta.1",
|
|
30
|
+
"@webiny/db-dynamodb": "6.3.0-beta.1",
|
|
31
31
|
"@webiny/di": "0.2.3",
|
|
32
|
-
"@webiny/error": "6.
|
|
33
|
-
"@webiny/feature": "6.
|
|
34
|
-
"@webiny/handler": "6.
|
|
35
|
-
"@webiny/handler-graphql": "6.
|
|
36
|
-
"@webiny/shared-aco": "6.
|
|
37
|
-
"@webiny/tasks": "6.
|
|
38
|
-
"@webiny/utils": "6.
|
|
39
|
-
"@webiny/validation": "6.
|
|
32
|
+
"@webiny/error": "6.3.0-beta.1",
|
|
33
|
+
"@webiny/feature": "6.3.0-beta.1",
|
|
34
|
+
"@webiny/handler": "6.3.0-beta.1",
|
|
35
|
+
"@webiny/handler-graphql": "6.3.0-beta.1",
|
|
36
|
+
"@webiny/shared-aco": "6.3.0-beta.1",
|
|
37
|
+
"@webiny/tasks": "6.3.0-beta.1",
|
|
38
|
+
"@webiny/utils": "6.3.0-beta.1",
|
|
39
|
+
"@webiny/validation": "6.3.0-beta.1",
|
|
40
40
|
"lodash": "4.18.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@webiny/api-core-ddb": "6.
|
|
44
|
-
"@webiny/api-file-manager": "6.
|
|
45
|
-
"@webiny/build-tools": "6.
|
|
46
|
-
"@webiny/handler-aws": "6.
|
|
47
|
-
"@webiny/plugins": "6.
|
|
48
|
-
"@webiny/project-utils": "6.
|
|
49
|
-
"@webiny/wcp": "6.
|
|
43
|
+
"@webiny/api-core-ddb": "6.3.0-beta.1",
|
|
44
|
+
"@webiny/api-file-manager": "6.3.0-beta.1",
|
|
45
|
+
"@webiny/build-tools": "6.3.0-beta.1",
|
|
46
|
+
"@webiny/handler-aws": "6.3.0-beta.1",
|
|
47
|
+
"@webiny/plugins": "6.3.0-beta.1",
|
|
48
|
+
"@webiny/project-utils": "6.3.0-beta.1",
|
|
49
|
+
"@webiny/wcp": "6.3.0-beta.1",
|
|
50
50
|
"graphql": "16.13.2",
|
|
51
|
-
"prettier": "3.6.2",
|
|
52
51
|
"rimraf": "6.1.3",
|
|
53
|
-
"typescript": "
|
|
52
|
+
"typescript": "6.0.3",
|
|
54
53
|
"vitest": "4.1.4"
|
|
55
54
|
},
|
|
56
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "664b273a9f0a971f9ca7e6ffe920db77fefdced1"
|
|
57
56
|
}
|