@webiny/migrations 6.0.0-alpha.5 → 6.0.0-rc.0
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/LICENSE +2 -7
- package/README.md +11 -1
- package/ddb-es.d.ts +1 -2
- package/ddb-es.js +2 -10
- package/ddb-es.js.map +1 -1
- package/ddb.d.ts +1 -2
- package/ddb.js +2 -10
- package/ddb.js.map +1 -1
- package/package.json +19 -22
- package/utils/createEntity.d.ts +3 -90
- package/utils/createEntity.js +3 -37
- package/utils/createEntity.js.map +1 -1
- package/utils/createTenantEntity.d.ts +2 -48
- package/utils/createTenantEntity.js +3 -10
- package/utils/createTenantEntity.js.map +1 -1
- package/utils/dynamoDb.d.ts +2 -2
- package/utils/dynamoDb.js +2 -60
- package/utils/dynamoDb.js.map +1 -1
- package/utils/elasticsearch/disableEsIndexing.js +3 -10
- package/utils/elasticsearch/disableEsIndexing.js.map +1 -1
- package/utils/elasticsearch/esCreateIndex.d.ts +0 -1
- package/utils/elasticsearch/esCreateIndex.js +8 -24
- package/utils/elasticsearch/esCreateIndex.js.map +1 -1
- package/utils/elasticsearch/esFindOne.d.ts +1 -1
- package/utils/elasticsearch/esFindOne.js +1 -8
- package/utils/elasticsearch/esFindOne.js.map +1 -1
- package/utils/elasticsearch/esGetIndexExist.d.ts +0 -1
- package/utils/elasticsearch/esGetIndexExist.js +4 -13
- package/utils/elasticsearch/esGetIndexExist.js.map +1 -1
- package/utils/elasticsearch/esGetIndexName.d.ts +0 -1
- package/utils/elasticsearch/esGetIndexName.js +8 -24
- package/utils/elasticsearch/esGetIndexName.js.map +1 -1
- package/utils/elasticsearch/esGetIndexSettings.js +5 -13
- package/utils/elasticsearch/esGetIndexSettings.js.map +1 -1
- package/utils/elasticsearch/esListIndexes.js +1 -8
- package/utils/elasticsearch/esListIndexes.js.map +1 -1
- package/utils/elasticsearch/esPutIndexSettings.js +3 -11
- package/utils/elasticsearch/esPutIndexSettings.js.map +1 -1
- package/utils/elasticsearch/esQueryAll.d.ts +1 -1
- package/utils/elasticsearch/esQueryAll.js +3 -10
- package/utils/elasticsearch/esQueryAll.js.map +1 -1
- package/utils/elasticsearch/esQueryAllWithCallback.d.ts +1 -1
- package/utils/elasticsearch/esQueryAllWithCallback.js +3 -10
- package/utils/elasticsearch/esQueryAllWithCallback.js.map +1 -1
- package/utils/elasticsearch/fetchOriginalEsSettings.js +3 -10
- package/utils/elasticsearch/fetchOriginalEsSettings.js.map +1 -1
- package/utils/elasticsearch/index.d.ts +12 -12
- package/utils/elasticsearch/index.js +12 -137
- package/utils/elasticsearch/index.js.map +1 -1
- package/utils/elasticsearch/plugins/base.js +3 -9
- package/utils/elasticsearch/plugins/base.js.map +1 -1
- package/utils/elasticsearch/plugins/index.d.ts +1 -1
- package/utils/elasticsearch/plugins/index.js +3 -11
- package/utils/elasticsearch/plugins/index.js.map +1 -1
- package/utils/elasticsearch/restoreOriginalEsSettings.js +3 -10
- package/utils/elasticsearch/restoreOriginalEsSettings.js.map +1 -1
- package/utils/getCompressedData.js +3 -10
- package/utils/getCompressedData.js.map +1 -1
- package/utils/index.d.ts +5 -7
- package/utils/index.js +5 -82
- package/utils/index.js.map +1 -1
- package/migrations/5.43.0/001/constants.d.ts +0 -2
- package/migrations/5.43.0/001/constants.js +0 -10
- package/migrations/5.43.0/001/constants.js.map +0 -1
- package/migrations/5.43.0/001/ddb/index.d.ts +0 -13
- package/migrations/5.43.0/001/ddb/index.js +0 -215
- package/migrations/5.43.0/001/ddb/index.js.map +0 -1
- package/migrations/5.43.0/001/ddb-es/index.d.ts +0 -16
- package/migrations/5.43.0/001/ddb-es/index.js +0 -257
- package/migrations/5.43.0/001/ddb-es/index.js.map +0 -1
- package/migrations/5.43.0/001/entities/createEntryEntity.d.ts +0 -91
- package/migrations/5.43.0/001/entities/createEntryEntity.js +0 -188
- package/migrations/5.43.0/001/entities/createEntryEntity.js.map +0 -1
- package/migrations/5.43.0/001/types.d.ts +0 -47
- package/migrations/5.43.0/001/types.js +0 -7
- package/migrations/5.43.0/001/types.js.map +0 -1
- package/utils/createLocaleEntity.d.ts +0 -42
- package/utils/createLocaleEntity.js +0 -32
- package/utils/createLocaleEntity.js.map +0 -1
- package/utils/elasticsearch/plugins/japanese.d.ts +0 -4
- package/utils/elasticsearch/plugins/japanese.js +0 -13
- package/utils/elasticsearch/plugins/japanese.js.map +0 -1
- package/utils/forEachTenantLocale.d.ts +0 -22
- package/utils/forEachTenantLocale.js +0 -55
- package/utils/forEachTenantLocale.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* All content that resides under the "enterprise/" directories of this repository, is licensed under the license defined in their respective "enterprise/LICENSE" file.
|
|
6
|
-
* All content that resides under the "packages/" sub-directories of this repository, is licensed under the license defined in their respective "packages/*/LICENSE" file.
|
|
7
|
-
* All third party components incorporated into the Webiny Software are licensed under the original license provided by the owner of the applicable component.
|
|
8
|
-
* Content outside of the above mentioned directories or restrictions above is available under the "MIT" license as defined below.
|
|
3
|
+
Copyright (c) Webiny
|
|
9
4
|
|
|
10
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @webiny/migrations
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
6
|
+
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/ddb-es.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const migrations: () => (typeof Flp_5_43_0_001)[];
|
|
1
|
+
export declare const migrations: () => never[];
|
package/ddb-es.js
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.migrations = void 0;
|
|
7
|
-
var _ddbEs = require("./migrations/5.43.0/001/ddb-es");
|
|
8
1
|
// We only list current version migrations here. No need to have them all
|
|
9
2
|
// listed, as we only need the latest version migrations to be executed.
|
|
10
3
|
// This also helps with keeping the bundle size down / faster boot times.
|
|
11
4
|
|
|
12
|
-
const migrations = () => {
|
|
13
|
-
return [
|
|
5
|
+
export const migrations = () => {
|
|
6
|
+
return [];
|
|
14
7
|
};
|
|
15
|
-
exports.migrations = migrations;
|
|
16
8
|
|
|
17
9
|
//# sourceMappingURL=ddb-es.js.map
|
package/ddb-es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["migrations"],"sources":["ddb-es.ts"],"sourcesContent":["// We only list current version migrations here. No need to have them all\n// listed, as we only need the latest version migrations to be executed.\n// This also helps with keeping the bundle size down / faster boot times.\n\nexport const migrations = () => {\n return [];\n};\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAU,GAAGA,CAAA,KAAM;EAC5B,OAAO,EAAE;AACb,CAAC","ignoreList":[]}
|
package/ddb.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const migrations: () => (typeof Flp_5_43_0_001)[];
|
|
1
|
+
export declare const migrations: () => never[];
|
package/ddb.js
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.migrations = void 0;
|
|
7
|
-
var _ddb = require("./migrations/5.43.0/001/ddb");
|
|
8
1
|
// We only list current version migrations here. No need to have them all
|
|
9
2
|
// listed, as we only need the latest version migrations to be executed.
|
|
10
3
|
// This also helps with keeping the bundle size down / faster boot times.
|
|
11
4
|
|
|
12
|
-
const migrations = () => {
|
|
13
|
-
return [
|
|
5
|
+
export const migrations = () => {
|
|
6
|
+
return [];
|
|
14
7
|
};
|
|
15
|
-
exports.migrations = migrations;
|
|
16
8
|
|
|
17
9
|
//# sourceMappingURL=ddb.js.map
|
package/ddb.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["migrations"],"sources":["ddb.ts"],"sourcesContent":["// We only list current version migrations here. No need to have them all\n// listed, as we only need the latest version migrations to be executed.\n// This also helps with keeping the bundle size down / faster boot times.\n\nexport const migrations = () => {\n return [];\n};\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAU,GAAGA,CAAA,KAAM;EAC5B,OAAO,EAAE;AACb,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,36 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/migrations",
|
|
3
|
-
"version": "6.0.0-
|
|
4
|
-
"
|
|
5
|
-
"build": "node ../cli/bin.js run build",
|
|
6
|
-
"watch": "node ../cli/bin.js run watch"
|
|
7
|
-
},
|
|
3
|
+
"version": "6.0.0-rc.0",
|
|
4
|
+
"type": "module",
|
|
8
5
|
"dependencies": {
|
|
9
6
|
"@elastic/elasticsearch": "7.12.0",
|
|
10
|
-
"@webiny/api-elasticsearch": "6.0.0-
|
|
11
|
-
"@webiny/aws-sdk": "6.0.0-
|
|
12
|
-
"@webiny/data-migration": "6.0.0-
|
|
13
|
-
"@webiny/db-dynamodb": "6.0.0-
|
|
14
|
-
"@webiny/error": "6.0.0-
|
|
15
|
-
"@webiny/ioc": "6.0.0-
|
|
16
|
-
"@webiny/
|
|
17
|
-
"
|
|
18
|
-
"@webiny/utils": "6.0.0-alpha.5",
|
|
19
|
-
"lodash": "4.17.21"
|
|
7
|
+
"@webiny/api-elasticsearch": "6.0.0-rc.0",
|
|
8
|
+
"@webiny/aws-sdk": "6.0.0-rc.0",
|
|
9
|
+
"@webiny/data-migration": "6.0.0-rc.0",
|
|
10
|
+
"@webiny/db-dynamodb": "6.0.0-rc.0",
|
|
11
|
+
"@webiny/error": "6.0.0-rc.0",
|
|
12
|
+
"@webiny/ioc": "6.0.0-rc.0",
|
|
13
|
+
"@webiny/utils": "6.0.0-rc.0",
|
|
14
|
+
"lodash": "4.17.23"
|
|
20
15
|
},
|
|
21
16
|
"publishConfig": {
|
|
22
17
|
"access": "public",
|
|
23
18
|
"directory": "dist"
|
|
24
19
|
},
|
|
25
20
|
"devDependencies": {
|
|
26
|
-
"@webiny/api-headless-cms": "6.0.0-
|
|
27
|
-
"@webiny/api-headless-cms-ddb-es": "6.0.0-
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
30
|
-
"@webiny/
|
|
21
|
+
"@webiny/api-headless-cms": "6.0.0-rc.0",
|
|
22
|
+
"@webiny/api-headless-cms-ddb-es": "6.0.0-rc.0",
|
|
23
|
+
"@webiny/build-tools": "6.0.0-rc.0",
|
|
24
|
+
"@webiny/handler-aws": "6.0.0-rc.0",
|
|
25
|
+
"@webiny/plugins": "6.0.0-rc.0",
|
|
26
|
+
"@webiny/project-utils": "6.0.0-rc.0",
|
|
31
27
|
"elastic-ts": "0.12.0",
|
|
32
28
|
"jest-dynalite": "3.6.1",
|
|
33
|
-
"typescript": "5.
|
|
29
|
+
"typescript": "5.9.3",
|
|
30
|
+
"vitest": "4.0.18"
|
|
34
31
|
},
|
|
35
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "0f2aa699f4642e550ab62c96fcd050e8d02345c9"
|
|
36
33
|
}
|
package/utils/createEntity.d.ts
CHANGED
|
@@ -1,90 +1,3 @@
|
|
|
1
|
-
import type { AttributeDefinitions, Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
-
export declare const
|
|
4
|
-
PK: {
|
|
5
|
-
partitionKey: true;
|
|
6
|
-
};
|
|
7
|
-
SK: {
|
|
8
|
-
sortKey: true;
|
|
9
|
-
};
|
|
10
|
-
GSI1_PK: {
|
|
11
|
-
type: "string";
|
|
12
|
-
};
|
|
13
|
-
GSI1_SK: {
|
|
14
|
-
type: "string";
|
|
15
|
-
};
|
|
16
|
-
TYPE: {
|
|
17
|
-
type: "string";
|
|
18
|
-
};
|
|
19
|
-
}, {
|
|
20
|
-
PK: {
|
|
21
|
-
partitionKey: true;
|
|
22
|
-
};
|
|
23
|
-
SK: {
|
|
24
|
-
sortKey: true;
|
|
25
|
-
};
|
|
26
|
-
GSI1_PK: {
|
|
27
|
-
type: "string";
|
|
28
|
-
};
|
|
29
|
-
GSI1_SK: {
|
|
30
|
-
type: "string";
|
|
31
|
-
};
|
|
32
|
-
TYPE: {
|
|
33
|
-
type: "string";
|
|
34
|
-
};
|
|
35
|
-
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
36
|
-
[x: string]: any;
|
|
37
|
-
[x: number]: any;
|
|
38
|
-
[x: symbol]: any;
|
|
39
|
-
}, {
|
|
40
|
-
[x: string]: any;
|
|
41
|
-
[x: number]: any;
|
|
42
|
-
[x: symbol]: any;
|
|
43
|
-
}>;
|
|
44
|
-
export declare const createStandardEntity: (table: Table<string, string, string>, entityName: string, attributes?: AttributeDefinitions) => Entity<string, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, Table<string, string, string>, true, true, boolean, string, string, string, boolean, {
|
|
45
|
-
PK: {
|
|
46
|
-
partitionKey: true;
|
|
47
|
-
};
|
|
48
|
-
SK: {
|
|
49
|
-
sortKey: true;
|
|
50
|
-
};
|
|
51
|
-
GSI1_PK: {
|
|
52
|
-
type: "string";
|
|
53
|
-
};
|
|
54
|
-
GSI1_SK: {
|
|
55
|
-
type: "string";
|
|
56
|
-
};
|
|
57
|
-
TYPE: {
|
|
58
|
-
type: "string";
|
|
59
|
-
};
|
|
60
|
-
data: {
|
|
61
|
-
type: "map";
|
|
62
|
-
};
|
|
63
|
-
}, {
|
|
64
|
-
PK: {
|
|
65
|
-
partitionKey: true;
|
|
66
|
-
};
|
|
67
|
-
SK: {
|
|
68
|
-
sortKey: true;
|
|
69
|
-
};
|
|
70
|
-
GSI1_PK: {
|
|
71
|
-
type: "string";
|
|
72
|
-
};
|
|
73
|
-
GSI1_SK: {
|
|
74
|
-
type: "string";
|
|
75
|
-
};
|
|
76
|
-
TYPE: {
|
|
77
|
-
type: "string";
|
|
78
|
-
};
|
|
79
|
-
data: {
|
|
80
|
-
type: "map";
|
|
81
|
-
};
|
|
82
|
-
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
83
|
-
[x: string]: any;
|
|
84
|
-
[x: number]: any;
|
|
85
|
-
[x: symbol]: any;
|
|
86
|
-
}, {
|
|
87
|
-
[x: string]: any;
|
|
88
|
-
[x: number]: any;
|
|
89
|
-
[x: symbol]: any;
|
|
90
|
-
}>;
|
|
1
|
+
import type { AttributeDefinitions, Table } from "@webiny/db-dynamodb/toolbox.js";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox.js";
|
|
3
|
+
export declare const createStandardEntity: (table: Table<string, string, string>, entityName: string, attributes?: AttributeDefinitions) => Entity;
|
package/utils/createEntity.js
CHANGED
|
@@ -1,39 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createStandardEntity = exports.createLegacyEntity = void 0;
|
|
7
|
-
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
-
const createLegacyEntity = (table, entityName, attributes) => {
|
|
9
|
-
return new _toolbox.Entity({
|
|
10
|
-
table,
|
|
11
|
-
name: entityName,
|
|
12
|
-
attributes: {
|
|
13
|
-
PK: {
|
|
14
|
-
partitionKey: true
|
|
15
|
-
},
|
|
16
|
-
SK: {
|
|
17
|
-
sortKey: true
|
|
18
|
-
},
|
|
19
|
-
GSI1_PK: {
|
|
20
|
-
type: "string"
|
|
21
|
-
},
|
|
22
|
-
GSI1_SK: {
|
|
23
|
-
type: "string"
|
|
24
|
-
},
|
|
25
|
-
TYPE: {
|
|
26
|
-
type: "string"
|
|
27
|
-
},
|
|
28
|
-
...(attributes || {})
|
|
29
|
-
},
|
|
30
|
-
autoExecute: true,
|
|
31
|
-
autoParse: true
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
exports.createLegacyEntity = createLegacyEntity;
|
|
35
|
-
const createStandardEntity = (table, entityName, attributes = {}) => {
|
|
36
|
-
return new _toolbox.Entity({
|
|
1
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox.js";
|
|
2
|
+
export const createStandardEntity = (table, entityName, attributes = {}) => {
|
|
3
|
+
return new Entity({
|
|
37
4
|
table,
|
|
38
5
|
name: entityName,
|
|
39
6
|
attributes: {
|
|
@@ -62,6 +29,5 @@ const createStandardEntity = (table, entityName, attributes = {}) => {
|
|
|
62
29
|
autoParse: true
|
|
63
30
|
});
|
|
64
31
|
};
|
|
65
|
-
exports.createStandardEntity = createStandardEntity;
|
|
66
32
|
|
|
67
33
|
//# sourceMappingURL=createEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Entity","createStandardEntity","table","entityName","attributes","name","PK","partitionKey","SK","sortKey","GSI1_PK","type","GSI1_SK","TYPE","data","autoExecute","autoParse"],"sources":["createEntity.ts"],"sourcesContent":["import type { AttributeDefinitions, Table } from \"@webiny/db-dynamodb/toolbox.js\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox.js\";\n\nexport const createStandardEntity = (\n table: Table<string, string, string>,\n entityName: string,\n attributes: AttributeDefinitions = {}\n): Entity => {\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 data: {\n type: \"map\"\n },\n // When moving attributes to `data` envelope, we need to keep the old attributes in place for 1 version.\n ...attributes\n },\n autoExecute: true,\n autoParse: true\n });\n};\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,gCAAgC;AAEvD,OAAO,MAAMC,oBAAoB,GAAGA,CAChCC,KAAoC,EACpCC,UAAkB,EAClBC,UAAgC,GAAG,CAAC,CAAC,KAC5B;EACT,OAAO,IAAIJ,MAAM,CAAC;IACdE,KAAK;IACLG,IAAI,EAAEF,UAAU;IAChBC,UAAU,EAAE;MACRE,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,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACD;MACA,GAAGP;IACP,CAAC;IACDW,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -1,48 +1,2 @@
|
|
|
1
|
-
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
export declare const createTenantEntity: (table: Table<string, string, string>) =>
|
|
3
|
-
PK: {
|
|
4
|
-
partitionKey: true;
|
|
5
|
-
};
|
|
6
|
-
SK: {
|
|
7
|
-
sortKey: true;
|
|
8
|
-
};
|
|
9
|
-
GSI1_PK: {
|
|
10
|
-
type: "string";
|
|
11
|
-
};
|
|
12
|
-
GSI1_SK: {
|
|
13
|
-
type: "string";
|
|
14
|
-
};
|
|
15
|
-
TYPE: {
|
|
16
|
-
type: "string";
|
|
17
|
-
};
|
|
18
|
-
data: {
|
|
19
|
-
type: "map";
|
|
20
|
-
};
|
|
21
|
-
}, {
|
|
22
|
-
PK: {
|
|
23
|
-
partitionKey: true;
|
|
24
|
-
};
|
|
25
|
-
SK: {
|
|
26
|
-
sortKey: true;
|
|
27
|
-
};
|
|
28
|
-
GSI1_PK: {
|
|
29
|
-
type: "string";
|
|
30
|
-
};
|
|
31
|
-
GSI1_SK: {
|
|
32
|
-
type: "string";
|
|
33
|
-
};
|
|
34
|
-
TYPE: {
|
|
35
|
-
type: "string";
|
|
36
|
-
};
|
|
37
|
-
data: {
|
|
38
|
-
type: "map";
|
|
39
|
-
};
|
|
40
|
-
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
41
|
-
[x: string]: any;
|
|
42
|
-
[x: number]: any;
|
|
43
|
-
[x: symbol]: any;
|
|
44
|
-
}, {
|
|
45
|
-
[x: string]: any;
|
|
46
|
-
[x: number]: any;
|
|
47
|
-
[x: symbol]: any;
|
|
48
|
-
}>;
|
|
1
|
+
import type { Table, Entity } from "@webiny/db-dynamodb/toolbox.js";
|
|
2
|
+
export declare const createTenantEntity: (table: Table<string, string, string>) => Entity;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createTenantEntity = void 0;
|
|
7
|
-
var _ = require("./");
|
|
8
|
-
const createTenantEntity = table => {
|
|
9
|
-
return (0, _.createStandardEntity)(table, "TenancyTenant");
|
|
1
|
+
import { createStandardEntity } from "./index.js";
|
|
2
|
+
export const createTenantEntity = table => {
|
|
3
|
+
return createStandardEntity(table, "TenancyTenant");
|
|
10
4
|
};
|
|
11
|
-
exports.createTenantEntity = createTenantEntity;
|
|
12
5
|
|
|
13
6
|
//# sourceMappingURL=createTenantEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createStandardEntity","createTenantEntity","table"],"sources":["createTenantEntity.ts"],"sourcesContent":["import type { Table, Entity } from \"@webiny/db-dynamodb/toolbox.js\";\nimport { createStandardEntity } from \"~/utils/index.js\";\n\nexport const createTenantEntity = (table: Table<string, string, string>): Entity => {\n return createStandardEntity(table, \"TenancyTenant\");\n};\n"],"mappings":"AACA,SAASA,oBAAoB;AAE7B,OAAO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAa;EAChF,OAAOF,oBAAoB,CAACE,KAAK,EAAE,eAAe,CAAC;AACvD,CAAC","ignoreList":[]}
|
package/utils/dynamoDb.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BatchReadItem, BatchReadParams, BatchWriteItem, BatchWriteParams, GetRecordParams, ScanParams, ScanResponse } from "@webiny/db-dynamodb/utils";
|
|
2
|
-
import { batchReadAll, batchWriteAll, get, count, queryAll, queryAllWithCallback as ddbQueryAllWithCallback, queryOne, scan, scanWithCallback as ddbScanWithCallback } from "@webiny/db-dynamodb/utils";
|
|
1
|
+
import type { BatchReadItem, BatchReadParams, BatchWriteItem, BatchWriteParams, GetRecordParams, ScanParams, ScanResponse } from "@webiny/db-dynamodb/utils/index.js";
|
|
2
|
+
import { batchReadAll, batchWriteAll, get, count, queryAll, queryAllWithCallback as ddbQueryAllWithCallback, queryOne, scan, scanWithCallback as ddbScanWithCallback } from "@webiny/db-dynamodb/utils/index.js";
|
|
3
3
|
export { count, get, queryAll, ddbQueryAllWithCallback, queryOne, batchReadAll, batchWriteAll, scan, ddbScanWithCallback };
|
|
4
4
|
export type { GetRecordParams, BatchWriteItem, BatchWriteParams, BatchReadItem, BatchReadParams, ScanParams, ScanResponse };
|
package/utils/dynamoDb.js
CHANGED
|
@@ -1,62 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "batchReadAll", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _utils.batchReadAll;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "batchWriteAll", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _utils.batchWriteAll;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "count", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _utils.count;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "ddbQueryAllWithCallback", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _utils.queryAllWithCallback;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "ddbScanWithCallback", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _utils.scanWithCallback;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "get", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _utils.get;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "queryAll", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _utils.queryAll;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "queryOne", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _utils.queryOne;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "scan", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _utils.scan;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
var _utils = require("@webiny/db-dynamodb/utils");
|
|
1
|
+
import { batchReadAll, batchWriteAll, get, count, queryAll, queryAllWithCallback as ddbQueryAllWithCallback, queryOne, scan, scanWithCallback as ddbScanWithCallback } from "@webiny/db-dynamodb/utils/index.js";
|
|
2
|
+
export { count, get, queryAll, ddbQueryAllWithCallback, queryOne, batchReadAll, batchWriteAll, scan, ddbScanWithCallback };
|
|
61
3
|
|
|
62
4
|
//# sourceMappingURL=dynamoDb.js.map
|
package/utils/dynamoDb.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["batchReadAll","batchWriteAll","get","count","queryAll","queryAllWithCallback","ddbQueryAllWithCallback","queryOne","scan","scanWithCallback","ddbScanWithCallback"],"sources":["dynamoDb.ts"],"sourcesContent":["import type {\n BatchReadItem,\n BatchReadParams,\n BatchWriteItem,\n BatchWriteParams,\n GetRecordParams,\n ScanParams,\n ScanResponse\n} from \"@webiny/db-dynamodb/utils/index.js\";\nimport {\n batchReadAll,\n batchWriteAll,\n get,\n count,\n queryAll,\n queryAllWithCallback as ddbQueryAllWithCallback,\n queryOne,\n scan,\n scanWithCallback as ddbScanWithCallback\n} from \"@webiny/db-dynamodb/utils/index.js\";\n\nexport {\n count,\n get,\n queryAll,\n ddbQueryAllWithCallback,\n queryOne,\n batchReadAll,\n batchWriteAll,\n scan,\n ddbScanWithCallback\n};\nexport type {\n GetRecordParams,\n BatchWriteItem,\n BatchWriteParams,\n BatchReadItem,\n BatchReadParams,\n ScanParams,\n ScanResponse\n};\n"],"mappings":"AASA,SACIA,YAAY,EACZC,aAAa,EACbC,GAAG,EACHC,KAAK,EACLC,QAAQ,EACRC,oBAAoB,IAAIC,uBAAuB,EAC/CC,QAAQ,EACRC,IAAI,EACJC,gBAAgB,IAAIC,mBAAmB,QACpC,oCAAoC;AAE3C,SACIP,KAAK,EACLD,GAAG,EACHE,QAAQ,EACRE,uBAAuB,EACvBC,QAAQ,EACRP,YAAY,EACZC,aAAa,EACbO,IAAI,EACJE,mBAAmB","ignoreList":[]}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.disableElasticsearchIndexing = void 0;
|
|
7
|
-
var _ = require("./..");
|
|
8
|
-
const disableElasticsearchIndexing = async params => {
|
|
1
|
+
import { esPutIndexSettings } from "../index.js";
|
|
2
|
+
export const disableElasticsearchIndexing = async params => {
|
|
9
3
|
const {
|
|
10
4
|
index,
|
|
11
5
|
logger
|
|
12
6
|
} = params;
|
|
13
7
|
try {
|
|
14
|
-
await
|
|
8
|
+
await esPutIndexSettings({
|
|
15
9
|
elasticsearchClient: params.elasticsearchClient,
|
|
16
10
|
index,
|
|
17
11
|
settings: {
|
|
@@ -28,6 +22,5 @@ const disableElasticsearchIndexing = async params => {
|
|
|
28
22
|
});
|
|
29
23
|
}
|
|
30
24
|
};
|
|
31
|
-
exports.disableElasticsearchIndexing = disableElasticsearchIndexing;
|
|
32
25
|
|
|
33
26
|
//# sourceMappingURL=disableEsIndexing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["esPutIndexSettings","disableElasticsearchIndexing","params","index","logger","elasticsearchClient","settings","refresh_interval","ex","error","message","code","data"],"sources":["disableEsIndexing.ts"],"sourcesContent":["import { esPutIndexSettings } from \"~/utils/index.js\";\nimport type { Logger } from \"@webiny/data-migration\";\nimport type { Client } from \"@elastic/elasticsearch\";\n\ninterface DisableElasticsearchIndexingParams {\n index: string;\n logger: Logger;\n elasticsearchClient: Client;\n}\n\nexport const disableElasticsearchIndexing = async (\n params: DisableElasticsearchIndexingParams\n): Promise<void> => {\n const { index, logger } = params;\n\n try {\n await esPutIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n settings: {\n refresh_interval: -1\n }\n });\n } catch (ex) {\n logger.error(`Failed to disable indexing for index \"${index}\".`);\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n};\n"],"mappings":"AAAA,SAASA,kBAAkB;AAU3B,OAAO,MAAMC,4BAA4B,GAAG,MACxCC,MAA0C,IAC1B;EAChB,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAEhC,IAAI;IACA,MAAMF,kBAAkB,CAAC;MACrBK,mBAAmB,EAAEH,MAAM,CAACG,mBAAmB;MAC/CF,KAAK;MACLG,QAAQ,EAAE;QACNC,gBAAgB,EAAE,CAAC;MACvB;IACJ,CAAC,CAAC;EACN,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTJ,MAAM,CAACK,KAAK,CAAC,yCAAyCN,KAAK,IAAI,CAAC;IAChEC,MAAM,CAACK,KAAK,CAAC;MACT,GAAGD,EAAE;MACLE,OAAO,EAAEF,EAAE,CAACE,OAAO;MACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;MACbC,IAAI,EAAEJ,EAAE,CAACI;IACb,CAAC,CAAC;EACN;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,40 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.esCreateIndex = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
var _ = require("./..");
|
|
10
|
-
var _plugins = require("./plugins");
|
|
11
|
-
const esCreateIndex = async params => {
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { esGetIndexName, esGetIndexExist } from "../index.js";
|
|
3
|
+
import { elasticsearchIndexPlugins } from "./plugins/index.js";
|
|
4
|
+
export const esCreateIndex = async params => {
|
|
12
5
|
const {
|
|
13
6
|
elasticsearchClient,
|
|
14
7
|
tenant,
|
|
15
|
-
locale,
|
|
16
8
|
type,
|
|
17
9
|
isHeadlessCmsModel
|
|
18
10
|
} = params;
|
|
19
|
-
const indexName =
|
|
11
|
+
const indexName = esGetIndexName({
|
|
20
12
|
tenant,
|
|
21
|
-
locale,
|
|
22
13
|
type,
|
|
23
14
|
isHeadlessCmsModel
|
|
24
15
|
});
|
|
25
16
|
try {
|
|
26
|
-
const exist = await
|
|
17
|
+
const exist = await esGetIndexExist(params);
|
|
27
18
|
if (exist) {
|
|
28
19
|
return indexName;
|
|
29
20
|
}
|
|
30
21
|
|
|
31
22
|
// Get registered plugins
|
|
32
|
-
const plugin =
|
|
33
|
-
if (!plugin.locales) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
return plugin.locales.includes(locale.toLowerCase());
|
|
37
|
-
}).pop();
|
|
23
|
+
const plugin = elasticsearchIndexPlugins().pop();
|
|
38
24
|
await elasticsearchClient.indices.create({
|
|
39
25
|
index: indexName,
|
|
40
26
|
...(plugin && {
|
|
@@ -49,14 +35,12 @@ const esCreateIndex = async params => {
|
|
|
49
35
|
if (ex.message === "resource_already_exists_exception") {
|
|
50
36
|
return indexName;
|
|
51
37
|
}
|
|
52
|
-
throw new
|
|
38
|
+
throw new WebinyError(ex.message || "Could not create Elasticsearch index.", ex.code || "CREATE_OPENSEARCH_INDEX_ERROR", {
|
|
53
39
|
error: ex,
|
|
54
|
-
locale,
|
|
55
40
|
tenant,
|
|
56
41
|
type
|
|
57
42
|
});
|
|
58
43
|
}
|
|
59
44
|
};
|
|
60
|
-
exports.esCreateIndex = esCreateIndex;
|
|
61
45
|
|
|
62
46
|
//# sourceMappingURL=esCreateIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["WebinyError","esGetIndexName","esGetIndexExist","elasticsearchIndexPlugins","esCreateIndex","params","elasticsearchClient","tenant","type","isHeadlessCmsModel","indexName","exist","plugin","pop","indices","create","index","body","ex","message","code","error"],"sources":["esCreateIndex.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { Client } from \"@elastic/elasticsearch\";\nimport { esGetIndexName, esGetIndexExist } from \"~/utils/index.js\";\nimport { elasticsearchIndexPlugins } from \"~/utils/elasticsearch/plugins/index.js\";\n\nexport interface EsCreateIndexParams {\n elasticsearchClient: Client;\n tenant: string;\n type: string;\n isHeadlessCmsModel: boolean;\n}\n\nexport const esCreateIndex = async (params: EsCreateIndexParams): Promise<string> => {\n const { elasticsearchClient, tenant, type, isHeadlessCmsModel } = params;\n\n const indexName = esGetIndexName({ tenant, type, isHeadlessCmsModel });\n\n try {\n const exist = await esGetIndexExist(params);\n\n if (exist) {\n return indexName;\n }\n\n // Get registered plugins\n const plugin = elasticsearchIndexPlugins().pop();\n\n await elasticsearchClient.indices.create({\n index: indexName,\n ...(plugin && { body: plugin.body })\n });\n return indexName;\n } catch (ex) {\n // Despite the fact the above `esGetIndexExist` check told us the index does not exist,\n // we've seen cases where the `resource_already_exists_exception` would still be thrown\n // upon index creation. That's why we're doing an additional check of the error message.\n if (ex.message === \"resource_already_exists_exception\") {\n return indexName;\n }\n\n throw new WebinyError(\n ex.message || \"Could not create Elasticsearch index.\",\n ex.code || \"CREATE_OPENSEARCH_INDEX_ERROR\",\n {\n error: ex,\n tenant,\n type\n }\n );\n }\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AAEvC,SAASC,cAAc,EAAEC,eAAe;AACxC,SAASC,yBAAyB;AASlC,OAAO,MAAMC,aAAa,GAAG,MAAOC,MAA2B,IAAsB;EACjF,MAAM;IAAEC,mBAAmB;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAmB,CAAC,GAAGJ,MAAM;EAExE,MAAMK,SAAS,GAAGT,cAAc,CAAC;IAAEM,MAAM;IAAEC,IAAI;IAAEC;EAAmB,CAAC,CAAC;EAEtE,IAAI;IACA,MAAME,KAAK,GAAG,MAAMT,eAAe,CAACG,MAAM,CAAC;IAE3C,IAAIM,KAAK,EAAE;MACP,OAAOD,SAAS;IACpB;;IAEA;IACA,MAAME,MAAM,GAAGT,yBAAyB,CAAC,CAAC,CAACU,GAAG,CAAC,CAAC;IAEhD,MAAMP,mBAAmB,CAACQ,OAAO,CAACC,MAAM,CAAC;MACrCC,KAAK,EAAEN,SAAS;MAChB,IAAIE,MAAM,IAAI;QAAEK,IAAI,EAAEL,MAAM,CAACK;MAAK,CAAC;IACvC,CAAC,CAAC;IACF,OAAOP,SAAS;EACpB,CAAC,CAAC,OAAOQ,EAAE,EAAE;IACT;IACA;IACA;IACA,IAAIA,EAAE,CAACC,OAAO,KAAK,mCAAmC,EAAE;MACpD,OAAOT,SAAS;IACpB;IAEA,MAAM,IAAIV,WAAW,CACjBkB,EAAE,CAACC,OAAO,IAAI,uCAAuC,EACrDD,EAAE,CAACE,IAAI,IAAI,+BAA+B,EAC1C;MACIC,KAAK,EAAEH,EAAE;MACTX,MAAM;MACNC;IACJ,CACJ,CAAC;EACL;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client } from "@elastic/elasticsearch";
|
|
2
|
-
import type { SearchBody } from "@webiny/api-elasticsearch/types";
|
|
2
|
+
import type { SearchBody } from "@webiny/api-elasticsearch/types.js";
|
|
3
3
|
export interface EsFindOneParams {
|
|
4
4
|
elasticsearchClient: Client;
|
|
5
5
|
index: string;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.esFindOne = void 0;
|
|
7
|
-
const esFindOne = async ({
|
|
1
|
+
export const esFindOne = async ({
|
|
8
2
|
elasticsearchClient,
|
|
9
3
|
body,
|
|
10
4
|
index
|
|
@@ -22,6 +16,5 @@ const esFindOne = async ({
|
|
|
22
16
|
}
|
|
23
17
|
return hits.hits[0]._source;
|
|
24
18
|
};
|
|
25
|
-
exports.esFindOne = esFindOne;
|
|
26
19
|
|
|
27
20
|
//# sourceMappingURL=esFindOne.js.map
|