@plaidev/karte-action-sdk 1.1.203 → 1.1.204
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/hydrate/index.es.d.ts +6 -2
- package/dist/hydrate/index.es.js +45 -28
- package/dist/index.es.d.ts +6 -2
- package/dist/index.es.js +45 -28
- package/package.json +1 -1
@@ -257,7 +257,9 @@ type ActionTableQueryRequestConfig = VariableQuery & {
|
|
257
257
|
query: {
|
258
258
|
table_name: string;
|
259
259
|
query_name: string;
|
260
|
-
params?:
|
260
|
+
params?: {
|
261
|
+
[key: string]: string;
|
262
|
+
};
|
261
263
|
default_value?: Array<ActionTableResult>;
|
262
264
|
};
|
263
265
|
preview_value?: Array<ActionTableResult>;
|
@@ -1711,7 +1713,9 @@ declare namespace widget {
|
|
1711
1713
|
query: {
|
1712
1714
|
table_name: string;
|
1713
1715
|
query_name: string;
|
1714
|
-
params?:
|
1716
|
+
params?: {
|
1717
|
+
[key: string]: string;
|
1718
|
+
};
|
1715
1719
|
default_value?: Array<ActionTableResult>;
|
1716
1720
|
};
|
1717
1721
|
preview_value?: Array<ActionTableResult>;
|
package/dist/hydrate/index.es.js
CHANGED
@@ -1332,40 +1332,57 @@ function request(url, data, cb) {
|
|
1332
1332
|
});
|
1333
1333
|
}
|
1334
1334
|
/** @internal */
|
1335
|
-
const loadActionTableRow = async (config, data, api_key, endpoint) => {
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
});
|
1344
|
-
};
|
1335
|
+
const loadActionTableRow = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
|
1336
|
+
const key = data[config.query.key] ?? null;
|
1337
|
+
if (key == null) {
|
1338
|
+
console.warn('key is not found. key: ', config.query.key);
|
1339
|
+
return reject('key is not found.');
|
1340
|
+
}
|
1341
|
+
return collection$1({ endpoint, api_key, table: config.query.table_name }).get(key, (err, data) => err ? reject(err) : resolve(data));
|
1342
|
+
});
|
1345
1343
|
/** @internal */
|
1346
|
-
const loadActionTableRows = async (config, data, api_key, endpoint) => {
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1344
|
+
const loadActionTableRows = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
|
1345
|
+
if (config.query.key == null) {
|
1346
|
+
console.warn('key is not defined.');
|
1347
|
+
return reject('key is not defined.');
|
1348
|
+
}
|
1349
|
+
const keys = [];
|
1350
|
+
let hasError = false;
|
1351
|
+
const originalKeys = Array.isArray(config.query.key) ? config.query.key : [config.query.key];
|
1352
|
+
originalKeys.forEach(key => {
|
1353
|
+
const d = data[key];
|
1354
|
+
if (d == null) {
|
1355
|
+
console.warn('key is not found. key: ', key);
|
1356
|
+
hasError = true;
|
1352
1357
|
}
|
1353
|
-
|
1358
|
+
keys.push(d);
|
1354
1359
|
});
|
1355
|
-
|
1360
|
+
if (hasError) {
|
1361
|
+
return reject('key is not found.');
|
1362
|
+
}
|
1363
|
+
return collection$1({ endpoint, api_key, table: config.query.table_name }).get(keys, (err, data) => (err ? reject(err) : resolve(data)));
|
1364
|
+
});
|
1356
1365
|
/** @internal */
|
1357
|
-
const loadActionTableQuery = async (config, data, api_key, endpoint) => {
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1366
|
+
const loadActionTableQuery = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
|
1367
|
+
if (config.query.params == null) {
|
1368
|
+
console.warn('key is not defined.');
|
1369
|
+
return reject('key is not defined.');
|
1370
|
+
}
|
1371
|
+
const params = {};
|
1372
|
+
let hasError = false;
|
1373
|
+
Object.entries(config.query.params).forEach(([key, param]) => {
|
1374
|
+
const d = data[param];
|
1375
|
+
if (d == null) {
|
1376
|
+
console.warn('key is not found. param: ', param);
|
1377
|
+
hasError = true;
|
1365
1378
|
}
|
1366
|
-
|
1379
|
+
params[key] = d;
|
1367
1380
|
});
|
1368
|
-
|
1381
|
+
if (hasError) {
|
1382
|
+
return reject('key is not found.');
|
1383
|
+
}
|
1384
|
+
return collection$1({ endpoint, api_key, table: config.query.table_name }).getByQuery(config.query.query_name, params, null, (err, data) => (err ? reject(err) : resolve(data)));
|
1385
|
+
});
|
1369
1386
|
/** @internal */
|
1370
1387
|
const loadActionTable = async (config, data, api_key, endpoint) => {
|
1371
1388
|
console.debug('[debug] loadActionTable', isPreview(), api_key, endpoint, JSON.stringify(config));
|
package/dist/index.es.d.ts
CHANGED
@@ -257,7 +257,9 @@ type ActionTableQueryRequestConfig = VariableQuery & {
|
|
257
257
|
query: {
|
258
258
|
table_name: string;
|
259
259
|
query_name: string;
|
260
|
-
params?:
|
260
|
+
params?: {
|
261
|
+
[key: string]: string;
|
262
|
+
};
|
261
263
|
default_value?: Array<ActionTableResult>;
|
262
264
|
};
|
263
265
|
preview_value?: Array<ActionTableResult>;
|
@@ -1711,7 +1713,9 @@ declare namespace widget {
|
|
1711
1713
|
query: {
|
1712
1714
|
table_name: string;
|
1713
1715
|
query_name: string;
|
1714
|
-
params?:
|
1716
|
+
params?: {
|
1717
|
+
[key: string]: string;
|
1718
|
+
};
|
1715
1719
|
default_value?: Array<ActionTableResult>;
|
1716
1720
|
};
|
1717
1721
|
preview_value?: Array<ActionTableResult>;
|
package/dist/index.es.js
CHANGED
@@ -1355,40 +1355,57 @@ function request(url, data, cb) {
|
|
1355
1355
|
});
|
1356
1356
|
}
|
1357
1357
|
/** @internal */
|
1358
|
-
const loadActionTableRow = async (config, data, api_key, endpoint) => {
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
});
|
1367
|
-
};
|
1358
|
+
const loadActionTableRow = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
|
1359
|
+
const key = data[config.query.key] ?? null;
|
1360
|
+
if (key == null) {
|
1361
|
+
console.warn('key is not found. key: ', config.query.key);
|
1362
|
+
return reject('key is not found.');
|
1363
|
+
}
|
1364
|
+
return collection$1({ endpoint, api_key, table: config.query.table_name }).get(key, (err, data) => err ? reject(err) : resolve(data));
|
1365
|
+
});
|
1368
1366
|
/** @internal */
|
1369
|
-
const loadActionTableRows = async (config, data, api_key, endpoint) => {
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1367
|
+
const loadActionTableRows = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
|
1368
|
+
if (config.query.key == null) {
|
1369
|
+
console.warn('key is not defined.');
|
1370
|
+
return reject('key is not defined.');
|
1371
|
+
}
|
1372
|
+
const keys = [];
|
1373
|
+
let hasError = false;
|
1374
|
+
const originalKeys = Array.isArray(config.query.key) ? config.query.key : [config.query.key];
|
1375
|
+
originalKeys.forEach(key => {
|
1376
|
+
const d = data[key];
|
1377
|
+
if (d == null) {
|
1378
|
+
console.warn('key is not found. key: ', key);
|
1379
|
+
hasError = true;
|
1375
1380
|
}
|
1376
|
-
|
1381
|
+
keys.push(d);
|
1377
1382
|
});
|
1378
|
-
|
1383
|
+
if (hasError) {
|
1384
|
+
return reject('key is not found.');
|
1385
|
+
}
|
1386
|
+
return collection$1({ endpoint, api_key, table: config.query.table_name }).get(keys, (err, data) => (err ? reject(err) : resolve(data)));
|
1387
|
+
});
|
1379
1388
|
/** @internal */
|
1380
|
-
const loadActionTableQuery = async (config, data, api_key, endpoint) => {
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1389
|
+
const loadActionTableQuery = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
|
1390
|
+
if (config.query.params == null) {
|
1391
|
+
console.warn('key is not defined.');
|
1392
|
+
return reject('key is not defined.');
|
1393
|
+
}
|
1394
|
+
const params = {};
|
1395
|
+
let hasError = false;
|
1396
|
+
Object.entries(config.query.params).forEach(([key, param]) => {
|
1397
|
+
const d = data[param];
|
1398
|
+
if (d == null) {
|
1399
|
+
console.warn('key is not found. param: ', param);
|
1400
|
+
hasError = true;
|
1388
1401
|
}
|
1389
|
-
|
1402
|
+
params[key] = d;
|
1390
1403
|
});
|
1391
|
-
|
1404
|
+
if (hasError) {
|
1405
|
+
return reject('key is not found.');
|
1406
|
+
}
|
1407
|
+
return collection$1({ endpoint, api_key, table: config.query.table_name }).getByQuery(config.query.query_name, params, null, (err, data) => (err ? reject(err) : resolve(data)));
|
1408
|
+
});
|
1392
1409
|
/** @internal */
|
1393
1410
|
const loadActionTable = async (config, data, api_key, endpoint) => {
|
1394
1411
|
console.debug('[debug] loadActionTable', isPreview(), api_key, endpoint, JSON.stringify(config));
|