@tstdl/base 0.82.4 → 0.82.6

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 (171) hide show
  1. package/api/types.d.ts +2 -1
  2. package/api/types.js.map +1 -1
  3. package/authentication/authentication-credentials.repository.d.ts +5 -0
  4. package/authentication/{authentication-credentials.service.js → authentication-credentials.repository.js} +6 -6
  5. package/authentication/authentication-credentials.repository.js.map +1 -0
  6. package/authentication/authentication-session.repository.d.ts +13 -4
  7. package/authentication/authentication-session.repository.js +2 -13
  8. package/authentication/authentication-session.repository.js.map +1 -1
  9. package/authentication/authentication.api.d.ts +28 -0
  10. package/authentication/authentication.api.js +53 -0
  11. package/authentication/authentication.api.js.map +1 -0
  12. package/authentication/authentication.service.d.ts +13 -13
  13. package/authentication/authentication.service.js +50 -25
  14. package/authentication/authentication.service.js.map +1 -1
  15. package/authentication/models/authentication-credentials.model.d.ts +7 -5
  16. package/authentication/models/authentication-credentials.model.js +28 -7
  17. package/authentication/models/authentication-credentials.model.js.map +1 -1
  18. package/authentication/models/authentication-session.model.d.ts +13 -6
  19. package/authentication/models/authentication-session.model.js +47 -9
  20. package/authentication/models/authentication-session.model.js.map +1 -1
  21. package/authentication/models/index.d.ts +1 -0
  22. package/authentication/models/index.js +1 -0
  23. package/authentication/models/index.js.map +1 -1
  24. package/authentication/models/token-payload-base.model.d.ts +5 -0
  25. package/{orm/test.js → authentication/models/token-payload-base.model.js} +19 -10
  26. package/authentication/models/token-payload-base.model.js.map +1 -0
  27. package/authentication/mongo/mongo-authentication-credentials.repository.d.ts +25 -0
  28. package/authentication/mongo/mongo-authentication-credentials.repository.js +65 -0
  29. package/authentication/mongo/mongo-authentication-credentials.repository.js.map +1 -0
  30. package/authentication/mongo/mongo-authentication-session.repository.d.ts +26 -0
  31. package/authentication/mongo/mongo-authentication-session.repository.js +64 -0
  32. package/authentication/mongo/mongo-authentication-session.repository.js.map +1 -0
  33. package/database/mongo/model/document.d.ts +0 -1
  34. package/database/mongo/model/document.js +1 -10
  35. package/database/mongo/model/document.js.map +1 -1
  36. package/database/mongo/module.js +0 -3
  37. package/database/mongo/module.js.map +1 -1
  38. package/database/mongo/query-converter.js.map +1 -1
  39. package/database/query.d.ts +1 -1
  40. package/examples/mail/basic.js +3 -3
  41. package/examples/mail/templates/hello-name.js +7 -2
  42. package/examples/mail/templates/hello-name.js.map +1 -1
  43. package/examples/pdf/basic.js +3 -3
  44. package/examples/pdf/templates/hello-name.js +1 -1
  45. package/examples/pdf/templates/hello-name.js.map +1 -1
  46. package/examples/template/basic.js +13 -7
  47. package/examples/template/basic.js.map +1 -1
  48. package/examples/template/templates/hello-jsx.d.ts +2 -0
  49. package/examples/template/templates/hello-jsx.js +15 -0
  50. package/examples/template/templates/hello-jsx.js.map +1 -0
  51. package/examples/template/templates/hello-name.js +1 -1
  52. package/examples/template/templates/hello-name.js.map +1 -1
  53. package/http/client/adapters/undici-http-client.adapter.js.map +1 -1
  54. package/http/types.d.ts +3 -3
  55. package/mail/mail.service.d.ts +4 -3
  56. package/mail/mail.service.js +5 -8
  57. package/mail/mail.service.js.map +1 -1
  58. package/mail/models/mail-log.model.d.ts +1 -1
  59. package/mail/models/mail-template.model.d.ts +1 -1
  60. package/mail/models/mail-template.model.js +2 -1
  61. package/mail/models/mail-template.model.js.map +1 -1
  62. package/notification/models/notification.model.d.ts +23 -5
  63. package/notification/models/notification.model.js +47 -3
  64. package/notification/models/notification.model.js.map +1 -1
  65. package/notification/notification.repository.d.ts +5 -0
  66. package/notification/notification.repository.js +7 -0
  67. package/notification/notification.repository.js.map +1 -0
  68. package/notification/notification.service.d.ts +2 -2
  69. package/notification/notification.service.js +4 -4
  70. package/notification/notification.service.js.map +1 -1
  71. package/package.json +6 -4
  72. package/pdf/pdf.service.d.ts +5 -4
  73. package/pdf/pdf.service.js +7 -6
  74. package/pdf/pdf.service.js.map +1 -1
  75. package/schema/schemas/assign.d.ts +3 -3
  76. package/schema/utils/schema.js.map +1 -1
  77. package/templates/providers/{file.provider-template.d.ts → file.template-provider.d.ts} +1 -1
  78. package/templates/providers/{file.provider-template.js → file.template-provider.js} +2 -2
  79. package/templates/providers/file.template-provider.js.map +1 -0
  80. package/templates/providers/memory.template-provider.d.ts +1 -1
  81. package/templates/providers/memory.template-provider.js +1 -1
  82. package/templates/providers/memory.template-provider.js.map +1 -1
  83. package/templates/renderers/handlebars.template-renderer.js.map +1 -1
  84. package/templates/renderers/jsx.template-renderer.d.ts +16 -0
  85. package/templates/renderers/jsx.template-renderer.js +40 -0
  86. package/templates/renderers/jsx.template-renderer.js.map +1 -0
  87. package/templates/renderers/mjml.template-renderer.d.ts +1 -1
  88. package/templates/renderers/string.template-renderer.d.ts +2 -2
  89. package/templates/renderers/string.template-renderer.js +1 -1
  90. package/templates/renderers/string.template-renderer.js.map +1 -1
  91. package/templates/resolvers/file.template-resolver.d.ts +2 -2
  92. package/templates/resolvers/jsx.template-resolver.d.ts +15 -0
  93. package/templates/resolvers/jsx.template-resolver.js +45 -0
  94. package/templates/resolvers/jsx.template-resolver.js.map +1 -0
  95. package/templates/resolvers/string.template-resolver.d.ts +1 -1
  96. package/templates/resolvers/string.template-resolver.js +1 -1
  97. package/templates/resolvers/string.template-resolver.js.map +1 -1
  98. package/templates/template.model.d.ts +3 -1
  99. package/templates/template.model.js +8 -1
  100. package/templates/template.model.js.map +1 -1
  101. package/templates/template.provider.d.ts +1 -1
  102. package/templates/template.renderer.d.ts +5 -2
  103. package/templates/template.renderer.js +6 -1
  104. package/templates/template.renderer.js.map +1 -1
  105. package/templates/template.resolver.d.ts +2 -2
  106. package/templates/template.service.d.ts +3 -2
  107. package/templates/template.service.js +6 -1
  108. package/templates/template.service.js.map +1 -1
  109. package/templates/tokens.d.ts +1 -1
  110. package/text/localization.service.js +1 -1
  111. package/text/localization.service.js.map +1 -1
  112. package/tsconfig.json +5 -0
  113. package/types.d.ts +6 -32
  114. package/utils/jwt.js +2 -2
  115. package/utils/jwt.js.map +1 -1
  116. package/utils/object/object.d.ts +1 -1
  117. package/utils/object/object.js +6 -5
  118. package/utils/object/object.js.map +1 -1
  119. package/authentication/authentication-credentials.service.d.ts +0 -6
  120. package/authentication/authentication-credentials.service.js.map +0 -1
  121. package/orm/decorators.d.ts +0 -26
  122. package/orm/decorators.js +0 -172
  123. package/orm/decorators.js.map +0 -1
  124. package/orm/entity-definition.model.d.ts +0 -51
  125. package/orm/entity-definition.model.js +0 -27
  126. package/orm/entity-definition.model.js.map +0 -1
  127. package/orm/index.d.ts +0 -1
  128. package/orm/index.js +0 -18
  129. package/orm/index.js.map +0 -1
  130. package/orm/models/entity.d.ts +0 -22
  131. package/orm/models/entity.js +0 -87
  132. package/orm/models/entity.js.map +0 -1
  133. package/orm/models/index.d.ts +0 -1
  134. package/orm/models/index.js +0 -18
  135. package/orm/models/index.js.map +0 -1
  136. package/orm/repository/mongo/classes.d.ts +0 -25
  137. package/orm/repository/mongo/classes.js +0 -33
  138. package/orm/repository/mongo/classes.js.map +0 -1
  139. package/orm/repository/mongo/module.d.ts +0 -8
  140. package/orm/repository/mongo/module.js +0 -88
  141. package/orm/repository/mongo/module.js.map +0 -1
  142. package/orm/repository/mongo/mongo-repository.d.ts +0 -11
  143. package/orm/repository/mongo/mongo-repository.js +0 -55
  144. package/orm/repository/mongo/mongo-repository.js.map +0 -1
  145. package/orm/repository/mongo/mongo-transaction.d.ts +0 -10
  146. package/orm/repository/mongo/mongo-transaction.js +0 -28
  147. package/orm/repository/mongo/mongo-transaction.js.map +0 -1
  148. package/orm/repository/repository.d.ts +0 -75
  149. package/orm/repository/repository.js +0 -182
  150. package/orm/repository/repository.js.map +0 -1
  151. package/orm/repository/transaction.d.ts +0 -26
  152. package/orm/repository/transaction.js +0 -65
  153. package/orm/repository/transaction.js.map +0 -1
  154. package/orm/sql/sql-repository.d.ts +0 -6
  155. package/orm/sql/sql-repository.js +0 -15
  156. package/orm/sql/sql-repository.js.map +0 -1
  157. package/orm/test.d.ts +0 -1
  158. package/orm/test.js.map +0 -1
  159. package/orm/types/definition.d.ts +0 -19
  160. package/orm/types/definition.js +0 -55
  161. package/orm/types/definition.js.map +0 -1
  162. package/orm/types/index.d.ts +0 -3
  163. package/orm/types/index.js +0 -20
  164. package/orm/types/index.js.map +0 -1
  165. package/orm/types/options.d.ts +0 -36
  166. package/orm/types/options.js +0 -5
  167. package/orm/types/options.js.map +0 -1
  168. package/orm/types/query.d.ts +0 -110
  169. package/orm/types/query.js +0 -10
  170. package/orm/types/query.js.map +0 -1
  171. package/templates/providers/file.provider-template.js.map +0 -1
@@ -1,36 +0,0 @@
1
- import type { Paths, TypedOmit } from "../../types";
2
- import type { Transaction } from '../repository/transaction';
3
- import type { Query } from './query';
4
- export type Order = 'asc' | 'desc';
5
- export declare const allOrders: Order[];
6
- export type Sort<T = unknown> = {
7
- field: (Extract<keyof T, string> | '$score');
8
- order?: Order;
9
- };
10
- export type SortOptions<T = unknown> = {
11
- sort?: Sort<T>[];
12
- };
13
- export type SkipOptions = {
14
- skip?: number;
15
- };
16
- export type LimitOptions = {
17
- limit?: number;
18
- };
19
- export type BaseOptions = {
20
- transaction?: Transaction;
21
- };
22
- export type HasOptions = BaseOptions;
23
- export type LoadOptions<T> = BaseOptions & SkipOptions & SortOptions<T> & {
24
- /** include deleted */
25
- deleted?: boolean;
26
- };
27
- export type LoadManyOptions<T> = LoadOptions<T> & LimitOptions;
28
- export type SaveOptions<T> = BaseOptions & {
29
- /** update existing */
30
- upsert?: Paths<T> | Query<T>;
31
- };
32
- export type InsertOptions = BaseOptions;
33
- export type PatchOptions<T> = BaseOptions & SkipOptions & SortOptions<T>;
34
- export type PatchManyOptions<T> = PatchOptions<T> & LimitOptions;
35
- export type DeleteOptions<T> = TypedOmit<LoadOptions<T>, 'deleted'>;
36
- export type DeleteManyOptions<T> = TypedOmit<LoadManyOptions<T>, 'deleted'>;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.allOrders = void 0;
4
- exports.allOrders = ['asc', 'desc'];
5
- //# sourceMappingURL=options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../source/orm/types/options.ts"],"names":[],"mappings":";;;AAKa,QAAA,SAAS,GAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC"}
@@ -1,110 +0,0 @@
1
- import type { Flatten, StringMap } from "../../types";
2
- import type { Geometry } from "../../types/geo-json";
3
- export type LogicalQuery<T = unknown> = LogicalAndQuery<T> | LogicalOrQuery<T> | LogicalNorQuery<T>;
4
- export type LogicalQueryTypes = keyof (LogicalAndQuery & LogicalOrQuery & LogicalNorQuery);
5
- export declare const allLogicalQueryTypes: LogicalQueryTypes[];
6
- export type ComparisonQueryBody<T = unknown> = {
7
- [P in keyof T]?: ComparisonQueryOrValue<T[P]>;
8
- } & StringMap<ComparisonQueryOrValue>;
9
- export type ComparisonQueryOrValue<T = unknown> = T | ComparisonQuery<T> | Flatten<T>;
10
- export type ComparisonQuery<T = unknown> = Partial<ComparisonNotQuery<T> & ComparisonEqualsQuery<T> & ComparisonNotEqualsQuery<T> & ComparisonExistsQuery & ComparisonItemQuery<T> & ComparisonInQuery<T> & ComparisonNotInQuery<T> & ComparisonAllQuery<T> & ComparisonGreaterThanQuery<T> & ComparisonGreaterThanOrEqualsQuery<T> & ComparisonLessThanQuery<T> & ComparisonLessThanOrEqualsQuery<T> & ComparisonRegexQuery & ComparisonTextQuery & ComparisonGeoShapeQuery & ComparisonGeoDistanceQuery>;
11
- export type ComparisonQueryTypes = keyof ComparisonQuery;
12
- export declare const allComparisonQueryTypes: ComparisonQueryTypes[];
13
- export type SpecialQuery<T = unknown> = Partial<TextSpanQuery<T>>;
14
- export type SpecialQueryTypes = keyof SpecialQuery;
15
- export declare const allSpecialQueryTypes: SpecialQueryTypes[];
16
- export type Query<T = unknown> = LogicalQuery<T> | (ComparisonQueryBody<T> & SpecialQuery<T>);
17
- export type QueryTypes = LogicalQueryTypes | ComparisonQueryTypes | SpecialQueryTypes;
18
- export declare const allQueryTypes: ("$and" | "$or" | "$nor" | "$not" | "$eq" | "$neq" | "$exists" | "$item" | "$in" | "$nin" | "$all" | "$gt" | "$gte" | "$lt" | "$lte" | "$regex" | "$text" | "$geoShape" | "$geoDistance" | "$textSpan")[];
19
- export type Operator = 'and' | 'or';
20
- export declare const allOperators: Operator[];
21
- export type LogicalAndQuery<T = unknown> = {
22
- $and: Query<T>[];
23
- };
24
- export type LogicalOrQuery<T = unknown> = {
25
- $or: Query<T>[];
26
- };
27
- export type LogicalNorQuery<T = unknown> = {
28
- $nor: Query<T>[];
29
- };
30
- export type ComparisonValue<T> = T | Flatten<T>;
31
- export type ComparisonValueWithRegex<T> = T extends string ? ComparisonValue<T | RegExp> : T extends string[] ? ComparisonValue<(Flatten<T> | RegExp)[]> : (T | Flatten<T>);
32
- export type ComparisonNotQuery<T = unknown> = {
33
- $not: ComparisonQuery<T>;
34
- };
35
- export type ComparisonEqualsQuery<T = unknown> = {
36
- $eq: ComparisonValueWithRegex<T>;
37
- };
38
- export type ComparisonNotEqualsQuery<T = unknown> = {
39
- $neq: ComparisonValueWithRegex<T>;
40
- };
41
- export type ComparisonExistsQuery = {
42
- $exists: ComparisonValue<boolean>;
43
- };
44
- export type ComparisonItemQuery<T = unknown> = {
45
- $item: T extends (infer U)[] ? U extends Record<string | number, unknown> ? Query<U> : ComparisonQuery<U> : never;
46
- };
47
- export type ComparisonInQuery<T = unknown> = {
48
- $in: ComparisonValueWithRegex<T>[];
49
- };
50
- export type ComparisonNotInQuery<T = unknown> = {
51
- $nin: ComparisonValueWithRegex<T>[];
52
- };
53
- export type ComparisonAllQuery<T = unknown> = {
54
- $all: ComparisonValueWithRegex<T>[];
55
- };
56
- export type ComparisonGreaterThanQuery<T = unknown> = {
57
- $gt: ComparisonValue<T>;
58
- };
59
- export type ComparisonGreaterThanOrEqualsQuery<T = unknown> = {
60
- $gte: ComparisonValue<T>;
61
- };
62
- export type ComparisonLessThanQuery<T = unknown> = {
63
- $lt: ComparisonValue<T>;
64
- };
65
- export type ComparisonLessThanOrEqualsQuery<T = unknown> = {
66
- $lte: ComparisonValue<T>;
67
- };
68
- export type ComparisonRegexQuery = {
69
- $regex: string | RegExp | {
70
- pattern: string;
71
- flags: string;
72
- };
73
- };
74
- export type ComparisonTextQuery = {
75
- $text: string | {
76
- text: string;
77
- operator?: Operator;
78
- };
79
- };
80
- export type GeoShapeRelation = 'intersects' | 'within' | 'disjoint' | 'contains';
81
- export type ComparisonGeoShapeQuery = {
82
- $geoShape: {
83
- geometry: Geometry;
84
- relation: GeoShapeRelation;
85
- };
86
- };
87
- export type ComparisonGeoDistanceQuery = {
88
- $geoDistance: {
89
- longitude: number;
90
- latitude: number;
91
- /**
92
- * maximum distance in meters
93
- */
94
- maxDistance?: number;
95
- /**
96
- * minimum distance in meters
97
- */
98
- minDistance?: number;
99
- };
100
- };
101
- export type TextSpanQueryMode = 'best' | 'most' | 'cross';
102
- export declare const allTextSpanQueryModes: TextSpanQueryMode[];
103
- export type TextSpanQuery<T = unknown> = {
104
- $textSpan: {
105
- fields: (Extract<keyof T, string>)[];
106
- text: string;
107
- mode?: TextSpanQueryMode;
108
- operator?: Operator;
109
- };
110
- };
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.allTextSpanQueryModes = exports.allOperators = exports.allQueryTypes = exports.allSpecialQueryTypes = exports.allComparisonQueryTypes = exports.allLogicalQueryTypes = void 0;
4
- exports.allLogicalQueryTypes = ['$and', '$or', '$nor'];
5
- exports.allComparisonQueryTypes = ['$all', '$not', '$eq', '$exists', '$gt', '$gte', '$in', '$item', '$lt', '$lte', '$neq', '$nin', '$regex', '$text', '$geoDistance', '$geoShape'];
6
- exports.allSpecialQueryTypes = ['$textSpan'];
7
- exports.allQueryTypes = [...exports.allLogicalQueryTypes, ...exports.allComparisonQueryTypes, ...exports.allSpecialQueryTypes];
8
- exports.allOperators = ['and', 'or'];
9
- exports.allTextSpanQueryModes = ['best', 'most', 'cross'];
10
- //# sourceMappingURL=query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../source/orm/types/query.ts"],"names":[],"mappings":";;;AAKa,QAAA,oBAAoB,GAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAyBpE,QAAA,uBAAuB,GAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AAInM,QAAA,oBAAoB,GAAwB,CAAC,WAAW,CAAC,CAAC;AAI1D,QAAA,aAAa,GAAG,CAAC,GAAG,4BAAoB,EAAE,GAAG,+BAAuB,EAAE,GAAG,4BAAoB,CAAC,CAAC;AAG/F,QAAA,YAAY,GAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AA0GzC,QAAA,qBAAqB,GAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"file.provider-template.js","sourceRoot":"","sources":["../../../source/templates/providers/file.provider-template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+CAAwE;AACxE,qEAA4D;AAC5D,yCAAkC;AAClC,6BAA6B;AAC7B,sDAA6C;AAC7C,4DAAwD;AAQ3C,QAAA,0BAA0B,GAA+B,EAAE,CAAC;AAEzE,MAAM,UAAU,GAAG,aAAa,CAAC;AAK1B,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,oCAAgB;IACvC,QAAQ,CAAS;IAEzB,CAAC,+BAAmB,CAAC,CAA+B;IAC7D,YAAyB,QAAgB;QACvC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW;;QACnB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACzB,MAAM,IAAI,mCAAe,CAAC,gEAAgE,CAAC,CAAC;SAC7F;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG,KAAK,CAAC,CAAC;QAE1D,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACvC,MAAM,IAAI,mCAAe,CAAC,sCAAsC,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC;SACpF;QAED,MAAM,cAAc,GAAG,YAAa,QAAQ,4CAAyB,CAAC;QACtE,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC;QAC3C,OAAO,eAAM,CAAC,KAAK,CAAC,yBAAQ,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC;CACF,CAAA;AAzBY,oBAAoB;IAHhC,IAAA,qBAAS,EAAC;QACT,uBAAuB,EAAE,GAAG,EAAE,CAAC,kCAA0B,CAAC,QAAQ;KACnE,CAAC;IAKa,WAAA,IAAA,qBAAS,GAAE,CAAA;;GAJb,oBAAoB,CAyBhC;AAzBY,oDAAoB;AA2BjC,SAAgB,6BAA6B,CAAC,SAA8C,EAAE;IAC5F,kCAA0B,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,kCAA0B,CAAC,QAAQ,CAAC;AAC/F,CAAC;AAFD,sEAEC"}