@webiny/migrations 5.43.0-beta.0 → 5.43.0-beta.2
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/ddb-es.d.ts +2 -2
- package/ddb-es.js +2 -2
- package/ddb-es.js.map +1 -1
- package/ddb.d.ts +2 -2
- package/ddb.js +2 -2
- package/ddb.js.map +1 -1
- package/migrations/5.43.0/001/constants.d.ts +2 -0
- package/migrations/5.43.0/001/constants.js +10 -0
- package/migrations/5.43.0/001/constants.js.map +1 -0
- package/migrations/{5.41.0/001 → 5.43.0/001/ddb}/index.d.ts +6 -4
- package/migrations/5.43.0/001/ddb/index.js +215 -0
- package/migrations/5.43.0/001/ddb/index.js.map +1 -0
- package/migrations/5.43.0/001/ddb-es/index.d.ts +16 -0
- package/migrations/5.43.0/001/ddb-es/index.js +257 -0
- package/migrations/5.43.0/001/ddb-es/index.js.map +1 -0
- package/migrations/5.43.0/001/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.43.0/001/entities/createEntryEntity.js +188 -0
- package/migrations/5.43.0/001/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.43.0/001/types.d.ts +47 -0
- package/migrations/5.43.0/001/types.js +7 -0
- package/migrations/5.43.0/001/types.js.map +1 -0
- package/package.json +17 -17
- package/utils/getCompressedData.d.ts +4 -0
- package/utils/getCompressedData.js +19 -0
- package/utils/getCompressedData.js.map +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +11 -0
- package/utils/index.js.map +1 -1
- package/migrations/5.41.0/001/createTenantEntity.d.ts +0 -42
- package/migrations/5.41.0/001/createTenantEntity.js +0 -46
- package/migrations/5.41.0/001/createTenantEntity.js.map +0 -1
- package/migrations/5.41.0/001/createUserEntity.d.ts +0 -48
- package/migrations/5.41.0/001/createUserEntity.js +0 -54
- package/migrations/5.41.0/001/createUserEntity.js.map +0 -1
- package/migrations/5.41.0/001/index.js +0 -92
- package/migrations/5.41.0/001/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ioc","require","_symbols","_utils","_createEntryEntity","_constants","_utils2","_StepFunctionServicePlugin","Flp_5_43_0_001","constructor","table","esTable","elasticsearchClient","ddbEntryEntity","createDdbEntryEntity","ddbEsEntryEntity","createDdbEsEntryEntity","getId","getDescription","shouldExecute","logger","forEachTenantLocale","callback","tenantId","localeCode","indexExists","esGetIndexExist","tenant","locale","type","ACO_FOLDER_MODEL_ID","isHeadlessCmsModel","info","execute","event","id","generateAlphaNumericId","definitionId","name","input","storeTaskDdbEntry","service","StepFunctionService","getTenant","getLocale","startTaskExecution","result","send","Error","executeWithRetry","onFailedAttempt","error","attemptNumber","e","entryId","values","partitionKey","ddbItems","putBatch","PK","SK","createRevisionId","location","folderId","locked","meta","modelId","TASK_MODEL_ID","status","TYPE","version","webinyVersion","process","env","WEBINY_VERSION","modifiedOn","Date","toISOString","revisionCreatedOn","revisionModifiedOn","revisionSavedOn","savedOn","createdOn","rawDatas","toString","latest","__type","rawValues","ddbEsItems","data","getCompressedData","index","esGetIndexName","batchWriteAll","items","console","log","parseIdentifier","exports","makeInjectable","inject","PrimaryDynamoTableSymbol","ElasticsearchDynamoTableSymbol","ElasticsearchClientSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport { inject, makeInjectable } from \"@webiny/ioc\";\nimport { DataMigration, DataMigrationContext } from \"@webiny/data-migration\";\nimport {\n PrimaryDynamoTableSymbol,\n ElasticsearchDynamoTableSymbol,\n ElasticsearchClientSymbol\n} from \"@webiny/data-migration/symbols\";\nimport {\n forEachTenantLocale,\n esGetIndexExist,\n batchWriteAll,\n esGetIndexName,\n getCompressedData\n} from \"~/utils\";\nimport { createDdbEntryEntity, createDdbEsEntryEntity } from \"../entities/createEntryEntity\";\nimport { ACO_FOLDER_MODEL_ID, TASK_MODEL_ID } from \"../constants\";\nimport type { TaskEntryEventPayload } from \"~/migrations/5.43.0/001/types\";\nimport { generateAlphaNumericId, parseIdentifier, executeWithRetry } from \"@webiny/utils\";\nimport { StepFunctionService } from \"@webiny/tasks/service/StepFunctionServicePlugin\";\n\nexport class Flp_5_43_0_001 implements DataMigration {\n private readonly table: Table<string, string, string>;\n private readonly elasticsearchClient: Client;\n private readonly ddbEntryEntity: ReturnType<typeof createDdbEntryEntity>;\n private readonly ddbEsEntryEntity: ReturnType<typeof createDdbEsEntryEntity>;\n\n constructor(\n table: Table<string, string, string>,\n esTable: Table<string, string, string>,\n elasticsearchClient: Client\n ) {\n this.table = table;\n this.elasticsearchClient = elasticsearchClient;\n this.ddbEntryEntity = createDdbEntryEntity(table);\n this.ddbEsEntryEntity = createDdbEsEntryEntity(esTable);\n }\n\n getId() {\n return \"5.43.0-001\";\n }\n\n getDescription() {\n return \"Introduce 'flp' entities\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext) {\n let shouldExecute = false;\n\n await forEachTenantLocale({\n table: this.table,\n logger,\n callback: async ({ tenantId, localeCode }) => {\n shouldExecute = true;\n\n const indexExists = await esGetIndexExist({\n elasticsearchClient: this.elasticsearchClient,\n tenant: tenantId,\n locale: localeCode,\n type: ACO_FOLDER_MODEL_ID,\n isHeadlessCmsModel: true\n });\n\n if (!indexExists) {\n logger.info(\n `No Elasticsearch index found for folders in tenant \"${tenantId}\" and locale \"${localeCode}\"; skipping.`\n );\n shouldExecute = false;\n return false;\n }\n\n // Continue to the next locale.\n return shouldExecute;\n }\n });\n\n return shouldExecute;\n }\n\n async execute({ logger }: DataMigrationContext) {\n await forEachTenantLocale({\n table: this.table,\n logger,\n callback: async ({ tenantId, localeCode }) => {\n logger.info(`Starting migration for tenant ${tenantId} / locale ${localeCode}`);\n\n const indexExists = await esGetIndexExist({\n elasticsearchClient: this.elasticsearchClient,\n tenant: tenantId,\n locale: localeCode,\n type: ACO_FOLDER_MODEL_ID,\n isHeadlessCmsModel: true\n });\n\n if (!indexExists) {\n logger.info(\n `No Elasticsearch index found for folders in tenant \"${tenantId}\" and locale \"${localeCode}\"; skipping.`\n );\n return true;\n }\n\n const event: TaskEntryEventPayload = {\n tenant: tenantId,\n locale: localeCode,\n id: `5_43_0_001_migration_${generateAlphaNumericId()}`,\n definitionId: \"acoSyncFlp\",\n name: \"5_43_0_001_migration\",\n input: {\n type: \"*\"\n }\n };\n\n await this.storeTaskDdbEntry(event);\n\n const service = new StepFunctionService({\n getTenant: () => tenantId,\n getLocale: () => localeCode\n });\n\n const startTaskExecution = async () => {\n const result = await service.send(\n {\n definitionId: event.definitionId,\n id: event.id\n },\n 0\n );\n\n if (!result) {\n throw new Error(\n `Failed to trigger task for tenant ${tenantId} / locale ${localeCode}. Check the above log.`\n );\n }\n\n return result;\n };\n\n try {\n await executeWithRetry(startTaskExecution, {\n onFailedAttempt: async error => {\n logger.error(\n `Attempt #${error.attemptNumber} failed to trigger task for tenant ${tenantId} / locale ${localeCode}.`\n );\n }\n });\n\n logger.info(\n `Successfully triggered task for tenant ${tenantId} / locale ${localeCode}. FLP records will be synced via background task.`\n );\n } catch (e) {\n logger.error(\n `Failed to trigger task for tenant ${tenantId} / locale ${localeCode}. Check the above logs for more info.`,\n e\n );\n }\n\n return true;\n }\n });\n\n logger.info(\"Finished updating all FLP entities across all tenants and locales.\");\n }\n\n private async storeTaskDdbEntry(event: TaskEntryEventPayload): Promise<void> {\n const { tenant, locale, id: entryId, definitionId, name, input } = event;\n\n try {\n const values = {\n \"number@iterations\": 0,\n \"text@taskStatus\": \"pending\",\n \"text@definitionId\": definitionId,\n \"text@name\": name,\n \"object@input\": input\n };\n\n const partitionKey = `T#${tenant}#L#${locale}#CMS#CME#${entryId}`;\n\n const ddbItems = [\n // Exact entry revision\n this.ddbEntryEntity.putBatch({\n PK: partitionKey,\n SK: \"REV#0001\",\n id: this.createRevisionId(entryId),\n entryId,\n locale,\n location: {\n folderId: \"root\"\n },\n locked: false,\n meta: {},\n modelId: TASK_MODEL_ID,\n status: \"draft\",\n tenant,\n TYPE: \"cms.entry\",\n version: 1,\n webinyVersion: process.env.WEBINY_VERSION,\n modifiedOn: new Date().toISOString(),\n revisionCreatedOn: new Date().toISOString(),\n revisionModifiedOn: new Date().toISOString(),\n revisionSavedOn: new Date().toISOString(),\n savedOn: new Date().toISOString(),\n createdOn: new Date().toISOString(),\n values\n }),\n // Latest entry revision\n this.ddbEntryEntity.putBatch({\n PK: partitionKey,\n SK: \"L\",\n id: this.createRevisionId(entryId),\n entryId,\n locale,\n location: {\n folderId: \"root\"\n },\n locked: false,\n meta: {},\n modelId: TASK_MODEL_ID,\n status: \"draft\",\n tenant,\n TYPE: \"cms.entry.l\",\n version: 1,\n webinyVersion: process.env.WEBINY_VERSION,\n modifiedOn: new Date().toISOString(),\n revisionCreatedOn: new Date().toISOString(),\n revisionModifiedOn: new Date().toISOString(),\n revisionSavedOn: new Date().toISOString(),\n savedOn: new Date().toISOString(),\n createdOn: new Date().toISOString(),\n values\n })\n ];\n\n const rawDatas = {\n modelId: TASK_MODEL_ID,\n revisionCreatedOn: new Date().toISOString(),\n revisionSavedOn: new Date().toString(),\n revisionModifiedOn: new Date().toString(),\n createdOn: new Date().toString(),\n modifiedOn: new Date().toString(),\n status: \"draft\",\n meta: {},\n entryId,\n id: this.createRevisionId(entryId),\n version: 1,\n location: { folderId: \"root\" },\n locale,\n values: {\n \"number@iterations\": 0,\n \"text@taskStatus\": \"pending\",\n \"text@definitionId\": definitionId,\n \"text@name\": name\n },\n tenant,\n locked: false,\n webinyVersion: process.env.WEBINY_VERSION,\n latest: true,\n TYPE: \"cms.entry.l\",\n __type: \"cms.entry.l\",\n rawValues: {\n \"object@input\": input\n }\n };\n\n const ddbEsItems = [\n this.ddbEsEntryEntity.putBatch({\n PK: partitionKey,\n SK: \"L\",\n data: await getCompressedData(rawDatas),\n index: esGetIndexName({\n tenant,\n locale,\n type: TASK_MODEL_ID,\n isHeadlessCmsModel: true\n })\n })\n ];\n\n await batchWriteAll({\n table: this.ddbEntryEntity.table,\n items: ddbItems\n });\n\n await batchWriteAll({\n table: this.ddbEsEntryEntity.table,\n items: ddbEsItems\n });\n } catch (e) {\n console.log(\"Error while storing task entry.\", event);\n console.error(e);\n }\n }\n\n private createRevisionId(id: string) {\n const { id: entryId } = parseIdentifier(id);\n return `${entryId}#0001`;\n }\n}\n\nmakeInjectable(Flp_5_43_0_001, [\n inject(PrimaryDynamoTableSymbol),\n inject(ElasticsearchDynamoTableSymbol),\n inject(ElasticsearchClientSymbol)\n]);\n"],"mappings":";;;;;;AAEA,IAAAA,IAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AAOA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,0BAAA,GAAAN,OAAA;AAEO,MAAMO,cAAc,CAA0B;EAMjDC,WAAWA,CACPC,KAAoC,EACpCC,OAAsC,EACtCC,mBAA2B,EAC7B;IACE,IAAI,CAACF,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACE,mBAAmB,GAAGA,mBAAmB;IAC9C,IAAI,CAACC,cAAc,GAAG,IAAAC,uCAAoB,EAACJ,KAAK,CAAC;IACjD,IAAI,CAACK,gBAAgB,GAAG,IAAAC,yCAAsB,EAACL,OAAO,CAAC;EAC3D;EAEAM,KAAKA,CAAA,EAAG;IACJ,OAAO,YAAY;EACvB;EAEAC,cAAcA,CAAA,EAAG;IACb,OAAO,0BAA0B;EACrC;EAEA,MAAMC,aAAaA,CAAC;IAAEC;EAA6B,CAAC,EAAE;IAClD,IAAID,aAAa,GAAG,KAAK;IAEzB,MAAM,IAAAE,0BAAmB,EAAC;MACtBX,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBU,MAAM;MACNE,QAAQ,EAAE,MAAAA,CAAO;QAAEC,QAAQ;QAAEC;MAAW,CAAC,KAAK;QAC1CL,aAAa,GAAG,IAAI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K,EAAE,IAAI,CAACK,gBAAgB,CAACL,KAAK;QAClCoF,KAAK,EAAEN;MACX,CAAC,CAAC;IACN,CAAC,CAAC,OAAOnC,CAAC,EAAE;MACR0C,OAAO,CAACC,GAAG,CAAC,iCAAiC,EAAE9D,KAAK,CAAC;MACrD6D,OAAO,CAAC5C,KAAK,CAACE,CAAC,CAAC;IACpB;EACJ;EAEQQ,gBAAgBA,CAAC1B,EAAU,EAAE;IACjC,MAAM;MAAEA,EAAE,EAAEmB;IAAQ,CAAC,GAAG,IAAA2C,uBAAe,EAAC9D,EAAE,CAAC;IAC3C,OAAO,GAAGmB,OAAO,OAAO;EAC5B;AACJ;AAAC4C,OAAA,CAAA1F,cAAA,GAAAA,cAAA;AAED,IAAA2F,mBAAc,EAAC3F,cAAc,EAAE,CAC3B,IAAA4F,WAAM,EAACC,iCAAwB,CAAC,EAChC,IAAAD,WAAM,EAACE,uCAA8B,CAAC,EACtC,IAAAF,WAAM,EAACG,kCAAyB,CAAC,CACpC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
export declare const createDdbEntryEntity: (table: Table<string, string, string>) => import("dynamodb-toolbox/dist/cjs/classes/Entity/Entity").default<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, {
|
|
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
|
+
}, {
|
|
19
|
+
PK: {
|
|
20
|
+
partitionKey: true;
|
|
21
|
+
};
|
|
22
|
+
SK: {
|
|
23
|
+
sortKey: true;
|
|
24
|
+
};
|
|
25
|
+
GSI1_PK: {
|
|
26
|
+
type: "string";
|
|
27
|
+
};
|
|
28
|
+
GSI1_SK: {
|
|
29
|
+
type: "string";
|
|
30
|
+
};
|
|
31
|
+
TYPE: {
|
|
32
|
+
type: "string";
|
|
33
|
+
};
|
|
34
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
[x: number]: any;
|
|
37
|
+
[x: symbol]: any;
|
|
38
|
+
}, {
|
|
39
|
+
[x: string]: any;
|
|
40
|
+
[x: number]: any;
|
|
41
|
+
[x: symbol]: any;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const createDdbEsEntryEntity: (table: Table<string, string, string>) => import("dynamodb-toolbox/dist/cjs/classes/Entity/Entity").default<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, {
|
|
44
|
+
PK: {
|
|
45
|
+
partitionKey: true;
|
|
46
|
+
};
|
|
47
|
+
SK: {
|
|
48
|
+
sortKey: true;
|
|
49
|
+
};
|
|
50
|
+
GSI1_PK: {
|
|
51
|
+
type: "string";
|
|
52
|
+
};
|
|
53
|
+
GSI1_SK: {
|
|
54
|
+
type: "string";
|
|
55
|
+
};
|
|
56
|
+
TYPE: {
|
|
57
|
+
type: "string";
|
|
58
|
+
};
|
|
59
|
+
data: {
|
|
60
|
+
type: "map";
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
PK: {
|
|
64
|
+
partitionKey: true;
|
|
65
|
+
};
|
|
66
|
+
SK: {
|
|
67
|
+
sortKey: true;
|
|
68
|
+
};
|
|
69
|
+
GSI1_PK: {
|
|
70
|
+
type: "string";
|
|
71
|
+
};
|
|
72
|
+
GSI1_SK: {
|
|
73
|
+
type: "string";
|
|
74
|
+
};
|
|
75
|
+
TYPE: {
|
|
76
|
+
type: "string";
|
|
77
|
+
};
|
|
78
|
+
data: {
|
|
79
|
+
type: "map";
|
|
80
|
+
};
|
|
81
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
82
|
+
[x: string]: any;
|
|
83
|
+
[x: number]: any;
|
|
84
|
+
[x: symbol]: any;
|
|
85
|
+
}, {
|
|
86
|
+
[x: string]: any;
|
|
87
|
+
[x: number]: any;
|
|
88
|
+
[x: symbol]: any;
|
|
89
|
+
}>;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createDdbEsEntryEntity = exports.createDdbEntryEntity = void 0;
|
|
7
|
+
var _utils = require("../../../../utils");
|
|
8
|
+
const ddbAttributes = {
|
|
9
|
+
PK: {
|
|
10
|
+
type: "string",
|
|
11
|
+
partitionKey: true
|
|
12
|
+
},
|
|
13
|
+
SK: {
|
|
14
|
+
type: "string",
|
|
15
|
+
sortKey: true
|
|
16
|
+
},
|
|
17
|
+
GSI1_PK: {
|
|
18
|
+
type: "string"
|
|
19
|
+
},
|
|
20
|
+
GSI1_SK: {
|
|
21
|
+
type: "string"
|
|
22
|
+
},
|
|
23
|
+
TYPE: {
|
|
24
|
+
type: "string"
|
|
25
|
+
},
|
|
26
|
+
__type: {
|
|
27
|
+
type: "string"
|
|
28
|
+
},
|
|
29
|
+
webinyVersion: {
|
|
30
|
+
type: "string"
|
|
31
|
+
},
|
|
32
|
+
tenant: {
|
|
33
|
+
type: "string"
|
|
34
|
+
},
|
|
35
|
+
entryId: {
|
|
36
|
+
type: "string"
|
|
37
|
+
},
|
|
38
|
+
id: {
|
|
39
|
+
type: "string"
|
|
40
|
+
},
|
|
41
|
+
modelId: {
|
|
42
|
+
type: "string"
|
|
43
|
+
},
|
|
44
|
+
locale: {
|
|
45
|
+
type: "string"
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Revision-level meta fields. 👇
|
|
49
|
+
*/
|
|
50
|
+
revisionCreatedOn: {
|
|
51
|
+
type: "string"
|
|
52
|
+
},
|
|
53
|
+
revisionSavedOn: {
|
|
54
|
+
type: "string"
|
|
55
|
+
},
|
|
56
|
+
revisionModifiedOn: {
|
|
57
|
+
type: "string"
|
|
58
|
+
},
|
|
59
|
+
revisionDeletedOn: {
|
|
60
|
+
type: "string"
|
|
61
|
+
},
|
|
62
|
+
revisionRestoredOn: {
|
|
63
|
+
type: "string"
|
|
64
|
+
},
|
|
65
|
+
revisionFirstPublishedOn: {
|
|
66
|
+
type: "string"
|
|
67
|
+
},
|
|
68
|
+
revisionLastPublishedOn: {
|
|
69
|
+
type: "string"
|
|
70
|
+
},
|
|
71
|
+
revisionCreatedBy: {
|
|
72
|
+
type: "map"
|
|
73
|
+
},
|
|
74
|
+
revisionSavedBy: {
|
|
75
|
+
type: "map"
|
|
76
|
+
},
|
|
77
|
+
revisionModifiedBy: {
|
|
78
|
+
type: "map"
|
|
79
|
+
},
|
|
80
|
+
revisionDeletedBy: {
|
|
81
|
+
type: "map"
|
|
82
|
+
},
|
|
83
|
+
revisionRestoredBy: {
|
|
84
|
+
type: "map"
|
|
85
|
+
},
|
|
86
|
+
revisionFirstPublishedBy: {
|
|
87
|
+
type: "map"
|
|
88
|
+
},
|
|
89
|
+
revisionLastPublishedBy: {
|
|
90
|
+
type: "map"
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Entry-level meta fields. 👇
|
|
94
|
+
*/
|
|
95
|
+
createdOn: {
|
|
96
|
+
type: "string"
|
|
97
|
+
},
|
|
98
|
+
savedOn: {
|
|
99
|
+
type: "string"
|
|
100
|
+
},
|
|
101
|
+
modifiedOn: {
|
|
102
|
+
type: "string"
|
|
103
|
+
},
|
|
104
|
+
deletedOn: {
|
|
105
|
+
type: "string"
|
|
106
|
+
},
|
|
107
|
+
restoredOn: {
|
|
108
|
+
type: "string"
|
|
109
|
+
},
|
|
110
|
+
firstPublishedOn: {
|
|
111
|
+
type: "string"
|
|
112
|
+
},
|
|
113
|
+
lastPublishedOn: {
|
|
114
|
+
type: "string"
|
|
115
|
+
},
|
|
116
|
+
createdBy: {
|
|
117
|
+
type: "map"
|
|
118
|
+
},
|
|
119
|
+
savedBy: {
|
|
120
|
+
type: "map"
|
|
121
|
+
},
|
|
122
|
+
modifiedBy: {
|
|
123
|
+
type: "map"
|
|
124
|
+
},
|
|
125
|
+
deletedBy: {
|
|
126
|
+
type: "map"
|
|
127
|
+
},
|
|
128
|
+
restoredBy: {
|
|
129
|
+
type: "map"
|
|
130
|
+
},
|
|
131
|
+
firstPublishedBy: {
|
|
132
|
+
type: "map"
|
|
133
|
+
},
|
|
134
|
+
lastPublishedBy: {
|
|
135
|
+
type: "map"
|
|
136
|
+
},
|
|
137
|
+
// Deprecated fields.
|
|
138
|
+
ownedBy: {
|
|
139
|
+
type: "map"
|
|
140
|
+
},
|
|
141
|
+
publishedOn: {
|
|
142
|
+
type: "string"
|
|
143
|
+
},
|
|
144
|
+
version: {
|
|
145
|
+
type: "number"
|
|
146
|
+
},
|
|
147
|
+
locked: {
|
|
148
|
+
type: "boolean"
|
|
149
|
+
},
|
|
150
|
+
status: {
|
|
151
|
+
type: "string"
|
|
152
|
+
},
|
|
153
|
+
values: {
|
|
154
|
+
type: "map"
|
|
155
|
+
},
|
|
156
|
+
meta: {
|
|
157
|
+
type: "map"
|
|
158
|
+
},
|
|
159
|
+
location: {
|
|
160
|
+
type: "map"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const ddbEsAttributes = {
|
|
164
|
+
PK: {
|
|
165
|
+
type: "string",
|
|
166
|
+
partitionKey: true
|
|
167
|
+
},
|
|
168
|
+
SK: {
|
|
169
|
+
type: "string",
|
|
170
|
+
sortKey: true
|
|
171
|
+
},
|
|
172
|
+
index: {
|
|
173
|
+
type: "string"
|
|
174
|
+
},
|
|
175
|
+
data: {
|
|
176
|
+
type: "map"
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
const createDdbEntryEntity = table => {
|
|
180
|
+
return (0, _utils.createLegacyEntity)(table, "CmsEntries", ddbAttributes);
|
|
181
|
+
};
|
|
182
|
+
exports.createDdbEntryEntity = createDdbEntryEntity;
|
|
183
|
+
const createDdbEsEntryEntity = table => {
|
|
184
|
+
return (0, _utils.createStandardEntity)(table, "CmsEntriesElasticsearch", ddbEsAttributes);
|
|
185
|
+
};
|
|
186
|
+
exports.createDdbEsEntryEntity = createDdbEsEntryEntity;
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=createEntryEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","ddbAttributes","PK","type","partitionKey","SK","sortKey","GSI1_PK","GSI1_SK","TYPE","__type","webinyVersion","tenant","entryId","id","modelId","locale","revisionCreatedOn","revisionSavedOn","revisionModifiedOn","revisionDeletedOn","revisionRestoredOn","revisionFirstPublishedOn","revisionLastPublishedOn","revisionCreatedBy","revisionSavedBy","revisionModifiedBy","revisionDeletedBy","revisionRestoredBy","revisionFirstPublishedBy","revisionLastPublishedBy","createdOn","savedOn","modifiedOn","deletedOn","restoredOn","firstPublishedOn","lastPublishedOn","createdBy","savedBy","modifiedBy","deletedBy","restoredBy","firstPublishedBy","lastPublishedBy","ownedBy","publishedOn","version","locked","status","values","meta","location","ddbEsAttributes","index","data","createDdbEntryEntity","table","createLegacyEntity","exports","createDdbEsEntryEntity","createStandardEntity"],"sources":["createEntryEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nconst ddbAttributes: Parameters<typeof createLegacyEntity>[2] = {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\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 __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: { type: \"string\" },\n revisionSavedOn: { type: \"string\" },\n revisionModifiedOn: { type: \"string\" },\n revisionDeletedOn: { type: \"string\" },\n revisionRestoredOn: { type: \"string\" },\n revisionFirstPublishedOn: { type: \"string\" },\n revisionLastPublishedOn: { type: \"string\" },\n revisionCreatedBy: { type: \"map\" },\n revisionSavedBy: { type: \"map\" },\n revisionModifiedBy: { type: \"map\" },\n revisionDeletedBy: { type: \"map\" },\n revisionRestoredBy: { type: \"map\" },\n revisionFirstPublishedBy: { type: \"map\" },\n revisionLastPublishedBy: { type: \"map\" },\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: { type: \"string\" },\n savedOn: { type: \"string\" },\n modifiedOn: { type: \"string\" },\n deletedOn: { type: \"string\" },\n restoredOn: { type: \"string\" },\n firstPublishedOn: { type: \"string\" },\n lastPublishedOn: { type: \"string\" },\n createdBy: { type: \"map\" },\n savedBy: { type: \"map\" },\n modifiedBy: { type: \"map\" },\n deletedBy: { type: \"map\" },\n restoredBy: { type: \"map\" },\n firstPublishedBy: { type: \"map\" },\n lastPublishedBy: { type: \"map\" },\n\n // Deprecated fields.\n ownedBy: { type: \"map\" },\n publishedOn: { type: \"string\" },\n\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n location: {\n type: \"map\"\n }\n};\n\nconst ddbEsAttributes: Parameters<typeof createStandardEntity>[2] = {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n }\n};\n\nexport const createDdbEntryEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"CmsEntries\", ddbAttributes);\n};\n\nexport const createDdbEsEntryEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"CmsEntriesElasticsearch\", ddbEsAttributes);\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,aAAuD,GAAG;EAC5DC,EAAE,EAAE;IACAC,IAAI,EAAE,QAAQ;IACdC,YAAY,EAAE;EAClB,CAAC;EACDC,EAAE,EAAE;IACAF,IAAI,EAAE,QAAQ;IACdG,OAAO,EAAE;EACb,CAAC;EACDC,OAAO,EAAE;IACLJ,IAAI,EAAE;EACV,CAAC;EACDK,OAAO,EAAE;IACLL,IAAI,EAAE;EACV,CAAC;EACDM,IAAI,EAAE;IACFN,IAAI,EAAE;EACV,CAAC;EACDO,MAAM,EAAE;IACJP,IAAI,EAAE;EACV,CAAC;EACDQ,aAAa,EAAE;IACXR,IAAI,EAAE;EACV,CAAC;EACDS,MAAM,EAAE;IACJT,IAAI,EAAE;EACV,CAAC;EACDU,OAAO,EAAE;IACLV,IAAI,EAAE;EACV,CAAC;EACDW,EAAE,EAAE;IACAX,IAAI,EAAE;EACV,CAAC;EACDY,OAAO,EAAE;IACLZ,IAAI,EAAE;EACV,CAAC;EACDa,MAAM,EAAE;IACJb,IAAI,EAAE;EACV,CAAC;EAED;AACJ;AACA;EACIc,iBAAiB,EAAE;IAAEd,IAAI,EAAE;EAAS,CAAC;EACrCe,eAAe,EAAE;IAAEf,IAAI,EAAE;EAAS,CAAC;EACnCgB,kBAAkB,EAAE;IAAEhB,IAAI,EAAE;EAAS,CAAC;EACtCiB,iBAAiB,EAAE;IAAEjB,IAAI,EAAE;EAAS,CAAC;EACrCkB,kBAAkB,E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
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface I18NLocale {
|
|
8
|
+
code: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Identity {
|
|
11
|
+
id: string;
|
|
12
|
+
displayName: string | null;
|
|
13
|
+
type: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CmsEntryValues {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
export type CmsEntryStatus = "published" | "unpublished" | "draft";
|
|
19
|
+
export interface CmsEntry<TValues = CmsEntryValues> {
|
|
20
|
+
webinyVersion: string;
|
|
21
|
+
tenant: string;
|
|
22
|
+
entryId: string;
|
|
23
|
+
id: string;
|
|
24
|
+
createdBy: Identity;
|
|
25
|
+
ownedBy: Identity;
|
|
26
|
+
modifiedBy?: Identity | null;
|
|
27
|
+
createdOn: string;
|
|
28
|
+
savedOn: string;
|
|
29
|
+
modelId: string;
|
|
30
|
+
locale: string;
|
|
31
|
+
publishedOn?: string;
|
|
32
|
+
version: number;
|
|
33
|
+
locked: boolean;
|
|
34
|
+
status: CmsEntryStatus;
|
|
35
|
+
values: TValues;
|
|
36
|
+
meta?: {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface TaskEntryEventPayload {
|
|
41
|
+
tenant: string;
|
|
42
|
+
locale: string;
|
|
43
|
+
id: string;
|
|
44
|
+
definitionId: string;
|
|
45
|
+
name: string;
|
|
46
|
+
input: Record<string, any>;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface Tenant {\n data: {\n id: string;\n name: string;\n };\n}\n\nexport interface I18NLocale {\n code: string;\n}\n\nexport interface Identity {\n id: string;\n displayName: string | null;\n type: string;\n}\n\nexport interface CmsEntryValues {\n [key: string]: any;\n}\n\nexport type CmsEntryStatus = \"published\" | \"unpublished\" | \"draft\";\n\nexport interface CmsEntry<TValues = CmsEntryValues> {\n webinyVersion: string;\n tenant: string;\n entryId: string;\n id: string;\n createdBy: Identity;\n ownedBy: Identity;\n modifiedBy?: Identity | null;\n createdOn: string;\n savedOn: string;\n modelId: string;\n locale: string;\n publishedOn?: string;\n version: number;\n locked: boolean;\n status: CmsEntryStatus;\n values: TValues;\n meta?: {\n [key: string]: any;\n };\n}\n\nexport interface TaskEntryEventPayload {\n tenant: string;\n locale: string;\n id: string;\n definitionId: string;\n name: string;\n input: Record<string, any>;\n}\n"],"mappings":"","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/migrations",
|
|
3
|
-
"version": "5.43.0-beta.
|
|
3
|
+
"version": "5.43.0-beta.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "node ../cli/bin.js run build",
|
|
6
6
|
"watch": "node ../cli/bin.js run watch"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@elastic/elasticsearch": "7.12.0",
|
|
10
|
-
"@webiny/api-elasticsearch": "5.43.0-beta.
|
|
11
|
-
"@webiny/aws-sdk": "5.43.0-beta.
|
|
12
|
-
"@webiny/data-migration": "5.43.0-beta.
|
|
13
|
-
"@webiny/db-dynamodb": "5.43.0-beta.
|
|
14
|
-
"@webiny/error": "5.43.0-beta.
|
|
15
|
-
"@webiny/ioc": "5.43.0-beta.
|
|
16
|
-
"@webiny/logger": "5.43.0-beta.
|
|
17
|
-
"@webiny/
|
|
10
|
+
"@webiny/api-elasticsearch": "5.43.0-beta.2",
|
|
11
|
+
"@webiny/aws-sdk": "5.43.0-beta.2",
|
|
12
|
+
"@webiny/data-migration": "5.43.0-beta.2",
|
|
13
|
+
"@webiny/db-dynamodb": "5.43.0-beta.2",
|
|
14
|
+
"@webiny/error": "5.43.0-beta.2",
|
|
15
|
+
"@webiny/ioc": "5.43.0-beta.2",
|
|
16
|
+
"@webiny/logger": "5.43.0-beta.2",
|
|
17
|
+
"@webiny/tasks": "5.43.0-beta.2",
|
|
18
|
+
"@webiny/utils": "5.43.0-beta.2",
|
|
18
19
|
"lodash": "4.17.21"
|
|
19
20
|
},
|
|
20
21
|
"publishConfig": {
|
|
@@ -22,15 +23,14 @@
|
|
|
22
23
|
"directory": "dist"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
|
-
"@webiny/api-headless-cms": "5.43.0-beta.
|
|
26
|
-
"@webiny/api-headless-cms-ddb-es": "5.43.0-beta.
|
|
27
|
-
"@webiny/handler-aws": "5.43.0-beta.
|
|
28
|
-
"@webiny/plugins": "5.43.0-beta.
|
|
29
|
-
"@webiny/project-utils": "5.43.0-beta.
|
|
26
|
+
"@webiny/api-headless-cms": "5.43.0-beta.2",
|
|
27
|
+
"@webiny/api-headless-cms-ddb-es": "5.43.0-beta.2",
|
|
28
|
+
"@webiny/handler-aws": "5.43.0-beta.2",
|
|
29
|
+
"@webiny/plugins": "5.43.0-beta.2",
|
|
30
|
+
"@webiny/project-utils": "5.43.0-beta.2",
|
|
30
31
|
"elastic-ts": "0.12.0",
|
|
31
32
|
"jest-dynalite": "3.6.1",
|
|
32
|
-
"
|
|
33
|
-
"typescript": "4.9.5"
|
|
33
|
+
"typescript": "5.3.3"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "dbed8c263df662358aca18c3cf452cd280f2dfd9"
|
|
36
36
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCompressedData = void 0;
|
|
7
|
+
var _gzip = require("@webiny/utils/compression/gzip");
|
|
8
|
+
const GZIP = "gzip";
|
|
9
|
+
const TO_STORAGE_ENCODING = "base64";
|
|
10
|
+
const getCompressedData = async data => {
|
|
11
|
+
const value = await (0, _gzip.compress)(JSON.stringify(data));
|
|
12
|
+
return {
|
|
13
|
+
compression: GZIP,
|
|
14
|
+
value: value.toString(TO_STORAGE_ENCODING)
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
exports.getCompressedData = getCompressedData;
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=getCompressedData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_gzip","require","GZIP","TO_STORAGE_ENCODING","getCompressedData","data","value","gzip","JSON","stringify","compression","toString","exports"],"sources":["getCompressedData.ts"],"sourcesContent":["import { compress as gzip } from \"@webiny/utils/compression/gzip\";\n\nconst GZIP = \"gzip\";\nconst TO_STORAGE_ENCODING = \"base64\";\n\nexport const getCompressedData = async (data: any) => {\n const value = await gzip(JSON.stringify(data));\n\n return {\n compression: GZIP,\n value: value.toString(TO_STORAGE_ENCODING)\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,mBAAmB,GAAG,QAAQ;AAE7B,MAAMC,iBAAiB,GAAG,MAAOC,IAAS,IAAK;EAClD,MAAMC,KAAK,GAAG,MAAM,IAAAC,cAAI,EAACC,IAAI,CAACC,SAAS,CAACJ,IAAI,CAAC,CAAC;EAE9C,OAAO;IACHK,WAAW,EAAER,IAAI;IACjBI,KAAK,EAAEA,KAAK,CAACK,QAAQ,CAACR,mBAAmB;EAC7C,CAAC;AACL,CAAC;AAACS,OAAA,CAAAR,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
|
@@ -69,5 +69,16 @@ Object.keys(_createTenantEntity).forEach(function (key) {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
+
var _getCompressedData = require("./getCompressedData");
|
|
73
|
+
Object.keys(_getCompressedData).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _getCompressedData[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _getCompressedData[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
72
83
|
|
|
73
84
|
//# sourceMappingURL=index.js.map
|
package/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_dynamoDb","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_elasticsearch","_forEachTenantLocale","_createEntity","_createLocaleEntity","_createTenantEntity"],"sources":["index.ts"],"sourcesContent":["export * from \"./dynamoDb\";\nexport * from \"./elasticsearch\";\nexport * from \"./forEachTenantLocale\";\nexport * from \"./createEntity\";\nexport * from \"./createLocaleEntity\";\nexport * from \"./createTenantEntity\";\n"],"mappings":";;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,cAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,cAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,cAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,cAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;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,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,mBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,mBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_dynamoDb","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_elasticsearch","_forEachTenantLocale","_createEntity","_createLocaleEntity","_createTenantEntity","_getCompressedData"],"sources":["index.ts"],"sourcesContent":["export * from \"./dynamoDb\";\nexport * from \"./elasticsearch\";\nexport * from \"./forEachTenantLocale\";\nexport * from \"./createEntity\";\nexport * from \"./createLocaleEntity\";\nexport * from \"./createTenantEntity\";\nexport * from \"./getCompressedData\";\n"],"mappings":";;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,cAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,cAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,cAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA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,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,mBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,mBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,kBAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,kBAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,kBAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,kBAAA,CAAAV,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
export declare const createTenantEntity: (table: Table<string, string, string>) => import("dynamodb-toolbox/dist/cjs/classes/Entity/Entity").default<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, {
|
|
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
|
-
}, {
|
|
19
|
-
PK: {
|
|
20
|
-
partitionKey: true;
|
|
21
|
-
};
|
|
22
|
-
SK: {
|
|
23
|
-
sortKey: true;
|
|
24
|
-
};
|
|
25
|
-
GSI1_PK: {
|
|
26
|
-
type: "string";
|
|
27
|
-
};
|
|
28
|
-
GSI1_SK: {
|
|
29
|
-
type: "string";
|
|
30
|
-
};
|
|
31
|
-
TYPE: {
|
|
32
|
-
type: "string";
|
|
33
|
-
};
|
|
34
|
-
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
35
|
-
[x: string]: any;
|
|
36
|
-
[x: number]: any;
|
|
37
|
-
[x: symbol]: any;
|
|
38
|
-
}, {
|
|
39
|
-
[x: string]: any;
|
|
40
|
-
[x: number]: any;
|
|
41
|
-
[x: symbol]: any;
|
|
42
|
-
}>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createTenantEntity = void 0;
|
|
7
|
-
var _utils = require("../../../utils");
|
|
8
|
-
const createTenantEntity = table => {
|
|
9
|
-
return (0, _utils.createLegacyEntity)(table, "TenancyTenant", {
|
|
10
|
-
id: {
|
|
11
|
-
type: "string"
|
|
12
|
-
},
|
|
13
|
-
name: {
|
|
14
|
-
type: "string"
|
|
15
|
-
},
|
|
16
|
-
description: {
|
|
17
|
-
type: "string"
|
|
18
|
-
},
|
|
19
|
-
status: {
|
|
20
|
-
type: "string",
|
|
21
|
-
default: "active"
|
|
22
|
-
},
|
|
23
|
-
createdOn: {
|
|
24
|
-
type: "string"
|
|
25
|
-
},
|
|
26
|
-
savedOn: {
|
|
27
|
-
type: "string"
|
|
28
|
-
},
|
|
29
|
-
createdBy: {
|
|
30
|
-
type: "map"
|
|
31
|
-
},
|
|
32
|
-
parent: {
|
|
33
|
-
type: "string"
|
|
34
|
-
},
|
|
35
|
-
webinyVersion: {
|
|
36
|
-
type: "string"
|
|
37
|
-
},
|
|
38
|
-
settings: {
|
|
39
|
-
type: "map",
|
|
40
|
-
default: {}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
exports.createTenantEntity = createTenantEntity;
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=createTenantEntity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_utils","require","createTenantEntity","table","createLegacyEntity","id","type","name","description","status","default","createdOn","savedOn","createdBy","parent","webinyVersion","settings","exports"],"sources":["createTenantEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createTenantEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"TenancyTenant\", {\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n status: {\n type: \"string\",\n default: \"active\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n parent: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n settings: {\n type: \"map\",\n default: {}\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,eAAe,EAAE;IAC9CE,EAAE,EAAE;MACAC,IAAI,EAAE;IACV,CAAC;IACDC,IAAI,EAAE;MACFD,IAAI,EAAE;IACV,CAAC;IACDE,WAAW,EAAE;MACTF,IAAI,EAAE;IACV,CAAC;IACDG,MAAM,EAAE;MACJH,IAAI,EAAE,QAAQ;MACdI,OAAO,EAAE;IACb,CAAC;IACDC,SAAS,EAAE;MACPL,IAAI,EAAE;IACV,CAAC;IACDM,OAAO,EAAE;MACLN,IAAI,EAAE;IACV,CAAC;IACDO,SAAS,EAAE;MACPP,IAAI,EAAE;IACV,CAAC;IACDQ,MAAM,EAAE;MACJR,IAAI,EAAE;IACV,CAAC;IACDS,aAAa,EAAE;MACXT,IAAI,EAAE;IACV,CAAC;IACDU,QAAQ,EAAE;MACNV,IAAI,EAAE,KAAK;MACXI,OAAO,EAAE,CAAC;IACd;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAAf,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|