Skip to content

Commit

Permalink
feat(app-page-builder): import and export blocks (#2844)
Browse files Browse the repository at this point in the history
  • Loading branch information
neatbyte-vnobis authored Jan 10, 2023
1 parent 851696c commit b79d3e8
Show file tree
Hide file tree
Showing 115 changed files with 3,147 additions and 1,371 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "api-page-builder-import-pages-create",
"name": "api-page-builder-export-combine",
"version": "0.1.0",
"scripts": {
"build": "yarn webiny run build",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { createStorageOperations as createPageBuilderStorageOperations } from "@webiny/api-page-builder-so-ddb";
import pageBuilderImportExportPlugins from "@webiny/api-page-builder-import-export/graphql";
import { createStorageOperations as createPageBuilderImportExportStorageOperations } from "@webiny/api-page-builder-import-export-so-ddb";
import exportPagesCombinePlugins from "@webiny/api-page-builder-import-export/exportPages/combine";
import exportCombinePlugins from "@webiny/api-page-builder-import-export/export/combine";
import dbPlugins from "@webiny/handler-db";
import { DynamoDbDriver } from "@webiny/db-dynamodb";
import dynamoDbPlugins from "@webiny/db-dynamodb/plugins";
Expand Down Expand Up @@ -47,7 +47,7 @@ export const handler = createHandler({
pageBuilderImportExportPlugins({
storageOperations: createPageBuilderImportExportStorageOperations({ documentClient })
}),
exportPagesCombinePlugins()
exportCombinePlugins()
],
http: { debug }
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "api-page-builder-import-pages-process",
"name": "api-page-builder-export-process",
"version": "0.1.0",
"scripts": {
"build": "yarn webiny run build",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ import {
import { createStorageOperations as createPageBuilderStorageOperations } from "@webiny/api-page-builder-so-ddb";
import pageBuilderImportExportPlugins from "@webiny/api-page-builder-import-export/graphql";
import { createStorageOperations as createPageBuilderImportExportStorageOperations } from "@webiny/api-page-builder-import-export-so-ddb";
import exportPagesProcessPlugins from "@webiny/api-page-builder-import-export/exportPages/process";
import exportProcessPlugins from "@webiny/api-page-builder-import-export/export/process";
import dbPlugins from "@webiny/handler-db";
import { DynamoDbDriver } from "@webiny/db-dynamodb";
import dynamoDbPlugins from "@webiny/db-dynamodb/plugins";
import fileManagerPlugins from "@webiny/api-file-manager/plugins";
import fileManagerDynamoDbStorageOperation from "@webiny/api-file-manager-ddb";
import fileManagerS3 from "@webiny/api-file-manager-s3";
import logsPlugins from "@webiny/handler-logs";
import securityPlugins from "./security";

Expand All @@ -36,6 +39,9 @@ export const handler = createHandler({
i18nPlugins(),
i18nDynamoDbStorageOperations(),
i18nContentPlugins(),
fileManagerPlugins(),
fileManagerDynamoDbStorageOperation(),
fileManagerS3(),
createPageBuilderContext({
storageOperations: createPageBuilderStorageOperations({
documentClient
Expand All @@ -45,10 +51,10 @@ export const handler = createHandler({
pageBuilderImportExportPlugins({
storageOperations: createPageBuilderImportExportStorageOperations({ documentClient })
}),
exportPagesProcessPlugins({
exportProcessPlugins({
handlers: {
process: String(process.env.AWS_LAMBDA_FUNCTION_NAME),
combine: String(process.env.EXPORT_PAGE_COMBINE_HANDLER)
combine: String(process.env.EXPORT_COMBINE_HANDLER)
}
})
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "api-page-builder-export-pages-combine",
"name": "api-page-builder-import-create",
"version": "0.1.0",
"scripts": {
"build": "yarn webiny run build",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { createStorageOperations as createPageBuilderStorageOperations } from "@webiny/api-page-builder-so-ddb";
import pageBuilderImportExportPlugins from "@webiny/api-page-builder-import-export/graphql";
import { createStorageOperations as createPageBuilderImportExportStorageOperations } from "@webiny/api-page-builder-import-export-so-ddb";
import importPagesCreatePlugins from "@webiny/api-page-builder-import-export/importPages/create";
import importCreatePlugins from "@webiny/api-page-builder-import-export/import/create";
import dbPlugins from "@webiny/handler-db";
import { DynamoDbDriver } from "@webiny/db-dynamodb";
import dynamoDbPlugins from "@webiny/db-dynamodb/plugins";
Expand Down Expand Up @@ -45,9 +45,9 @@ export const handler = createHandler({
pageBuilderImportExportPlugins({
storageOperations: createPageBuilderImportExportStorageOperations({ documentClient })
}),
importPagesCreatePlugins({
importCreatePlugins({
handlers: {
process: String(process.env.IMPORT_PAGE_QUEUE_PROCESS_HANDLER)
process: String(process.env.IMPORT_QUEUE_PROCESS_HANDLER)
}
})
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "api-page-builder-export-pages-process",
"name": "api-page-builder-import-process",
"version": "0.1.0",
"scripts": {
"build": "yarn webiny run build",
"watch": "yarn webiny run watch"
},
"dependencies": {
"@webiny/api-file-manager": "^5.33.2",
"@webiny/api-file-manager-ddb": "^5.33.2",
"@webiny/api-file-manager-s3": "^5.33.2",
"@webiny/api-i18n": "^5.33.2",
"@webiny/api-i18n-content": "^5.33.2",
"@webiny/api-i18n-ddb": "^5.33.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { createStorageOperations as createPageBuilderStorageOperations } from "@webiny/api-page-builder-so-ddb";
import pageBuilderImportExportPlugins from "@webiny/api-page-builder-import-export/graphql";
import { createStorageOperations as createPageBuilderImportExportStorageOperations } from "@webiny/api-page-builder-import-export-so-ddb";
import importPagesProcessPlugins from "@webiny/api-page-builder-import-export/importPages/process";
import importProcessPlugins from "@webiny/api-page-builder-import-export/import/process";
import dbPlugins from "@webiny/handler-db";
import { DynamoDbDriver } from "@webiny/db-dynamodb";
import dynamoDbPlugins from "@webiny/db-dynamodb/plugins";
Expand Down Expand Up @@ -51,7 +51,7 @@ export const handler = createHandler({
pageBuilderImportExportPlugins({
storageOperations: createPageBuilderImportExportStorageOperations({ documentClient })
}),
importPagesProcessPlugins({
importProcessPlugins({
handlers: {
process: String(process.env.AWS_LAMBDA_FUNCTION_NAME)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"extends": "../../../../../tsconfig.json",
"include": ["src"],
"references": [
{ "path": "../../../../../packages/api-file-manager/tsconfig.build.json" },
{ "path": "../../../../../packages/api-file-manager-ddb/tsconfig.build.json" },
{ "path": "../../../../../packages/api-file-manager-s3/tsconfig.build.json" },
{ "path": "../../../../../packages/api-i18n/tsconfig.build.json" },
{ "path": "../../../../../packages/api-i18n-content/tsconfig.build.json" },
{ "path": "../../../../../packages/api-i18n-ddb/tsconfig.build.json" },
Expand All @@ -21,6 +24,12 @@
"compilerOptions": {
"paths": {
"~/*": ["./src/*"],
"@webiny/api-file-manager/*": ["../../../../../packages/api-file-manager/src/*"],
"@webiny/api-file-manager": ["../../../../../packages/api-file-manager/src"],
"@webiny/api-file-manager-ddb/*": ["../../../../../packages/api-file-manager-ddb/src/*"],
"@webiny/api-file-manager-ddb": ["../../../../../packages/api-file-manager-ddb/src"],
"@webiny/api-file-manager-s3/*": ["../../../../../packages/api-file-manager-s3/src/*"],
"@webiny/api-file-manager-s3": ["../../../../../packages/api-file-manager-s3/src"],
"@webiny/api-i18n/*": ["../../../../../packages/api-i18n/src/*"],
"@webiny/api-i18n": ["../../../../../packages/api-i18n/src"],
"@webiny/api-i18n-content/*": ["../../../../../packages/api-i18n-content/src/*"],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"apps/api/graphql",
"apps/api/headlessCMS",
"apps/api/pageBuilder/updateSettings",
"apps/api/pageBuilder/importPages/*",
"apps/api/pageBuilder/exportPages/*"
"apps/api/pageBuilder/import/*",
"apps/api/pageBuilder/export/*"
]
},
"author": "Webiny Ltd.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "API Page Builder DynamoDB for Page Import Export",
"name": "API Page Builder DynamoDB for Import Export",
"entryPoints": ["types.ts"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Params {
attributes?: Attributes;
}

export const createPageImportExportTaskEntity = ({ entityName, table, attributes }: Params) => {
export const createImportExportTaskEntity = ({ entityName, table, attributes }: Params) => {
return new Entity({
name: entityName,
table,
Expand Down
Loading

0 comments on commit b79d3e8

Please sign in to comment.