@crowdin/app-project-module 1.2.1 → 1.3.1
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/app-test/integration/get-integration-files.js +1 -1
- package/out/app-test/integration/index.js +6 -6
- package/out/app-test/integration/mocks/crowdin-storage.d.ts +16 -16
- package/out/app-test/integration/mocks/mock-crowdin-api-client.js +17 -7
- package/out/app-test/integration/update-crowdin.js +1 -1
- package/out/app-test/integration/update-integration.js +1 -1
- package/out/app-test/util/index.js +1 -2
- package/out/index.js +23 -13
- package/out/middlewares/api-call.js +1 -1
- package/out/middlewares/auto-credentials-masker.js +2 -3
- package/out/middlewares/crowdin-client.d.ts +1 -2
- package/out/middlewares/crowdin-client.js +5 -6
- package/out/middlewares/integration-credentials.d.ts +1 -2
- package/out/middlewares/integration-credentials.js +18 -8
- package/out/middlewares/json-response.js +1 -1
- package/out/middlewares/render-ui-module.d.ts +1 -2
- package/out/middlewares/render-ui-module.js +1 -1
- package/out/middlewares/ui-module.d.ts +1 -2
- package/out/middlewares/ui-module.js +1 -1
- package/out/modules/about.js +2 -3
- package/out/modules/ai-prompt-provider/handlers/compile.d.ts +1 -2
- package/out/modules/ai-prompt-provider/handlers/compile.js +1 -1
- package/out/modules/ai-prompt-provider/index.js +1 -2
- package/out/modules/ai-prompt-provider/types.js +1 -1
- package/out/modules/ai-provider/handlers/chat-completions.d.ts +1 -2
- package/out/modules/ai-provider/handlers/chat-completions.js +2 -2
- package/out/modules/ai-provider/handlers/get-model-list.d.ts +1 -2
- package/out/modules/ai-provider/handlers/get-model-list.js +1 -1
- package/out/modules/ai-provider/index.js +1 -2
- package/out/modules/ai-provider/util/index.js +6 -6
- package/out/modules/ai-request-processors/handler.d.ts +1 -2
- package/out/modules/ai-request-processors/handler.js +1 -1
- package/out/modules/ai-request-processors/index.js +5 -5
- package/out/modules/ai-tools/handlers/tool-calls.d.ts +1 -2
- package/out/modules/ai-tools/handlers/tool-calls.js +1 -1
- package/out/modules/ai-tools/index.js +2 -3
- package/out/modules/ai-tools/util/index.js +4 -5
- package/out/modules/api/api.js +4 -5
- package/out/modules/api/index.js +1 -2
- package/out/modules/api/types.js +1 -1
- package/out/modules/auth-guard/handlers/verify.d.ts +1 -2
- package/out/modules/auth-guard/handlers/verify.js +1 -1
- package/out/modules/auth-guard/index.js +1 -2
- package/out/modules/automation-action/handlers/execute.d.ts +1 -2
- package/out/modules/automation-action/handlers/execute.js +1 -1
- package/out/modules/automation-action/handlers/input-schema.d.ts +1 -2
- package/out/modules/automation-action/handlers/input-schema.js +1 -1
- package/out/modules/automation-action/handlers/output-schema.d.ts +1 -2
- package/out/modules/automation-action/handlers/output-schema.js +1 -1
- package/out/modules/automation-action/handlers/validate-settings.d.ts +1 -2
- package/out/modules/automation-action/handlers/validate-settings.js +1 -1
- package/out/modules/automation-action/index.js +1 -2
- package/out/modules/automation-action/util/index.js +2 -3
- package/out/modules/automation-action/util/validate-input.js +1 -2
- package/out/modules/context-menu/index.js +1 -2
- package/out/modules/context-menu/types.js +2 -2
- package/out/modules/custom-mt/handlers/translate.d.ts +1 -2
- package/out/modules/custom-mt/handlers/translate.js +1 -1
- package/out/modules/custom-mt/index.js +1 -2
- package/out/modules/custom-mt/types.d.ts +0 -2
- package/out/modules/custom-spell-check/handlers/get-languages-list.d.ts +1 -2
- package/out/modules/custom-spell-check/handlers/get-languages-list.js +1 -1
- package/out/modules/custom-spell-check/handlers/spell-check.d.ts +1 -2
- package/out/modules/custom-spell-check/handlers/spell-check.js +1 -1
- package/out/modules/custom-spell-check/index.js +1 -2
- package/out/modules/editor-right-panel/index.js +1 -2
- package/out/modules/external-qa-check/handlers/validate.d.ts +1 -2
- package/out/modules/external-qa-check/handlers/validate.js +1 -1
- package/out/modules/external-qa-check/index.js +1 -2
- package/out/modules/file-processing/handlers/custom-file-format.d.ts +1 -2
- package/out/modules/file-processing/handlers/custom-file-format.js +9 -9
- package/out/modules/file-processing/handlers/file-download.d.ts +1 -2
- package/out/modules/file-processing/handlers/file-download.js +1 -1
- package/out/modules/file-processing/handlers/pre-post-process.d.ts +1 -2
- package/out/modules/file-processing/handlers/pre-post-process.js +1 -1
- package/out/modules/file-processing/handlers/translations-alignment.d.ts +1 -2
- package/out/modules/file-processing/handlers/translations-alignment.js +1 -1
- package/out/modules/file-processing/index.js +6 -7
- package/out/modules/file-processing/types.d.ts +0 -2
- package/out/modules/file-processing/types.js +1 -1
- package/out/modules/file-processing/util/defaults.js +18 -9
- package/out/modules/file-processing/util/files.d.ts +0 -2
- package/out/modules/file-processing/util/files.js +4 -4
- package/out/modules/form-data-display.d.ts +1 -2
- package/out/modules/form-data-display.js +18 -8
- package/out/modules/form-data-save.d.ts +1 -2
- package/out/modules/form-data-save.js +18 -8
- package/out/modules/install.d.ts +1 -2
- package/out/modules/install.js +2 -2
- package/out/modules/integration/handlers/crowdin-file-progress.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-file-progress.js +1 -1
- package/out/modules/integration/handlers/crowdin-files-target-languages.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-files-target-languages.js +1 -1
- package/out/modules/integration/handlers/crowdin-files.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-files.js +1 -1
- package/out/modules/integration/handlers/crowdin-project.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-project.js +1 -1
- package/out/modules/integration/handlers/crowdin-update.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-update.js +1 -1
- package/out/modules/integration/handlers/crowdin-webhook.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-webhook.js +2 -2
- package/out/modules/integration/handlers/integration-data.d.ts +1 -2
- package/out/modules/integration/handlers/integration-data.js +1 -1
- package/out/modules/integration/handlers/integration-login.d.ts +1 -2
- package/out/modules/integration/handlers/integration-login.js +1 -1
- package/out/modules/integration/handlers/integration-logout.d.ts +1 -2
- package/out/modules/integration/handlers/integration-logout.js +18 -8
- package/out/modules/integration/handlers/integration-update.d.ts +1 -2
- package/out/modules/integration/handlers/integration-update.js +1 -1
- package/out/modules/integration/handlers/integration-webhook.d.ts +1 -2
- package/out/modules/integration/handlers/integration-webhook.js +1 -1
- package/out/modules/integration/handlers/invite-users.d.ts +1 -2
- package/out/modules/integration/handlers/invite-users.js +1 -1
- package/out/modules/integration/handlers/job-cancel.d.ts +1 -2
- package/out/modules/integration/handlers/job-cancel.js +1 -1
- package/out/modules/integration/handlers/job-info-deprecated.d.ts +1 -2
- package/out/modules/integration/handlers/job-info-deprecated.js +1 -1
- package/out/modules/integration/handlers/job-info.d.ts +1 -2
- package/out/modules/integration/handlers/job-info.js +1 -1
- package/out/modules/integration/handlers/job-list.d.ts +1 -2
- package/out/modules/integration/handlers/job-list.js +1 -1
- package/out/modules/integration/handlers/main.d.ts +1 -2
- package/out/modules/integration/handlers/main.js +1 -1
- package/out/modules/integration/handlers/oauth-login.d.ts +1 -2
- package/out/modules/integration/handlers/oauth-login.js +1 -1
- package/out/modules/integration/handlers/oauth-polling.d.ts +1 -2
- package/out/modules/integration/handlers/oauth-polling.js +1 -1
- package/out/modules/integration/handlers/oauth-url.d.ts +1 -2
- package/out/modules/integration/handlers/oauth-url.js +1 -1
- package/out/modules/integration/handlers/settings-save.d.ts +1 -2
- package/out/modules/integration/handlers/settings-save.js +1 -1
- package/out/modules/integration/handlers/settings.d.ts +1 -2
- package/out/modules/integration/handlers/settings.js +1 -1
- package/out/modules/integration/handlers/subscription-info.js +1 -1
- package/out/modules/integration/handlers/sync-settings-save.d.ts +1 -2
- package/out/modules/integration/handlers/sync-settings-save.js +1 -1
- package/out/modules/integration/handlers/sync-settings.d.ts +1 -2
- package/out/modules/integration/handlers/sync-settings.js +1 -1
- package/out/modules/integration/handlers/user-errors.d.ts +1 -2
- package/out/modules/integration/handlers/user-errors.js +1 -1
- package/out/modules/integration/handlers/users.d.ts +1 -2
- package/out/modules/integration/handlers/users.js +4 -5
- package/out/modules/integration/index.js +1 -2
- package/out/modules/integration/types.js +4 -4
- package/out/modules/integration/util/cron.js +46 -37
- package/out/modules/integration/util/defaults.js +33 -24
- package/out/modules/integration/util/files.js +29 -30
- package/out/modules/integration/util/job.js +29 -20
- package/out/modules/integration/util/snapshot.js +7 -8
- package/out/modules/integration/util/types.js +3 -3
- package/out/modules/integration/util/webhooks.js +54 -44
- package/out/modules/manifest.js +1 -1
- package/out/modules/modal/index.js +1 -2
- package/out/modules/organization-menu/index.js +1 -2
- package/out/modules/organization-settings-menu/index.js +1 -2
- package/out/modules/profile-resources-menu/index.js +1 -2
- package/out/modules/profile-settings-menu/index.js +1 -2
- package/out/modules/project-menu/index.js +1 -2
- package/out/modules/project-menu-crowdsource/index.js +1 -2
- package/out/modules/project-reports/index.js +1 -2
- package/out/modules/project-tools/index.js +1 -2
- package/out/modules/status.d.ts +1 -2
- package/out/modules/status.js +1 -1
- package/out/modules/subscription-paid.d.ts +1 -2
- package/out/modules/subscription-paid.js +1 -1
- package/out/modules/uninstall.d.ts +1 -2
- package/out/modules/uninstall.js +1 -1
- package/out/modules/webhooks/handlers/webhook-handler.d.ts +1 -2
- package/out/modules/webhooks/handlers/webhook-handler.js +18 -9
- package/out/modules/webhooks/index.js +1 -2
- package/out/modules/workflow-step-type/handlers/delete-step.d.ts +1 -2
- package/out/modules/workflow-step-type/handlers/delete-step.js +18 -8
- package/out/modules/workflow-step-type/handlers/step-settings-save.d.ts +1 -2
- package/out/modules/workflow-step-type/handlers/step-settings-save.js +18 -8
- package/out/modules/workflow-step-type/index.js +1 -2
- package/out/modules/workflow-step-type/types.js +1 -1
- package/out/modules/workflow-step-type/util/index.js +2 -3
- package/out/static/ui/error.bundle.js +446 -379
- package/out/static/ui/error.bundle.js.map +1 -1
- package/out/static/ui/form.bundle.js +29793 -29989
- package/out/static/ui/form.bundle.js.map +1 -1
- package/out/static/ui/install.bundle.js +446 -379
- package/out/static/ui/install.bundle.js.map +1 -1
- package/out/static/ui/login.bundle.js +448 -379
- package/out/static/ui/login.bundle.js.map +1 -1
- package/out/static/ui/main.bundle.js +448 -379
- package/out/static/ui/main.bundle.js.map +1 -1
- package/out/static/ui/oauth.bundle.js +448 -379
- package/out/static/ui/oauth.bundle.js.map +1 -1
- package/out/storage/d1.d.ts +1 -1
- package/out/storage/d1.js +29 -27
- package/out/storage/index.d.ts +1 -1
- package/out/storage/index.js +25 -11
- package/out/storage/mysql.d.ts +1 -1
- package/out/storage/mysql.js +35 -33
- package/out/storage/postgre.d.ts +1 -1
- package/out/storage/postgre.js +46 -44
- package/out/storage/sqlite.d.ts +1 -1
- package/out/storage/sqlite.js +18 -16
- package/out/types.d.ts +0 -2
- package/out/types.js +8 -8
- package/out/util/connection.js +34 -25
- package/out/util/credentials-masker.d.ts +1 -2
- package/out/util/credentials-masker.js +3 -4
- package/out/util/cron.js +20 -10
- package/out/util/form-schema.js +2 -3
- package/out/util/index.js +38 -28
- package/out/util/jsx-renderer.js +2 -3
- package/out/util/logger.js +41 -31
- package/out/util/static-files.d.ts +0 -1
- package/out/util/static-files.js +2 -3
- package/out/util/subscription.js +11 -12
- package/out/views/FormPage.js +3 -3
- package/package.json +28 -33
package/out/storage/d1.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare class D1Storage implements Storage {
|
|
|
32
32
|
ensureMigrated(): Promise<void>;
|
|
33
33
|
private addColumn;
|
|
34
34
|
private updateTables;
|
|
35
|
-
migrate(): Promise<void>;
|
|
35
|
+
migrate(skipOnboarding?: boolean): Promise<void>;
|
|
36
36
|
saveCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
|
37
37
|
updateCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
|
38
38
|
getCrowdinCredentials(id: string): Promise<CrowdinCredentials | undefined>;
|
package/out/storage/d1.js
CHANGED
|
@@ -143,31 +143,33 @@ class D1Storage {
|
|
|
143
143
|
yield this.addColumn('job', 'processed_entities', 'null');
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
migrate() {
|
|
147
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
key
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
146
|
+
migrate(skipOnboarding) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
if (!skipOnboarding) {
|
|
149
|
+
try {
|
|
150
|
+
// Create all tables
|
|
151
|
+
const statements = [];
|
|
152
|
+
const tableEntries = Object.keys(this.tables).map((key) => [
|
|
153
|
+
key,
|
|
154
|
+
this.tables[key],
|
|
155
|
+
]);
|
|
156
|
+
for (const [tableName, tableSchema] of tableEntries) {
|
|
157
|
+
statements.push(this.db.prepare(`CREATE TABLE IF NOT EXISTS ${tableName} ${tableSchema}`));
|
|
158
|
+
}
|
|
159
|
+
// Execute all table creation in batch
|
|
160
|
+
yield this.db.batch(statements);
|
|
161
|
+
// Update tables with new columns if needed
|
|
162
|
+
yield this.updateTables();
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
console.error(e);
|
|
157
166
|
}
|
|
158
|
-
// Execute all table creation in batch
|
|
159
|
-
yield this.db.batch(statements);
|
|
160
|
-
// Update tables with new columns if needed
|
|
161
|
-
yield this.updateTables();
|
|
162
|
-
}
|
|
163
|
-
catch (e) {
|
|
164
|
-
console.error(e);
|
|
165
167
|
}
|
|
166
168
|
});
|
|
167
169
|
}
|
|
168
170
|
saveCrowdinCredentials(credentials) {
|
|
169
|
-
var _a, _b, _c;
|
|
170
171
|
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
+
var _a, _b, _c;
|
|
171
173
|
yield this.db
|
|
172
174
|
.prepare('INSERT INTO crowdin_credentials(id, app_secret, domain, user_id, agent_id, organization_id, base_url, access_token, refresh_token, expire, type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)')
|
|
173
175
|
.bind(...this.sanitizeBindValues(credentials.id, credentials.appSecret, credentials.domain, (_a = credentials.userId) === null || _a === void 0 ? void 0 : _a.toString(), (_b = credentials.agentId) === null || _b === void 0 ? void 0 : _b.toString(), (_c = credentials.organizationId) === null || _c === void 0 ? void 0 : _c.toString(), credentials.baseUrl, credentials.accessToken, credentials.refreshToken, credentials.expire, credentials.type))
|
|
@@ -175,8 +177,8 @@ class D1Storage {
|
|
|
175
177
|
});
|
|
176
178
|
}
|
|
177
179
|
updateCrowdinCredentials(credentials) {
|
|
178
|
-
var _a, _b, _c;
|
|
179
180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
var _a, _b, _c;
|
|
180
182
|
yield this.db
|
|
181
183
|
.prepare('UPDATE crowdin_credentials SET app_secret = ?, domain = ?, user_id = ?, agent_id = ?, organization_id = ?, base_url = ?, access_token = ?, refresh_token = ?, expire = ? WHERE id = ?')
|
|
182
184
|
.bind(...this.sanitizeBindValues(credentials.appSecret, credentials.domain, (_a = credentials.userId) === null || _a === void 0 ? void 0 : _a.toString(), (_b = credentials.agentId) === null || _b === void 0 ? void 0 : _b.toString(), (_c = credentials.organizationId) === null || _c === void 0 ? void 0 : _c.toString(), credentials.baseUrl, credentials.accessToken, credentials.refreshToken, credentials.expire, credentials.id))
|
|
@@ -753,9 +755,9 @@ class D1Storage {
|
|
|
753
755
|
.run();
|
|
754
756
|
});
|
|
755
757
|
}
|
|
756
|
-
selectRecords(
|
|
757
|
-
|
|
758
|
-
|
|
758
|
+
selectRecords(tableName_1) {
|
|
759
|
+
return __awaiter(this, arguments, void 0, function* (tableName, options = {}, params = []) {
|
|
760
|
+
var _a;
|
|
759
761
|
const columns = ((_a = options.columns) === null || _a === void 0 ? void 0 : _a.length) ? options.columns.join(', ') : '*';
|
|
760
762
|
const distinctKeyword = options.distinct ? 'DISTINCT ' : '';
|
|
761
763
|
const whereClause = options.whereClause ? ` ${options.whereClause}` : '';
|
|
@@ -768,8 +770,8 @@ class D1Storage {
|
|
|
768
770
|
return result.results || [];
|
|
769
771
|
});
|
|
770
772
|
}
|
|
771
|
-
updateRecord(
|
|
772
|
-
return __awaiter(this,
|
|
773
|
+
updateRecord(tableName_1, data_1, whereClause_1) {
|
|
774
|
+
return __awaiter(this, arguments, void 0, function* (tableName, data, whereClause, params = []) {
|
|
773
775
|
const setClause = Object.keys(data)
|
|
774
776
|
.map((key) => `${key} = ?`)
|
|
775
777
|
.join(', ');
|
|
@@ -781,8 +783,8 @@ class D1Storage {
|
|
|
781
783
|
.run();
|
|
782
784
|
});
|
|
783
785
|
}
|
|
784
|
-
deleteRecord(
|
|
785
|
-
return __awaiter(this,
|
|
786
|
+
deleteRecord(tableName_1, whereClause_1) {
|
|
787
|
+
return __awaiter(this, arguments, void 0, function* (tableName, whereClause, params = []) {
|
|
786
788
|
const query = `DELETE FROM ${tableName} ${whereClause};`;
|
|
787
789
|
const stmt = this.db.prepare(query);
|
|
788
790
|
if (params.length > 0) {
|
package/out/storage/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare const TABLES: {
|
|
|
18
18
|
};
|
|
19
19
|
export interface Storage {
|
|
20
20
|
tables: typeof TABLES;
|
|
21
|
-
migrate(): Promise<void>;
|
|
21
|
+
migrate(skipOnboarding?: boolean): Promise<void>;
|
|
22
22
|
saveCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
|
23
23
|
updateCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
|
24
24
|
getCrowdinCredentials(id: string): Promise<CrowdinCredentials | undefined>;
|
package/out/storage/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,7 +45,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
46
|
};
|
|
37
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.
|
|
48
|
+
exports.TABLES = void 0;
|
|
49
|
+
exports.initialize = initialize;
|
|
50
|
+
exports.getStorage = getStorage;
|
|
39
51
|
const child_process_1 = require("child_process");
|
|
40
52
|
const fs_1 = __importDefault(require("fs"));
|
|
41
53
|
const util = __importStar(require("node:util"));
|
|
@@ -90,17 +102,19 @@ function initialize(config) {
|
|
|
90
102
|
}
|
|
91
103
|
storage = new sqlite_1.SQLiteStorage({ dbFolder: config.dbFolder });
|
|
92
104
|
}
|
|
93
|
-
|
|
105
|
+
const skipOnboarding = !!process.env.SKIP_MIGRATIONS;
|
|
106
|
+
if (skipOnboarding) {
|
|
107
|
+
(0, logger_1.log)('Skipping database migrations (SKIP_MIGRATIONS is set)');
|
|
108
|
+
}
|
|
109
|
+
yield storage.migrate(skipOnboarding);
|
|
94
110
|
});
|
|
95
111
|
}
|
|
96
|
-
exports.initialize = initialize;
|
|
97
112
|
function getStorage() {
|
|
98
113
|
if (!storage) {
|
|
99
114
|
throw new Error('Storage not initialized');
|
|
100
115
|
}
|
|
101
116
|
return storage;
|
|
102
117
|
}
|
|
103
|
-
exports.getStorage = getStorage;
|
|
104
118
|
function createDumpForMigration(config) {
|
|
105
119
|
const sqliteFilePath = (0, path_1.join)(config.dbFolder, types_1.storageFiles.SQLITE);
|
|
106
120
|
const backupFilePath = (0, path_1.join)(config.dbFolder, types_1.storageFiles.SQLITE_BACKUP);
|
package/out/storage/mysql.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare class MySQLStorage implements Storage {
|
|
|
38
38
|
};
|
|
39
39
|
constructor(config: MySQLStorageConfig);
|
|
40
40
|
executeQuery<T>(command: (connection: any) => Promise<T>): Promise<T>;
|
|
41
|
-
migrate(): Promise<void>;
|
|
41
|
+
migrate(skipOnboarding?: boolean): Promise<void>;
|
|
42
42
|
addTables(connection: any): Promise<void>;
|
|
43
43
|
saveCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
|
44
44
|
updateCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
package/out/storage/mysql.js
CHANGED
|
@@ -191,10 +191,12 @@ class MySQLStorage {
|
|
|
191
191
|
}));
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
migrate() {
|
|
194
|
+
migrate(skipOnboarding) {
|
|
195
195
|
return __awaiter(this, void 0, void 0, function* () {
|
|
196
196
|
try {
|
|
197
|
-
|
|
197
|
+
if (!skipOnboarding) {
|
|
198
|
+
yield this.executeQuery((connection) => this.addTables(connection));
|
|
199
|
+
}
|
|
198
200
|
this._res && this._res();
|
|
199
201
|
}
|
|
200
202
|
catch (e) {
|
|
@@ -599,8 +601,8 @@ class MySQLStorage {
|
|
|
599
601
|
yield this.executeQuery((connection) => connection.execute('UPDATE integration_settings SET config = ? WHERE id = ?', [config, integrationId]));
|
|
600
602
|
});
|
|
601
603
|
}
|
|
602
|
-
createJob(
|
|
603
|
-
return __awaiter(this,
|
|
604
|
+
createJob(_a) {
|
|
605
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, type, title, payload }) {
|
|
604
606
|
const id = (0, crypto_1.randomUUID)();
|
|
605
607
|
yield this.dbPromise;
|
|
606
608
|
yield this.executeQuery((connection) => connection.execute(`
|
|
@@ -610,8 +612,8 @@ class MySQLStorage {
|
|
|
610
612
|
return id;
|
|
611
613
|
});
|
|
612
614
|
}
|
|
613
|
-
updateJob(
|
|
614
|
-
return __awaiter(this,
|
|
615
|
+
updateJob(_a) {
|
|
616
|
+
return __awaiter(this, arguments, void 0, function* ({ id, progress, status, info, data, attempt, errors, processedEntities, }) {
|
|
615
617
|
const updateFields = ['updated_at'];
|
|
616
618
|
const updateParams = [Date.now().toString()];
|
|
617
619
|
if (progress) {
|
|
@@ -659,8 +661,8 @@ class MySQLStorage {
|
|
|
659
661
|
`, updateParams));
|
|
660
662
|
});
|
|
661
663
|
}
|
|
662
|
-
getJob(
|
|
663
|
-
return __awaiter(this,
|
|
664
|
+
getJob(_a) {
|
|
665
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
664
666
|
yield this.dbPromise;
|
|
665
667
|
return this.executeQuery((connection) => __awaiter(this, void 0, void 0, function* () {
|
|
666
668
|
const [rows] = yield connection.execute(`
|
|
@@ -687,8 +689,8 @@ class MySQLStorage {
|
|
|
687
689
|
}));
|
|
688
690
|
});
|
|
689
691
|
}
|
|
690
|
-
getActiveJobs(
|
|
691
|
-
return __awaiter(this,
|
|
692
|
+
getActiveJobs(_a) {
|
|
693
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId }) {
|
|
692
694
|
yield this.dbPromise;
|
|
693
695
|
return this.executeQuery((connection) => __awaiter(this, void 0, void 0, function* () {
|
|
694
696
|
const [rows] = yield connection.execute(`
|
|
@@ -752,8 +754,8 @@ class MySQLStorage {
|
|
|
752
754
|
}));
|
|
753
755
|
});
|
|
754
756
|
}
|
|
755
|
-
getAllJobs(
|
|
756
|
-
return __awaiter(this,
|
|
757
|
+
getAllJobs(_a) {
|
|
758
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, limit, offset }) {
|
|
757
759
|
yield this.dbPromise;
|
|
758
760
|
return this.executeQuery((connection) => __awaiter(this, void 0, void 0, function* () {
|
|
759
761
|
const [rows] = yield connection.execute(`
|
|
@@ -782,8 +784,8 @@ class MySQLStorage {
|
|
|
782
784
|
}));
|
|
783
785
|
});
|
|
784
786
|
}
|
|
785
|
-
saveTranslationCache(
|
|
786
|
-
return __awaiter(this,
|
|
787
|
+
saveTranslationCache(_a) {
|
|
788
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, fileId, languageId, etag, }) {
|
|
787
789
|
yield this.dbPromise;
|
|
788
790
|
yield this.executeQuery((connection) => connection.execute(`
|
|
789
791
|
INSERT INTO translation_file_cache(integration_id, crowdin_id, file_id, language_id, etag)
|
|
@@ -791,8 +793,8 @@ class MySQLStorage {
|
|
|
791
793
|
`, [integrationId, crowdinId, fileId, languageId, etag]));
|
|
792
794
|
});
|
|
793
795
|
}
|
|
794
|
-
getFileTranslationCache(
|
|
795
|
-
return __awaiter(this,
|
|
796
|
+
getFileTranslationCache(_a) {
|
|
797
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, fileId, }) {
|
|
796
798
|
yield this.dbPromise;
|
|
797
799
|
return this.executeQuery((connection) => __awaiter(this, void 0, void 0, function* () {
|
|
798
800
|
const [rows] = yield connection.execute(`
|
|
@@ -810,8 +812,8 @@ class MySQLStorage {
|
|
|
810
812
|
}));
|
|
811
813
|
});
|
|
812
814
|
}
|
|
813
|
-
getFileTranslationCacheByLanguage(
|
|
814
|
-
return __awaiter(this,
|
|
815
|
+
getFileTranslationCacheByLanguage(_a) {
|
|
816
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, fileId, languageId, }) {
|
|
815
817
|
yield this.dbPromise;
|
|
816
818
|
return this.executeQuery((connection) => __awaiter(this, void 0, void 0, function* () {
|
|
817
819
|
const [rows] = yield connection.execute(`
|
|
@@ -830,8 +832,8 @@ class MySQLStorage {
|
|
|
830
832
|
}));
|
|
831
833
|
});
|
|
832
834
|
}
|
|
833
|
-
updateTranslationCache(
|
|
834
|
-
return __awaiter(this,
|
|
835
|
+
updateTranslationCache(_a) {
|
|
836
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, fileId, languageId, etag, }) {
|
|
835
837
|
yield this.dbPromise;
|
|
836
838
|
yield this.executeQuery((connection) => connection.execute(`
|
|
837
839
|
UPDATE translation_file_cache
|
|
@@ -843,8 +845,8 @@ class MySQLStorage {
|
|
|
843
845
|
`, [etag, integrationId, crowdinId, fileId, languageId]));
|
|
844
846
|
});
|
|
845
847
|
}
|
|
846
|
-
saveUnsyncedFiles(
|
|
847
|
-
return __awaiter(this,
|
|
848
|
+
saveUnsyncedFiles(_a) {
|
|
849
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, files }) {
|
|
848
850
|
yield this.dbPromise;
|
|
849
851
|
yield this.executeQuery((connection) => connection.execute(`
|
|
850
852
|
INSERT INTO unsynced_files(integration_id, crowdin_id, files)
|
|
@@ -852,8 +854,8 @@ class MySQLStorage {
|
|
|
852
854
|
`, [integrationId, crowdinId, files]));
|
|
853
855
|
});
|
|
854
856
|
}
|
|
855
|
-
updateUnsyncedFiles(
|
|
856
|
-
return __awaiter(this,
|
|
857
|
+
updateUnsyncedFiles(_a) {
|
|
858
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, files }) {
|
|
857
859
|
yield this.dbPromise;
|
|
858
860
|
yield this.executeQuery((connection) => connection.execute(`
|
|
859
861
|
UPDATE unsynced_files
|
|
@@ -863,8 +865,8 @@ class MySQLStorage {
|
|
|
863
865
|
`, [files, integrationId, crowdinId]));
|
|
864
866
|
});
|
|
865
867
|
}
|
|
866
|
-
getUnsyncedFiles(
|
|
867
|
-
return __awaiter(this,
|
|
868
|
+
getUnsyncedFiles(_a) {
|
|
869
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId }) {
|
|
868
870
|
yield this.dbPromise;
|
|
869
871
|
return this.executeQuery((connection) => __awaiter(this, void 0, void 0, function* () {
|
|
870
872
|
const [rows] = yield connection.execute(`
|
|
@@ -907,9 +909,9 @@ class MySQLStorage {
|
|
|
907
909
|
}));
|
|
908
910
|
});
|
|
909
911
|
}
|
|
910
|
-
selectRecords(
|
|
911
|
-
|
|
912
|
-
|
|
912
|
+
selectRecords(tableName_1) {
|
|
913
|
+
return __awaiter(this, arguments, void 0, function* (tableName, options = {}, params = []) {
|
|
914
|
+
var _a;
|
|
913
915
|
const columns = ((_a = options.columns) === null || _a === void 0 ? void 0 : _a.length) ? options.columns.join(', ') : '*';
|
|
914
916
|
const distinctKeyword = options.distinct ? 'DISTINCT ' : '';
|
|
915
917
|
const whereClause = options.whereClause ? ` ${options.whereClause}` : '';
|
|
@@ -928,8 +930,8 @@ class MySQLStorage {
|
|
|
928
930
|
}));
|
|
929
931
|
});
|
|
930
932
|
}
|
|
931
|
-
updateRecord(
|
|
932
|
-
return __awaiter(this,
|
|
933
|
+
updateRecord(tableName_1, data_1, whereClause_1) {
|
|
934
|
+
return __awaiter(this, arguments, void 0, function* (tableName, data, whereClause, params = []) {
|
|
933
935
|
const setClause = Object.keys(data)
|
|
934
936
|
.map((key) => `${key} = ?`)
|
|
935
937
|
.join(', ');
|
|
@@ -942,8 +944,8 @@ class MySQLStorage {
|
|
|
942
944
|
}));
|
|
943
945
|
});
|
|
944
946
|
}
|
|
945
|
-
deleteRecord(
|
|
946
|
-
return __awaiter(this,
|
|
947
|
+
deleteRecord(tableName_1, whereClause_1) {
|
|
948
|
+
return __awaiter(this, arguments, void 0, function* (tableName, whereClause, params = []) {
|
|
947
949
|
const query = `DELETE
|
|
948
950
|
FROM ${tableName} ${whereClause};`;
|
|
949
951
|
yield this.executeQuery((connection) => __awaiter(this, void 0, void 0, function* () {
|
package/out/storage/postgre.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare class PostgreStorage implements Storage {
|
|
|
47
47
|
private generateLockId;
|
|
48
48
|
executeQuery<T>(command: (client: Client) => Promise<T>): Promise<T>;
|
|
49
49
|
private hasDumpFiles;
|
|
50
|
-
migrate(): Promise<void>;
|
|
50
|
+
migrate(skipOnboarding?: boolean): Promise<void>;
|
|
51
51
|
addColumns(client: Client, newColumns: string[], tableName: string): Promise<void>;
|
|
52
52
|
addColumn(client: Client, columnName: string, tableName: string, columnType: string): Promise<void>;
|
|
53
53
|
addTables(client: Client): Promise<void>;
|
package/out/storage/postgre.js
CHANGED
|
@@ -210,22 +210,24 @@ class PostgreStorage {
|
|
|
210
210
|
const files = fs_1.default.readdirSync(directoryPath).filter((file) => file.startsWith(name) && file.endsWith(extension));
|
|
211
211
|
return files.length > 0;
|
|
212
212
|
}
|
|
213
|
-
migrate() {
|
|
213
|
+
migrate(skipOnboarding) {
|
|
214
214
|
return __awaiter(this, void 0, void 0, function* () {
|
|
215
215
|
try {
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
// Use advisory lock to prevent concurrent migrations
|
|
220
|
-
yield this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
221
|
-
yield client.query('SELECT pg_advisory_lock($1)', [this.migrationLockId]);
|
|
222
|
-
try {
|
|
223
|
-
yield this.addTables(client);
|
|
224
|
-
}
|
|
225
|
-
finally {
|
|
226
|
-
yield client.query('SELECT pg_advisory_unlock($1)', [this.migrationLockId]);
|
|
216
|
+
if (!skipOnboarding) {
|
|
217
|
+
if (this.directoryPath && this.hasDumpFiles(this.directoryPath)) {
|
|
218
|
+
yield this.migrateFromSqlite(this.directoryPath);
|
|
227
219
|
}
|
|
228
|
-
|
|
220
|
+
// Use advisory lock to prevent concurrent migrations
|
|
221
|
+
yield this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
222
|
+
yield client.query('SELECT pg_advisory_lock($1)', [this.migrationLockId]);
|
|
223
|
+
try {
|
|
224
|
+
yield this.addTables(client);
|
|
225
|
+
}
|
|
226
|
+
finally {
|
|
227
|
+
yield client.query('SELECT pg_advisory_unlock($1)', [this.migrationLockId]);
|
|
228
|
+
}
|
|
229
|
+
}));
|
|
230
|
+
}
|
|
229
231
|
this._res && this._res();
|
|
230
232
|
}
|
|
231
233
|
catch (e) {
|
|
@@ -643,8 +645,8 @@ class PostgreStorage {
|
|
|
643
645
|
]));
|
|
644
646
|
});
|
|
645
647
|
}
|
|
646
|
-
createJob(
|
|
647
|
-
return __awaiter(this,
|
|
648
|
+
createJob(_a) {
|
|
649
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, type, payload, title }) {
|
|
648
650
|
const id = (0, crypto_1.randomUUID)();
|
|
649
651
|
yield this.dbPromise;
|
|
650
652
|
yield this.executeQuery((client) => client.query(`
|
|
@@ -655,8 +657,8 @@ class PostgreStorage {
|
|
|
655
657
|
return id;
|
|
656
658
|
});
|
|
657
659
|
}
|
|
658
|
-
updateJob(
|
|
659
|
-
return __awaiter(this,
|
|
660
|
+
updateJob(_a) {
|
|
661
|
+
return __awaiter(this, arguments, void 0, function* ({ id, progress, status, info, data, attempt, errors, processedEntities, }) {
|
|
660
662
|
let parametersPointer = 1;
|
|
661
663
|
const updateFields = [`updated_at = $${parametersPointer}`];
|
|
662
664
|
const updateParams = [Date.now().toString()];
|
|
@@ -715,8 +717,8 @@ class PostgreStorage {
|
|
|
715
717
|
`, updateParams));
|
|
716
718
|
});
|
|
717
719
|
}
|
|
718
|
-
getJob(
|
|
719
|
-
return __awaiter(this,
|
|
720
|
+
getJob(_a) {
|
|
721
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
720
722
|
yield this.dbPromise;
|
|
721
723
|
return this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
722
724
|
const res = yield client.query(`
|
|
@@ -729,8 +731,8 @@ class PostgreStorage {
|
|
|
729
731
|
}));
|
|
730
732
|
});
|
|
731
733
|
}
|
|
732
|
-
getActiveJobs(
|
|
733
|
-
return __awaiter(this,
|
|
734
|
+
getActiveJobs(_a) {
|
|
735
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId }) {
|
|
734
736
|
yield this.dbPromise;
|
|
735
737
|
return this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
736
738
|
const res = yield client.query(`
|
|
@@ -763,8 +765,8 @@ class PostgreStorage {
|
|
|
763
765
|
}));
|
|
764
766
|
});
|
|
765
767
|
}
|
|
766
|
-
getAllJobs(
|
|
767
|
-
return __awaiter(this,
|
|
768
|
+
getAllJobs(_a) {
|
|
769
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, limit, offset }) {
|
|
768
770
|
yield this.dbPromise;
|
|
769
771
|
return this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
770
772
|
const res = yield client.query(`
|
|
@@ -792,8 +794,8 @@ class PostgreStorage {
|
|
|
792
794
|
}));
|
|
793
795
|
});
|
|
794
796
|
}
|
|
795
|
-
saveTranslationCache(
|
|
796
|
-
return __awaiter(this,
|
|
797
|
+
saveTranslationCache(_a) {
|
|
798
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, fileId, languageId, etag, }) {
|
|
797
799
|
yield this.dbPromise;
|
|
798
800
|
yield this.executeQuery((client) => client.query(`
|
|
799
801
|
INSERT
|
|
@@ -802,8 +804,8 @@ class PostgreStorage {
|
|
|
802
804
|
`, [integrationId, crowdinId, fileId, languageId, etag]));
|
|
803
805
|
});
|
|
804
806
|
}
|
|
805
|
-
getFileTranslationCache(
|
|
806
|
-
return __awaiter(this,
|
|
807
|
+
getFileTranslationCache(_a) {
|
|
808
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, fileId, }) {
|
|
807
809
|
yield this.dbPromise;
|
|
808
810
|
return this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
809
811
|
const res = yield client.query(`
|
|
@@ -815,8 +817,8 @@ class PostgreStorage {
|
|
|
815
817
|
}));
|
|
816
818
|
});
|
|
817
819
|
}
|
|
818
|
-
getFileTranslationCacheByLanguage(
|
|
819
|
-
return __awaiter(this,
|
|
820
|
+
getFileTranslationCacheByLanguage(_a) {
|
|
821
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, fileId, languageId, }) {
|
|
820
822
|
yield this.dbPromise;
|
|
821
823
|
return this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
822
824
|
const res = yield client.query(`
|
|
@@ -828,8 +830,8 @@ class PostgreStorage {
|
|
|
828
830
|
}));
|
|
829
831
|
});
|
|
830
832
|
}
|
|
831
|
-
updateTranslationCache(
|
|
832
|
-
return __awaiter(this,
|
|
833
|
+
updateTranslationCache(_a) {
|
|
834
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, fileId, languageId, etag, }) {
|
|
833
835
|
yield this.dbPromise;
|
|
834
836
|
yield this.executeQuery((client) => client.query(`
|
|
835
837
|
UPDATE translation_file_cache
|
|
@@ -862,8 +864,8 @@ class PostgreStorage {
|
|
|
862
864
|
yield this.resetSequences();
|
|
863
865
|
});
|
|
864
866
|
}
|
|
865
|
-
saveUnsyncedFiles(
|
|
866
|
-
return __awaiter(this,
|
|
867
|
+
saveUnsyncedFiles(_a) {
|
|
868
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, files }) {
|
|
867
869
|
yield this.dbPromise;
|
|
868
870
|
yield this.executeQuery((client) => client.query(`
|
|
869
871
|
INSERT
|
|
@@ -872,8 +874,8 @@ class PostgreStorage {
|
|
|
872
874
|
`, [integrationId, crowdinId, files]));
|
|
873
875
|
});
|
|
874
876
|
}
|
|
875
|
-
updateUnsyncedFiles(
|
|
876
|
-
return __awaiter(this,
|
|
877
|
+
updateUnsyncedFiles(_a) {
|
|
878
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId, files }) {
|
|
877
879
|
yield this.dbPromise;
|
|
878
880
|
yield this.executeQuery((client) => client.query(`
|
|
879
881
|
UPDATE unsynced_files
|
|
@@ -882,8 +884,8 @@ class PostgreStorage {
|
|
|
882
884
|
`, [files, integrationId, crowdinId]));
|
|
883
885
|
});
|
|
884
886
|
}
|
|
885
|
-
getUnsyncedFiles(
|
|
886
|
-
return __awaiter(this,
|
|
887
|
+
getUnsyncedFiles(_a) {
|
|
888
|
+
return __awaiter(this, arguments, void 0, function* ({ integrationId, crowdinId }) {
|
|
887
889
|
yield this.dbPromise;
|
|
888
890
|
return this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
889
891
|
const res = yield client.query(`
|
|
@@ -923,9 +925,9 @@ class PostgreStorage {
|
|
|
923
925
|
}));
|
|
924
926
|
});
|
|
925
927
|
}
|
|
926
|
-
selectRecords(
|
|
927
|
-
|
|
928
|
-
|
|
928
|
+
selectRecords(tableName_1) {
|
|
929
|
+
return __awaiter(this, arguments, void 0, function* (tableName, options = {}, params = []) {
|
|
930
|
+
var _a;
|
|
929
931
|
const columns = ((_a = options.columns) === null || _a === void 0 ? void 0 : _a.length) ? options.columns.join(', ') : '*';
|
|
930
932
|
const distinctKeyword = options.distinct ? 'DISTINCT ' : '';
|
|
931
933
|
const whereClause = options.whereClause ? ` ${options.whereClause}` : '';
|
|
@@ -939,8 +941,8 @@ class PostgreStorage {
|
|
|
939
941
|
}));
|
|
940
942
|
});
|
|
941
943
|
}
|
|
942
|
-
updateRecord(
|
|
943
|
-
return __awaiter(this,
|
|
944
|
+
updateRecord(tableName_1, data_1, whereClause_1) {
|
|
945
|
+
return __awaiter(this, arguments, void 0, function* (tableName, data, whereClause, params = []) {
|
|
944
946
|
const keys = Object.keys(data);
|
|
945
947
|
const setClause = keys.map((key, index) => `"${key}" = $${index + 1}`).join(', ');
|
|
946
948
|
const values = Object.values(data);
|
|
@@ -951,8 +953,8 @@ class PostgreStorage {
|
|
|
951
953
|
}));
|
|
952
954
|
});
|
|
953
955
|
}
|
|
954
|
-
deleteRecord(
|
|
955
|
-
return __awaiter(this,
|
|
956
|
+
deleteRecord(tableName_1, whereClause_1) {
|
|
957
|
+
return __awaiter(this, arguments, void 0, function* (tableName, whereClause, params = []) {
|
|
956
958
|
const query = `DELETE FROM ${tableName} ${whereClause};`;
|
|
957
959
|
yield this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
958
960
|
yield client.query(query, params);
|
package/out/storage/sqlite.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare class SQLiteStorage implements Storage {
|
|
|
24
24
|
synced_data: string;
|
|
25
25
|
};
|
|
26
26
|
constructor(config: SQLiteStorageConfig);
|
|
27
|
-
migrate(): Promise<void>;
|
|
27
|
+
migrate(skipOnboarding?: boolean): Promise<void>;
|
|
28
28
|
saveCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
|
29
29
|
updateCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
|
|
30
30
|
getCrowdinCredentials(id: string): Promise<CrowdinCredentials | undefined>;
|