mocody 0.2.14 → 0.2.17
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 +29 -28
- package/dist/dynamo/dynamo-filter-query-operation.js +655 -627
- package/dist/dynamo/dynamo-filter-query-operation.js.map +1 -1
- package/dist/dynamo/dynamo-helper.d.ts +1 -1
- package/dist/dynamo/dynamo-helper.js +8 -15
- package/dist/dynamo/dynamo-helper.js.map +1 -1
- 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 +96 -84
- package/dist/helpers/query-validator.js.map +1 -1
- package/dist/helpers/util-service.d.ts +29 -30
- package/dist/helpers/util-service.js +155 -167
- package/dist/helpers/util-service.js.map +1 -1
- 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 -71
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { RepoModel } from "../model";
|
|
2
|
-
import type { IMocodyIndexDefinition, IMocodyFieldCondition, IMocodyQueryIndexOptions, IMocodyPagingResult, IMocodyQueryIndexOptionsNoPaging, IMocodyPreparedTransaction, IMocodyTransactionPrepare } from "../type";
|
|
3
|
-
import { AttributeValue } from "@aws-sdk/client-dynamodb";
|
|
4
|
-
import Joi from "joi";
|
|
5
|
-
import { DynamoManageTable } from "./dynamo-manage-table";
|
|
6
|
-
import { MocodyInitializerDynamo } from "./dynamo-initializer";
|
|
7
|
-
interface IOptions<T> {
|
|
8
|
-
schemaDef: Joi.SchemaMap;
|
|
9
|
-
dynamoDbInitializer: () => MocodyInitializerDynamo;
|
|
10
|
-
dataKeyGenerator: () => string;
|
|
11
|
-
featureEntityValue: string;
|
|
12
|
-
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
13
|
-
baseTableName: string;
|
|
14
|
-
strictRequiredFields: (keyof T)[] | string[];
|
|
15
|
-
}
|
|
16
|
-
export interface IBulkDataDynamoDb {
|
|
17
|
-
[tableName: string]: {
|
|
18
|
-
PutRequest: {
|
|
19
|
-
Item: {
|
|
20
|
-
[key: string]: AttributeValue;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}[];
|
|
24
|
-
}
|
|
25
|
-
export declare class DynamoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
26
|
-
private readonly _mocody_partitionKeyFieldName;
|
|
27
|
-
private readonly _mocody_sortKeyFieldName;
|
|
28
|
-
private readonly _mocody_featureEntity_Key_Value;
|
|
29
|
-
private readonly _mocody_dynamoDb;
|
|
30
|
-
private readonly _mocody_dataKeyGenerator;
|
|
31
|
-
private readonly _mocody_schema;
|
|
32
|
-
private readonly _mocody_tableFullName;
|
|
33
|
-
private readonly _mocody_strictRequiredFields;
|
|
34
|
-
private readonly _mocody_featureEntityValue;
|
|
35
|
-
private readonly _mocody_secondaryIndexOptions;
|
|
36
|
-
private readonly _mocody_queryFilter;
|
|
37
|
-
private readonly _mocody_queryScanProcessor;
|
|
38
|
-
private readonly _mocody_errorHelper;
|
|
39
|
-
private readonly _mocody_entityFieldsKeySet;
|
|
40
|
-
private _mocody_tableManager;
|
|
41
|
-
constructor({ schemaDef, dynamoDbInitializer, secondaryIndexOptions, featureEntityValue, baseTableName, strictRequiredFields, dataKeyGenerator, }: IOptions<T>);
|
|
42
|
-
mocody_tableManager(): DynamoManageTable<T>;
|
|
43
|
-
private
|
|
44
|
-
private _mocody_generateDynamoTableKey;
|
|
45
|
-
private _mocody_getLocalVariables;
|
|
46
|
-
private _mocody_getBaseObject;
|
|
47
|
-
private _mocody_checkValidateMustBeAnObjectDataType;
|
|
48
|
-
private _mocody_checkValidateStrictRequiredFields;
|
|
49
|
-
private _mocody_createGenericError;
|
|
50
|
-
private _mocody_withConditionPassed;
|
|
51
|
-
private _mocody_removeDuplicateString;
|
|
52
|
-
private _mocody_allHelpValidateGetValue;
|
|
53
|
-
private _mocody_formatTTL;
|
|
54
|
-
mocody_createOne({ data }: {
|
|
55
|
-
data: T;
|
|
56
|
-
}): Promise<T>;
|
|
57
|
-
mocody_validateFormatData({ data }: {
|
|
58
|
-
data: T;
|
|
59
|
-
}): Promise<string>;
|
|
60
|
-
mocody_formatForDump({ dataList }: {
|
|
61
|
-
dataList: T[];
|
|
62
|
-
}): Promise<string[]>;
|
|
63
|
-
private _mocody_validateReady;
|
|
64
|
-
mocody_getOneById({ dataId, withCondition, }: {
|
|
65
|
-
dataId: string;
|
|
66
|
-
withCondition?: IMocodyFieldCondition<T>;
|
|
67
|
-
}): Promise<T | null>;
|
|
68
|
-
mocody_updateOne({ dataId, updateData, withCondition, }: {
|
|
69
|
-
dataId: string;
|
|
70
|
-
updateData: Partial<T>;
|
|
71
|
-
withCondition?: IMocodyFieldCondition<T>;
|
|
72
|
-
}): Promise<T>;
|
|
73
|
-
mocody_prepareTransaction({ transactPrepareInfo, }: {
|
|
74
|
-
transactPrepareInfo: IMocodyTransactionPrepare<T>[];
|
|
75
|
-
}): Promise<IMocodyPreparedTransaction[]>;
|
|
76
|
-
mocody_executeTransaction({ transactInfo }: {
|
|
77
|
-
transactInfo: IMocodyPreparedTransaction[];
|
|
78
|
-
}): Promise<void>;
|
|
79
|
-
private _mocody_getProjectionFields;
|
|
80
|
-
mocody_getManyByIds({ dataIds, fields, excludeFields, withCondition, }: {
|
|
81
|
-
dataIds: string[];
|
|
82
|
-
fields?: (keyof T)[];
|
|
83
|
-
excludeFields?: (keyof T)[];
|
|
84
|
-
withCondition?: IMocodyFieldCondition<T>;
|
|
85
|
-
}): Promise<T[]>;
|
|
86
|
-
private mocody_batchGetManyByIdsBasePrivate;
|
|
87
|
-
mocody_getManyByIndex<TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptionsNoPaging<TData, TSortKeyField>): Promise<TData[]>;
|
|
88
|
-
mocody_getManyByIndexPaginate<TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptions<TData, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
89
|
-
mocody_getManyWithRelation<TQuery = T, TData = T, TSortKeyField = string>(paramOption: Omit<IMocodyQueryIndexOptions<TQuery, TSortKeyField>, "pagingParams">): Promise<TData[]>;
|
|
90
|
-
mocody_getManyWithRelationPaginate<TQuery = T, TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptions<TQuery, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
91
|
-
private _mocody_getManyBySecondaryIndexPaginateBase;
|
|
92
|
-
mocody_deleteById({ dataId, withCondition, }: {
|
|
93
|
-
dataId: string;
|
|
94
|
-
withCondition?: IMocodyFieldCondition<T>;
|
|
95
|
-
}): Promise<T>;
|
|
96
|
-
}
|
|
97
|
-
export {};
|
|
1
|
+
import { RepoModel } from "../model";
|
|
2
|
+
import type { IMocodyIndexDefinition, IMocodyFieldCondition, IMocodyQueryIndexOptions, IMocodyPagingResult, IMocodyQueryIndexOptionsNoPaging, IMocodyPreparedTransaction, IMocodyTransactionPrepare } from "../type";
|
|
3
|
+
import { AttributeValue } from "@aws-sdk/client-dynamodb";
|
|
4
|
+
import Joi from "joi";
|
|
5
|
+
import { DynamoManageTable } from "./dynamo-manage-table";
|
|
6
|
+
import { MocodyInitializerDynamo } from "./dynamo-initializer";
|
|
7
|
+
interface IOptions<T> {
|
|
8
|
+
schemaDef: Joi.SchemaMap;
|
|
9
|
+
dynamoDbInitializer: () => MocodyInitializerDynamo;
|
|
10
|
+
dataKeyGenerator: () => string;
|
|
11
|
+
featureEntityValue: string;
|
|
12
|
+
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
13
|
+
baseTableName: string;
|
|
14
|
+
strictRequiredFields: (keyof T)[] | string[];
|
|
15
|
+
}
|
|
16
|
+
export interface IBulkDataDynamoDb {
|
|
17
|
+
[tableName: string]: {
|
|
18
|
+
PutRequest: {
|
|
19
|
+
Item: {
|
|
20
|
+
[key: string]: AttributeValue;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
}
|
|
25
|
+
export declare class DynamoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
26
|
+
private readonly _mocody_partitionKeyFieldName;
|
|
27
|
+
private readonly _mocody_sortKeyFieldName;
|
|
28
|
+
private readonly _mocody_featureEntity_Key_Value;
|
|
29
|
+
private readonly _mocody_dynamoDb;
|
|
30
|
+
private readonly _mocody_dataKeyGenerator;
|
|
31
|
+
private readonly _mocody_schema;
|
|
32
|
+
private readonly _mocody_tableFullName;
|
|
33
|
+
private readonly _mocody_strictRequiredFields;
|
|
34
|
+
private readonly _mocody_featureEntityValue;
|
|
35
|
+
private readonly _mocody_secondaryIndexOptions;
|
|
36
|
+
private readonly _mocody_queryFilter;
|
|
37
|
+
private readonly _mocody_queryScanProcessor;
|
|
38
|
+
private readonly _mocody_errorHelper;
|
|
39
|
+
private readonly _mocody_entityFieldsKeySet;
|
|
40
|
+
private _mocody_tableManager;
|
|
41
|
+
constructor({ schemaDef, dynamoDbInitializer, secondaryIndexOptions, featureEntityValue, baseTableName, strictRequiredFields, dataKeyGenerator, }: IOptions<T>);
|
|
42
|
+
mocody_tableManager(): DynamoManageTable<T>;
|
|
43
|
+
private _mocody_dynamoInit;
|
|
44
|
+
private _mocody_generateDynamoTableKey;
|
|
45
|
+
private _mocody_getLocalVariables;
|
|
46
|
+
private _mocody_getBaseObject;
|
|
47
|
+
private _mocody_checkValidateMustBeAnObjectDataType;
|
|
48
|
+
private _mocody_checkValidateStrictRequiredFields;
|
|
49
|
+
private _mocody_createGenericError;
|
|
50
|
+
private _mocody_withConditionPassed;
|
|
51
|
+
private _mocody_removeDuplicateString;
|
|
52
|
+
private _mocody_allHelpValidateGetValue;
|
|
53
|
+
private _mocody_formatTTL;
|
|
54
|
+
mocody_createOne({ data }: {
|
|
55
|
+
data: T;
|
|
56
|
+
}): Promise<T>;
|
|
57
|
+
mocody_validateFormatData({ data }: {
|
|
58
|
+
data: T;
|
|
59
|
+
}): Promise<string>;
|
|
60
|
+
mocody_formatForDump({ dataList }: {
|
|
61
|
+
dataList: T[];
|
|
62
|
+
}): Promise<string[]>;
|
|
63
|
+
private _mocody_validateReady;
|
|
64
|
+
mocody_getOneById({ dataId, withCondition, }: {
|
|
65
|
+
dataId: string;
|
|
66
|
+
withCondition?: IMocodyFieldCondition<T>;
|
|
67
|
+
}): Promise<T | null>;
|
|
68
|
+
mocody_updateOne({ dataId, updateData, withCondition, }: {
|
|
69
|
+
dataId: string;
|
|
70
|
+
updateData: Partial<T>;
|
|
71
|
+
withCondition?: IMocodyFieldCondition<T>;
|
|
72
|
+
}): Promise<T>;
|
|
73
|
+
mocody_prepareTransaction({ transactPrepareInfo, }: {
|
|
74
|
+
transactPrepareInfo: IMocodyTransactionPrepare<T>[];
|
|
75
|
+
}): Promise<IMocodyPreparedTransaction[]>;
|
|
76
|
+
mocody_executeTransaction({ transactInfo }: {
|
|
77
|
+
transactInfo: IMocodyPreparedTransaction[];
|
|
78
|
+
}): Promise<void>;
|
|
79
|
+
private _mocody_getProjectionFields;
|
|
80
|
+
mocody_getManyByIds({ dataIds, fields, excludeFields, withCondition, }: {
|
|
81
|
+
dataIds: string[];
|
|
82
|
+
fields?: (keyof T)[];
|
|
83
|
+
excludeFields?: (keyof T)[];
|
|
84
|
+
withCondition?: IMocodyFieldCondition<T>;
|
|
85
|
+
}): Promise<T[]>;
|
|
86
|
+
private mocody_batchGetManyByIdsBasePrivate;
|
|
87
|
+
mocody_getManyByIndex<TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptionsNoPaging<TData, TSortKeyField>): Promise<TData[]>;
|
|
88
|
+
mocody_getManyByIndexPaginate<TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptions<TData, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
89
|
+
mocody_getManyWithRelation<TQuery = T, TData = T, TSortKeyField = string>(paramOption: Omit<IMocodyQueryIndexOptions<TQuery, TSortKeyField>, "pagingParams">): Promise<TData[]>;
|
|
90
|
+
mocody_getManyWithRelationPaginate<TQuery = T, TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptions<TQuery, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
91
|
+
private _mocody_getManyBySecondaryIndexPaginateBase;
|
|
92
|
+
mocody_deleteById({ dataId, withCondition, }: {
|
|
93
|
+
dataId: string;
|
|
94
|
+
withCondition?: IMocodyFieldCondition<T>;
|
|
95
|
+
}): Promise<T>;
|
|
96
|
+
}
|
|
97
|
+
export {};
|