@tstdl/base 0.92.85 → 0.92.86

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 (79) hide show
  1. package/ai/ai.service.d.ts +1 -1
  2. package/ai/ai.service.js +3 -3
  3. package/ai/types.d.ts +1 -1
  4. package/authentication/authentication.api.d.ts +9 -9
  5. package/authentication/models/schemas.d.ts +2 -2
  6. package/cancellation/token.d.ts +1 -1
  7. package/document-management/api/document-management.api.d.ts +94 -94
  8. package/document-management/models/document-category.model.d.ts +1 -0
  9. package/document-management/models/document-index.model.d.ts +7 -0
  10. package/document-management/models/document-index.model.js +32 -0
  11. package/document-management/models/document-request-file.model.d.ts +1 -1
  12. package/document-management/models/document-request-file.model.js +2 -2
  13. package/document-management/models/document-type.model.d.ts +1 -0
  14. package/document-management/models/document.model.d.ts +1 -1
  15. package/document-management/models/document.model.js +2 -2
  16. package/document-management/models/service-models/document.service-model.d.ts +51 -51
  17. package/document-management/models/service-models/document.service-model.js +2 -2
  18. package/document-management/server/drizzle/{0000_sloppy_fenris.sql → 0000_useful_overlord.sql} +2 -2
  19. package/document-management/server/drizzle/meta/0000_snapshot.json +5 -5
  20. package/document-management/server/drizzle/meta/_journal.json +2 -2
  21. package/document-management/server/drizzle.config.js +1 -1
  22. package/document-management/server/module.d.ts +1 -1
  23. package/document-management/server/module.js +1 -1
  24. package/document-management/server/schemas.d.ts +33 -0
  25. package/document-management/{models → server}/schemas.js +14 -14
  26. package/document-management/server/services/document-management.service.d.ts +17 -3
  27. package/document-management/server/services/document-management.service.js +65 -17
  28. package/examples/orm/schemas.d.ts +1 -1
  29. package/mail/drizzle.config.js +1 -1
  30. package/mail/models/schemas.d.ts +1 -1
  31. package/orm/decorators.d.ts +4 -4
  32. package/orm/entity.d.ts +5 -7
  33. package/orm/entity.js +9 -1
  34. package/orm/index.d.ts +1 -0
  35. package/orm/index.js +1 -0
  36. package/orm/query.d.ts +1 -3
  37. package/orm/query.js +0 -1
  38. package/orm/repository.types.d.ts +32 -0
  39. package/orm/repository.types.js +1 -0
  40. package/orm/server/database-schema.d.ts +4 -4
  41. package/orm/server/drizzle/schema-converter.d.ts +1 -1
  42. package/orm/server/index.d.ts +1 -0
  43. package/orm/server/index.js +1 -0
  44. package/orm/server/query-converter.d.ts +1 -2
  45. package/orm/server/query-converter.js +66 -61
  46. package/orm/server/repository.d.ts +78 -42
  47. package/orm/server/repository.js +202 -106
  48. package/orm/server/sqls.d.ts +7 -0
  49. package/orm/server/sqls.js +6 -0
  50. package/orm/server/types.d.ts +3 -3
  51. package/orm/types.d.ts +1 -1
  52. package/package.json +11 -9
  53. package/queue/enqueue-batch.d.ts +1 -0
  54. package/queue/enqueue-batch.js +1 -1
  55. package/queue/mongo/queue.d.ts +9 -4
  56. package/queue/mongo/queue.js +5 -6
  57. package/queue/postgres/drizzle/0000_zippy_moondragon.sql +11 -0
  58. package/queue/postgres/drizzle/meta/0000_snapshot.json +90 -0
  59. package/queue/postgres/drizzle/meta/_journal.json +13 -0
  60. package/queue/postgres/drizzle.config.d.ts +2 -0
  61. package/queue/postgres/drizzle.config.js +11 -0
  62. package/queue/postgres/index.d.ts +4 -0
  63. package/queue/postgres/index.js +4 -0
  64. package/queue/postgres/job.model.d.ts +13 -0
  65. package/queue/postgres/job.model.js +55 -0
  66. package/queue/postgres/module.d.ts +9 -0
  67. package/queue/postgres/module.js +29 -0
  68. package/queue/postgres/queue.d.ts +28 -0
  69. package/queue/postgres/queue.js +149 -0
  70. package/queue/postgres/queue.provider.d.ts +7 -0
  71. package/queue/postgres/queue.provider.js +21 -0
  72. package/queue/postgres/schemas.d.ts +3 -0
  73. package/queue/postgres/schemas.js +4 -0
  74. package/queue/provider.d.ts +2 -1
  75. package/queue/queue.d.ts +18 -6
  76. package/schema/schemas/object.d.ts +1 -1
  77. package/utils/timing.d.ts +4 -3
  78. package/utils/timing.js +3 -1
  79. package/document-management/models/schemas.d.ts +0 -33
@@ -44,7 +44,7 @@ export declare class AiService implements Resolvable<AiServiceArgument> {
44
44
  processFiles(fileInputs: FileInput[]): Promise<FileContentPart[]>;
45
45
  getFileById(id: string): FileContentPart;
46
46
  classify<T extends EnumerationType>(parts: OneOrMany<ContentPart>, types: T, options?: GenerationOptions & Pick<GenerationRequest, 'model'>): Promise<SpecializedGenerationResult<ClassificationResult<T>>>;
47
- getClassifyConents(parts: OneOrMany<ContentPart>): Content[];
47
+ getClassifyContents(parts: OneOrMany<ContentPart>): Content[];
48
48
  extractData<T>(parts: OneOrMany<ContentPart>, schema: SchemaTestable<T>, options?: GenerationOptions & Pick<GenerationRequest, 'model'>): Promise<SpecializedGenerationResult<T>>;
49
49
  getExtractDataConents(parts: OneOrMany<ContentPart>): Content[];
50
50
  analyzeContent<T extends EnumerationType>(parts: OneOrMany<ContentPart>, types: T, options?: GenerationOptions & {
package/ai/ai.service.js CHANGED
@@ -43,7 +43,7 @@ let AiService = class AiService {
43
43
  #genAI = (isDefined(this.#options.vertex)
44
44
  ? new VertexAI({ project: this.#options.vertex.project, location: this.#options.vertex.location, googleAuthOptions: { apiKey: this.#options.apiKey, keyFile: this.#options.keyFile } })
45
45
  : new GoogleGenerativeAI(assertDefinedPass(this.#options.apiKey, 'Api key not defined')));
46
- defaultModel = this.#options.defaultModel ?? 'gemini-2.0-flash-exp';
46
+ defaultModel = this.#options.defaultModel ?? 'gemini-2.0-flash';
47
47
  createSession() {
48
48
  return new AiSession(this);
49
49
  }
@@ -72,14 +72,14 @@ let AiService = class AiService {
72
72
  },
73
73
  generationSchema,
74
74
  systemInstruction: 'You are a highly accurate document classification AI. Your task is to analyze the content of a given document and determine its type based on a predefined list of possible document types.',
75
- contents: this.getClassifyConents(parts)
75
+ contents: this.getClassifyContents(parts)
76
76
  });
77
77
  return {
78
78
  result: JSON.parse(assertNotNullPass(generation.text, 'No text returned.')),
79
79
  raw: generation
80
80
  };
81
81
  }
82
- getClassifyConents(parts) {
82
+ getClassifyContents(parts) {
83
83
  return [{
84
84
  role: 'user',
85
85
  parts: [
package/ai/types.d.ts CHANGED
@@ -52,7 +52,7 @@ export type Content = {
52
52
  };
53
53
  export type FunctionCallingMode = 'auto' | 'force' | 'none';
54
54
  export type FinishReason = 'stop' | 'maxTokens' | 'unknown';
55
- export type AiModel = LiteralUnion<'gemini-2.0-flash-exp' | 'gemini-exp-1206' | 'gemini-2.0-flash-thinking-exp-1219', string>;
55
+ export type AiModel = LiteralUnion<'gemini-2.0-flash' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21', string>;
56
56
  export type GenerationOptions = {
57
57
  maxOutputTokens?: number;
58
58
  temperature?: number;
@@ -84,8 +84,8 @@ export declare const authenticationApiDefinition: {
84
84
  resource: string;
85
85
  method: "POST";
86
86
  parameters: ObjectSchema<{
87
- readonly token: string;
88
- readonly newSecret: string;
87
+ token: string;
88
+ newSecret: string;
89
89
  }>;
90
90
  result: import("../schema/index.js").LiteralSchema<"ok">;
91
91
  };
@@ -93,7 +93,7 @@ export declare const authenticationApiDefinition: {
93
93
  resource: string;
94
94
  method: "POST";
95
95
  parameters: ObjectSchema<{
96
- readonly secret: string;
96
+ secret: string;
97
97
  }>;
98
98
  result: typeof SecretCheckResult;
99
99
  };
@@ -179,8 +179,8 @@ export declare function getAuthenticationApiDefinition<AdditionalTokenPayload ex
179
179
  resource: string;
180
180
  method: "POST";
181
181
  parameters: ObjectSchema<{
182
- readonly token: string;
183
- readonly newSecret: string;
182
+ token: string;
183
+ newSecret: string;
184
184
  }>;
185
185
  result: import("../schema/index.js").LiteralSchema<"ok">;
186
186
  };
@@ -188,7 +188,7 @@ export declare function getAuthenticationApiDefinition<AdditionalTokenPayload ex
188
188
  resource: string;
189
189
  method: "POST";
190
190
  parameters: ObjectSchema<{
191
- readonly secret: string;
191
+ secret: string;
192
192
  }>;
193
193
  result: typeof SecretCheckResult;
194
194
  };
@@ -272,8 +272,8 @@ export declare function getAuthenticationApiEndpointsDefinition<AdditionalTokenP
272
272
  resource: string;
273
273
  method: "POST";
274
274
  parameters: ObjectSchema<{
275
- readonly token: string;
276
- readonly newSecret: string;
275
+ token: string;
276
+ newSecret: string;
277
277
  }>;
278
278
  result: import("../schema/index.js").LiteralSchema<"ok">;
279
279
  };
@@ -281,7 +281,7 @@ export declare function getAuthenticationApiEndpointsDefinition<AdditionalTokenP
281
281
  resource: string;
282
282
  method: "POST";
283
283
  parameters: ObjectSchema<{
284
- readonly secret: string;
284
+ secret: string;
285
285
  }>;
286
286
  result: typeof SecretCheckResult;
287
287
  };
@@ -1,5 +1,5 @@
1
1
  import { AuthenticationCredentials } from './authentication-credentials.model.js';
2
2
  import { AuthenticationSession } from './authentication-session.model.js';
3
3
  export declare const authenticationSchema: import("../../orm/server/database-schema.js").DatabaseSchema<"authentication">;
4
- export declare const authenticationCredentials: import("../../orm/server/types.js").PgTableFromType<"authentication", typeof AuthenticationCredentials>;
5
- export declare const authenticationSession: import("../../orm/server/types.js").PgTableFromType<"authentication", typeof AuthenticationSession>;
4
+ export declare const authenticationCredentials: import("../../orm/server/types.js").PgTableFromType<typeof AuthenticationCredentials, "authentication">;
5
+ export declare const authenticationSession: import("../../orm/server/types.js").PgTableFromType<typeof AuthenticationSession, "authentication">;
@@ -81,7 +81,7 @@ export declare class CancellationSignal implements PromiseLike<void>, Subscribab
81
81
  * @param target receiver to connect
82
82
  */
83
83
  connect(target: CancellationToken, config?: ConnectConfig): void;
84
- then<TResult>(onfulfilled?: ((value: void) => TResult | PromiseLike<TResult>) | undefined | null): Promise<TResult>;
84
+ then<TResult>(onfulfilled?: ((value: void) => TResult | PromiseLike<TResult>) | null): Promise<TResult>;
85
85
  subscribe(observer: Partial<Observer<void>>): Unsubscribable;
86
86
  }
87
87
  export declare class CancellationToken extends CancellationSignal {