mocody 0.6.6 → 0.6.8
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/index.cjs +5907 -0
- package/dist/index.d.cts +723 -0
- package/dist/index.d.ts +723 -10
- package/dist/index.js +5907 -9
- package/package.json +36 -8
- package/dist/core/base-schema.d.ts +0 -13
- package/dist/core/base-schema.js +0 -8
- package/dist/core/base-schema.js.map +0 -1
- package/dist/couch/couch-data-operation.d.ts +0 -91
- package/dist/couch/couch-data-operation.js +0 -528
- package/dist/couch/couch-data-operation.js.map +0 -1
- package/dist/couch/couch-filter-query-operation.d.ts +0 -45
- package/dist/couch/couch-filter-query-operation.js +0 -369
- package/dist/couch/couch-filter-query-operation.js.map +0 -1
- package/dist/couch/couch-initializer.d.ts +0 -126
- package/dist/couch/couch-initializer.js +0 -173
- package/dist/couch/couch-initializer.js.map +0 -1
- package/dist/couch/couch-manage-table.d.ts +0 -46
- package/dist/couch/couch-manage-table.js +0 -75
- package/dist/couch/couch-manage-table.js.map +0 -1
- package/dist/dynamo/dynamo-data-operation.d.ts +0 -101
- package/dist/dynamo/dynamo-data-operation.js +0 -860
- package/dist/dynamo/dynamo-data-operation.js.map +0 -1
- package/dist/dynamo/dynamo-filter-query-operation.d.ts +0 -30
- package/dist/dynamo/dynamo-filter-query-operation.js +0 -652
- package/dist/dynamo/dynamo-filter-query-operation.js.map +0 -1
- package/dist/dynamo/dynamo-filter-query-partiql-operation.d.ts +0 -23
- package/dist/dynamo/dynamo-filter-query-partiql-operation.js +0 -560
- package/dist/dynamo/dynamo-filter-query-partiql-operation.js.map +0 -1
- package/dist/dynamo/dynamo-helper.d.ts +0 -22
- package/dist/dynamo/dynamo-helper.js +0 -54
- package/dist/dynamo/dynamo-helper.js.map +0 -1
- package/dist/dynamo/dynamo-initializer.d.ts +0 -16
- package/dist/dynamo/dynamo-initializer.js +0 -52
- package/dist/dynamo/dynamo-initializer.js.map +0 -1
- package/dist/dynamo/dynamo-manage-table.d.ts +0 -33
- package/dist/dynamo/dynamo-manage-table.js +0 -387
- package/dist/dynamo/dynamo-manage-table.js.map +0 -1
- package/dist/dynamo/dynamo-query-partiql-processor.d.ts +0 -29
- package/dist/dynamo/dynamo-query-partiql-processor.js +0 -209
- package/dist/dynamo/dynamo-query-partiql-processor.js.map +0 -1
- package/dist/dynamo/dynamo-query-scan-processor.d.ts +0 -25
- package/dist/dynamo/dynamo-query-scan-processor.js +0 -265
- package/dist/dynamo/dynamo-query-scan-processor.js.map +0 -1
- package/dist/helpers/base-joi-helper.d.ts +0 -2
- package/dist/helpers/base-joi-helper.js +0 -9
- package/dist/helpers/base-joi-helper.js.map +0 -1
- package/dist/helpers/constants.d.ts +0 -3
- package/dist/helpers/constants.js +0 -4
- package/dist/helpers/constants.js.map +0 -1
- package/dist/helpers/errors.d.ts +0 -14
- package/dist/helpers/errors.js +0 -34
- package/dist/helpers/errors.js.map +0 -1
- package/dist/helpers/logging-service.d.ts +0 -9
- package/dist/helpers/logging-service.js +0 -46
- package/dist/helpers/logging-service.js.map +0 -1
- package/dist/helpers/mocody-utils.d.ts +0 -22
- package/dist/helpers/mocody-utils.js +0 -70
- package/dist/helpers/mocody-utils.js.map +0 -1
- package/dist/helpers/query-validator.d.ts +0 -21
- package/dist/helpers/query-validator.js +0 -102
- package/dist/helpers/query-validator.js.map +0 -1
- package/dist/helpers/util-service.d.ts +0 -38
- package/dist/helpers/util-service.js +0 -225
- package/dist/helpers/util-service.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/model/index.d.ts +0 -40
- package/dist/model/index.js +0 -3
- package/dist/model/index.js.map +0 -1
- package/dist/mongo/mongo-data-operation.d.ts +0 -89
- package/dist/mongo/mongo-data-operation.js +0 -557
- package/dist/mongo/mongo-data-operation.js.map +0 -1
- package/dist/mongo/mongo-filter-query-operation.d.ts +0 -45
- package/dist/mongo/mongo-filter-query-operation.js +0 -367
- package/dist/mongo/mongo-filter-query-operation.js.map +0 -1
- package/dist/mongo/mongo-initializer.d.ts +0 -16
- package/dist/mongo/mongo-initializer.js +0 -33
- package/dist/mongo/mongo-initializer.js.map +0 -1
- package/dist/mongo/mongo-table-manager.d.ts +0 -31
- package/dist/mongo/mongo-table-manager.js +0 -76
- package/dist/mongo/mongo-table-manager.js.map +0 -1
- package/dist/type/index.d.ts +0 -128
- package/dist/type/index.js +0 -2
- package/dist/type/index.js.map +0 -1
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,723 @@
|
|
|
1
|
+
import * as _aws_sdk_client_dynamodb from '@aws-sdk/client-dynamodb';
|
|
2
|
+
import { DynamoDBClientConfig, DynamoDBClient, ExecuteStatementCommandInput, PutItemCommandInput, GetItemCommandInput, TransactWriteItemsCommandInput, BatchWriteItemCommandInput, BatchGetItemCommandInput, DeleteItemCommandInput, TableDescription } from '@aws-sdk/client-dynamodb';
|
|
3
|
+
import * as _aws_sdk_lib_dynamodb from '@aws-sdk/lib-dynamodb';
|
|
4
|
+
import Joi from 'joi';
|
|
5
|
+
import * as Nano from 'nano';
|
|
6
|
+
import Nano__default from 'nano';
|
|
7
|
+
import * as mongodb from 'mongodb';
|
|
8
|
+
import { MongoClientOptions, Document } from 'mongodb';
|
|
9
|
+
|
|
10
|
+
type RequireAtLeastOneBase<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
11
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
12
|
+
}[Keys];
|
|
13
|
+
type RequireAtLeastOne<T> = RequireAtLeastOneBase<T, keyof T>;
|
|
14
|
+
type TypeFallBackStringOnly<T> = T extends string ? Extract<T, string> : never;
|
|
15
|
+
type TypeFallBack<T> = undefined extends T ? Exclude<T, undefined> : T;
|
|
16
|
+
type TypeFallBackArray<T> = number extends T ? number[] : string extends T ? string[] : T;
|
|
17
|
+
type TypeFallBackArrayAdvanced<T> = number extends T ? number[] : string extends T ? string[] : Extract<T, string>[] | Extract<T, number>[];
|
|
18
|
+
type IMocodyKeyConditionParams<T = string> = {
|
|
19
|
+
$eq?: TypeFallBack<T> | null;
|
|
20
|
+
$gt?: TypeFallBack<T>;
|
|
21
|
+
$gte?: TypeFallBack<T>;
|
|
22
|
+
$lt?: TypeFallBack<T>;
|
|
23
|
+
$lte?: TypeFallBack<T>;
|
|
24
|
+
$between?: [TypeFallBack<T>, TypeFallBack<T>];
|
|
25
|
+
$beginsWith?: TypeFallBackStringOnly<T>;
|
|
26
|
+
};
|
|
27
|
+
type IMocodyQueryConditionParams<T = any> = IMocodyKeyConditionParams<T> & {
|
|
28
|
+
$ne?: TypeFallBack<T> | null;
|
|
29
|
+
$in?: TypeFallBackArrayAdvanced<T>;
|
|
30
|
+
$nin?: TypeFallBackArrayAdvanced<T>;
|
|
31
|
+
$exists?: boolean;
|
|
32
|
+
$elemMatch?: {
|
|
33
|
+
$in: TypeFallBackArray<T>;
|
|
34
|
+
};
|
|
35
|
+
$contains?: TypeFallBackStringOnly<T>;
|
|
36
|
+
$notContains?: TypeFallBackStringOnly<T>;
|
|
37
|
+
$nestedMatch?: IQueryNested<RequireAtLeastOne<T>>;
|
|
38
|
+
$nestedArrayMatch?: IQueryNestedArray<RequireAtLeastOne<T>>;
|
|
39
|
+
};
|
|
40
|
+
type IMocodyQueryNestedParams<T = any> = IMocodyKeyConditionParams<T> & {
|
|
41
|
+
$contains?: TypeFallBackStringOnly<T>;
|
|
42
|
+
$ne?: TypeFallBack<T> | null;
|
|
43
|
+
$in?: TypeFallBackArrayAdvanced<T>;
|
|
44
|
+
$nin?: TypeFallBackArrayAdvanced<T>;
|
|
45
|
+
$exists?: boolean;
|
|
46
|
+
};
|
|
47
|
+
type IQueryAll<T> = {
|
|
48
|
+
[P in keyof T]: T[P] | IMocodyQueryConditionParams<T[P]>;
|
|
49
|
+
};
|
|
50
|
+
type IQueryNested<T> = {
|
|
51
|
+
[P in keyof T]: T[P] | IMocodyQueryNestedParams<T[P]>;
|
|
52
|
+
};
|
|
53
|
+
type IQueryNestedArray<T = any> = {
|
|
54
|
+
query: IMocodyQueryNestedParams<any>;
|
|
55
|
+
index: number;
|
|
56
|
+
path: string[];
|
|
57
|
+
};
|
|
58
|
+
interface IMocodyPagingResult<T> {
|
|
59
|
+
nextPageHash: string | undefined | null;
|
|
60
|
+
paginationResults: T;
|
|
61
|
+
}
|
|
62
|
+
type IMocodyPagingParams = {
|
|
63
|
+
evaluationLimit?: number | undefined | null;
|
|
64
|
+
nextPageHash?: string | undefined | null;
|
|
65
|
+
};
|
|
66
|
+
type IQueryDefOr<T> = {
|
|
67
|
+
$or?: IQueryAll<RequireAtLeastOne<T>>[];
|
|
68
|
+
};
|
|
69
|
+
type IQueryDefAnd<T> = {
|
|
70
|
+
$and?: IQueryAll<RequireAtLeastOne<T>>[];
|
|
71
|
+
};
|
|
72
|
+
type IMocodyQueryDefinition<T> = IQueryAll<RequireAtLeastOne<T & IQueryDefOr<T> & IQueryDefAnd<T>>>;
|
|
73
|
+
interface IMocodyQueryIndexOptions<T, TSortKeyField = string> {
|
|
74
|
+
indexName: string;
|
|
75
|
+
partitionKeyValue: string | number;
|
|
76
|
+
sortKeyQuery?: IMocodyKeyConditionParams<TSortKeyField> | undefined | null;
|
|
77
|
+
query?: IMocodyQueryDefinition<T> | undefined | null;
|
|
78
|
+
fields?: (keyof T)[] | undefined | null;
|
|
79
|
+
excludeFields?: (keyof T)[] | undefined | null;
|
|
80
|
+
pagingParams?: IMocodyPagingParams | undefined | null;
|
|
81
|
+
limit?: number | undefined | null;
|
|
82
|
+
sort?: "asc" | "desc" | undefined | null;
|
|
83
|
+
}
|
|
84
|
+
type IMocodyQueryIndexOptionsNoPaging<T, TSortKeyField = string> = Omit<IMocodyQueryIndexOptions<T, TSortKeyField>, "pagingParams">;
|
|
85
|
+
interface IMocodyIndexDefinition<T> {
|
|
86
|
+
indexName: string;
|
|
87
|
+
partitionKeyFieldName: keyof T;
|
|
88
|
+
sortKeyFieldName: keyof T;
|
|
89
|
+
dataTypes: {
|
|
90
|
+
partitionKeyDataType: "N" | "S";
|
|
91
|
+
sortKeyDataType: "N" | "S";
|
|
92
|
+
};
|
|
93
|
+
projectionFieldsInclude?: (keyof T)[];
|
|
94
|
+
}
|
|
95
|
+
type IMocodyFieldCondition<T> = {
|
|
96
|
+
field: keyof T;
|
|
97
|
+
equals: string | number;
|
|
98
|
+
}[];
|
|
99
|
+
interface IMocodyCreateTransactionPrepare<T> {
|
|
100
|
+
kind: "create";
|
|
101
|
+
data: T;
|
|
102
|
+
}
|
|
103
|
+
interface IMocodyUpdateTransactionPrepare<T> {
|
|
104
|
+
kind: "update";
|
|
105
|
+
data: T;
|
|
106
|
+
dataId: string;
|
|
107
|
+
}
|
|
108
|
+
interface IMocodyDeleteTransactionPrepare<T> {
|
|
109
|
+
kind: "delete";
|
|
110
|
+
dataId: string;
|
|
111
|
+
}
|
|
112
|
+
type IMocodyTransactionPrepare<T> = IMocodyCreateTransactionPrepare<T> | IMocodyUpdateTransactionPrepare<T> | IMocodyDeleteTransactionPrepare<T>;
|
|
113
|
+
interface IMocodyPreparedCreateTransaction {
|
|
114
|
+
kind: "create";
|
|
115
|
+
tableName: string;
|
|
116
|
+
data: Record<string, any>;
|
|
117
|
+
partitionKeyFieldName: "id";
|
|
118
|
+
}
|
|
119
|
+
interface IMocodyPreparedUpdateTransaction {
|
|
120
|
+
kind: "update";
|
|
121
|
+
tableName: string;
|
|
122
|
+
data: Record<string, any>;
|
|
123
|
+
keyQuery: Record<string, any>;
|
|
124
|
+
partitionKeyFieldName: "id";
|
|
125
|
+
}
|
|
126
|
+
interface IMocodyPreparedDeleteTransaction {
|
|
127
|
+
kind: "delete";
|
|
128
|
+
tableName: string;
|
|
129
|
+
keyQuery: Record<string, any>;
|
|
130
|
+
partitionKeyFieldName: "id";
|
|
131
|
+
}
|
|
132
|
+
type IMocodyPreparedTransaction = IMocodyPreparedCreateTransaction | IMocodyPreparedUpdateTransaction | IMocodyPreparedDeleteTransaction;
|
|
133
|
+
type IFieldAliases<T> = {
|
|
134
|
+
source: keyof T;
|
|
135
|
+
dest: keyof T;
|
|
136
|
+
}[];
|
|
137
|
+
|
|
138
|
+
interface IMocodyCoreEntityModel {
|
|
139
|
+
id: string;
|
|
140
|
+
featureEntity: string;
|
|
141
|
+
dangerouslyExpireAt?: string;
|
|
142
|
+
dangerouslyExpireAtTTL?: string | number | Date;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
declare class MocodyGenericError extends Error {
|
|
146
|
+
constructor(message: string);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare class MocodyUtilBase {
|
|
150
|
+
marshallFromJson(jsonData: Record<string, any>): Record<string, _aws_sdk_client_dynamodb.AttributeValue>;
|
|
151
|
+
unmarshallToJson(dynamoData: Record<string, any>): Record<string, any>;
|
|
152
|
+
getProjectionFields<T = any>({ excludeFields, fields, entityFields, }: {
|
|
153
|
+
excludeFields?: (keyof T)[] | undefined | null;
|
|
154
|
+
fields?: (keyof T)[] | undefined | null;
|
|
155
|
+
entityFields: (keyof T)[] | string[];
|
|
156
|
+
}): (keyof T)[] | undefined;
|
|
157
|
+
alignFormatFieldAlias<T>({ data, fieldAliases, featureEntity, }: {
|
|
158
|
+
data: Partial<T>;
|
|
159
|
+
fieldAliases: IFieldAliases<T> | undefined | null;
|
|
160
|
+
featureEntity: string;
|
|
161
|
+
}): any;
|
|
162
|
+
validateFieldAlias<T>({ data, fieldAliases, featureEntity, }: {
|
|
163
|
+
data: Partial<T>;
|
|
164
|
+
fieldAliases: IFieldAliases<T> | undefined | null;
|
|
165
|
+
featureEntity: string;
|
|
166
|
+
}): void;
|
|
167
|
+
}
|
|
168
|
+
declare const MocodyUtil: MocodyUtilBase;
|
|
169
|
+
|
|
170
|
+
declare class MocodyInitializerDynamo {
|
|
171
|
+
private client;
|
|
172
|
+
private readonly _config;
|
|
173
|
+
constructor(inits: DynamoDBClientConfig);
|
|
174
|
+
getInstance(): Promise<DynamoDBClient>;
|
|
175
|
+
executeStatement(param: ExecuteStatementCommandInput): Promise<_aws_sdk_lib_dynamodb.ExecuteStatementCommandOutput>;
|
|
176
|
+
putItem(params: PutItemCommandInput): Promise<_aws_sdk_client_dynamodb.PutItemCommandOutput>;
|
|
177
|
+
getItem(params: GetItemCommandInput): Promise<_aws_sdk_client_dynamodb.GetItemCommandOutput>;
|
|
178
|
+
transactWriteItems(params: TransactWriteItemsCommandInput): Promise<_aws_sdk_client_dynamodb.TransactWriteItemsCommandOutput>;
|
|
179
|
+
batchWriteItem(params: BatchWriteItemCommandInput): Promise<_aws_sdk_client_dynamodb.BatchWriteItemCommandOutput>;
|
|
180
|
+
batchGetItem(params: BatchGetItemCommandInput): Promise<_aws_sdk_client_dynamodb.BatchGetItemCommandOutput>;
|
|
181
|
+
deleteItem(params: DeleteItemCommandInput): Promise<_aws_sdk_client_dynamodb.DeleteItemCommandOutput>;
|
|
182
|
+
private getInstanceBase;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
declare abstract class RepoModel<T> {
|
|
186
|
+
abstract mocody_getOneById({ dataId, withCondition, }: {
|
|
187
|
+
dataId: string;
|
|
188
|
+
withCondition?: IMocodyFieldCondition<T> | null;
|
|
189
|
+
}): Promise<T | null>;
|
|
190
|
+
abstract mocody_getManyByIds({ dataIds, fields, withCondition, }: {
|
|
191
|
+
dataIds: string[];
|
|
192
|
+
fields?: (keyof T)[] | undefined | null;
|
|
193
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
194
|
+
}): Promise<T[]>;
|
|
195
|
+
abstract mocody_createOne({ data }: {
|
|
196
|
+
data: T;
|
|
197
|
+
}): Promise<T>;
|
|
198
|
+
abstract mocody_prepareTransaction({ transactPrepareInfo, }: {
|
|
199
|
+
transactPrepareInfo: IMocodyTransactionPrepare<T>[];
|
|
200
|
+
}): Promise<IMocodyPreparedTransaction[]>;
|
|
201
|
+
abstract mocody_executeTransaction({ transactInfo }: {
|
|
202
|
+
transactInfo: IMocodyPreparedTransaction[];
|
|
203
|
+
}): Promise<void>;
|
|
204
|
+
abstract mocody_formatForDump({ dataList }: {
|
|
205
|
+
dataList: T[];
|
|
206
|
+
}): Promise<string[]>;
|
|
207
|
+
abstract mocody_validateFormatData({ data }: {
|
|
208
|
+
data: T;
|
|
209
|
+
}): Promise<string>;
|
|
210
|
+
abstract mocody_updateOne({ dataId, updateData, withCondition, }: {
|
|
211
|
+
dataId: string;
|
|
212
|
+
updateData: Partial<T>;
|
|
213
|
+
withCondition?: IMocodyFieldCondition<T> | null;
|
|
214
|
+
}): Promise<T>;
|
|
215
|
+
abstract mocody_getManyByIndex<TData = T, TSortKeyField extends string | number = string>(paramOption: Omit<IMocodyQueryIndexOptions<TData, TSortKeyField>, "pagingParams">): Promise<TData[]>;
|
|
216
|
+
abstract mocody_getManyByIndexPaginate<TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptions<TData, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
217
|
+
abstract mocody_deleteById({ dataId, withCondition, }: {
|
|
218
|
+
dataId: string;
|
|
219
|
+
withCondition?: IMocodyFieldCondition<T> | null;
|
|
220
|
+
}): Promise<T>;
|
|
221
|
+
abstract mocody_getManyWithRelation<TQuery = T, TData = T, TSortKeyField extends string | number = string>(paramOption: Omit<IMocodyQueryIndexOptions<TQuery, TSortKeyField>, "pagingParams">): Promise<TData[]>;
|
|
222
|
+
abstract mocody_getManyWithRelationPaginate<TQuery = T, TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptions<TQuery, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
interface ITableOptions$2<T> {
|
|
226
|
+
dynamoDb: () => MocodyInitializerDynamo;
|
|
227
|
+
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
228
|
+
tableFullName: string;
|
|
229
|
+
partitionKeyFieldName: string;
|
|
230
|
+
sortKeyFieldName: string;
|
|
231
|
+
}
|
|
232
|
+
declare class DynamoManageTable<T> {
|
|
233
|
+
private readonly partitionKeyFieldName;
|
|
234
|
+
private readonly sortKeyFieldName;
|
|
235
|
+
private readonly dynamoDb;
|
|
236
|
+
private readonly tableFullName;
|
|
237
|
+
private readonly secondaryIndexOptions;
|
|
238
|
+
constructor({ dynamoDb, secondaryIndexOptions, tableFullName, partitionKeyFieldName, sortKeyFieldName }: ITableOptions$2<T>);
|
|
239
|
+
private _tbl_getLocalVariables;
|
|
240
|
+
private _tbl_dynamoDb;
|
|
241
|
+
mocody_tbl_getListOfTablesNamesOnline(): Promise<string[] | undefined>;
|
|
242
|
+
mocody_updateTTL({ isEnabled }: {
|
|
243
|
+
isEnabled: boolean;
|
|
244
|
+
}): Promise<_aws_sdk_client_dynamodb.TimeToLiveSpecification | null>;
|
|
245
|
+
mocody_tbl_getTableInfo(): Promise<TableDescription | null>;
|
|
246
|
+
mocody_tbl_checkTableExists(): Promise<boolean>;
|
|
247
|
+
private _allUpdateGlobalSecondaryIndexBase;
|
|
248
|
+
mocody_createOrUpdateDefinedIndexes(): Promise<TableDescription[] | null>;
|
|
249
|
+
mocody_tbl_createTableIfNotExists(): Promise<string | null | undefined>;
|
|
250
|
+
private _getGlobalSecondaryIndexCreationParams;
|
|
251
|
+
mocody_tbl_createTable(): Promise<string | null | undefined>;
|
|
252
|
+
mocody_tbl_deleteGlobalSecondaryIndex(indexName: string): Promise<string | null | undefined>;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
interface IOptions$3<T> {
|
|
256
|
+
schemaDef: Joi.SchemaMap;
|
|
257
|
+
dynamoDbInitializer: () => MocodyInitializerDynamo;
|
|
258
|
+
dataKeyGenerator: () => string;
|
|
259
|
+
featureEntityValue: string;
|
|
260
|
+
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
261
|
+
baseTableName: string;
|
|
262
|
+
strictRequiredFields: (keyof T)[] | string[];
|
|
263
|
+
fieldAliases?: IFieldAliases<T> | undefined | null;
|
|
264
|
+
}
|
|
265
|
+
declare class DynamoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
266
|
+
private readonly _mocody_partitionKeyFieldName;
|
|
267
|
+
private readonly _mocody_sortKeyFieldName;
|
|
268
|
+
private readonly _mocody_featureEntity_Key_Value;
|
|
269
|
+
private readonly _mocody_dynamoDb;
|
|
270
|
+
private readonly _mocody_dataKeyGenerator;
|
|
271
|
+
private readonly _mocody_schema;
|
|
272
|
+
private readonly _mocody_tableFullName;
|
|
273
|
+
private readonly _mocody_strictRequiredFields;
|
|
274
|
+
private readonly _mocody_featureEntityValue;
|
|
275
|
+
private readonly _mocody_secondaryIndexOptions;
|
|
276
|
+
private readonly _mocody_queryFilter;
|
|
277
|
+
private readonly _mocody_queryPartiQlFilter;
|
|
278
|
+
private readonly _mocody_queryScanProcessor;
|
|
279
|
+
private readonly _mocody_queryPartiQlProcessor;
|
|
280
|
+
private readonly _mocody_entityFieldsKeySet;
|
|
281
|
+
private readonly _mocody_fieldAliases;
|
|
282
|
+
private _mocody_tableManager;
|
|
283
|
+
constructor({ schemaDef, dynamoDbInitializer, secondaryIndexOptions, featureEntityValue, baseTableName, strictRequiredFields, dataKeyGenerator, fieldAliases, }: IOptions$3<T>);
|
|
284
|
+
mocody_tableManager(): DynamoManageTable<T>;
|
|
285
|
+
private _mocody_dynamoInit;
|
|
286
|
+
private _mocody_generateDynamoTableKey;
|
|
287
|
+
private _mocody_getLocalVariables;
|
|
288
|
+
private _mocody_getBaseObject;
|
|
289
|
+
private _mocody_checkValidateMustBeAnObjectDataType;
|
|
290
|
+
private _mocody_checkValidateStrictRequiredFields;
|
|
291
|
+
private _mocody_createGenericError;
|
|
292
|
+
private _mocody_withConditionPassed;
|
|
293
|
+
private _mocody_removeDuplicateString;
|
|
294
|
+
private _mocody_allHelpValidateGetValue;
|
|
295
|
+
private _mocody_formatTTL;
|
|
296
|
+
mocody_createOne({ data }: {
|
|
297
|
+
data: T;
|
|
298
|
+
}): Promise<T>;
|
|
299
|
+
mocody_validateFormatData({ data }: {
|
|
300
|
+
data: T;
|
|
301
|
+
}): Promise<string>;
|
|
302
|
+
mocody_formatForDump({ dataList }: {
|
|
303
|
+
dataList: T[];
|
|
304
|
+
}): Promise<string[]>;
|
|
305
|
+
private _mocody_validateReady;
|
|
306
|
+
mocody_getOneById({ dataId, withCondition, }: {
|
|
307
|
+
dataId: string;
|
|
308
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
309
|
+
}): Promise<T | null>;
|
|
310
|
+
mocody_updateOne({ dataId, updateData, withCondition, }: {
|
|
311
|
+
dataId: string;
|
|
312
|
+
updateData: Partial<T>;
|
|
313
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
314
|
+
}): Promise<T>;
|
|
315
|
+
mocody_prepareTransaction({ transactPrepareInfo, }: {
|
|
316
|
+
transactPrepareInfo: IMocodyTransactionPrepare<T>[];
|
|
317
|
+
}): Promise<IMocodyPreparedTransaction[]>;
|
|
318
|
+
mocody_executeTransaction({ transactInfo }: {
|
|
319
|
+
transactInfo: IMocodyPreparedTransaction[];
|
|
320
|
+
}): Promise<void>;
|
|
321
|
+
private _mocody_getProjectionFields;
|
|
322
|
+
mocody_getManyByIds({ dataIds, fields, excludeFields, withCondition, }: {
|
|
323
|
+
dataIds: string[];
|
|
324
|
+
fields?: (keyof T)[] | undefined | null;
|
|
325
|
+
excludeFields?: (keyof T)[] | undefined | null;
|
|
326
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
327
|
+
}): Promise<T[]>;
|
|
328
|
+
private mocody_batchGetManyByIdsBasePrivate;
|
|
329
|
+
mocody_getManyByIndex<TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptionsNoPaging<TData, TSortKeyField>): Promise<TData[]>;
|
|
330
|
+
mocody_getManyByIndexPaginate<TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptions<TData, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
331
|
+
mocody_getManyWithRelation<TQuery = T, TData = T, TSortKeyField extends string | number = string>(paramOption: Omit<IMocodyQueryIndexOptions<TQuery, TSortKeyField>, "pagingParams">): Promise<TData[]>;
|
|
332
|
+
mocody_getManyWithRelationPaginate<TQuery = T, TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptions<TQuery, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
333
|
+
private _mocody_getManyBySecondaryIndexPaginateBase;
|
|
334
|
+
private _mocody_getManyBySecondaryIndexPartiQlPaginateBase;
|
|
335
|
+
mocody_deleteById({ dataId, withCondition }: {
|
|
336
|
+
dataId: string;
|
|
337
|
+
withCondition?: IMocodyFieldCondition<T>;
|
|
338
|
+
}): Promise<T>;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
type IBaseDef<T> = Omit<T & IMocodyCoreEntityModel, "">;
|
|
342
|
+
type IFindOptions = {
|
|
343
|
+
featureEntity: string;
|
|
344
|
+
skip: number | undefined;
|
|
345
|
+
limit: number | undefined;
|
|
346
|
+
selector: Nano__default.MangoSelector;
|
|
347
|
+
fields: string[] | undefined;
|
|
348
|
+
use_index: string;
|
|
349
|
+
sort?: {
|
|
350
|
+
[propName: string]: "asc" | "desc";
|
|
351
|
+
}[];
|
|
352
|
+
};
|
|
353
|
+
interface IBasisOptions {
|
|
354
|
+
authType: "basic";
|
|
355
|
+
couchConfig: {
|
|
356
|
+
host: string;
|
|
357
|
+
password: string;
|
|
358
|
+
username: string;
|
|
359
|
+
databaseName: string;
|
|
360
|
+
port?: number;
|
|
361
|
+
protocol?: "http" | "https";
|
|
362
|
+
};
|
|
363
|
+
indexes?: {
|
|
364
|
+
indexName: string;
|
|
365
|
+
fields: string[];
|
|
366
|
+
}[];
|
|
367
|
+
}
|
|
368
|
+
interface ICookieOptions {
|
|
369
|
+
authType: "cookie";
|
|
370
|
+
couchConfig: {
|
|
371
|
+
host: string;
|
|
372
|
+
databaseName: string;
|
|
373
|
+
port?: number;
|
|
374
|
+
protocol?: "http" | "https";
|
|
375
|
+
cookie: string;
|
|
376
|
+
headers?: {
|
|
377
|
+
[key: string]: string;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
indexes?: {
|
|
381
|
+
indexName: string;
|
|
382
|
+
fields: string[];
|
|
383
|
+
}[];
|
|
384
|
+
}
|
|
385
|
+
interface IProxyOptions {
|
|
386
|
+
authType: "proxy";
|
|
387
|
+
couchConfig: {
|
|
388
|
+
host: string;
|
|
389
|
+
databaseName: string;
|
|
390
|
+
port?: number;
|
|
391
|
+
protocol?: "http" | "https";
|
|
392
|
+
proxyHeaders: {
|
|
393
|
+
[key: string]: string;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
indexes?: {
|
|
397
|
+
indexName: string;
|
|
398
|
+
fields: string[];
|
|
399
|
+
}[];
|
|
400
|
+
}
|
|
401
|
+
type IOptions$2 = IProxyOptions | ICookieOptions | IBasisOptions;
|
|
402
|
+
declare class MocodyInitializerCouch {
|
|
403
|
+
private _databaseInstance;
|
|
404
|
+
private _documentScope;
|
|
405
|
+
private readonly baseConfig;
|
|
406
|
+
constructor(baseConfig: IOptions$2);
|
|
407
|
+
deleteIndex({ ddoc, name }: {
|
|
408
|
+
ddoc: string;
|
|
409
|
+
name: string;
|
|
410
|
+
}): Promise<{
|
|
411
|
+
ok: boolean;
|
|
412
|
+
}>;
|
|
413
|
+
getIndexes(): Promise<{
|
|
414
|
+
indexes: {
|
|
415
|
+
ddoc: string;
|
|
416
|
+
name: string;
|
|
417
|
+
type: string;
|
|
418
|
+
def: {
|
|
419
|
+
fields: {
|
|
420
|
+
[field: string]: "asc" | "desc";
|
|
421
|
+
}[];
|
|
422
|
+
};
|
|
423
|
+
}[];
|
|
424
|
+
total_rows: number;
|
|
425
|
+
}>;
|
|
426
|
+
findPartitionedDocs({ featureEntity, selector, fields, use_index, sort, limit, skip }: IFindOptions): Promise<Nano__default.MangoResponse<IBaseDef<unknown>>>;
|
|
427
|
+
getById({ nativeId }: {
|
|
428
|
+
nativeId: string;
|
|
429
|
+
}): Promise<(Nano__default.DocumentGetResponse & IBaseDef<unknown>) | null>;
|
|
430
|
+
getManyByIds({ nativeIds }: {
|
|
431
|
+
nativeIds: string[];
|
|
432
|
+
}): Promise<Nano__default.DocumentListResponse<IBaseDef<unknown>>>;
|
|
433
|
+
createDoc({ validatedData }: {
|
|
434
|
+
validatedData: any;
|
|
435
|
+
}): Promise<Nano__default.DocumentInsertResponse>;
|
|
436
|
+
updateDoc({ docRev, validatedData }: {
|
|
437
|
+
docRev: string;
|
|
438
|
+
validatedData: any;
|
|
439
|
+
}): Promise<Nano__default.DocumentInsertResponse>;
|
|
440
|
+
getList({ featureEntity, size, skip }: {
|
|
441
|
+
featureEntity: string;
|
|
442
|
+
size?: number | null;
|
|
443
|
+
skip?: number | null;
|
|
444
|
+
}): Promise<Nano__default.DocumentListResponse<IBaseDef<unknown>>>;
|
|
445
|
+
deleteById({ docRev, nativeId }: {
|
|
446
|
+
docRev: string;
|
|
447
|
+
nativeId: string;
|
|
448
|
+
}): Promise<Nano__default.DocumentDestroyResponse>;
|
|
449
|
+
private getDocInstance;
|
|
450
|
+
createIndex({ indexName, fields, dbx, }: {
|
|
451
|
+
indexName: string;
|
|
452
|
+
fields: string[];
|
|
453
|
+
dbx?: Nano__default.DocumentScope<IBaseDef<any>>;
|
|
454
|
+
}): Promise<{
|
|
455
|
+
id: string;
|
|
456
|
+
name: string;
|
|
457
|
+
result: string;
|
|
458
|
+
}>;
|
|
459
|
+
checkDatabaseExists(databaseName?: string): Promise<any>;
|
|
460
|
+
createDatabase(): Promise<Nano__default.DatabaseCreateResponse>;
|
|
461
|
+
getInstance(): Promise<Nano__default.ServerScope>;
|
|
462
|
+
private getInstanceBase;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
interface ITableOptions$1<T> {
|
|
466
|
+
couchDb: () => MocodyInitializerCouch;
|
|
467
|
+
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
468
|
+
tableFullName: string;
|
|
469
|
+
partitionKeyFieldName: string;
|
|
470
|
+
sortKeyFieldName: string;
|
|
471
|
+
}
|
|
472
|
+
declare class CouchManageTable<T> {
|
|
473
|
+
private readonly partitionKeyFieldName;
|
|
474
|
+
private readonly sortKeyFieldName;
|
|
475
|
+
private readonly couchDb;
|
|
476
|
+
private readonly tableFullName;
|
|
477
|
+
private readonly secondaryIndexOptions;
|
|
478
|
+
constructor({ couchDb, secondaryIndexOptions, tableFullName, partitionKeyFieldName, sortKeyFieldName }: ITableOptions$1<T>);
|
|
479
|
+
private _trickLinter;
|
|
480
|
+
private _mocody_getInstance;
|
|
481
|
+
mocody_createIndex({ indexName, fields }: {
|
|
482
|
+
indexName: string;
|
|
483
|
+
fields: string[];
|
|
484
|
+
}): Promise<{
|
|
485
|
+
id: string;
|
|
486
|
+
name: string;
|
|
487
|
+
result: string;
|
|
488
|
+
}>;
|
|
489
|
+
mocody_clearAllIndexes(): Promise<{
|
|
490
|
+
deletedIndexes: any[];
|
|
491
|
+
}>;
|
|
492
|
+
mocody_getIndexes(): Promise<{
|
|
493
|
+
indexes: {
|
|
494
|
+
ddoc: string;
|
|
495
|
+
name: string;
|
|
496
|
+
type: string;
|
|
497
|
+
def: {
|
|
498
|
+
fields: {
|
|
499
|
+
[field: string]: "asc" | "desc";
|
|
500
|
+
}[];
|
|
501
|
+
};
|
|
502
|
+
}[];
|
|
503
|
+
total_rows: number;
|
|
504
|
+
}>;
|
|
505
|
+
mocody_createDatabase(): Promise<Nano.DatabaseCreateResponse>;
|
|
506
|
+
mocody_createDefinedIndexes(): Promise<string[]>;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
interface IOptions$1<T> {
|
|
510
|
+
schemaDef: Joi.SchemaMap;
|
|
511
|
+
couchDbInitializer: () => MocodyInitializerCouch;
|
|
512
|
+
dataKeyGenerator: () => string;
|
|
513
|
+
featureEntityValue: string;
|
|
514
|
+
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
515
|
+
baseTableName: string;
|
|
516
|
+
strictRequiredFields: (keyof T)[] | string[];
|
|
517
|
+
fieldAliases?: IFieldAliases<T> | undefined | null;
|
|
518
|
+
}
|
|
519
|
+
declare class CouchDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
520
|
+
private readonly _mocody_partitionKeyFieldName;
|
|
521
|
+
private readonly _mocody_sortKeyFieldName;
|
|
522
|
+
private readonly _mocody_operationNotSuccessful;
|
|
523
|
+
private readonly _mocody_entityFieldsKeySet;
|
|
524
|
+
private readonly _mocody_couchDb;
|
|
525
|
+
private readonly _mocody_dataKeyGenerator;
|
|
526
|
+
private readonly _mocody_schema;
|
|
527
|
+
private readonly _mocody_tableFullName;
|
|
528
|
+
private readonly _mocody_strictRequiredFields;
|
|
529
|
+
private readonly _mocody_featureEntityValue;
|
|
530
|
+
private readonly _mocody_secondaryIndexOptions;
|
|
531
|
+
private readonly _mocody_filterQueryOperation;
|
|
532
|
+
private readonly _mocody_fieldAliases;
|
|
533
|
+
private _mocody_tableManager;
|
|
534
|
+
constructor({ schemaDef, couchDbInitializer, secondaryIndexOptions, featureEntityValue, baseTableName, strictRequiredFields, dataKeyGenerator, fieldAliases, }: IOptions$1<T>);
|
|
535
|
+
mocody_tableManager(): CouchManageTable<T>;
|
|
536
|
+
private _mocody_generateDynamoTableKey;
|
|
537
|
+
private _mocody_couchDbInstance;
|
|
538
|
+
private _mocody_getLocalVariables;
|
|
539
|
+
private _mocody_getProjectionFields;
|
|
540
|
+
private _mocody_stripNonRequiredOutputData;
|
|
541
|
+
private _mocody_getNativePouchId;
|
|
542
|
+
private _mocody_getBaseObject;
|
|
543
|
+
private _mocody_withConditionPassed;
|
|
544
|
+
private _mocody_checkValidateMustBeAnObjectDataType;
|
|
545
|
+
private _mocody_checkValidateStrictRequiredFields;
|
|
546
|
+
private _mocody_removeDuplicateString;
|
|
547
|
+
private _mocody_allHelpValidateGetValue;
|
|
548
|
+
private _mocody_createGenericError;
|
|
549
|
+
mocody_createOne({ data }: {
|
|
550
|
+
data: T;
|
|
551
|
+
}): Promise<T>;
|
|
552
|
+
mocody_formatForDump({ dataList }: {
|
|
553
|
+
dataList: T[];
|
|
554
|
+
}): Promise<string[]>;
|
|
555
|
+
mocody_validateFormatData({ data }: {
|
|
556
|
+
data: T;
|
|
557
|
+
}): Promise<string>;
|
|
558
|
+
private _mocody_validateReady;
|
|
559
|
+
mocody_getAll({ size, skip }?: {
|
|
560
|
+
size?: number | undefined | null;
|
|
561
|
+
skip?: number | undefined | null;
|
|
562
|
+
}): Promise<T[]>;
|
|
563
|
+
mocody_getOneById({ dataId, withCondition, }: {
|
|
564
|
+
dataId: string;
|
|
565
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
566
|
+
}): Promise<T | null>;
|
|
567
|
+
mocody_updateOne({ dataId, updateData, withCondition, }: {
|
|
568
|
+
dataId: string;
|
|
569
|
+
updateData: Partial<T>;
|
|
570
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
571
|
+
}): Promise<T>;
|
|
572
|
+
mocody_prepareTransaction({ transactPrepareInfo, }: {
|
|
573
|
+
transactPrepareInfo: IMocodyTransactionPrepare<T>[];
|
|
574
|
+
}): Promise<IMocodyPreparedTransaction[]>;
|
|
575
|
+
mocody_executeTransaction({ transactInfo }: {
|
|
576
|
+
transactInfo: IMocodyPreparedTransaction[];
|
|
577
|
+
}): Promise<void>;
|
|
578
|
+
mocody_getManyByIds({ dataIds, fields, excludeFields, withCondition, }: {
|
|
579
|
+
dataIds: string[];
|
|
580
|
+
fields?: (keyof T)[] | undefined | null;
|
|
581
|
+
excludeFields?: (keyof T)[] | undefined | null;
|
|
582
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
583
|
+
}): Promise<T[]>;
|
|
584
|
+
mocody_getManyByIndex<TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptionsNoPaging<TData, TSortKeyField>): Promise<TData[]>;
|
|
585
|
+
mocody_getManyByIndexPaginate<TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptions<TData, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
586
|
+
mocody_getManyWithRelation<TQuery = T, TData = T, TSortKeyField extends string | number = string>(paramOption: Omit<IMocodyQueryIndexOptions<TQuery, TSortKeyField>, "pagingParams">): Promise<TData[]>;
|
|
587
|
+
mocody_getManyWithRelationPaginate<TQuery = T, TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptions<TQuery, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
588
|
+
private _mocody_getManyBySecondaryIndexPaginateBase;
|
|
589
|
+
mocody_deleteById({ dataId, withCondition, }: {
|
|
590
|
+
dataId: string;
|
|
591
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
592
|
+
}): Promise<T>;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
interface IDbOptions {
|
|
596
|
+
uri: string;
|
|
597
|
+
databaseName: string;
|
|
598
|
+
options?: MongoClientOptions;
|
|
599
|
+
}
|
|
600
|
+
declare class MocodyInitializerMongo {
|
|
601
|
+
private _mongoClient;
|
|
602
|
+
private readonly _inits;
|
|
603
|
+
constructor(inits: IDbOptions);
|
|
604
|
+
private getInstance;
|
|
605
|
+
getNewSession(): Promise<mongodb.ClientSession>;
|
|
606
|
+
getCustomCollectionInstance<T = any>(collectionName: string): Promise<mongodb.Collection<T & Document>>;
|
|
607
|
+
close(): Promise<void>;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
interface ITableOptions<T> {
|
|
611
|
+
mongoDb: () => MocodyInitializerMongo;
|
|
612
|
+
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
613
|
+
tableFullName: string;
|
|
614
|
+
partitionKeyFieldName: string;
|
|
615
|
+
sortKeyFieldName: string;
|
|
616
|
+
}
|
|
617
|
+
declare class MongoManageTable<T> {
|
|
618
|
+
private readonly partitionKeyFieldName;
|
|
619
|
+
private readonly sortKeyFieldName;
|
|
620
|
+
private readonly mongoDb;
|
|
621
|
+
private readonly tableFullName;
|
|
622
|
+
private readonly secondaryIndexOptions;
|
|
623
|
+
constructor({ mongoDb, secondaryIndexOptions, tableFullName, partitionKeyFieldName, sortKeyFieldName }: ITableOptions<T>);
|
|
624
|
+
private _trickLinter;
|
|
625
|
+
private _mocody_getInstance;
|
|
626
|
+
mocody_createIndex({ indexName, fields }: {
|
|
627
|
+
indexName: string;
|
|
628
|
+
fields: string[];
|
|
629
|
+
}): Promise<string>;
|
|
630
|
+
mocody_clearAllIndexes(): Promise<{
|
|
631
|
+
indexes: mongodb.IndexDescriptionInfo[];
|
|
632
|
+
dropedIndexes: Record<string, any>;
|
|
633
|
+
}>;
|
|
634
|
+
mocody_getIndexes(): Promise<mongodb.IndexDescriptionInfo[]>;
|
|
635
|
+
mocody_createTTL(): Promise<string>;
|
|
636
|
+
mocody_createDefinedIndexes(): Promise<string[]>;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
interface IOptions<T> {
|
|
640
|
+
schemaDef: Joi.SchemaMap;
|
|
641
|
+
mongoDbInitializer: () => MocodyInitializerMongo;
|
|
642
|
+
dataKeyGenerator: () => string;
|
|
643
|
+
featureEntityValue: string;
|
|
644
|
+
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
645
|
+
baseTableName: string;
|
|
646
|
+
strictRequiredFields: (keyof T)[] | string[];
|
|
647
|
+
fieldAliases?: IFieldAliases<T> | undefined | null;
|
|
648
|
+
}
|
|
649
|
+
declare class MongoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
650
|
+
private readonly _mocody_partitionKeyFieldName;
|
|
651
|
+
private readonly _mocody_sortKeyFieldName;
|
|
652
|
+
private readonly _mocody_operationNotSuccessful;
|
|
653
|
+
private readonly _mocody_entityFieldsKeySet;
|
|
654
|
+
private readonly _mocody_mongoDb;
|
|
655
|
+
private readonly _mocody_dataKeyGenerator;
|
|
656
|
+
private readonly _mocody_schema;
|
|
657
|
+
private readonly _mocody_tableFullName;
|
|
658
|
+
private readonly _mocody_strictRequiredFields;
|
|
659
|
+
private readonly _mocody_featureEntityValue;
|
|
660
|
+
private readonly _mocody_secondaryIndexOptions;
|
|
661
|
+
private readonly _mocody_filterQueryOperation;
|
|
662
|
+
private readonly _mocody_fieldAliases;
|
|
663
|
+
private _mocody_tableManager;
|
|
664
|
+
constructor({ schemaDef, mongoDbInitializer, secondaryIndexOptions, featureEntityValue, baseTableName, strictRequiredFields, dataKeyGenerator, fieldAliases, }: IOptions<T>);
|
|
665
|
+
mocody_tableManager(): MongoManageTable<T>;
|
|
666
|
+
private _mocody_generateDynamoTableKey;
|
|
667
|
+
private _mocody_getDbInstance;
|
|
668
|
+
private _mocody_getDbInstanceDefined;
|
|
669
|
+
private _mocody_getLocalVariables;
|
|
670
|
+
private _mocody_getNativeMongoId;
|
|
671
|
+
private _mocody_getBaseObject;
|
|
672
|
+
private _mocody_withConditionPassed;
|
|
673
|
+
private _mocody_checkValidateMustBeAnObjectDataType;
|
|
674
|
+
private _mocody_checkValidateStrictRequiredFields;
|
|
675
|
+
private _mocody_removeDuplicateString;
|
|
676
|
+
private _mocody_getProjectionFields;
|
|
677
|
+
private _mocody_toMongoProjection;
|
|
678
|
+
private _mocody_allHelpValidateGetValue;
|
|
679
|
+
private _mocody_createGenericError;
|
|
680
|
+
mocody_getOneById({ dataId, withCondition, }: {
|
|
681
|
+
dataId: string;
|
|
682
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
683
|
+
}): Promise<T | null>;
|
|
684
|
+
mocody_getManyByIds({ dataIds, fields, excludeFields, withCondition, }: {
|
|
685
|
+
dataIds: string[];
|
|
686
|
+
fields?: (keyof T)[] | undefined | null;
|
|
687
|
+
excludeFields?: (keyof T)[] | undefined | null;
|
|
688
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
689
|
+
}): Promise<T[]>;
|
|
690
|
+
mocody_formatForDump({ dataList }: {
|
|
691
|
+
dataList: T[];
|
|
692
|
+
}): Promise<string[]>;
|
|
693
|
+
mocody_validateFormatData({ data }: {
|
|
694
|
+
data: T;
|
|
695
|
+
}): Promise<string>;
|
|
696
|
+
mocody_createOne({ data }: {
|
|
697
|
+
data: T;
|
|
698
|
+
}): Promise<T>;
|
|
699
|
+
private _mocody_validateReady;
|
|
700
|
+
private _mocody_formatTTL;
|
|
701
|
+
mocody_updateOne({ dataId, updateData, withCondition, }: {
|
|
702
|
+
dataId: string;
|
|
703
|
+
updateData: Partial<T>;
|
|
704
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
705
|
+
}): Promise<T>;
|
|
706
|
+
mocody_prepareTransaction({ transactPrepareInfo, }: {
|
|
707
|
+
transactPrepareInfo: IMocodyTransactionPrepare<T>[];
|
|
708
|
+
}): Promise<IMocodyPreparedTransaction[]>;
|
|
709
|
+
mocody_executeTransaction({ transactInfo }: {
|
|
710
|
+
transactInfo: IMocodyPreparedTransaction[];
|
|
711
|
+
}): Promise<void>;
|
|
712
|
+
mocody_getManyByIndex<TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptionsNoPaging<TData, TSortKeyField>): Promise<TData[]>;
|
|
713
|
+
mocody_getManyByIndexPaginate<TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptions<TData, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
714
|
+
mocody_getManyWithRelation<TQuery = T, TData = T, TSortKeyField extends string | number = string>(paramOption: Omit<IMocodyQueryIndexOptions<TQuery, TSortKeyField>, "pagingParams">): Promise<TData[]>;
|
|
715
|
+
mocody_getManyWithRelationPaginate<TQuery = T, TData = T, TSortKeyField extends string | number = string>(paramOption: IMocodyQueryIndexOptions<TQuery, TSortKeyField>): Promise<IMocodyPagingResult<TData[]>>;
|
|
716
|
+
private _mocody_getManyBySecondaryIndexPaginateBase;
|
|
717
|
+
mocody_deleteById({ dataId, withCondition, }: {
|
|
718
|
+
dataId: string;
|
|
719
|
+
withCondition?: IMocodyFieldCondition<T> | undefined | null;
|
|
720
|
+
}): Promise<T>;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
export { CouchDataOperation, DynamoDataOperation, type IFieldAliases, type IMocodyCoreEntityModel, type IMocodyFieldCondition, type IMocodyIndexDefinition, type IMocodyKeyConditionParams, type IMocodyPagingParams, type IMocodyPagingResult, type IMocodyQueryConditionParams, type IMocodyQueryDefinition, type IMocodyQueryIndexOptions, type IMocodyQueryIndexOptionsNoPaging, MocodyGenericError, MocodyInitializerCouch, MocodyInitializerDynamo, MocodyInitializerMongo, MocodyUtil, MongoDataOperation };
|