@crowdin/app-project-module 3.0.1 → 3.1.0

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.
@@ -13,6 +13,27 @@ export interface UserErrors {
13
13
  crowdinId: string;
14
14
  integrationId?: string;
15
15
  }
16
+ export interface UserErrorListItem {
17
+ id: number;
18
+ action: string;
19
+ message: string;
20
+ createdAt: string;
21
+ }
22
+ export interface UserErrorsFilter {
23
+ crowdinId: string;
24
+ integrationId?: string;
25
+ search?: string;
26
+ }
27
+ export interface GetUserErrorsParams extends UserErrorsFilter {
28
+ limit: number;
29
+ offset: number;
30
+ orderDirection?: 'asc' | 'desc';
31
+ }
32
+ export interface GetUserErrorParams {
33
+ id: number;
34
+ crowdinId: string;
35
+ integrationId?: string;
36
+ }
16
37
  export type DB_TYPE = 'sqlite' | 'postgresql' | 'd1';
17
38
  export type DRIZZLE_DB = SQLITE_DB | POSTGRESQL_DB | D1_DB;
18
39
  export interface Storage {
@@ -48,7 +69,16 @@ export interface Storage {
48
69
  getWebhooks(fileId: string, integrationId: string, crowdinId: string, provider: Provider): Promise<IntegrationWebhooks | undefined>;
49
70
  saveWebhooks(fileId: string, integrationId: string, crowdinId: string, provider: Provider): Promise<void>;
50
71
  deleteWebhooks(fileIds: string[], integrationId: string, crowdinId: string, provider: Provider): Promise<void>;
72
+ /**
73
+ * @deprecated loads every error log together with its full `data` payload, which can
74
+ * exhaust memory on large tables. Use {@link Storage.getUserErrors} together with
75
+ * {@link Storage.countUserErrors} for the list and {@link Storage.getUserError} for a
76
+ * single record.
77
+ */
51
78
  getAllUserErrors(crowdinId: string, integrationId?: string): Promise<UserErrors[] | undefined>;
79
+ getUserErrors(params: GetUserErrorsParams): Promise<UserErrorListItem[]>;
80
+ countUserErrors(params: UserErrorsFilter): Promise<number>;
81
+ getUserError(params: GetUserErrorParams): Promise<UserErrors | undefined>;
52
82
  saveUserError(action: string, message: string, data: string, createdAt: string, crowdinId: string, integrationId?: string): Promise<void>;
53
83
  deleteUserErrors(date: string, crowdinId: string, integrationId?: string): Promise<void>;
54
84
  deleteAllUsersErrorsOlderThan(date: string): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",