@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.
- package/out/index.js +8 -15
- package/out/middlewares/auto-credentials-masker.js +5 -2
- package/out/middlewares/crowdin-client.d.ts +1 -1
- package/out/middlewares/crowdin-client.js +1 -1
- package/out/middlewares/export.d.ts +2 -2
- package/out/middlewares/export.js +4 -35
- package/out/middlewares/json-response.d.ts +1 -1
- package/out/middlewares/json-response.js +1 -1
- package/out/modules/ai-prompt-provider/index.js +6 -6
- package/out/modules/ai-provider/index.js +7 -7
- package/out/modules/ai-provider/types.d.ts +10 -0
- package/out/modules/ai-provider/types.js +12 -0
- package/out/modules/ai-provider/util/index.d.ts +0 -10
- package/out/modules/ai-provider/util/index.js +2 -13
- package/out/modules/ai-request-processors/index.js +4 -4
- package/out/modules/api/api.js +18 -18
- package/out/modules/auth-guard/index.js +4 -5
- package/out/modules/automation-action/index.js +4 -6
- package/out/modules/context-menu/index.js +4 -13
- package/out/modules/custom-mt/index.js +4 -4
- package/out/modules/custom-spell-check/index.js +11 -11
- package/out/modules/editor-right-panel/index.js +1 -1
- package/out/modules/external-qa-check/index.js +7 -7
- package/out/modules/file-processing/index.js +14 -14
- package/out/modules/integration/index.js +26 -26
- package/out/modules/integration/types.d.ts +4 -4
- package/out/modules/integration/util/files.js +1 -1
- package/out/modules/integration/util/types.d.ts +1 -1
- package/out/modules/manifest.js +70 -281
- package/out/modules/modal/index.js +4 -13
- package/out/modules/organization-menu/index.js +1 -1
- package/out/modules/organization-settings-menu/index.js +1 -1
- package/out/modules/profile-resources-menu/index.js +1 -1
- package/out/modules/profile-settings-menu/index.js +1 -1
- package/out/modules/project-menu/index.js +1 -1
- package/out/modules/project-menu-crowdsource/index.js +1 -1
- package/out/modules/project-reports/index.js +1 -1
- package/out/modules/project-tools/index.js +1 -1
- package/out/modules/webhooks/index.js +3 -6
- package/out/modules/workflow-step-type/index.js +6 -6
- package/out/storage/drizzle/d1/index.d.ts +7 -0
- package/out/storage/drizzle/d1/index.js +48 -0
- package/out/storage/drizzle/d1/migrations/init.d.ts +2 -0
- package/out/storage/drizzle/d1/migrations/init.js +122 -0
- package/out/storage/drizzle/d1/types.d.ts +13 -0
- package/out/storage/drizzle/d1/types.js +38 -0
- package/out/storage/{sqlite.d.ts → drizzle/index.d.ts} +37 -58
- package/out/storage/drizzle/index.js +939 -0
- package/out/storage/drizzle/postgresql/config.d.ts +5 -0
- package/out/storage/drizzle/postgresql/config.js +11 -0
- package/out/storage/drizzle/postgresql/index.d.ts +14 -0
- package/out/storage/drizzle/postgresql/index.js +144 -0
- package/out/storage/drizzle/postgresql/migrations/0000_init.sql +113 -0
- package/out/storage/drizzle/postgresql/migrations/0001_init_indexes.sql +28 -0
- package/out/storage/drizzle/postgresql/migrations/meta/0000_snapshot.json +646 -0
- package/out/storage/drizzle/postgresql/migrations/meta/0001_snapshot.json +646 -0
- package/out/storage/drizzle/postgresql/migrations/meta/_journal.json +20 -0
- package/out/storage/drizzle/postgresql/schema.d.ts +1410 -0
- package/out/storage/drizzle/postgresql/schema.js +106 -0
- package/out/storage/drizzle/sqlite/config.d.ts +5 -0
- package/out/storage/drizzle/sqlite/config.js +11 -0
- package/out/storage/drizzle/sqlite/index.d.ts +8 -0
- package/out/storage/drizzle/sqlite/index.js +63 -0
- package/out/storage/drizzle/sqlite/migrations/0000_init.sql +113 -0
- package/out/storage/drizzle/sqlite/migrations/meta/0000_snapshot.json +687 -0
- package/out/storage/drizzle/sqlite/migrations/meta/_journal.json +13 -0
- package/out/storage/drizzle/sqlite/schema.d.ts +1544 -0
- package/out/storage/drizzle/sqlite/schema.js +106 -0
- package/out/storage/index.d.ts +2 -88
- package/out/storage/index.js +12 -128
- package/out/storage/internal/backup.d.ts +3 -0
- package/out/storage/internal/backup.js +94 -0
- package/out/storage/types.d.ts +66 -0
- package/out/types.d.ts +43 -47
- package/out/util/credentials-masker.js +2 -2
- package/out/util/export.d.ts +1 -0
- package/out/util/export.js +2 -1
- package/out/util/index.d.ts +2 -1
- package/out/util/index.js +12 -9
- package/out/util/normalize-module.d.ts +0 -1
- package/out/util/normalize-module.js +0 -4
- package/package.json +18 -22
- package/out/modules/ai-tools/handlers/tool-calls.d.ts +0 -4
- package/out/modules/ai-tools/handlers/tool-calls.js +0 -52
- package/out/modules/ai-tools/index.d.ts +0 -10
- package/out/modules/ai-tools/index.js +0 -46
- package/out/modules/ai-tools/types.d.ts +0 -63
- package/out/modules/ai-tools/types.js +0 -2
- package/out/modules/ai-tools/util/index.d.ts +0 -5
- package/out/modules/ai-tools/util/index.js +0 -24
- package/out/storage/d1.d.ts +0 -107
- package/out/storage/d1.js +0 -837
- package/out/storage/export.d.ts +0 -1
- package/out/storage/export.js +0 -2
- package/out/storage/mysql.d.ts +0 -109
- package/out/storage/mysql.js +0 -984
- package/out/storage/postgre.d.ts +0 -124
- package/out/storage/postgre.js +0 -1027
- package/out/storage/sqlite.js +0 -786
package/out/storage/d1.d.ts
DELETED
|
@@ -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
|
-
}
|