pangea-server 3.3.83 → 3.3.85

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.
@@ -2,7 +2,7 @@ import * as seq from 'sequelize-typescript';
2
2
  import { BaseModel } from './models';
3
3
  import { Db as _Db } from './db.class';
4
4
  import type { OptionalFields, OptionalIfNullish } from 'pangea-helpers';
5
- import type { InferAttributes, InferCreationAttributes, CreationOptional, NonAttribute, AbstractDataTypeConstructor, AbstractDataType, Transaction, WhereOptions } from 'sequelize';
5
+ import type { InferAttributes, InferCreationAttributes, CreationOptional, AbstractDataTypeConstructor, AbstractDataType, Transaction, WhereOptions } from 'sequelize';
6
6
  import type { ModelCtor } from 'sequelize-typescript';
7
7
  declare global {
8
8
  type ModelId = number;
@@ -12,14 +12,15 @@ declare global {
12
12
  type ColHidden<T> = T & {
13
13
  __brand: 'hidden';
14
14
  };
15
- type ColVirtual<T> = NonAttribute<T>;
15
+ type ColVirtual<T> = CreationOptional<T>;
16
+ type FieldsToExclude = '__brand' | 'version';
17
+ type ModelInstance<BM extends BaseModel> = InferAttributes<BM>;
16
18
  type Where<BM extends BaseModel> = WhereOptions<BM> & Record<symbol, any>;
17
- type InsertParams<BM extends BaseModel> = OptionalIfNullish<OptionalIfOptional<StripRelations<OptionalFields<IncludeHidden<Omit<InferCreationAttributes<BM>, '__brand'>>, Exclude<keyof InferCreationAttributes<BM>, '__brand'> & 'id'>>>>;
19
+ type InsertParams<BM extends BaseModel> = OptionalIfNullish<OptionalIfOptional<StripRelations<OptionalFields<IncludeHidden<Omit<InferCreationAttributes<BM>, FieldsToExclude>>, Exclude<keyof InferCreationAttributes<BM>, FieldsToExclude> & 'id'>>>>;
18
20
  type UpdateParams<BM extends BaseModel> = Partial<InsertParams<BM>>;
19
21
  type UpdateParamsWithId<BM extends BaseModel> = UpdateParams<BM> & {
20
22
  id: ModelId;
21
23
  };
22
- type ModelInstance<BM extends BaseModel> = InferAttributes<BM>;
23
24
  type Tx = Transaction;
24
25
  type Db = _Db;
25
26
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-server",
3
3
  "description": "",
4
- "version": "3.3.83",
4
+ "version": "3.3.85",
5
5
  "files": [
6
6
  "dist"
7
7
  ],