lucid-extension-sdk 0.0.16 → 0.0.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.16",
3
+ "version": "0.0.19",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
@@ -81,10 +81,13 @@ export declare const enum CommandName {
81
81
  ShowModal = "sm",
82
82
  ShowPanel = "spn",
83
83
  SleepForTestCase = "sleep",
84
+ ThrowForTestCase = "throw",
84
85
  UnhookCreateItems = "uci",
85
86
  UnhookSelection = "us",
86
87
  UnhookTextEdit = "ute"
87
88
  }
89
+ /** @ignore */
90
+ export declare const commandTitles: Map<CommandName, string>;
88
91
  /**
89
92
  * This is a type declaration whose purpose is to allow TypeScript to enforce the correct parameter and
90
93
  * return types from [EditorClient.sendCommand](#classes_editorclient-EditorClient_sendcommand) based on
@@ -347,6 +350,10 @@ export declare type CommandArgs = {
347
350
  query: SleepForTestCaseQuery;
348
351
  result: SleepForTestCaseResult;
349
352
  };
353
+ [CommandName.ThrowForTestCase]: {
354
+ query: ThrowForTestCaseQuery;
355
+ result: ThrowForTestCaseResult;
356
+ };
350
357
  [CommandName.UnhookCreateItems]: {
351
358
  query: UnhookCreateItemsQuery;
352
359
  result: UnhookCreateItemsResult;
@@ -494,8 +501,8 @@ export declare type DataActionQuery = {
494
501
  'a': boolean;
495
502
  /** Flow Data */
496
503
  'fd'?: unknown;
497
- /** Sync data source ID */
498
- 's': string;
504
+ /** Sync data source ID Nonce */
505
+ 's'?: string;
499
506
  /** Data Connector Name */
500
507
  'n': string;
501
508
  };
@@ -823,6 +830,8 @@ export declare type ShowPanelQuery = {
823
830
  export declare type ShowPanelResult = undefined;
824
831
  export declare type SleepForTestCaseQuery = number;
825
832
  export declare type SleepForTestCaseResult = Promise<void>;
833
+ export declare type ThrowForTestCaseQuery = number;
834
+ export declare type ThrowForTestCaseResult = undefined | Promise<void>;
826
835
  export declare type UnhookCreateItemsQuery = {
827
836
  /** Name of the action passed to HookCreateItems */
828
837
  'n': string;
@@ -1,7 +1,77 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isRawSendXHRResponse = void 0;
3
+ exports.isRawSendXHRResponse = exports.commandTitles = void 0;
4
4
  const checks_1 = require("./core/checks");
5
+ /** @ignore */
6
+ exports.commandTitles = new Map([
7
+ ["alta" /* AddLineTextArea */, 'AddLineTextArea'],
8
+ ["ami" /* AddMenuItem */, 'AddMenuItem'],
9
+ ["asd" /* AddShapeData */, 'AddShapeData'],
10
+ ["a" /* Alert */, 'Alert'],
11
+ ["av" /* AnimateViewport */, 'AnimateViewport'],
12
+ ["b" /* Bootstrap */, 'Bootstrap'],
13
+ ["c" /* Confirm */, 'Confirm'],
14
+ ["cb" /* CreateBlock */, 'CreateBlock'],
15
+ ["cc" /* CreateCollection */, 'CreateCollection'],
16
+ ["cds" /* CreateDataSource */, 'CreateDataSource'],
17
+ ["cl" /* CreateLine */, 'CreateLine'],
18
+ ["cp" /* CreatePage */, 'CreatePage'],
19
+ ["di" /* DeleteItem */, 'DeleteItem'],
20
+ ["dp" /* DeletePage */, 'DeletePage'],
21
+ ["dsd" /* DeleteShapeData */, 'DeleteShapeData'],
22
+ ["d" /* Download */, 'Download'],
23
+ ["ee" /* ElementExists */, 'ElementExists'],
24
+ ["ef" /* ExecuteFormula */, 'ExecuteFormula'],
25
+ ["gcl" /* GetConnectedLines */, 'GetConnectedLines'],
26
+ ["gcp" /* GetCurrentPage */, 'GetCurrentPage'],
27
+ ["gcs" /* GetCustomShape */, 'GetCustomShape'],
28
+ ["gdif" /* GetDataItemField */, 'GetDataItemField'],
29
+ ["get" /* GetElementType */, 'GetElementType'],
30
+ ["gip" /* GetItemPageId */, 'GetItemPageId'],
31
+ ["gp" /* GetProperty */, 'GetProperty'],
32
+ ["grk" /* GetReferenceKey */, 'GetReferenceKey'],
33
+ ["grlp" /* GetRelativeLinePosition */, 'GetRelativeLinePosition'],
34
+ ["gs" /* GetSelection */, 'GetSelection'],
35
+ ["gsd" /* GetShapeData */, 'GetShapeData'],
36
+ ["hm" /* HideModal */, 'HideModal'],
37
+ ["hp" /* HidePanel */, 'HidePanel'],
38
+ ["hci" /* HookCreateItems */, 'HookCreateItems'],
39
+ ["hs" /* HookSelection */, 'HookSelection'],
40
+ ["hte" /* HookTextEdit */, 'HookTextEdit'],
41
+ ["k" /* KillExtension */, 'KillExtension'],
42
+ ["lb" /* ListBlocks */, 'ListBlocks'],
43
+ ["lcf" /* ListCollectionFields */, 'ListCollectionFields'],
44
+ ["lc" /* ListCollections */, 'ListCollections'],
45
+ ["ldi" /* ListDataItems */, 'ListDataItems'],
46
+ ["lds" /* ListDataSources */, 'ListDataSources'],
47
+ ["lg" /* ListGroups */, 'ListGroups'],
48
+ ["ll" /* ListLines */, 'ListLines'],
49
+ ["lp" /* ListPages */, 'ListPages'],
50
+ ["lpr" /* ListProperties */, 'ListProperties'],
51
+ ["lrk" /* ListReferenceKeys */, 'ListReferenceKeys'],
52
+ ["lsd" /* ListShapeData */, 'ListShapeData'],
53
+ ["lta" /* ListTextAreas */, 'ListTextAreas'],
54
+ ["lbc" /* LoadBlockClasses */, 'LoadBlockClasses'],
55
+ ["log" /* LogForTestCase */, 'LogForTestCase'],
56
+ ["oi" /* OffsetItems */, 'OffsetItems'],
57
+ ["pdi" /* PatchDataItems */, 'PatchDataItems'],
58
+ ["rp" /* RegisterPanel */, 'RegisterPanel'],
59
+ ["r" /* ReloadExtension */, 'ReloadExtension'],
60
+ ["oauth" /* SendOAuthRequest */, 'SendOAuthRequest'],
61
+ ["suim" /* SendUIMessage */, 'SendUIMessage'],
62
+ ["xhr" /* SendXHR */, 'SendXHR'],
63
+ ["scp" /* SetCurrentPage */, 'SetCurrentPage'],
64
+ ["sp" /* SetProperty */, 'SetProperty'],
65
+ ["srk" /* SetReferenceKey */, 'SetReferenceKey'],
66
+ ["ssd" /* SetShapeData */, 'SetShapeData'],
67
+ ["sm" /* ShowModal */, 'ShowModal'],
68
+ ["spn" /* ShowPanel */, 'ShowPanel'],
69
+ ["sleep" /* SleepForTestCase */, 'SleepForTestCase'],
70
+ ["throw" /* ThrowForTestCase */, 'ThrowForTestCase'],
71
+ ["uci" /* UnhookCreateItems */, 'UnhookCreateItems'],
72
+ ["us" /* UnhookSelection */, 'UnhookSelection'],
73
+ ["ute" /* UnhookTextEdit */, 'UnhookTextEdit'],
74
+ ]);
5
75
  function isRawSendXHRResponse(val) {
6
76
  return (0, checks_1.isString)(val['url']) && (0, checks_1.isString)(val['t']) && (0, checks_1.isNumber)(val['s']) && (0, checks_1.isObject)(val['h']);
7
77
  }
@@ -11,7 +11,8 @@ export declare enum FieldConstraintType {
11
11
  LOCKED = "locked",
12
12
  MIN_VALUE = "minValue",
13
13
  MAX_VALUE = "maxValue",
14
- SINGLE_LINE_ONLY = "singleLineOnly"
14
+ SINGLE_LINE_ONLY = "singleLineOnly",
15
+ NO_WHITESPACE = "noWhitespace"
15
16
  }
16
17
  export declare type SerializedFieldConstraint = {
17
18
  'Type': FieldConstraintType;
@@ -9,4 +9,5 @@ var FieldConstraintType;
9
9
  FieldConstraintType["MIN_VALUE"] = "minValue";
10
10
  FieldConstraintType["MAX_VALUE"] = "maxValue";
11
11
  FieldConstraintType["SINGLE_LINE_ONLY"] = "singleLineOnly";
12
+ FieldConstraintType["NO_WHITESPACE"] = "noWhitespace";
12
13
  })(FieldConstraintType = exports.FieldConstraintType || (exports.FieldConstraintType = {}));
@@ -75,7 +75,7 @@ export declare class EditorClient {
75
75
  * @returns
76
76
  * @throws A string with an error from the data sync server
77
77
  */
78
- performDataAction(flowName: string, dataConnectorName: string, syncDataSourceId: string, flowData?: unknown, async?: boolean): Promise<DataActionResult>;
78
+ performDataAction(flowName: string, dataConnectorName: string, syncDataSourceId?: undefined | string, flowData?: unknown, async?: boolean): Promise<DataActionResult>;
79
79
  /**
80
80
  * Make a network request
81
81
  * @param request Settings for the network request
@@ -59,7 +59,7 @@ class EditorClient {
59
59
  * @returns
60
60
  * @throws A string with an error from the data sync server
61
61
  */
62
- async performDataAction(flowName, dataConnectorName, syncDataSourceId, flowData = undefined, async = true) {
62
+ async performDataAction(flowName, dataConnectorName, syncDataSourceId = undefined, flowData = undefined, async = true) {
63
63
  const result = await this.sendCommand("da" /* DataAction */, {
64
64
  'fn': flowName,
65
65
  'a': async,