@webiny/api-prerendering-service-so-ddb 0.0.0-mt-3 → 0.0.0-unstable.2af142b57e
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/definitions/queueJob.d.ts +2 -2
- package/definitions/queueJob.js +3 -12
- package/definitions/queueJob.js.map +1 -0
- package/definitions/render.d.ts +2 -2
- package/definitions/render.js +6 -21
- package/definitions/render.js.map +1 -0
- package/definitions/{tagUrlLink.d.ts → renderLegacy.d.ts} +2 -2
- package/definitions/renderLegacy.js +47 -0
- package/definitions/renderLegacy.js.map +1 -0
- package/definitions/settings.d.ts +8 -0
- package/definitions/settings.js +35 -0
- package/definitions/settings.js.map +1 -0
- package/definitions/table.d.ts +3 -2
- package/definitions/table.js +7 -4
- package/definitions/table.js.map +1 -0
- package/definitions/tagPathLink.d.ts +9 -0
- package/definitions/tagPathLink.js +41 -0
- package/definitions/tagPathLink.js.map +1 -0
- package/definitions/tagPathLinkLegacy.d.ts +9 -0
- package/definitions/tagPathLinkLegacy.js +44 -0
- package/definitions/tagPathLinkLegacy.js.map +1 -0
- package/definitions/tenantEntity.d.ts +7 -0
- package/definitions/tenantEntity.js +37 -0
- package/definitions/tenantEntity.js.map +1 -0
- package/index.js +28 -32
- package/index.js.map +1 -0
- package/operations/queueJob.d.ts +6 -0
- package/operations/{queueJob/index.js → queueJob.js} +5 -28
- package/operations/queueJob.js.map +1 -0
- package/operations/render.d.ts +21 -0
- package/operations/{render/index.js → render.js} +117 -127
- package/operations/render.js.map +1 -0
- package/operations/settings.d.ts +6 -0
- package/operations/settings.js +62 -0
- package/operations/settings.js.map +1 -0
- package/operations/tenant.d.ts +6 -0
- package/operations/tenant.js +28 -0
- package/operations/tenant.js.map +1 -0
- package/package.json +17 -17
- package/types.d.ts +9 -2
- package/types.js +3 -2
- package/types.js.map +1 -0
- package/definitions/tagUrlLink.js +0 -53
- package/operations/queueJob/index.d.ts +0 -6
- package/operations/render/index.d.ts +0 -16
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
|
-
export interface
|
|
3
|
+
export interface CreateQueueJobEntityParams {
|
|
4
4
|
table: Table;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
8
|
-
export declare const createQueueJobEntity: (params:
|
|
8
|
+
export declare const createQueueJobEntity: (params: CreateQueueJobEntityParams) => Entity<any>;
|
package/definitions/queueJob.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createQueueJobEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
-
|
|
18
10
|
const createQueueJobEntity = params => {
|
|
19
11
|
const {
|
|
20
12
|
entityName,
|
|
@@ -24,7 +16,7 @@ const createQueueJobEntity = params => {
|
|
|
24
16
|
return new _dynamodbToolbox.Entity({
|
|
25
17
|
name: entityName,
|
|
26
18
|
table,
|
|
27
|
-
attributes:
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
28
20
|
PK: {
|
|
29
21
|
partitionKey: true
|
|
30
22
|
},
|
|
@@ -43,5 +35,4 @@ const createQueueJobEntity = params => {
|
|
|
43
35
|
}, attributes || {})
|
|
44
36
|
});
|
|
45
37
|
};
|
|
46
|
-
|
|
47
38
|
exports.createQueueJobEntity = createQueueJobEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createQueueJobEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","id","args"],"sources":["queueJob.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateQueueJobEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createQueueJobEntity = (params: CreateQueueJobEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n args: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AASO,MAAMA,oBAAoB,GAAIC,MAAkC,IAAkB;EACrF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,EAAE,EAAE;QACAD,IAAI,EAAE;MACV,CAAC;MACDE,IAAI,EAAE;QACFF,IAAI,EAAE;MACV;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/definitions/render.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
|
-
export interface
|
|
3
|
+
export interface CreateRenderEntityParams {
|
|
4
4
|
table: Table;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
8
|
-
export declare const createRenderEntity: (params:
|
|
8
|
+
export declare const createRenderEntity: (params: CreateRenderEntityParams) => Entity<any>;
|
package/definitions/render.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createRenderEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
-
|
|
18
10
|
const createRenderEntity = params => {
|
|
19
11
|
const {
|
|
20
12
|
entityName,
|
|
@@ -24,7 +16,7 @@ const createRenderEntity = params => {
|
|
|
24
16
|
return new _dynamodbToolbox.Entity({
|
|
25
17
|
name: entityName,
|
|
26
18
|
table,
|
|
27
|
-
attributes:
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
28
20
|
PK: {
|
|
29
21
|
partitionKey: true
|
|
30
22
|
},
|
|
@@ -34,23 +26,16 @@ const createRenderEntity = params => {
|
|
|
34
26
|
TYPE: {
|
|
35
27
|
type: "string"
|
|
36
28
|
},
|
|
37
|
-
|
|
29
|
+
GSI1_PK: {
|
|
38
30
|
type: "string"
|
|
39
31
|
},
|
|
40
|
-
|
|
32
|
+
GSI1_SK: {
|
|
41
33
|
type: "string"
|
|
42
34
|
},
|
|
43
|
-
|
|
44
|
-
type: "map"
|
|
45
|
-
},
|
|
46
|
-
configuration: {
|
|
35
|
+
data: {
|
|
47
36
|
type: "map"
|
|
48
|
-
},
|
|
49
|
-
files: {
|
|
50
|
-
type: "list"
|
|
51
37
|
}
|
|
52
38
|
}, attributes || {})
|
|
53
39
|
});
|
|
54
40
|
};
|
|
55
|
-
|
|
56
41
|
exports.createRenderEntity = createRenderEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createRenderEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","GSI1_PK","GSI1_SK","data"],"sources":["render.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateRenderEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createRenderEntity = (params: CreateRenderEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AASO,MAAMA,kBAAkB,GAAIC,MAAgC,IAAkB;EACjF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,OAAO,EAAE;QACLD,IAAI,EAAE;MACV,CAAC;MACDE,OAAO,EAAE;QACLF,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
|
-
export interface
|
|
3
|
+
export interface CreateRenderEntityParams {
|
|
4
4
|
table: Table;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const createRenderEntity: (params: CreateRenderEntityParams) => Entity<any>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createRenderEntity = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
10
|
+
const createRenderEntity = params => {
|
|
11
|
+
const {
|
|
12
|
+
entityName,
|
|
13
|
+
attributes,
|
|
14
|
+
table
|
|
15
|
+
} = params;
|
|
16
|
+
return new _dynamodbToolbox.Entity({
|
|
17
|
+
name: entityName,
|
|
18
|
+
table,
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
20
|
+
PK: {
|
|
21
|
+
partitionKey: true
|
|
22
|
+
},
|
|
23
|
+
SK: {
|
|
24
|
+
sortKey: true
|
|
25
|
+
},
|
|
26
|
+
TYPE: {
|
|
27
|
+
type: "string"
|
|
28
|
+
},
|
|
29
|
+
namespace: {
|
|
30
|
+
type: "string"
|
|
31
|
+
},
|
|
32
|
+
url: {
|
|
33
|
+
type: "string"
|
|
34
|
+
},
|
|
35
|
+
args: {
|
|
36
|
+
type: "map"
|
|
37
|
+
},
|
|
38
|
+
configuration: {
|
|
39
|
+
type: "map"
|
|
40
|
+
},
|
|
41
|
+
files: {
|
|
42
|
+
type: "list"
|
|
43
|
+
}
|
|
44
|
+
}, attributes || {})
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
exports.createRenderEntity = createRenderEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createRenderEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","namespace","url","args","configuration","files"],"sources":["renderLegacy.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateRenderEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createRenderEntity = (params: CreateRenderEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n namespace: {\n type: \"string\"\n },\n url: {\n type: \"string\"\n },\n args: {\n type: \"map\"\n },\n configuration: {\n type: \"map\"\n },\n files: {\n type: \"list\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AASO,MAAMA,kBAAkB,GAAIC,MAAgC,IAAkB;EACjF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,SAAS,EAAE;QACPD,IAAI,EAAE;MACV,CAAC;MACDE,GAAG,EAAE;QACDF,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACDI,aAAa,EAAE;QACXJ,IAAI,EAAE;MACV,CAAC;MACDK,KAAK,EAAE;QACHL,IAAI,EAAE;MACV;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
+
import { Attributes } from "../types";
|
|
3
|
+
export interface CreateSettingsEntityParams {
|
|
4
|
+
table: Table;
|
|
5
|
+
entityName: string;
|
|
6
|
+
attributes: Attributes;
|
|
7
|
+
}
|
|
8
|
+
export declare const createSettingsEntity: (params: CreateSettingsEntityParams) => Entity<any>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createSettingsEntity = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
10
|
+
const createSettingsEntity = params => {
|
|
11
|
+
const {
|
|
12
|
+
entityName,
|
|
13
|
+
attributes,
|
|
14
|
+
table
|
|
15
|
+
} = params;
|
|
16
|
+
return new _dynamodbToolbox.Entity({
|
|
17
|
+
name: entityName,
|
|
18
|
+
table,
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
20
|
+
PK: {
|
|
21
|
+
partitionKey: true
|
|
22
|
+
},
|
|
23
|
+
SK: {
|
|
24
|
+
sortKey: true
|
|
25
|
+
},
|
|
26
|
+
TYPE: {
|
|
27
|
+
type: "string"
|
|
28
|
+
},
|
|
29
|
+
data: {
|
|
30
|
+
type: "map"
|
|
31
|
+
}
|
|
32
|
+
}, attributes || {})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
exports.createSettingsEntity = createSettingsEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSettingsEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","data"],"sources":["settings.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateSettingsEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSettingsEntity = (params: CreateSettingsEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AASO,MAAMA,oBAAoB,GAAIC,MAAkC,IAAkB;EACrF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,IAAI,EAAE;QACFD,IAAI,EAAE;MACV;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/definitions/table.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
2
2
|
import { Table } from "dynamodb-toolbox";
|
|
3
3
|
import { TableModifier } from "../types";
|
|
4
|
-
|
|
4
|
+
interface CreateTableParams {
|
|
5
5
|
table?: TableModifier;
|
|
6
6
|
documentClient: DocumentClient;
|
|
7
7
|
}
|
|
8
|
-
export declare const createTable: (params:
|
|
8
|
+
export declare const createTable: (params: CreateTableParams) => Table;
|
|
9
|
+
export {};
|
package/definitions/table.js
CHANGED
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createTable = void 0;
|
|
7
|
-
|
|
8
7
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
9
|
-
|
|
10
8
|
const createTable = params => {
|
|
11
9
|
const {
|
|
12
10
|
table,
|
|
@@ -16,10 +14,15 @@ const createTable = params => {
|
|
|
16
14
|
name: process.env.DB_TABLE_PRERENDERING_SERVICE || process.env.DB_TABLE,
|
|
17
15
|
partitionKey: "PK",
|
|
18
16
|
sortKey: "SK",
|
|
19
|
-
DocumentClient: documentClient
|
|
17
|
+
DocumentClient: documentClient,
|
|
18
|
+
indexes: {
|
|
19
|
+
GSI1: {
|
|
20
|
+
partitionKey: "GSI1_PK",
|
|
21
|
+
sortKey: "GSI1_SK"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
20
24
|
};
|
|
21
25
|
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
|
|
22
26
|
return new _dynamodbToolbox.Table(config);
|
|
23
27
|
};
|
|
24
|
-
|
|
25
28
|
exports.createTable = createTable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createTable","params","table","documentClient","tableConfig","name","process","env","DB_TABLE_PRERENDERING_SERVICE","DB_TABLE","partitionKey","sortKey","DocumentClient","indexes","GSI1","config","Table"],"sources":["table.ts"],"sourcesContent":["import { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table } from \"dynamodb-toolbox\";\nimport { TableModifier } from \"~/types\";\nimport { TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\n\ninterface CreateTableParams {\n table?: TableModifier;\n documentClient: DocumentClient;\n}\n\nexport const createTable = (params: CreateTableParams): Table => {\n const { table, documentClient } = params;\n\n const tableConfig: TableConstructor = {\n name: (process.env.DB_TABLE_PRERENDERING_SERVICE || process.env.DB_TABLE) as string,\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n indexes: {\n GSI1: {\n partitionKey: \"GSI1_PK\",\n sortKey: \"GSI1_SK\"\n }\n }\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AACA;AASO,MAAMA,WAAW,GAAIC,MAAyB,IAAY;EAC7D,MAAM;IAAEC,KAAK;IAAEC;EAAe,CAAC,GAAGF,MAAM;EAExC,MAAMG,WAA6B,GAAG;IAClCC,IAAI,EAAGC,OAAO,CAACC,GAAG,CAACC,6BAA6B,IAAIF,OAAO,CAACC,GAAG,CAACE,QAAmB;IACnFC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET,cAAc;IAC9BU,OAAO,EAAE;MACLC,IAAI,EAAE;QACFJ,YAAY,EAAE,SAAS;QACvBC,OAAO,EAAE;MACb;IACJ;EACJ,CAAC;EAED,MAAMI,MAAM,GAAG,OAAOb,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIY,sBAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
+
import { Attributes } from "../types";
|
|
3
|
+
interface CreateTagPathLinkEntityParams {
|
|
4
|
+
table: Table;
|
|
5
|
+
entityName: string;
|
|
6
|
+
attributes: Attributes;
|
|
7
|
+
}
|
|
8
|
+
export declare const createTagPathLinkEntity: (params: CreateTagPathLinkEntityParams) => Entity<{}>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createTagPathLinkEntity = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
10
|
+
const createTagPathLinkEntity = params => {
|
|
11
|
+
const {
|
|
12
|
+
entityName,
|
|
13
|
+
attributes,
|
|
14
|
+
table
|
|
15
|
+
} = params;
|
|
16
|
+
return new _dynamodbToolbox.Entity({
|
|
17
|
+
name: entityName,
|
|
18
|
+
table,
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
20
|
+
PK: {
|
|
21
|
+
partitionKey: true
|
|
22
|
+
},
|
|
23
|
+
SK: {
|
|
24
|
+
sortKey: true
|
|
25
|
+
},
|
|
26
|
+
TYPE: {
|
|
27
|
+
type: "string"
|
|
28
|
+
},
|
|
29
|
+
GSI1_PK: {
|
|
30
|
+
type: "string"
|
|
31
|
+
},
|
|
32
|
+
GSI1_SK: {
|
|
33
|
+
type: "string"
|
|
34
|
+
},
|
|
35
|
+
data: {
|
|
36
|
+
type: "map"
|
|
37
|
+
}
|
|
38
|
+
}, attributes || {})
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.createTagPathLinkEntity = createTagPathLinkEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createTagPathLinkEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","GSI1_PK","GSI1_SK","data"],"sources":["tagPathLink.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface CreateTagPathLinkEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createTagPathLinkEntity = (params: CreateTagPathLinkEntityParams) => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AASO,MAAMA,uBAAuB,GAAIC,MAAqC,IAAK;EAC9E,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,OAAO,EAAE;QACLD,IAAI,EAAE;MACV,CAAC;MACDE,OAAO,EAAE;QACLF,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
+
import { Attributes } from "../types";
|
|
3
|
+
interface CreateTagUrlLinkEntityParams {
|
|
4
|
+
table: Table;
|
|
5
|
+
entityName: string;
|
|
6
|
+
attributes: Attributes;
|
|
7
|
+
}
|
|
8
|
+
export declare const createTagUrlLinkEntity: (params: CreateTagUrlLinkEntityParams) => Entity<{}>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createTagUrlLinkEntity = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
10
|
+
const createTagUrlLinkEntity = params => {
|
|
11
|
+
const {
|
|
12
|
+
entityName,
|
|
13
|
+
attributes,
|
|
14
|
+
table
|
|
15
|
+
} = params;
|
|
16
|
+
return new _dynamodbToolbox.Entity({
|
|
17
|
+
name: entityName,
|
|
18
|
+
table,
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
20
|
+
PK: {
|
|
21
|
+
partitionKey: true
|
|
22
|
+
},
|
|
23
|
+
SK: {
|
|
24
|
+
sortKey: true
|
|
25
|
+
},
|
|
26
|
+
TYPE: {
|
|
27
|
+
type: "string"
|
|
28
|
+
},
|
|
29
|
+
namespace: {
|
|
30
|
+
type: "string"
|
|
31
|
+
},
|
|
32
|
+
url: {
|
|
33
|
+
type: "string"
|
|
34
|
+
},
|
|
35
|
+
value: {
|
|
36
|
+
type: "string"
|
|
37
|
+
},
|
|
38
|
+
key: {
|
|
39
|
+
type: "string"
|
|
40
|
+
}
|
|
41
|
+
}, attributes || {})
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
exports.createTagUrlLinkEntity = createTagUrlLinkEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createTagUrlLinkEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","namespace","url","value","key"],"sources":["tagPathLinkLegacy.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface CreateTagUrlLinkEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createTagUrlLinkEntity = (params: CreateTagUrlLinkEntityParams) => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n namespace: {\n type: \"string\"\n },\n url: {\n type: \"string\"\n },\n value: {\n type: \"string\"\n },\n key: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AASO,MAAMA,sBAAsB,GAAIC,MAAoC,IAAK;EAC5E,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,SAAS,EAAE;QACPD,IAAI,EAAE;MACV,CAAC;MACDE,GAAG,EAAE;QACDF,IAAI,EAAE;MACV,CAAC;MACDG,KAAK,EAAE;QACHH,IAAI,EAAE;MACV,CAAC;MACDI,GAAG,EAAE;QACDJ,IAAI,EAAE;MACV;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createTenantEntity = void 0;
|
|
7
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
8
|
+
const createTenantEntity = ({
|
|
9
|
+
entityName,
|
|
10
|
+
table
|
|
11
|
+
}) => {
|
|
12
|
+
return new _dynamodbToolbox.Entity({
|
|
13
|
+
table,
|
|
14
|
+
name: entityName,
|
|
15
|
+
attributes: {
|
|
16
|
+
PK: {
|
|
17
|
+
partitionKey: true
|
|
18
|
+
},
|
|
19
|
+
SK: {
|
|
20
|
+
sortKey: true
|
|
21
|
+
},
|
|
22
|
+
GSI1_PK: {
|
|
23
|
+
type: "string"
|
|
24
|
+
},
|
|
25
|
+
GSI1_SK: {
|
|
26
|
+
type: "string"
|
|
27
|
+
},
|
|
28
|
+
TYPE: {
|
|
29
|
+
type: "string"
|
|
30
|
+
},
|
|
31
|
+
id: {
|
|
32
|
+
type: "string"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.createTenantEntity = createTenantEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createTenantEntity","entityName","table","Entity","name","attributes","PK","partitionKey","SK","sortKey","GSI1_PK","type","GSI1_SK","TYPE","id"],"sources":["tenantEntity.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\n\ninterface Params {\n table: Table;\n entityName: string;\n}\n\nexport const createTenantEntity = ({ entityName, table }: Params): Entity<any> => {\n return new Entity({\n table,\n name: entityName,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n }\n }\n });\n};\n"],"mappings":";;;;;;AAAA;AAOO,MAAMA,kBAAkB,GAAG,CAAC;EAAEC,UAAU;EAAEC;AAAc,CAAC,KAAkB;EAC9E,OAAO,IAAIC,uBAAM,CAAC;IACdD,KAAK;IACLE,IAAI,EAAEH,UAAU;IAChBI,UAAU,EAAE;MACRC,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,OAAO,EAAE;QACLD,IAAI,EAAE;MACV,CAAC;MACDE,IAAI,EAAE;QACFF,IAAI,EAAE;MACV,CAAC;MACDG,EAAE,EAAE;QACAH,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/index.js
CHANGED
|
@@ -1,59 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createPrerenderingServiceStorageOperations = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
-
|
|
14
10
|
var _types = require("./types");
|
|
15
|
-
|
|
16
11
|
var _table = require("./definitions/table");
|
|
17
|
-
|
|
18
12
|
var _render = require("./definitions/render");
|
|
19
|
-
|
|
13
|
+
var _settings = require("./definitions/settings");
|
|
20
14
|
var _queueJob = require("./definitions/queueJob");
|
|
21
|
-
|
|
22
15
|
var _render2 = require("./operations/render");
|
|
23
|
-
|
|
16
|
+
var _tenant = require("./operations/tenant");
|
|
17
|
+
var _settings2 = require("./operations/settings");
|
|
24
18
|
var _queueJob2 = require("./operations/queueJob");
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
-
|
|
30
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
|
-
|
|
19
|
+
var _tagPathLink = require("./definitions/tagPathLink");
|
|
20
|
+
var _tenantEntity = require("./definitions/tenantEntity");
|
|
32
21
|
const reservedFields = ["PK", "SK", "index", "data", "TYPE", "__type", "GSI1_PK", "GSI1_SK"];
|
|
33
|
-
|
|
34
22
|
const isReserved = name => {
|
|
35
23
|
if (reservedFields.includes(name) === false) {
|
|
36
24
|
return;
|
|
37
25
|
}
|
|
38
|
-
|
|
39
26
|
throw new _error.default(`Attribute name "${name}" is not allowed.`, "ATTRIBUTE_NOT_ALLOWED", {
|
|
40
27
|
name
|
|
41
28
|
});
|
|
42
29
|
};
|
|
43
|
-
|
|
44
30
|
const createPrerenderingServiceStorageOperations = params => {
|
|
45
31
|
const {
|
|
46
|
-
attributes
|
|
32
|
+
attributes,
|
|
47
33
|
table,
|
|
48
34
|
documentClient
|
|
49
35
|
} = params;
|
|
50
|
-
|
|
51
36
|
if (attributes) {
|
|
52
37
|
Object.values(attributes).forEach(attrs => {
|
|
53
38
|
Object.keys(attrs).forEach(isReserved);
|
|
54
39
|
});
|
|
55
40
|
}
|
|
56
|
-
|
|
57
41
|
const tableInstance = (0, _table.createTable)({
|
|
58
42
|
table,
|
|
59
43
|
documentClient
|
|
@@ -62,28 +46,40 @@ const createPrerenderingServiceStorageOperations = params => {
|
|
|
62
46
|
render: (0, _render.createRenderEntity)({
|
|
63
47
|
entityName: _types.ENTITIES.RENDER,
|
|
64
48
|
table: tableInstance,
|
|
65
|
-
attributes: attributes[_types.ENTITIES.RENDER]
|
|
49
|
+
attributes: attributes ? attributes[_types.ENTITIES.RENDER] : {}
|
|
50
|
+
}),
|
|
51
|
+
settings: (0, _settings.createSettingsEntity)({
|
|
52
|
+
entityName: _types.ENTITIES.SETTINGS,
|
|
53
|
+
table: tableInstance,
|
|
54
|
+
attributes: attributes ? attributes[_types.ENTITIES.SETTINGS] : {}
|
|
66
55
|
}),
|
|
67
56
|
queueJob: (0, _queueJob.createQueueJobEntity)({
|
|
68
57
|
entityName: _types.ENTITIES.QUEUE_JOB,
|
|
69
58
|
table: tableInstance,
|
|
70
|
-
attributes: attributes[_types.ENTITIES.QUEUE_JOB]
|
|
59
|
+
attributes: attributes ? attributes[_types.ENTITIES.QUEUE_JOB] : {}
|
|
71
60
|
}),
|
|
72
|
-
|
|
73
|
-
entityName: _types.ENTITIES.
|
|
61
|
+
tagPathLink: (0, _tagPathLink.createTagPathLinkEntity)({
|
|
62
|
+
entityName: _types.ENTITIES.TAG_PATH_LINK,
|
|
74
63
|
table: tableInstance,
|
|
75
|
-
attributes: attributes[_types.ENTITIES.
|
|
64
|
+
attributes: attributes ? attributes[_types.ENTITIES.TAG_PATH_LINK] : {}
|
|
65
|
+
}),
|
|
66
|
+
tenant: (0, _tenantEntity.createTenantEntity)({
|
|
67
|
+
entityName: _types.ENTITIES.TENANT,
|
|
68
|
+
table: tableInstance
|
|
76
69
|
})
|
|
77
70
|
};
|
|
78
|
-
return
|
|
71
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
79
72
|
getTable: () => tableInstance,
|
|
80
73
|
getEntities: () => entities
|
|
81
74
|
}, (0, _render2.createRenderStorageOperations)({
|
|
82
75
|
entity: entities.render,
|
|
83
|
-
|
|
76
|
+
tagPathLinkEntity: entities.tagPathLink
|
|
84
77
|
})), (0, _queueJob2.createQueueJobStorageOperations)({
|
|
85
78
|
entity: entities.queueJob
|
|
79
|
+
})), (0, _settings2.createSettingsStorageOperations)({
|
|
80
|
+
entity: entities.settings
|
|
81
|
+
})), (0, _tenant.createTenantStorageOperations)({
|
|
82
|
+
entity: entities.tenant
|
|
86
83
|
}));
|
|
87
84
|
};
|
|
88
|
-
|
|
89
85
|
exports.createPrerenderingServiceStorageOperations = createPrerenderingServiceStorageOperations;
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reservedFields","isReserved","name","includes","WebinyError","createPrerenderingServiceStorageOperations","params","attributes","table","documentClient","Object","values","forEach","attrs","keys","tableInstance","createTable","entities","render","createRenderEntity","entityName","ENTITIES","RENDER","settings","createSettingsEntity","SETTINGS","queueJob","createQueueJobEntity","QUEUE_JOB","tagPathLink","createTagPathLinkEntity","TAG_PATH_LINK","tenant","createTenantEntity","TENANT","getTable","getEntities","createRenderStorageOperations","entity","tagPathLinkEntity","createQueueJobStorageOperations","createSettingsStorageOperations","createTenantStorageOperations"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ENTITIES, PrerenderingServiceFactory, PrerenderingServiceFactoryParams } from \"~/types\";\nimport { createTable } from \"~/definitions/table\";\nimport { createRenderEntity } from \"~/definitions/render\";\nimport { createSettingsEntity } from \"~/definitions/settings\";\nimport { createQueueJobEntity } from \"~/definitions/queueJob\";\nimport { createRenderStorageOperations } from \"~/operations/render\";\nimport { createTenantStorageOperations } from \"~/operations/tenant\";\nimport { createSettingsStorageOperations } from \"~/operations/settings\";\nimport { createQueueJobStorageOperations } from \"~/operations/queueJob\";\nimport { createTagPathLinkEntity } from \"~/definitions/tagPathLink\";\nimport { createTenantEntity } from \"~/definitions/tenantEntity\";\n\nconst reservedFields = [\"PK\", \"SK\", \"index\", \"data\", \"TYPE\", \"__type\", \"GSI1_PK\", \"GSI1_SK\"];\n\nconst isReserved = (name: string): void => {\n if (reservedFields.includes(name) === false) {\n return;\n }\n throw new WebinyError(`Attribute name \"${name}\" is not allowed.`, \"ATTRIBUTE_NOT_ALLOWED\", {\n name\n });\n};\n\nexport const createPrerenderingServiceStorageOperations: PrerenderingServiceFactory = (\n params: PrerenderingServiceFactoryParams\n) => {\n const { attributes, table, documentClient } = params;\n\n if (attributes) {\n Object.values(attributes).forEach(attrs => {\n Object.keys(attrs).forEach(isReserved);\n });\n }\n\n const tableInstance = createTable({ table, documentClient });\n\n const entities = {\n render: createRenderEntity({\n entityName: ENTITIES.RENDER,\n table: tableInstance,\n attributes: attributes ? attributes[ENTITIES.RENDER] : {}\n }),\n settings: createSettingsEntity({\n entityName: ENTITIES.SETTINGS,\n table: tableInstance,\n attributes: attributes ? attributes[ENTITIES.SETTINGS] : {}\n }),\n queueJob: createQueueJobEntity({\n entityName: ENTITIES.QUEUE_JOB,\n table: tableInstance,\n attributes: attributes ? attributes[ENTITIES.QUEUE_JOB] : {}\n }),\n tagPathLink: createTagPathLinkEntity({\n entityName: ENTITIES.TAG_PATH_LINK,\n table: tableInstance,\n attributes: attributes ? attributes[ENTITIES.TAG_PATH_LINK] : {}\n }),\n tenant: createTenantEntity({\n entityName: ENTITIES.TENANT,\n table: tableInstance\n })\n };\n\n return {\n getTable: () => tableInstance,\n getEntities: () => entities,\n ...createRenderStorageOperations({\n entity: entities.render,\n tagPathLinkEntity: entities.tagPathLink\n }),\n ...createQueueJobStorageOperations({\n entity: entities.queueJob\n }),\n ...createSettingsStorageOperations({\n entity: entities.settings\n }),\n ...createTenantStorageOperations({\n entity: entities.tenant\n })\n };\n};\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAMA,cAAc,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;AAE5F,MAAMC,UAAU,GAAIC,IAAY,IAAW;EACvC,IAAIF,cAAc,CAACG,QAAQ,CAACD,IAAI,CAAC,KAAK,KAAK,EAAE;IACzC;EACJ;EACA,MAAM,IAAIE,cAAW,CAAE,mBAAkBF,IAAK,mBAAkB,EAAE,uBAAuB,EAAE;IACvFA;EACJ,CAAC,CAAC;AACN,CAAC;AAEM,MAAMG,0CAAsE,GAC/EC,MAAwC,IACvC;EACD,MAAM;IAAEC,UAAU;IAAEC,KAAK;IAAEC;EAAe,CAAC,GAAGH,MAAM;EAEpD,IAAIC,UAAU,EAAE;IACZG,MAAM,CAACC,MAAM,CAACJ,UAAU,CAAC,CAACK,OAAO,CAACC,KAAK,IAAI;MACvCH,MAAM,CAACI,IAAI,CAACD,KAAK,CAAC,CAACD,OAAO,CAACX,UAAU,CAAC;IAC1C,CAAC,CAAC;EACN;EAEA,MAAMc,aAAa,GAAG,IAAAC,kBAAW,EAAC;IAAER,KAAK;IAAEC;EAAe,CAAC,CAAC;EAE5D,MAAMQ,QAAQ,GAAG;IACbC,MAAM,EAAE,IAAAC,0BAAkB,EAAC;MACvBC,UAAU,EAAEC,eAAQ,CAACC,MAAM;MAC3Bd,KAAK,EAAEO,aAAa;MACpBR,UAAU,EAAEA,UAAU,GAAGA,UAAU,CAACc,eAAQ,CAACC,MAAM,CAAC,GAAG,CAAC;IAC5D,CAAC,CAAC;IACFC,QAAQ,EAAE,IAAAC,8BAAoB,EAAC;MAC3BJ,UAAU,EAAEC,eAAQ,CAACI,QAAQ;MAC7BjB,KAAK,EAAEO,aAAa;MACpBR,UAAU,EAAEA,UAAU,GAAGA,UAAU,CAACc,eAAQ,CAACI,QAAQ,CAAC,GAAG,CAAC;IAC9D,CAAC,CAAC;IACFC,QAAQ,EAAE,IAAAC,8BAAoB,EAAC;MAC3BP,UAAU,EAAEC,eAAQ,CAACO,SAAS;MAC9BpB,KAAK,EAAEO,aAAa;MACpBR,UAAU,EAAEA,UAAU,GAAGA,UAAU,CAACc,eAAQ,CAACO,SAAS,CAAC,GAAG,CAAC;IAC/D,CAAC,CAAC;IACFC,WAAW,EAAE,IAAAC,oCAAuB,EAAC;MACjCV,UAAU,EAAEC,eAAQ,CAACU,aAAa;MAClCvB,KAAK,EAAEO,aAAa;MACpBR,UAAU,EAAEA,UAAU,GAAGA,UAAU,CAACc,eAAQ,CAACU,aAAa,CAAC,GAAG,CAAC;IACnE,CAAC,CAAC;IACFC,MAAM,EAAE,IAAAC,gCAAkB,EAAC;MACvBb,UAAU,EAAEC,eAAQ,CAACa,MAAM;MAC3B1B,KAAK,EAAEO;IACX,CAAC;EACL,CAAC;EAED;IACIoB,QAAQ,EAAE,MAAMpB,aAAa;IAC7BqB,WAAW,EAAE,MAAMnB;EAAQ,GACxB,IAAAoB,sCAA6B,EAAC;IAC7BC,MAAM,EAAErB,QAAQ,CAACC,MAAM;IACvBqB,iBAAiB,EAAEtB,QAAQ,CAACY;EAChC,CAAC,CAAC,GACC,IAAAW,0CAA+B,EAAC;IAC/BF,MAAM,EAAErB,QAAQ,CAACS;EACrB,CAAC,CAAC,GACC,IAAAe,0CAA+B,EAAC;IAC/BH,MAAM,EAAErB,QAAQ,CAACM;EACrB,CAAC,CAAC,GACC,IAAAmB,qCAA6B,EAAC;IAC7BJ,MAAM,EAAErB,QAAQ,CAACe;EACrB,CAAC,CAAC;AAEV,CAAC;AAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PrerenderingServiceQueueJobStorageOperations } from "@webiny/api-prerendering-service/types";
|
|
2
|
+
import { Entity } from "dynamodb-toolbox";
|
|
3
|
+
export interface CreateQueueJobStorageOperationsParams {
|
|
4
|
+
entity: Entity<any>;
|
|
5
|
+
}
|
|
6
|
+
export declare const createQueueJobStorageOperations: (params: CreateQueueJobStorageOperationsParams) => PrerenderingServiceQueueJobStorageOperations;
|