mocody 0.6.8 → 0.7.0
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 +393 -362
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +2 -0
- package/package.json +2 -7
package/dist/index.d.cts
CHANGED
|
@@ -130,7 +130,7 @@ interface IMocodyPreparedDeleteTransaction {
|
|
|
130
130
|
partitionKeyFieldName: "id";
|
|
131
131
|
}
|
|
132
132
|
type IMocodyPreparedTransaction = IMocodyPreparedCreateTransaction | IMocodyPreparedUpdateTransaction | IMocodyPreparedDeleteTransaction;
|
|
133
|
-
type
|
|
133
|
+
type IMocodyFieldAliases<T> = {
|
|
134
134
|
source: keyof T;
|
|
135
135
|
dest: keyof T;
|
|
136
136
|
}[];
|
|
@@ -156,12 +156,12 @@ declare class MocodyUtilBase {
|
|
|
156
156
|
}): (keyof T)[] | undefined;
|
|
157
157
|
alignFormatFieldAlias<T>({ data, fieldAliases, featureEntity, }: {
|
|
158
158
|
data: Partial<T>;
|
|
159
|
-
fieldAliases:
|
|
159
|
+
fieldAliases: IMocodyFieldAliases<T> | undefined | null;
|
|
160
160
|
featureEntity: string;
|
|
161
161
|
}): any;
|
|
162
162
|
validateFieldAlias<T>({ data, fieldAliases, featureEntity, }: {
|
|
163
163
|
data: Partial<T>;
|
|
164
|
-
fieldAliases:
|
|
164
|
+
fieldAliases: IMocodyFieldAliases<T> | undefined | null;
|
|
165
165
|
featureEntity: string;
|
|
166
166
|
}): void;
|
|
167
167
|
}
|
|
@@ -260,7 +260,7 @@ interface IOptions$3<T> {
|
|
|
260
260
|
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
261
261
|
baseTableName: string;
|
|
262
262
|
strictRequiredFields: (keyof T)[] | string[];
|
|
263
|
-
fieldAliases?:
|
|
263
|
+
fieldAliases?: IMocodyFieldAliases<T> | undefined | null;
|
|
264
264
|
}
|
|
265
265
|
declare class DynamoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
266
266
|
private readonly _mocody_partitionKeyFieldName;
|
|
@@ -514,7 +514,7 @@ interface IOptions$1<T> {
|
|
|
514
514
|
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
515
515
|
baseTableName: string;
|
|
516
516
|
strictRequiredFields: (keyof T)[] | string[];
|
|
517
|
-
fieldAliases?:
|
|
517
|
+
fieldAliases?: IMocodyFieldAliases<T> | undefined | null;
|
|
518
518
|
}
|
|
519
519
|
declare class CouchDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
520
520
|
private readonly _mocody_partitionKeyFieldName;
|
|
@@ -644,7 +644,7 @@ interface IOptions<T> {
|
|
|
644
644
|
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
645
645
|
baseTableName: string;
|
|
646
646
|
strictRequiredFields: (keyof T)[] | string[];
|
|
647
|
-
fieldAliases?:
|
|
647
|
+
fieldAliases?: IMocodyFieldAliases<T> | undefined | null;
|
|
648
648
|
}
|
|
649
649
|
declare class MongoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
650
650
|
private readonly _mocody_partitionKeyFieldName;
|
|
@@ -720,4 +720,4 @@ declare class MongoDataOperation<T> extends RepoModel<T> implements RepoModel<T>
|
|
|
720
720
|
}): Promise<T>;
|
|
721
721
|
}
|
|
722
722
|
|
|
723
|
-
export { CouchDataOperation, DynamoDataOperation, type
|
|
723
|
+
export { CouchDataOperation, DynamoDataOperation, type IMocodyCoreEntityModel, type IMocodyFieldAliases, type IMocodyFieldCondition, type IMocodyIndexDefinition, type IMocodyKeyConditionParams, type IMocodyPagingParams, type IMocodyPagingResult, type IMocodyPreparedTransaction, type IMocodyQueryConditionParams, type IMocodyQueryDefinition, type IMocodyQueryIndexOptions, type IMocodyQueryIndexOptionsNoPaging, MocodyGenericError, MocodyInitializerCouch, MocodyInitializerDynamo, MocodyInitializerMongo, MocodyUtil, MongoDataOperation };
|
package/dist/index.d.ts
CHANGED
|
@@ -130,7 +130,7 @@ interface IMocodyPreparedDeleteTransaction {
|
|
|
130
130
|
partitionKeyFieldName: "id";
|
|
131
131
|
}
|
|
132
132
|
type IMocodyPreparedTransaction = IMocodyPreparedCreateTransaction | IMocodyPreparedUpdateTransaction | IMocodyPreparedDeleteTransaction;
|
|
133
|
-
type
|
|
133
|
+
type IMocodyFieldAliases<T> = {
|
|
134
134
|
source: keyof T;
|
|
135
135
|
dest: keyof T;
|
|
136
136
|
}[];
|
|
@@ -156,12 +156,12 @@ declare class MocodyUtilBase {
|
|
|
156
156
|
}): (keyof T)[] | undefined;
|
|
157
157
|
alignFormatFieldAlias<T>({ data, fieldAliases, featureEntity, }: {
|
|
158
158
|
data: Partial<T>;
|
|
159
|
-
fieldAliases:
|
|
159
|
+
fieldAliases: IMocodyFieldAliases<T> | undefined | null;
|
|
160
160
|
featureEntity: string;
|
|
161
161
|
}): any;
|
|
162
162
|
validateFieldAlias<T>({ data, fieldAliases, featureEntity, }: {
|
|
163
163
|
data: Partial<T>;
|
|
164
|
-
fieldAliases:
|
|
164
|
+
fieldAliases: IMocodyFieldAliases<T> | undefined | null;
|
|
165
165
|
featureEntity: string;
|
|
166
166
|
}): void;
|
|
167
167
|
}
|
|
@@ -260,7 +260,7 @@ interface IOptions$3<T> {
|
|
|
260
260
|
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
261
261
|
baseTableName: string;
|
|
262
262
|
strictRequiredFields: (keyof T)[] | string[];
|
|
263
|
-
fieldAliases?:
|
|
263
|
+
fieldAliases?: IMocodyFieldAliases<T> | undefined | null;
|
|
264
264
|
}
|
|
265
265
|
declare class DynamoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
266
266
|
private readonly _mocody_partitionKeyFieldName;
|
|
@@ -514,7 +514,7 @@ interface IOptions$1<T> {
|
|
|
514
514
|
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
515
515
|
baseTableName: string;
|
|
516
516
|
strictRequiredFields: (keyof T)[] | string[];
|
|
517
|
-
fieldAliases?:
|
|
517
|
+
fieldAliases?: IMocodyFieldAliases<T> | undefined | null;
|
|
518
518
|
}
|
|
519
519
|
declare class CouchDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
520
520
|
private readonly _mocody_partitionKeyFieldName;
|
|
@@ -644,7 +644,7 @@ interface IOptions<T> {
|
|
|
644
644
|
secondaryIndexOptions: IMocodyIndexDefinition<T>[];
|
|
645
645
|
baseTableName: string;
|
|
646
646
|
strictRequiredFields: (keyof T)[] | string[];
|
|
647
|
-
fieldAliases?:
|
|
647
|
+
fieldAliases?: IMocodyFieldAliases<T> | undefined | null;
|
|
648
648
|
}
|
|
649
649
|
declare class MongoDataOperation<T> extends RepoModel<T> implements RepoModel<T> {
|
|
650
650
|
private readonly _mocody_partitionKeyFieldName;
|
|
@@ -720,4 +720,4 @@ declare class MongoDataOperation<T> extends RepoModel<T> implements RepoModel<T>
|
|
|
720
720
|
}): Promise<T>;
|
|
721
721
|
}
|
|
722
722
|
|
|
723
|
-
export { CouchDataOperation, DynamoDataOperation, type
|
|
723
|
+
export { CouchDataOperation, DynamoDataOperation, type IMocodyCoreEntityModel, type IMocodyFieldAliases, type IMocodyFieldCondition, type IMocodyIndexDefinition, type IMocodyKeyConditionParams, type IMocodyPagingParams, type IMocodyPagingResult, type IMocodyPreparedTransaction, type IMocodyQueryConditionParams, type IMocodyQueryDefinition, type IMocodyQueryIndexOptions, type IMocodyQueryIndexOptionsNoPaging, MocodyGenericError, MocodyInitializerCouch, MocodyInitializerDynamo, MocodyInitializerMongo, MocodyUtil, MongoDataOperation };
|
package/dist/index.js
CHANGED
|
@@ -3171,6 +3171,8 @@ var DynamoDataOperation = class extends RepoModel {
|
|
|
3171
3171
|
ExpressionAttributeValues: expressionAttributeValues
|
|
3172
3172
|
}
|
|
3173
3173
|
});
|
|
3174
|
+
} else {
|
|
3175
|
+
throw this._mocody_createGenericError("Invalid transaction kind");
|
|
3174
3176
|
}
|
|
3175
3177
|
}
|
|
3176
3178
|
await this._mocody_dynamoInit().transactWriteItems(transactData);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mocody",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Implementation of single table design, and unified query access for MongoDB, CouchDB, and dynamoDB",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -22,16 +22,11 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "npx rimraf ./dist && tsup",
|
|
24
24
|
"prepublishOnly_00": "npm run build",
|
|
25
|
-
"build:esm": "tsc -p tsconfig.esm.json",
|
|
26
|
-
"build:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > dist/commonjs/package.json",
|
|
27
|
-
"build:01": "rimraf dist && npm run build:esm && npm run build:cjs",
|
|
28
25
|
"build:00": "npx rimraf ./dist && npx tsc -b",
|
|
29
26
|
"prepare": "npm run build",
|
|
30
27
|
"version": "npm run build",
|
|
31
28
|
"pub": "npm publish",
|
|
32
29
|
"build-dev": "npx rimraf ./dist && npx tsc -b",
|
|
33
|
-
"eslint": "eslint 'src/**/*.ts'",
|
|
34
|
-
"eslint:fix": "eslint --fix 'src/**/*.ts'",
|
|
35
30
|
"prettier-format-fix": "prettier --write \"src/**/*.{ts,js,json}\"",
|
|
36
31
|
"prettier-different": "prettier --list-different \"src/**/*.{ts,js,json}\"",
|
|
37
32
|
"prettier-unformatted": "prettier --check \"src/**/*.{ts,js,json}\"",
|
|
@@ -72,7 +67,7 @@
|
|
|
72
67
|
],
|
|
73
68
|
"dts": true,
|
|
74
69
|
"clean": true,
|
|
75
|
-
"splitting":
|
|
70
|
+
"splitting": false,
|
|
76
71
|
"outDir": "dist"
|
|
77
72
|
},
|
|
78
73
|
"dependencies": {
|