sedentary 0.0.36 → 0.0.39

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.
Files changed (2) hide show
  1. package/dist/types/index.d.ts +12 -6
  2. package/package.json +11 -11
@@ -16,9 +16,12 @@ declare type ForeignKeysAttributes<T, k> = T extends AttributeDefinition<Natural
16
16
  declare type ForeignKeys<A extends AttributesDefinition> = {
17
17
  [a in keyof A]?: ForeignKeysAttributes<A[a], a>;
18
18
  }[keyof A];
19
- declare type Native__<T> = T extends Type<infer N, unknown> ? N | null : never;
20
- declare type Native_<T> = T extends () => Type<infer N, infer E> ? Native__<Type<N, E>> : Native__<T>;
21
- declare type Native<T> = T extends AttributeOptions<infer N, infer E> ? Native__<Type<N, E>> : Native_<T>;
19
+ declare type Native___<T> = T extends Type<infer N, unknown> ? N : never;
20
+ declare type Native__<T> = T extends () => Type<infer N, infer E> ? Native___<Type<N, E>> : Native___<T>;
21
+ declare type Native_<T, N extends Natural, E> = T extends {
22
+ notNull: true;
23
+ } ? Native___<Type<N, E>> : Native___<Type<N, E>> | null;
24
+ declare type Native<T> = T extends AttributeOptions<infer N, infer E> ? Native_<T, N, E> : Native__<T> | null;
22
25
  export declare type IndexAttributes = string[] | string;
23
26
  export interface IndexOptions {
24
27
  attributes: IndexAttributes;
@@ -51,7 +54,7 @@ declare type BaseKeyType<B extends boolean> = IsUnion<B> extends true ? number :
51
54
  declare type KeyType<B extends boolean, P extends ModelStd> = P extends new () => EntryBase ? (P extends Attribute<infer T, EntryBase> ? T : never) : BaseKeyType<B>;
52
55
  declare type ForeignKey<A> = A extends AttributeDefinition<Natural, infer E> ? () => Promise<E> : never;
53
56
  declare type EntryBaseAttributes<A extends AttributesDefinition> = {
54
- [a in keyof A]?: Native<A[a]>;
57
+ [a in keyof A]: Native<A[a]>;
55
58
  };
56
59
  declare type EntryMethodsBase<P extends ModelStd> = P extends new () => EntryBase ? P["methods"] : EntryBase;
57
60
  declare type EntryMethodsFK<A extends AttributesDefinition> = {
@@ -60,14 +63,17 @@ declare type EntryMethodsFK<A extends AttributesDefinition> = {
60
63
  declare type EntryMethods<A extends AttributesDefinition, P extends ModelStd> = keyof EntryMethodsFK<A> extends never ? EntryMethodsBase<P> : EntryMethodsBase<P> & EntryMethodsFK<A>;
61
64
  declare type ModelAttributesIf<A extends AttributesDefinition, T> = keyof A extends never ? T : T & A;
62
65
  declare type ModelAttributes<A extends AttributesDefinition, B extends boolean, K extends string, P extends ModelStd> = K extends keyof A ? A : ModelAttributesIf<A, P extends new () => EntryBase ? P["attributes"] : {
63
- id: Type<BaseKeyType<B>, unknown>;
66
+ id: {
67
+ notNull: true;
68
+ type: Type<BaseKeyType<B>, unknown>;
69
+ };
64
70
  }>;
65
71
  export interface ModelLoad<A extends AttributesDefinition, E extends EntryBase> {
66
72
  attributes: A;
67
73
  load(where: Condition<A>, order?: Order<A>, tx?: Transaction, lock?: boolean): Promise<E[]>;
68
74
  load(where: Condition<A>, tx: Transaction, lock?: boolean): Promise<E[]>;
69
75
  }
70
- declare type ModelBase<N extends Natural, A extends AttributesDefinition, EA extends Record<string, Natural | undefined>, EM extends EntryBase, E extends EntryBase> = (new (from?: EA, tx?: Transaction) => E) & Attribute<N, E> & {
76
+ declare type ModelBase<N extends Natural, A extends AttributesDefinition, EA extends Record<string, Natural | undefined>, EM extends EntryBase, E extends EntryBase> = (new (from?: Partial<EA>, tx?: Transaction) => E) & Attribute<N, E> & {
71
77
  foreignKeys: Record<string, boolean>;
72
78
  methods: EM;
73
79
  parent?: ModelStd;
package/package.json CHANGED
@@ -8,18 +8,18 @@
8
8
  "dependencies": {},
9
9
  "description": "The ORM which never needs to migrate",
10
10
  "devDependencies": {
11
- "@types/mocha": "9.1.0",
12
- "@types/node": "17.0.24",
11
+ "@types/mocha": "9.1.1",
12
+ "@types/node": "18.0.0",
13
13
  "@types/yamljs": "0.2.31",
14
- "@typescript-eslint/eslint-plugin": "5.19.0",
15
- "@typescript-eslint/parser": "5.19.0",
16
- "eslint": "8.13.0",
17
- "mocha": "9.2.2",
14
+ "@typescript-eslint/eslint-plugin": "5.30.0",
15
+ "@typescript-eslint/parser": "5.30.0",
16
+ "eslint": "8.18.0",
17
+ "mocha": "10.0.0",
18
18
  "nyc": "15.1.0",
19
- "prettier": "2.6.2",
20
- "ts-node": "10.7.0",
21
- "tsd": "0.20.0",
22
- "typescript": "4.6.3",
19
+ "prettier": "2.7.1",
20
+ "ts-node": "10.8.1",
21
+ "tsd": "0.21.0",
22
+ "typescript": "4.7.4",
23
23
  "yamljs": "0.3.0"
24
24
  },
25
25
  "engines": {
@@ -79,5 +79,5 @@
79
79
  }
80
80
  },
81
81
  "types": "./dist/types/index.d.ts",
82
- "version": "0.0.36"
82
+ "version": "0.0.39"
83
83
  }