mocody 0.2.15 → 0.2.16
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 +21 -21
- package/README.md +4 -4
- package/dist/core/base-schema.d.ts +13 -13
- package/dist/core/base-schema.js +11 -11
- package/dist/core/base-schema.js.map +1 -1
- package/dist/couch/couch-data-operation.d.ts +90 -90
- package/dist/couch/couch-data-operation.js +581 -581
- package/dist/couch/couch-data-operation.js.map +1 -1
- package/dist/couch/couch-filter-query-operation.d.ts +47 -47
- package/dist/couch/couch-filter-query-operation.js +438 -438
- package/dist/couch/couch-initializer.d.ts +45 -45
- package/dist/couch/couch-initializer.js +98 -98
- 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 +113 -113
- package/dist/dynamo/dynamo-data-operation.d.ts +97 -97
- package/dist/dynamo/dynamo-data-operation.js +788 -793
- package/dist/dynamo/dynamo-data-operation.js.map +1 -1
- package/dist/dynamo/dynamo-filter-query-operation.d.ts +28 -28
- package/dist/dynamo/dynamo-filter-query-operation.js +627 -627
- package/dist/dynamo/dynamo-helper.d.ts +1 -1
- package/dist/dynamo/dynamo-helper.js +8 -8
- package/dist/dynamo/dynamo-initializer.d.ts +14 -8
- package/dist/dynamo/dynamo-initializer.js +58 -34
- package/dist/dynamo/dynamo-initializer.js.map +1 -1
- package/dist/dynamo/dynamo-manage-table.d.ts +33 -32
- package/dist/dynamo/dynamo-manage-table.js +419 -418
- package/dist/dynamo/dynamo-manage-table.js.map +1 -1
- package/dist/dynamo/dynamo-query-scan-processor.d.ts +25 -24
- package/dist/dynamo/dynamo-query-scan-processor.js +268 -266
- 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 +8 -8
- package/dist/helpers/logging-service.js +44 -44
- package/dist/helpers/mocody-utils.d.ts +13 -15
- package/dist/helpers/mocody-utils.js +48 -48
- package/dist/helpers/query-validator.d.ts +20 -20
- package/dist/helpers/query-validator.js +84 -84
- package/dist/helpers/util-service.d.ts +29 -29
- package/dist/helpers/util-service.js +155 -155
- package/dist/index.d.ts +10 -10
- package/dist/index.js +19 -19
- package/dist/model/index.d.ts +40 -40
- package/dist/model/index.js +6 -6
- package/dist/mongo/mongo-data-operation.d.ts +88 -88
- package/dist/mongo/mongo-data-operation.js +597 -597
- package/dist/mongo/mongo-data-operation.js.map +1 -1
- package/dist/mongo/mongo-filter-query-operation.d.ts +47 -47
- package/dist/mongo/mongo-filter-query-operation.js +433 -433
- 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/type/index.d.ts +108 -108
- package/dist/type/index.js +2 -2
- package/package.json +70 -72
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getDynamoRandomKeyOrHash(prefix: `:${string}` | `#${string}`): string;
|
|
1
|
+
export declare function getDynamoRandomKeyOrHash(prefix: `:${string}` | `#${string}`): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDynamoRandomKeyOrHash = void 0;
|
|
4
|
-
const util_service_1 = require("./../helpers/util-service");
|
|
5
|
-
function getDynamoRandomKeyOrHash(prefix) {
|
|
6
|
-
return [prefix, util_service_1.UtilService.getRandomString(6)].join("").toLowerCase();
|
|
7
|
-
}
|
|
8
|
-
exports.getDynamoRandomKeyOrHash = getDynamoRandomKeyOrHash;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDynamoRandomKeyOrHash = void 0;
|
|
4
|
+
const util_service_1 = require("./../helpers/util-service");
|
|
5
|
+
function getDynamoRandomKeyOrHash(prefix) {
|
|
6
|
+
return [prefix, util_service_1.UtilService.getRandomString(6)].join("").toLowerCase();
|
|
7
|
+
}
|
|
8
|
+
exports.getDynamoRandomKeyOrHash = getDynamoRandomKeyOrHash;
|
|
9
9
|
//# sourceMappingURL=dynamo-helper.js.map
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class MocodyInitializerDynamo {
|
|
3
|
-
private
|
|
4
|
-
private readonly
|
|
5
|
-
constructor(inits: DynamoDBClientConfig);
|
|
6
|
-
getInstance(): Promise<
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { DynamoDBClientConfig, DynamoDBClient, PutItemCommandInput, GetItemCommandInput, TransactWriteItemsCommandInput, BatchWriteItemCommandInput, BatchGetItemCommandInput, DeleteItemCommandInput } from "@aws-sdk/client-dynamodb";
|
|
2
|
+
export declare class MocodyInitializerDynamo {
|
|
3
|
+
private client;
|
|
4
|
+
private readonly _config;
|
|
5
|
+
constructor(inits: DynamoDBClientConfig);
|
|
6
|
+
getInstance(): Promise<DynamoDBClient>;
|
|
7
|
+
putItem(params: PutItemCommandInput): Promise<import("@aws-sdk/client-dynamodb").PutItemCommandOutput>;
|
|
8
|
+
getItem(params: GetItemCommandInput): Promise<import("@aws-sdk/client-dynamodb").GetItemCommandOutput>;
|
|
9
|
+
transactWriteItems(params: TransactWriteItemsCommandInput): Promise<import("@aws-sdk/client-dynamodb").TransactWriteItemsCommandOutput>;
|
|
10
|
+
batchWriteItem(params: BatchWriteItemCommandInput): Promise<import("@aws-sdk/client-dynamodb").BatchWriteItemCommandOutput>;
|
|
11
|
+
batchGetItem(params: BatchGetItemCommandInput): Promise<import("@aws-sdk/client-dynamodb").BatchGetItemCommandOutput>;
|
|
12
|
+
deleteItem(params: DeleteItemCommandInput): Promise<import("@aws-sdk/client-dynamodb").DeleteItemCommandOutput>;
|
|
13
|
+
private getInstanceBase;
|
|
14
|
+
}
|
|
@@ -1,35 +1,59 @@
|
|
|
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 throat_1 =
|
|
7
|
-
const concurrency = (0, throat_1.default)(1);
|
|
8
|
-
class MocodyInitializerDynamo {
|
|
9
|
-
constructor(inits) {
|
|
10
|
-
Object.defineProperty(this, "
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true,
|
|
14
|
-
value: void 0
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(this, "
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true,
|
|
20
|
-
value: void 0
|
|
21
|
-
});
|
|
22
|
-
this.
|
|
23
|
-
}
|
|
24
|
-
async getInstance() {
|
|
25
|
-
return await concurrency(() => this.getInstanceBase());
|
|
26
|
-
}
|
|
27
|
-
async
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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 throat_1 = tslib_1.__importDefault(require("throat"));
|
|
7
|
+
const concurrency = (0, throat_1.default)(1);
|
|
8
|
+
class MocodyInitializerDynamo {
|
|
9
|
+
constructor(inits) {
|
|
10
|
+
Object.defineProperty(this, "client", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: void 0
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(this, "_config", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: void 0
|
|
21
|
+
});
|
|
22
|
+
this._config = inits;
|
|
23
|
+
}
|
|
24
|
+
async getInstance() {
|
|
25
|
+
return await concurrency(() => this.getInstanceBase());
|
|
26
|
+
}
|
|
27
|
+
async putItem(params) {
|
|
28
|
+
const client = await this.getInstance();
|
|
29
|
+
return await client.send(new client_dynamodb_1.PutItemCommand(params));
|
|
30
|
+
}
|
|
31
|
+
async getItem(params) {
|
|
32
|
+
const client = await this.getInstance();
|
|
33
|
+
return await client.send(new client_dynamodb_1.GetItemCommand(params));
|
|
34
|
+
}
|
|
35
|
+
async transactWriteItems(params) {
|
|
36
|
+
const client = await this.getInstance();
|
|
37
|
+
return await client.send(new client_dynamodb_1.TransactWriteItemsCommand(params));
|
|
38
|
+
}
|
|
39
|
+
async batchWriteItem(params) {
|
|
40
|
+
const client = await this.getInstance();
|
|
41
|
+
return await client.send(new client_dynamodb_1.BatchWriteItemCommand(params));
|
|
42
|
+
}
|
|
43
|
+
async batchGetItem(params) {
|
|
44
|
+
const client = await this.getInstance();
|
|
45
|
+
return await client.send(new client_dynamodb_1.BatchGetItemCommand(params));
|
|
46
|
+
}
|
|
47
|
+
async deleteItem(params) {
|
|
48
|
+
const client = await this.getInstance();
|
|
49
|
+
return await client.send(new client_dynamodb_1.DeleteItemCommand(params));
|
|
50
|
+
}
|
|
51
|
+
async getInstanceBase() {
|
|
52
|
+
if (!this.client) {
|
|
53
|
+
this.client = new client_dynamodb_1.DynamoDBClient(this._config);
|
|
54
|
+
}
|
|
55
|
+
return await Promise.resolve(this.client);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.MocodyInitializerDynamo = MocodyInitializerDynamo;
|
|
35
59
|
//# 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,8DAekC;AAClC,4DAA4B;AAC5B,MAAM,WAAW,GAAG,IAAA,gBAAM,EAAC,CAAC,CAAC,CAAC;AAE9B,MAAa,uBAAuB;IAIlC,YAAY,KAA2B;QAHvC;;;;;WAAmD;QACnD;;;;;WAA+C;QAG7C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO,MAAM,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAA2B;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,gCAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAA2B;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,gCAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,MAAsC;QAC7D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,2CAAyB,CAAC,MAAM,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,MAAkC;QACrD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,uCAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,CAAC;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;AAhDD,0DAgDC"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { IMocodyIndexDefinition } from "../type";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private readonly
|
|
13
|
-
private readonly
|
|
14
|
-
private readonly
|
|
15
|
-
private readonly
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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 {};
|