mocody 0.4.37 → 0.5.0-alpha
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/dist/core/base-schema.d.ts +13 -13
- package/dist/core/base-schema.js +11 -11
- package/dist/couch/couch-data-operation.d.ts +92 -92
- package/dist/couch/couch-data-operation.js +580 -580
- package/dist/couch/couch-data-operation.js.map +1 -1
- package/dist/couch/couch-filter-query-operation.d.ts +45 -47
- package/dist/couch/couch-filter-query-operation.js +371 -438
- package/dist/couch/couch-filter-query-operation.js.map +1 -1
- package/dist/couch/couch-initializer.d.ts +126 -126
- package/dist/couch/couch-initializer.js +189 -189
- package/dist/couch/couch-initializer.js.map +1 -1
- package/dist/couch/couch-manage-table.d.ts +46 -46
- package/dist/couch/couch-manage-table.js +103 -103
- package/dist/couch/couch-manage-table.js.map +1 -1
- package/dist/dynamo/dynamo-data-operation.d.ts +102 -99
- package/dist/dynamo/dynamo-data-operation.js +932 -797
- package/dist/dynamo/dynamo-data-operation.js.map +1 -1
- package/dist/dynamo/dynamo-filter-query-operation.d.ts +29 -29
- package/dist/dynamo/dynamo-filter-query-operation.js +603 -693
- package/dist/dynamo/dynamo-filter-query-operation.js.map +1 -1
- package/dist/dynamo/dynamo-filter-query-partiql-operation.d.ts +22 -0
- package/dist/dynamo/dynamo-filter-query-partiql-operation.js +457 -0
- package/dist/dynamo/dynamo-filter-query-partiql-operation.js.map +1 -0
- package/dist/dynamo/dynamo-helper.d.ts +1 -1
- package/dist/dynamo/dynamo-helper.js +8 -8
- package/dist/dynamo/dynamo-initializer.d.ts +15 -14
- package/dist/dynamo/dynamo-initializer.js +66 -58
- package/dist/dynamo/dynamo-initializer.js.map +1 -1
- package/dist/dynamo/dynamo-manage-table.d.ts +33 -33
- package/dist/dynamo/dynamo-manage-table.js +419 -419
- package/dist/dynamo/dynamo-manage-table.js.map +1 -1
- package/dist/dynamo/dynamo-query-partiql-processor.d.ts +31 -0
- package/dist/dynamo/dynamo-query-partiql-processor.js +277 -0
- package/dist/dynamo/dynamo-query-partiql-processor.js.map +1 -0
- package/dist/dynamo/dynamo-query-scan-processor.d.ts +25 -25
- package/dist/dynamo/dynamo-query-scan-processor.js +268 -268
- package/dist/dynamo/dynamo-query-scan-processor.js.map +1 -1
- package/dist/helpers/base-joi-helper.d.ts +2 -2
- package/dist/helpers/base-joi-helper.js +12 -12
- package/dist/helpers/constants.d.ts +3 -3
- package/dist/helpers/constants.js +6 -6
- package/dist/helpers/errors.d.ts +13 -13
- package/dist/helpers/errors.js +38 -38
- package/dist/helpers/logging-service.d.ts +9 -9
- package/dist/helpers/logging-service.js +53 -53
- package/dist/helpers/logging-service.js.map +1 -1
- package/dist/helpers/mocody-utils.d.ts +16 -16
- package/dist/helpers/mocody-utils.js +58 -58
- package/dist/helpers/query-validator.d.ts +20 -20
- package/dist/helpers/query-validator.js +96 -96
- package/dist/helpers/util-service.d.ts +29 -29
- package/dist/helpers/util-service.js +155 -155
- package/dist/index.d.ts +12 -12
- package/dist/index.js +23 -23
- package/dist/model/index.d.ts +42 -42
- package/dist/model/index.js +6 -6
- package/dist/mongo/mongo-data-operation.d.ts +90 -90
- package/dist/mongo/mongo-data-operation.js +607 -607
- package/dist/mongo/mongo-data-operation.js.map +1 -1
- package/dist/mongo/mongo-filter-query-operation.d.ts +45 -47
- package/dist/mongo/mongo-filter-query-operation.js +368 -433
- package/dist/mongo/mongo-filter-query-operation.js.map +1 -1
- package/dist/mongo/mongo-initializer.d.ts +16 -16
- package/dist/mongo/mongo-initializer.js +47 -47
- package/dist/mongo/mongo-initializer.js.map +1 -1
- package/dist/mongo/mongo-table-manager.d.ts +31 -31
- package/dist/mongo/mongo-table-manager.js +104 -104
- package/dist/mongo/mongo-table-manager.js.map +1 -1
- package/dist/pouch/pouch-data-operation.d.ts +90 -90
- package/dist/pouch/pouch-data-operation.js +583 -583
- package/dist/pouch/pouch-data-operation.js.map +1 -1
- package/dist/pouch/pouch-filter-query-operation.d.ts +45 -47
- package/dist/pouch/pouch-filter-query-operation.js +371 -438
- package/dist/pouch/pouch-filter-query-operation.js.map +1 -1
- package/dist/pouch/pouch-initializer.d.ts +111 -109
- package/dist/pouch/pouch-initializer.js +357 -357
- package/dist/pouch/pouch-initializer.js.map +1 -1
- package/dist/pouch/pouch-manage-table.d.ts +35 -35
- package/dist/pouch/pouch-manage-table.js +99 -99
- package/dist/pouch/pouch-manage-table.js.map +1 -1
- package/dist/type/index.d.ts +118 -119
- package/dist/type/index.js +2 -2
- package/package.json +17 -16
|
@@ -1,59 +1,67 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MocodyInitializerDynamo = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
async
|
|
36
|
-
const client = await this.getInstance();
|
|
37
|
-
return await client.send(new client_dynamodb_1.
|
|
38
|
-
}
|
|
39
|
-
async
|
|
40
|
-
const client = await this.getInstance();
|
|
41
|
-
return await client.send(new client_dynamodb_1.
|
|
42
|
-
}
|
|
43
|
-
async
|
|
44
|
-
const client = await this.getInstance();
|
|
45
|
-
return await client.send(new client_dynamodb_1.
|
|
46
|
-
}
|
|
47
|
-
async
|
|
48
|
-
const client = await this.getInstance();
|
|
49
|
-
return await client.send(new client_dynamodb_1.
|
|
50
|
-
}
|
|
51
|
-
async
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MocodyInitializerDynamo = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
6
|
+
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
7
|
+
const throat_1 = tslib_1.__importDefault(require("throat"));
|
|
8
|
+
const concurrency = (0, throat_1.default)(1);
|
|
9
|
+
class MocodyInitializerDynamo {
|
|
10
|
+
constructor(inits) {
|
|
11
|
+
Object.defineProperty(this, "client", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(this, "_config", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: void 0
|
|
22
|
+
});
|
|
23
|
+
this._config = inits;
|
|
24
|
+
}
|
|
25
|
+
async getInstance() {
|
|
26
|
+
return await concurrency(() => this.getInstanceBase());
|
|
27
|
+
}
|
|
28
|
+
async executeStatement(param) {
|
|
29
|
+
const client = await this.getInstance();
|
|
30
|
+
const docClient = lib_dynamodb_1.DynamoDBDocumentClient.from(client);
|
|
31
|
+
const command = new lib_dynamodb_1.ExecuteStatementCommand(param);
|
|
32
|
+
const response = await docClient.send(command);
|
|
33
|
+
return response;
|
|
34
|
+
}
|
|
35
|
+
async putItem(params) {
|
|
36
|
+
const client = await this.getInstance();
|
|
37
|
+
return await client.send(new client_dynamodb_1.PutItemCommand(params));
|
|
38
|
+
}
|
|
39
|
+
async getItem(params) {
|
|
40
|
+
const client = await this.getInstance();
|
|
41
|
+
return await client.send(new client_dynamodb_1.GetItemCommand(params));
|
|
42
|
+
}
|
|
43
|
+
async transactWriteItems(params) {
|
|
44
|
+
const client = await this.getInstance();
|
|
45
|
+
return await client.send(new client_dynamodb_1.TransactWriteItemsCommand(params));
|
|
46
|
+
}
|
|
47
|
+
async batchWriteItem(params) {
|
|
48
|
+
const client = await this.getInstance();
|
|
49
|
+
return await client.send(new client_dynamodb_1.BatchWriteItemCommand(params));
|
|
50
|
+
}
|
|
51
|
+
async batchGetItem(params) {
|
|
52
|
+
const client = await this.getInstance();
|
|
53
|
+
return await client.send(new client_dynamodb_1.BatchGetItemCommand(params));
|
|
54
|
+
}
|
|
55
|
+
async deleteItem(params) {
|
|
56
|
+
const client = await this.getInstance();
|
|
57
|
+
return await client.send(new client_dynamodb_1.DeleteItemCommand(params));
|
|
58
|
+
}
|
|
59
|
+
async getInstanceBase() {
|
|
60
|
+
if (!this.client) {
|
|
61
|
+
this.client = new client_dynamodb_1.DynamoDBClient(this._config);
|
|
62
|
+
}
|
|
63
|
+
return await Promise.resolve(this.client);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.MocodyInitializerDynamo = MocodyInitializerDynamo;
|
|
59
67
|
//# sourceMappingURL=dynamo-initializer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamo-initializer.js","sourceRoot":"","sources":["../../src/dynamo/dynamo-initializer.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"dynamo-initializer.js","sourceRoot":"","sources":["../../src/dynamo/dynamo-initializer.ts"],"names":[],"mappings":";;;;AAAA,8DAgBkC;AAElC,wDAAwF;AAExF,4DAA4B;AAC5B,MAAM,WAAW,GAAG,IAAA,gBAAM,EAAC,CAAC,CAAC,CAAC;AAE9B,MAAa,uBAAuB;IAIlC,YAAY,KAA2B;QAH/B;;;;;WAA0C;QACjC;;;;;WAA8B;QAG7C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,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AAC;IAED,KAAK,CAAC,YAAY,CAAC,MAAgC;QACjD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,qCAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAA8B;QAC7C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,mCAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1D,CAAC;IAEO,KAAK,CAAC,eAAe;QAC3B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,MAAM,GAAG,IAAI,gCAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAChD;QACD,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACF;AAxDD,0DAwDC"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { IMocodyIndexDefinition } from "../type";
|
|
2
|
-
import { TableDescription } from "@aws-sdk/client-dynamodb";
|
|
3
|
-
import { MocodyInitializerDynamo } from "./dynamo-initializer";
|
|
4
|
-
interface ITableOptions<T> {
|
|
5
|
-
dynamoDb: () => MocodyInitializerDynamo;
|
|
6
|
-
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
7
|
-
tableFullName: string;
|
|
8
|
-
partitionKeyFieldName: string;
|
|
9
|
-
sortKeyFieldName: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class DynamoManageTable<T> {
|
|
12
|
-
private readonly partitionKeyFieldName;
|
|
13
|
-
private readonly sortKeyFieldName;
|
|
14
|
-
private readonly dynamoDb;
|
|
15
|
-
private readonly tableFullName;
|
|
16
|
-
private readonly secondaryIndexOptions;
|
|
17
|
-
constructor({ dynamoDb, secondaryIndexOptions, tableFullName, partitionKeyFieldName, sortKeyFieldName, }: ITableOptions<T>);
|
|
18
|
-
private _tbl_getLocalVariables;
|
|
19
|
-
private _tbl_dynamoDb;
|
|
20
|
-
mocody_tbl_getListOfTablesNamesOnline(): Promise<string[] | undefined>;
|
|
21
|
-
mocody_updateTTL({ isEnabled }: {
|
|
22
|
-
isEnabled: boolean;
|
|
23
|
-
}): Promise<import("@aws-sdk/client-dynamodb").TimeToLiveSpecification | null>;
|
|
24
|
-
mocody_tbl_getTableInfo(): Promise<TableDescription | null>;
|
|
25
|
-
mocody_tbl_checkTableExists(): Promise<boolean>;
|
|
26
|
-
private _allUpdateGlobalSecondaryIndexBase;
|
|
27
|
-
mocody_createOrUpdateDefinedIndexes(): Promise<TableDescription[] | null>;
|
|
28
|
-
mocody_tbl_createTableIfNotExists(): Promise<string | null | undefined>;
|
|
29
|
-
private _getGlobalSecondaryIndexCreationParams;
|
|
30
|
-
mocody_tbl_createTable(): Promise<string | null | undefined>;
|
|
31
|
-
mocody_tbl_deleteGlobalSecondaryIndex(indexName: string): Promise<string | null | undefined>;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
1
|
+
import { IMocodyIndexDefinition } from "../type";
|
|
2
|
+
import { TableDescription } from "@aws-sdk/client-dynamodb";
|
|
3
|
+
import { MocodyInitializerDynamo } from "./dynamo-initializer";
|
|
4
|
+
interface ITableOptions<T> {
|
|
5
|
+
dynamoDb: () => MocodyInitializerDynamo;
|
|
6
|
+
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
7
|
+
tableFullName: string;
|
|
8
|
+
partitionKeyFieldName: string;
|
|
9
|
+
sortKeyFieldName: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class DynamoManageTable<T> {
|
|
12
|
+
private readonly partitionKeyFieldName;
|
|
13
|
+
private readonly sortKeyFieldName;
|
|
14
|
+
private readonly dynamoDb;
|
|
15
|
+
private readonly tableFullName;
|
|
16
|
+
private readonly secondaryIndexOptions;
|
|
17
|
+
constructor({ dynamoDb, secondaryIndexOptions, tableFullName, partitionKeyFieldName, sortKeyFieldName, }: ITableOptions<T>);
|
|
18
|
+
private _tbl_getLocalVariables;
|
|
19
|
+
private _tbl_dynamoDb;
|
|
20
|
+
mocody_tbl_getListOfTablesNamesOnline(): Promise<string[] | undefined>;
|
|
21
|
+
mocody_updateTTL({ isEnabled }: {
|
|
22
|
+
isEnabled: boolean;
|
|
23
|
+
}): Promise<import("@aws-sdk/client-dynamodb").TimeToLiveSpecification | null>;
|
|
24
|
+
mocody_tbl_getTableInfo(): Promise<TableDescription | null>;
|
|
25
|
+
mocody_tbl_checkTableExists(): Promise<boolean>;
|
|
26
|
+
private _allUpdateGlobalSecondaryIndexBase;
|
|
27
|
+
mocody_createOrUpdateDefinedIndexes(): Promise<TableDescription[] | null>;
|
|
28
|
+
mocody_tbl_createTableIfNotExists(): Promise<string | null | undefined>;
|
|
29
|
+
private _getGlobalSecondaryIndexCreationParams;
|
|
30
|
+
mocody_tbl_createTable(): Promise<string | null | undefined>;
|
|
31
|
+
mocody_tbl_deleteGlobalSecondaryIndex(indexName: string): Promise<string | null | undefined>;
|
|
32
|
+
}
|
|
33
|
+
export {};
|