@webiny/api-page-builder-import-export 0.0.0-unstable.1145e7667f → 0.0.0-unstable.15c0a8dfc8
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/client.d.ts +1 -1
- package/client.js +12 -21
- package/client.js.map +1 -1
- package/export/combine/blocksHandler.d.ts +2 -2
- package/export/combine/blocksHandler.js +4 -2
- package/export/combine/blocksHandler.js.map +1 -1
- package/export/combine/formsHandler.d.ts +2 -2
- package/export/combine/formsHandler.js +4 -2
- package/export/combine/formsHandler.js.map +1 -1
- package/export/combine/index.d.ts +2 -2
- package/export/combine/index.js +24 -20
- package/export/combine/index.js.map +1 -1
- package/export/combine/templatesHandler.d.ts +2 -2
- package/export/combine/templatesHandler.js +4 -2
- package/export/combine/templatesHandler.js.map +1 -1
- package/export/pages/ExportPagesCleanup.d.ts +5 -0
- package/export/pages/ExportPagesCleanup.js +82 -0
- package/export/pages/ExportPagesCleanup.js.map +1 -0
- package/export/pages/ExportPagesController.d.ts +5 -0
- package/export/pages/ExportPagesController.js +31 -0
- package/export/pages/ExportPagesController.js.map +1 -0
- package/export/pages/ExportPagesZipPages.d.ts +5 -0
- package/export/pages/ExportPagesZipPages.js +23 -0
- package/export/pages/ExportPagesZipPages.js.map +1 -0
- package/export/pages/controller/CombineZippedPages.d.ts +5 -0
- package/export/pages/controller/CombineZippedPages.js +75 -0
- package/export/pages/controller/CombineZippedPages.js.map +1 -0
- package/export/pages/controller/CreateZipPagesTasks.d.ts +8 -0
- package/export/pages/controller/CreateZipPagesTasks.js +103 -0
- package/export/pages/controller/CreateZipPagesTasks.js.map +1 -0
- package/export/pages/controller/ProcessZipPagesTasks.d.ts +6 -0
- package/export/pages/controller/ProcessZipPagesTasks.js +61 -0
- package/export/pages/controller/ProcessZipPagesTasks.js.map +1 -0
- package/export/pages/types.d.ts +53 -0
- package/export/pages/types.js +26 -0
- package/export/pages/types.js.map +1 -0
- package/export/pages/utils.d.ts +2 -0
- package/export/pages/utils.js +13 -0
- package/export/pages/utils.js.map +1 -0
- package/export/pages/zipPages/ZipPages.d.ts +5 -0
- package/export/pages/zipPages/ZipPages.js +100 -0
- package/export/pages/zipPages/ZipPages.js.map +1 -0
- package/export/pages/zipPages/ZipPagesDataManager.d.ts +14 -0
- package/export/pages/zipPages/ZipPagesDataManager.js +46 -0
- package/export/pages/zipPages/ZipPagesDataManager.js.map +1 -0
- package/export/pages/zipPages/getPageFactory.d.ts +4 -0
- package/export/pages/zipPages/getPageFactory.js +38 -0
- package/export/pages/zipPages/getPageFactory.js.map +1 -0
- package/export/process/blocksHandler.d.ts +2 -2
- package/export/process/blocksHandler.js +13 -6
- package/export/process/blocksHandler.js.map +1 -1
- package/export/process/exporters/BlockExporter.d.ts +12 -0
- package/export/process/exporters/BlockExporter.js +57 -0
- package/export/process/exporters/BlockExporter.js.map +1 -0
- package/export/process/exporters/FormExporter.d.ts +9 -0
- package/export/process/exporters/FormExporter.js +36 -0
- package/export/process/exporters/FormExporter.js.map +1 -0
- package/export/process/exporters/PageExporter.d.ts +18 -0
- package/export/process/exporters/PageExporter.js +59 -0
- package/export/process/exporters/PageExporter.js.map +1 -0
- package/export/process/exporters/PageTemplateExporter.d.ts +11 -0
- package/export/process/exporters/PageTemplateExporter.js +58 -0
- package/export/process/exporters/PageTemplateExporter.js.map +1 -0
- package/export/process/formsHandler.d.ts +2 -2
- package/export/process/formsHandler.js +8 -6
- package/export/process/formsHandler.js.map +1 -1
- package/export/process/index.d.ts +2 -2
- package/export/process/index.js +24 -20
- package/export/process/index.js.map +1 -1
- package/export/process/templatesHandler.d.ts +2 -2
- package/export/process/templatesHandler.js +8 -6
- package/export/process/templatesHandler.js.map +1 -1
- package/export/s3Stream.d.ts +12 -10
- package/export/s3Stream.js +27 -23
- package/export/s3Stream.js.map +1 -1
- package/export/utils.d.ts +10 -15
- package/export/utils.js +27 -46
- package/export/utils.js.map +1 -1
- package/export/zipper.d.ts +7 -6
- package/export/zipper.js +18 -22
- package/export/zipper.js.map +1 -1
- package/graphql/crud/blocks.crud.d.ts +1 -1
- package/graphql/crud/blocks.crud.js +49 -27
- package/graphql/crud/blocks.crud.js.map +1 -1
- package/graphql/crud/forms.crud.d.ts +1 -1
- package/graphql/crud/forms.crud.js +51 -18
- package/graphql/crud/forms.crud.js.map +1 -1
- package/graphql/crud/importExportTasks.crud.d.ts +2 -2
- package/graphql/crud/importExportTasks.crud.js +144 -111
- package/graphql/crud/importExportTasks.crud.js.map +1 -1
- package/graphql/crud/pages.crud.d.ts +1 -1
- package/graphql/crud/pages.crud.js +238 -121
- package/graphql/crud/pages.crud.js.map +1 -1
- package/graphql/crud/templates.crud.d.ts +1 -1
- package/graphql/crud/templates.crud.js +48 -16
- package/graphql/crud/templates.crud.js.map +1 -1
- package/graphql/crud.d.ts +2 -2
- package/graphql/crud.js +3 -1
- package/graphql/crud.js.map +1 -1
- package/graphql/graphql/blocks.gql.d.ts +2 -2
- package/graphql/graphql/blocks.gql.js +7 -7
- package/graphql/graphql/blocks.gql.js.map +1 -1
- package/graphql/graphql/forms.gql.d.ts +2 -2
- package/graphql/graphql/forms.gql.js +6 -6
- package/graphql/graphql/forms.gql.js.map +1 -1
- package/graphql/graphql/importExportTasks.gql.d.ts +2 -2
- package/graphql/graphql/importExportTasks.gql.js +7 -7
- package/graphql/graphql/importExportTasks.gql.js.map +1 -1
- package/graphql/graphql/pages.gql.d.ts +2 -2
- package/graphql/graphql/pages.gql.js +103 -14
- package/graphql/graphql/pages.gql.js.map +1 -1
- package/graphql/graphql/templates.gql.d.ts +2 -2
- package/graphql/graphql/templates.gql.js +6 -6
- package/graphql/graphql/templates.gql.js.map +1 -1
- package/graphql/graphql/utils/resolve.d.ts +3 -3
- package/graphql/graphql/utils/resolve.js +16 -5
- package/graphql/graphql/utils/resolve.js.map +1 -1
- package/graphql/graphql.d.ts +1 -1
- package/graphql/graphql.js +3 -2
- package/graphql/graphql.js.map +1 -1
- package/graphql/index.d.ts +2 -2
- package/graphql/index.js +5 -2
- package/graphql/index.js.map +1 -1
- package/graphql/types.d.ts +173 -33
- package/graphql/types.js +3 -1
- package/graphql/types.js.map +1 -1
- package/import/constants.js +5 -6
- package/import/constants.js.map +1 -1
- package/import/create/blocksHandler.d.ts +2 -2
- package/import/create/blocksHandler.js +3 -3
- package/import/create/blocksHandler.js.map +1 -1
- package/import/create/formsHandler.d.ts +2 -2
- package/import/create/formsHandler.js +3 -1
- package/import/create/formsHandler.js.map +1 -1
- package/import/create/index.d.ts +2 -2
- package/import/create/index.js +24 -20
- package/import/create/index.js.map +1 -1
- package/import/create/pagesHandler.d.ts +2 -2
- package/import/create/pagesHandler.js +3 -1
- package/import/create/pagesHandler.js.map +1 -1
- package/import/create/templatesHandler.d.ts +2 -2
- package/import/create/templatesHandler.js +3 -1
- package/import/create/templatesHandler.js.map +1 -1
- package/import/pages/ImportPagesController.d.ts +5 -0
- package/import/pages/ImportPagesController.js +29 -0
- package/import/pages/ImportPagesController.js.map +1 -0
- package/import/pages/ImportPagesProcessPages.d.ts +6 -0
- package/import/pages/ImportPagesProcessPages.js +112 -0
- package/import/pages/ImportPagesProcessPages.js.map +1 -0
- package/import/pages/controller/ImportPagesProcessPagesChecker.d.ts +6 -0
- package/import/pages/controller/ImportPagesProcessPagesChecker.js +40 -0
- package/import/pages/controller/ImportPagesProcessPagesChecker.js.map +1 -0
- package/import/pages/controller/ImportPagesProcessZipFile.d.ts +5 -0
- package/import/pages/controller/ImportPagesProcessZipFile.js +71 -0
- package/import/pages/controller/ImportPagesProcessZipFile.js.map +1 -0
- package/import/{process/pages → pages/process}/importPage.d.ts +3 -4
- package/import/{process/pages → pages/process}/importPage.js +8 -6
- package/import/pages/process/importPage.js.map +1 -0
- package/import/pages/types.d.ts +48 -0
- package/import/pages/types.js +20 -0
- package/import/pages/types.js.map +1 -0
- package/import/process/blocks/ElementIdsProcessor.d.ts +5 -0
- package/import/process/blocks/ElementIdsProcessor.js +26 -0
- package/import/process/blocks/ElementIdsProcessor.js.map +1 -0
- package/import/process/blocks/blocksHandler.d.ts +2 -2
- package/import/process/blocks/blocksHandler.js +6 -6
- package/import/process/blocks/blocksHandler.js.map +1 -1
- package/import/process/blocks/importBlock.d.ts +4 -4
- package/import/process/blocks/importBlock.js +38 -29
- package/import/process/blocks/importBlock.js.map +1 -1
- package/import/process/forms/formsHandler.d.ts +2 -2
- package/import/process/forms/formsHandler.js +4 -2
- package/import/process/forms/formsHandler.js.map +1 -1
- package/import/process/forms/importForm.d.ts +2 -2
- package/import/process/forms/importForm.js +6 -2
- package/import/process/forms/importForm.js.map +1 -1
- package/import/process/index.d.ts +2 -2
- package/import/process/index.js +24 -20
- package/import/process/index.js.map +1 -1
- package/import/process/templates/importTemplate.d.ts +3 -3
- package/import/process/templates/importTemplate.js +6 -2
- package/import/process/templates/importTemplate.js.map +1 -1
- package/import/process/templates/templatesHandler.d.ts +2 -2
- package/import/process/templates/templatesHandler.js +6 -2
- package/import/process/templates/templatesHandler.js.map +1 -1
- package/import/utils/deleteS3Folder.js +3 -1
- package/import/utils/deleteS3Folder.js.map +1 -1
- package/import/utils/extractAndUploadZipFileContents.d.ts +1 -1
- package/import/utils/extractAndUploadZipFileContents.js +9 -5
- package/import/utils/extractAndUploadZipFileContents.js.map +1 -1
- package/import/utils/extractZipAndUploadToS3.d.ts +1 -1
- package/import/utils/extractZipAndUploadToS3.js +3 -1
- package/import/utils/extractZipAndUploadToS3.js.map +1 -1
- package/import/utils/getFileNameWithoutExt.js +3 -1
- package/import/utils/getFileNameWithoutExt.js.map +1 -1
- package/import/utils/index.js +3 -1
- package/import/utils/index.js.map +1 -1
- package/import/utils/initialStats.js +3 -1
- package/import/utils/initialStats.js.map +1 -1
- package/import/utils/prepareDataDirMap.d.ts +1 -1
- package/import/utils/prepareDataDirMap.js +3 -1
- package/import/utils/prepareDataDirMap.js.map +1 -1
- package/import/utils/updateFilesInData.d.ts +1 -1
- package/import/utils/updateFilesInData.js +5 -2
- package/import/utils/updateFilesInData.js.map +1 -1
- package/import/utils/uploadAssets.d.ts +3 -3
- package/import/utils/uploadAssets.js +56 -15
- package/import/utils/uploadAssets.js.map +1 -1
- package/import/utils/uploadFilesFromS3.d.ts +3 -3
- package/import/utils/uploadFilesFromS3.js +4 -2
- package/import/utils/uploadFilesFromS3.js.map +1 -1
- package/mockSecurity.d.ts +1 -1
- package/mockSecurity.js +3 -2
- package/mockSecurity.js.map +1 -1
- package/package.json +37 -54
- package/tasks/common/ChildTasksCleanup.d.ts +12 -0
- package/tasks/common/ChildTasksCleanup.js +64 -0
- package/tasks/common/ChildTasksCleanup.js.map +1 -0
- package/tasks/index.d.ts +1 -0
- package/tasks/index.js +13 -0
- package/tasks/index.js.map +1 -0
- package/tasks/pages/exportPagesCleanupTask.d.ts +3 -0
- package/tasks/pages/exportPagesCleanupTask.js +36 -0
- package/tasks/pages/exportPagesCleanupTask.js.map +1 -0
- package/tasks/pages/exportPagesControllerTask.d.ts +3 -0
- package/tasks/pages/exportPagesControllerTask.js +83 -0
- package/tasks/pages/exportPagesControllerTask.js.map +1 -0
- package/tasks/pages/exportPagesZipPagesTask.d.ts +3 -0
- package/tasks/pages/exportPagesZipPagesTask.js +39 -0
- package/tasks/pages/exportPagesZipPagesTask.js.map +1 -0
- package/tasks/pages/importPagesControllerTask.d.ts +3 -0
- package/tasks/pages/importPagesControllerTask.js +39 -0
- package/tasks/pages/importPagesControllerTask.js.map +1 -0
- package/tasks/pages/importPagesProcessPageTask.d.ts +3 -0
- package/tasks/pages/importPagesProcessPageTask.js +39 -0
- package/tasks/pages/importPagesProcessPageTask.js.map +1 -0
- package/tasks/pages/index.d.ts +1 -0
- package/tasks/pages/index.js +17 -0
- package/tasks/pages/index.js.map +1 -0
- package/types.d.ts +2 -2
- package/types.js +60 -8
- package/types.js.map +1 -1
- package/utils/ZipFiles.d.ts +11 -0
- package/utils/ZipFiles.js +124 -0
- package/utils/ZipFiles.js.map +1 -0
- package/export/combine/pagesHandler.d.ts +0 -6
- package/export/combine/pagesHandler.js +0 -99
- package/export/combine/pagesHandler.js.map +0 -1
- package/export/process/pagesHandler.d.ts +0 -6
- package/export/process/pagesHandler.js +0 -189
- package/export/process/pagesHandler.js.map +0 -1
- package/import/process/blocksHandler.d.ts +0 -3
- package/import/process/blocksHandler.js +0 -175
- package/import/process/blocksHandler.js.map +0 -1
- package/import/process/pages/importPage.js.map +0 -1
- package/import/process/pages/pagesHandler.d.ts +0 -3
- package/import/process/pages/pagesHandler.js +0 -183
- package/import/process/pages/pagesHandler.js.map +0 -1
- package/import/process/pagesHandler.d.ts +0 -3
- package/import/process/pagesHandler.js +0 -180
- package/import/process/pagesHandler.js.map +0 -1
- package/import/utils.d.ts +0 -49
- package/import/utils.js +0 -641
- package/import/utils.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-page-builder-import-export",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.15c0a8dfc8",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pbie:base"
|
|
@@ -14,70 +14,53 @@
|
|
|
14
14
|
"author": "Webiny Ltd",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@
|
|
18
|
-
"@
|
|
19
|
-
"@webiny/api": "0.0.0-unstable.
|
|
20
|
-
"@webiny/api-
|
|
21
|
-
"@webiny/api-
|
|
22
|
-
"@webiny/api-
|
|
23
|
-
"@webiny/
|
|
24
|
-
"@webiny/error": "0.0.0-unstable.
|
|
25
|
-
"@webiny/handler": "0.0.0-unstable.
|
|
26
|
-
"@webiny/handler-aws": "0.0.0-unstable.
|
|
27
|
-
"@webiny/handler-graphql": "0.0.0-unstable.
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
30
|
-
"
|
|
31
|
-
"
|
|
17
|
+
"@smithy/node-http-handler": "2.1.6",
|
|
18
|
+
"@webiny/api": "0.0.0-unstable.15c0a8dfc8",
|
|
19
|
+
"@webiny/api-file-manager": "0.0.0-unstable.15c0a8dfc8",
|
|
20
|
+
"@webiny/api-form-builder": "0.0.0-unstable.15c0a8dfc8",
|
|
21
|
+
"@webiny/api-page-builder": "0.0.0-unstable.15c0a8dfc8",
|
|
22
|
+
"@webiny/api-security": "0.0.0-unstable.15c0a8dfc8",
|
|
23
|
+
"@webiny/aws-sdk": "0.0.0-unstable.15c0a8dfc8",
|
|
24
|
+
"@webiny/error": "0.0.0-unstable.15c0a8dfc8",
|
|
25
|
+
"@webiny/handler": "0.0.0-unstable.15c0a8dfc8",
|
|
26
|
+
"@webiny/handler-aws": "0.0.0-unstable.15c0a8dfc8",
|
|
27
|
+
"@webiny/handler-graphql": "0.0.0-unstable.15c0a8dfc8",
|
|
28
|
+
"@webiny/pubsub": "0.0.0-unstable.15c0a8dfc8",
|
|
29
|
+
"@webiny/tasks": "0.0.0-unstable.15c0a8dfc8",
|
|
30
|
+
"@webiny/utils": "0.0.0-unstable.15c0a8dfc8",
|
|
31
|
+
"archiver": "7.0.1",
|
|
32
32
|
"dot-prop-immutable": "2.1.1",
|
|
33
|
-
"fs-extra": "
|
|
33
|
+
"fs-extra": "11.2.0",
|
|
34
34
|
"load-json-file": "6.2.0",
|
|
35
35
|
"lodash": "4.17.21",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"stream": "0.0.2",
|
|
36
|
+
"node-fetch": "2.6.7",
|
|
37
|
+
"stream": "0.0.3",
|
|
39
38
|
"uniqid": "5.4.0",
|
|
40
|
-
"yauzl": "2.10.0"
|
|
39
|
+
"yauzl": "2.10.0",
|
|
40
|
+
"zod": "3.23.8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@webiny/
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"@webiny/api-tenancy-so-ddb": "^0.0.0-unstable.1145e7667f",
|
|
57
|
-
"@webiny/api-wcp": "^0.0.0-unstable.1145e7667f",
|
|
58
|
-
"@webiny/cli": "^0.0.0-unstable.1145e7667f",
|
|
59
|
-
"@webiny/db": "^0.0.0-unstable.1145e7667f",
|
|
60
|
-
"@webiny/project-utils": "^0.0.0-unstable.1145e7667f",
|
|
61
|
-
"jest": "^28.1.0",
|
|
62
|
-
"jest-dynalite": "^3.2.0",
|
|
63
|
-
"rimraf": "^3.0.2",
|
|
64
|
-
"ttypescript": "^1.5.12",
|
|
65
|
-
"typescript": "4.7.4"
|
|
43
|
+
"@types/archiver": "5.3.1",
|
|
44
|
+
"@types/node-fetch": "2.6.2",
|
|
45
|
+
"@types/yauzl": "2.10.0",
|
|
46
|
+
"@webiny/api-authentication": "0.0.0-unstable.15c0a8dfc8",
|
|
47
|
+
"@webiny/api-dynamodb-to-elasticsearch": "0.0.0-unstable.15c0a8dfc8",
|
|
48
|
+
"@webiny/api-tenancy": "0.0.0-unstable.15c0a8dfc8",
|
|
49
|
+
"@webiny/api-wcp": "0.0.0-unstable.15c0a8dfc8",
|
|
50
|
+
"@webiny/db": "0.0.0-unstable.15c0a8dfc8",
|
|
51
|
+
"@webiny/project-utils": "0.0.0-unstable.15c0a8dfc8",
|
|
52
|
+
"jest": "29.7.0",
|
|
53
|
+
"jest-dynalite": "3.6.1",
|
|
54
|
+
"rimraf": "6.0.1",
|
|
55
|
+
"typescript": "5.3.3"
|
|
66
56
|
},
|
|
67
57
|
"publishConfig": {
|
|
68
58
|
"access": "public",
|
|
69
59
|
"directory": "dist"
|
|
70
60
|
},
|
|
71
61
|
"scripts": {
|
|
72
|
-
"build": "
|
|
73
|
-
"watch": "
|
|
62
|
+
"build": "node ../cli/bin.js run build",
|
|
63
|
+
"watch": "node ../cli/bin.js run watch"
|
|
74
64
|
},
|
|
75
|
-
"
|
|
76
|
-
"ignore": {
|
|
77
|
-
"src": [
|
|
78
|
-
"aws-sdk"
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
"gitHead": "1145e7667ffd3d18bfea1e73d6078cd6a35c1038"
|
|
65
|
+
"gitHead": "15c0a8dfc8a6714acdedfbfdc83bbe4967d80177"
|
|
83
66
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cleanup of the child tasks.
|
|
3
|
+
* This code will remove all the child tasks and their logs, which have no errors in them.
|
|
4
|
+
*/
|
|
5
|
+
import type { ITask, Context } from "@webiny/tasks";
|
|
6
|
+
export interface IChildTasksCleanupExecuteParams {
|
|
7
|
+
context: Context;
|
|
8
|
+
task: ITask;
|
|
9
|
+
}
|
|
10
|
+
export declare class ChildTasksCleanup {
|
|
11
|
+
execute(params: IChildTasksCleanupExecuteParams): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ChildTasksCleanup = void 0;
|
|
7
|
+
var _tasks = require("@webiny/tasks");
|
|
8
|
+
/**
|
|
9
|
+
* Cleanup of the child tasks.
|
|
10
|
+
* This code will remove all the child tasks and their logs, which have no errors in them.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
class ChildTasksCleanup {
|
|
14
|
+
async execute(params) {
|
|
15
|
+
const {
|
|
16
|
+
context,
|
|
17
|
+
task
|
|
18
|
+
} = params;
|
|
19
|
+
const {
|
|
20
|
+
items: childTasks
|
|
21
|
+
} = await context.tasks.listTasks({
|
|
22
|
+
where: {
|
|
23
|
+
parentId: task.id
|
|
24
|
+
},
|
|
25
|
+
// Really doubtful there will be more than 10k of child tasks.
|
|
26
|
+
limit: 100000
|
|
27
|
+
});
|
|
28
|
+
if (childTasks.length === 0) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const childTaskIdList = childTasks.map(childTask => childTask.id);
|
|
32
|
+
const {
|
|
33
|
+
items: childLogs
|
|
34
|
+
} = await context.tasks.listLogs({
|
|
35
|
+
where: {
|
|
36
|
+
task_in: childTaskIdList
|
|
37
|
+
},
|
|
38
|
+
limit: 100000
|
|
39
|
+
});
|
|
40
|
+
const deletedChildTaskLogIdList = [];
|
|
41
|
+
/**
|
|
42
|
+
* First, we need to remove all the logs which have no errors.
|
|
43
|
+
*/
|
|
44
|
+
for (const log of childLogs) {
|
|
45
|
+
if (log.items.some(item => item.type === _tasks.TaskLogItemType.ERROR)) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
await context.tasks.deleteLog(log.id);
|
|
49
|
+
if (deletedChildTaskLogIdList.includes(log.task)) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
deletedChildTaskLogIdList.push(log.task);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Now we can remove the tasks.
|
|
56
|
+
*/
|
|
57
|
+
for (const childTaskId of deletedChildTaskLogIdList) {
|
|
58
|
+
await context.tasks.deleteTask(childTaskId);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.ChildTasksCleanup = ChildTasksCleanup;
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=ChildTasksCleanup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_tasks","require","ChildTasksCleanup","execute","params","context","task","items","childTasks","tasks","listTasks","where","parentId","id","limit","length","childTaskIdList","map","childTask","childLogs","listLogs","task_in","deletedChildTaskLogIdList","log","some","item","type","TaskLogItemType","ERROR","deleteLog","includes","push","childTaskId","deleteTask","exports"],"sources":["ChildTasksCleanup.ts"],"sourcesContent":["/**\n * Cleanup of the child tasks.\n * This code will remove all the child tasks and their logs, which have no errors in them.\n */\nimport type { ITask, Context } from \"@webiny/tasks\";\nimport { TaskLogItemType } from \"@webiny/tasks\";\n\nexport interface IChildTasksCleanupExecuteParams {\n context: Context;\n task: ITask;\n}\nexport class ChildTasksCleanup {\n public async execute(params: IChildTasksCleanupExecuteParams): Promise<void> {\n const { context, task } = params;\n\n const { items: childTasks } = await context.tasks.listTasks({\n where: {\n parentId: task.id\n },\n // Really doubtful there will be more than 10k of child tasks.\n limit: 100000\n });\n if (childTasks.length === 0) {\n return;\n }\n\n const childTaskIdList = childTasks.map(childTask => childTask.id);\n\n const { items: childLogs } = await context.tasks.listLogs({\n where: {\n task_in: childTaskIdList\n },\n limit: 100000\n });\n\n const deletedChildTaskLogIdList: string[] = [];\n /**\n * First, we need to remove all the logs which have no errors.\n */\n for (const log of childLogs) {\n if (log.items.some(item => item.type === TaskLogItemType.ERROR)) {\n continue;\n }\n await context.tasks.deleteLog(log.id);\n if (deletedChildTaskLogIdList.includes(log.task)) {\n continue;\n }\n deletedChildTaskLogIdList.push(log.task);\n }\n /**\n * Now we can remove the tasks.\n */\n for (const childTaskId of deletedChildTaskLogIdList) {\n await context.tasks.deleteTask(childTaskId);\n }\n }\n}\n"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,OAAA;AALA;AACA;AACA;AACA;;AAQO,MAAMC,iBAAiB,CAAC;EAC3B,MAAaC,OAAOA,CAACC,MAAuC,EAAiB;IACzE,MAAM;MAAEC,OAAO;MAAEC;IAAK,CAAC,GAAGF,MAAM;IAEhC,MAAM;MAAEG,KAAK,EAAEC;IAAW,CAAC,GAAG,MAAMH,OAAO,CAACI,KAAK,CAACC,SAAS,CAAC;MACxDC,KAAK,EAAE;QACHC,QAAQ,EAAEN,IAAI,CAACO;MACnB,CAAC;MACD;MACAC,KAAK,EAAE;IACX,CAAC,CAAC;IACF,IAAIN,UAAU,CAACO,MAAM,KAAK,CAAC,EAAE;MACzB;IACJ;IAEA,MAAMC,eAAe,GAAGR,UAAU,CAACS,GAAG,CAACC,SAAS,IAAIA,SAAS,CAACL,EAAE,CAAC;IAEjE,MAAM;MAAEN,KAAK,EAAEY;IAAU,CAAC,GAAG,MAAMd,OAAO,CAACI,KAAK,CAACW,QAAQ,CAAC;MACtDT,KAAK,EAAE;QACHU,OAAO,EAAEL;MACb,CAAC;MACDF,KAAK,EAAE;IACX,CAAC,CAAC;IAEF,MAAMQ,yBAAmC,GAAG,EAAE;IAC9C;AACR;AACA;IACQ,KAAK,MAAMC,GAAG,IAAIJ,SAAS,EAAE;MACzB,IAAII,GAAG,CAAChB,KAAK,CAACiB,IAAI,CAACC,IAAI,IAAIA,IAAI,CAACC,IAAI,KAAKC,sBAAe,CAACC,KAAK,CAAC,EAAE;QAC7D;MACJ;MACA,MAAMvB,OAAO,CAACI,KAAK,CAACoB,SAAS,CAACN,GAAG,CAACV,EAAE,CAAC;MACrC,IAAIS,yBAAyB,CAACQ,QAAQ,CAACP,GAAG,CAACjB,IAAI,CAAC,EAAE;QAC9C;MACJ;MACAgB,yBAAyB,CAACS,IAAI,CAACR,GAAG,CAACjB,IAAI,CAAC;IAC5C;IACA;AACR;AACA;IACQ,KAAK,MAAM0B,WAAW,IAAIV,yBAAyB,EAAE;MACjD,MAAMjB,OAAO,CAACI,KAAK,CAACwB,UAAU,CAACD,WAAW,CAAC;IAC/C;EACJ;AACJ;AAACE,OAAA,CAAAhC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
package/tasks/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createTasks: () => (import("@webiny/tasks").TaskDefinitionPlugin<import("../types").PbImportExportContext, import("../export/pages/types").IExportPagesControllerInput, import("../export/pages/types").IExportPagesControllerOutput> | import("@webiny/tasks").TaskDefinitionPlugin<import("../types").PbImportExportContext, import("../import/pages/types").IImportPagesControllerInput, import("../import/pages/types").IImportPagesControllerOutput> | import("@webiny/tasks").TaskDefinitionPlugin<import("../types").PbImportExportContext, import("../export/pages/types").IExportPagesZipPagesInput, import("../export/pages/types").IExportPagesZipPagesOutput> | import("@webiny/tasks").TaskDefinitionPlugin<import("../types").PbImportExportContext, import("../export/pages/types").IExportPagesCleanupInput, import("@webiny/tasks").ITaskResponseDoneResultOutput> | import("@webiny/tasks").TaskDefinitionPlugin<import("../types").PbImportExportContext, import("../import/pages/types").IImportPagesProcessPagesInput, import("../import/pages/types").IImportPagesProcessPagesOutput>)[][];
|
package/tasks/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createTasks = void 0;
|
|
7
|
+
var _pages = require("./pages");
|
|
8
|
+
const createTasks = () => {
|
|
9
|
+
return [(0, _pages.createPagesTasks)()];
|
|
10
|
+
};
|
|
11
|
+
exports.createTasks = createTasks;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_pages","require","createTasks","createPagesTasks","exports"],"sources":["index.ts"],"sourcesContent":["import { createPagesTasks } from \"./pages\";\n\nexport const createTasks = () => {\n return [createPagesTasks()];\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAC7B,OAAO,CAAC,IAAAC,uBAAgB,EAAC,CAAC,CAAC;AAC/B,CAAC;AAACC,OAAA,CAAAF,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IExportPagesCleanupInput } from "../../export/pages/types";
|
|
2
|
+
import type { PbImportExportContext } from "../../graphql/types";
|
|
3
|
+
export declare const createExportPagesCleanupTask: () => import("@webiny/tasks").TaskDefinitionPlugin<PbImportExportContext, IExportPagesCleanupInput, import("@webiny/tasks").ITaskResponseDoneResultOutput>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createExportPagesCleanupTask = void 0;
|
|
7
|
+
var _tasks = require("@webiny/tasks");
|
|
8
|
+
var _types = require("../../export/pages/types");
|
|
9
|
+
const createExportPagesCleanupTask = () => {
|
|
10
|
+
return (0, _tasks.createPrivateTaskDefinition)({
|
|
11
|
+
id: _types.PageExportTask.Cleanup,
|
|
12
|
+
title: "Page Builder - Export Pages Cleanup",
|
|
13
|
+
description: "Export pages from the Page Builder - cleanup.",
|
|
14
|
+
maxIterations: 1,
|
|
15
|
+
run: async param => {
|
|
16
|
+
const {
|
|
17
|
+
response,
|
|
18
|
+
isAborted
|
|
19
|
+
} = param;
|
|
20
|
+
/**
|
|
21
|
+
* We always need to check task status.
|
|
22
|
+
*/
|
|
23
|
+
if (isAborted()) {
|
|
24
|
+
return response.aborted();
|
|
25
|
+
}
|
|
26
|
+
const {
|
|
27
|
+
ExportPagesCleanup
|
|
28
|
+
} = await import(/* webpackChunkName: "ExportPagesCleanup" */"../../export/pages/ExportPagesCleanup");
|
|
29
|
+
const exportPagesCleanup = new ExportPagesCleanup();
|
|
30
|
+
return await exportPagesCleanup.execute(param);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
exports.createExportPagesCleanupTask = createExportPagesCleanupTask;
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=exportPagesCleanupTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_tasks","require","_types","createExportPagesCleanupTask","createPrivateTaskDefinition","id","PageExportTask","Cleanup","title","description","maxIterations","run","param","response","isAborted","aborted","ExportPagesCleanup","exportPagesCleanup","execute","exports"],"sources":["exportPagesCleanupTask.ts"],"sourcesContent":["import { createPrivateTaskDefinition } from \"@webiny/tasks\";\nimport type { IExportPagesCleanupInput } from \"~/export/pages/types\";\nimport { PageExportTask } from \"~/export/pages/types\";\nimport type { PbImportExportContext } from \"~/graphql/types\";\n\nexport const createExportPagesCleanupTask = () => {\n return createPrivateTaskDefinition<PbImportExportContext, IExportPagesCleanupInput>({\n id: PageExportTask.Cleanup,\n title: \"Page Builder - Export Pages Cleanup\",\n description: \"Export pages from the Page Builder - cleanup.\",\n maxIterations: 1,\n run: async param => {\n const { response, isAborted } = param;\n /**\n * We always need to check task status.\n */\n if (isAborted()) {\n return response.aborted();\n }\n\n const { ExportPagesCleanup } = await import(\n /* webpackChunkName: \"ExportPagesCleanup\" */ \"~/export/pages/ExportPagesCleanup\"\n );\n\n const exportPagesCleanup = new ExportPagesCleanup();\n return await exportPagesCleanup.execute(param);\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAGO,MAAME,4BAA4B,GAAGA,CAAA,KAAM;EAC9C,OAAO,IAAAC,kCAA2B,EAAkD;IAChFC,EAAE,EAAEC,qBAAc,CAACC,OAAO;IAC1BC,KAAK,EAAE,qCAAqC;IAC5CC,WAAW,EAAE,+CAA+C;IAC5DC,aAAa,EAAE,CAAC;IAChBC,GAAG,EAAE,MAAMC,KAAK,IAAI;MAChB,MAAM;QAAEC,QAAQ;QAAEC;MAAU,CAAC,GAAGF,KAAK;MACrC;AACZ;AACA;MACY,IAAIE,SAAS,CAAC,CAAC,EAAE;QACb,OAAOD,QAAQ,CAACE,OAAO,CAAC,CAAC;MAC7B;MAEA,MAAM;QAAEC;MAAmB,CAAC,GAAG,MAAM,MAAM,CACvC,mFACJ,CAAC;MAED,MAAMC,kBAAkB,GAAG,IAAID,kBAAkB,CAAC,CAAC;MACnD,OAAO,MAAMC,kBAAkB,CAACC,OAAO,CAACN,KAAK,CAAC;IAClD;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAAhB,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PbImportExportContext } from "../../graphql/types";
|
|
2
|
+
import type { IExportPagesControllerInput, IExportPagesControllerOutput } from "../../export/pages/types";
|
|
3
|
+
export declare const createExportPagesControllerTask: () => import("@webiny/tasks").TaskDefinitionPlugin<PbImportExportContext, IExportPagesControllerInput, IExportPagesControllerOutput>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createExportPagesControllerTask = void 0;
|
|
7
|
+
var _tasks = require("@webiny/tasks");
|
|
8
|
+
var _types = require("../../export/pages/types");
|
|
9
|
+
var _ChildTasksCleanup = require("../common/ChildTasksCleanup");
|
|
10
|
+
const createExportPagesControllerTask = () => {
|
|
11
|
+
// TODO make the task private with createPrivateTaskDefinition
|
|
12
|
+
return (0, _tasks.createTaskDefinition)({
|
|
13
|
+
isPrivate: true,
|
|
14
|
+
id: _types.PageExportTask.Controller,
|
|
15
|
+
title: "Page Builder - Export Pages - Controller",
|
|
16
|
+
description: "Export pages from the Page Builder - controller.",
|
|
17
|
+
/**
|
|
18
|
+
* We want to have a lot of executions because we need to pool the subtasks all the time.
|
|
19
|
+
*/
|
|
20
|
+
maxIterations: 500,
|
|
21
|
+
run: async params => {
|
|
22
|
+
const {
|
|
23
|
+
response,
|
|
24
|
+
isAborted
|
|
25
|
+
} = params;
|
|
26
|
+
/**
|
|
27
|
+
* We always need to check task status.
|
|
28
|
+
*/
|
|
29
|
+
if (isAborted()) {
|
|
30
|
+
return response.aborted();
|
|
31
|
+
}
|
|
32
|
+
const {
|
|
33
|
+
ExportPagesController
|
|
34
|
+
} = await import(/* webpackChunkName: "ExportPagesController" */"../../export/pages/ExportPagesController");
|
|
35
|
+
const exportPagesController = new ExportPagesController();
|
|
36
|
+
return await exportPagesController.execute(params);
|
|
37
|
+
},
|
|
38
|
+
onDone: async ({
|
|
39
|
+
context,
|
|
40
|
+
task
|
|
41
|
+
}) => {
|
|
42
|
+
await context.tasks.trigger({
|
|
43
|
+
definition: _types.PageExportTask.Cleanup,
|
|
44
|
+
parent: task,
|
|
45
|
+
// delay cleanup for 25hrs
|
|
46
|
+
delay: 25 * 60 * 60
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* We want to clean all child tasks and logs, which have no errors.
|
|
50
|
+
*/
|
|
51
|
+
const childTasksCleanup = new _ChildTasksCleanup.ChildTasksCleanup();
|
|
52
|
+
try {
|
|
53
|
+
await childTasksCleanup.execute({
|
|
54
|
+
context,
|
|
55
|
+
task
|
|
56
|
+
});
|
|
57
|
+
} catch (ex) {
|
|
58
|
+
console.error("Error while cleaning child tasks.", ex);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
onError: async ({
|
|
62
|
+
context,
|
|
63
|
+
task
|
|
64
|
+
}) => {
|
|
65
|
+
await context.tasks.trigger({
|
|
66
|
+
definition: _types.PageExportTask.Cleanup,
|
|
67
|
+
parent: task
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
onAbort: async ({
|
|
71
|
+
context,
|
|
72
|
+
task
|
|
73
|
+
}) => {
|
|
74
|
+
await context.tasks.trigger({
|
|
75
|
+
definition: _types.PageExportTask.Cleanup,
|
|
76
|
+
parent: task
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
exports.createExportPagesControllerTask = createExportPagesControllerTask;
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=exportPagesControllerTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_tasks","require","_types","_ChildTasksCleanup","createExportPagesControllerTask","createTaskDefinition","isPrivate","id","PageExportTask","Controller","title","description","maxIterations","run","params","response","isAborted","aborted","ExportPagesController","exportPagesController","execute","onDone","context","task","tasks","trigger","definition","Cleanup","parent","delay","childTasksCleanup","ChildTasksCleanup","ex","console","error","onError","onAbort","exports"],"sources":["exportPagesControllerTask.ts"],"sourcesContent":["import { createTaskDefinition } from \"@webiny/tasks\";\nimport type { PbImportExportContext } from \"~/graphql/types\";\nimport type {\n IExportPagesControllerInput,\n IExportPagesControllerOutput\n} from \"~/export/pages/types\";\nimport { PageExportTask } from \"~/export/pages/types\";\nimport { ChildTasksCleanup } from \"../common/ChildTasksCleanup\";\n\nexport const createExportPagesControllerTask = () => {\n // TODO make the task private with createPrivateTaskDefinition\n return createTaskDefinition<\n PbImportExportContext,\n IExportPagesControllerInput,\n IExportPagesControllerOutput\n >({\n isPrivate: true,\n id: PageExportTask.Controller,\n title: \"Page Builder - Export Pages - Controller\",\n description: \"Export pages from the Page Builder - controller.\",\n /**\n * We want to have a lot of executions because we need to pool the subtasks all the time.\n */\n maxIterations: 500,\n run: async params => {\n const { response, isAborted } = params;\n /**\n * We always need to check task status.\n */\n if (isAborted()) {\n return response.aborted();\n }\n\n const { ExportPagesController } = await import(\n /* webpackChunkName: \"ExportPagesController\" */ \"~/export/pages/ExportPagesController\"\n );\n\n const exportPagesController = new ExportPagesController();\n return await exportPagesController.execute(params);\n },\n onDone: async ({ context, task }) => {\n await context.tasks.trigger({\n definition: PageExportTask.Cleanup,\n parent: task,\n // delay cleanup for 25hrs\n delay: 25 * 60 * 60\n });\n /**\n * We want to clean all child tasks and logs, which have no errors.\n */\n const childTasksCleanup = new ChildTasksCleanup();\n try {\n await childTasksCleanup.execute({\n context,\n task\n });\n } catch (ex) {\n console.error(\"Error while cleaning child tasks.\", ex);\n }\n },\n onError: async ({ context, task }) => {\n await context.tasks.trigger({\n definition: PageExportTask.Cleanup,\n parent: task\n });\n },\n onAbort: async ({ context, task }) => {\n await context.tasks.trigger({\n definition: PageExportTask.Cleanup,\n parent: task\n });\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAEO,MAAMG,+BAA+B,GAAGA,CAAA,KAAM;EACjD;EACA,OAAO,IAAAC,2BAAoB,EAIzB;IACEC,SAAS,EAAE,IAAI;IACfC,EAAE,EAAEC,qBAAc,CAACC,UAAU;IAC7BC,KAAK,EAAE,0CAA0C;IACjDC,WAAW,EAAE,kDAAkD;IAC/D;AACR;AACA;IACQC,aAAa,EAAE,GAAG;IAClBC,GAAG,EAAE,MAAMC,MAAM,IAAI;MACjB,MAAM;QAAEC,QAAQ;QAAEC;MAAU,CAAC,GAAGF,MAAM;MACtC;AACZ;AACA;MACY,IAAIE,SAAS,CAAC,CAAC,EAAE;QACb,OAAOD,QAAQ,CAACE,OAAO,CAAC,CAAC;MAC7B;MAEA,MAAM;QAAEC;MAAsB,CAAC,GAAG,MAAM,MAAM,CAC1C,yFACJ,CAAC;MAED,MAAMC,qBAAqB,GAAG,IAAID,qBAAqB,CAAC,CAAC;MACzD,OAAO,MAAMC,qBAAqB,CAACC,OAAO,CAACN,MAAM,CAAC;IACtD,CAAC;IACDO,MAAM,EAAE,MAAAA,CAAO;MAAEC,OAAO;MAAEC;IAAK,CAAC,KAAK;MACjC,MAAMD,OAAO,CAACE,KAAK,CAACC,OAAO,CAAC;QACxBC,UAAU,EAAElB,qBAAc,CAACmB,OAAO;QAClCC,MAAM,EAAEL,IAAI;QACZ;QACAM,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG;MACrB,CAAC,CAAC;MACF;AACZ;AACA;MACY,MAAMC,iBAAiB,GAAG,IAAIC,oCAAiB,CAAC,CAAC;MACjD,IAAI;QACA,MAAMD,iBAAiB,CAACV,OAAO,CAAC;UAC5BE,OAAO;UACPC;QACJ,CAAC,CAAC;MACN,CAAC,CAAC,OAAOS,EAAE,EAAE;QACTC,OAAO,CAACC,KAAK,CAAC,mCAAmC,EAAEF,EAAE,CAAC;MAC1D;IACJ,CAAC;IACDG,OAAO,EAAE,MAAAA,CAAO;MAAEb,OAAO;MAAEC;IAAK,CAAC,KAAK;MAClC,MAAMD,OAAO,CAACE,KAAK,CAACC,OAAO,CAAC;QACxBC,UAAU,EAAElB,qBAAc,CAACmB,OAAO;QAClCC,MAAM,EAAEL;MACZ,CAAC,CAAC;IACN,CAAC;IACDa,OAAO,EAAE,MAAAA,CAAO;MAAEd,OAAO;MAAEC;IAAK,CAAC,KAAK;MAClC,MAAMD,OAAO,CAACE,KAAK,CAACC,OAAO,CAAC;QACxBC,UAAU,EAAElB,qBAAc,CAACmB,OAAO;QAClCC,MAAM,EAAEL;MACZ,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACc,OAAA,CAAAjC,+BAAA,GAAAA,+BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IExportPagesZipPagesInput, IExportPagesZipPagesOutput } from "../../export/pages/types";
|
|
2
|
+
import type { PbImportExportContext } from "../../graphql/types";
|
|
3
|
+
export declare const createExportPagesZipPagesTask: () => import("@webiny/tasks").TaskDefinitionPlugin<PbImportExportContext, IExportPagesZipPagesInput, IExportPagesZipPagesOutput>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createExportPagesZipPagesTask = void 0;
|
|
7
|
+
var _tasks = require("@webiny/tasks");
|
|
8
|
+
var _types = require("../../export/pages/types");
|
|
9
|
+
const createExportPagesZipPagesTask = () => {
|
|
10
|
+
return (0, _tasks.createPrivateTaskDefinition)({
|
|
11
|
+
id: _types.PageExportTask.ZipPages,
|
|
12
|
+
title: "Page Builder - Export Pages - Zip Pages",
|
|
13
|
+
description: "Export pages from the Page Builder - zip pages.",
|
|
14
|
+
/**
|
|
15
|
+
* If we ever hit the max iterations limit, we should decrease the number of pages being zipped in one task execution.
|
|
16
|
+
*/
|
|
17
|
+
maxIterations: 10,
|
|
18
|
+
run: async params => {
|
|
19
|
+
const {
|
|
20
|
+
response,
|
|
21
|
+
isAborted
|
|
22
|
+
} = params;
|
|
23
|
+
/**
|
|
24
|
+
* We always need to check task status.
|
|
25
|
+
*/
|
|
26
|
+
if (isAborted()) {
|
|
27
|
+
return response.aborted();
|
|
28
|
+
}
|
|
29
|
+
const {
|
|
30
|
+
ExportPagesZipPages
|
|
31
|
+
} = await import(/* webpackChunkName: "ExportPagesZipPages" */"../../export/pages/ExportPagesZipPages");
|
|
32
|
+
const exportPagesZipPages = new ExportPagesZipPages();
|
|
33
|
+
return await exportPagesZipPages.execute(params);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.createExportPagesZipPagesTask = createExportPagesZipPagesTask;
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=exportPagesZipPagesTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_tasks","require","_types","createExportPagesZipPagesTask","createPrivateTaskDefinition","id","PageExportTask","ZipPages","title","description","maxIterations","run","params","response","isAborted","aborted","ExportPagesZipPages","exportPagesZipPages","execute","exports"],"sources":["exportPagesZipPagesTask.ts"],"sourcesContent":["import { createPrivateTaskDefinition } from \"@webiny/tasks\";\nimport type { IExportPagesZipPagesInput, IExportPagesZipPagesOutput } from \"~/export/pages/types\";\nimport { PageExportTask } from \"~/export/pages/types\";\nimport type { PbImportExportContext } from \"~/graphql/types\";\n\nexport const createExportPagesZipPagesTask = () => {\n return createPrivateTaskDefinition<\n PbImportExportContext,\n IExportPagesZipPagesInput,\n IExportPagesZipPagesOutput\n >({\n id: PageExportTask.ZipPages,\n title: \"Page Builder - Export Pages - Zip Pages\",\n description: \"Export pages from the Page Builder - zip pages.\",\n /**\n * If we ever hit the max iterations limit, we should decrease the number of pages being zipped in one task execution.\n */\n maxIterations: 10,\n run: async params => {\n const { response, isAborted } = params;\n /**\n * We always need to check task status.\n */\n if (isAborted()) {\n return response.aborted();\n }\n\n const { ExportPagesZipPages } = await import(\n /* webpackChunkName: \"ExportPagesZipPages\" */ \"~/export/pages/ExportPagesZipPages\"\n );\n\n const exportPagesZipPages = new ExportPagesZipPages();\n return await exportPagesZipPages.execute(params);\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAGO,MAAME,6BAA6B,GAAGA,CAAA,KAAM;EAC/C,OAAO,IAAAC,kCAA2B,EAIhC;IACEC,EAAE,EAAEC,qBAAc,CAACC,QAAQ;IAC3BC,KAAK,EAAE,yCAAyC;IAChDC,WAAW,EAAE,iDAAiD;IAC9D;AACR;AACA;IACQC,aAAa,EAAE,EAAE;IACjBC,GAAG,EAAE,MAAMC,MAAM,IAAI;MACjB,MAAM;QAAEC,QAAQ;QAAEC;MAAU,CAAC,GAAGF,MAAM;MACtC;AACZ;AACA;MACY,IAAIE,SAAS,CAAC,CAAC,EAAE;QACb,OAAOD,QAAQ,CAACE,OAAO,CAAC,CAAC;MAC7B;MAEA,MAAM;QAAEC;MAAoB,CAAC,GAAG,MAAM,MAAM,CACxC,qFACJ,CAAC;MAED,MAAMC,mBAAmB,GAAG,IAAID,mBAAmB,CAAC,CAAC;MACrD,OAAO,MAAMC,mBAAmB,CAACC,OAAO,CAACN,MAAM,CAAC;IACpD;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAAhB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PbImportExportContext } from "../../graphql/types";
|
|
2
|
+
import type { IImportPagesControllerInput, IImportPagesControllerOutput } from "../../import/pages/types";
|
|
3
|
+
export declare const createImportPagesControllerTask: () => import("@webiny/tasks").TaskDefinitionPlugin<PbImportExportContext, IImportPagesControllerInput, IImportPagesControllerOutput>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createImportPagesControllerTask = void 0;
|
|
7
|
+
var _tasks = require("@webiny/tasks");
|
|
8
|
+
var _types = require("../../import/pages/types");
|
|
9
|
+
const createImportPagesControllerTask = () => {
|
|
10
|
+
return (0, _tasks.createPrivateTaskDefinition)({
|
|
11
|
+
id: _types.PageImportTask.Controller,
|
|
12
|
+
title: "Page Builder - Import Pages Controlelr",
|
|
13
|
+
description: "Import pages from the Page Builder.",
|
|
14
|
+
/**
|
|
15
|
+
* We want to have a lot of executions because we need to pool the subtasks all the time.
|
|
16
|
+
*/
|
|
17
|
+
maxIterations: 500,
|
|
18
|
+
run: async params => {
|
|
19
|
+
const {
|
|
20
|
+
response,
|
|
21
|
+
isAborted
|
|
22
|
+
} = params;
|
|
23
|
+
/**
|
|
24
|
+
* We always need to check task status.
|
|
25
|
+
*/
|
|
26
|
+
if (isAborted()) {
|
|
27
|
+
return response.aborted();
|
|
28
|
+
}
|
|
29
|
+
const {
|
|
30
|
+
ImportPagesController
|
|
31
|
+
} = await import(/* webpackChunkName: "ImportPagesController" */"../../import/pages/ImportPagesController");
|
|
32
|
+
const importPagesController = new ImportPagesController();
|
|
33
|
+
return await importPagesController.execute(params);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.createImportPagesControllerTask = createImportPagesControllerTask;
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=importPagesControllerTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_tasks","require","_types","createImportPagesControllerTask","createPrivateTaskDefinition","id","PageImportTask","Controller","title","description","maxIterations","run","params","response","isAborted","aborted","ImportPagesController","importPagesController","execute","exports"],"sources":["importPagesControllerTask.ts"],"sourcesContent":["import { createPrivateTaskDefinition } from \"@webiny/tasks\";\nimport type { PbImportExportContext } from \"~/graphql/types\";\nimport type {\n IImportPagesControllerInput,\n IImportPagesControllerOutput\n} from \"~/import/pages/types\";\nimport { PageImportTask } from \"~/import/pages/types\";\n\nexport const createImportPagesControllerTask = () => {\n return createPrivateTaskDefinition<\n PbImportExportContext,\n IImportPagesControllerInput,\n IImportPagesControllerOutput\n >({\n id: PageImportTask.Controller,\n title: \"Page Builder - Import Pages Controlelr\",\n description: \"Import pages from the Page Builder.\",\n /**\n * We want to have a lot of executions because we need to pool the subtasks all the time.\n */\n maxIterations: 500,\n run: async params => {\n const { response, isAborted } = params;\n /**\n * We always need to check task status.\n */\n if (isAborted()) {\n return response.aborted();\n }\n const { ImportPagesController } = await import(\n /* webpackChunkName: \"ImportPagesController\" */ \"~/import/pages/ImportPagesController\"\n );\n\n const importPagesController = new ImportPagesController();\n\n return await importPagesController.execute(params);\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAME,+BAA+B,GAAGA,CAAA,KAAM;EACjD,OAAO,IAAAC,kCAA2B,EAIhC;IACEC,EAAE,EAAEC,qBAAc,CAACC,UAAU;IAC7BC,KAAK,EAAE,wCAAwC;IAC/CC,WAAW,EAAE,qCAAqC;IAClD;AACR;AACA;IACQC,aAAa,EAAE,GAAG;IAClBC,GAAG,EAAE,MAAMC,MAAM,IAAI;MACjB,MAAM;QAAEC,QAAQ;QAAEC;MAAU,CAAC,GAAGF,MAAM;MACtC;AACZ;AACA;MACY,IAAIE,SAAS,CAAC,CAAC,EAAE;QACb,OAAOD,QAAQ,CAACE,OAAO,CAAC,CAAC;MAC7B;MACA,MAAM;QAAEC;MAAsB,CAAC,GAAG,MAAM,MAAM,CAC1C,yFACJ,CAAC;MAED,MAAMC,qBAAqB,GAAG,IAAID,qBAAqB,CAAC,CAAC;MAEzD,OAAO,MAAMC,qBAAqB,CAACC,OAAO,CAACN,MAAM,CAAC;IACtD;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAAhB,+BAAA,GAAAA,+BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PbImportExportContext } from "../../graphql/types";
|
|
2
|
+
import type { IImportPagesProcessPagesInput, IImportPagesProcessPagesOutput } from "../../import/pages/types";
|
|
3
|
+
export declare const createImportPagesProcessPagesTask: () => import("@webiny/tasks").TaskDefinitionPlugin<PbImportExportContext, IImportPagesProcessPagesInput, IImportPagesProcessPagesOutput>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createImportPagesProcessPagesTask = void 0;
|
|
7
|
+
var _tasks = require("@webiny/tasks");
|
|
8
|
+
var _types = require("../../import/pages/types");
|
|
9
|
+
const createImportPagesProcessPagesTask = () => {
|
|
10
|
+
return (0, _tasks.createPrivateTaskDefinition)({
|
|
11
|
+
id: _types.PageImportTask.Process,
|
|
12
|
+
title: "Page Builder - Import Pages Process",
|
|
13
|
+
description: "Import pages from the Page Builder - Process pages.",
|
|
14
|
+
/**
|
|
15
|
+
* We do not want to have a large number of iterations because we are splitting page processing into multiple tasks.
|
|
16
|
+
*/
|
|
17
|
+
maxIterations: 20,
|
|
18
|
+
run: async params => {
|
|
19
|
+
const {
|
|
20
|
+
response,
|
|
21
|
+
isAborted
|
|
22
|
+
} = params;
|
|
23
|
+
/**
|
|
24
|
+
* We always need to check task status.
|
|
25
|
+
*/
|
|
26
|
+
if (isAborted()) {
|
|
27
|
+
return response.aborted();
|
|
28
|
+
}
|
|
29
|
+
const {
|
|
30
|
+
ImportPagesProcessPages
|
|
31
|
+
} = await import(/* webpackChunkName: "ImportPagesProcessPages" */"../../import/pages/ImportPagesProcessPages");
|
|
32
|
+
const importPagesProcessPages = new ImportPagesProcessPages();
|
|
33
|
+
return await importPagesProcessPages.execute(params);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.createImportPagesProcessPagesTask = createImportPagesProcessPagesTask;
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=importPagesProcessPageTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_tasks","require","_types","createImportPagesProcessPagesTask","createPrivateTaskDefinition","id","PageImportTask","Process","title","description","maxIterations","run","params","response","isAborted","aborted","ImportPagesProcessPages","importPagesProcessPages","execute","exports"],"sources":["importPagesProcessPageTask.ts"],"sourcesContent":["import { createPrivateTaskDefinition } from \"@webiny/tasks\";\nimport type { PbImportExportContext } from \"~/graphql/types\";\nimport type {\n IImportPagesProcessPagesInput,\n IImportPagesProcessPagesOutput\n} from \"~/import/pages/types\";\nimport { PageImportTask } from \"~/import/pages/types\";\n\nexport const createImportPagesProcessPagesTask = () => {\n return createPrivateTaskDefinition<\n PbImportExportContext,\n IImportPagesProcessPagesInput,\n IImportPagesProcessPagesOutput\n >({\n id: PageImportTask.Process,\n title: \"Page Builder - Import Pages Process\",\n description: \"Import pages from the Page Builder - Process pages.\",\n /**\n * We do not want to have a large number of iterations because we are splitting page processing into multiple tasks.\n */\n maxIterations: 20,\n run: async params => {\n const { response, isAborted } = params;\n /**\n * We always need to check task status.\n */\n if (isAborted()) {\n return response.aborted();\n }\n const { ImportPagesProcessPages } = await import(\n /* webpackChunkName: \"ImportPagesProcessPages\" */ \"~/import/pages/ImportPagesProcessPages\"\n );\n\n const importPagesProcessPages = new ImportPagesProcessPages();\n\n return await importPagesProcessPages.execute(params);\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAME,iCAAiC,GAAGA,CAAA,KAAM;EACnD,OAAO,IAAAC,kCAA2B,EAIhC;IACEC,EAAE,EAAEC,qBAAc,CAACC,OAAO;IAC1BC,KAAK,EAAE,qCAAqC;IAC5CC,WAAW,EAAE,qDAAqD;IAClE;AACR;AACA;IACQC,aAAa,EAAE,EAAE;IACjBC,GAAG,EAAE,MAAMC,MAAM,IAAI;MACjB,MAAM;QAAEC,QAAQ;QAAEC;MAAU,CAAC,GAAGF,MAAM;MACtC;AACZ;AACA;MACY,IAAIE,SAAS,CAAC,CAAC,EAAE;QACb,OAAOD,QAAQ,CAACE,OAAO,CAAC,CAAC;MAC7B;MACA,MAAM;QAAEC;MAAwB,CAAC,GAAG,MAAM,MAAM,CAC5C,6FACJ,CAAC;MAED,MAAMC,uBAAuB,GAAG,IAAID,uBAAuB,CAAC,CAAC;MAE7D,OAAO,MAAMC,uBAAuB,CAACC,OAAO,CAACN,MAAM,CAAC;IACxD;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAAhB,iCAAA,GAAAA,iCAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createPagesTasks: () => (import("@webiny/tasks").TaskDefinitionPlugin<import("../../types").PbImportExportContext, import("../../export/pages/types").IExportPagesControllerInput, import("../../export/pages/types").IExportPagesControllerOutput> | import("@webiny/tasks").TaskDefinitionPlugin<import("../../types").PbImportExportContext, import("../../import/pages/types").IImportPagesControllerInput, import("../../import/pages/types").IImportPagesControllerOutput> | import("@webiny/tasks").TaskDefinitionPlugin<import("../../types").PbImportExportContext, import("../../export/pages/types").IExportPagesZipPagesInput, import("../../export/pages/types").IExportPagesZipPagesOutput> | import("@webiny/tasks").TaskDefinitionPlugin<import("../../types").PbImportExportContext, import("../../export/pages/types").IExportPagesCleanupInput, import("@webiny/tasks").ITaskResponseDoneResultOutput> | import("@webiny/tasks").TaskDefinitionPlugin<import("../../types").PbImportExportContext, import("../../import/pages/types").IImportPagesProcessPagesInput, import("../../import/pages/types").IImportPagesProcessPagesOutput>)[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createPagesTasks = void 0;
|
|
7
|
+
var _exportPagesControllerTask = require("./exportPagesControllerTask");
|
|
8
|
+
var _importPagesControllerTask = require("./importPagesControllerTask");
|
|
9
|
+
var _exportPagesZipPagesTask = require("./exportPagesZipPagesTask");
|
|
10
|
+
var _exportPagesCleanupTask = require("./exportPagesCleanupTask");
|
|
11
|
+
var _importPagesProcessPageTask = require("./importPagesProcessPageTask");
|
|
12
|
+
const createPagesTasks = () => {
|
|
13
|
+
return [(0, _exportPagesControllerTask.createExportPagesControllerTask)(), (0, _exportPagesZipPagesTask.createExportPagesZipPagesTask)(), (0, _exportPagesCleanupTask.createExportPagesCleanupTask)(), (0, _importPagesControllerTask.createImportPagesControllerTask)(), (0, _importPagesProcessPageTask.createImportPagesProcessPagesTask)()];
|
|
14
|
+
};
|
|
15
|
+
exports.createPagesTasks = createPagesTasks;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_exportPagesControllerTask","require","_importPagesControllerTask","_exportPagesZipPagesTask","_exportPagesCleanupTask","_importPagesProcessPageTask","createPagesTasks","createExportPagesControllerTask","createExportPagesZipPagesTask","createExportPagesCleanupTask","createImportPagesControllerTask","createImportPagesProcessPagesTask","exports"],"sources":["index.ts"],"sourcesContent":["import { createExportPagesControllerTask } from \"./exportPagesControllerTask\";\nimport { createImportPagesControllerTask } from \"./importPagesControllerTask\";\nimport { createExportPagesZipPagesTask } from \"./exportPagesZipPagesTask\";\nimport { createExportPagesCleanupTask } from \"./exportPagesCleanupTask\";\nimport { createImportPagesProcessPagesTask } from \"./importPagesProcessPageTask\";\n\nexport const createPagesTasks = () => {\n return [\n createExportPagesControllerTask(),\n createExportPagesZipPagesTask(),\n createExportPagesCleanupTask(),\n createImportPagesControllerTask(),\n createImportPagesProcessPagesTask()\n ];\n};\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAH,OAAA;AACA,IAAAI,2BAAA,GAAAJ,OAAA;AAEO,MAAMK,gBAAgB,GAAGA,CAAA,KAAM;EAClC,OAAO,CACH,IAAAC,0DAA+B,EAAC,CAAC,EACjC,IAAAC,sDAA6B,EAAC,CAAC,EAC/B,IAAAC,oDAA4B,EAAC,CAAC,EAC9B,IAAAC,0DAA+B,EAAC,CAAC,EACjC,IAAAC,6DAAiC,EAAC,CAAC,CACtC;AACL,CAAC;AAACC,OAAA,CAAAN,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
package/types.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export interface ImportExportTaskStorageOperationsListParams {
|
|
|
71
71
|
* @category StorageOperations
|
|
72
72
|
* @category ImportExportTaskStorageOperations
|
|
73
73
|
*/
|
|
74
|
-
export
|
|
74
|
+
export type ImportExportTaskStorageOperationsListResponse = [ImportExportTask[], MetaResponse];
|
|
75
75
|
/**
|
|
76
76
|
* @category StorageOperations
|
|
77
77
|
* @category ImportExportTaskStorageOperations
|
|
@@ -128,7 +128,7 @@ export interface ImportExportTaskStorageOperationsListSubTaskParams {
|
|
|
128
128
|
* @category StorageOperations
|
|
129
129
|
* @category ImportExportTaskStorageOperations
|
|
130
130
|
*/
|
|
131
|
-
export
|
|
131
|
+
export type ImportExportTaskStorageOperationsListSubTaskResponse = [
|
|
132
132
|
ImportExportTask[],
|
|
133
133
|
MetaResponse
|
|
134
134
|
];
|