@webiny/app-aco 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.eb196ccd2f
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/components/AdvancedSearch/domain/Filter.d.ts +24 -24
- package/components/FolderTree/List/List.js +15 -1
- package/components/FolderTree/List/List.js.map +1 -1
- package/components/Table/components/Table/Table.d.ts +4 -3
- package/components/Table/components/Table/Table.js.map +1 -1
- package/components/Table/components/Table/TableInner.d.ts +3 -2
- package/components/Table/components/Table/TableInner.js.map +1 -1
- package/components/Table/createTableData.d.ts +5 -5
- package/components/Table/createTableData.js +8 -8
- package/components/Table/createTableData.js.map +1 -1
- package/components/Table/useTableRow.d.ts +6 -2
- package/components/Table/useTableRow.js +10 -3
- package/components/Table/useTableRow.js.map +1 -1
- package/config/AcoConfig.d.ts +12 -7
- package/config/AcoConfig.js +0 -5
- package/config/AcoConfig.js.map +1 -1
- package/config/table/Column.d.ts +8 -3
- package/config/table/Column.js.map +1 -1
- package/config/table/index.d.ts +7 -2
- package/contexts/index.d.ts +1 -1
- package/contexts/index.js +1 -1
- package/contexts/index.js.map +1 -1
- package/features/folders/getFolderAncestors/FolderDto.d.ts +9 -0
- package/features/folders/getFolderAncestors/FolderDto.js +3 -0
- package/features/folders/getFolderAncestors/FolderDto.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.d.ts +4 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.js +12 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.test.d.ts +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.test.js +97 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.test.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsRepository.d.ts +7 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsRepository.js +25 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsRepository.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsUseCase.d.ts +14 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsUseCase.js +18 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsUseCase.js.map +1 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsRepository.d.ts +4 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsRepository.js +3 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsRepository.js.map +1 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsUseCase.d.ts +7 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsUseCase.js +3 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsUseCase.js.map +1 -0
- package/features/folders/getFolderAncestors/index.d.ts +1 -0
- package/features/folders/getFolderAncestors/index.js +3 -0
- package/features/folders/getFolderAncestors/index.js.map +1 -0
- package/features/folders/getFolderAncestors/useGetFolderAncestors.d.ts +3 -0
- package/features/folders/getFolderAncestors/useGetFolderAncestors.js +17 -0
- package/features/folders/getFolderAncestors/useGetFolderAncestors.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsRepository.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCase.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespace.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespaceAndModelId.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/useGetFolderExtensionsFields.d.ts +1 -1
- package/features/folders/index.d.ts +1 -0
- package/features/folders/index.js +1 -0
- package/features/folders/index.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +18 -18
- package/table.types.d.ts +5 -3
- package/table.types.js.map +1 -1
- package/types.d.ts +1 -1
- package/types.js +0 -1
- package/types.js.map +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { folderCacheFactory } from "../cache";
|
|
2
|
+
import { GetFolderAncestorsRepository } from "./GetFolderAncestorsRepository";
|
|
3
|
+
import { GetFolderAncestorsUseCase } from "./GetFolderAncestorsUseCase";
|
|
4
|
+
export class GetFolderAncestors {
|
|
5
|
+
static getInstance(type) {
|
|
6
|
+
const foldersCache = folderCacheFactory.getCache(type);
|
|
7
|
+
const repository = new GetFolderAncestorsRepository(foldersCache);
|
|
8
|
+
return new GetFolderAncestorsUseCase(repository);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=GetFolderAncestors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["folderCacheFactory","GetFolderAncestorsRepository","GetFolderAncestorsUseCase","GetFolderAncestors","getInstance","type","foldersCache","getCache","repository"],"sources":["GetFolderAncestors.ts"],"sourcesContent":["import { folderCacheFactory } from \"../cache\";\nimport { GetFolderAncestorsRepository } from \"./GetFolderAncestorsRepository\";\nimport { GetFolderAncestorsUseCase } from \"./GetFolderAncestorsUseCase\";\nimport type { IGetFolderAncestorsUseCase } from \"./IGetFolderAncestorsUseCase\";\n\nexport class GetFolderAncestors {\n public static getInstance(type: string): IGetFolderAncestorsUseCase {\n const foldersCache = folderCacheFactory.getCache(type);\n const repository = new GetFolderAncestorsRepository(foldersCache);\n return new GetFolderAncestorsUseCase(repository);\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB;AAC3B,SAASC,4BAA4B;AACrC,SAASC,yBAAyB;AAGlC,OAAO,MAAMC,kBAAkB,CAAC;EAC5B,OAAcC,WAAWA,CAACC,IAAY,EAA8B;IAChE,MAAMC,YAAY,GAAGN,kBAAkB,CAACO,QAAQ,CAACF,IAAI,CAAC;IACtD,MAAMG,UAAU,GAAG,IAAIP,4BAA4B,CAACK,YAAY,CAAC;IACjE,OAAO,IAAIJ,yBAAyB,CAACM,UAAU,CAAC;EACpD;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { folderCacheFactory } from "../cache/FoldersCacheFactory";
|
|
2
|
+
import { Folder } from "../Folder";
|
|
3
|
+
import { GetFolderAncestors } from "./GetFolderAncestors";
|
|
4
|
+
describe("GetFolderAncestors", () => {
|
|
5
|
+
const type = "abc";
|
|
6
|
+
const foldersCache = folderCacheFactory.getCache(type);
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
foldersCache.clear();
|
|
9
|
+
foldersCache.addItems([Folder.create({
|
|
10
|
+
id: "folder-1",
|
|
11
|
+
title: "Folder 1",
|
|
12
|
+
slug: "folder-1",
|
|
13
|
+
parentId: null,
|
|
14
|
+
permissions: [],
|
|
15
|
+
type
|
|
16
|
+
}), Folder.create({
|
|
17
|
+
id: "folder-2",
|
|
18
|
+
title: "Folder 2",
|
|
19
|
+
slug: "folder-2",
|
|
20
|
+
parentId: null,
|
|
21
|
+
permissions: [],
|
|
22
|
+
type
|
|
23
|
+
}), Folder.create({
|
|
24
|
+
id: "folder-3",
|
|
25
|
+
title: "Folder 3",
|
|
26
|
+
slug: "folder-3",
|
|
27
|
+
parentId: "folder-2",
|
|
28
|
+
permissions: [],
|
|
29
|
+
type
|
|
30
|
+
}), Folder.create({
|
|
31
|
+
id: "folder-4",
|
|
32
|
+
title: "Folder 4",
|
|
33
|
+
slug: "folder-4",
|
|
34
|
+
parentId: "folder-3",
|
|
35
|
+
permissions: [],
|
|
36
|
+
type
|
|
37
|
+
}), Folder.create({
|
|
38
|
+
id: "folder-5",
|
|
39
|
+
title: "Folder 5",
|
|
40
|
+
slug: "folder-5",
|
|
41
|
+
parentId: "folder-3",
|
|
42
|
+
permissions: [],
|
|
43
|
+
type
|
|
44
|
+
})]);
|
|
45
|
+
});
|
|
46
|
+
it("should return all ancestors of a folder", () => {
|
|
47
|
+
const getFolderAncestors = GetFolderAncestors.getInstance(type);
|
|
48
|
+
const ancestors = getFolderAncestors.execute({
|
|
49
|
+
id: "folder-4"
|
|
50
|
+
});
|
|
51
|
+
expect(ancestors).toEqual([{
|
|
52
|
+
id: "folder-4",
|
|
53
|
+
title: "Folder 4",
|
|
54
|
+
slug: "folder-4",
|
|
55
|
+
permissions: [],
|
|
56
|
+
type,
|
|
57
|
+
parentId: "folder-3"
|
|
58
|
+
}, {
|
|
59
|
+
id: "folder-3",
|
|
60
|
+
title: "Folder 3",
|
|
61
|
+
slug: "folder-3",
|
|
62
|
+
permissions: [],
|
|
63
|
+
type,
|
|
64
|
+
parentId: "folder-2"
|
|
65
|
+
}, {
|
|
66
|
+
id: "folder-2",
|
|
67
|
+
title: "Folder 2",
|
|
68
|
+
slug: "folder-2",
|
|
69
|
+
permissions: [],
|
|
70
|
+
type,
|
|
71
|
+
parentId: null
|
|
72
|
+
}]);
|
|
73
|
+
});
|
|
74
|
+
it("should return an empty array if the folder has no ancestors", () => {
|
|
75
|
+
const getFolderAncestors = GetFolderAncestors.getInstance(type);
|
|
76
|
+
const ancestors = getFolderAncestors.execute({
|
|
77
|
+
id: "folder-1"
|
|
78
|
+
});
|
|
79
|
+
expect(ancestors).toEqual([{
|
|
80
|
+
id: "folder-1",
|
|
81
|
+
title: "Folder 1",
|
|
82
|
+
slug: "folder-1",
|
|
83
|
+
permissions: [],
|
|
84
|
+
type,
|
|
85
|
+
parentId: null
|
|
86
|
+
}]);
|
|
87
|
+
});
|
|
88
|
+
it("should return an empty array if the folder does not exist", () => {
|
|
89
|
+
const getFolderAncestors = GetFolderAncestors.getInstance(type);
|
|
90
|
+
const ancestors = getFolderAncestors.execute({
|
|
91
|
+
id: "non-existing-folder"
|
|
92
|
+
});
|
|
93
|
+
expect(ancestors).toEqual([]);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=GetFolderAncestors.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["folderCacheFactory","Folder","GetFolderAncestors","describe","type","foldersCache","getCache","beforeEach","clear","addItems","create","id","title","slug","parentId","permissions","it","getFolderAncestors","getInstance","ancestors","execute","expect","toEqual"],"sources":["GetFolderAncestors.test.ts"],"sourcesContent":["import { folderCacheFactory } from \"../cache/FoldersCacheFactory\";\nimport { Folder } from \"../Folder\";\nimport { GetFolderAncestors } from \"./GetFolderAncestors\";\n\ndescribe(\"GetFolderAncestors\", () => {\n const type = \"abc\";\n const foldersCache = folderCacheFactory.getCache(type);\n\n beforeEach(() => {\n foldersCache.clear();\n foldersCache.addItems([\n Folder.create({\n id: \"folder-1\",\n title: \"Folder 1\",\n slug: \"folder-1\",\n parentId: null,\n permissions: [],\n type\n }),\n Folder.create({\n id: \"folder-2\",\n title: \"Folder 2\",\n slug: \"folder-2\",\n parentId: null,\n permissions: [],\n type\n }),\n Folder.create({\n id: \"folder-3\",\n title: \"Folder 3\",\n slug: \"folder-3\",\n parentId: \"folder-2\",\n permissions: [],\n type\n }),\n Folder.create({\n id: \"folder-4\",\n title: \"Folder 4\",\n slug: \"folder-4\",\n parentId: \"folder-3\",\n permissions: [],\n type\n }),\n Folder.create({\n id: \"folder-5\",\n title: \"Folder 5\",\n slug: \"folder-5\",\n parentId: \"folder-3\",\n permissions: [],\n type\n })\n ]);\n });\n\n it(\"should return all ancestors of a folder\", () => {\n const getFolderAncestors = GetFolderAncestors.getInstance(type);\n\n const ancestors = getFolderAncestors.execute({\n id: \"folder-4\"\n });\n\n expect(ancestors).toEqual([\n {\n id: \"folder-4\",\n title: \"Folder 4\",\n slug: \"folder-4\",\n permissions: [],\n type,\n parentId: \"folder-3\"\n },\n {\n id: \"folder-3\",\n title: \"Folder 3\",\n slug: \"folder-3\",\n permissions: [],\n type,\n parentId: \"folder-2\"\n },\n {\n id: \"folder-2\",\n title: \"Folder 2\",\n slug: \"folder-2\",\n permissions: [],\n type,\n parentId: null\n }\n ]);\n });\n\n it(\"should return an empty array if the folder has no ancestors\", () => {\n const getFolderAncestors = GetFolderAncestors.getInstance(type);\n\n const ancestors = getFolderAncestors.execute({\n id: \"folder-1\"\n });\n\n expect(ancestors).toEqual([\n {\n id: \"folder-1\",\n title: \"Folder 1\",\n slug: \"folder-1\",\n permissions: [],\n type,\n parentId: null\n }\n ]);\n });\n\n it(\"should return an empty array if the folder does not exist\", () => {\n const getFolderAncestors = GetFolderAncestors.getInstance(type);\n\n const ancestors = getFolderAncestors.execute({\n id: \"non-existing-folder\"\n });\n\n expect(ancestors).toEqual([]);\n });\n});\n"],"mappings":"AAAA,SAASA,kBAAkB;AAC3B,SAASC,MAAM;AACf,SAASC,kBAAkB;AAE3BC,QAAQ,CAAC,oBAAoB,EAAE,MAAM;EACjC,MAAMC,IAAI,GAAG,KAAK;EAClB,MAAMC,YAAY,GAAGL,kBAAkB,CAACM,QAAQ,CAACF,IAAI,CAAC;EAEtDG,UAAU,CAAC,MAAM;IACbF,YAAY,CAACG,KAAK,CAAC,CAAC;IACpBH,YAAY,CAACI,QAAQ,CAAC,CAClBR,MAAM,CAACS,MAAM,CAAC;MACVC,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE,UAAU;MAChBC,QAAQ,EAAE,IAAI;MACdC,WAAW,EAAE,EAAE;MACfX;IACJ,CAAC,CAAC,EACFH,MAAM,CAACS,MAAM,CAAC;MACVC,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE,UAAU;MAChBC,QAAQ,EAAE,IAAI;MACdC,WAAW,EAAE,EAAE;MACfX;IACJ,CAAC,CAAC,EACFH,MAAM,CAACS,MAAM,CAAC;MACVC,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE,UAAU;MAChBC,QAAQ,EAAE,UAAU;MACpBC,WAAW,EAAE,EAAE;MACfX;IACJ,CAAC,CAAC,EACFH,MAAM,CAACS,MAAM,CAAC;MACVC,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE,UAAU;MAChBC,QAAQ,EAAE,UAAU;MACpBC,WAAW,EAAE,EAAE;MACfX;IACJ,CAAC,CAAC,EACFH,MAAM,CAACS,MAAM,CAAC;MACVC,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE,UAAU;MAChBC,QAAQ,EAAE,UAAU;MACpBC,WAAW,EAAE,EAAE;MACfX;IACJ,CAAC,CAAC,CACL,CAAC;EACN,CAAC,CAAC;EAEFY,EAAE,CAAC,yCAAyC,EAAE,MAAM;IAChD,MAAMC,kBAAkB,GAAGf,kBAAkB,CAACgB,WAAW,CAACd,IAAI,CAAC;IAE/D,MAAMe,SAAS,GAAGF,kBAAkB,CAACG,OAAO,CAAC;MACzCT,EAAE,EAAE;IACR,CAAC,CAAC;IAEFU,MAAM,CAACF,SAAS,CAAC,CAACG,OAAO,CAAC,CACtB;MACIX,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE,UAAU;MAChBE,WAAW,EAAE,EAAE;MACfX,IAAI;MACJU,QAAQ,EAAE;IACd,CAAC,EACD;MACIH,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE,UAAU;MAChBE,WAAW,EAAE,EAAE;MACfX,IAAI;MACJU,QAAQ,EAAE;IACd,CAAC,EACD;MACIH,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE,UAAU;MAChBE,WAAW,EAAE,EAAE;MACfX,IAAI;MACJU,QAAQ,EAAE;IACd,CAAC,CACJ,CAAC;EACN,CAAC,CAAC;EAEFE,EAAE,CAAC,6DAA6D,EAAE,MAAM;IACpE,MAAMC,kBAAkB,GAAGf,kBAAkB,CAACgB,WAAW,CAACd,IAAI,CAAC;IAE/D,MAAMe,SAAS,GAAGF,kBAAkB,CAACG,OAAO,CAAC;MACzCT,EAAE,EAAE;IACR,CAAC,CAAC;IAEFU,MAAM,CAACF,SAAS,CAAC,CAACG,OAAO,CAAC,CACtB;MACIX,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE,UAAU;MAChBE,WAAW,EAAE,EAAE;MACfX,IAAI;MACJU,QAAQ,EAAE;IACd,CAAC,CACJ,CAAC;EACN,CAAC,CAAC;EAEFE,EAAE,CAAC,2DAA2D,EAAE,MAAM;IAClE,MAAMC,kBAAkB,GAAGf,kBAAkB,CAACgB,WAAW,CAACd,IAAI,CAAC;IAE/D,MAAMe,SAAS,GAAGF,kBAAkB,CAACG,OAAO,CAAC;MACzCT,EAAE,EAAE;IACR,CAAC,CAAC;IAEFU,MAAM,CAACF,SAAS,CAAC,CAACG,OAAO,CAAC,EAAE,CAAC;EACjC,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IGetFolderAncestorsRepository } from "./IGetFolderAncestorsRepository";
|
|
2
|
+
import type { Folder, ListCache } from "../..";
|
|
3
|
+
export declare class GetFolderAncestorsRepository implements IGetFolderAncestorsRepository {
|
|
4
|
+
private readonly cache;
|
|
5
|
+
constructor(cache: ListCache<Folder>);
|
|
6
|
+
execute(id: string): Folder[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class GetFolderAncestorsRepository {
|
|
2
|
+
constructor(cache) {
|
|
3
|
+
this.cache = cache;
|
|
4
|
+
}
|
|
5
|
+
execute(id) {
|
|
6
|
+
const currentFolders = this.cache.getItems();
|
|
7
|
+
if (!currentFolders.length) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
const folderMap = new Map(currentFolders.map(folder => [folder.id, folder]));
|
|
11
|
+
const result = [];
|
|
12
|
+
let currentFolderId = id;
|
|
13
|
+
while (currentFolderId) {
|
|
14
|
+
const folder = folderMap.get(currentFolderId);
|
|
15
|
+
if (!folder) {
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
result.push(folder);
|
|
19
|
+
currentFolderId = folder.parentId ?? null;
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=GetFolderAncestorsRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GetFolderAncestorsRepository","constructor","cache","execute","id","currentFolders","getItems","length","folderMap","Map","map","folder","result","currentFolderId","get","push","parentId"],"sources":["GetFolderAncestorsRepository.ts"],"sourcesContent":["import type { IGetFolderAncestorsRepository } from \"./IGetFolderAncestorsRepository\";\nimport type { Folder, ListCache } from \"~/features\";\n\nexport class GetFolderAncestorsRepository implements IGetFolderAncestorsRepository {\n private readonly cache: ListCache<Folder>;\n\n constructor(cache: ListCache<Folder>) {\n this.cache = cache;\n }\n\n execute(id: string) {\n const currentFolders = this.cache.getItems();\n\n if (!currentFolders.length) {\n return [];\n }\n\n const folderMap = new Map(currentFolders.map(folder => [folder.id, folder]));\n const result: Folder[] = [];\n\n let currentFolderId: string | null = id;\n\n while (currentFolderId) {\n const folder = folderMap.get(currentFolderId);\n if (!folder) {\n break;\n }\n result.push(folder);\n currentFolderId = folder.parentId ?? null;\n }\n\n return result;\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,4BAA4B,CAA0C;EAG/EC,WAAWA,CAACC,KAAwB,EAAE;IAClC,IAAI,CAACA,KAAK,GAAGA,KAAK;EACtB;EAEAC,OAAOA,CAACC,EAAU,EAAE;IAChB,MAAMC,cAAc,GAAG,IAAI,CAACH,KAAK,CAACI,QAAQ,CAAC,CAAC;IAE5C,IAAI,CAACD,cAAc,CAACE,MAAM,EAAE;MACxB,OAAO,EAAE;IACb;IAEA,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAACJ,cAAc,CAACK,GAAG,CAACC,MAAM,IAAI,CAACA,MAAM,CAACP,EAAE,EAAEO,MAAM,CAAC,CAAC,CAAC;IAC5E,MAAMC,MAAgB,GAAG,EAAE;IAE3B,IAAIC,eAA8B,GAAGT,EAAE;IAEvC,OAAOS,eAAe,EAAE;MACpB,MAAMF,MAAM,GAAGH,SAAS,CAACM,GAAG,CAACD,eAAe,CAAC;MAC7C,IAAI,CAACF,MAAM,EAAE;QACT;MACJ;MACAC,MAAM,CAACG,IAAI,CAACJ,MAAM,CAAC;MACnBE,eAAe,GAAGF,MAAM,CAACK,QAAQ,IAAI,IAAI;IAC7C;IAEA,OAAOJ,MAAM;EACjB;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { GetFolderAncestorsParams, IGetFolderAncestorsUseCase } from "./IGetFolderAncestorsUseCase";
|
|
2
|
+
import type { IGetFolderAncestorsRepository } from "./IGetFolderAncestorsRepository";
|
|
3
|
+
export declare class GetFolderAncestorsUseCase implements IGetFolderAncestorsUseCase {
|
|
4
|
+
private repository;
|
|
5
|
+
constructor(repository: IGetFolderAncestorsRepository);
|
|
6
|
+
execute(params: GetFolderAncestorsParams): {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
permissions: import("@webiny/shared-aco/types").FolderPermission[];
|
|
11
|
+
type: string;
|
|
12
|
+
parentId: string | null;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class GetFolderAncestorsUseCase {
|
|
2
|
+
constructor(repository) {
|
|
3
|
+
this.repository = repository;
|
|
4
|
+
}
|
|
5
|
+
execute(params) {
|
|
6
|
+
const folders = this.repository.execute(params.id);
|
|
7
|
+
return folders.map(folder => ({
|
|
8
|
+
id: folder.id,
|
|
9
|
+
title: folder.title,
|
|
10
|
+
slug: folder.slug,
|
|
11
|
+
permissions: folder.permissions,
|
|
12
|
+
type: folder.type,
|
|
13
|
+
parentId: folder.parentId
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=GetFolderAncestorsUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GetFolderAncestorsUseCase","constructor","repository","execute","params","folders","id","map","folder","title","slug","permissions","type","parentId"],"sources":["GetFolderAncestorsUseCase.ts"],"sourcesContent":["import type {\n GetFolderAncestorsParams,\n IGetFolderAncestorsUseCase\n} from \"./IGetFolderAncestorsUseCase\";\nimport type { IGetFolderAncestorsRepository } from \"./IGetFolderAncestorsRepository\";\n\nexport class GetFolderAncestorsUseCase implements IGetFolderAncestorsUseCase {\n private repository: IGetFolderAncestorsRepository;\n\n constructor(repository: IGetFolderAncestorsRepository) {\n this.repository = repository;\n }\n\n execute(params: GetFolderAncestorsParams) {\n const folders = this.repository.execute(params.id);\n\n return folders.map(folder => ({\n id: folder.id,\n title: folder.title,\n slug: folder.slug,\n permissions: folder.permissions,\n type: folder.type,\n parentId: folder.parentId\n }));\n }\n}\n"],"mappings":"AAMA,OAAO,MAAMA,yBAAyB,CAAuC;EAGzEC,WAAWA,CAACC,UAAyC,EAAE;IACnD,IAAI,CAACA,UAAU,GAAGA,UAAU;EAChC;EAEAC,OAAOA,CAACC,MAAgC,EAAE;IACtC,MAAMC,OAAO,GAAG,IAAI,CAACH,UAAU,CAACC,OAAO,CAACC,MAAM,CAACE,EAAE,CAAC;IAElD,OAAOD,OAAO,CAACE,GAAG,CAACC,MAAM,KAAK;MAC1BF,EAAE,EAAEE,MAAM,CAACF,EAAE;MACbG,KAAK,EAAED,MAAM,CAACC,KAAK;MACnBC,IAAI,EAAEF,MAAM,CAACE,IAAI;MACjBC,WAAW,EAAEH,MAAM,CAACG,WAAW;MAC/BC,IAAI,EAAEJ,MAAM,CAACI,IAAI;MACjBC,QAAQ,EAAEL,MAAM,CAACK;IACrB,CAAC,CAAC,CAAC;EACP;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["IGetFolderAncestorsRepository.ts"],"sourcesContent":["import type { Folder } from \"~/features\";\n\nexport interface IGetFolderAncestorsRepository {\n execute: (id: string) => Folder[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["IGetFolderAncestorsUseCase.ts"],"sourcesContent":["import type { FolderDto } from \"./FolderDto.js\";\n\nexport interface GetFolderAncestorsParams {\n id: string;\n}\n\nexport interface IGetFolderAncestorsUseCase {\n execute: (params: GetFolderAncestorsParams) => FolderDto[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./useGetFolderAncestors";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useGetFolderAncestors\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useFoldersType } from "../../../hooks";
|
|
3
|
+
import { GetFolderAncestors } from "./GetFolderAncestors";
|
|
4
|
+
export const useGetFolderAncestors = () => {
|
|
5
|
+
const type = useFoldersType();
|
|
6
|
+
const getFolderAncestors = useCallback(id => {
|
|
7
|
+
const instance = GetFolderAncestors.getInstance(type);
|
|
8
|
+
return instance.execute({
|
|
9
|
+
id
|
|
10
|
+
});
|
|
11
|
+
}, [type]);
|
|
12
|
+
return {
|
|
13
|
+
getFolderAncestors
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=useGetFolderAncestors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useFoldersType","GetFolderAncestors","useGetFolderAncestors","type","getFolderAncestors","id","instance","getInstance","execute"],"sources":["useGetFolderAncestors.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useFoldersType } from \"~/hooks\";\nimport { GetFolderAncestors } from \"~/features/folders/getFolderAncestors/GetFolderAncestors\";\n\nexport const useGetFolderAncestors = () => {\n const type = useFoldersType();\n\n const getFolderAncestors = useCallback(\n (id: string) => {\n const instance = GetFolderAncestors.getInstance(type);\n return instance.execute({ id });\n },\n [type]\n );\n\n return {\n getFolderAncestors\n };\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,cAAc;AACvB,SAASC,kBAAkB;AAE3B,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACvC,MAAMC,IAAI,GAAGH,cAAc,CAAC,CAAC;EAE7B,MAAMI,kBAAkB,GAAGL,WAAW,CACjCM,EAAU,IAAK;IACZ,MAAMC,QAAQ,GAAGL,kBAAkB,CAACM,WAAW,CAACJ,IAAI,CAAC;IACrD,OAAOG,QAAQ,CAACE,OAAO,CAAC;MAAEH;IAAG,CAAC,CAAC;EACnC,CAAC,EACD,CAACF,IAAI,CACT,CAAC;EAED,OAAO;IACHC;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ export declare class GetFolderExtensionsFieldsRepository implements IGetFolderEx
|
|
|
12
12
|
label: string;
|
|
13
13
|
helpText?: string | undefined;
|
|
14
14
|
placeholderText?: string | undefined;
|
|
15
|
-
validation?: (import("@webiny/
|
|
15
|
+
validation?: (import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator | import("@webiny/validation/types").Validator)[] | undefined;
|
|
16
16
|
listValidation?: import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator[] | undefined;
|
|
17
17
|
multipleValues?: boolean | undefined;
|
|
18
18
|
predefinedValues?: import("@webiny/app-headless-cms-common/types").CmsEditorFieldPredefinedValues | undefined;
|
|
@@ -13,7 +13,7 @@ export declare class GetFolderExtensionsFieldsUseCase implements IGetFolderExten
|
|
|
13
13
|
label: string;
|
|
14
14
|
helpText?: string | undefined;
|
|
15
15
|
placeholderText?: string | undefined;
|
|
16
|
-
validation?: (import("@webiny/
|
|
16
|
+
validation?: (import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator | import("@webiny/validation/types").Validator)[] | undefined;
|
|
17
17
|
listValidation?: import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator[] | undefined;
|
|
18
18
|
multipleValues?: boolean | undefined;
|
|
19
19
|
predefinedValues?: import("@webiny/app-headless-cms-common/types").CmsEditorFieldPredefinedValues | undefined;
|
|
@@ -13,7 +13,7 @@ export declare class GetFolderExtensionsFieldsUseCaseWithNamespace implements IG
|
|
|
13
13
|
label: string;
|
|
14
14
|
helpText?: string | undefined;
|
|
15
15
|
placeholderText?: string | undefined;
|
|
16
|
-
validation?: (import("@webiny/
|
|
16
|
+
validation?: (import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator | import("@webiny/validation/types").Validator)[] | undefined;
|
|
17
17
|
listValidation?: import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator[] | undefined;
|
|
18
18
|
multipleValues?: boolean | undefined;
|
|
19
19
|
predefinedValues?: import("@webiny/app-headless-cms-common/types").CmsEditorFieldPredefinedValues | undefined;
|
|
@@ -14,7 +14,7 @@ export declare class GetFolderExtensionsFieldsUseCaseWithNamespaceAndModelId imp
|
|
|
14
14
|
label: string;
|
|
15
15
|
helpText?: string | undefined;
|
|
16
16
|
placeholderText?: string | undefined;
|
|
17
|
-
validation?: (import("@webiny/
|
|
17
|
+
validation?: (import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator | import("@webiny/validation/types").Validator)[] | undefined;
|
|
18
18
|
listValidation?: import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator[] | undefined;
|
|
19
19
|
multipleValues?: boolean | undefined;
|
|
20
20
|
predefinedValues?: import("@webiny/app-headless-cms-common/types").CmsEditorFieldPredefinedValues | undefined;
|
|
@@ -9,7 +9,7 @@ export declare const useGetFolderExtensionsFields: () => {
|
|
|
9
9
|
label: string;
|
|
10
10
|
helpText?: string | undefined;
|
|
11
11
|
placeholderText?: string | undefined;
|
|
12
|
-
validation?: (import("@webiny/
|
|
12
|
+
validation?: (import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator | import("@webiny/validation/types").Validator)[] | undefined;
|
|
13
13
|
listValidation?: import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator[] | undefined;
|
|
14
14
|
multipleValues?: boolean | undefined;
|
|
15
15
|
predefinedValues?: import("@webiny/app-headless-cms-common/types").CmsEditorFieldPredefinedValues | undefined;
|
|
@@ -4,6 +4,7 @@ export * from "./createFolder";
|
|
|
4
4
|
export * from "./deleteFolder";
|
|
5
5
|
export * from "./getDescendantFolders";
|
|
6
6
|
export * from "./getFolder";
|
|
7
|
+
export * from "./getFolderAncestors";
|
|
7
8
|
export * from "./getFolderExtensionsFields";
|
|
8
9
|
export * from "./getFolderHierarchy";
|
|
9
10
|
export * from "./getFolderLevelPermission";
|
|
@@ -4,6 +4,7 @@ export * from "./createFolder";
|
|
|
4
4
|
export * from "./deleteFolder";
|
|
5
5
|
export * from "./getDescendantFolders";
|
|
6
6
|
export * from "./getFolder";
|
|
7
|
+
export * from "./getFolderAncestors";
|
|
7
8
|
export * from "./getFolderExtensionsFields";
|
|
8
9
|
export * from "./getFolderHierarchy";
|
|
9
10
|
export * from "./getFolderLevelPermission";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Folder\";\nexport * from \"./cache\";\nexport * from \"./createFolder\";\nexport * from \"./deleteFolder\";\nexport * from \"./getDescendantFolders\";\nexport * from \"./getFolder\";\nexport * from \"./getFolderExtensionsFields\";\nexport * from \"./getFolderHierarchy\";\nexport * from \"./getFolderLevelPermission\";\nexport * from \"./getFolderModel\";\nexport * from \"./listFolders\";\nexport * from \"./listFoldersByParentIds\";\nexport * from \"./updateFolder\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Folder\";\nexport * from \"./cache\";\nexport * from \"./createFolder\";\nexport * from \"./deleteFolder\";\nexport * from \"./getDescendantFolders\";\nexport * from \"./getFolder\";\nexport * from \"./getFolderAncestors\";\nexport * from \"./getFolderExtensionsFields\";\nexport * from \"./getFolderHierarchy\";\nexport * from \"./getFolderLevelPermission\";\nexport * from \"./getFolderModel\";\nexport * from \"./listFolders\";\nexport * from \"./listFoldersByParentIds\";\nexport * from \"./updateFolder\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./app\";\nexport * from \"./components\";\nexport * from \"./config\";\nexport * from \"./contexts\";\nexport * from \"./hooks\";\nexport * from \"./features\";\nexport * from \"./dialogs\";\nexport * from \"./sorting\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./app\";\nexport * from \"./components\";\nexport * from \"./config\";\nexport * from \"./contexts\";\nexport * from \"./hooks\";\nexport * from \"./features\";\nexport * from \"./dialogs\";\nexport * from \"./sorting\";\nexport type { TableRow, FolderTableRow, RecordTableRow } from \"./table.types\";\nexport type { ListMeta } from \"./types\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA0B","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-aco",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.eb196ccd2f",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@apollo/react-hooks": "3.1.5",
|
|
15
|
-
"@webiny/admin-ui": "0.0.0-unstable.
|
|
16
|
-
"@webiny/app": "0.0.0-unstable.
|
|
17
|
-
"@webiny/app-admin": "0.0.0-unstable.
|
|
18
|
-
"@webiny/app-headless-cms-common": "0.0.0-unstable.
|
|
19
|
-
"@webiny/app-security": "0.0.0-unstable.
|
|
20
|
-
"@webiny/app-utils": "0.0.0-unstable.
|
|
21
|
-
"@webiny/app-wcp": "0.0.0-unstable.
|
|
22
|
-
"@webiny/form": "0.0.0-unstable.
|
|
23
|
-
"@webiny/icons": "0.0.0-unstable.
|
|
24
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
25
|
-
"@webiny/react-properties": "0.0.0-unstable.
|
|
26
|
-
"@webiny/react-router": "0.0.0-unstable.
|
|
27
|
-
"@webiny/shared-aco": "0.0.0-unstable.
|
|
28
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
29
|
-
"@webiny/validation": "0.0.0-unstable.
|
|
15
|
+
"@webiny/admin-ui": "0.0.0-unstable.eb196ccd2f",
|
|
16
|
+
"@webiny/app": "0.0.0-unstable.eb196ccd2f",
|
|
17
|
+
"@webiny/app-admin": "0.0.0-unstable.eb196ccd2f",
|
|
18
|
+
"@webiny/app-headless-cms-common": "0.0.0-unstable.eb196ccd2f",
|
|
19
|
+
"@webiny/app-security": "0.0.0-unstable.eb196ccd2f",
|
|
20
|
+
"@webiny/app-utils": "0.0.0-unstable.eb196ccd2f",
|
|
21
|
+
"@webiny/app-wcp": "0.0.0-unstable.eb196ccd2f",
|
|
22
|
+
"@webiny/form": "0.0.0-unstable.eb196ccd2f",
|
|
23
|
+
"@webiny/icons": "0.0.0-unstable.eb196ccd2f",
|
|
24
|
+
"@webiny/plugins": "0.0.0-unstable.eb196ccd2f",
|
|
25
|
+
"@webiny/react-properties": "0.0.0-unstable.eb196ccd2f",
|
|
26
|
+
"@webiny/react-router": "0.0.0-unstable.eb196ccd2f",
|
|
27
|
+
"@webiny/shared-aco": "0.0.0-unstable.eb196ccd2f",
|
|
28
|
+
"@webiny/utils": "0.0.0-unstable.eb196ccd2f",
|
|
29
|
+
"@webiny/validation": "0.0.0-unstable.eb196ccd2f",
|
|
30
30
|
"dot-prop-immutable": "2.1.1",
|
|
31
31
|
"graphql": "15.9.0",
|
|
32
32
|
"graphql-tag": "2.12.6",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/react": "18.2.79",
|
|
46
|
-
"@webiny/project-utils": "0.0.0-unstable.
|
|
46
|
+
"@webiny/project-utils": "0.0.0-unstable.eb196ccd2f",
|
|
47
47
|
"apollo-client": "2.6.10",
|
|
48
48
|
"apollo-link": "1.2.14",
|
|
49
49
|
"rimraf": "6.0.1",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"build": "node ../cli/bin.js run build",
|
|
58
58
|
"watch": "node ../cli/bin.js run watch"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "eb196ccd2f32296e10f7add6dd7220d4e3abece4"
|
|
61
61
|
}
|
package/table.types.d.ts
CHANGED
|
@@ -16,13 +16,15 @@ export interface SearchRecordItem<TData extends GenericSearchData = GenericSearc
|
|
|
16
16
|
}
|
|
17
17
|
export type MovableSearchRecordItem = Pick<SearchRecordItem, "id" | "location">;
|
|
18
18
|
export type DeletableSearchRecordItem = Pick<SearchRecordItem, "id" | "location">;
|
|
19
|
-
export interface
|
|
19
|
+
export interface TableRow<TData = unknown> {
|
|
20
|
+
id: string;
|
|
20
21
|
$selectable: boolean;
|
|
21
22
|
$type: string;
|
|
23
|
+
data: TData;
|
|
22
24
|
}
|
|
23
|
-
export interface
|
|
25
|
+
export interface FolderTableRow extends TableRow<FolderItem> {
|
|
24
26
|
$type: "FOLDER";
|
|
25
27
|
}
|
|
26
|
-
export interface
|
|
28
|
+
export interface RecordTableRow<TData> extends TableRow<TData> {
|
|
27
29
|
$type: "RECORD";
|
|
28
30
|
}
|
package/table.types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["table.types.ts"],"sourcesContent":["import type { CmsIdentity, FolderItem, GenericSearchData, Location } from \"~/types\";\n\nexport interface SearchRecordItem<TData extends GenericSearchData = GenericSearchData> {\n id: string;\n type: string;\n title: string;\n content: string;\n location: Location;\n data: TData;\n tags: string[];\n createdOn: string;\n createdBy: CmsIdentity;\n savedOn: string;\n savedBy: CmsIdentity;\n modifiedOn: string | null;\n modifiedBy: CmsIdentity | null;\n}\n\nexport type MovableSearchRecordItem = Pick<SearchRecordItem, \"id\" | \"location\">;\n\nexport type DeletableSearchRecordItem = Pick<SearchRecordItem, \"id\" | \"location\">;\n\nexport interface
|
|
1
|
+
{"version":3,"names":[],"sources":["table.types.ts"],"sourcesContent":["import type { CmsIdentity, FolderItem, GenericSearchData, Location } from \"~/types\";\n\nexport interface SearchRecordItem<TData extends GenericSearchData = GenericSearchData> {\n id: string;\n type: string;\n title: string;\n content: string;\n location: Location;\n data: TData;\n tags: string[];\n createdOn: string;\n createdBy: CmsIdentity;\n savedOn: string;\n savedBy: CmsIdentity;\n modifiedOn: string | null;\n modifiedBy: CmsIdentity | null;\n}\n\nexport type MovableSearchRecordItem = Pick<SearchRecordItem, \"id\" | \"location\">;\n\nexport type DeletableSearchRecordItem = Pick<SearchRecordItem, \"id\" | \"location\">;\n\nexport interface TableRow<TData = unknown> {\n id: string;\n $selectable: boolean;\n $type: string;\n data: TData;\n}\n\nexport interface FolderTableRow extends TableRow<FolderItem> {\n $type: \"FOLDER\";\n}\n\nexport interface RecordTableRow<TData> extends TableRow<TData> {\n $type: \"RECORD\";\n}\n"],"mappings":"","ignoreList":[]}
|
package/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CmsIdentity, CmsModel, CmsModelField, CmsModelFieldSettings } from "@webiny/app-headless-cms-common/types";
|
|
2
2
|
import type { FolderPermission } from "@webiny/shared-aco/types";
|
|
3
|
-
export { CmsIdentity } from "@webiny/app-headless-cms-common/types";
|
|
3
|
+
export type { CmsIdentity } from "@webiny/app-headless-cms-common/types";
|
|
4
4
|
export * from "@webiny/shared-aco/flp/flp.types";
|
|
5
5
|
export * from "./graphql/records/types";
|
|
6
6
|
export * from "./table.types";
|
package/types.js
CHANGED
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["LoadingActionsEnum","init","list","listMore","get","create","update","delete","move"],"sources":["types.ts"],"sourcesContent":["import type {\n CmsIdentity,\n CmsModel,\n CmsModelField,\n CmsModelFieldSettings\n} from \"@webiny/app-headless-cms-common/types\";\nimport type { FolderPermission } from \"@webiny/shared-aco/types\";\n\nexport type { CmsIdentity } from \"@webiny/app-headless-cms-common/types\";\nexport * from \"@webiny/shared-aco/flp/flp.types\";\nexport * from \"~/graphql/records/types\";\nexport * from \"~/table.types\";\n\nexport interface FolderLevelPermissionsTarget<TMeta = Record<string, any>> {\n id: string;\n target: string;\n name: string;\n type: string;\n meta: TMeta;\n}\n\nexport interface FolderItem {\n id: string;\n title: string;\n slug: string;\n permissions: FolderPermission[];\n hasNonInheritedPermissions: boolean;\n canManagePermissions: boolean;\n canManageStructure: boolean;\n canManageContent: boolean;\n type: string;\n parentId: string | null;\n path: string;\n createdBy: CmsIdentity;\n createdOn: string;\n savedBy: CmsIdentity;\n savedOn: string;\n modifiedBy: CmsIdentity | null;\n modifiedOn: string | null;\n extensions: Record<string, any>;\n}\n\nexport type GenericSearchData = {\n [key: string]: any;\n};\n\nexport interface Location {\n folderId: string;\n}\n\nexport interface TagItem {\n tag: string;\n}\n\nexport type Loading<T extends string> = { [P in T]?: boolean };\n\nexport type LoadingActions =\n | \"INIT\"\n | \"LIST\"\n | \"LIST_MORE\"\n | \"GET\"\n | \"CREATE\"\n | \"UPDATE\"\n | \"DELETE\"\n | \"MOVE\";\n\nexport const LoadingActionsEnum = {\n init: \"INIT\",\n list: \"LIST\",\n listMore: \"LIST_MORE\",\n get: \"GET\",\n create: \"CREATE\",\n update: \"UPDATE\",\n delete: \"DELETE\",\n move: \"MOVE\"\n};\n\nexport interface AcoError {\n code: string;\n message: string;\n data?: Record<string, any> | null;\n}\n\nexport type ListSearchRecordsSortItem = `${string}_ASC` | `${string}_DESC`;\nexport type ListSearchRecordsSort = ListSearchRecordsSortItem[];\n\nexport interface ListMeta {\n cursor: string | null;\n totalCount: number;\n hasMoreItems: boolean;\n}\n\nexport interface ListFoldersResponse {\n aco: {\n listFolders: {\n data: FolderItem[] | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface ListFoldersQueryVariables {\n type: string;\n limit: number;\n sort?: Record<string, any>;\n after?: string | null;\n}\n\nexport interface GetFolderResponse {\n aco: {\n getFolder: {\n data: FolderItem | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface GetFolderQueryVariables {\n id: string;\n}\n\nexport interface UpdateFolderResponse {\n aco: {\n updateFolder: {\n data: FolderItem;\n error: AcoError | null;\n };\n };\n}\n\nexport interface UpdateFolderVariables {\n id: string;\n data: Partial<\n Omit<\n FolderItem,\n \"id\" | \"createdOn\" | \"createdBy\" | \"savedOn\" | \"savedBy\" | \"modifiedOn\" | \"modifiedBy\"\n >\n >;\n}\n\nexport interface CreateFolderResponse {\n aco: {\n createFolder: {\n data: FolderItem;\n error: AcoError | null;\n };\n };\n}\n\nexport interface CreateFolderVariables {\n data: Omit<\n FolderItem,\n | \"id\"\n | \"createdOn\"\n | \"createdBy\"\n | \"savedOn\"\n | \"savedBy\"\n | \"modifiedOn\"\n | \"modifiedBy\"\n | \"hasNonInheritedPermissions\"\n | \"canManageContent\"\n | \"canManagePermissions\"\n | \"canManageStructure\"\n >;\n}\n\nexport interface DeleteFolderVariables {\n id: string;\n}\n\nexport interface DeleteFolderResponse {\n aco: {\n deleteFolder: {\n data: boolean;\n error: AcoError | null;\n };\n };\n}\n\nexport interface DndFolderItemData {\n isFocused?: boolean;\n}\n\n/**\n * This type will be removed when all apps migrate to the CMS.\n * @deprecated\n */\nexport type AcoAppMode = \"aco\" | \"cms\";\n\n/**\n * Apps.\n */\nexport interface AcoModel extends CmsModel {\n fields: AcoModelField[];\n}\n\nexport interface AcoModelFieldSettingsAco {\n enabled?: boolean;\n header?: boolean;\n}\n\nexport interface AcoModelFieldSettings {\n aco?: AcoModelFieldSettingsAco;\n}\n\nexport interface AcoModelField extends CmsModelField {\n settings?: CmsModelFieldSettings & AcoModelFieldSettings;\n}\n\nexport interface AcoApp {\n id: string;\n model: AcoModel;\n getFields: () => AcoModelField[];\n}\n"],"mappings":"AASA,cAAc,kCAAkC;AAChD;AACA;AAuDA,OAAO,MAAMA,kBAAkB,GAAG;EAC9BC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,QAAQ,EAAE,WAAW;EACrBC,GAAG,EAAE,KAAK;EACVC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE;AACV,CAAC;;AA4GD;AACA;AACA;AACA;;AAGA;AACA;AACA","ignoreList":[]}
|