@stacksjs/orm 0.65.0 → 0.68.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/types.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export 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
- }
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
- import type { Attributes, Model, ModelElement, RelationConfig } from "@stacksjs/types";
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
- table: string;
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
- export declare function writeModelRequest(): Promise<void>;
21
- export declare function writeOrmActions(apiRoute: string, modelName: string, actionPath?: string): Promise<void>;
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
- export {};
19
+ declare function ensureCodeStyle(): Promise<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/orm",
3
3
  "type": "module",
4
- "version": "0.65.0",
4
+ "version": "0.68.0",
5
5
  "description": "The Stacks ORM integration",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": ["Chris Breuer <chris@stacksjs.org>"],
@@ -19,29 +19,27 @@
19
19
  "keywords": ["stacks", "kysely"],
20
20
  "exports": {
21
21
  ".": {
22
- "bun": "./src/index.ts",
23
22
  "import": "./dist/index.js"
24
23
  },
25
24
  "./*": {
26
- "bun": "./src/*",
27
25
  "import": "./dist/*"
28
26
  }
29
27
  },
30
28
  "module": "dist/index.js",
31
29
  "types": "dist/index.d.ts",
32
- "files": ["README.md", "dist", "src"],
30
+ "files": ["README.md", "dist"],
33
31
  "scripts": {
34
32
  "build": "bun build.ts",
35
33
  "typecheck": "bun tsc --noEmit",
36
34
  "prepublishOnly": "bun run build"
37
35
  },
38
36
  "dependencies": {
39
- "@stacksjs/build": "0.64.6",
40
- "@stacksjs/config": "0.64.6",
41
- "@stacksjs/query-builder": "0.64.6",
42
- "@stacksjs/types": "0.64.6"
37
+ "@stacksjs/build": "0.67.0",
38
+ "@stacksjs/config": "0.67.0",
39
+ "@stacksjs/query-builder": "0.67.0",
40
+ "@stacksjs/types": "0.67.0"
43
41
  },
44
42
  "devDependencies": {
45
- "@stacksjs/development": "0.64.6"
43
+ "@stacksjs/development": "0.67.0"
46
44
  }
47
45
  }
File without changes