@casekit/orm 0.0.1-alpha.1 → 0.0.1-alpha.2

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.
@@ -96,6 +96,8 @@ jobs:
96
96
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
97
97
  - name: Push
98
98
  run: git push
99
+ - name: Push tag
100
+ run: git push --tags
99
101
 
100
102
  dependabot:
101
103
  name: "🤖 Dependabot"
@@ -1,3 +1,5 @@
1
+ import { ModelName } from "../helpers/ModelName";
2
+ import { LooseModelDefinitions } from "./LooseModelDefinitions";
1
3
  import { LooseRelationDefinition } from "./LooseRelationDefinition";
2
- export type LooseRelationsDefinition = Record<string, LooseRelationDefinition>;
4
+ export type LooseRelationsDefinition<Models extends LooseModelDefinitions, _M extends ModelName<Models>> = Record<string, LooseRelationDefinition>;
3
5
  //# sourceMappingURL=LooseRelationsDefinition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LooseRelationsDefinition.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationsDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"LooseRelationsDefinition.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationsDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,MAAM,wBAAwB,CAChC,MAAM,SAAS,qBAAqB,EACpC,EAAE,SAAS,SAAS,CAAC,MAAM,CAAC,IAC5B,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC"}
@@ -2,6 +2,6 @@ import { ModelName } from "../helpers/ModelName";
2
2
  import { LooseModelDefinitions } from "./LooseModelDefinitions";
3
3
  import { LooseRelationsDefinition } from "./LooseRelationsDefinition";
4
4
  export type LooseRelationsDefinitions<Models extends LooseModelDefinitions> = {
5
- [M in ModelName<Models>]?: LooseRelationsDefinition;
5
+ [M in ModelName<Models>]?: LooseRelationsDefinition<Models, M>;
6
6
  };
7
7
  //# sourceMappingURL=LooseRelationsDefinitions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LooseRelationsDefinitions.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationsDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,MAAM,yBAAyB,CAAC,MAAM,SAAS,qBAAqB,IAAI;KACzE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,wBAAwB;CACtD,CAAC"}
1
+ {"version":3,"file":"LooseRelationsDefinitions.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationsDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,MAAM,yBAAyB,CAAC,MAAM,SAAS,qBAAqB,IAAI;KACzE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,wBAAwB,CAAC,MAAM,EAAE,CAAC,CAAC;CACjE,CAAC"}
@@ -2,7 +2,7 @@ export declare const post: {
2
2
  readonly columns: {
3
3
  readonly id: {
4
4
  readonly type: "uuid";
5
- readonly default: import("../../../sql").SQLStatement;
5
+ readonly default: import("../../..").SQLStatement;
6
6
  readonly primaryKey: true;
7
7
  };
8
8
  readonly title: {
@@ -2,7 +2,7 @@ export declare const tenant: {
2
2
  readonly columns: {
3
3
  readonly id: {
4
4
  readonly type: "uuid";
5
- readonly default: import("../../../sql").SQLStatement;
5
+ readonly default: import("../../..").SQLStatement;
6
6
  readonly primaryKey: true;
7
7
  };
8
8
  readonly name: {
@@ -10,7 +10,7 @@ export declare const tenant: {
10
10
  };
11
11
  readonly createdAt: {
12
12
  readonly type: "timestamp";
13
- readonly default: import("../../../sql").SQLStatement;
13
+ readonly default: import("../../..").SQLStatement;
14
14
  };
15
15
  };
16
16
  };
@@ -3,7 +3,7 @@ export declare const tenantUser: {
3
3
  readonly columns: {
4
4
  readonly id: {
5
5
  readonly type: "uuid";
6
- readonly default: import("../../../sql").SQLStatement;
6
+ readonly default: import("../../..").SQLStatement;
7
7
  readonly primaryKey: true;
8
8
  };
9
9
  readonly tenantId: {
@@ -22,7 +22,7 @@ export declare const tenantUser: {
22
22
  };
23
23
  readonly createdAt: {
24
24
  readonly type: "timestamp with time zone";
25
- readonly default: import("../../../sql").SQLStatement;
25
+ readonly default: import("../../..").SQLStatement;
26
26
  };
27
27
  readonly deletedAt: {
28
28
  readonly type: "timestamp with time zone";
@@ -3,7 +3,7 @@ export declare const user: {
3
3
  readonly columns: {
4
4
  readonly id: {
5
5
  readonly type: "uuid";
6
- readonly default: import("../../../sql").SQLStatement;
6
+ readonly default: import("../../..").SQLStatement;
7
7
  };
8
8
  readonly username: {
9
9
  readonly zodSchema: z.ZodString;
@@ -28,7 +28,7 @@ export declare const user: {
28
28
  readonly primaryKey: ["id"];
29
29
  readonly uniqueConstraints: [{
30
30
  readonly columns: ["username"];
31
- readonly where: import("../../../sql").SQLStatement;
31
+ readonly where: import("../../..").SQLStatement;
32
32
  }];
33
33
  };
34
34
  //# sourceMappingURL=user.model.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casekit/orm",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.2",
4
4
  "description": "A simple ORM",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -1,3 +1,8 @@
1
+ import { ModelName } from "../helpers/ModelName";
2
+ import { LooseModelDefinitions } from "./LooseModelDefinitions";
1
3
  import { LooseRelationDefinition } from "./LooseRelationDefinition";
2
4
 
3
- export type LooseRelationsDefinition = Record<string, LooseRelationDefinition>;
5
+ export type LooseRelationsDefinition<
6
+ Models extends LooseModelDefinitions,
7
+ _M extends ModelName<Models>,
8
+ > = Record<string, LooseRelationDefinition>;
@@ -3,5 +3,5 @@ import { LooseModelDefinitions } from "./LooseModelDefinitions";
3
3
  import { LooseRelationsDefinition } from "./LooseRelationsDefinition";
4
4
 
5
5
  export type LooseRelationsDefinitions<Models extends LooseModelDefinitions> = {
6
- [M in ModelName<Models>]?: LooseRelationsDefinition;
6
+ [M in ModelName<Models>]?: LooseRelationsDefinition<Models, M>;
7
7
  };
@@ -1,4 +1,4 @@
1
- import { RelationsDefinition } from "../../../schema/types/strict/RelationsDefinition";
1
+ import { RelationsDefinition } from "../../..";
2
2
  import { Models } from "../models";
3
3
 
4
4
  export const foo = {} as const satisfies RelationsDefinition<Models, "foo">;
@@ -1,4 +1,4 @@
1
- import { ModelDefinition } from "../../../schema/types/strict/ModelDefinition";
1
+ import { ModelDefinition } from "../../..";
2
2
  import { sql } from "../../../sql";
3
3
 
4
4
  export const post = {
@@ -1,4 +1,4 @@
1
- import { RelationsDefinition } from "../../../schema/types/strict/RelationsDefinition";
1
+ import { RelationsDefinition } from "../../..";
2
2
  import { Models } from "../models";
3
3
 
4
4
  export const post = {
@@ -1,4 +1,4 @@
1
- import { ModelDefinition } from "../../../schema/types/strict/ModelDefinition";
1
+ import { ModelDefinition } from "../../..";
2
2
  import { sql } from "../../../sql";
3
3
 
4
4
  export const tenant = {
@@ -1,4 +1,4 @@
1
- import { RelationsDefinition } from "../../../schema/types/strict/RelationsDefinition";
1
+ import { RelationsDefinition } from "../../..";
2
2
  import { Models } from "../models";
3
3
 
4
4
  export const tenant = {
@@ -1,4 +1,4 @@
1
- import { ModelDefinition } from "../../../schema/types/strict/ModelDefinition";
1
+ import { ModelDefinition } from "../../..";
2
2
  import { sql } from "../../../sql";
3
3
 
4
4
  export const tenantUser = {
@@ -1,4 +1,4 @@
1
- import { RelationsDefinition } from "../../../schema/types/strict/RelationsDefinition";
1
+ import { RelationsDefinition } from "../../..";
2
2
  import { Models } from "../models";
3
3
 
4
4
  export const tenantUser = {
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
 
3
- import { ModelDefinition } from "../../../schema/types/strict/ModelDefinition";
3
+ import { ModelDefinition } from "../../..";
4
4
  import { sql } from "../../../sql";
5
5
 
6
6
  export const user = {
@@ -1,4 +1,4 @@
1
- import { RelationsDefinition } from "../../../schema/types/strict/RelationsDefinition";
1
+ import { RelationsDefinition } from "../../..";
2
2
  import { Models } from "../models";
3
3
 
4
4
  export const user = {