@crowdin/app-project-module 1.0.2 → 1.2.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 +5 -2
- package/out/middlewares/auto-credentials-masker.js +4 -1
- package/out/modules/integration/handlers/integration-data.js +2 -0
- package/out/modules/integration/handlers/sync-settings-save.js +5 -2
- package/out/modules/integration/types.d.ts +2 -0
- package/out/modules/integration/util/cron.js +32 -7
- package/out/modules/integration/util/files.js +4 -0
- package/out/modules/integration/util/snapshot.d.ts +7 -1
- package/out/modules/integration/util/snapshot.js +15 -5
- package/out/static/ui/form.bundle.js +46368 -0
- package/out/static/ui/form.bundle.js.map +1 -0
- package/out/static/ui/main.bundle.js +9 -2
- package/out/static/ui/main.bundle.js.map +1 -1
- package/out/storage/index.d.ts +1 -1
- package/out/storage/index.js +6 -6
- package/out/storage/sqlite.d.ts +28 -38
- package/out/storage/sqlite.js +533 -538
- package/out/util/credentials-masker.d.ts +5 -1
- package/out/util/credentials-masker.js +2 -2
- package/out/views/FormPage.js +1 -1
- package/package.json +7 -13
- package/out/static/js/form.js +0 -106
package/out/storage/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IntegrationConfig, IntegrationCredentials, IntegrationFilesSnapshot, IntegrationSyncSettings, IntegrationWebhooks, Provider } from '../modules/integration/types';
|
|
2
|
+
import { CreateJobParams, GetActiveJobsParams, GetAllJobsParams, GetFileTranslationCache, GetFileTranslationCacheByLanguageParams, GetJobParams, GetUnsyncedFiles, IntegrationSyncedData, Job, TranslationCache, UnsyncedFiles, UpdateJobParams, UpdateTranslationCacheParams } from '../modules/integration/util/types';
|
|
2
3
|
import { Config, CrowdinCredentials, UnauthorizedConfig } from '../types';
|
|
3
|
-
import { CreateJobParams, GetActiveJobsParams, GetJobParams, GetFileTranslationCacheByLanguageParams, Job, TranslationCache, UpdateJobParams, UpdateTranslationCacheParams, GetFileTranslationCache, UnsyncedFiles, GetUnsyncedFiles, IntegrationSyncedData, GetAllJobsParams } from '../modules/integration/util/types';
|
|
4
4
|
import { UserErrors } from './types';
|
|
5
5
|
export declare const TABLES: {
|
|
6
6
|
crowdin_credentials: string;
|
package/out/storage/index.js
CHANGED
|
@@ -36,16 +36,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.getStorage = exports.initialize = exports.TABLES = void 0;
|
|
39
|
+
const child_process_1 = require("child_process");
|
|
40
|
+
const fs_1 = __importDefault(require("fs"));
|
|
41
|
+
const util = __importStar(require("node:util"));
|
|
42
|
+
const path_1 = __importStar(require("path"));
|
|
39
43
|
const types_1 = require("../types");
|
|
40
44
|
const logger_1 = require("../util/logger");
|
|
41
|
-
const mysql_1 = require("./mysql");
|
|
42
|
-
const postgre_1 = require("./postgre");
|
|
43
45
|
const sqlite_1 = require("./sqlite");
|
|
44
46
|
const d1_1 = require("./d1");
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const child_process_1 = require("child_process");
|
|
48
|
-
const util = __importStar(require("node:util"));
|
|
47
|
+
const mysql_1 = require("./mysql");
|
|
48
|
+
const postgre_1 = require("./postgre");
|
|
49
49
|
exports.TABLES = {
|
|
50
50
|
crowdin_credentials: 'crowdin_credentials',
|
|
51
51
|
integration_credentials: 'integration_credentials',
|
package/out/storage/sqlite.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Storage } from '.';
|
|
2
|
-
import { IntegrationConfig, IntegrationCredentials, IntegrationFilesSnapshot, IntegrationSyncSettings, IntegrationWebhooks } from '../modules/integration/types';
|
|
2
|
+
import { IntegrationConfig, IntegrationCredentials, IntegrationFilesSnapshot, IntegrationSyncSettings, IntegrationWebhooks, Provider } from '../modules/integration/types';
|
|
3
3
|
import { CreateJobParams, GetActiveJobsParams, GetAllJobsParams, GetFileTranslationCache, GetFileTranslationCacheByLanguageParams, GetJobParams, GetUnsyncedFiles, IntegrationSyncedData, Job, TranslationCache, UnsyncedFiles, UpdateJobParams, UpdateTranslationCacheParams } from '../modules/integration/util/types';
|
|
4
4
|
import { CrowdinCredentials } from '../types';
|
|
5
5
|
import { UserErrors } from './types';
|
|
@@ -7,11 +7,8 @@ export interface SQLiteStorageConfig {
|
|
|
7
7
|
dbFolder: string;
|
|
8
8
|
}
|
|
9
9
|
export declare class SQLiteStorage implements Storage {
|
|
10
|
-
private db;
|
|
11
|
-
private _res?;
|
|
12
|
-
private _rej?;
|
|
13
|
-
private dbPromise;
|
|
14
10
|
private config;
|
|
11
|
+
private db;
|
|
15
12
|
tables: {
|
|
16
13
|
crowdin_credentials: string;
|
|
17
14
|
integration_credentials: string;
|
|
@@ -27,13 +24,6 @@ export declare class SQLiteStorage implements Storage {
|
|
|
27
24
|
synced_data: string;
|
|
28
25
|
};
|
|
29
26
|
constructor(config: SQLiteStorageConfig);
|
|
30
|
-
private _run;
|
|
31
|
-
private run;
|
|
32
|
-
private get;
|
|
33
|
-
private each;
|
|
34
|
-
private removeColumns;
|
|
35
|
-
private addColumns;
|
|
36
|
-
private addColumn;
|
|
37
27
|
migrate(): Promise<void>;
|
|
38
28
|
saveCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
|
39
29
|
updateCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
|
@@ -49,43 +39,43 @@ export declare class SQLiteStorage implements Storage {
|
|
|
49
39
|
deleteAllIntegrationCredentials(crowdinId: string): Promise<void>;
|
|
50
40
|
saveMetadata(id: string, metadata: any, crowdinId: string): Promise<void>;
|
|
51
41
|
updateMetadata(id: string, metadata: any, crowdinId: string): Promise<void>;
|
|
52
|
-
getMetadata(id: string): Promise<any>;
|
|
53
|
-
getAllMetadata(): Promise<any[]>;
|
|
42
|
+
getMetadata(id: string): Promise<any | undefined>;
|
|
43
|
+
getAllMetadata(): Promise<any[] | undefined>;
|
|
54
44
|
deleteMetadata(id: string): Promise<void>;
|
|
55
|
-
getSyncSettingsByProvider(integrationId: string, provider:
|
|
45
|
+
getSyncSettingsByProvider(integrationId: string, provider: Provider): Promise<IntegrationSyncSettings | undefined>;
|
|
56
46
|
getSyncSettingsBySchedule(type: string, schedule: string): Promise<IntegrationSyncSettings[]>;
|
|
57
|
-
saveSyncSettings(files: any, integrationId: string, crowdinId: string, type: string, provider:
|
|
58
|
-
updateSyncSettings(files: any, integrationId: string, crowdinId: string, type: string, provider:
|
|
59
|
-
getSyncSettings(integrationId: string, crowdinId: string, type: string, provider:
|
|
60
|
-
saveFilesSnapshot(files: any, integrationId: string, crowdinId: string, provider:
|
|
61
|
-
updateFilesSnapshot(files: any, integrationId: string, crowdinId: string, provider:
|
|
62
|
-
getFilesSnapshot(integrationId: string, crowdinId: string, provider:
|
|
63
|
-
getAllWebhooks(integrationId: string, crowdinId: string, provider:
|
|
64
|
-
getWebhooks(fileId: string, integrationId: string, crowdinId: string, provider:
|
|
65
|
-
saveWebhooks(fileId: string, integrationId: string, crowdinId: string, provider:
|
|
66
|
-
deleteWebhooks(fileIds: any[], integrationId: string, crowdinId: string, provider:
|
|
67
|
-
getAllUserErrors(crowdinId: string, integrationId?: string): Promise<UserErrors[]>;
|
|
47
|
+
saveSyncSettings(files: any, integrationId: string, crowdinId: string, type: string, provider: Provider): Promise<void>;
|
|
48
|
+
updateSyncSettings(files: any, integrationId: string, crowdinId: string, type: string, provider: Provider): Promise<void>;
|
|
49
|
+
getSyncSettings(integrationId: string, crowdinId: string, type: string, provider: Provider): Promise<IntegrationSyncSettings | undefined>;
|
|
50
|
+
saveFilesSnapshot(files: any, integrationId: string, crowdinId: string, provider: Provider): Promise<void>;
|
|
51
|
+
updateFilesSnapshot(files: any, integrationId: string, crowdinId: string, provider: Provider): Promise<void>;
|
|
52
|
+
getFilesSnapshot(integrationId: string, crowdinId: string, provider: Provider): Promise<IntegrationFilesSnapshot | undefined>;
|
|
53
|
+
getAllWebhooks(integrationId: string, crowdinId: string, provider: Provider): Promise<IntegrationWebhooks[] | undefined>;
|
|
54
|
+
getWebhooks(fileId: string, integrationId: string, crowdinId: string, provider: Provider): Promise<IntegrationWebhooks | undefined>;
|
|
55
|
+
saveWebhooks(fileId: string, integrationId: string, crowdinId: string, provider: Provider): Promise<void>;
|
|
56
|
+
deleteWebhooks(fileIds: any[], integrationId: string, crowdinId: string, provider: Provider): Promise<void>;
|
|
57
|
+
getAllUserErrors(crowdinId: string, integrationId?: string): Promise<UserErrors[] | undefined>;
|
|
68
58
|
saveUserError(action: string, message: string, data: any, createdAt: string, crowdinId: string, integrationId?: string): Promise<void>;
|
|
69
|
-
deleteUserErrors(
|
|
70
|
-
deleteAllUsersErrorsOlderThan(
|
|
59
|
+
deleteUserErrors(date: string, crowdinId: string, integrationId?: string): Promise<void>;
|
|
60
|
+
deleteAllUsersErrorsOlderThan(date: string): Promise<void>;
|
|
71
61
|
saveIntegrationConfig(integrationId: string, crowdinId: string, config: any): Promise<void>;
|
|
72
62
|
getAllIntegrationConfigs(crowdinId: string): Promise<IntegrationConfig[]>;
|
|
73
63
|
getIntegrationConfig(integrationId: string): Promise<IntegrationConfig | undefined>;
|
|
74
64
|
updateIntegrationConfig(integrationId: string, config: any): Promise<void>;
|
|
75
|
-
createJob(
|
|
65
|
+
createJob(params: CreateJobParams): Promise<string>;
|
|
76
66
|
updateJob({ id, progress, status, info, data, attempt, errors, processedEntities, }: UpdateJobParams): Promise<void>;
|
|
77
|
-
getJob(
|
|
78
|
-
getActiveJobs(
|
|
67
|
+
getJob(params: GetJobParams): Promise<Job | undefined>;
|
|
68
|
+
getActiveJobs(params: GetActiveJobsParams): Promise<Job[] | undefined>;
|
|
79
69
|
deleteFinishedJobs(): Promise<void>;
|
|
80
70
|
getAllInProgressJobs(): Promise<Job[] | undefined>;
|
|
81
71
|
getAllJobs({ integrationId, crowdinId, limit, offset }: GetAllJobsParams): Promise<Job[] | undefined>;
|
|
82
|
-
saveTranslationCache(
|
|
83
|
-
getFileTranslationCache(
|
|
84
|
-
getFileTranslationCacheByLanguage(
|
|
85
|
-
updateTranslationCache(
|
|
86
|
-
saveUnsyncedFiles(
|
|
87
|
-
|
|
88
|
-
|
|
72
|
+
saveTranslationCache(params: TranslationCache): Promise<void>;
|
|
73
|
+
getFileTranslationCache(params: GetFileTranslationCache): Promise<TranslationCache[] | undefined>;
|
|
74
|
+
getFileTranslationCacheByLanguage(params: GetFileTranslationCacheByLanguageParams): Promise<TranslationCache | undefined>;
|
|
75
|
+
updateTranslationCache(params: UpdateTranslationCacheParams): Promise<void>;
|
|
76
|
+
saveUnsyncedFiles(params: UnsyncedFiles): Promise<void>;
|
|
77
|
+
getUnsyncedFiles(params: GetUnsyncedFiles): Promise<UnsyncedFiles | undefined>;
|
|
78
|
+
updateUnsyncedFiles(params: UnsyncedFiles): Promise<void>;
|
|
89
79
|
registerCustomTable(tableName: string, schema: Record<string, string>): Promise<void>;
|
|
90
80
|
insertRecord(tableName: string, data: Record<string, any>): Promise<void>;
|
|
91
81
|
selectRecords(tableName: string, options?: {
|