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,88 +1,88 @@
|
|
|
1
|
-
import { IMocodyFieldCondition, IMocodyIndexDefinition, IMocodyPagingResult, IMocodyPreparedTransaction, IMocodyQueryIndexOptions, IMocodyQueryIndexOptionsNoPaging, IMocodyTransactionPrepare } from "../type";
|
|
2
|
-
import { RepoModel } from "../model";
|
|
3
|
-
import Joi from "joi";
|
|
4
|
-
import { MocodyInitializerMongo } from "./mongo-initializer";
|
|
5
|
-
import { MongoManageTable } from "./mongo-table-manager";
|
|
6
|
-
interface IOptions<T> {
|
|
7
|
-
schemaDef: Joi.SchemaMap;
|
|
8
|
-
mongoDbInitializer: () => MocodyInitializerMongo;
|
|
9
|
-
dataKeyGenerator: () => string;
|
|
10
|
-
featureEntityValue: string;
|
|
11
|
-
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
12
|
-
baseTableName: string;
|
|
13
|
-
strictRequiredFields: (keyof T)[] | string[];
|
|
14
|
-
}
|
|
15
|
-
export declare class MongoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
16
|
-
private readonly _mocody_partitionKeyFieldName;
|
|
17
|
-
private readonly _mocody_sortKeyFieldName;
|
|
18
|
-
private readonly _mocody_operationNotSuccessful;
|
|
19
|
-
private readonly _mocody_entityFieldsKeySet;
|
|
20
|
-
private readonly _mocody_mongoDb;
|
|
21
|
-
private readonly _mocody_dataKeyGenerator;
|
|
22
|
-
private readonly _mocody_schema;
|
|
23
|
-
private readonly _mocody_tableFullName;
|
|
24
|
-
private readonly _mocody_strictRequiredFields;
|
|
25
|
-
private readonly _mocody_featureEntityValue;
|
|
26
|
-
private readonly _mocody_secondaryIndexOptions;
|
|
27
|
-
private readonly _mocody_errorHelper;
|
|
28
|
-
private readonly _mocody_filterQueryOperation;
|
|
29
|
-
private _mocody_tableManager;
|
|
30
|
-
constructor({ schemaDef, mongoDbInitializer, secondaryIndexOptions, featureEntityValue, baseTableName, strictRequiredFields, dataKeyGenerator, }: IOptions<T>);
|
|
31
|
-
mocody_tableManager(): MongoManageTable<T>;
|
|
32
|
-
private _mocody_generateDynamoTableKey;
|
|
33
|
-
private _mocody_getDbInstance;
|
|
34
|
-
private _mocody_getDbInstanceDefined;
|
|
35
|
-
private _mocody_getLocalVariables;
|
|
36
|
-
private _mocody_getNativeMongoId;
|
|
37
|
-
private _mocody_getBaseObject;
|
|
38
|
-
private _mocody_withConditionPassed;
|
|
39
|
-
private _mocody_checkValidateMustBeAnObjectDataType;
|
|
40
|
-
private _mocody_checkValidateStrictRequiredFields;
|
|
41
|
-
private _mocody_removeDuplicateString;
|
|
42
|
-
private _mocody_getProjectionFields;
|
|
43
|
-
private _mocody_toMongoProjection;
|
|
44
|
-
private _mocody_allHelpValidateGetValue;
|
|
45
|
-
private _mocody_createGenericError;
|
|
46
|
-
mocody_getOneById({ dataId, withCondition, }: {
|
|
47
|
-
dataId: string;
|
|
48
|
-
withCondition?: IMocodyFieldCondition<T> | undefined;
|
|
49
|
-
}): Promise<T | null>;
|
|
50
|
-
mocody_getManyByIds({ dataIds, fields, excludeFields, withCondition, }: {
|
|
51
|
-
dataIds: string[];
|
|
52
|
-
fields?: (keyof T)[] | undefined;
|
|
53
|
-
excludeFields?: (keyof T)[] | undefined;
|
|
54
|
-
withCondition?: IMocodyFieldCondition<T> | undefined;
|
|
55
|
-
}): Promise<T[]>;
|
|
56
|
-
mocody_formatForDump({ dataList }: {
|
|
57
|
-
dataList: T[];
|
|
58
|
-
}): Promise<string[]>;
|
|
59
|
-
mocody_validateFormatData({ data }: {
|
|
60
|
-
data: T;
|
|
61
|
-
}): Promise<string>;
|
|
62
|
-
mocody_createOne({ data }: {
|
|
63
|
-
data: T;
|
|
64
|
-
}): Promise<T>;
|
|
65
|
-
private _mocody_validateReady;
|
|
66
|
-
private _mocody_formatTTL;
|
|
67
|
-
mocody_updateOne({ dataId, updateData, withCondition, }: {
|
|
68
|
-
dataId: string;
|
|
69
|
-
updateData: Partial<T>;
|
|
70
|
-
withCondition?: IMocodyFieldCondition<T> | undefined;
|
|
71
|
-
}): Promise<T>;
|
|
72
|
-
mocody_prepareTransaction({ transactPrepareInfo, }: {
|
|
73
|
-
transactPrepareInfo: IMocodyTransactionPrepare<T>[];
|
|
74
|
-
}): Promise<IMocodyPreparedTransaction[]>;
|
|
75
|
-
mocody_executeTransaction({ transactInfo }: {
|
|
76
|
-
transactInfo: IMocodyPreparedTransaction[];
|
|
77
|
-
}): Promise<void>;
|
|
78
|
-
mocody_getManyByIndex<TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptionsNoPaging<TData, TSortKeyField>): Promise<TData[]>;
|
|
79
|
-
mocody_getManyByIndexPaginate<TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptions<TData, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
80
|
-
mocody_getManyWithRelation<TQuery = T, TData = T, TSortKeyField = string>(paramOption: Omit<IMocodyQueryIndexOptions<TQuery, TSortKeyField>, "pagingParams">): Promise<TData[]>;
|
|
81
|
-
mocody_getManyWithRelationPaginate<TQuery = T, TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptions<TQuery, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
82
|
-
private _mocody_getManyBySecondaryIndexPaginateBase;
|
|
83
|
-
mocody_deleteById({ dataId, withCondition, }: {
|
|
84
|
-
dataId: string;
|
|
85
|
-
withCondition?: IMocodyFieldCondition<T> | undefined;
|
|
86
|
-
}): Promise<T>;
|
|
87
|
-
}
|
|
88
|
-
export {};
|
|
1
|
+
import { IMocodyFieldCondition, IMocodyIndexDefinition, IMocodyPagingResult, IMocodyPreparedTransaction, IMocodyQueryIndexOptions, IMocodyQueryIndexOptionsNoPaging, IMocodyTransactionPrepare } from "../type";
|
|
2
|
+
import { RepoModel } from "../model";
|
|
3
|
+
import Joi from "joi";
|
|
4
|
+
import { MocodyInitializerMongo } from "./mongo-initializer";
|
|
5
|
+
import { MongoManageTable } from "./mongo-table-manager";
|
|
6
|
+
interface IOptions<T> {
|
|
7
|
+
schemaDef: Joi.SchemaMap;
|
|
8
|
+
mongoDbInitializer: () => MocodyInitializerMongo;
|
|
9
|
+
dataKeyGenerator: () => string;
|
|
10
|
+
featureEntityValue: string;
|
|
11
|
+
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
12
|
+
baseTableName: string;
|
|
13
|
+
strictRequiredFields: (keyof T)[] | string[];
|
|
14
|
+
}
|
|
15
|
+
export declare class MongoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
16
|
+
private readonly _mocody_partitionKeyFieldName;
|
|
17
|
+
private readonly _mocody_sortKeyFieldName;
|
|
18
|
+
private readonly _mocody_operationNotSuccessful;
|
|
19
|
+
private readonly _mocody_entityFieldsKeySet;
|
|
20
|
+
private readonly _mocody_mongoDb;
|
|
21
|
+
private readonly _mocody_dataKeyGenerator;
|
|
22
|
+
private readonly _mocody_schema;
|
|
23
|
+
private readonly _mocody_tableFullName;
|
|
24
|
+
private readonly _mocody_strictRequiredFields;
|
|
25
|
+
private readonly _mocody_featureEntityValue;
|
|
26
|
+
private readonly _mocody_secondaryIndexOptions;
|
|
27
|
+
private readonly _mocody_errorHelper;
|
|
28
|
+
private readonly _mocody_filterQueryOperation;
|
|
29
|
+
private _mocody_tableManager;
|
|
30
|
+
constructor({ schemaDef, mongoDbInitializer, secondaryIndexOptions, featureEntityValue, baseTableName, strictRequiredFields, dataKeyGenerator, }: IOptions<T>);
|
|
31
|
+
mocody_tableManager(): MongoManageTable<T>;
|
|
32
|
+
private _mocody_generateDynamoTableKey;
|
|
33
|
+
private _mocody_getDbInstance;
|
|
34
|
+
private _mocody_getDbInstanceDefined;
|
|
35
|
+
private _mocody_getLocalVariables;
|
|
36
|
+
private _mocody_getNativeMongoId;
|
|
37
|
+
private _mocody_getBaseObject;
|
|
38
|
+
private _mocody_withConditionPassed;
|
|
39
|
+
private _mocody_checkValidateMustBeAnObjectDataType;
|
|
40
|
+
private _mocody_checkValidateStrictRequiredFields;
|
|
41
|
+
private _mocody_removeDuplicateString;
|
|
42
|
+
private _mocody_getProjectionFields;
|
|
43
|
+
private _mocody_toMongoProjection;
|
|
44
|
+
private _mocody_allHelpValidateGetValue;
|
|
45
|
+
private _mocody_createGenericError;
|
|
46
|
+
mocody_getOneById({ dataId, withCondition, }: {
|
|
47
|
+
dataId: string;
|
|
48
|
+
withCondition?: IMocodyFieldCondition<T> | undefined;
|
|
49
|
+
}): Promise<T | null>;
|
|
50
|
+
mocody_getManyByIds({ dataIds, fields, excludeFields, withCondition, }: {
|
|
51
|
+
dataIds: string[];
|
|
52
|
+
fields?: (keyof T)[] | undefined;
|
|
53
|
+
excludeFields?: (keyof T)[] | undefined;
|
|
54
|
+
withCondition?: IMocodyFieldCondition<T> | undefined;
|
|
55
|
+
}): Promise<T[]>;
|
|
56
|
+
mocody_formatForDump({ dataList }: {
|
|
57
|
+
dataList: T[];
|
|
58
|
+
}): Promise<string[]>;
|
|
59
|
+
mocody_validateFormatData({ data }: {
|
|
60
|
+
data: T;
|
|
61
|
+
}): Promise<string>;
|
|
62
|
+
mocody_createOne({ data }: {
|
|
63
|
+
data: T;
|
|
64
|
+
}): Promise<T>;
|
|
65
|
+
private _mocody_validateReady;
|
|
66
|
+
private _mocody_formatTTL;
|
|
67
|
+
mocody_updateOne({ dataId, updateData, withCondition, }: {
|
|
68
|
+
dataId: string;
|
|
69
|
+
updateData: Partial<T>;
|
|
70
|
+
withCondition?: IMocodyFieldCondition<T> | undefined;
|
|
71
|
+
}): Promise<T>;
|
|
72
|
+
mocody_prepareTransaction({ transactPrepareInfo, }: {
|
|
73
|
+
transactPrepareInfo: IMocodyTransactionPrepare<T>[];
|
|
74
|
+
}): Promise<IMocodyPreparedTransaction[]>;
|
|
75
|
+
mocody_executeTransaction({ transactInfo }: {
|
|
76
|
+
transactInfo: IMocodyPreparedTransaction[];
|
|
77
|
+
}): Promise<void>;
|
|
78
|
+
mocody_getManyByIndex<TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptionsNoPaging<TData, TSortKeyField>): Promise<TData[]>;
|
|
79
|
+
mocody_getManyByIndexPaginate<TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptions<TData, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
80
|
+
mocody_getManyWithRelation<TQuery = T, TData = T, TSortKeyField = string>(paramOption: Omit<IMocodyQueryIndexOptions<TQuery, TSortKeyField>, "pagingParams">): Promise<TData[]>;
|
|
81
|
+
mocody_getManyWithRelationPaginate<TQuery = T, TData = T, TSortKeyField = string>(paramOption: IMocodyQueryIndexOptions<TQuery, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
82
|
+
private _mocody_getManyBySecondaryIndexPaginateBase;
|
|
83
|
+
mocody_deleteById({ dataId, withCondition, }: {
|
|
84
|
+
dataId: string;
|
|
85
|
+
withCondition?: IMocodyFieldCondition<T> | undefined;
|
|
86
|
+
}): Promise<T>;
|
|
87
|
+
}
|
|
88
|
+
export {};
|