@plaidev/karte-action-sdk 1.1.124 → 1.1.125-27947768.57120ff7

Sign up to get free protection for your applications and to get access to all the features.
@@ -559,11 +559,13 @@ declare const state: Store<string>;
559
559
  * 現在のステートを設定する
560
560
  *
561
561
  * @param stateId - 表示するステートID
562
- * @param force - 強制的にステートを設定するフラグ。デフォルトは `false`
562
+ * @param options - オプション。`options.disableInPreview`でプレビュー時のステート遷移を無効化できます。
563
563
  *
564
564
  * @public
565
565
  */
566
- declare function setState(stateId: string, force?: boolean): void;
566
+ declare function setState(stateId: string, options?: {
567
+ disableInPreview: boolean;
568
+ }): void;
567
569
  /**
568
570
  * 現在のステートを取得する
569
571
  *
@@ -884,7 +886,7 @@ declare function onTime(time: number, fn: Function): () => void;
884
886
  type LogLevel = "info" | "error" | "warn";
885
887
  type Log = {
886
888
  level: LogLevel;
887
- message: string;
889
+ messages: any;
888
890
  date?: Date;
889
891
  };
890
892
  type Event = {
@@ -907,13 +909,9 @@ declare const logger: {
907
909
  clearEvents: () => void;
908
910
  };
909
911
  /**
910
- * loggerのログを実行ログに表示する
912
+ * メッセージを実行ログに表示する
911
913
  */
912
914
  declare function listenLogger(): () => void;
913
- /**
914
- * consoleログを実行ログに表示する
915
- */
916
- declare function listenConsoleLogger(): () => void;
917
915
  /**
918
916
  * プロパティ
919
917
  *
@@ -1034,6 +1032,82 @@ declare function showOnScroll<Props extends Pick<_Props, "show_on_scroll" | "sho
1034
1032
  * @internal
1035
1033
  */
1036
1034
  declare function showOnTime<Props extends Pick<_Props, "show_on_time" | "show_on_time_count">>(props: Props, show?: Function): (() => void) | null;
1035
+ type ActionTableResult = number | string | boolean | Date | null | undefined;
1036
+ type ActionTableQueryParam = string | number | boolean | Date;
1037
+ type ActionTableQueryParams = {
1038
+ [key: string]: ActionTableQueryParam | ActionTableQueryParam[];
1039
+ };
1040
+ /**
1041
+ * アクションテーブルの設定情報
1042
+ *
1043
+ * @public
1044
+ */
1045
+ type CollectionConfig = {
1046
+ /**
1047
+ * APIキー
1048
+ */
1049
+ api_key: string;
1050
+ /**
1051
+ * テーブル名
1052
+ */
1053
+ table: string;
1054
+ /**
1055
+ * エンドポイント
1056
+ */
1057
+ endpoint?: string;
1058
+ };
1059
+ /**
1060
+ * アクションテーブルを管理するメソッドを取得する
1061
+ *
1062
+ * @param config - 設定情報
1063
+ *
1064
+ * @returns メソッドを返します
1065
+ *
1066
+ * @public
1067
+ */
1068
+ declare function collection(config: CollectionConfig): {
1069
+ get(key: string | Array<string>, cb: (err: Error | null, items?: ActionTableResult | Array<ActionTableResult>) => void): void;
1070
+ getByQuery(query_name: string, params: ActionTableQueryParams, options: {
1071
+ ignore_fields?: string[];
1072
+ } | null | undefined, cb: (err: Error | null, items?: Array<ActionTableResult>) => void): void;
1073
+ set(key: string, value: string, cb: (err: Error | null) => void): void;
1074
+ };
1075
+ type ActionTableRowRequestConfig = {
1076
+ resolver: "action-table-row";
1077
+ name: string;
1078
+ default: {
1079
+ table_name: string;
1080
+ key: string;
1081
+ default_value?: ActionTableResult;
1082
+ };
1083
+ preview_value?: ActionTableResult;
1084
+ };
1085
+ type ActionTableRowsRequestConfig = {
1086
+ resolver: "action-table-rows";
1087
+ name: string;
1088
+ default: {
1089
+ table_name: string;
1090
+ key: Array<string>;
1091
+ default_value?: Array<ActionTableResult>;
1092
+ };
1093
+ preview_value?: Array<ActionTableResult>;
1094
+ };
1095
+ type ActionTableQueryRequestConfig = {
1096
+ resolver: "action-table-query";
1097
+ name: string;
1098
+ default: {
1099
+ table_name: string;
1100
+ query_name: string;
1101
+ params?: ActionTableQueryParams;
1102
+ default_value?: Array<ActionTableResult>;
1103
+ };
1104
+ preview_value?: Array<ActionTableResult>;
1105
+ };
1106
+ type ActionTableRequestConfig = ActionTableRowRequestConfig | ActionTableRowsRequestConfig | ActionTableQueryRequestConfig;
1107
+ declare const loadActionTableRow: (config: ActionTableRowRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
1108
+ declare const loadActionTableRows: (config: ActionTableRowsRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
1109
+ declare const loadActionTableQuery: (config: ActionTableQueryRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
1110
+ declare const loadActionTable: (config: Array<ActionTableRequestConfig>, api_key: string, endpoint?: string) => Promise<{}>;
1037
1111
  type _Props$0 = Props;
1038
1112
  /**
1039
1113
  * アクションのライフサイクルで呼び出されるフック
@@ -1135,7 +1209,7 @@ interface ActionProps<Props, Variables> {
1135
1209
  *
1136
1210
  * @public
1137
1211
  */
1138
- interface ActionOptions<Props, Variables> {
1212
+ interface ActionOptions<Props, Variables, VariablesQuery> {
1139
1213
  /**
1140
1214
  * アクションでイベントがトリガーされたときに受信するための関数
1141
1215
  *
@@ -1149,11 +1223,17 @@ interface ActionOptions<Props, Variables> {
1149
1223
  */
1150
1224
  props?: Props;
1151
1225
  /**
1152
- * アクションで使用されるアクションテーブルのユーザー環境変数
1226
+ * アクションで使用される解析時に取得される変数
1153
1227
  *
1154
1228
  * @defaultValue `{}`
1155
1229
  */
1156
1230
  variables?: Variables;
1231
+ /**
1232
+ * アクションで使用されるアクション実行時に取得される変数
1233
+ *
1234
+ * @defaultValue `[]`
1235
+ */
1236
+ localVariablesQuery?: VariablesQuery;
1157
1237
  /**
1158
1238
  * アクションが作成されているときにフックされる {@link onCreate}
1159
1239
  *
@@ -1171,7 +1251,7 @@ interface ActionOptions<Props, Variables> {
1171
1251
  *
1172
1252
  * @public
1173
1253
  */
1174
- declare function create<Props extends _Props$0, Variables>(App: typeof SvelteComponentDev, options?: ActionOptions<Props, Variables & CustomVariables>): () => void;
1254
+ declare function create<Props extends _Props$0, Variables, VariablesQuery extends ActionTableRequestConfig[]>(App: typeof SvelteComponentDev, options?: ActionOptions<Props, Variables & CustomVariables, VariablesQuery>): () => void;
1175
1255
  /**
1176
1256
  * アクションの破棄する
1177
1257
  *
@@ -1287,7 +1367,7 @@ declare const close: typeof closeAction;
1287
1367
  *
1288
1368
  * @internal
1289
1369
  */
1290
- type AppOptions<Props, Variables> = ActionOptions<Props, Variables>;
1370
+ type AppOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
1291
1371
  /**
1292
1372
  * App application instance that is with {@link createApp}
1293
1373
  *
@@ -1319,44 +1399,7 @@ interface App {
1319
1399
  *
1320
1400
  * @internal
1321
1401
  */
1322
- declare function createApp<Props, Variables>(App: typeof SvelteComponentDev, options?: AppOptions<Props, Variables>): App;
1323
- /**
1324
- * アクションテーブルの設定情報
1325
- *
1326
- * @public
1327
- */
1328
- type CollectionConfig = {
1329
- /**
1330
- * APIキー
1331
- */
1332
- api_key: string;
1333
- /**
1334
- * テーブル名
1335
- */
1336
- table: string;
1337
- /**
1338
- * エンドポイント
1339
- */
1340
- endpoint?: string;
1341
- };
1342
- /**
1343
- * アクションテーブルを管理するメソッドを取得する
1344
- *
1345
- * @param config - 設定情報
1346
- *
1347
- * @returns メソッドを返します
1348
- *
1349
- * @public
1350
- */
1351
- declare function collection(config: CollectionConfig): {
1352
- get(key: string | string[], cb: (err: Error | null, items?: any) => void): void;
1353
- getByQuery(query_name: string, params: {
1354
- [p: string]: string | number | boolean | (string | number | boolean)[];
1355
- }, options: {
1356
- ignore_fields?: string[];
1357
- } | null | undefined, cb: (err: Error | null, items?: any) => void): void;
1358
- set(key: string, value: string, cb: (err: Error | null) => void): void;
1359
- };
1402
+ declare function createApp<Props, Variables, VariablesQuery>(App: typeof SvelteComponentDev, options?: AppOptions<Props, Variables, VariablesQuery>): App;
1360
1403
  declare namespace widget {
1361
1404
  /** @internal */
1362
1405
  const PropTypes: readonly [
@@ -1948,11 +1991,13 @@ declare namespace widget {
1948
1991
  * 現在のステートを設定する
1949
1992
  *
1950
1993
  * @param stateId - 表示するステートID
1951
- * @param force - 強制的にステートを設定するフラグ。デフォルトは `false`
1994
+ * @param options - オプション。`options.disableInPreview`でプレビュー時のステート遷移を無効化できます。
1952
1995
  *
1953
1996
  * @public
1954
1997
  */
1955
- function setState(stateId: string, force?: boolean): void;
1998
+ function setState(stateId: string, options?: {
1999
+ disableInPreview: boolean;
2000
+ }): void;
1956
2001
  /**
1957
2002
  * 現在のステートを取得する
1958
2003
  *
@@ -2365,6 +2410,82 @@ declare namespace widget {
2365
2410
  * @internal
2366
2411
  */
2367
2412
  const setAutoStart: (on?: boolean) => void;
2413
+ type ActionTableResult = number | string | boolean | Date | null | undefined;
2414
+ type ActionTableQueryParam = string | number | boolean | Date;
2415
+ type ActionTableQueryParams = {
2416
+ [key: string]: ActionTableQueryParam | ActionTableQueryParam[];
2417
+ };
2418
+ /**
2419
+ * アクションテーブルの設定情報
2420
+ *
2421
+ * @public
2422
+ */
2423
+ type CollectionConfig = {
2424
+ /**
2425
+ * APIキー
2426
+ */
2427
+ api_key: string;
2428
+ /**
2429
+ * テーブル名
2430
+ */
2431
+ table: string;
2432
+ /**
2433
+ * エンドポイント
2434
+ */
2435
+ endpoint?: string;
2436
+ };
2437
+ /**
2438
+ * アクションテーブルを管理するメソッドを取得する
2439
+ *
2440
+ * @param config - 設定情報
2441
+ *
2442
+ * @returns メソッドを返します
2443
+ *
2444
+ * @public
2445
+ */
2446
+ function collection(config: CollectionConfig): {
2447
+ get(key: string | Array<string>, cb: (err: Error | null, items?: ActionTableResult | Array<ActionTableResult>) => void): void;
2448
+ getByQuery(query_name: string, params: ActionTableQueryParams, options: {
2449
+ ignore_fields?: string[];
2450
+ } | null | undefined, cb: (err: Error | null, items?: Array<ActionTableResult>) => void): void;
2451
+ set(key: string, value: string, cb: (err: Error | null) => void): void;
2452
+ };
2453
+ type ActionTableRowRequestConfig = {
2454
+ resolver: "action-table-row";
2455
+ name: string;
2456
+ default: {
2457
+ table_name: string;
2458
+ key: string;
2459
+ default_value?: ActionTableResult;
2460
+ };
2461
+ preview_value?: ActionTableResult;
2462
+ };
2463
+ type ActionTableRowsRequestConfig = {
2464
+ resolver: "action-table-rows";
2465
+ name: string;
2466
+ default: {
2467
+ table_name: string;
2468
+ key: Array<string>;
2469
+ default_value?: Array<ActionTableResult>;
2470
+ };
2471
+ preview_value?: Array<ActionTableResult>;
2472
+ };
2473
+ type ActionTableQueryRequestConfig = {
2474
+ resolver: "action-table-query";
2475
+ name: string;
2476
+ default: {
2477
+ table_name: string;
2478
+ query_name: string;
2479
+ params?: ActionTableQueryParams;
2480
+ default_value?: Array<ActionTableResult>;
2481
+ };
2482
+ preview_value?: Array<ActionTableResult>;
2483
+ };
2484
+ type ActionTableRequestConfig = ActionTableRowRequestConfig | ActionTableRowsRequestConfig | ActionTableQueryRequestConfig;
2485
+ const loadActionTableRow: (config: ActionTableRowRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
2486
+ const loadActionTableRows: (config: ActionTableRowsRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
2487
+ const loadActionTableQuery: (config: ActionTableQueryRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
2488
+ const loadActionTable: (config: Array<ActionTableRequestConfig>, api_key: string, endpoint?: string) => Promise<{}>;
2368
2489
  /**
2369
2490
  * プロパティ
2370
2491
  *
@@ -2521,7 +2642,7 @@ declare namespace widget {
2521
2642
  *
2522
2643
  * @public
2523
2644
  */
2524
- interface ActionOptions<Props, Variables> {
2645
+ interface ActionOptions<Props, Variables, VariablesQuery> {
2525
2646
  /**
2526
2647
  * アクションでイベントがトリガーされたときに受信するための関数
2527
2648
  *
@@ -2535,11 +2656,17 @@ declare namespace widget {
2535
2656
  */
2536
2657
  props?: Props;
2537
2658
  /**
2538
- * アクションで使用されるアクションテーブルのユーザー環境変数
2659
+ * アクションで使用される解析時に取得される変数
2539
2660
  *
2540
2661
  * @defaultValue `{}`
2541
2662
  */
2542
2663
  variables?: Variables;
2664
+ /**
2665
+ * アクションで使用されるアクション実行時に取得される変数
2666
+ *
2667
+ * @defaultValue `[]`
2668
+ */
2669
+ localVariablesQuery?: VariablesQuery;
2543
2670
  /**
2544
2671
  * アクションが作成されているときにフックされる {@link onCreate}
2545
2672
  *
@@ -2557,7 +2684,7 @@ declare namespace widget {
2557
2684
  *
2558
2685
  * @public
2559
2686
  */
2560
- function create<Props extends _Props, Variables>(App: typeof SvelteComponentDev, options?: ActionOptions<Props, Variables & CustomVariables>): () => void;
2687
+ function create<Props extends _Props, Variables, VariablesQuery extends ActionTableRequestConfig[]>(App: typeof SvelteComponentDev, options?: ActionOptions<Props, Variables & CustomVariables, VariablesQuery>): () => void;
2561
2688
  /**
2562
2689
  * Dispatch the event to destroy KARTE action
2563
2690
  *
@@ -2657,7 +2784,7 @@ declare namespace widget {
2657
2784
  *
2658
2785
  * @internal
2659
2786
  */
2660
- type ModalOptions<Props, Variables> = ActionOptions<Props, Variables>;
2787
+ type ModalOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
2661
2788
  /**
2662
2789
  * 非推奨です
2663
2790
  *
@@ -2697,7 +2824,7 @@ declare namespace widget {
2697
2824
  *
2698
2825
  * @internal
2699
2826
  */
2700
- type AppOptions<Props, Variables> = ActionOptions<Props, Variables>;
2827
+ type AppOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
2701
2828
  /**
2702
2829
  * App application instance that is with {@link createApp}
2703
2830
  *
@@ -2729,7 +2856,7 @@ declare namespace widget {
2729
2856
  *
2730
2857
  * @internal
2731
2858
  */
2732
- function createApp<Props, Variables>(App: typeof SvelteComponentDev, options?: AppOptions<Props, Variables>): App;
2859
+ function createApp<Props, Variables, VariablesQuery>(App: typeof SvelteComponentDev, options?: AppOptions<Props, Variables, VariablesQuery>): App;
2733
2860
  // @ts-ignore
2734
2861
  type ChangeValCallback = ({ newVal, oldVal, key }: {
2735
2862
  newVal: any;
@@ -2857,13 +2984,13 @@ declare namespace widget {
2857
2984
  *
2858
2985
  * @public
2859
2986
  */
2860
- function collection(table: string): {
2861
- get(key: string | string[], cb: (err: Error, items?: any) => void): void;
2987
+ function collection$0(table: string): {
2988
+ get(key: string | string[], cb: (err: Error, items?: (string | number | boolean | Date) | (string | number | boolean | Date)[]) => void): void;
2862
2989
  getByQuery(query_name: string, params: {
2863
- [p: string]: string | number | boolean | (string | number | boolean)[];
2990
+ [key: string]: (string | number | boolean | Date) | (string | number | boolean | Date)[];
2864
2991
  }, options: {
2865
2992
  ignore_fields?: string[];
2866
- }, cb: (err: Error, items?: any) => void): void;
2993
+ }, cb: (err: Error, items?: (string | number | boolean | Date)[]) => void): void;
2867
2994
  set(key: string, value: string, cb: (err: Error) => void): void;
2868
2995
  };
2869
2996
  /**
@@ -2876,8 +3003,8 @@ declare namespace widget {
2876
3003
  */
2877
3004
  export { showAction as show, closeAction as hide };
2878
3005
  }
2879
- export { loadGlobalScript, loadGlobalStyle, applyGlobalCss, initialize, finalize, setAutoStart, getState, setState, getStates, isOpened, getCustomVariables, setCustomVariables, updateCustomVariables, getCustomHandlers, setCustomHandlers, updateCustomHandlers, getSystem, setActionSetting, customHandlers, customVariables, formData, state, opened, closed, destroyed, stopped, isClosed, setClosed, getStoreState, onScroll, onTime, getLogs, getEvents, logger, listenLogger, listenConsoleLogger, hideOnScroll, hideOnTime, showOnScroll, showOnTime, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, ModalPositions, ModalPosition, ModalMargin, ModalPlacement, DefaultModalPlacement, Elasticities, Elasticity, ElasticityStyle, TextDirections, TextDirection, OperationArgumentType, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, ClipPaths, ClipPath, Repeats, Repeat, BackgroundSizes, BackgroundSize, Cursors, Cursor, Overflows, Overflow, Border, BorderStyle, BorderWidth, Style, StateName, WritingModes, WritingMode, ListSeparatorTypes, ListSeparatorNone, ListSeparatorBorder, ListSeparatorGap, ListSeparator, DefaultListSeparatorNone, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparator, ListBackgroundTypes, ListBackgroundNone, ListBackgroundStripe, ListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListBackground, ListDirections, ListDirection, ListContext, SlideButtonIcon, SlideButtonText, SlideButton, DefaultSlideButton, SlideButtonPosition, SlideNavigationButton, DefaultSlideNavigationButton, FormInputName, FormButtonStyle, DefaultFormButtonStyle, FormSelectStyle, DefaultFormSelectStyle, FormRatingButtonType, FormRatingButtonTypes, DefaultFormRatingButtonType, create, destroy, closeAction, showAction, loadStyle, applyCss, getActionShadowRoot, onCreate, onShow, onClose, onDestroy, onChangeState, showModal, ensureModalRoot, show, close, createApp, createFog, KARTE_MODAL_ROOT, collection, widget };
2880
- export type { CloseTrigger, CustomVariables, ActionEventHandler, SystemConfig, OnScrollContext, OnScrollFunction, ScrollDirection, LogLevel, Log, Event, ActionProps, ActionOptions, ActionHook, ActionCloseHook, ActionChangeStateHook, SendFunction, CollectionConfig };
3006
+ export { loadGlobalScript, loadGlobalStyle, applyGlobalCss, initialize, finalize, setAutoStart, getState, setState, getStates, isOpened, getCustomVariables, setCustomVariables, updateCustomVariables, getCustomHandlers, setCustomHandlers, updateCustomHandlers, getSystem, setActionSetting, customHandlers, customVariables, formData, state, opened, closed, destroyed, stopped, isClosed, setClosed, getStoreState, onScroll, onTime, getLogs, getEvents, logger, listenLogger, hideOnScroll, hideOnTime, showOnScroll, showOnTime, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, ModalPositions, ModalPosition, ModalMargin, ModalPlacement, DefaultModalPlacement, Elasticities, Elasticity, ElasticityStyle, TextDirections, TextDirection, OperationArgumentType, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, ClipPaths, ClipPath, Repeats, Repeat, BackgroundSizes, BackgroundSize, Cursors, Cursor, Overflows, Overflow, Border, BorderStyle, BorderWidth, Style, StateName, WritingModes, WritingMode, ListSeparatorTypes, ListSeparatorNone, ListSeparatorBorder, ListSeparatorGap, ListSeparator, DefaultListSeparatorNone, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparator, ListBackgroundTypes, ListBackgroundNone, ListBackgroundStripe, ListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListBackground, ListDirections, ListDirection, ListContext, SlideButtonIcon, SlideButtonText, SlideButton, DefaultSlideButton, SlideButtonPosition, SlideNavigationButton, DefaultSlideNavigationButton, FormInputName, FormButtonStyle, DefaultFormButtonStyle, FormSelectStyle, DefaultFormSelectStyle, FormRatingButtonType, FormRatingButtonTypes, DefaultFormRatingButtonType, create, destroy, closeAction, showAction, loadStyle, applyCss, getActionShadowRoot, onCreate, onShow, onClose, onDestroy, onChangeState, showModal, ensureModalRoot, show, close, createApp, createFog, KARTE_MODAL_ROOT, collection, loadActionTableRow, loadActionTableRows, loadActionTableQuery, loadActionTable, widget };
3007
+ export type { CloseTrigger, CustomVariables, ActionEventHandler, SystemConfig, OnScrollContext, OnScrollFunction, ScrollDirection, LogLevel, Log, Event, ActionProps, ActionOptions, ActionHook, ActionCloseHook, ActionChangeStateHook, SendFunction, CollectionConfig, ActionTableRowRequestConfig, ActionTableRowsRequestConfig, ActionTableQueryRequestConfig, ActionTableRequestConfig };
2881
3008
  export { default as State } from './components/State.svelte';
2882
3009
  export { default as StateItem } from './components/StateItem.svelte';
2883
3010
  export { default as Modal } from './components/Modal.svelte';