@opengis/fastify-table 2.0.77 → 2.0.79
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/dist/log/migration/dist-geoname-cls.json +1 -0
- package/dist/server/plugins/crud/funcs/dataUpsert.d.ts +13 -0
- package/dist/server/plugins/crud/funcs/dataUpsert.d.ts.map +1 -0
- package/dist/server/plugins/crud/funcs/dataUpsert.js +148 -0
- package/dist/server/plugins/crud/funcs/utils/getInsertQuery.d.ts +2 -0
- package/dist/server/plugins/crud/funcs/utils/getInsertQuery.d.ts.map +1 -1
- package/dist/server/plugins/crud/funcs/utils/getInsertQuery.js +2 -1
- package/dist/server/plugins/file/providers/fs.d.ts +1 -1
- package/dist/server/plugins/file/uploadMultiPart.d.ts +1 -1
- package/dist/server/plugins/file/uploadMultiPart.d.ts.map +1 -1
- package/dist/server/plugins/file/uploadMultiPart.js +10 -2
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -0
- package/package.json +88 -88
- package/dist/log/migration/dist-ip_ukraine-cls.json +0 -1
- /package/dist/log/migration/{dist-ip_ukraine-cls.sql → dist-geoname-cls.sql} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"name":"admin.user_id","module":"data","type":"select","hash":"29f728fe5e89fed0f2bec41657fae26e","dbhash":"29f728fe5e89fed0f2bec41657fae26e","update":false},{"name":"data.admin_statistic","module":"data","type":"select","hash":"8f0689a8995711c7693379a177ea4e92","dbhash":"8f0689a8995711c7693379a177ea4e92","update":false},{"name":"data.last_objects_all","module":"data","type":"select","hash":"f942c95781b420a837ae38c324cca7a9","dbhash":"f942c95781b420a837ae38c324cca7a9","update":false},{"name":"data.object_id","module":"data","type":"select","hash":"f5b4f8e86d5b3bf5da599b4e7d126ea2","dbhash":"f5b4f8e86d5b3bf5da599b4e7d126ea2","update":false},{"name":"data.site_statistic","module":"data","type":"select","hash":"fbc3b42fee3ef287b3a576bb1a0b43b4","dbhash":"fbc3b42fee3ef287b3a576bb1a0b43b4","update":false},{"name":"data_addition.change_status.parent","module":"data_addition","type":"select","hash":"517f0390a98a5642b94a62dbbd058441","dbhash":"517f0390a98a5642b94a62dbbd058441","update":false},{"name":"data_addition.deregistration.parent","module":"data_addition","type":"select","hash":"1dbbd6e0a48e52a9c23dedad368f06c3","dbhash":"1dbbd6e0a48e52a9c23dedad368f06c3","update":false},{"name":"data_addition.historical_name.parent","module":"data_addition","type":"select","hash":"3d42dee53b639fb594e9961492f577cc","dbhash":"3d42dee53b639fb594e9961492f577cc","update":false},{"name":"data_addition.national_lang_name.parent","module":"data_addition","type":"select","hash":"c3a9ac90dd38c02736503d003a0ca012","dbhash":"c3a9ac90dd38c02736503d003a0ca012","update":false},{"name":"data_addition.objects_atu.parent","module":"data_addition","type":"select","hash":"1629be10ba3bd71280621dc7e6737092","dbhash":"1629be10ba3bd71280621dc7e6737092","update":false},{"name":"data_addition.objects_countries.parent","module":"data_addition","type":"select","hash":"b389f543053bf35a5469580333cc1b0b","dbhash":"b389f543053bf35a5469580333cc1b0b","update":false},{"name":"data_addition.options_name.parent","module":"data_addition","type":"select","hash":"e5d02b5f8d64a18cf21b1daa448fe54e","dbhash":"e5d02b5f8d64a18cf21b1daa448fe54e","update":false},{"name":"data_addition.options_type.parent","module":"data_addition","type":"select","hash":"fb41e8f7b9cf18786611d8e880ff4051","dbhash":"fb41e8f7b9cf18786611d8e880ff4051","update":false},{"name":"data_addition.rename.parent","module":"data_addition","type":"select","hash":"c883a3baf1beb4a7d3d5bdb28062be69","dbhash":"c883a3baf1beb4a7d3d5bdb28062be69","update":false},{"name":"data_countries.object_id","module":"data_countries","type":"select","hash":"a6f120bea7bd0df1afcdb1b56484e516","dbhash":"a6f120bea7bd0df1afcdb1b56484e516","update":false},{"name":"dict.admin_status","module":"dict","type":"select","hash":"10452051e966f3051456226b78d1e11b","dbhash":"10452051e966f3051456226b78d1e11b","update":false},{"name":"dict.atu_countries","module":"dict","type":"select","hash":"c7368a1b9c10350e5709872d933a6ffb","dbhash":"c7368a1b9c10350e5709872d933a6ffb","update":false},{"name":"dict.atu_type","module":"dict","type":"select","hash":"376a4e7a7e77d5f9ee865b8a1fb25e07","dbhash":"376a4e7a7e77d5f9ee865b8a1fb25e07","update":false},{"name":"dict.community","module":"dict","type":"select","hash":"deb128826eb03dbca6762f058f49e980","dbhash":"deb128826eb03dbca6762f058f49e980","update":false},{"name":"dict.country_location","module":"dict","type":"select","hash":"333f3f56fc1a9f79f176f509d8aeca53","dbhash":"333f3f56fc1a9f79f176f509d8aeca53","update":false},{"name":"dict.district","module":"dict","type":"select","hash":"0d3a18d3fe4e6329567f5ba5cc360d53","dbhash":"0d3a18d3fe4e6329567f5ba5cc360d53","update":false},{"name":"dict.existence","module":"dict","type":"select","hash":"781bb2394e4f5eee87cbaf6ff1cc358e","dbhash":"781bb2394e4f5eee87cbaf6ff1cc358e","update":false},{"name":"dict.foreign_country","module":"dict","type":"select","hash":"dd4d5c31a9eea9abd538acdb952e99e9","dbhash":"dd4d5c31a9eea9abd538acdb952e99e9","update":false},{"name":"dict.info_source","module":"dict","type":"select","hash":"0ae17d8e43740078dea206cc7949151f","dbhash":"0ae17d8e43740078dea206cc7949151f","update":false},{"name":"dict.language","module":"dict","type":"select","hash":"fd1826c9ca150ef93bd251b923d6094e","dbhash":"fd1826c9ca150ef93bd251b923d6094e","update":false},{"name":"dict.object_type.adm","module":"dict","type":"select","hash":"0faeff4dc1c1f60996efe614d44a6e5f","dbhash":"0faeff4dc1c1f60996efe614d44a6e5f","update":false},{"name":"dict.object_type.geo","module":"dict","type":"select","hash":"34b82095969396e8a8497f93cda3dcc5","dbhash":"34b82095969396e8a8497f93cda3dcc5","update":false},{"name":"dict.object_type.pzf","module":"dict","type":"select","hash":"df2c1ced6405602aa8f262e437ac5062","dbhash":"df2c1ced6405602aa8f262e437ac5062","update":false},{"name":"dict.object_type.soc","module":"dict","type":"select","hash":"d60d3f993acb76e5782e4a3046756858","dbhash":"d60d3f993acb76e5782e4a3046756858","update":false},{"name":"dict.object_type","module":"dict","type":"select","hash":"9630e32f344f33580d5a90e305bf5cf2","dbhash":"9630e32f344f33580d5a90e305bf5cf2","update":false},{"name":"dict.region","module":"dict","type":"select","hash":"c1e0b38f520a004726694109398d5544","dbhash":"c1e0b38f520a004726694109398d5544","update":false},{"name":"dict.settlement_type","module":"dict","type":"select","hash":"49261c87bf6cd01e4ab32f65c94b5dbf","dbhash":"49261c87bf6cd01e4ab32f65c94b5dbf","update":false},{"name":"dict.source","module":"dict","type":"select","hash":"ac2bf8aca5c819e42b6529c73a7e1cb5","dbhash":"ac2bf8aca5c819e42b6529c73a7e1cb5","update":false},{"name":"dict.source_name","module":"dict","type":"select","hash":"9550cb3ad87783d7528c3c440be50a89","dbhash":"9550cb3ad87783d7528c3c440be50a89","update":false},{"name":"dict.source_type","module":"dict","type":"select","hash":"fee4eb12cd50344d2de7c49290238501","dbhash":"fee4eb12cd50344d2de7c49290238501","update":false},{"name":"core.accounts","module":"settings","type":"select","hash":"36eef3856f46bc0eecb61a6f911ced2e","dbhash":"36eef3856f46bc0eecb61a6f911ced2e","update":false},{"name":"core.menu_id","module":"settings","type":"select","hash":"3b08d360628afa15339f364f5e2ff211","dbhash":"3b08d360628afa15339f364f5e2ff211","update":false},{"name":"core.roles","module":"settings","type":"select","hash":"ed1290380ea5e5e7e48bd08b41cb7793","dbhash":"ed1290380ea5e5e7e48bd08b41cb7793","update":false},{"name":"core.routes.alias","module":"settings","type":"select","hash":"ac6afe9a8ebaf0b26236c4bae5297709","dbhash":"ac6afe9a8ebaf0b26236c4bae5297709","update":false},{"name":"core.routes","module":"settings","type":"select","hash":"306bddbe5b73b0628728a60f5335aaee","dbhash":"306bddbe5b73b0628728a60f5335aaee","update":false},{"name":"core.rules","module":"settings","type":"select","hash":"a86085f579f4abff5cf09e775e034ed3","dbhash":"a86085f579f4abff5cf09e775e034ed3","update":false},{"name":"core.user_mentioned","module":"settings","type":"select","hash":"6687f073de73a3ec4b6e0811d9310e7e","dbhash":"6687f073de73a3ec4b6e0811d9310e7e","update":false},{"name":"core.user_uid","module":"settings","type":"select","hash":"45f7d8a57ecbca5b433be7937be51d5c","dbhash":"45f7d8a57ecbca5b433be7937be51d5c","update":false},{"name":"data.exist_flag","module":"data","type":"cls","hash":"4cc57ff8d055dd194b51a6937d70f04c","dbhash":"4cc57ff8d055dd194b51a6937d70f04c","update":false},{"name":"data.latitude_dir","module":"data","type":"cls","hash":"542cd461818ff655002fec7bf23dcdb1","dbhash":"542cd461818ff655002fec7bf23dcdb1","update":false},{"name":"data.longitude_dir","module":"data","type":"cls","hash":"39f5c0554eab4f34ae25312d8dfafa78","dbhash":"39f5c0554eab4f34ae25312d8dfafa78","update":false},{"name":"data._type","module":"data","type":"cls","hash":"588c9b704054165dc6977f1262bbfee7","dbhash":"588c9b704054165dc6977f1262bbfee7","update":false},{"name":"access_type","module":"settings","type":"cls","hash":"e02065dbaed2ccb437a1722c00ed3fab","dbhash":"e02065dbaed2ccb437a1722c00ed3fab","update":false},{"name":"change_type","module":"settings","type":"cls","hash":"0fcaac1864fc81b9760075836c1bb2ac","dbhash":"0fcaac1864fc81b9760075836c1bb2ac","update":false},{"name":"core.actions","module":"settings","type":"cls","hash":"17862ea92ef5ad846a284fd68b4ff1f7","dbhash":"17862ea92ef5ad846a284fd68b4ff1f7","update":false},{"name":"core.column_type","module":"settings","type":"cls","hash":"8004d1fc1876e6f5a096b4f40a7f3775","dbhash":"8004d1fc1876e6f5a096b4f40a7f3775","update":false},{"name":"core.scope","module":"settings","type":"cls","hash":"c274693f6c7e9849704bbf4c46334871","dbhash":"c274693f6c7e9849704bbf4c46334871","update":false},{"name":"properties.site_status","module":"settings","type":"cls","hash":"2c2980706c5afe8808000d971b304cc9","dbhash":"2c2980706c5afe8808000d971b304cc9","update":false},{"name":"properties.widget_status","module":"settings","type":"cls","hash":"232f321af15895a9b33953c9bd500043","dbhash":"232f321af15895a9b33953c9bd500043","update":false},{"name":"users.user_type","module":"settings","type":"cls","hash":"9f6a303d48d2d33c68dbcd8e72ad0e83","dbhash":"9f6a303d48d2d33c68dbcd8e72ad0e83","update":false},{"name":"yes_no","module":"settings","type":"cls","hash":"50c527053426248c20b0a2f112ff9046","dbhash":"50c527053426248c20b0a2f112ff9046","update":false}]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ExtendedPG } from "../../../types/core.js";
|
|
2
|
+
export default function dataUpsert({ id, table: table1, referer, data, pg: pg1, uid, tokenData, update, constraint, }: {
|
|
3
|
+
id?: string | number;
|
|
4
|
+
table: string;
|
|
5
|
+
referer?: string;
|
|
6
|
+
data: Record<string, any>;
|
|
7
|
+
pg?: ExtendedPG;
|
|
8
|
+
uid?: string;
|
|
9
|
+
tokenData?: Record<string, any>;
|
|
10
|
+
update?: boolean | string;
|
|
11
|
+
constraint?: string;
|
|
12
|
+
}): Promise<any>;
|
|
13
|
+
//# sourceMappingURL=dataUpsert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataUpsert.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/crud/funcs/dataUpsert.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAezD,wBAA8B,UAAU,CAAC,EACvC,EAAE,EACF,KAAK,EAAE,MAAM,EACb,OAAO,EACP,IAAI,EACJ,EAAE,EAAE,GAAG,EACP,GAAG,EACH,SAAc,EACd,MAAa,EACb,UAAU,GACX,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,gBA+KA"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import getPG from "../../pg/funcs/getPG.js";
|
|
2
|
+
import getRedis from "../../redis/funcs/getRedis.js";
|
|
3
|
+
import pgClients from "../../pg/pgClients.js";
|
|
4
|
+
import getTemplate from "../../table/funcs/getTemplate.js";
|
|
5
|
+
import config from "../../../../config.js";
|
|
6
|
+
import logChanges from "./utils/logChanges.js";
|
|
7
|
+
import getInsertQuery from "./utils/getInsertQuery.js";
|
|
8
|
+
import logger from "../../logger/getLogger.js";
|
|
9
|
+
import extraData from "../../extra/extraData.js";
|
|
10
|
+
const rclient = getRedis();
|
|
11
|
+
export default async function dataUpsert({ id, table: table1, referer, data, pg: pg1, uid, tokenData = {}, update = true, constraint, }) {
|
|
12
|
+
const pg = pg1 || getPG({ name: "client" });
|
|
13
|
+
if (!pg)
|
|
14
|
+
return null;
|
|
15
|
+
// pg client single transaction support
|
|
16
|
+
if (!pg?.pk && config.pg) {
|
|
17
|
+
pg.options = pgClients.client?.options;
|
|
18
|
+
pg.tlist = pgClients.client?.tlist;
|
|
19
|
+
pg.pgType = pgClients.client?.pgType;
|
|
20
|
+
pg.relkinds = pgClients.client?.relkinds;
|
|
21
|
+
pg.pk = pgClients.client?.pk;
|
|
22
|
+
}
|
|
23
|
+
if (config.trace)
|
|
24
|
+
console.log("form", tokenData?.form);
|
|
25
|
+
const table = pg.pk?.[table1] ? table1 : table1.replace(/"/g, "");
|
|
26
|
+
const { insertQuery, args = [], keys = [], systemColumns = [], } = (await getInsertQuery({
|
|
27
|
+
pg,
|
|
28
|
+
table,
|
|
29
|
+
data,
|
|
30
|
+
id,
|
|
31
|
+
uid,
|
|
32
|
+
})) || {};
|
|
33
|
+
const updatedAtColumn = systemColumns
|
|
34
|
+
.map((el) => el[0])
|
|
35
|
+
.find((colname) => ["editor_date", "updated_at"].includes(colname));
|
|
36
|
+
const upsert = () => {
|
|
37
|
+
if (!update || !keys.length) {
|
|
38
|
+
const p1 = `on conflict(${constraint || pg.pk?.[table]}) do `;
|
|
39
|
+
const p2 = updatedAtColumn
|
|
40
|
+
? `update set ${updatedAtColumn}=now()`
|
|
41
|
+
: "nothing";
|
|
42
|
+
return p1 + p2 + "returning *";
|
|
43
|
+
}
|
|
44
|
+
return `on conflict(${constraint || pg.pk?.[table]}) do update set ${typeof update === "string"
|
|
45
|
+
? update
|
|
46
|
+
: keys.map((colname) => `${colname} = EXCLUDED."${colname}"`).join(", ")} ${keys.includes(updatedAtColumn) || !updatedAtColumn
|
|
47
|
+
? ""
|
|
48
|
+
: `,${updatedAtColumn}=now()`} returning *`;
|
|
49
|
+
};
|
|
50
|
+
if (!insertQuery || !args.length)
|
|
51
|
+
return null;
|
|
52
|
+
const q = [insertQuery.replace("returning *", ""), upsert()]
|
|
53
|
+
.filter(Boolean)
|
|
54
|
+
.join(" ");
|
|
55
|
+
// for transactions
|
|
56
|
+
const isClient = typeof pg.query === "function" && typeof pg.release === "function";
|
|
57
|
+
const client = (isClient ? pg : await pg.connect());
|
|
58
|
+
if (isClient || !client.pk) {
|
|
59
|
+
client.options = pg.options;
|
|
60
|
+
client.tlist = pg.tlist;
|
|
61
|
+
client.pgType = pg.pgType;
|
|
62
|
+
client.relkinds = pg.relkinds;
|
|
63
|
+
client.pk = pg.pk;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
if (!isClient) {
|
|
67
|
+
await client.query("begin;");
|
|
68
|
+
}
|
|
69
|
+
const row = await client.query(q, args).then((el) => el.rows?.[0]);
|
|
70
|
+
const id1 = row?.[pg.pk?.[table] || ""];
|
|
71
|
+
if (!id1)
|
|
72
|
+
return null;
|
|
73
|
+
await extraData({
|
|
74
|
+
table,
|
|
75
|
+
form: tokenData?.form,
|
|
76
|
+
id: id1,
|
|
77
|
+
data,
|
|
78
|
+
uid,
|
|
79
|
+
row,
|
|
80
|
+
}, client);
|
|
81
|
+
// foreign key dataTable (table + parent_id)
|
|
82
|
+
const formData = tokenData?.form
|
|
83
|
+
? (await getTemplate("form", tokenData.form)) || {}
|
|
84
|
+
: {};
|
|
85
|
+
const schema = formData?.schema || formData;
|
|
86
|
+
const parentKeys = Object.keys(schema || {})?.filter((key) => data[key]?.length &&
|
|
87
|
+
Array.isArray(data[key]) &&
|
|
88
|
+
schema?.[key]?.table &&
|
|
89
|
+
schema?.[key]?.parent_id);
|
|
90
|
+
if (parentKeys?.length) {
|
|
91
|
+
await Promise.all(parentKeys?.map(async (key) => {
|
|
92
|
+
const parentKey = schema[key].parent_id;
|
|
93
|
+
const objId = data[parentKey] || data?.id || row?.[parentKey] || id1;
|
|
94
|
+
const parentRows = await Promise.all(data[key].map(async (row) => {
|
|
95
|
+
Object.assign(row, { [parentKey]: objId });
|
|
96
|
+
const parentRes = await getInsertQuery({
|
|
97
|
+
pg: client,
|
|
98
|
+
table: schema[key].table,
|
|
99
|
+
data: row,
|
|
100
|
+
uid,
|
|
101
|
+
});
|
|
102
|
+
if (!parentRes?.insertQuery || !parentRes?.args?.length)
|
|
103
|
+
return null;
|
|
104
|
+
const { rows = [] } = await client.query(parentRes.insertQuery, parentRes.args);
|
|
105
|
+
return rows[0];
|
|
106
|
+
}));
|
|
107
|
+
Object.assign(row, { [key]: parentRows.filter(Boolean) });
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
await logChanges({
|
|
111
|
+
pg: client,
|
|
112
|
+
table,
|
|
113
|
+
tokenData,
|
|
114
|
+
referer,
|
|
115
|
+
data,
|
|
116
|
+
id: id1,
|
|
117
|
+
uid,
|
|
118
|
+
type: "UPSERT",
|
|
119
|
+
});
|
|
120
|
+
if (config.redis) {
|
|
121
|
+
rclient.incr(`pg:${table}:crud`);
|
|
122
|
+
}
|
|
123
|
+
if (!isClient) {
|
|
124
|
+
await client.query("commit;");
|
|
125
|
+
}
|
|
126
|
+
return row;
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
logger.file("crud/upsert", {
|
|
130
|
+
error: err.toString(),
|
|
131
|
+
stack: err.stack,
|
|
132
|
+
table,
|
|
133
|
+
id,
|
|
134
|
+
referer,
|
|
135
|
+
uid,
|
|
136
|
+
form: tokenData?.form,
|
|
137
|
+
});
|
|
138
|
+
if (!isClient) {
|
|
139
|
+
await client.query("rollback;");
|
|
140
|
+
}
|
|
141
|
+
throw err;
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
if (!isClient) {
|
|
145
|
+
client?.release?.();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInsertQuery.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/crud/funcs/utils/getInsertQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5D,wBAA8B,cAAc,CAAC,EAC3C,EAAE,EACF,KAAK,EACL,IAAI,EACJ,EAAE,EACF,GAAG,GACJ,EAAE;IACD,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd
|
|
1
|
+
{"version":3,"file":"getInsertQuery.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/crud/funcs/utils/getInsertQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5D,wBAA8B,cAAc,CAAC,EAC3C,EAAE,EACF,KAAK,EACL,IAAI,EACJ,EAAE,EACF,GAAG,GACJ,EAAE;IACD,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;;;;;UA+EA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
export default function fsStorage(): {
|
|
3
3
|
deleteFile: (fp: string) => Promise<void>;
|
|
4
|
-
downloadFile: (fp: string, options?: Record<string, any>) => Promise<
|
|
4
|
+
downloadFile: (fp: string, options?: Record<string, any>) => Promise<Buffer<ArrayBufferLike> | fs.ReadStream | {
|
|
5
5
|
original: string;
|
|
6
6
|
full: string | null;
|
|
7
7
|
} | null>;
|
|
@@ -9,7 +9,7 @@ interface IFile {
|
|
|
9
9
|
extension?: string;
|
|
10
10
|
buffer?: Buffer;
|
|
11
11
|
filename?: string;
|
|
12
|
-
|
|
12
|
+
fields?: Record<string, any>;
|
|
13
13
|
}
|
|
14
14
|
export default function uploadMultiPart(req: any, { extensions, raw, subdir, originalFilename, }?: {
|
|
15
15
|
extensions?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadMultiPart.d.ts","sourceRoot":"","sources":["../../../../server/plugins/file/uploadMultiPart.ts"],"names":[],"mappings":"AAqBA,UAAU,KAAK;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"uploadMultiPart.d.ts","sourceRoot":"","sources":["../../../../server/plugins/file/uploadMultiPart.ts"],"names":[],"mappings":"AAqBA,UAAU,KAAK;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAyCD,wBAA8B,eAAe,CAC3C,GAAG,EAAE,GAAG,EACR,EACE,UAAU,EACV,GAAG,EACH,MAAM,EACN,gBAAwB,GACzB,GAAE;IACD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACvB,GACL,OAAO,CAAC,KAAK,CAAC,CAgGhB"}
|
|
@@ -66,8 +66,15 @@ export default async function uploadMultiPart(req, { extensions, raw, subdir, or
|
|
|
66
66
|
if (!fileBuffer?.length) {
|
|
67
67
|
throw new BadRequestError("file buffer is empty");
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
// return buffer for custom upload
|
|
70
|
+
if (raw) {
|
|
71
|
+
return {
|
|
72
|
+
buffer: fileBuffer,
|
|
73
|
+
filename: value.filename,
|
|
74
|
+
extension: ext.substring(1),
|
|
75
|
+
fields: value.fields,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
71
78
|
const dir = subdir != null ? subdir : req.params?.["*"] || "uploads";
|
|
72
79
|
const yearMonthDay = subdir != null ? "" : new Date().toISOString().split("T")[0];
|
|
73
80
|
const dbname = req.pg?.options?.database || req.pg?.database || config.pg?.database; // request / config params / default config params
|
|
@@ -81,6 +88,7 @@ export default async function uploadMultiPart(req, { extensions, raw, subdir, or
|
|
|
81
88
|
throw new BadRequestError("file with specified name already exists in directory");
|
|
82
89
|
}
|
|
83
90
|
const file = {
|
|
91
|
+
fields: value.fields,
|
|
84
92
|
originalFilename: value.filename,
|
|
85
93
|
newFilename,
|
|
86
94
|
filepath: path.join(folder, newFilename).replace(/\\/g, "/"),
|
package/dist/utils.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export { default as getMenu } from "./server/routes/menu/controllers/getMenu.js"
|
|
|
34
34
|
export { default as getFilter } from "./server/plugins/table/funcs/getFilter.js";
|
|
35
35
|
export { default as dataInsert } from "./server/plugins/crud/funcs/dataInsert.js";
|
|
36
36
|
export { default as dataUpdate } from "./server/plugins/crud/funcs/dataUpdate.js";
|
|
37
|
+
export { default as dataUpsert } from "./server/plugins/crud/funcs/dataUpsert.js";
|
|
37
38
|
export { default as dataDelete } from "./server/plugins/crud/funcs/dataDelete.js";
|
|
38
39
|
export { default as getInsertQuery } from "./server/plugins/crud/funcs/utils/getInsertQuery.js";
|
|
39
40
|
export { default as getToken } from "./server/plugins/crud/funcs/getToken.js";
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGvE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EA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AO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAE5F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAE9F,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAEnG,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,GACX,MAAM,mCAAmC,CAAC;;AAE3C,wBAAoB"}
|
package/dist/utils.js
CHANGED
|
@@ -42,6 +42,7 @@ export { default as getFilter } from "./server/plugins/table/funcs/getFilter.js"
|
|
|
42
42
|
// crud
|
|
43
43
|
export { default as dataInsert } from "./server/plugins/crud/funcs/dataInsert.js";
|
|
44
44
|
export { default as dataUpdate } from "./server/plugins/crud/funcs/dataUpdate.js";
|
|
45
|
+
export { default as dataUpsert } from "./server/plugins/crud/funcs/dataUpsert.js";
|
|
45
46
|
export { default as dataDelete } from "./server/plugins/crud/funcs/dataDelete.js";
|
|
46
47
|
export { default as getInsertQuery } from "./server/plugins/crud/funcs/utils/getInsertQuery.js";
|
|
47
48
|
export { default as getToken } from "./server/plugins/crud/funcs/getToken.js";
|
package/package.json
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@opengis/fastify-table",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "core-plugins",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"fastify",
|
|
8
|
-
"table",
|
|
9
|
-
"crud",
|
|
10
|
-
"auth",
|
|
11
|
-
"pg",
|
|
12
|
-
"backend"
|
|
13
|
-
],
|
|
14
|
-
"main": "dist/index.js",
|
|
15
|
-
"exports": {
|
|
16
|
-
".": "./dist/index.js",
|
|
17
|
-
"./index.js": "./dist/index.js",
|
|
18
|
-
"./utils.js": "./dist/utils.js"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"dist/*"
|
|
22
|
-
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"prepublishOnly": "npm run build",
|
|
25
|
-
"clean": "tsc -b --clean",
|
|
26
|
-
"build": "tsc -b --clean && tsc && copyfiles server/plugins/grpc/utils/*.proto dist && copyfiles server/migrations/*.sql dist && copyfiles server/templates/**/*.html dist",
|
|
27
|
-
"prod": "NODE_ENV=production bun dist/server",
|
|
28
|
-
"patch": "npm version patch && git push && npm publish",
|
|
29
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
30
|
-
"test": "bun test",
|
|
31
|
-
"compress": "node compress.js",
|
|
32
|
-
"dev1": "bun --hot dist/server",
|
|
33
|
-
"dev": "NODE_ENV=production bun start",
|
|
34
|
-
"start": "LOG_LEVEL=trace bun server"
|
|
35
|
-
},
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"@aws-sdk/client-s3": "3.879.0",
|
|
38
|
-
"@aws-sdk/lib-storage": "3.879.0",
|
|
39
|
-
"@fastify/cookie": "11.0.2",
|
|
40
|
-
"@fastify/http-proxy": "11.1.2",
|
|
41
|
-
"@fastify/multipart": "9.0.3",
|
|
42
|
-
"@fastify/passport": "3.0.2",
|
|
43
|
-
"@fastify/rate-limit": "10.3.0",
|
|
44
|
-
"@fastify/session": "11.1.0",
|
|
45
|
-
"@grpc/grpc-js": "1.10.11",
|
|
46
|
-
"@grpc/proto-loader": "0.7.15",
|
|
47
|
-
"apache-crypt": "1.2.6",
|
|
48
|
-
"better-sqlite3": "12.2.0",
|
|
49
|
-
"dotenv": "16.5.0",
|
|
50
|
-
"fastify": "5.3.3",
|
|
51
|
-
"fastify-plugin": "5.0.1",
|
|
52
|
-
"fastify-session-redis-store": "7.1.2",
|
|
53
|
-
"handlebars": "4.7.8",
|
|
54
|
-
"image-size": "1.2.0",
|
|
55
|
-
"ioredis": "5.3.2",
|
|
56
|
-
"js-yaml": "4.1.0",
|
|
57
|
-
"markdown-it": "14.1.0",
|
|
58
|
-
"nodemailer": "7.0.6",
|
|
59
|
-
"otplib": "12.0.1",
|
|
60
|
-
"pg": "8.11.6",
|
|
61
|
-
"pino": "9.5.0",
|
|
62
|
-
"pino-abstract-transport": "2.0.0",
|
|
63
|
-
"promised-handlebars": "2.0.1",
|
|
64
|
-
"qrcode": "1.5.4",
|
|
65
|
-
"uglify-js": "3.19.3",
|
|
66
|
-
"undici": "7.16.0"
|
|
67
|
-
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
70
|
-
"@types/bun": "^1.2.21",
|
|
71
|
-
"@types/js-yaml": "^4.0.9",
|
|
72
|
-
"@types/markdown-it": "^14.1.2",
|
|
73
|
-
"@types/node": "^24.3.1",
|
|
74
|
-
"@types/nodemailer": "^7.0.1",
|
|
75
|
-
"@types/passport": "^1.0.17",
|
|
76
|
-
"@types/passport-local": "^1.0.38",
|
|
77
|
-
"@types/pg": "^8.15.5",
|
|
78
|
-
"@types/qrcode": "^1.5.5",
|
|
79
|
-
"copyfiles": "^2.4.1",
|
|
80
|
-
"eslint": "^9.35.0",
|
|
81
|
-
"eslint-config-airbnb-extended": "^2.3.1",
|
|
82
|
-
"ts-migrate": "^0.1.35",
|
|
83
|
-
"typescript": "^5.9.2",
|
|
84
|
-
"vitest": "^3.2.4"
|
|
85
|
-
},
|
|
86
|
-
"author": "Softpro",
|
|
87
|
-
"license": "ISC"
|
|
88
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengis/fastify-table",
|
|
3
|
+
"version": "2.0.79",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "core-plugins",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"fastify",
|
|
8
|
+
"table",
|
|
9
|
+
"crud",
|
|
10
|
+
"auth",
|
|
11
|
+
"pg",
|
|
12
|
+
"backend"
|
|
13
|
+
],
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./dist/index.js",
|
|
17
|
+
"./index.js": "./dist/index.js",
|
|
18
|
+
"./utils.js": "./dist/utils.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/*"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"prepublishOnly": "npm run build",
|
|
25
|
+
"clean": "tsc -b --clean",
|
|
26
|
+
"build": "tsc -b --clean && tsc && copyfiles server/plugins/grpc/utils/*.proto dist && copyfiles server/migrations/*.sql dist && copyfiles server/templates/**/*.html dist",
|
|
27
|
+
"prod": "NODE_ENV=production bun dist/server",
|
|
28
|
+
"patch": "npm version patch && git push && npm publish",
|
|
29
|
+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
30
|
+
"test": "bun test",
|
|
31
|
+
"compress": "node compress.js",
|
|
32
|
+
"dev1": "bun --hot dist/server",
|
|
33
|
+
"dev": "NODE_ENV=production bun start",
|
|
34
|
+
"start": "LOG_LEVEL=trace bun server"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@aws-sdk/client-s3": "3.879.0",
|
|
38
|
+
"@aws-sdk/lib-storage": "3.879.0",
|
|
39
|
+
"@fastify/cookie": "11.0.2",
|
|
40
|
+
"@fastify/http-proxy": "11.1.2",
|
|
41
|
+
"@fastify/multipart": "9.0.3",
|
|
42
|
+
"@fastify/passport": "3.0.2",
|
|
43
|
+
"@fastify/rate-limit": "10.3.0",
|
|
44
|
+
"@fastify/session": "11.1.0",
|
|
45
|
+
"@grpc/grpc-js": "1.10.11",
|
|
46
|
+
"@grpc/proto-loader": "0.7.15",
|
|
47
|
+
"apache-crypt": "1.2.6",
|
|
48
|
+
"better-sqlite3": "12.2.0",
|
|
49
|
+
"dotenv": "16.5.0",
|
|
50
|
+
"fastify": "5.3.3",
|
|
51
|
+
"fastify-plugin": "5.0.1",
|
|
52
|
+
"fastify-session-redis-store": "7.1.2",
|
|
53
|
+
"handlebars": "4.7.8",
|
|
54
|
+
"image-size": "1.2.0",
|
|
55
|
+
"ioredis": "5.3.2",
|
|
56
|
+
"js-yaml": "4.1.0",
|
|
57
|
+
"markdown-it": "14.1.0",
|
|
58
|
+
"nodemailer": "7.0.6",
|
|
59
|
+
"otplib": "12.0.1",
|
|
60
|
+
"pg": "8.11.6",
|
|
61
|
+
"pino": "9.5.0",
|
|
62
|
+
"pino-abstract-transport": "2.0.0",
|
|
63
|
+
"promised-handlebars": "2.0.1",
|
|
64
|
+
"qrcode": "1.5.4",
|
|
65
|
+
"uglify-js": "3.19.3",
|
|
66
|
+
"undici": "7.16.0"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
70
|
+
"@types/bun": "^1.2.21",
|
|
71
|
+
"@types/js-yaml": "^4.0.9",
|
|
72
|
+
"@types/markdown-it": "^14.1.2",
|
|
73
|
+
"@types/node": "^24.3.1",
|
|
74
|
+
"@types/nodemailer": "^7.0.1",
|
|
75
|
+
"@types/passport": "^1.0.17",
|
|
76
|
+
"@types/passport-local": "^1.0.38",
|
|
77
|
+
"@types/pg": "^8.15.5",
|
|
78
|
+
"@types/qrcode": "^1.5.5",
|
|
79
|
+
"copyfiles": "^2.4.1",
|
|
80
|
+
"eslint": "^9.35.0",
|
|
81
|
+
"eslint-config-airbnb-extended": "^2.3.1",
|
|
82
|
+
"ts-migrate": "^0.1.35",
|
|
83
|
+
"typescript": "^5.9.2",
|
|
84
|
+
"vitest": "^3.2.4"
|
|
85
|
+
},
|
|
86
|
+
"author": "Softpro",
|
|
87
|
+
"license": "ISC"
|
|
88
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"name":"core.menu_id","module":"admin","type":"select","hash":"3b08d360628afa15339f364f5e2ff211","dbhash":"3b08d360628afa15339f364f5e2ff211","update":false},{"name":"core.roles","module":"admin","type":"select","hash":"ed1290380ea5e5e7e48bd08b41cb7793","dbhash":"ed1290380ea5e5e7e48bd08b41cb7793","update":false},{"name":"core.routes.alias","module":"admin","type":"select","hash":"ac6afe9a8ebaf0b26236c4bae5297709","dbhash":"ac6afe9a8ebaf0b26236c4bae5297709","update":false},{"name":"core.routes","module":"admin","type":"select","hash":"306bddbe5b73b0628728a60f5335aaee","dbhash":"306bddbe5b73b0628728a60f5335aaee","update":false},{"name":"core.rules","module":"admin","type":"select","hash":"a86085f579f4abff5cf09e775e034ed3","dbhash":"a86085f579f4abff5cf09e775e034ed3","update":false},{"name":"core.user_uid","module":"admin","type":"select","hash":"45f7d8a57ecbca5b433be7937be51d5c","dbhash":"45f7d8a57ecbca5b433be7937be51d5c","update":false},{"name":"application_id","module":"cabinet","type":"select","hash":"8ac02fd941910ba83983201d5e7499ed","dbhash":"8ac02fd941910ba83983201d5e7499ed","update":false},{"name":"application_name","module":"cabinet","type":"select","hash":"c8cdcbd80fbe44192264fab9006c3d16","dbhash":"c8cdcbd80fbe44192264fab9006c3d16","update":false},{"name":"application_num","module":"cabinet","type":"select","hash":"125bc84c082a8ccf4955071c97692e90","dbhash":"125bc84c082a8ccf4955071c97692e90","update":false},{"name":"counterparty_id","module":"cabinet","type":"select","hash":"dfba212a541e8da0b48211c7f94bab38","dbhash":"dfba212a541e8da0b48211c7f94bab38","update":false},{"name":"customer_id","module":"cabinet","type":"select","hash":"083fc793955b1cd44f07fae2d4b8905c","dbhash":"083fc793955b1cd44f07fae2d4b8905c","update":false},{"name":"customer_id_name","module":"cabinet","type":"select","hash":"ee00edee2ac1e84ed60c7eee6a8aceee","dbhash":"ee00edee2ac1e84ed60c7eee6a8aceee","update":false},{"name":"customer_id_short","module":"cabinet","type":"select","hash":"aa4be1274dd3e4ca72c9b563f9a76da9","dbhash":"aa4be1274dd3e4ca72c9b563f9a76da9","update":false},{"name":"first_application_id","module":"cabinet","type":"select","hash":"d05108d2623f51721e1b505f1890c716","dbhash":"d05108d2623f51721e1b505f1890c716","update":false},{"name":"megapolis_id","module":"cabinet","type":"select","hash":"4f41be0ca48c141a6d377250c60d10ae","dbhash":"4f41be0ca48c141a6d377250c60d10ae","update":false},{"name":"org_id","module":"cabinet","type":"select","hash":"588d35bc63a9c3fd00f7fd53dfb9286e","dbhash":"588d35bc63a9c3fd00f7fd53dfb9286e","update":false},{"name":"service_documents","module":"cabinet","type":"select","hash":"0e6d4879f6fbde582f755fc8dad97704","dbhash":"0e6d4879f6fbde582f755fc8dad97704","update":false},{"name":"service_documents_parent","module":"cabinet","type":"select","hash":"649b138f3f2a13bc296b6c7729422603","dbhash":"649b138f3f2a13bc296b6c7729422603","update":false},{"name":"service_id","module":"cabinet","type":"select","hash":"35ce9a68267344fd81084484b3446268","dbhash":"35ce9a68267344fd81084484b3446268","update":false},{"name":"service_id_parent","module":"cabinet","type":"select","hash":"03cb7d85357c4c4cf6fc24a241954d0e","dbhash":"03cb7d85357c4c4cf6fc24a241954d0e","update":false},{"name":"type_id","module":"cabinet","type":"select","hash":"1c771b0ed8c40bc40a0ccef1c49dccd8","dbhash":"1c771b0ed8c40bc40a0ccef1c49dccd8","update":false},{"name":"user_uid","module":"cabinet","type":"select","hash":"ccb63ab9251395211b5040fc29478c36","dbhash":"ccb63ab9251395211b5040fc29478c36","update":false},{"name":"admin_message_status","module":"admin","type":"cls","hash":"883a0c32f43308810e4957b0f1596e32","dbhash":"883a0c32f43308810e4957b0f1596e32","update":false},{"name":"change_type","module":"admin","type":"cls","hash":"9ffe724fdb2b452be35adf367947f748","dbhash":"9ffe724fdb2b452be35adf367947f748","update":false},{"name":"counterparty_type","module":"admin","type":"cls","hash":"321fb9b8dfdf8811df08b0789eb249c2","dbhash":"321fb9b8dfdf8811df08b0789eb249c2","update":false},{"name":"customer_type","module":"admin","type":"cls","hash":"d84500f21e0f636947ade0d89118b641","dbhash":"d84500f21e0f636947ade0d89118b641","update":false},{"name":"feedback_type","module":"admin","type":"cls","hash":"c897ac5bae34d034db4dbb8759ac6e1f","dbhash":"c897ac5bae34d034db4dbb8759ac6e1f","update":false},{"name":"message_direction","module":"admin","type":"cls","hash":"b855c333a08cd577278c2a6e917589b3","dbhash":"b855c333a08cd577278c2a6e917589b3","update":false},{"name":"ticket_category","module":"admin","type":"cls","hash":"43e6f9f07a97220d08027a8a73120173","dbhash":"43e6f9f07a97220d08027a8a73120173","update":false},{"name":"ticket_message_type","module":"admin","type":"cls","hash":"88613599291fca85d9a05a04e0ea278c","dbhash":"88613599291fca85d9a05a04e0ea278c","update":false},{"name":"ticket_status","module":"admin","type":"cls","hash":"03a73b4cba7d415315052d22c3aa109e","dbhash":"03a73b4cba7d415315052d22c3aa109e","update":false},{"name":"transaction_status","module":"admin","type":"cls","hash":"04d4c136405dad725cde84d7c4b4e421","dbhash":"04d4c136405dad725cde84d7c4b4e421","update":false},{"name":"user_type","module":"admin","type":"cls","hash":"4b87551dd9f4a8090c1dc6736904362f","dbhash":"4b87551dd9f4a8090c1dc6736904362f","update":false},{"name":"yes_no","module":"admin","type":"cls","hash":"50c527053426248c20b0a2f112ff9046","dbhash":"50c527053426248c20b0a2f112ff9046","update":false},{"name":"application_type","module":"cabinet","type":"cls","hash":"d8368b9ebf8d428349666ae8486f3749","dbhash":"d8368b9ebf8d428349666ae8486f3749","update":false},{"name":"app_status","module":"cabinet","type":"cls","hash":"6702f763c21abc929f52d290f448b532","dbhash":"6702f763c21abc929f52d290f448b532","update":false},{"name":"customer_role","module":"cabinet","type":"cls","hash":"0faca46489cd7e44e0a9936ca9058e7c","dbhash":"0faca46489cd7e44e0a9936ca9058e7c","update":false},{"name":"message_status","module":"cabinet","type":"cls","hash":"05e66e7fb4e17fb5d50adcb1fa2ba434","dbhash":"05e66e7fb4e17fb5d50adcb1fa2ba434","update":false}]
|
|
File without changes
|