@crowdin/app-project-module 0.96.2 → 0.97.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/modules/integration/util/job.js +2 -4
- package/out/modules/integration/util/types.d.ts +2 -1
- package/out/static/js/form.js +13 -13
- package/out/storage/index.d.ts +1 -0
- package/out/storage/mysql.d.ts +1 -0
- package/out/storage/mysql.js +7 -1
- package/out/storage/postgre.d.ts +1 -0
- package/out/storage/postgre.js +2 -1
- package/out/storage/sqlite.d.ts +1 -0
- package/out/storage/sqlite.js +2 -1
- package/package.json +1 -1
package/out/storage/index.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export interface Storage {
|
|
|
76
76
|
whereClause?: string;
|
|
77
77
|
orderBy?: string;
|
|
78
78
|
limit?: number;
|
|
79
|
+
offset?: number;
|
|
79
80
|
distinct?: boolean;
|
|
80
81
|
}, params?: any[]): Promise<any[]>;
|
|
81
82
|
updateRecord(tableName: string, data: Record<string, any>, whereClause: string, params?: any[]): Promise<void>;
|
package/out/storage/mysql.d.ts
CHANGED
|
@@ -97,6 +97,7 @@ export declare class MySQLStorage implements Storage {
|
|
|
97
97
|
whereClause?: string;
|
|
98
98
|
orderBy?: string;
|
|
99
99
|
limit?: number;
|
|
100
|
+
offset?: number;
|
|
100
101
|
distinct?: boolean;
|
|
101
102
|
}, params?: any[]): Promise<any[]>;
|
|
102
103
|
updateRecord(tableName: string, data: Record<string, any>, whereClause: string, params?: any[]): Promise<void>;
|
package/out/storage/mysql.js
CHANGED
|
@@ -873,7 +873,13 @@ class MySQLStorage {
|
|
|
873
873
|
const distinctKeyword = options.distinct ? 'DISTINCT ' : '';
|
|
874
874
|
const whereClause = options.whereClause ? ` ${options.whereClause}` : '';
|
|
875
875
|
const orderByClause = options.orderBy ? ` ORDER BY ${options.orderBy}` : '';
|
|
876
|
-
|
|
876
|
+
let limitClause = options.limit ? ` LIMIT ${options.limit}` : '';
|
|
877
|
+
if (!options.limit && options.offset) {
|
|
878
|
+
throw new Error('[selectRecords] Limit is required for pagination with MySQL');
|
|
879
|
+
}
|
|
880
|
+
else if (options.limit && options.offset) {
|
|
881
|
+
limitClause += ` OFFSET ${options.offset}`;
|
|
882
|
+
}
|
|
877
883
|
const query = `SELECT ${distinctKeyword}${columns} FROM ${tableName}${whereClause}${orderByClause}${limitClause};`;
|
|
878
884
|
return this.executeQuery((connection) => __awaiter(this, void 0, void 0, function* () {
|
|
879
885
|
const [rows] = yield connection.execute(query, params);
|
package/out/storage/postgre.d.ts
CHANGED
|
@@ -108,6 +108,7 @@ export declare class PostgreStorage implements Storage {
|
|
|
108
108
|
whereClause?: string;
|
|
109
109
|
orderBy?: string;
|
|
110
110
|
limit?: number;
|
|
111
|
+
offset?: number;
|
|
111
112
|
distinct?: boolean;
|
|
112
113
|
}, params?: any[]): Promise<any[]>;
|
|
113
114
|
updateRecord(tableName: string, data: Record<string, any>, whereClause: string, params?: any[]): Promise<void>;
|
package/out/storage/postgre.js
CHANGED
|
@@ -886,7 +886,8 @@ class PostgreStorage {
|
|
|
886
886
|
const whereClause = options.whereClause ? ` ${options.whereClause}` : '';
|
|
887
887
|
const orderByClause = options.orderBy ? ` ORDER BY ${options.orderBy}` : '';
|
|
888
888
|
const limitClause = options.limit ? ` LIMIT ${options.limit}` : '';
|
|
889
|
-
const
|
|
889
|
+
const offsetClause = options.offset ? ` OFFSET ${options.offset}` : '';
|
|
890
|
+
const query = `SELECT ${distinctKeyword}${columns} FROM ${tableName}${whereClause}${orderByClause}${limitClause}${offsetClause};`;
|
|
890
891
|
return this.executeQuery((client) => __awaiter(this, void 0, void 0, function* () {
|
|
891
892
|
const res = yield client.query(query, params);
|
|
892
893
|
return res.rows;
|
package/out/storage/sqlite.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ export declare class SQLiteStorage implements Storage {
|
|
|
95
95
|
whereClause?: string;
|
|
96
96
|
orderBy?: string;
|
|
97
97
|
limit?: number;
|
|
98
|
+
offset?: number;
|
|
98
99
|
distinct?: boolean;
|
|
99
100
|
}, params?: any[]): Promise<any[]>;
|
|
100
101
|
updateRecord(tableName: string, data: Record<string, any>, whereClause: string, params?: any[]): Promise<void>;
|
package/out/storage/sqlite.js
CHANGED
|
@@ -745,7 +745,8 @@ class SQLiteStorage {
|
|
|
745
745
|
const whereClause = options.whereClause ? ` ${options.whereClause}` : '';
|
|
746
746
|
const orderByClause = options.orderBy ? ` ORDER BY ${options.orderBy}` : '';
|
|
747
747
|
const limitClause = options.limit ? ` LIMIT ${options.limit}` : '';
|
|
748
|
-
const
|
|
748
|
+
const offsetClause = options.offset ? ` OFFSET ${options.offset}` : '';
|
|
749
|
+
const query = `SELECT ${distinctKeyword}${columns} FROM ${tableName}${whereClause}${orderByClause}${limitClause}${offsetClause};`;
|
|
749
750
|
return this.each(query, params);
|
|
750
751
|
});
|
|
751
752
|
}
|
package/package.json
CHANGED