@plaidev/karte-action-sdk 1.1.208-28223142.6bbd2434 → 1.1.209-28225816.f4be3caa

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.
@@ -245,7 +245,7 @@ type ActionTableRowsRequestConfig = VariableQuery & {
245
245
  resolver: "action-table-rows";
246
246
  query: {
247
247
  table_name: string;
248
- key: Array<string>;
248
+ keys: Array<string>;
249
249
  default_value?: Array<ActionTableResult>;
250
250
  };
251
251
  preview_value?: Array<ActionTableResult>;
@@ -1712,7 +1712,7 @@ declare namespace widget {
1712
1712
  resolver: "action-table-rows";
1713
1713
  query: {
1714
1714
  table_name: string;
1715
- key: Array<string>;
1715
+ keys: Array<string>;
1716
1716
  default_value?: Array<ActionTableResult>;
1717
1717
  };
1718
1718
  preview_value?: Array<ActionTableResult>;
@@ -1387,14 +1387,14 @@ const loadActionTableRow = async (config, data, api_key, endpoint) => new Promis
1387
1387
  });
1388
1388
  /** @internal */
1389
1389
  const loadActionTableRows = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
1390
- if (config.query.key == null) {
1390
+ if (config.query.keys == null) {
1391
1391
  console.warn('key is not defined.');
1392
1392
  return reject('key is not defined.');
1393
1393
  }
1394
1394
  const defaultValue = config.query.default_value ?? null;
1395
1395
  const keys = [];
1396
1396
  let hasError = false;
1397
- const originalKeys = Array.isArray(config.query.key) ? config.query.key : [config.query.key];
1397
+ const originalKeys = Array.isArray(config.query.keys) ? config.query.keys : [config.query.keys];
1398
1398
  originalKeys.forEach(key => {
1399
1399
  const d = data[key];
1400
1400
  if (d == null || d === '') {
@@ -1991,21 +1991,26 @@ async function runScript$1(options = {
1991
1991
  }) {
1992
1992
  if (!options.onCreate)
1993
1993
  return;
1994
- const data = {
1994
+ let data = {
1995
1995
  ...options.props,
1996
1996
  ...options.variables,
1997
1997
  ...getVariables(),
1998
1998
  };
1999
- const actionProps = {
2000
- send: options.send,
2001
- publish: options.publish,
2002
- data,
2003
- };
2004
1999
  initialize({ send: options.send, initialState: data.initial_state });
2005
2000
  initActionTable(options.localVariablesQuery);
2006
2001
  const { success } = await setupActionTable(options.localVariablesQuery, data, data.api_key);
2007
2002
  if (!success)
2008
2003
  return;
2004
+ // Action Tableの取得結果を反映する
2005
+ data = {
2006
+ ...data,
2007
+ ...getVariables(),
2008
+ };
2009
+ const actionProps = {
2010
+ send: options.send,
2011
+ publish: options.publish,
2012
+ data,
2013
+ };
2009
2014
  options.send('script_fired');
2010
2015
  // 旧Widget API IFの処理
2011
2016
  const { onCreateHandlers } = getInternalHandlers();
@@ -245,7 +245,7 @@ type ActionTableRowsRequestConfig = VariableQuery & {
245
245
  resolver: "action-table-rows";
246
246
  query: {
247
247
  table_name: string;
248
- key: Array<string>;
248
+ keys: Array<string>;
249
249
  default_value?: Array<ActionTableResult>;
250
250
  };
251
251
  preview_value?: Array<ActionTableResult>;
@@ -1712,7 +1712,7 @@ declare namespace widget {
1712
1712
  resolver: "action-table-rows";
1713
1713
  query: {
1714
1714
  table_name: string;
1715
- key: Array<string>;
1715
+ keys: Array<string>;
1716
1716
  default_value?: Array<ActionTableResult>;
1717
1717
  };
1718
1718
  preview_value?: Array<ActionTableResult>;
package/dist/index.es.js CHANGED
@@ -1410,14 +1410,14 @@ const loadActionTableRow = async (config, data, api_key, endpoint) => new Promis
1410
1410
  });
1411
1411
  /** @internal */
1412
1412
  const loadActionTableRows = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
1413
- if (config.query.key == null) {
1413
+ if (config.query.keys == null) {
1414
1414
  console.warn('key is not defined.');
1415
1415
  return reject('key is not defined.');
1416
1416
  }
1417
1417
  const defaultValue = config.query.default_value ?? null;
1418
1418
  const keys = [];
1419
1419
  let hasError = false;
1420
- const originalKeys = Array.isArray(config.query.key) ? config.query.key : [config.query.key];
1420
+ const originalKeys = Array.isArray(config.query.keys) ? config.query.keys : [config.query.keys];
1421
1421
  originalKeys.forEach(key => {
1422
1422
  const d = data[key];
1423
1423
  if (d == null || d === '') {
@@ -2050,21 +2050,26 @@ async function runScript$1(options = {
2050
2050
  }) {
2051
2051
  if (!options.onCreate)
2052
2052
  return;
2053
- const data = {
2053
+ let data = {
2054
2054
  ...options.props,
2055
2055
  ...options.variables,
2056
2056
  ...getVariables(),
2057
2057
  };
2058
- const actionProps = {
2059
- send: options.send,
2060
- publish: options.publish,
2061
- data,
2062
- };
2063
2058
  initialize({ send: options.send, initialState: data.initial_state });
2064
2059
  initActionTable(options.localVariablesQuery);
2065
2060
  const { success } = await setupActionTable(options.localVariablesQuery, data, data.api_key);
2066
2061
  if (!success)
2067
2062
  return;
2063
+ // Action Tableの取得結果を反映する
2064
+ data = {
2065
+ ...data,
2066
+ ...getVariables(),
2067
+ };
2068
+ const actionProps = {
2069
+ send: options.send,
2070
+ publish: options.publish,
2071
+ data,
2072
+ };
2068
2073
  options.send('script_fired');
2069
2074
  // 旧Widget API IFの処理
2070
2075
  const { onCreateHandlers } = getInternalHandlers();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.208-28223142.6bbd2434",
3
+ "version": "1.1.209-28225816.f4be3caa",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",