@crowdin/app-project-module 1.16.0 → 2.0.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.
Files changed (99) hide show
  1. package/out/index.js +8 -15
  2. package/out/middlewares/auto-credentials-masker.js +5 -2
  3. package/out/middlewares/crowdin-client.d.ts +1 -1
  4. package/out/middlewares/crowdin-client.js +1 -1
  5. package/out/middlewares/export.d.ts +2 -2
  6. package/out/middlewares/export.js +4 -35
  7. package/out/middlewares/json-response.d.ts +1 -1
  8. package/out/middlewares/json-response.js +1 -1
  9. package/out/modules/ai-prompt-provider/index.js +6 -6
  10. package/out/modules/ai-provider/index.js +7 -7
  11. package/out/modules/ai-provider/types.d.ts +10 -0
  12. package/out/modules/ai-provider/types.js +12 -0
  13. package/out/modules/ai-provider/util/index.d.ts +0 -10
  14. package/out/modules/ai-provider/util/index.js +2 -13
  15. package/out/modules/ai-request-processors/index.js +4 -4
  16. package/out/modules/api/api.js +18 -18
  17. package/out/modules/auth-guard/index.js +4 -5
  18. package/out/modules/automation-action/index.js +4 -6
  19. package/out/modules/context-menu/index.js +4 -13
  20. package/out/modules/custom-mt/index.js +4 -4
  21. package/out/modules/custom-spell-check/index.js +11 -11
  22. package/out/modules/editor-right-panel/index.js +1 -1
  23. package/out/modules/external-qa-check/index.js +7 -7
  24. package/out/modules/file-processing/index.js +14 -14
  25. package/out/modules/integration/index.js +26 -26
  26. package/out/modules/integration/types.d.ts +4 -4
  27. package/out/modules/integration/util/files.js +1 -1
  28. package/out/modules/integration/util/types.d.ts +1 -1
  29. package/out/modules/manifest.js +70 -281
  30. package/out/modules/modal/index.js +4 -13
  31. package/out/modules/organization-menu/index.js +1 -1
  32. package/out/modules/organization-settings-menu/index.js +1 -1
  33. package/out/modules/profile-resources-menu/index.js +1 -1
  34. package/out/modules/profile-settings-menu/index.js +1 -1
  35. package/out/modules/project-menu/index.js +1 -1
  36. package/out/modules/project-menu-crowdsource/index.js +1 -1
  37. package/out/modules/project-reports/index.js +1 -1
  38. package/out/modules/project-tools/index.js +1 -1
  39. package/out/modules/webhooks/index.js +3 -6
  40. package/out/modules/workflow-step-type/index.js +6 -6
  41. package/out/storage/drizzle/d1/index.d.ts +7 -0
  42. package/out/storage/drizzle/d1/index.js +48 -0
  43. package/out/storage/drizzle/d1/migrations/init.d.ts +2 -0
  44. package/out/storage/drizzle/d1/migrations/init.js +122 -0
  45. package/out/storage/drizzle/d1/types.d.ts +13 -0
  46. package/out/storage/drizzle/d1/types.js +38 -0
  47. package/out/storage/{sqlite.d.ts → drizzle/index.d.ts} +37 -58
  48. package/out/storage/drizzle/index.js +939 -0
  49. package/out/storage/drizzle/postgresql/config.d.ts +5 -0
  50. package/out/storage/drizzle/postgresql/config.js +11 -0
  51. package/out/storage/drizzle/postgresql/index.d.ts +14 -0
  52. package/out/storage/drizzle/postgresql/index.js +144 -0
  53. package/out/storage/drizzle/postgresql/migrations/0000_init.sql +113 -0
  54. package/out/storage/drizzle/postgresql/migrations/0001_init_indexes.sql +28 -0
  55. package/out/storage/drizzle/postgresql/migrations/meta/0000_snapshot.json +646 -0
  56. package/out/storage/drizzle/postgresql/migrations/meta/0001_snapshot.json +646 -0
  57. package/out/storage/drizzle/postgresql/migrations/meta/_journal.json +20 -0
  58. package/out/storage/drizzle/postgresql/schema.d.ts +1410 -0
  59. package/out/storage/drizzle/postgresql/schema.js +106 -0
  60. package/out/storage/drizzle/sqlite/config.d.ts +5 -0
  61. package/out/storage/drizzle/sqlite/config.js +11 -0
  62. package/out/storage/drizzle/sqlite/index.d.ts +8 -0
  63. package/out/storage/drizzle/sqlite/index.js +63 -0
  64. package/out/storage/drizzle/sqlite/migrations/0000_init.sql +113 -0
  65. package/out/storage/drizzle/sqlite/migrations/meta/0000_snapshot.json +687 -0
  66. package/out/storage/drizzle/sqlite/migrations/meta/_journal.json +13 -0
  67. package/out/storage/drizzle/sqlite/schema.d.ts +1544 -0
  68. package/out/storage/drizzle/sqlite/schema.js +106 -0
  69. package/out/storage/index.d.ts +2 -88
  70. package/out/storage/index.js +12 -128
  71. package/out/storage/internal/backup.d.ts +3 -0
  72. package/out/storage/internal/backup.js +94 -0
  73. package/out/storage/types.d.ts +66 -0
  74. package/out/types.d.ts +43 -47
  75. package/out/util/credentials-masker.js +2 -2
  76. package/out/util/export.d.ts +1 -0
  77. package/out/util/export.js +2 -1
  78. package/out/util/index.d.ts +2 -1
  79. package/out/util/index.js +12 -9
  80. package/out/util/normalize-module.d.ts +0 -1
  81. package/out/util/normalize-module.js +0 -4
  82. package/package.json +18 -22
  83. package/out/modules/ai-tools/handlers/tool-calls.d.ts +0 -4
  84. package/out/modules/ai-tools/handlers/tool-calls.js +0 -52
  85. package/out/modules/ai-tools/index.d.ts +0 -10
  86. package/out/modules/ai-tools/index.js +0 -46
  87. package/out/modules/ai-tools/types.d.ts +0 -63
  88. package/out/modules/ai-tools/types.js +0 -2
  89. package/out/modules/ai-tools/util/index.d.ts +0 -5
  90. package/out/modules/ai-tools/util/index.js +0 -24
  91. package/out/storage/d1.d.ts +0 -107
  92. package/out/storage/d1.js +0 -837
  93. package/out/storage/export.d.ts +0 -1
  94. package/out/storage/export.js +0 -2
  95. package/out/storage/mysql.d.ts +0 -109
  96. package/out/storage/mysql.js +0 -984
  97. package/out/storage/postgre.d.ts +0 -124
  98. package/out/storage/postgre.js +0 -1027
  99. package/out/storage/sqlite.js +0 -786
@@ -1,107 +0,0 @@
1
- import type { D1Database } from '@cloudflare/workers-types';
2
- import { Storage } from '.';
3
- import { CrowdinCredentials } from '../types';
4
- import { IntegrationConfig, IntegrationCredentials, IntegrationFilesSnapshot, IntegrationSyncSettings, IntegrationWebhooks } from '../modules/integration/types';
5
- import { CreateJobParams, GetActiveJobsParams, GetJobParams, GetFileTranslationCacheByLanguageParams, Job, TranslationCache, UpdateJobParams, UpdateTranslationCacheParams, GetFileTranslationCache, UnsyncedFiles, GetUnsyncedFiles, IntegrationSyncedData, GetAllJobsParams } from '../modules/integration/util/types';
6
- import { UserErrors } from './types';
7
- export interface D1StorageConfig {
8
- /**
9
- * Cloudflare D1 database binding
10
- * This should be passed from env.DB in Workers/Pages Functions
11
- */
12
- database: D1Database;
13
- }
14
- export declare class D1Storage implements Storage {
15
- private db;
16
- private migrated;
17
- tables: {
18
- crowdin_credentials: string;
19
- integration_credentials: string;
20
- sync_settings: string;
21
- app_metadata: string;
22
- files_snapshot: string;
23
- webhooks: string;
24
- user_errors: string;
25
- integration_settings: string;
26
- job: string;
27
- translation_file_cache: string;
28
- unsynced_files: string;
29
- synced_data: string;
30
- };
31
- constructor(config: D1StorageConfig);
32
- ensureMigrated(): Promise<void>;
33
- private addColumn;
34
- private updateTables;
35
- migrate(skipOnboarding?: boolean): Promise<void>;
36
- saveCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
37
- updateCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
38
- getCrowdinCredentials(id: string): Promise<CrowdinCredentials | undefined>;
39
- getAllCrowdinCredentials(): Promise<CrowdinCredentials[]>;
40
- deleteCrowdinCredentials(id: string): Promise<void>;
41
- saveIntegrationCredentials(id: string, credentials: any, crowdinId: string): Promise<void>;
42
- updateIntegrationCredentials(id: string, credentials: any): Promise<void>;
43
- updateIntegrationManagers(id: string, managers: any): Promise<void>;
44
- getIntegrationCredentials(id: string): Promise<IntegrationCredentials | undefined>;
45
- getAllIntegrationCredentials(crowdinId: string): Promise<IntegrationCredentials[]>;
46
- deleteIntegrationCredentials(id: string): Promise<void>;
47
- deleteAllIntegrationCredentials(crowdinId: string): Promise<void>;
48
- saveMetadata(id: string, metadata: any, crowdinId: string): Promise<void>;
49
- updateMetadata(id: string, metadata: any, crowdinId: string): Promise<void>;
50
- getMetadata(id: string): Promise<any>;
51
- getAllMetadata(): Promise<any[]>;
52
- deleteMetadata(id: string): Promise<void>;
53
- getSyncSettingsByProvider(integrationId: string, provider: string): Promise<IntegrationSyncSettings | undefined>;
54
- getSyncSettingsBySchedule(type: string, schedule: string): Promise<IntegrationSyncSettings[]>;
55
- saveSyncSettings(files: any, integrationId: string, crowdinId: string, type: string, provider: string): Promise<void>;
56
- updateSyncSettings(files: any, integrationId: string, crowdinId: string, type: string, provider: string): Promise<void>;
57
- getSyncSettings(integrationId: string, crowdinId: string, type: string, provider: string): Promise<IntegrationSyncSettings | undefined>;
58
- saveFilesSnapshot(files: any, integrationId: string, crowdinId: string, provider: string): Promise<void>;
59
- updateFilesSnapshot(files: any, integrationId: string, crowdinId: string, provider: string): Promise<void>;
60
- getFilesSnapshot(integrationId: string, crowdinId: string, provider: string): Promise<IntegrationFilesSnapshot | undefined>;
61
- getAllWebhooks(integrationId: string, crowdinId: string, provider: string): Promise<IntegrationWebhooks[] | undefined>;
62
- getWebhooks(fileId: string, integrationId: string, crowdinId: string, provider: string): Promise<IntegrationWebhooks | undefined>;
63
- saveWebhooks(fileId: string, integrationId: string, crowdinId: string, provider: string): Promise<void>;
64
- deleteWebhooks(fileIds: any[], integrationId: string, crowdinId: string, provider: string): Promise<void>;
65
- getAllUserErrors(crowdinId: string, integrationId?: string): Promise<UserErrors[] | undefined>;
66
- saveUserError(action: string, message: string, data: any, createdAt: string, crowdinId: string, integrationId?: string): Promise<void>;
67
- deleteUserErrors(date: string, crowdinId: string, integrationId?: string): Promise<void>;
68
- deleteAllUsersErrorsOlderThan(date: string): Promise<void>;
69
- saveIntegrationConfig(integrationId: string, crowdinId: string, config: any): Promise<void>;
70
- getAllIntegrationConfigs(crowdinId: string): Promise<IntegrationConfig[]>;
71
- getIntegrationConfig(integrationId: string): Promise<IntegrationConfig | undefined>;
72
- updateIntegrationConfig(integrationId: string, config: any): Promise<void>;
73
- createJob(params: CreateJobParams): Promise<string>;
74
- updateJob(params: UpdateJobParams): Promise<void>;
75
- getJob(params: GetJobParams): Promise<Job | undefined>;
76
- getActiveJobs(params: GetActiveJobsParams): Promise<Job[] | undefined>;
77
- deleteFinishedJobs(): Promise<void>;
78
- getAllInProgressJobs(): Promise<Job[] | undefined>;
79
- getAllJobs(params: GetAllJobsParams): Promise<Job[] | undefined>;
80
- saveTranslationCache(params: TranslationCache): Promise<void>;
81
- getFileTranslationCache(params: GetFileTranslationCache): Promise<TranslationCache[] | undefined>;
82
- getFileTranslationCacheByLanguage(params: GetFileTranslationCacheByLanguageParams): Promise<TranslationCache | undefined>;
83
- updateTranslationCache(params: UpdateTranslationCacheParams): Promise<void>;
84
- saveUnsyncedFiles(params: UnsyncedFiles): Promise<void>;
85
- updateUnsyncedFiles(params: UnsyncedFiles): Promise<void>;
86
- getUnsyncedFiles(params: GetUnsyncedFiles): Promise<UnsyncedFiles | undefined>;
87
- registerCustomTable(tableName: string, schema: Record<string, string>): Promise<void>;
88
- insertRecord(tableName: string, data: Record<string, any>): Promise<void>;
89
- selectRecords(tableName: string, options?: {
90
- columns?: string[];
91
- whereClause?: string;
92
- orderBy?: string;
93
- limit?: number;
94
- offset?: number;
95
- distinct?: boolean;
96
- }, params?: any[]): Promise<any[]>;
97
- updateRecord(tableName: string, data: Record<string, any>, whereClause: string, params?: any[]): Promise<void>;
98
- deleteRecord(tableName: string, whereClause: string, params?: any[]): Promise<void>;
99
- saveSyncedData(files: any, integrationId: string, crowdinId: string, type: string): Promise<void>;
100
- updateSyncedData(files: any, integrationId: string, crowdinId: string, type: string): Promise<void>;
101
- getSyncedData(integrationId: string, crowdinId: string, type: string): Promise<IntegrationSyncedData | undefined>;
102
- /**
103
- * Converts undefined values to null for D1 compatibility
104
- * D1 does not support undefined values, so we convert them to null
105
- */
106
- private sanitizeBindValues;
107
- }