sasat 0.22.2 → 0.22.4
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.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/package.json +8 -11
package/dist/index.d.cts
CHANGED
|
@@ -290,7 +290,7 @@ type MakeConditionArg<Context = unknown, Entity = unknown> = {
|
|
|
290
290
|
parent: Partial<Entity>;
|
|
291
291
|
parentTableAlias?: undefined;
|
|
292
292
|
});
|
|
293
|
-
type MakeCondition<Context, Entity =
|
|
293
|
+
type MakeCondition<Context, Entity = any> = (arg: MakeConditionArg<Context, Entity>) => BooleanValueExpression;
|
|
294
294
|
type RelationInfo<Context = unknown> = {
|
|
295
295
|
table: string;
|
|
296
296
|
condition: MakeCondition<Context>;
|
|
@@ -346,7 +346,7 @@ type QueryOptions = {
|
|
|
346
346
|
};
|
|
347
347
|
declare abstract class SasatDBDatasource<Entity extends EntityType, Identifiable extends object, Creatable extends EntityType, Updatable extends Identifiable, EntityFields extends Fields<Entity>, QueryResult extends Partial<Entity> & Identifiable> implements Repository<Entity, Identifiable, Creatable, Updatable> {
|
|
348
348
|
protected client: SQLExecutor;
|
|
349
|
-
protected abstract relationMap: RelationMap<
|
|
349
|
+
protected abstract relationMap: RelationMap<any>;
|
|
350
350
|
protected abstract tableInfo: TableInfo;
|
|
351
351
|
abstract readonly tableName: string;
|
|
352
352
|
abstract readonly fields: string[];
|
|
@@ -378,7 +378,7 @@ declare abstract class SasatDBDatasource<Entity extends EntityType, Identifiable
|
|
|
378
378
|
private executeQuery;
|
|
379
379
|
private createIdentifiableExpression;
|
|
380
380
|
getRelationMap(): {
|
|
381
|
-
[to: string]: RelationInfo<
|
|
381
|
+
[to: string]: RelationInfo<any>;
|
|
382
382
|
};
|
|
383
383
|
protected fieldToColumn(fields: string[]): string[];
|
|
384
384
|
}
|
|
@@ -1170,7 +1170,7 @@ declare const Sql: {
|
|
|
1170
1170
|
};
|
|
1171
1171
|
//#endregion
|
|
1172
1172
|
//#region src/runtime/gqlResolveInfoToField.d.ts
|
|
1173
|
-
declare const gqlResolveInfoToField: <T extends Fields<
|
|
1173
|
+
declare const gqlResolveInfoToField: <T extends Fields<any> = Fields<unknown>>(info: GraphQLResolveInfo) => T;
|
|
1174
1174
|
//#endregion
|
|
1175
1175
|
//#region src/runtime/id.d.ts
|
|
1176
1176
|
type NumberIdEncoder = {
|
package/dist/index.d.mts
CHANGED
|
@@ -290,7 +290,7 @@ type MakeConditionArg<Context = unknown, Entity = unknown> = {
|
|
|
290
290
|
parent: Partial<Entity>;
|
|
291
291
|
parentTableAlias?: undefined;
|
|
292
292
|
});
|
|
293
|
-
type MakeCondition<Context, Entity =
|
|
293
|
+
type MakeCondition<Context, Entity = any> = (arg: MakeConditionArg<Context, Entity>) => BooleanValueExpression;
|
|
294
294
|
type RelationInfo<Context = unknown> = {
|
|
295
295
|
table: string;
|
|
296
296
|
condition: MakeCondition<Context>;
|
|
@@ -346,7 +346,7 @@ type QueryOptions = {
|
|
|
346
346
|
};
|
|
347
347
|
declare abstract class SasatDBDatasource<Entity extends EntityType, Identifiable extends object, Creatable extends EntityType, Updatable extends Identifiable, EntityFields extends Fields<Entity>, QueryResult extends Partial<Entity> & Identifiable> implements Repository<Entity, Identifiable, Creatable, Updatable> {
|
|
348
348
|
protected client: SQLExecutor;
|
|
349
|
-
protected abstract relationMap: RelationMap<
|
|
349
|
+
protected abstract relationMap: RelationMap<any>;
|
|
350
350
|
protected abstract tableInfo: TableInfo;
|
|
351
351
|
abstract readonly tableName: string;
|
|
352
352
|
abstract readonly fields: string[];
|
|
@@ -378,7 +378,7 @@ declare abstract class SasatDBDatasource<Entity extends EntityType, Identifiable
|
|
|
378
378
|
private executeQuery;
|
|
379
379
|
private createIdentifiableExpression;
|
|
380
380
|
getRelationMap(): {
|
|
381
|
-
[to: string]: RelationInfo<
|
|
381
|
+
[to: string]: RelationInfo<any>;
|
|
382
382
|
};
|
|
383
383
|
protected fieldToColumn(fields: string[]): string[];
|
|
384
384
|
}
|
|
@@ -1170,7 +1170,7 @@ declare const Sql: {
|
|
|
1170
1170
|
};
|
|
1171
1171
|
//#endregion
|
|
1172
1172
|
//#region src/runtime/gqlResolveInfoToField.d.ts
|
|
1173
|
-
declare const gqlResolveInfoToField: <T extends Fields<
|
|
1173
|
+
declare const gqlResolveInfoToField: <T extends Fields<any> = Fields<unknown>>(info: GraphQLResolveInfo) => T;
|
|
1174
1174
|
//#endregion
|
|
1175
1175
|
//#region src/runtime/id.d.ts
|
|
1176
1176
|
type NumberIdEncoder = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sasat",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.4",
|
|
4
4
|
"repository": "https://github.com/nin138/sasat.git",
|
|
5
5
|
"author": "nin138 <ninian138@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"test:base": "node --experimental-vm-modules node_modules/.bin/jest",
|
|
19
19
|
"resetdb": "docker-compose exec db sh -c \"mysql -u root < /docker-entrypoint-initdb.d/temp.sql\"",
|
|
20
20
|
"prepare": "yarn build && husky install",
|
|
21
|
-
"sasat": "yarn env-cmd tsx src/cli/index.ts",
|
|
21
|
+
"sasat": "yarn env-cmd npx tsx src/cli/index.ts",
|
|
22
22
|
"server": "yarn env-cmd ts-node-esm -r tsconfig-paths/register ./test/testServer.ts"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
@@ -37,22 +37,19 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@apollo/server": "^5.5.1",
|
|
40
|
-
"@types/jest": "
|
|
40
|
+
"@types/jest": "^30.0.0",
|
|
41
41
|
"@types/js-yaml": "4.0.9",
|
|
42
42
|
"@types/node": "^25.7.0",
|
|
43
43
|
"@types/pluralize": "0.0.33",
|
|
44
44
|
"@types/sqlstring": "2.3.2",
|
|
45
|
-
"env-cmd": "
|
|
45
|
+
"env-cmd": "^11.0.0",
|
|
46
46
|
"globals": "^17.4.0",
|
|
47
47
|
"husky": "8.0.3",
|
|
48
|
-
"jest": "^30.2
|
|
49
|
-
"lint-staged": "
|
|
48
|
+
"jest": "^30.4.2",
|
|
49
|
+
"lint-staged": "^17.0.4",
|
|
50
50
|
"sasat": "link:./dist",
|
|
51
|
-
"ts-jest": "^29.4.
|
|
52
|
-
"
|
|
53
|
-
"tsconfig-paths": "4.2.0",
|
|
54
|
-
"tsdown": "^0.22.0",
|
|
55
|
-
"tsx": "^4.20.3"
|
|
51
|
+
"ts-jest": "^29.4.9",
|
|
52
|
+
"tsdown": "^0.22.0"
|
|
56
53
|
},
|
|
57
54
|
"peerDependencies": {
|
|
58
55
|
"@apollo/server": "^4.0.0 || ^5.0.0"
|