bigal 12.1.5 → 13.0.0-beta2

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 (213) hide show
  1. package/.devcontainer/devcontainer.json +16 -0
  2. package/.husky/pre-commit +4 -0
  3. package/.prettierrc.cjs +34 -0
  4. package/CHANGELOG.md +5 -0
  5. package/dist/index.cjs +2626 -0
  6. package/dist/index.d.cts +892 -0
  7. package/dist/index.d.mts +892 -0
  8. package/dist/index.d.ts +892 -0
  9. package/dist/index.mjs +2605 -0
  10. package/eslint.config.mjs +25 -0
  11. package/package.json +44 -35
  12. package/tsconfig.build.json +7 -0
  13. package/Entity.d.ts +0 -16
  14. package/Entity.js +0 -13
  15. package/Entity.js.map +0 -1
  16. package/IReadonlyRepository.d.ts +0 -36
  17. package/IReadonlyRepository.js +0 -3
  18. package/IReadonlyRepository.js.map +0 -1
  19. package/IRepository.d.ts +0 -99
  20. package/IRepository.js +0 -3
  21. package/IRepository.js.map +0 -1
  22. package/ReadonlyRepository.d.ts +0 -69
  23. package/ReadonlyRepository.js +0 -687
  24. package/ReadonlyRepository.js.map +0 -1
  25. package/Repository.d.ts +0 -69
  26. package/Repository.js +0 -171
  27. package/Repository.js.map +0 -1
  28. package/SqlHelper.d.ts +0 -144
  29. package/SqlHelper.js +0 -1081
  30. package/SqlHelper.js.map +0 -1
  31. package/decorators/ColumnBaseOptions.d.ts +0 -10
  32. package/decorators/ColumnBaseOptions.js +0 -3
  33. package/decorators/ColumnBaseOptions.js.map +0 -1
  34. package/decorators/ColumnCollectionOptions.d.ts +0 -15
  35. package/decorators/ColumnCollectionOptions.js +0 -3
  36. package/decorators/ColumnCollectionOptions.js.map +0 -1
  37. package/decorators/ColumnModelOptions.d.ts +0 -7
  38. package/decorators/ColumnModelOptions.js +0 -3
  39. package/decorators/ColumnModelOptions.js.map +0 -1
  40. package/decorators/ColumnTypeOptions.d.ts +0 -21
  41. package/decorators/ColumnTypeOptions.js +0 -3
  42. package/decorators/ColumnTypeOptions.js.map +0 -1
  43. package/decorators/TableOptions.d.ts +0 -14
  44. package/decorators/TableOptions.js +0 -3
  45. package/decorators/TableOptions.js.map +0 -1
  46. package/decorators/column.d.ts +0 -9
  47. package/decorators/column.js +0 -93
  48. package/decorators/column.js.map +0 -1
  49. package/decorators/createDateColumn.d.ts +0 -6
  50. package/decorators/createDateColumn.js +0 -50
  51. package/decorators/createDateColumn.js.map +0 -1
  52. package/decorators/index.d.ts +0 -6
  53. package/decorators/index.js +0 -23
  54. package/decorators/index.js.map +0 -1
  55. package/decorators/primaryColumn.d.ts +0 -8
  56. package/decorators/primaryColumn.js +0 -66
  57. package/decorators/primaryColumn.js.map +0 -1
  58. package/decorators/table.d.ts +0 -5
  59. package/decorators/table.js +0 -40
  60. package/decorators/table.js.map +0 -1
  61. package/decorators/updateDateColumn.d.ts +0 -6
  62. package/decorators/updateDateColumn.js +0 -51
  63. package/decorators/updateDateColumn.js.map +0 -1
  64. package/decorators/versionColumn.d.ts +0 -6
  65. package/decorators/versionColumn.js +0 -51
  66. package/decorators/versionColumn.js.map +0 -1
  67. package/errors/QueryError.d.ts +0 -8
  68. package/errors/QueryError.js +0 -13
  69. package/errors/QueryError.js.map +0 -1
  70. package/errors/index.d.ts +0 -1
  71. package/errors/index.js +0 -18
  72. package/errors/index.js.map +0 -1
  73. package/index.d.ts +0 -35
  74. package/index.js +0 -220
  75. package/index.js.map +0 -1
  76. package/metadata/ColumnBaseMetadata.d.ts +0 -93
  77. package/metadata/ColumnBaseMetadata.js +0 -19
  78. package/metadata/ColumnBaseMetadata.js.map +0 -1
  79. package/metadata/ColumnCollectionMetadata.d.ts +0 -36
  80. package/metadata/ColumnCollectionMetadata.js +0 -63
  81. package/metadata/ColumnCollectionMetadata.js.map +0 -1
  82. package/metadata/ColumnMetadata.d.ts +0 -4
  83. package/metadata/ColumnMetadata.js +0 -3
  84. package/metadata/ColumnMetadata.js.map +0 -1
  85. package/metadata/ColumnModelMetadata.d.ts +0 -18
  86. package/metadata/ColumnModelMetadata.js +0 -43
  87. package/metadata/ColumnModelMetadata.js.map +0 -1
  88. package/metadata/ColumnModifierMetadata.d.ts +0 -46
  89. package/metadata/ColumnModifierMetadata.js +0 -3
  90. package/metadata/ColumnModifierMetadata.js.map +0 -1
  91. package/metadata/ColumnTypeMetadata.d.ts +0 -43
  92. package/metadata/ColumnTypeMetadata.js +0 -26
  93. package/metadata/ColumnTypeMetadata.js.map +0 -1
  94. package/metadata/MetadataStorage.d.ts +0 -13
  95. package/metadata/MetadataStorage.js +0 -19
  96. package/metadata/MetadataStorage.js.map +0 -1
  97. package/metadata/ModelMetadata.d.ts +0 -36
  98. package/metadata/ModelMetadata.js +0 -81
  99. package/metadata/ModelMetadata.js.map +0 -1
  100. package/metadata/index.d.ts +0 -10
  101. package/metadata/index.js +0 -33
  102. package/metadata/index.js.map +0 -1
  103. package/query/Comparer.d.ts +0 -1
  104. package/query/Comparer.js +0 -3
  105. package/query/Comparer.js.map +0 -1
  106. package/query/CountArgs.d.ts +0 -7
  107. package/query/CountArgs.js +0 -3
  108. package/query/CountArgs.js.map +0 -1
  109. package/query/CountResult.d.ts +0 -5
  110. package/query/CountResult.js +0 -3
  111. package/query/CountResult.js.map +0 -1
  112. package/query/CreateOptions.d.ts +0 -9
  113. package/query/CreateOptions.js +0 -3
  114. package/query/CreateOptions.js.map +0 -1
  115. package/query/CreateUpdateOptions.d.ts +0 -4
  116. package/query/CreateUpdateOptions.js +0 -3
  117. package/query/CreateUpdateOptions.js.map +0 -1
  118. package/query/DeleteOptions.d.ts +0 -12
  119. package/query/DeleteOptions.js +0 -3
  120. package/query/DeleteOptions.js.map +0 -1
  121. package/query/DestroyResult.d.ts +0 -5
  122. package/query/DestroyResult.js +0 -3
  123. package/query/DestroyResult.js.map +0 -1
  124. package/query/DoNotReturnRecords.d.ts +0 -3
  125. package/query/DoNotReturnRecords.js +0 -3
  126. package/query/DoNotReturnRecords.js.map +0 -1
  127. package/query/FindArgs.d.ts +0 -6
  128. package/query/FindArgs.js +0 -3
  129. package/query/FindArgs.js.map +0 -1
  130. package/query/FindOneArgs.d.ts +0 -11
  131. package/query/FindOneArgs.js +0 -3
  132. package/query/FindOneArgs.js.map +0 -1
  133. package/query/FindOneResult.d.ts +0 -12
  134. package/query/FindOneResult.js +0 -3
  135. package/query/FindOneResult.js.map +0 -1
  136. package/query/FindResult.d.ts +0 -15
  137. package/query/FindResult.js +0 -3
  138. package/query/FindResult.js.map +0 -1
  139. package/query/OnConflictOptions.d.ts +0 -25
  140. package/query/OnConflictOptions.js +0 -3
  141. package/query/OnConflictOptions.js.map +0 -1
  142. package/query/PaginateOptions.d.ts +0 -4
  143. package/query/PaginateOptions.js +0 -3
  144. package/query/PaginateOptions.js.map +0 -1
  145. package/query/PopulateArgs.d.ts +0 -13
  146. package/query/PopulateArgs.js +0 -3
  147. package/query/PopulateArgs.js.map +0 -1
  148. package/query/ReturnSelect.d.ts +0 -5
  149. package/query/ReturnSelect.js +0 -3
  150. package/query/ReturnSelect.js.map +0 -1
  151. package/query/Sort.d.ts +0 -15
  152. package/query/Sort.js +0 -3
  153. package/query/Sort.js.map +0 -1
  154. package/query/WhereQuery.d.ts +0 -21
  155. package/query/WhereQuery.js +0 -3
  156. package/query/WhereQuery.js.map +0 -1
  157. package/query/index.d.ts +0 -15
  158. package/query/index.js +0 -32
  159. package/query/index.js.map +0 -1
  160. package/types/ClassLike.d.ts +0 -8
  161. package/types/ClassLike.js +0 -3
  162. package/types/ClassLike.js.map +0 -1
  163. package/types/CreateUpdateParams.d.ts +0 -9
  164. package/types/CreateUpdateParams.js +0 -3
  165. package/types/CreateUpdateParams.js.map +0 -1
  166. package/types/EntityPrimitiveOrId.d.ts +0 -2
  167. package/types/EntityPrimitiveOrId.js +0 -3
  168. package/types/EntityPrimitiveOrId.js.map +0 -1
  169. package/types/ExcludeEntityCollections.d.ts +0 -5
  170. package/types/ExcludeEntityCollections.js +0 -3
  171. package/types/ExcludeEntityCollections.js.map +0 -1
  172. package/types/ExcludeFunctions.d.ts +0 -4
  173. package/types/ExcludeFunctions.js +0 -3
  174. package/types/ExcludeFunctions.js.map +0 -1
  175. package/types/GetValueType.d.ts +0 -1
  176. package/types/GetValueType.js +0 -3
  177. package/types/GetValueType.js.map +0 -1
  178. package/types/IncludeFunctions.d.ts +0 -4
  179. package/types/IncludeFunctions.js +0 -3
  180. package/types/IncludeFunctions.js.map +0 -1
  181. package/types/IsValueOfType.d.ts +0 -1
  182. package/types/IsValueOfType.js +0 -3
  183. package/types/IsValueOfType.js.map +0 -1
  184. package/types/OmitEntityCollections.d.ts +0 -7
  185. package/types/OmitEntityCollections.js +0 -3
  186. package/types/OmitEntityCollections.js.map +0 -1
  187. package/types/OmitFunctions.d.ts +0 -7
  188. package/types/OmitFunctions.js +0 -3
  189. package/types/OmitFunctions.js.map +0 -1
  190. package/types/PickAsType.d.ts +0 -3
  191. package/types/PickAsType.js +0 -3
  192. package/types/PickAsType.js.map +0 -1
  193. package/types/PickByValueType.d.ts +0 -5
  194. package/types/PickByValueType.js +0 -3
  195. package/types/PickByValueType.js.map +0 -1
  196. package/types/PickFunctions.d.ts +0 -4
  197. package/types/PickFunctions.js +0 -3
  198. package/types/PickFunctions.js.map +0 -1
  199. package/types/Populated.d.ts +0 -9
  200. package/types/Populated.js +0 -3
  201. package/types/Populated.js.map +0 -1
  202. package/types/QueryResult.d.ts +0 -9
  203. package/types/QueryResult.js +0 -3
  204. package/types/QueryResult.js.map +0 -1
  205. package/types/QueryResultOptionalPopulated.d.ts +0 -9
  206. package/types/QueryResultOptionalPopulated.js +0 -3
  207. package/types/QueryResultOptionalPopulated.js.map +0 -1
  208. package/types/QueryResultPopulated.d.ts +0 -9
  209. package/types/QueryResultPopulated.js +0 -3
  210. package/types/QueryResultPopulated.js.map +0 -1
  211. package/types/index.d.ts +0 -17
  212. package/types/index.js +0 -34
  213. package/types/index.js.map +0 -1
@@ -1,25 +0,0 @@
1
- import type { Entity } from '../Entity';
2
- import type { OmitEntityCollections, OmitFunctions } from '../types';
3
- import type { WhereQuery } from './WhereQuery';
4
- type OnConflictTargets<T extends Entity, K extends string & keyof OmitFunctions<OmitEntityCollections<T>> = string & keyof OmitFunctions<OmitEntityCollections<T>>> = K[] | {
5
- columns: K[];
6
- where: WhereQuery<T>;
7
- };
8
- export interface OnConflictIgnoreOptions<T extends Entity, K extends string & keyof OmitFunctions<OmitEntityCollections<T>> = string & keyof OmitFunctions<OmitEntityCollections<T>>> {
9
- onConflict: {
10
- action: 'ignore';
11
- targets: OnConflictTargets<T, K>;
12
- };
13
- }
14
- export interface OnConflictMergeOptions<T extends Entity, K extends string & keyof OmitFunctions<OmitEntityCollections<T>> = string & keyof OmitFunctions<OmitEntityCollections<T>>> {
15
- onConflict: {
16
- action: 'merge';
17
- targets: OnConflictTargets<T, K>;
18
- merge?: K[] | {
19
- columns?: K[];
20
- where: WhereQuery<T>;
21
- };
22
- };
23
- }
24
- export type OnConflictOptions<T extends Entity, K extends string & keyof OmitFunctions<OmitEntityCollections<T>> = string & keyof OmitFunctions<OmitEntityCollections<T>>> = OnConflictIgnoreOptions<T, K> | OnConflictMergeOptions<T, K>;
25
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=OnConflictOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OnConflictOptions.js","sourceRoot":"./","sources":["query/OnConflictOptions.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface PaginateOptions {
2
- limit: number;
3
- page: number;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=PaginateOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaginateOptions.js","sourceRoot":"./","sources":["query/PaginateOptions.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- import type { Pool } from 'postgres-pool';
2
- import type { Entity } from '../Entity';
3
- import type { OmitEntityCollections, OmitFunctions } from '../types';
4
- import type { Sort } from './Sort';
5
- import type { WhereQuery } from './WhereQuery';
6
- export interface PopulateArgs<T extends Entity, K extends keyof T> {
7
- where?: WhereQuery<T>;
8
- select?: (K & string & keyof OmitFunctions<OmitEntityCollections<T>>)[];
9
- sort?: Sort<T>;
10
- skip?: number;
11
- limit?: number;
12
- pool?: Pool;
13
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=PopulateArgs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PopulateArgs.js","sourceRoot":"./","sources":["query/PopulateArgs.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import type { Entity } from '../Entity';
2
- import type { OmitEntityCollections, OmitFunctions } from '../types';
3
- export interface ReturnSelect<T extends Entity, K extends keyof OmitFunctions<OmitEntityCollections<T>> = keyof OmitFunctions<OmitEntityCollections<T>>> {
4
- returnSelect: (K & string)[];
5
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ReturnSelect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReturnSelect.js","sourceRoot":"./","sources":["query/ReturnSelect.ts"],"names":[],"mappings":""}
package/query/Sort.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import type { Entity } from '../Entity';
2
- import type { ExcludeFunctions, OmitEntityCollections, OmitFunctions } from '../types';
3
- export type SortString<T extends Entity> = `${string & keyof OmitFunctions<OmitEntityCollections<T>>} ASC` | `${string & keyof OmitFunctions<OmitEntityCollections<T>>} asc` | `${string & keyof OmitFunctions<OmitEntityCollections<T>>} DESC` | `${string & keyof OmitFunctions<OmitEntityCollections<T>>} desc` | `${string & keyof OmitFunctions<OmitEntityCollections<T>>}`;
4
- type ValidateMultipleSorts<T extends Entity, TNextSortPart extends string, TPreviouslyValidatedSortString extends string, TSortString extends string> = TNextSortPart extends `, ${SortString<T>}${infer TRestSortPart}` ? TRestSortPart extends '' ? TSortString : ValidateMultipleSorts<T, TRestSortPart, TNextSortPart extends `${infer TValidatedSortPart}${TRestSortPart}` ? `${TPreviouslyValidatedSortString}${TValidatedSortPart}` : never, TSortString> : `${TPreviouslyValidatedSortString}, ${SortString<T>}`;
5
- export type MultipleSortString<T extends Entity, TSortString extends string = string> = TSortString extends `${SortString<T>}${infer TRestSortPart}` ? TRestSortPart extends '' ? TSortString : ValidateMultipleSorts<T, TRestSortPart, TSortString extends `${infer TPreviouslyValidatedSortString}${TRestSortPart}` ? TPreviouslyValidatedSortString : never, TSortString> : SortString<T>;
6
- export type SortObjectValue = -1 | 'asc' | 'desc' | 1;
7
- export type SortObject<T extends Entity> = {
8
- [K in keyof T as ExcludeFunctions<OmitEntityCollections<T>, K>]?: SortObjectValue;
9
- };
10
- export type Sort<T extends Entity> = MultipleSortString<T> | SortObject<T>;
11
- export interface OrderBy<T extends Entity> {
12
- propertyName: string & keyof OmitFunctions<OmitEntityCollections<T>>;
13
- descending?: boolean;
14
- }
15
- export {};
package/query/Sort.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Sort.js.map
package/query/Sort.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Sort.js","sourceRoot":"./","sources":["query/Sort.ts"],"names":[],"mappings":""}
@@ -1,21 +0,0 @@
1
- import type { Entity, NotEntityBrand } from '../Entity';
2
- import type { ExcludeEntityCollections, ExcludeFunctions } from '../types';
3
- type ExcludeUndefined<T> = Exclude<T, undefined>;
4
- export type LiteralValues<TValue> = (TValue | null)[] | TValue | null;
5
- export type WhereClauseValue<TValue> = TValue extends NotEntityBrand | undefined ? Exclude<TValue, NotEntityBrand | undefined> : Extract<TValue, Entity> extends undefined ? LiteralValues<ExcludeUndefined<TValue>> : (ExcludeUndefined<Exclude<TValue, Entity>> | null)[] | (Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null)[] | ExcludeUndefined<Exclude<TValue, Entity>> | Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null;
6
- export type StringConstraint<TValue extends string> = {
7
- [P in 'contains' | 'endsWith' | 'like' | 'startsWith']?: LiteralValues<ExcludeUndefined<TValue>>;
8
- };
9
- export type NumberOrDateConstraint<TValue extends Date | number> = {
10
- [P in '<' | '<=' | '>' | '>=']?: LiteralValues<ExcludeUndefined<TValue>>;
11
- };
12
- export type NegatableConstraint<TValue> = TValue | {
13
- '!': TValue;
14
- };
15
- export type WhereQueryStatement<TValue> = [TValue] extends [string] ? NegatableConstraint<StringConstraint<TValue> | WhereClauseValue<TValue>> : TValue extends string ? NegatableConstraint<StringConstraint<TValue> | WhereClauseValue<TValue>> : TValue extends Date | number ? NegatableConstraint<NumberOrDateConstraint<TValue> | WhereClauseValue<TValue>> : NegatableConstraint<WhereClauseValue<TValue>>;
16
- export type WhereQuery<T extends Entity> = {
17
- [K in keyof T as ExcludeEntityCollections<T[K], ExcludeFunctions<T[K], K>>]?: K extends 'id' ? WhereQueryStatement<T | T[K]> : T[K] extends (infer U)[] | undefined ? WhereQueryStatement<ExcludeUndefined<U>> : NegatableConstraint<LiteralValues<ExcludeUndefined<T[K]>>> | WhereQueryStatement<ExcludeUndefined<T[K]>>;
18
- } & {
19
- or?: WhereQuery<T>[];
20
- };
21
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=WhereQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WhereQuery.js","sourceRoot":"./","sources":["query/WhereQuery.ts"],"names":[],"mappings":""}
package/query/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- export * from './Comparer';
2
- export * from './CountResult';
3
- export * from './CreateUpdateOptions';
4
- export * from './DeleteOptions';
5
- export * from './DestroyResult';
6
- export * from './DoNotReturnRecords';
7
- export * from './FindArgs';
8
- export * from './FindOneArgs';
9
- export * from './FindOneResult';
10
- export * from './FindResult';
11
- export * from './PaginateOptions';
12
- export * from './PopulateArgs';
13
- export * from './ReturnSelect';
14
- export * from './Sort';
15
- export * from './WhereQuery';
package/query/index.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Comparer"), exports);
18
- __exportStar(require("./CountResult"), exports);
19
- __exportStar(require("./CreateUpdateOptions"), exports);
20
- __exportStar(require("./DeleteOptions"), exports);
21
- __exportStar(require("./DestroyResult"), exports);
22
- __exportStar(require("./DoNotReturnRecords"), exports);
23
- __exportStar(require("./FindArgs"), exports);
24
- __exportStar(require("./FindOneArgs"), exports);
25
- __exportStar(require("./FindOneResult"), exports);
26
- __exportStar(require("./FindResult"), exports);
27
- __exportStar(require("./PaginateOptions"), exports);
28
- __exportStar(require("./PopulateArgs"), exports);
29
- __exportStar(require("./ReturnSelect"), exports);
30
- __exportStar(require("./Sort"), exports);
31
- __exportStar(require("./WhereQuery"), exports);
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"./","sources":["query/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,gDAA8B;AAC9B,wDAAsC;AACtC,kDAAgC;AAChC,kDAAgC;AAChC,uDAAqC;AACrC,6CAA2B;AAC3B,gDAA8B;AAC9B,kDAAgC;AAChC,+CAA6B;AAC7B,oDAAkC;AAClC,iDAA+B;AAC/B,iDAA+B;AAC/B,yCAAuB;AACvB,+CAA6B"}
@@ -1,8 +0,0 @@
1
- export interface ClassLike {
2
- /**
3
- * Returns the name of the function. Function names are read-only and can not be changed.
4
- */
5
- readonly constructor: {
6
- readonly name: string;
7
- };
8
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ClassLike.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClassLike.js","sourceRoot":"./","sources":["types/ClassLike.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import type { Entity, NotEntityBrand } from '../Entity';
2
- import type { ExcludeEntityCollections } from './ExcludeEntityCollections';
3
- import type { ExcludeFunctions } from './ExcludeFunctions';
4
- /**
5
- * Changes all Entity value properties to Primitive (string|number) | Pick<Entity, 'id'>
6
- */
7
- export type CreateUpdateParams<T extends Entity> = {
8
- [K in keyof T as ExcludeEntityCollections<NonNullable<T[K]>, ExcludeFunctions<T[K], K>>]?: T[K] extends NotEntityBrand | undefined ? T[K] : Extract<T[K], Entity> extends undefined ? T[K] : Exclude<T[K], Entity> | Pick<Extract<T[K], Entity>, 'id'>;
9
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=CreateUpdateParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateUpdateParams.js","sourceRoot":"./","sources":["types/CreateUpdateParams.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import type { Entity } from '../Entity';
2
- export type EntityPrimitiveOrId<T> = T extends [] ? T extends (infer U)[] ? EntityPrimitiveOrId<U>[] : T : Extract<NonNullable<T>, Entity> extends undefined ? T : Exclude<NonNullable<T>, Entity> | Pick<Extract<NonNullable<T>, Entity>, 'id'>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=EntityPrimitiveOrId.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntityPrimitiveOrId.js","sourceRoot":"./","sources":["types/EntityPrimitiveOrId.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import type { Entity, NotEntityBrand } from '../Entity';
2
- /**
3
- * Removes all entity collection properties. To be used as a re-map key function
4
- */
5
- export type ExcludeEntityCollections<T, K extends PropertyKey> = T extends NotEntityBrand[] | undefined ? K : T extends Entity[] | undefined ? never : K;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ExcludeEntityCollections.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExcludeEntityCollections.js","sourceRoot":"./","sources":["types/ExcludeEntityCollections.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- /**
2
- * Removes all functions and entity collection properties. To be used as a re-map key function
3
- */
4
- export type ExcludeFunctions<T, K extends PropertyKey> = T extends Function ? never : K;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ExcludeFunctions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExcludeFunctions.js","sourceRoot":"./","sources":["types/ExcludeFunctions.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export type GetValueType<T, TValueType> = T extends TValueType[] ? T extends (infer U)[] ? Extract<U, TValueType> : never : T extends TValueType ? T : never;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=GetValueType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GetValueType.js","sourceRoot":"./","sources":["types/GetValueType.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- /**
2
- * Returns the key name if the property type is a function
3
- */
4
- export type IncludeFunctions<T, K extends PropertyKey> = T extends Function ? K : never;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IncludeFunctions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IncludeFunctions.js","sourceRoot":"./","sources":["types/IncludeFunctions.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export type IsValueOfType<T, K extends PropertyKey, TValueType> = T extends TValueType | TValueType[] | undefined ? K : never;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IsValueOfType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IsValueOfType.js","sourceRoot":"./","sources":["types/IsValueOfType.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import type { ExcludeEntityCollections } from './ExcludeEntityCollections';
2
- /**
3
- * Removes all entity collection properties
4
- */
5
- export type OmitEntityCollections<T> = {
6
- [K in keyof T as ExcludeEntityCollections<T[K], K>]: T[K];
7
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=OmitEntityCollections.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OmitEntityCollections.js","sourceRoot":"./","sources":["types/OmitEntityCollections.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import type { ExcludeFunctions } from './ExcludeFunctions';
2
- /**
3
- * Removes all functions
4
- */
5
- export type OmitFunctions<T> = {
6
- [K in keyof T as ExcludeFunctions<T[K], K>]: T[K];
7
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=OmitFunctions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OmitFunctions.js","sourceRoot":"./","sources":["types/OmitFunctions.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export type PickAsType<T, K extends keyof T, TValue> = {
2
- [P in K]: Extract<T[P], TValue>;
3
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=PickAsType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PickAsType.js","sourceRoot":"./","sources":["types/PickAsType.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import type { GetValueType } from './GetValueType';
2
- import type { IsValueOfType } from './IsValueOfType';
3
- export type PickByValueType<T, TValueType> = {
4
- [K in keyof T as IsValueOfType<T[K], K, TValueType>]: GetValueType<T[K], TValueType>;
5
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=PickByValueType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PickByValueType.js","sourceRoot":"./","sources":["types/PickByValueType.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- import type { IncludeFunctions } from './IncludeFunctions';
2
- export type PickFunctions<T> = {
3
- [K in keyof T as IncludeFunctions<T[K], K>]: T[K];
4
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=PickFunctions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PickFunctions.js","sourceRoot":"./","sources":["types/PickFunctions.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import type { Entity } from '../Entity';
2
- import type { PickFunctions } from './PickFunctions';
3
- import type { QueryResult } from './QueryResult';
4
- /**
5
- * Removes primitives from specified properties and make non-optional. Allow singular Entity properties to be null.
6
- */
7
- export type Populated<T extends Entity, K extends keyof T, TPropertyType extends Entity, TPropertyKeys extends keyof TPropertyType> = {
8
- [P in K]-?: Extract<T[P], Entity | Entity[]> extends Entity ? undefined extends T[P] ? QueryResult<Pick<TPropertyType, TPropertyKeys | keyof PickFunctions<TPropertyType> | 'id'>> | null : QueryResult<Pick<TPropertyType, TPropertyKeys | keyof PickFunctions<TPropertyType> | 'id'>> : QueryResult<Pick<TPropertyType, TPropertyKeys | keyof PickFunctions<TPropertyType> | 'id'>>[];
9
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Populated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Populated.js","sourceRoot":"./","sources":["types/Populated.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import type { Entity, NotEntityBrand } from '../Entity';
2
- import type { ExcludeEntityCollections } from './ExcludeEntityCollections';
3
- /**
4
- * Changes all properties with Entity values to Primitive (string|number). Removes any properties that with values
5
- * of Entity arrays
6
- */
7
- export type QueryResult<T extends Entity> = Extract<{
8
- [K in keyof T as ExcludeEntityCollections<NonNullable<T[K]>, K>]: T[K] extends NotEntityBrand | undefined ? T[K] : Exclude<T[K], Entity>;
9
- }, T>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=QueryResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueryResult.js","sourceRoot":"./","sources":["types/QueryResult.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import type { Entity } from '../Entity';
2
- import type { EntityPrimitiveOrId } from './EntityPrimitiveOrId';
3
- import type { QueryResult } from './QueryResult';
4
- /**
5
- * Allows a QueryResult type with specific properties optionally populated. If the property is populated, only the id property is needed
6
- */
7
- export type QueryResultOptionalPopulated<T extends Entity, K extends keyof T> = Omit<QueryResult<T>, K> & {
8
- [P in K]-?: T[P] extends [] ? undefined extends T[P] ? EntityPrimitiveOrId<T[P]> | null : EntityPrimitiveOrId<T[P]> : EntityPrimitiveOrId<T[P]>;
9
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=QueryResultOptionalPopulated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueryResultOptionalPopulated.js","sourceRoot":"./","sources":["types/QueryResultOptionalPopulated.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import type { Entity } from '../Entity';
2
- import type { GetValueType } from './GetValueType';
3
- import type { QueryResult } from './QueryResult';
4
- /**
5
- * Allows a QueryResult type with specific populated properties
6
- */
7
- export type QueryResultPopulated<T extends Entity, K extends keyof T> = Omit<QueryResult<T>, K> & {
8
- [P in K]-?: Extract<T[P], Entity | Entity[]> extends Entity ? undefined extends T[P] ? QueryResult<GetValueType<T[P], Entity>> | null : QueryResult<GetValueType<T[P], Entity>> : QueryResult<GetValueType<T[P], Entity>>[];
9
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=QueryResultPopulated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueryResultPopulated.js","sourceRoot":"./","sources":["types/QueryResultPopulated.ts"],"names":[],"mappings":""}
package/types/index.d.ts DELETED
@@ -1,17 +0,0 @@
1
- export * from './ClassLike';
2
- export * from './CreateUpdateParams';
3
- export * from './EntityPrimitiveOrId';
4
- export * from './ExcludeEntityCollections';
5
- export * from './ExcludeFunctions';
6
- export * from './GetValueType';
7
- export * from './IncludeFunctions';
8
- export * from './IsValueOfType';
9
- export * from './OmitEntityCollections';
10
- export * from './OmitFunctions';
11
- export * from './PickAsType';
12
- export * from './PickByValueType';
13
- export * from './PickFunctions';
14
- export * from './Populated';
15
- export * from './QueryResult';
16
- export * from './QueryResultPopulated';
17
- export * from './QueryResultOptionalPopulated';
package/types/index.js DELETED
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./ClassLike"), exports);
18
- __exportStar(require("./CreateUpdateParams"), exports);
19
- __exportStar(require("./EntityPrimitiveOrId"), exports);
20
- __exportStar(require("./ExcludeEntityCollections"), exports);
21
- __exportStar(require("./ExcludeFunctions"), exports);
22
- __exportStar(require("./GetValueType"), exports);
23
- __exportStar(require("./IncludeFunctions"), exports);
24
- __exportStar(require("./IsValueOfType"), exports);
25
- __exportStar(require("./OmitEntityCollections"), exports);
26
- __exportStar(require("./OmitFunctions"), exports);
27
- __exportStar(require("./PickAsType"), exports);
28
- __exportStar(require("./PickByValueType"), exports);
29
- __exportStar(require("./PickFunctions"), exports);
30
- __exportStar(require("./Populated"), exports);
31
- __exportStar(require("./QueryResult"), exports);
32
- __exportStar(require("./QueryResultPopulated"), exports);
33
- __exportStar(require("./QueryResultOptionalPopulated"), exports);
34
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"./","sources":["types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,uDAAqC;AACrC,wDAAsC;AACtC,6DAA2C;AAC3C,qDAAmC;AACnC,iDAA+B;AAC/B,qDAAmC;AACnC,kDAAgC;AAChC,0DAAwC;AACxC,kDAAgC;AAChC,+CAA6B;AAC7B,oDAAkC;AAClC,kDAAgC;AAChC,8CAA4B;AAC5B,gDAA8B;AAC9B,yDAAuC;AACvC,iEAA+C"}