lucid-extension-sdk 0.0.123 → 0.0.124

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.123",
3
+ "version": "0.0.124",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
@@ -20,6 +20,13 @@ export declare type DataActionResponse = {
20
20
  /** The body of the HTTP Response (otherwise) */
21
21
  'text': string;
22
22
  });
23
+ export declare type DataActionOptions = {
24
+ dataConnectorName: string;
25
+ actionName: string;
26
+ actionData?: unknown;
27
+ syncDataSourceIdNonce?: string;
28
+ asynchronous?: boolean;
29
+ };
23
30
  export declare class EditorClient {
24
31
  private nextId;
25
32
  private readonly callbacks;
@@ -58,17 +65,7 @@ export declare class EditorClient {
58
65
  * @deprecated Use createUserImage instead.
59
66
  */
60
67
  experimentalCreateUserImage(mediaType: string, data: Uint8Array | string): Promise<string>;
61
- /**
62
- *
63
- * @param flowName
64
- * @param dataConnectorName
65
- * @param syncDataSourceId
66
- * @param flowData
67
- * @param async
68
- * @returns
69
- * @throws A string with an error from the data sync server
70
- */
71
- performDataAction(flowName: string, dataConnectorName: string, syncDataSourceId?: undefined | string, flowData?: unknown, async?: boolean): Promise<DataActionResponse>;
68
+ performDataAction(options: DataActionOptions): Promise<DataActionResponse>;
72
69
  /**
73
70
  * If the extension package containing this editor extension has configurable settings,
74
71
  * show a standard modal allowing the user to view or change those settings.
@@ -96,23 +96,16 @@ class EditorClient {
96
96
  experimentalCreateUserImage(mediaType, data) {
97
97
  return this.createUserImage(mediaType, data);
98
98
  }
99
- /**
100
- *
101
- * @param flowName
102
- * @param dataConnectorName
103
- * @param syncDataSourceId
104
- * @param flowData
105
- * @param async
106
- * @returns
107
- * @throws A string with an error from the data sync server
108
- */
109
- async performDataAction(flowName, dataConnectorName, syncDataSourceId = undefined, flowData = undefined, async = true) {
99
+ async performDataAction(options) {
100
+ if (options.asynchronous === undefined) {
101
+ options.asynchronous = true;
102
+ }
110
103
  const result = await this.sendCommand("da" /* CommandName.DataAction */, {
111
- 'fn': flowName,
112
- 'a': async,
113
- 's': syncDataSourceId,
114
- 'fd': flowData,
115
- 'n': dataConnectorName,
104
+ 'fn': options.actionName,
105
+ 'a': options.asynchronous,
106
+ 's': options.syncDataSourceIdNonce,
107
+ 'fd': options.actionData,
108
+ 'n': options.dataConnectorName,
116
109
  });
117
110
  if ('t' in result) {
118
111
  return {