@stacksjs/orm 0.67.0 → 0.68.1
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/fsevents-hj42pnne.node +0 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +496 -307
- package/dist/types.d.ts +8 -8
- package/dist/utils.d.ts +7 -21
- package/package.json +1 -1
- package/dist/generated/types.d.ts +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface OrmDriver {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
export declare interface OrmDriver {
|
|
2
|
+
find: (id: number) => Promise<any>
|
|
3
|
+
create: (data: any) => Promise<any>
|
|
4
|
+
update: (id: number, data: any) => Promise<any>
|
|
5
|
+
delete: (id: number) => Promise<any>
|
|
6
|
+
all: () => Promise<any[]>
|
|
7
|
+
where: (column: string, value: any) => Promise<any[]>
|
|
8
|
+
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
type ModelPath = string;
|
|
1
|
+
declare type ModelPath = string
|
|
3
2
|
export declare function modelTableName(model: Model | ModelPath): Promise<string>;
|
|
4
3
|
export declare function getModelName(model: Model, modelPath: string): string;
|
|
5
4
|
export declare function getTableName(model: Model, modelPath: string): string;
|
|
@@ -8,26 +7,13 @@ export declare function hasRelations(obj: any, key: string): boolean;
|
|
|
8
7
|
export declare function getRelations(model: Model, modelName: string): Promise<RelationConfig[]>;
|
|
9
8
|
export declare function getRelationType(relation: string): string;
|
|
10
9
|
export declare function getRelationCount(relation: string): string;
|
|
11
|
-
export declare function getPivotTables(model: Model, modelPath: string): Promise<{
|
|
12
|
-
|
|
13
|
-
firstForeignKey?: string;
|
|
14
|
-
secondForeignKey?: string;
|
|
15
|
-
}[]>;
|
|
16
|
-
export declare function fetchOtherModelRelations(model: Model, modelName?: string): Promise<RelationConfig[]>;
|
|
10
|
+
export declare function getPivotTables(model: Model, modelPath: string,): Promise<{ table: string, firstForeignKey?: string, secondForeignKey?: string }[]>;
|
|
11
|
+
export declare function fetchOtherModelRelations(modelName?: string): Promise<RelationConfig[]>;
|
|
17
12
|
export declare function getHiddenAttributes(attributes: Attributes | undefined): string[];
|
|
18
|
-
export declare function getFillableAttributes(attributes: Attributes | undefined): string[];
|
|
13
|
+
export declare function getFillableAttributes(attributes: Attributes | undefined, otherModelRelations: RelationConfig[]): string[];
|
|
19
14
|
export declare function writeModelNames(): Promise<void>;
|
|
20
|
-
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function extractFields(model: Model, modelFile: string): Promise<ModelElement[]>;
|
|
23
|
-
export declare function generateApiRoutes(modelFiles: string[]): Promise<void>;
|
|
24
|
-
export declare function deleteExistingModels(modelStringFile?: string): Promise<void>;
|
|
25
|
-
export declare function deleteExistingOrmActions(modelStringFile?: string): Promise<void>;
|
|
26
|
-
export declare function deleteExistingModelNameTypes(): Promise<void>;
|
|
27
|
-
export declare function deleteExistingModelRequest(modelStringFile?: string): Promise<void>;
|
|
28
|
-
export declare function deleteExistingOrmRoute(): Promise<void>;
|
|
29
|
-
export declare function generateKyselyTypes(): Promise<void>;
|
|
30
|
-
export declare function generateModelString(tableName: string, modelName: string, model: Model, attributes: ModelElement[]): Promise<string>;
|
|
15
|
+
declare function parseRule(rule: string): FieldArrayElement | null;
|
|
16
|
+
export declare function generateModelString(tableName: string, modelName: string, model: Model, attributes: ModelElement[],): Promise<string>;
|
|
31
17
|
export declare function generateModelFiles(modelStringFile?: string): Promise<void>;
|
|
32
18
|
export declare function extractAttributesFromModel(filePath: string): Promise<Attributes>;
|
|
33
|
-
|
|
19
|
+
declare function ensureCodeStyle(): Promise<void>;
|
package/package.json
CHANGED
|
File without changes
|