@webiny/app-headless-cms 6.1.0-beta.3 → 6.2.0-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/HeadlessCMS.js +5 -2
- package/HeadlessCMS.js.map +1 -1
- package/admin/components/ContentEntryForm/Header/Header.js +3 -6
- package/admin/components/ContentEntryForm/Header/Header.js.map +1 -1
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.js +1 -1
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.js.map +1 -1
- package/admin/contexts/Cms/index.js +32 -2
- package/admin/contexts/Cms/index.js.map +1 -1
- package/admin/hooks/usePermission.js +132 -125
- package/admin/hooks/usePermission.js.map +1 -1
- package/admin/plugins/apiInformation/index.js +3 -3
- package/admin/plugins/apiInformation/index.js.map +1 -1
- package/admin/plugins/apiInformation/placeholder.manage.graphql.d.ts +1 -0
- package/admin/plugins/apiInformation/placeholder.manage.graphql.js +22 -0
- package/admin/plugins/apiInformation/placeholder.manage.graphql.js.map +1 -0
- package/admin/plugins/apiInformation/placeholder.preview.graphql.d.ts +1 -0
- package/admin/plugins/apiInformation/placeholder.preview.graphql.js +19 -0
- package/admin/plugins/apiInformation/placeholder.preview.graphql.js.map +1 -0
- package/admin/plugins/apiInformation/placeholder.read.graphql.d.ts +1 -0
- package/admin/plugins/apiInformation/placeholder.read.graphql.js +20 -0
- package/admin/plugins/apiInformation/placeholder.read.graphql.js.map +1 -0
- package/admin/views/contentEntries/ContentEntriesContext.js +5 -15
- package/admin/views/contentEntries/ContentEntriesContext.js.map +1 -1
- package/admin/views/contentEntries/ContentEntriesModule.js +20 -14
- package/admin/views/contentEntries/ContentEntriesModule.js.map +1 -1
- package/admin/views/contentModels/ContentModelsDataList.js +103 -88
- package/admin/views/contentModels/ContentModelsDataList.js.map +1 -1
- package/domain/permissionsSchema.d.ts +31 -0
- package/domain/permissionsSchema.js +34 -0
- package/domain/permissionsSchema.js.map +1 -0
- package/exports/admin/cms.d.ts +3 -0
- package/exports/admin/cms.js +4 -0
- package/exports/admin/cms.js.map +1 -1
- package/features/ListCache.d.ts +29 -0
- package/features/ListCache.js +43 -0
- package/features/ListCache.js.map +1 -0
- package/features/contentEntry/events/EntryAfterCreateEvent.d.ts +10 -0
- package/features/contentEntry/events/EntryAfterCreateEvent.js +10 -0
- package/features/contentEntry/events/EntryAfterCreateEvent.js.map +1 -0
- package/features/contentEntry/events/EntryAfterDeleteEvent.d.ts +11 -0
- package/features/contentEntry/events/EntryAfterDeleteEvent.js +10 -0
- package/features/contentEntry/events/EntryAfterDeleteEvent.js.map +1 -0
- package/features/contentEntry/events/EntryAfterUpdateEvent.d.ts +10 -0
- package/features/contentEntry/events/EntryAfterUpdateEvent.js +10 -0
- package/features/contentEntry/events/EntryAfterUpdateEvent.js.map +1 -0
- package/features/contentEntry/events/abstractions.d.ts +19 -0
- package/features/contentEntry/events/abstractions.js +6 -0
- package/features/contentEntry/events/abstractions.js.map +1 -0
- package/features/contentEntry/events/index.d.ts +7 -0
- package/features/contentEntry/events/index.js +6 -0
- package/features/contentEntry/events/index.js.map +1 -0
- package/features/graphQLClient/CmsGraphQLClient.d.ts +13 -0
- package/features/graphQLClient/CmsGraphQLClient.js +21 -0
- package/features/graphQLClient/CmsGraphQLClient.js.map +1 -0
- package/features/graphQLClient/abstractions.d.ts +17 -0
- package/features/graphQLClient/abstractions.js +4 -0
- package/features/graphQLClient/abstractions.js.map +1 -0
- package/features/graphQLClient/feature.d.ts +3 -0
- package/features/graphQLClient/feature.js +16 -0
- package/features/graphQLClient/feature.js.map +1 -0
- package/features/graphQLClient/index.d.ts +1 -0
- package/features/graphQLClient/index.js +3 -0
- package/features/graphQLClient/index.js.map +1 -0
- package/features/modelGroup/abstractions.d.ts +6 -0
- package/features/modelGroup/abstractions.js +4 -0
- package/features/modelGroup/abstractions.js.map +1 -0
- package/features/modelGroup/createModelGroup/CreateModelGroupGateway.d.ts +23 -0
- package/features/modelGroup/createModelGroup/CreateModelGroupGateway.js +59 -0
- package/features/modelGroup/createModelGroup/CreateModelGroupGateway.js.map +1 -0
- package/features/modelGroup/createModelGroup/CreateModelGroupRepository.d.ts +13 -0
- package/features/modelGroup/createModelGroup/CreateModelGroupRepository.js +19 -0
- package/features/modelGroup/createModelGroup/CreateModelGroupRepository.js.map +1 -0
- package/features/modelGroup/createModelGroup/CreateModelGroupUseCase.d.ts +10 -0
- package/features/modelGroup/createModelGroup/CreateModelGroupUseCase.js +15 -0
- package/features/modelGroup/createModelGroup/CreateModelGroupUseCase.js.map +1 -0
- package/features/modelGroup/createModelGroup/abstractions.d.ts +29 -0
- package/features/modelGroup/createModelGroup/abstractions.js +15 -0
- package/features/modelGroup/createModelGroup/abstractions.js.map +1 -0
- package/features/modelGroup/createModelGroup/feature.d.ts +3 -0
- package/features/modelGroup/createModelGroup/feature.js +20 -0
- package/features/modelGroup/createModelGroup/feature.js.map +1 -0
- package/features/modelGroup/deleteModelGroup/DeleteModelGroupGateway.d.ts +21 -0
- package/features/modelGroup/deleteModelGroup/DeleteModelGroupGateway.js +41 -0
- package/features/modelGroup/deleteModelGroup/DeleteModelGroupGateway.js.map +1 -0
- package/features/modelGroup/deleteModelGroup/DeleteModelGroupRepository.d.ts +12 -0
- package/features/modelGroup/deleteModelGroup/DeleteModelGroupRepository.js +18 -0
- package/features/modelGroup/deleteModelGroup/DeleteModelGroupRepository.js.map +1 -0
- package/features/modelGroup/deleteModelGroup/DeleteModelGroupUseCase.d.ts +10 -0
- package/features/modelGroup/deleteModelGroup/DeleteModelGroupUseCase.js +15 -0
- package/features/modelGroup/deleteModelGroup/DeleteModelGroupUseCase.js.map +1 -0
- package/features/modelGroup/deleteModelGroup/abstractions.d.ts +21 -0
- package/features/modelGroup/deleteModelGroup/abstractions.js +15 -0
- package/features/modelGroup/deleteModelGroup/abstractions.js.map +1 -0
- package/features/modelGroup/deleteModelGroup/feature.d.ts +3 -0
- package/features/modelGroup/deleteModelGroup/feature.js +20 -0
- package/features/modelGroup/deleteModelGroup/feature.js.map +1 -0
- package/features/modelGroup/feature.d.ts +1 -0
- package/features/modelGroup/feature.js +21 -0
- package/features/modelGroup/feature.js.map +1 -0
- package/features/modelGroup/getModelGroup/GetModelGroupGateway.d.ts +22 -0
- package/features/modelGroup/getModelGroup/GetModelGroupGateway.js +55 -0
- package/features/modelGroup/getModelGroup/GetModelGroupGateway.js.map +1 -0
- package/features/modelGroup/getModelGroup/GetModelGroupRepository.d.ts +12 -0
- package/features/modelGroup/getModelGroup/GetModelGroupRepository.js +19 -0
- package/features/modelGroup/getModelGroup/GetModelGroupRepository.js.map +1 -0
- package/features/modelGroup/getModelGroup/GetModelGroupUseCase.d.ts +10 -0
- package/features/modelGroup/getModelGroup/GetModelGroupUseCase.js +15 -0
- package/features/modelGroup/getModelGroup/GetModelGroupUseCase.js.map +1 -0
- package/features/modelGroup/getModelGroup/abstractions.d.ts +22 -0
- package/features/modelGroup/getModelGroup/abstractions.js +15 -0
- package/features/modelGroup/getModelGroup/abstractions.js.map +1 -0
- package/features/modelGroup/getModelGroup/feature.d.ts +3 -0
- package/features/modelGroup/getModelGroup/feature.js +20 -0
- package/features/modelGroup/getModelGroup/feature.js.map +1 -0
- package/features/modelGroup/listModelGroups/ListModelGroupsGateway.d.ts +19 -0
- package/features/modelGroup/listModelGroups/ListModelGroupsGateway.js +56 -0
- package/features/modelGroup/listModelGroups/ListModelGroupsGateway.js.map +1 -0
- package/features/modelGroup/listModelGroups/ListModelGroupsRepository.d.ts +12 -0
- package/features/modelGroup/listModelGroups/ListModelGroupsRepository.js +23 -0
- package/features/modelGroup/listModelGroups/ListModelGroupsRepository.js.map +1 -0
- package/features/modelGroup/listModelGroups/ListModelGroupsUseCase.d.ts +10 -0
- package/features/modelGroup/listModelGroups/ListModelGroupsUseCase.js +15 -0
- package/features/modelGroup/listModelGroups/ListModelGroupsUseCase.js.map +1 -0
- package/features/modelGroup/listModelGroups/abstractions.d.ts +39 -0
- package/features/modelGroup/listModelGroups/abstractions.js +15 -0
- package/features/modelGroup/listModelGroups/abstractions.js.map +1 -0
- package/features/modelGroup/listModelGroups/feature.d.ts +3 -0
- package/features/modelGroup/listModelGroups/feature.js +20 -0
- package/features/modelGroup/listModelGroups/feature.js.map +1 -0
- package/features/modelGroup/updateModelGroup/UpdateModelGroupGateway.d.ts +24 -0
- package/features/modelGroup/updateModelGroup/UpdateModelGroupGateway.js +56 -0
- package/features/modelGroup/updateModelGroup/UpdateModelGroupGateway.js.map +1 -0
- package/features/modelGroup/updateModelGroup/UpdateModelGroupRepository.d.ts +13 -0
- package/features/modelGroup/updateModelGroup/UpdateModelGroupRepository.js +31 -0
- package/features/modelGroup/updateModelGroup/UpdateModelGroupRepository.js.map +1 -0
- package/features/modelGroup/updateModelGroup/UpdateModelGroupUseCase.d.ts +10 -0
- package/features/modelGroup/updateModelGroup/UpdateModelGroupUseCase.js +15 -0
- package/features/modelGroup/updateModelGroup/UpdateModelGroupUseCase.js.map +1 -0
- package/features/modelGroup/updateModelGroup/abstractions.d.ts +30 -0
- package/features/modelGroup/updateModelGroup/abstractions.js +15 -0
- package/features/modelGroup/updateModelGroup/abstractions.js.map +1 -0
- package/features/modelGroup/updateModelGroup/feature.d.ts +3 -0
- package/features/modelGroup/updateModelGroup/feature.js +20 -0
- package/features/modelGroup/updateModelGroup/feature.js.map +1 -0
- package/features/permissions/abstractions.d.ts +17 -0
- package/features/permissions/abstractions.js +5 -0
- package/features/permissions/abstractions.js.map +1 -0
- package/features/permissions/feature.d.ts +14 -0
- package/features/permissions/feature.js +6 -0
- package/features/permissions/feature.js.map +1 -0
- package/package.json +29 -30
- package/presentation/modelGroup/hooks/index.d.ts +5 -0
- package/presentation/modelGroup/hooks/index.js +7 -0
- package/presentation/modelGroup/hooks/index.js.map +1 -0
- package/presentation/modelGroup/hooks/useCreateModelGroup.d.ts +4 -0
- package/presentation/modelGroup/hooks/useCreateModelGroup.js +12 -0
- package/presentation/modelGroup/hooks/useCreateModelGroup.js.map +1 -0
- package/presentation/modelGroup/hooks/useDeleteModelGroup.d.ts +3 -0
- package/presentation/modelGroup/hooks/useDeleteModelGroup.js +12 -0
- package/presentation/modelGroup/hooks/useDeleteModelGroup.js.map +1 -0
- package/presentation/modelGroup/hooks/useGetModelGroup.d.ts +3 -0
- package/presentation/modelGroup/hooks/useGetModelGroup.js +12 -0
- package/presentation/modelGroup/hooks/useGetModelGroup.js.map +1 -0
- package/presentation/modelGroup/hooks/useListModelGroups.d.ts +3 -0
- package/presentation/modelGroup/hooks/useListModelGroups.js +16 -0
- package/presentation/modelGroup/hooks/useListModelGroups.js.map +1 -0
- package/presentation/modelGroup/hooks/useUpdateModelGroup.d.ts +4 -0
- package/presentation/modelGroup/hooks/useUpdateModelGroup.js +12 -0
- package/presentation/modelGroup/hooks/useUpdateModelGroup.js.map +1 -0
- package/admin/plugins/apiInformation/placeholder.manage.graphql +0 -18
- package/admin/plugins/apiInformation/placeholder.preview.graphql +0 -15
- package/admin/plugins/apiInformation/placeholder.read.graphql +0 -16
package/exports/admin/cms.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { CmsGraphQLClient } from "../../features/graphQLClient/index.js";
|
|
1
2
|
export { CmsContentFormRenderer } from "../../legacyPluginAdapters/CmsContentFormRenderer.js";
|
|
2
3
|
export { CmsModelFieldValidator } from "../../legacyPluginAdapters/CmsModelFieldValidator.js";
|
|
3
4
|
export { CmsModelFieldType } from "../../legacyPluginAdapters/CmsModelFieldType.js";
|
|
@@ -12,3 +13,5 @@ export { useModel } from "../../admin/components/ModelProvider/index.js";
|
|
|
12
13
|
export { usePermission } from "../../admin/hooks/usePermission.js";
|
|
13
14
|
export { IsModelPublishable } from "../../admin/components/IsModelPublishable.js";
|
|
14
15
|
export { Routes } from "../../routes.js";
|
|
16
|
+
export { EntryAfterCreateEventHandler, EntryAfterUpdateEventHandler, EntryAfterDeleteEventHandler } from "../../features/contentEntry/events/index.js";
|
|
17
|
+
export type { EntryAfterCreatePayload, EntryAfterUpdatePayload, EntryAfterDeletePayload } from "../../features/contentEntry/events/index.js";
|
package/exports/admin/cms.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { CmsGraphQLClient } from "../../features/graphQLClient/index.js";
|
|
1
2
|
export { CmsContentFormRenderer } from "../../legacyPluginAdapters/CmsContentFormRenderer.js";
|
|
2
3
|
export { CmsModelFieldValidator } from "../../legacyPluginAdapters/CmsModelFieldValidator.js";
|
|
3
4
|
export { CmsModelFieldType } from "../../legacyPluginAdapters/CmsModelFieldType.js";
|
|
@@ -13,4 +14,7 @@ export { usePermission } from "../../admin/hooks/usePermission.js";
|
|
|
13
14
|
export { IsModelPublishable } from "../../admin/components/IsModelPublishable.js";
|
|
14
15
|
export { Routes } from "../../routes.js";
|
|
15
16
|
|
|
17
|
+
// CMS Entry Events
|
|
18
|
+
export { EntryAfterCreateEventHandler, EntryAfterUpdateEventHandler, EntryAfterDeleteEventHandler } from "../../features/contentEntry/events/index.js";
|
|
19
|
+
|
|
16
20
|
//# sourceMappingURL=cms.js.map
|
package/exports/admin/cms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsContentFormRenderer","CmsModelFieldValidator","CmsModelFieldType","CmsModelFieldRenderer","CmsModelLayoutFieldType","CmsModelLayoutFieldRenderer","useQuery","useCms","useLazyQuery","useMutation","useModel","usePermission","IsModelPublishable","Routes"],"sources":["cms.ts"],"sourcesContent":["export { CmsContentFormRenderer } from \"~/legacyPluginAdapters/CmsContentFormRenderer.js\";\nexport { CmsModelFieldValidator } from \"~/legacyPluginAdapters/CmsModelFieldValidator.js\";\nexport { CmsModelFieldType } from \"~/legacyPluginAdapters/CmsModelFieldType.js\";\nexport { CmsModelFieldRenderer } from \"~/legacyPluginAdapters/CmsModelFieldRenderer.js\";\nexport { CmsModelLayoutFieldType } from \"~/legacyPluginAdapters/CmsModelLayoutFieldType.js\";\nexport { CmsModelLayoutFieldRenderer } from \"~/legacyPluginAdapters/CmsModelLayoutFieldRenderer.js\";\nexport { useQuery } from \"~/admin/hooks/useQuery.js\";\nexport { useCms } from \"~/admin/hooks/useCms.js\";\nexport { useLazyQuery } from \"~/admin/hooks/useLazyQuery.js\";\nexport { useMutation } from \"~/admin/hooks/useMutation.js\";\nexport { useModel } from \"~/admin/components/ModelProvider/index.js\";\nexport { usePermission } from \"~/admin/hooks/usePermission.js\";\nexport { IsModelPublishable } from \"~/admin/components/IsModelPublishable.js\";\nexport { Routes } from \"~/routes.js\";\n"],"mappings":"AAAA,SAASA,sBAAsB;AAC/B,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;AAC9B,SAASC,uBAAuB;AAChC,SAASC,2BAA2B;AACpC,SAASC,QAAQ;AACjB,SAASC,MAAM;AACf,SAASC,YAAY;AACrB,SAASC,WAAW;AACpB,SAASC,QAAQ;AACjB,SAASC,aAAa;AACtB,SAASC,kBAAkB;AAC3B,SAASC,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["CmsGraphQLClient","CmsContentFormRenderer","CmsModelFieldValidator","CmsModelFieldType","CmsModelFieldRenderer","CmsModelLayoutFieldType","CmsModelLayoutFieldRenderer","useQuery","useCms","useLazyQuery","useMutation","useModel","usePermission","IsModelPublishable","Routes","EntryAfterCreateEventHandler","EntryAfterUpdateEventHandler","EntryAfterDeleteEventHandler"],"sources":["cms.ts"],"sourcesContent":["export { CmsGraphQLClient } from \"~/features/graphQLClient/index.js\";\nexport { CmsContentFormRenderer } from \"~/legacyPluginAdapters/CmsContentFormRenderer.js\";\nexport { CmsModelFieldValidator } from \"~/legacyPluginAdapters/CmsModelFieldValidator.js\";\nexport { CmsModelFieldType } from \"~/legacyPluginAdapters/CmsModelFieldType.js\";\nexport { CmsModelFieldRenderer } from \"~/legacyPluginAdapters/CmsModelFieldRenderer.js\";\nexport { CmsModelLayoutFieldType } from \"~/legacyPluginAdapters/CmsModelLayoutFieldType.js\";\nexport { CmsModelLayoutFieldRenderer } from \"~/legacyPluginAdapters/CmsModelLayoutFieldRenderer.js\";\nexport { useQuery } from \"~/admin/hooks/useQuery.js\";\nexport { useCms } from \"~/admin/hooks/useCms.js\";\nexport { useLazyQuery } from \"~/admin/hooks/useLazyQuery.js\";\nexport { useMutation } from \"~/admin/hooks/useMutation.js\";\nexport { useModel } from \"~/admin/components/ModelProvider/index.js\";\nexport { usePermission } from \"~/admin/hooks/usePermission.js\";\nexport { IsModelPublishable } from \"~/admin/components/IsModelPublishable.js\";\nexport { Routes } from \"~/routes.js\";\n\n// CMS Entry Events\nexport {\n EntryAfterCreateEventHandler,\n EntryAfterUpdateEventHandler,\n EntryAfterDeleteEventHandler\n} from \"~/features/contentEntry/events/index.js\";\n\nexport type {\n EntryAfterCreatePayload,\n EntryAfterUpdatePayload,\n EntryAfterDeletePayload\n} from \"~/features/contentEntry/events/index.js\";\n"],"mappings":"AAAA,SAASA,gBAAgB;AACzB,SAASC,sBAAsB;AAC/B,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;AAC9B,SAASC,uBAAuB;AAChC,SAASC,2BAA2B;AACpC,SAASC,QAAQ;AACjB,SAASC,MAAM;AACf,SAASC,YAAY;AACrB,SAASC,WAAW;AACpB,SAASC,QAAQ;AACjB,SAASC,aAAa;AACtB,SAASC,kBAAkB;AAC3B,SAASC,MAAM;;AAEf;AACA,SACIC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,4BAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type Constructor<T> = new (...args: any[]) => T;
|
|
2
|
+
export interface IListCachePredicate<T> {
|
|
3
|
+
(item: T): boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface IListCacheItemUpdater<T> {
|
|
6
|
+
(item: T): T;
|
|
7
|
+
}
|
|
8
|
+
export interface IListCache<T> {
|
|
9
|
+
count(): number;
|
|
10
|
+
clear(): void;
|
|
11
|
+
hasItems(): boolean;
|
|
12
|
+
getItems(): T[];
|
|
13
|
+
getItem(predicate: IListCachePredicate<T>): T | undefined;
|
|
14
|
+
addItems(items: T[]): void;
|
|
15
|
+
updateItems(updater: IListCacheItemUpdater<T>): void;
|
|
16
|
+
removeItems(predicate: IListCachePredicate<T>): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class ListCache<T> implements IListCache<T> {
|
|
19
|
+
private state;
|
|
20
|
+
constructor();
|
|
21
|
+
count(): number;
|
|
22
|
+
clear(): void;
|
|
23
|
+
hasItems(): boolean;
|
|
24
|
+
getItems(): T[];
|
|
25
|
+
getItem(predicate: IListCachePredicate<T>): T | undefined;
|
|
26
|
+
addItems(items: T[]): void;
|
|
27
|
+
updateItems(updater: IListCacheItemUpdater<T>): void;
|
|
28
|
+
removeItems(predicate: IListCachePredicate<T>): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { makeAutoObservable, runInAction, toJS } from "mobx";
|
|
2
|
+
import unionBy from "lodash/unionBy.js";
|
|
3
|
+
export class ListCache {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.state = [];
|
|
6
|
+
makeAutoObservable(this);
|
|
7
|
+
}
|
|
8
|
+
count() {
|
|
9
|
+
return this.state.length;
|
|
10
|
+
}
|
|
11
|
+
clear() {
|
|
12
|
+
runInAction(() => {
|
|
13
|
+
this.state = [];
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
hasItems() {
|
|
17
|
+
return this.state.length > 0;
|
|
18
|
+
}
|
|
19
|
+
getItems() {
|
|
20
|
+
return [...this.state.map(item => toJS(item))];
|
|
21
|
+
}
|
|
22
|
+
getItem(predicate) {
|
|
23
|
+
const item = this.state.find(item => predicate(item));
|
|
24
|
+
return item ? toJS(item) : undefined;
|
|
25
|
+
}
|
|
26
|
+
addItems(items) {
|
|
27
|
+
runInAction(() => {
|
|
28
|
+
this.state = unionBy(this.state, items, "id");
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
updateItems(updater) {
|
|
32
|
+
runInAction(() => {
|
|
33
|
+
this.state = [...this.state.map(item => updater(item))];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
removeItems(predicate) {
|
|
37
|
+
runInAction(() => {
|
|
38
|
+
this.state = this.state.filter(item => !predicate(item));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=ListCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["makeAutoObservable","runInAction","toJS","unionBy","ListCache","constructor","state","count","length","clear","hasItems","getItems","map","item","getItem","predicate","find","undefined","addItems","items","updateItems","updater","removeItems","filter"],"sources":["ListCache.ts"],"sourcesContent":["import { makeAutoObservable, runInAction, toJS } from \"mobx\";\nimport unionBy from \"lodash/unionBy.js\";\n\nexport type Constructor<T> = new (...args: any[]) => T;\n\nexport interface IListCachePredicate<T> {\n (item: T): boolean;\n}\n\nexport interface IListCacheItemUpdater<T> {\n (item: T): T;\n}\n\nexport interface IListCache<T> {\n count(): number;\n clear(): void;\n hasItems(): boolean;\n getItems(): T[];\n getItem(predicate: IListCachePredicate<T>): T | undefined;\n addItems(items: T[]): void;\n updateItems(updater: IListCacheItemUpdater<T>): void;\n removeItems(predicate: IListCachePredicate<T>): void;\n}\n\nexport class ListCache<T> implements IListCache<T> {\n private state: T[];\n\n constructor() {\n this.state = [];\n\n makeAutoObservable(this);\n }\n\n count() {\n return this.state.length;\n }\n\n clear() {\n runInAction(() => {\n this.state = [];\n });\n }\n\n hasItems() {\n return this.state.length > 0;\n }\n\n getItems() {\n return [...this.state.map(item => toJS(item))];\n }\n\n getItem(predicate: IListCachePredicate<T>): T | undefined {\n const item = this.state.find(item => predicate(item));\n\n return item ? toJS(item) : undefined;\n }\n\n addItems(items: T[]) {\n runInAction(() => {\n this.state = unionBy(this.state, items, \"id\");\n });\n }\n\n updateItems(updater: IListCacheItemUpdater<T>) {\n runInAction(() => {\n this.state = [...this.state.map(item => updater(item))];\n });\n }\n\n removeItems(predicate: IListCachePredicate<T>) {\n runInAction(() => {\n this.state = this.state.filter(item => !predicate(item));\n });\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,EAAEC,IAAI,QAAQ,MAAM;AAC5D,OAAOC,OAAO,MAAM,mBAAmB;AAuBvC,OAAO,MAAMC,SAAS,CAA6B;EAG/CC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,KAAK,GAAG,EAAE;IAEfN,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAO,KAAKA,CAAA,EAAG;IACJ,OAAO,IAAI,CAACD,KAAK,CAACE,MAAM;EAC5B;EAEAC,KAAKA,CAAA,EAAG;IACJR,WAAW,CAAC,MAAM;MACd,IAAI,CAACK,KAAK,GAAG,EAAE;IACnB,CAAC,CAAC;EACN;EAEAI,QAAQA,CAAA,EAAG;IACP,OAAO,IAAI,CAACJ,KAAK,CAACE,MAAM,GAAG,CAAC;EAChC;EAEAG,QAAQA,CAAA,EAAG;IACP,OAAO,CAAC,GAAG,IAAI,CAACL,KAAK,CAACM,GAAG,CAACC,IAAI,IAAIX,IAAI,CAACW,IAAI,CAAC,CAAC,CAAC;EAClD;EAEAC,OAAOA,CAACC,SAAiC,EAAiB;IACtD,MAAMF,IAAI,GAAG,IAAI,CAACP,KAAK,CAACU,IAAI,CAACH,IAAI,IAAIE,SAAS,CAACF,IAAI,CAAC,CAAC;IAErD,OAAOA,IAAI,GAAGX,IAAI,CAACW,IAAI,CAAC,GAAGI,SAAS;EACxC;EAEAC,QAAQA,CAACC,KAAU,EAAE;IACjBlB,WAAW,CAAC,MAAM;MACd,IAAI,CAACK,KAAK,GAAGH,OAAO,CAAC,IAAI,CAACG,KAAK,EAAEa,KAAK,EAAE,IAAI,CAAC;IACjD,CAAC,CAAC;EACN;EAEAC,WAAWA,CAACC,OAAiC,EAAE;IAC3CpB,WAAW,CAAC,MAAM;MACd,IAAI,CAACK,KAAK,GAAG,CAAC,GAAG,IAAI,CAACA,KAAK,CAACM,GAAG,CAACC,IAAI,IAAIQ,OAAO,CAACR,IAAI,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC;EACN;EAEAS,WAAWA,CAACP,SAAiC,EAAE;IAC3Cd,WAAW,CAAC,MAAM;MACd,IAAI,CAACK,KAAK,GAAG,IAAI,CAACA,KAAK,CAACiB,MAAM,CAACV,IAAI,IAAI,CAACE,SAAS,CAACF,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseEvent } from "@webiny/app/features/eventPublisher/index.js";
|
|
2
|
+
import type { CmsContentEntry, CmsModel } from "../../../types.js";
|
|
3
|
+
export interface EntryAfterCreatePayload {
|
|
4
|
+
entry: CmsContentEntry;
|
|
5
|
+
model: CmsModel;
|
|
6
|
+
}
|
|
7
|
+
export declare class EntryAfterCreateEvent extends BaseEvent<EntryAfterCreatePayload> {
|
|
8
|
+
readonly eventType: "Cms/Entry/AfterCreate";
|
|
9
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/app/features/eventPublisher/abstractions.js").IEventHandler<EntryAfterCreateEvent>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EntryAfterCreateEventHandler } from "./abstractions.js";
|
|
2
|
+
import { BaseEvent } from "@webiny/app/features/eventPublisher/index.js";
|
|
3
|
+
export class EntryAfterCreateEvent extends BaseEvent {
|
|
4
|
+
eventType = "Cms/Entry/AfterCreate";
|
|
5
|
+
getHandlerAbstraction() {
|
|
6
|
+
return EntryAfterCreateEventHandler;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=EntryAfterCreateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EntryAfterCreateEventHandler","BaseEvent","EntryAfterCreateEvent","eventType","getHandlerAbstraction"],"sources":["EntryAfterCreateEvent.ts"],"sourcesContent":["import { EntryAfterCreateEventHandler } from \"./abstractions.js\";\nimport { BaseEvent } from \"@webiny/app/features/eventPublisher/index.js\";\nimport type { CmsContentEntry, CmsModel } from \"~/types.js\";\n\nexport interface EntryAfterCreatePayload {\n entry: CmsContentEntry;\n model: CmsModel;\n}\n\nexport class EntryAfterCreateEvent extends BaseEvent<EntryAfterCreatePayload> {\n readonly eventType = \"Cms/Entry/AfterCreate\" as const;\n\n getHandlerAbstraction() {\n return EntryAfterCreateEventHandler;\n }\n}\n"],"mappings":"AAAA,SAASA,4BAA4B;AACrC,SAASC,SAAS,QAAQ,8CAA8C;AAQxE,OAAO,MAAMC,qBAAqB,SAASD,SAAS,CAA0B;EACjEE,SAAS,GAAG,uBAAuB;EAE5CC,qBAAqBA,CAAA,EAAG;IACpB,OAAOJ,4BAA4B;EACvC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseEvent } from "@webiny/app/features/eventPublisher/index.js";
|
|
2
|
+
import type { CmsModel } from "../../../types.js";
|
|
3
|
+
export interface EntryAfterDeletePayload {
|
|
4
|
+
model: CmsModel;
|
|
5
|
+
id: string;
|
|
6
|
+
entryId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class EntryAfterDeleteEvent extends BaseEvent<EntryAfterDeletePayload> {
|
|
9
|
+
readonly eventType: "Cms/Entry/AfterDelete";
|
|
10
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/app/features/eventPublisher/abstractions.js").IEventHandler<EntryAfterDeleteEvent>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EntryAfterDeleteEventHandler } from "./abstractions.js";
|
|
2
|
+
import { BaseEvent } from "@webiny/app/features/eventPublisher/index.js";
|
|
3
|
+
export class EntryAfterDeleteEvent extends BaseEvent {
|
|
4
|
+
eventType = "Cms/Entry/AfterDelete";
|
|
5
|
+
getHandlerAbstraction() {
|
|
6
|
+
return EntryAfterDeleteEventHandler;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=EntryAfterDeleteEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EntryAfterDeleteEventHandler","BaseEvent","EntryAfterDeleteEvent","eventType","getHandlerAbstraction"],"sources":["EntryAfterDeleteEvent.ts"],"sourcesContent":["import { EntryAfterDeleteEventHandler } from \"./abstractions.js\";\nimport { BaseEvent } from \"@webiny/app/features/eventPublisher/index.js\";\nimport type { CmsModel } from \"~/types.js\";\n\nexport interface EntryAfterDeletePayload {\n model: CmsModel;\n id: string;\n entryId: string;\n}\n\nexport class EntryAfterDeleteEvent extends BaseEvent<EntryAfterDeletePayload> {\n readonly eventType = \"Cms/Entry/AfterDelete\" as const;\n\n getHandlerAbstraction() {\n return EntryAfterDeleteEventHandler;\n }\n}\n"],"mappings":"AAAA,SAASA,4BAA4B;AACrC,SAASC,SAAS,QAAQ,8CAA8C;AASxE,OAAO,MAAMC,qBAAqB,SAASD,SAAS,CAA0B;EACjEE,SAAS,GAAG,uBAAuB;EAE5CC,qBAAqBA,CAAA,EAAG;IACpB,OAAOJ,4BAA4B;EACvC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseEvent } from "@webiny/app/features/eventPublisher/index.js";
|
|
2
|
+
import type { CmsContentEntry, CmsModel } from "../../../types.js";
|
|
3
|
+
export interface EntryAfterUpdatePayload {
|
|
4
|
+
entry: CmsContentEntry;
|
|
5
|
+
model: CmsModel;
|
|
6
|
+
}
|
|
7
|
+
export declare class EntryAfterUpdateEvent extends BaseEvent<EntryAfterUpdatePayload> {
|
|
8
|
+
readonly eventType: "Cms/Entry/AfterUpdate";
|
|
9
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/app/features/eventPublisher/abstractions.js").IEventHandler<EntryAfterUpdateEvent>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EntryAfterUpdateEventHandler } from "./abstractions.js";
|
|
2
|
+
import { BaseEvent } from "@webiny/app/features/eventPublisher/index.js";
|
|
3
|
+
export class EntryAfterUpdateEvent extends BaseEvent {
|
|
4
|
+
eventType = "Cms/Entry/AfterUpdate";
|
|
5
|
+
getHandlerAbstraction() {
|
|
6
|
+
return EntryAfterUpdateEventHandler;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=EntryAfterUpdateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EntryAfterUpdateEventHandler","BaseEvent","EntryAfterUpdateEvent","eventType","getHandlerAbstraction"],"sources":["EntryAfterUpdateEvent.ts"],"sourcesContent":["import { EntryAfterUpdateEventHandler } from \"./abstractions.js\";\nimport { BaseEvent } from \"@webiny/app/features/eventPublisher/index.js\";\nimport type { CmsContentEntry, CmsModel } from \"~/types.js\";\n\nexport interface EntryAfterUpdatePayload {\n entry: CmsContentEntry;\n model: CmsModel;\n}\n\nexport class EntryAfterUpdateEvent extends BaseEvent<EntryAfterUpdatePayload> {\n readonly eventType = \"Cms/Entry/AfterUpdate\" as const;\n\n getHandlerAbstraction() {\n return EntryAfterUpdateEventHandler;\n }\n}\n"],"mappings":"AAAA,SAASA,4BAA4B;AACrC,SAASC,SAAS,QAAQ,8CAA8C;AAQxE,OAAO,MAAMC,qBAAqB,SAASD,SAAS,CAA0B;EACjEE,SAAS,GAAG,uBAAuB;EAE5CC,qBAAqBA,CAAA,EAAG;IACpB,OAAOJ,4BAA4B;EACvC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EntryAfterCreateEvent } from "./EntryAfterCreateEvent.js";
|
|
2
|
+
import type { EntryAfterUpdateEvent } from "./EntryAfterUpdateEvent.js";
|
|
3
|
+
import type { EntryAfterDeleteEvent } from "./EntryAfterDeleteEvent.js";
|
|
4
|
+
import type { IEventHandler } from "@webiny/app/features/eventPublisher/index.js";
|
|
5
|
+
export declare const EntryAfterCreateEventHandler: import("@webiny/di").Abstraction<IEventHandler<EntryAfterCreateEvent>>;
|
|
6
|
+
export declare namespace EntryAfterCreateEventHandler {
|
|
7
|
+
type Interface = IEventHandler<EntryAfterCreateEvent>;
|
|
8
|
+
type Event = EntryAfterCreateEvent;
|
|
9
|
+
}
|
|
10
|
+
export declare const EntryAfterUpdateEventHandler: import("@webiny/di").Abstraction<IEventHandler<EntryAfterUpdateEvent>>;
|
|
11
|
+
export declare namespace EntryAfterUpdateEventHandler {
|
|
12
|
+
type Interface = IEventHandler<EntryAfterUpdateEvent>;
|
|
13
|
+
type Event = EntryAfterUpdateEvent;
|
|
14
|
+
}
|
|
15
|
+
export declare const EntryAfterDeleteEventHandler: import("@webiny/di").Abstraction<IEventHandler<EntryAfterDeleteEvent>>;
|
|
16
|
+
export declare namespace EntryAfterDeleteEventHandler {
|
|
17
|
+
type Interface = IEventHandler<EntryAfterDeleteEvent>;
|
|
18
|
+
type Event = EntryAfterDeleteEvent;
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/admin";
|
|
2
|
+
export const EntryAfterCreateEventHandler = createAbstraction("App/EntryAfterCreateEventHandler");
|
|
3
|
+
export const EntryAfterUpdateEventHandler = createAbstraction("App/EntryAfterUpdateEventHandler");
|
|
4
|
+
export const EntryAfterDeleteEventHandler = createAbstraction("App/EntryAfterDeleteEventHandler");
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","EntryAfterCreateEventHandler","EntryAfterUpdateEventHandler","EntryAfterDeleteEventHandler"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { EntryAfterCreateEvent } from \"./EntryAfterCreateEvent.js\";\nimport type { EntryAfterUpdateEvent } from \"./EntryAfterUpdateEvent.js\";\nimport type { EntryAfterDeleteEvent } from \"./EntryAfterDeleteEvent.js\";\nimport type { IEventHandler } from \"@webiny/app/features/eventPublisher/index.js\";\n\nexport const EntryAfterCreateEventHandler = createAbstraction<IEventHandler<EntryAfterCreateEvent>>(\n \"App/EntryAfterCreateEventHandler\"\n);\n\nexport namespace EntryAfterCreateEventHandler {\n export type Interface = IEventHandler<EntryAfterCreateEvent>;\n export type Event = EntryAfterCreateEvent;\n}\n\nexport const EntryAfterUpdateEventHandler = createAbstraction<IEventHandler<EntryAfterUpdateEvent>>(\n \"App/EntryAfterUpdateEventHandler\"\n);\n\nexport namespace EntryAfterUpdateEventHandler {\n export type Interface = IEventHandler<EntryAfterUpdateEvent>;\n export type Event = EntryAfterUpdateEvent;\n}\n\nexport const EntryAfterDeleteEventHandler = createAbstraction<IEventHandler<EntryAfterDeleteEvent>>(\n \"App/EntryAfterDeleteEventHandler\"\n);\n\nexport namespace EntryAfterDeleteEventHandler {\n export type Interface = IEventHandler<EntryAfterDeleteEvent>;\n export type Event = EntryAfterDeleteEvent;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,uBAAuB;AAMzD,OAAO,MAAMC,4BAA4B,GAAGD,iBAAiB,CACzD,kCACJ,CAAC;AAOD,OAAO,MAAME,4BAA4B,GAAGF,iBAAiB,CACzD,kCACJ,CAAC;AAOD,OAAO,MAAMG,4BAA4B,GAAGH,iBAAiB,CACzD,kCACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { EntryAfterCreateEvent } from "./EntryAfterCreateEvent.js";
|
|
2
|
+
export type { EntryAfterCreatePayload } from "./EntryAfterCreateEvent.js";
|
|
3
|
+
export { EntryAfterUpdateEvent } from "./EntryAfterUpdateEvent.js";
|
|
4
|
+
export type { EntryAfterUpdatePayload } from "./EntryAfterUpdateEvent.js";
|
|
5
|
+
export { EntryAfterDeleteEvent } from "./EntryAfterDeleteEvent.js";
|
|
6
|
+
export type { EntryAfterDeletePayload } from "./EntryAfterDeleteEvent.js";
|
|
7
|
+
export { EntryAfterCreateEventHandler, EntryAfterUpdateEventHandler, EntryAfterDeleteEventHandler } from "./abstractions.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { EntryAfterCreateEvent } from "./EntryAfterCreateEvent.js";
|
|
2
|
+
export { EntryAfterUpdateEvent } from "./EntryAfterUpdateEvent.js";
|
|
3
|
+
export { EntryAfterDeleteEvent } from "./EntryAfterDeleteEvent.js";
|
|
4
|
+
export { EntryAfterCreateEventHandler, EntryAfterUpdateEventHandler, EntryAfterDeleteEventHandler } from "./abstractions.js";
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EntryAfterCreateEvent","EntryAfterUpdateEvent","EntryAfterDeleteEvent","EntryAfterCreateEventHandler","EntryAfterUpdateEventHandler","EntryAfterDeleteEventHandler"],"sources":["index.ts"],"sourcesContent":["export { EntryAfterCreateEvent } from \"./EntryAfterCreateEvent.js\";\nexport type { EntryAfterCreatePayload } from \"./EntryAfterCreateEvent.js\";\n\nexport { EntryAfterUpdateEvent } from \"./EntryAfterUpdateEvent.js\";\nexport type { EntryAfterUpdatePayload } from \"./EntryAfterUpdateEvent.js\";\n\nexport { EntryAfterDeleteEvent } from \"./EntryAfterDeleteEvent.js\";\nexport type { EntryAfterDeletePayload } from \"./EntryAfterDeleteEvent.js\";\n\nexport {\n EntryAfterCreateEventHandler,\n EntryAfterUpdateEventHandler,\n EntryAfterDeleteEventHandler\n} from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,qBAAqB;AAG9B,SAASC,qBAAqB;AAG9B,SAASC,qBAAqB;AAG9B,SACIC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,4BAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GraphQLClient } from "@webiny/app/features/graphqlClient/abstractions.js";
|
|
2
|
+
import { EnvConfig } from "@webiny/app/features/envConfig/index.js";
|
|
3
|
+
import { CmsGraphQLClient } from "./abstractions.js";
|
|
4
|
+
declare class CmsGraphQLClientImpl implements CmsGraphQLClient.Interface {
|
|
5
|
+
private client;
|
|
6
|
+
private readonly endpoint;
|
|
7
|
+
constructor(envConfig: EnvConfig.Interface, client: GraphQLClient.Interface);
|
|
8
|
+
execute<TResult = any, TVariables = any>(params: CmsGraphQLClient.Request<TVariables>): Promise<TResult>;
|
|
9
|
+
}
|
|
10
|
+
export declare const DefaultCmsGraphQLClient: typeof CmsGraphQLClientImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICmsGraphQLClient>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GraphQLClient } from "@webiny/app/features/graphqlClient/abstractions.js";
|
|
2
|
+
import { EnvConfig } from "@webiny/app/features/envConfig/index.js";
|
|
3
|
+
import { CmsGraphQLClient } from "./abstractions.js";
|
|
4
|
+
class CmsGraphQLClientImpl {
|
|
5
|
+
constructor(envConfig, client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.endpoint = `${envConfig.get("apiUrl")}/cms/manage`;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
return this.client.execute({
|
|
11
|
+
endpoint: this.endpoint,
|
|
12
|
+
...params
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export const DefaultCmsGraphQLClient = CmsGraphQLClient.createImplementation({
|
|
17
|
+
implementation: CmsGraphQLClientImpl,
|
|
18
|
+
dependencies: [EnvConfig, GraphQLClient]
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=CmsGraphQLClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GraphQLClient","EnvConfig","CmsGraphQLClient","CmsGraphQLClientImpl","constructor","envConfig","client","endpoint","get","execute","params","DefaultCmsGraphQLClient","createImplementation","implementation","dependencies"],"sources":["CmsGraphQLClient.ts"],"sourcesContent":["import { GraphQLClient } from \"@webiny/app/features/graphqlClient/abstractions.js\";\nimport { EnvConfig } from \"@webiny/app/features/envConfig/index.js\";\nimport { CmsGraphQLClient } from \"./abstractions.js\";\n\nclass CmsGraphQLClientImpl implements CmsGraphQLClient.Interface {\n private readonly endpoint: string;\n\n constructor(\n envConfig: EnvConfig.Interface,\n private client: GraphQLClient.Interface\n ) {\n this.endpoint = `${envConfig.get(\"apiUrl\")}/cms/manage`;\n }\n\n async execute<TResult = any, TVariables = any>(\n params: CmsGraphQLClient.Request<TVariables>\n ): Promise<TResult> {\n return this.client.execute({ endpoint: this.endpoint, ...params });\n }\n}\n\nexport const DefaultCmsGraphQLClient = CmsGraphQLClient.createImplementation({\n implementation: CmsGraphQLClientImpl,\n dependencies: [EnvConfig, GraphQLClient]\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,oDAAoD;AAClF,SAASC,SAAS,QAAQ,yCAAyC;AACnE,SAASC,gBAAgB;AAEzB,MAAMC,oBAAoB,CAAuC;EAG7DC,WAAWA,CACPC,SAA8B,EACtBC,MAA+B,EACzC;IAAA,KADUA,MAA+B,GAA/BA,MAA+B;IAEvC,IAAI,CAACC,QAAQ,GAAG,GAAGF,SAAS,CAACG,GAAG,CAAC,QAAQ,CAAC,aAAa;EAC3D;EAEA,MAAMC,OAAOA,CACTC,MAA4C,EAC5B;IAChB,OAAO,IAAI,CAACJ,MAAM,CAACG,OAAO,CAAC;MAAEF,QAAQ,EAAE,IAAI,CAACA,QAAQ;MAAE,GAAGG;IAAO,CAAC,CAAC;EACtE;AACJ;AAEA,OAAO,MAAMC,uBAAuB,GAAGT,gBAAgB,CAACU,oBAAoB,CAAC;EACzEC,cAAc,EAAEV,oBAAoB;EACpCW,YAAY,EAAE,CAACb,SAAS,EAAED,aAAa;AAC3C,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DocumentNode } from "graphql";
|
|
2
|
+
type IHeaders = Record<string, string | number | undefined>;
|
|
3
|
+
type CmsGraphQLRequest<TVariables = any> = {
|
|
4
|
+
query: DocumentNode | string;
|
|
5
|
+
variables?: TVariables;
|
|
6
|
+
headers?: IHeaders;
|
|
7
|
+
};
|
|
8
|
+
export interface ICmsGraphQLClient {
|
|
9
|
+
execute<TResult = any, TVariables = any>(params: CmsGraphQLRequest<TVariables>): Promise<TResult>;
|
|
10
|
+
}
|
|
11
|
+
export declare const CmsGraphQLClient: import("@webiny/di").Abstraction<ICmsGraphQLClient>;
|
|
12
|
+
export declare namespace CmsGraphQLClient {
|
|
13
|
+
type Headers = IHeaders;
|
|
14
|
+
type Interface = ICmsGraphQLClient;
|
|
15
|
+
type Request<TVariables = any> = CmsGraphQLRequest<TVariables>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","CmsGraphQLClient"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { DocumentNode } from \"graphql\";\n\ntype IHeaders = Record<string, string | number | undefined>;\n\ntype CmsGraphQLRequest<TVariables = any> = {\n query: DocumentNode | string;\n variables?: TVariables;\n headers?: IHeaders;\n};\n\nexport interface ICmsGraphQLClient {\n execute<TResult = any, TVariables = any>(\n params: CmsGraphQLRequest<TVariables>\n ): Promise<TResult>;\n}\n\nexport const CmsGraphQLClient = createAbstraction<ICmsGraphQLClient>(\"CmsGraphQLClient\");\n\nexport namespace CmsGraphQLClient {\n export type Headers = IHeaders;\n export type Interface = ICmsGraphQLClient;\n export type Request<TVariables = any> = CmsGraphQLRequest<TVariables>;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,uBAAuB;AAiBzD,OAAO,MAAMC,gBAAgB,GAAGD,iBAAiB,CAAoB,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/app/shared/di/createFeature.js";
|
|
2
|
+
import { CmsGraphQLClient } from "./abstractions.js";
|
|
3
|
+
import { DefaultCmsGraphQLClient } from "./CmsGraphQLClient.js";
|
|
4
|
+
export const CmsGraphQLClientFeature = createFeature({
|
|
5
|
+
name: "CmsGraphQLClient",
|
|
6
|
+
register(container) {
|
|
7
|
+
container.register(DefaultCmsGraphQLClient).inSingletonScope();
|
|
8
|
+
},
|
|
9
|
+
resolve(container) {
|
|
10
|
+
return {
|
|
11
|
+
client: container.resolve(CmsGraphQLClient)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFeature","CmsGraphQLClient","DefaultCmsGraphQLClient","CmsGraphQLClientFeature","name","register","container","inSingletonScope","resolve","client"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/app/shared/di/createFeature.js\";\nimport { CmsGraphQLClient } from \"./abstractions.js\";\nimport { DefaultCmsGraphQLClient } from \"./CmsGraphQLClient.js\";\n\nexport const CmsGraphQLClientFeature = createFeature({\n name: \"CmsGraphQLClient\",\n register(container) {\n container.register(DefaultCmsGraphQLClient).inSingletonScope();\n },\n resolve(container) {\n return {\n client: container.resolve(CmsGraphQLClient)\n };\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,wCAAwC;AACtE,SAASC,gBAAgB;AACzB,SAASC,uBAAuB;AAEhC,OAAO,MAAMC,uBAAuB,GAAGH,aAAa,CAAC;EACjDI,IAAI,EAAE,kBAAkB;EACxBC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,uBAAuB,CAAC,CAACK,gBAAgB,CAAC,CAAC;EAClE,CAAC;EACDC,OAAOA,CAACF,SAAS,EAAE;IACf,OAAO;MACHG,MAAM,EAAEH,SAAS,CAACE,OAAO,CAACP,gBAAgB;IAC9C,CAAC;EACL;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CmsGraphQLClient } from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsGraphQLClient"],"sources":["index.ts"],"sourcesContent":["export { CmsGraphQLClient } from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IListCache } from "@webiny/app-aco/features/folders/cache/ListCache.js";
|
|
2
|
+
import type { ModelGroupDto } from "./listModelGroups/abstractions.js";
|
|
3
|
+
export declare const ModelGroupsCache: import("@webiny/di").Abstraction<IListCache<ModelGroupDto>>;
|
|
4
|
+
export declare namespace ModelGroupsCache {
|
|
5
|
+
type Interface = IListCache<ModelGroupDto>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","ModelGroupsCache"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IListCache } from \"@webiny/app-aco/features/folders/cache/ListCache.js\";\nimport type { ModelGroupDto } from \"./listModelGroups/abstractions.js\";\n\nexport const ModelGroupsCache = createAbstraction<IListCache<ModelGroupDto>>(\"ModelGroupsCache\");\n\nexport namespace ModelGroupsCache {\n export type Interface = IListCache<ModelGroupDto>;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,uBAAuB;AAIzD,OAAO,MAAMC,gBAAgB,GAAGD,iBAAiB,CAA4B,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CmsGraphQLClient } from "../../../features/graphQLClient/abstractions.js";
|
|
2
|
+
import type { CmsErrorResponse } from "../../../types.js";
|
|
3
|
+
import type { ModelGroupDto } from "../listModelGroups/abstractions.js";
|
|
4
|
+
import type { CreateModelGroupParams } from "./abstractions.js";
|
|
5
|
+
import { CreateModelGroupGateway as GatewayAbstraction } from "./abstractions.js";
|
|
6
|
+
export interface CreateModelGroupResponse {
|
|
7
|
+
contentModelGroup: {
|
|
8
|
+
data: ModelGroupDto | null;
|
|
9
|
+
error: CmsErrorResponse | null;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface CreateModelGroupVariables {
|
|
13
|
+
data: CreateModelGroupParams;
|
|
14
|
+
}
|
|
15
|
+
declare class CreateModelGroupGatewayImpl implements GatewayAbstraction.Interface {
|
|
16
|
+
private client;
|
|
17
|
+
constructor(client: CmsGraphQLClient.Interface);
|
|
18
|
+
execute(data: CreateModelGroupParams): Promise<ModelGroupDto>;
|
|
19
|
+
}
|
|
20
|
+
export declare const CreateModelGroupGateway: typeof CreateModelGroupGatewayImpl & {
|
|
21
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICreateModelGroupGateway>;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
import { CmsGraphQLClient } from "../../graphQLClient/abstractions.js";
|
|
3
|
+
import { CreateModelGroupGateway as GatewayAbstraction } from "./abstractions.js";
|
|
4
|
+
const CREATE_CONTENT_MODEL_GROUP = gql`
|
|
5
|
+
mutation CmsCreateContentModelGroup($data: CmsContentModelGroupInput!) {
|
|
6
|
+
contentModelGroup: createContentModelGroup(data: $data) {
|
|
7
|
+
data {
|
|
8
|
+
id
|
|
9
|
+
name
|
|
10
|
+
slug
|
|
11
|
+
description
|
|
12
|
+
icon
|
|
13
|
+
createdOn
|
|
14
|
+
plugin
|
|
15
|
+
createdBy {
|
|
16
|
+
id
|
|
17
|
+
displayName
|
|
18
|
+
type
|
|
19
|
+
}
|
|
20
|
+
contentModels {
|
|
21
|
+
modelId
|
|
22
|
+
name
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
error {
|
|
26
|
+
message
|
|
27
|
+
code
|
|
28
|
+
data
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
class CreateModelGroupGatewayImpl {
|
|
34
|
+
constructor(client) {
|
|
35
|
+
this.client = client;
|
|
36
|
+
}
|
|
37
|
+
async execute(data) {
|
|
38
|
+
const response = await this.client.execute({
|
|
39
|
+
query: CREATE_CONTENT_MODEL_GROUP,
|
|
40
|
+
variables: {
|
|
41
|
+
data
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const {
|
|
45
|
+
data: result,
|
|
46
|
+
error
|
|
47
|
+
} = response.contentModelGroup;
|
|
48
|
+
if (!result) {
|
|
49
|
+
throw new Error(error?.message || "Could not create model group");
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export const CreateModelGroupGateway = GatewayAbstraction.createImplementation({
|
|
55
|
+
implementation: CreateModelGroupGatewayImpl,
|
|
56
|
+
dependencies: [CmsGraphQLClient]
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=CreateModelGroupGateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["gql","CmsGraphQLClient","CreateModelGroupGateway","GatewayAbstraction","CREATE_CONTENT_MODEL_GROUP","CreateModelGroupGatewayImpl","constructor","client","execute","data","response","query","variables","result","error","contentModelGroup","Error","message","createImplementation","implementation","dependencies"],"sources":["CreateModelGroupGateway.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { CmsGraphQLClient } from \"~/features/graphQLClient/abstractions.js\";\nimport type { CmsErrorResponse } from \"~/types.js\";\nimport type { ModelGroupDto } from \"../listModelGroups/abstractions.js\";\nimport type { CreateModelGroupParams } from \"./abstractions.js\";\nimport { CreateModelGroupGateway as GatewayAbstraction } from \"./abstractions.js\";\n\nexport interface CreateModelGroupResponse {\n contentModelGroup: {\n data: ModelGroupDto | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface CreateModelGroupVariables {\n data: CreateModelGroupParams;\n}\n\nconst CREATE_CONTENT_MODEL_GROUP = gql`\n mutation CmsCreateContentModelGroup($data: CmsContentModelGroupInput!) {\n contentModelGroup: createContentModelGroup(data: $data) {\n data {\n id\n name\n slug\n description\n icon\n createdOn\n plugin\n createdBy {\n id\n displayName\n type\n }\n contentModels {\n modelId\n name\n }\n }\n error {\n message\n code\n data\n }\n }\n }\n`;\n\nclass CreateModelGroupGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: CmsGraphQLClient.Interface) {}\n\n async execute(data: CreateModelGroupParams) {\n const response = await this.client.execute<\n CreateModelGroupResponse,\n CreateModelGroupVariables\n >({\n query: CREATE_CONTENT_MODEL_GROUP,\n variables: { data }\n });\n\n const { data: result, error } = response.contentModelGroup;\n\n if (!result) {\n throw new Error(error?.message || \"Could not create model group\");\n }\n\n return result;\n }\n}\n\nexport const CreateModelGroupGateway = GatewayAbstraction.createImplementation({\n implementation: CreateModelGroupGatewayImpl,\n dependencies: [CmsGraphQLClient]\n});\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAC7B,SAASC,gBAAgB;AAIzB,SAASC,uBAAuB,IAAIC,kBAAkB;AAatD,MAAMC,0BAA0B,GAAGJ,GAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAMK,2BAA2B,CAAyC;EACtEC,WAAWA,CAASC,MAAkC,EAAE;IAAA,KAApCA,MAAkC,GAAlCA,MAAkC;EAAG;EAEzD,MAAMC,OAAOA,CAACC,IAA4B,EAAE;IACxC,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACH,MAAM,CAACC,OAAO,CAGxC;MACEG,KAAK,EAAEP,0BAA0B;MACjCQ,SAAS,EAAE;QAAEH;MAAK;IACtB,CAAC,CAAC;IAEF,MAAM;MAAEA,IAAI,EAAEI,MAAM;MAAEC;IAAM,CAAC,GAAGJ,QAAQ,CAACK,iBAAiB;IAE1D,IAAI,CAACF,MAAM,EAAE;MACT,MAAM,IAAIG,KAAK,CAACF,KAAK,EAAEG,OAAO,IAAI,8BAA8B,CAAC;IACrE;IAEA,OAAOJ,MAAM;EACjB;AACJ;AAEA,OAAO,MAAMX,uBAAuB,GAAGC,kBAAkB,CAACe,oBAAoB,CAAC;EAC3EC,cAAc,EAAEd,2BAA2B;EAC3Ce,YAAY,EAAE,CAACnB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CreateModelGroupParams } from "./abstractions.js";
|
|
2
|
+
import { CreateModelGroupRepository as RepositoryAbstraction, CreateModelGroupGateway } from "./abstractions.js";
|
|
3
|
+
import { ModelGroupsCache } from "../../../features/modelGroup/abstractions.js";
|
|
4
|
+
declare class CreateModelGroupRepositoryImpl implements RepositoryAbstraction.Interface {
|
|
5
|
+
private cache;
|
|
6
|
+
private gateway;
|
|
7
|
+
constructor(cache: ModelGroupsCache.Interface, gateway: CreateModelGroupGateway.Interface);
|
|
8
|
+
execute(params: CreateModelGroupParams): Promise<import("../listModelGroups/abstractions.js").ModelGroupDto>;
|
|
9
|
+
}
|
|
10
|
+
export declare const CreateModelGroupRepository: typeof CreateModelGroupRepositoryImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICreateModelGroupRepository>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CreateModelGroupRepository as RepositoryAbstraction, CreateModelGroupGateway } from "./abstractions.js";
|
|
2
|
+
import { ModelGroupsCache } from "../abstractions.js";
|
|
3
|
+
class CreateModelGroupRepositoryImpl {
|
|
4
|
+
constructor(cache, gateway) {
|
|
5
|
+
this.cache = cache;
|
|
6
|
+
this.gateway = gateway;
|
|
7
|
+
}
|
|
8
|
+
async execute(params) {
|
|
9
|
+
const result = await this.gateway.execute(params);
|
|
10
|
+
this.cache.addItems([result]);
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export const CreateModelGroupRepository = RepositoryAbstraction.createImplementation({
|
|
15
|
+
implementation: CreateModelGroupRepositoryImpl,
|
|
16
|
+
dependencies: [ModelGroupsCache, CreateModelGroupGateway]
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=CreateModelGroupRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CreateModelGroupRepository","RepositoryAbstraction","CreateModelGroupGateway","ModelGroupsCache","CreateModelGroupRepositoryImpl","constructor","cache","gateway","execute","params","result","addItems","createImplementation","implementation","dependencies"],"sources":["CreateModelGroupRepository.ts"],"sourcesContent":["import type { CreateModelGroupParams } from \"./abstractions.js\";\nimport {\n CreateModelGroupRepository as RepositoryAbstraction,\n CreateModelGroupGateway\n} from \"./abstractions.js\";\nimport { ModelGroupsCache } from \"~/features/modelGroup/abstractions.js\";\n\nclass CreateModelGroupRepositoryImpl implements RepositoryAbstraction.Interface {\n constructor(\n private cache: ModelGroupsCache.Interface,\n private gateway: CreateModelGroupGateway.Interface\n ) {}\n\n async execute(params: CreateModelGroupParams) {\n const result = await this.gateway.execute(params);\n this.cache.addItems([result]);\n return result;\n }\n}\n\nexport const CreateModelGroupRepository = RepositoryAbstraction.createImplementation({\n implementation: CreateModelGroupRepositoryImpl,\n dependencies: [ModelGroupsCache, CreateModelGroupGateway]\n});\n"],"mappings":"AACA,SACIA,0BAA0B,IAAIC,qBAAqB,EACnDC,uBAAuB;AAE3B,SAASC,gBAAgB;AAEzB,MAAMC,8BAA8B,CAA4C;EAC5EC,WAAWA,CACCC,KAAiC,EACjCC,OAA0C,EACpD;IAAA,KAFUD,KAAiC,GAAjCA,KAAiC;IAAA,KACjCC,OAA0C,GAA1CA,OAA0C;EACnD;EAEH,MAAMC,OAAOA,CAACC,MAA8B,EAAE;IAC1C,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACH,OAAO,CAACC,OAAO,CAACC,MAAM,CAAC;IACjD,IAAI,CAACH,KAAK,CAACK,QAAQ,CAAC,CAACD,MAAM,CAAC,CAAC;IAC7B,OAAOA,MAAM;EACjB;AACJ;AAEA,OAAO,MAAMV,0BAA0B,GAAGC,qBAAqB,CAACW,oBAAoB,CAAC;EACjFC,cAAc,EAAET,8BAA8B;EAC9CU,YAAY,EAAE,CAACX,gBAAgB,EAAED,uBAAuB;AAC5D,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CreateModelGroupUseCase as UseCaseAbstraction, CreateModelGroupRepository } from "./abstractions.js";
|
|
2
|
+
declare class CreateModelGroupUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
3
|
+
private repository;
|
|
4
|
+
constructor(repository: CreateModelGroupRepository.Interface);
|
|
5
|
+
execute(params: UseCaseAbstraction.Params): Promise<import("../listModelGroups/abstractions.js").ModelGroupDto>;
|
|
6
|
+
}
|
|
7
|
+
export declare const CreateModelGroupUseCase: typeof CreateModelGroupUseCaseImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICreateModelGroupUseCase>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CreateModelGroupUseCase as UseCaseAbstraction, CreateModelGroupRepository } from "./abstractions.js";
|
|
2
|
+
class CreateModelGroupUseCaseImpl {
|
|
3
|
+
constructor(repository) {
|
|
4
|
+
this.repository = repository;
|
|
5
|
+
}
|
|
6
|
+
async execute(params) {
|
|
7
|
+
return this.repository.execute(params);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export const CreateModelGroupUseCase = UseCaseAbstraction.createImplementation({
|
|
11
|
+
implementation: CreateModelGroupUseCaseImpl,
|
|
12
|
+
dependencies: [CreateModelGroupRepository]
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=CreateModelGroupUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CreateModelGroupUseCase","UseCaseAbstraction","CreateModelGroupRepository","CreateModelGroupUseCaseImpl","constructor","repository","execute","params","createImplementation","implementation","dependencies"],"sources":["CreateModelGroupUseCase.ts"],"sourcesContent":["import {\n CreateModelGroupUseCase as UseCaseAbstraction,\n CreateModelGroupRepository\n} from \"./abstractions.js\";\n\nclass CreateModelGroupUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private repository: CreateModelGroupRepository.Interface) {}\n\n async execute(params: UseCaseAbstraction.Params) {\n return this.repository.execute(params);\n }\n}\n\nexport const CreateModelGroupUseCase = UseCaseAbstraction.createImplementation({\n implementation: CreateModelGroupUseCaseImpl,\n dependencies: [CreateModelGroupRepository]\n});\n"],"mappings":"AAAA,SACIA,uBAAuB,IAAIC,kBAAkB,EAC7CC,0BAA0B;AAG9B,MAAMC,2BAA2B,CAAyC;EACtEC,WAAWA,CAASC,UAAgD,EAAE;IAAA,KAAlDA,UAAgD,GAAhDA,UAAgD;EAAG;EAEvE,MAAMC,OAAOA,CAACC,MAAiC,EAAE;IAC7C,OAAO,IAAI,CAACF,UAAU,CAACC,OAAO,CAACC,MAAM,CAAC;EAC1C;AACJ;AAEA,OAAO,MAAMP,uBAAuB,GAAGC,kBAAkB,CAACO,oBAAoB,CAAC;EAC3EC,cAAc,EAAEN,2BAA2B;EAC3CO,YAAY,EAAE,CAACR,0BAA0B;AAC7C,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ModelGroupDto } from "../listModelGroups/abstractions.js";
|
|
2
|
+
export interface CreateModelGroupParams {
|
|
3
|
+
name: string;
|
|
4
|
+
slug: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ICreateModelGroupUseCase {
|
|
9
|
+
execute: (params: CreateModelGroupParams) => Promise<ModelGroupDto>;
|
|
10
|
+
}
|
|
11
|
+
export declare const CreateModelGroupUseCase: import("@webiny/di").Abstraction<ICreateModelGroupUseCase>;
|
|
12
|
+
export declare namespace CreateModelGroupUseCase {
|
|
13
|
+
type Interface = ICreateModelGroupUseCase;
|
|
14
|
+
type Params = CreateModelGroupParams;
|
|
15
|
+
}
|
|
16
|
+
export interface ICreateModelGroupRepository {
|
|
17
|
+
execute: (params: CreateModelGroupParams) => Promise<ModelGroupDto>;
|
|
18
|
+
}
|
|
19
|
+
export declare const CreateModelGroupRepository: import("@webiny/di").Abstraction<ICreateModelGroupRepository>;
|
|
20
|
+
export declare namespace CreateModelGroupRepository {
|
|
21
|
+
type Interface = ICreateModelGroupRepository;
|
|
22
|
+
}
|
|
23
|
+
export interface ICreateModelGroupGateway {
|
|
24
|
+
execute: (data: CreateModelGroupParams) => Promise<ModelGroupDto>;
|
|
25
|
+
}
|
|
26
|
+
export declare const CreateModelGroupGateway: import("@webiny/di").Abstraction<ICreateModelGroupGateway>;
|
|
27
|
+
export declare namespace CreateModelGroupGateway {
|
|
28
|
+
type Interface = ICreateModelGroupGateway;
|
|
29
|
+
}
|