Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api-prerendering-service): DynamoDB storage operations with upgr…
…ade (#1996)
- Loading branch information
1 parent
ad30d3c
commit 1d3602e
Showing
83 changed files
with
4,511 additions
and
1,270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
import { DocumentClient } from "aws-sdk/clients/dynamodb"; | ||
import { createHandler } from "@webiny/handler-aws"; | ||
import dbPlugins from "@webiny/handler-db"; | ||
import { DynamoDbDriver } from "@webiny/db-dynamodb"; | ||
import flushPlugins from "@webiny/api-prerendering-service/flush"; | ||
import flushAwsPlugins from "@webiny/api-prerendering-service-aws/flush"; | ||
import logsPlugins from "@webiny/handler-logs"; | ||
import { createPrerenderingServiceStorageOperations } from "@webiny/api-prerendering-service-so-ddb"; | ||
|
||
export const handler = createHandler( | ||
logsPlugins(), | ||
flushPlugins(), | ||
flushAwsPlugins(), | ||
dbPlugins({ | ||
table: process.env.DB_TABLE, | ||
driver: new DynamoDbDriver({ | ||
documentClient: new DocumentClient({ | ||
convertEmptyValues: true, | ||
region: process.env.AWS_REGION | ||
const documentClient = new DocumentClient({ | ||
convertEmptyValues: true, | ||
region: process.env.AWS_REGION | ||
}); | ||
export const handler = createHandler({ | ||
plugins: [ | ||
logsPlugins(), | ||
flushPlugins({ | ||
storageOperations: createPrerenderingServiceStorageOperations({ | ||
documentClient, | ||
table: table => ({ ...table, name: process.env.DB_TABLE }) | ||
}) | ||
}) | ||
}) | ||
); | ||
}), | ||
flushAwsPlugins() | ||
], | ||
http: { debug: process.env.DEBUG === "true" } | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { DocumentClient } from "aws-sdk/clients/dynamodb"; | ||
import { createHandler } from "@webiny/handler-aws"; | ||
import dbPlugins from "@webiny/handler-db"; | ||
import { DynamoDbDriver } from "@webiny/db-dynamodb"; | ||
import queueAddPlugins from "@webiny/api-prerendering-service/queue/add"; | ||
import logsPlugins from "@webiny/handler-logs"; | ||
import { createPrerenderingServiceStorageOperations } from "@webiny/api-prerendering-service-so-ddb"; | ||
|
||
export const handler = createHandler( | ||
logsPlugins(), | ||
queueAddPlugins(), | ||
dbPlugins({ | ||
table: process.env.DB_TABLE, | ||
driver: new DynamoDbDriver({ | ||
documentClient: new DocumentClient({ | ||
convertEmptyValues: true, | ||
region: process.env.AWS_REGION | ||
const documentClient = new DocumentClient({ | ||
convertEmptyValues: true, | ||
region: process.env.AWS_REGION | ||
}); | ||
export const handler = createHandler({ | ||
plugins: [ | ||
logsPlugins(), | ||
queueAddPlugins({ | ||
storageOperations: createPrerenderingServiceStorageOperations({ | ||
documentClient, | ||
table: table => ({ ...table, name: process.env.DB_TABLE }) | ||
}) | ||
}) | ||
}) | ||
); | ||
], | ||
http: { debug: process.env.DEBUG === "true" } | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
import { DocumentClient } from "aws-sdk/clients/dynamodb"; | ||
import { createHandler } from "@webiny/handler-aws"; | ||
import dbPlugins from "@webiny/handler-db"; | ||
import { DynamoDbDriver } from "@webiny/db-dynamodb"; | ||
import queueProcessPlugins from "@webiny/api-prerendering-service/queue/process"; | ||
import logsPlugins from "@webiny/handler-logs"; | ||
import { createPrerenderingServiceStorageOperations } from "@webiny/api-prerendering-service-so-ddb"; | ||
|
||
export const handler = createHandler( | ||
logsPlugins(), | ||
queueProcessPlugins({ | ||
handlers: { | ||
render: process.env.PRERENDERING_RENDER_HANDLER, | ||
flush: process.env.PRERENDERING_FLUSH_HANDLER | ||
} | ||
}), | ||
dbPlugins({ | ||
table: process.env.DB_TABLE, | ||
driver: new DynamoDbDriver({ | ||
documentClient: new DocumentClient({ | ||
convertEmptyValues: true, | ||
region: process.env.AWS_REGION | ||
const documentClient = new DocumentClient({ | ||
convertEmptyValues: true, | ||
region: process.env.AWS_REGION | ||
}); | ||
export const handler = createHandler({ | ||
plugins: [ | ||
logsPlugins(), | ||
queueProcessPlugins({ | ||
handlers: { | ||
render: process.env.PRERENDERING_RENDER_HANDLER, | ||
flush: process.env.PRERENDERING_FLUSH_HANDLER | ||
}, | ||
storageOperations: createPrerenderingServiceStorageOperations({ | ||
documentClient, | ||
table: table => ({ ...table, name: process.env.DB_TABLE }) | ||
}) | ||
}) | ||
}) | ||
); | ||
], | ||
http: { debug: process.env.DEBUG === "true" } | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
import { DocumentClient } from "aws-sdk/clients/dynamodb"; | ||
import { createHandler } from "@webiny/handler-aws"; | ||
import dbPlugins from "@webiny/handler-db"; | ||
import { DynamoDbDriver } from "@webiny/db-dynamodb"; | ||
import renderPlugins from "@webiny/api-prerendering-service/render"; | ||
import renderAwsPlugins from "@webiny/api-prerendering-service-aws/render"; | ||
import logsPlugins from "@webiny/handler-logs"; | ||
import { createPrerenderingServiceStorageOperations } from "@webiny/api-prerendering-service-so-ddb"; | ||
|
||
export const handler = createHandler( | ||
logsPlugins(), | ||
renderPlugins(), | ||
renderAwsPlugins(), | ||
dbPlugins({ | ||
table: process.env.DB_TABLE, | ||
driver: new DynamoDbDriver({ | ||
documentClient: new DocumentClient({ | ||
convertEmptyValues: true, | ||
region: process.env.AWS_REGION | ||
const documentClient = new DocumentClient({ | ||
convertEmptyValues: true, | ||
region: process.env.AWS_REGION | ||
}); | ||
export const handler = createHandler({ | ||
plugins: [ | ||
logsPlugins(), | ||
renderPlugins({ | ||
storageOperations: createPrerenderingServiceStorageOperations({ | ||
documentClient, | ||
table: table => ({ ...table, name: process.env.DB_TABLE }) | ||
}) | ||
}) | ||
}) | ||
); | ||
}), | ||
renderAwsPlugins() | ||
], | ||
http: { debug: process.env.DEBUG === "true" } | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("../../.babel.node")({ path: __dirname }); |
Oops, something went wrong.