@sigmacomputing/embed-sdk 0.4.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -64,6 +64,7 @@ declare const WorkbookVariablesListEventName: "workbook:variables:list";
64
64
  declare const WorkbookVariablesUpdateEventName: "workbook:variables:update";
65
65
  declare const WorkbookVariablesCurrentEventName: "workbook:variables:current";
66
66
  declare const WorkbookSharingLinkUpdateEventName: "workbook:sharinglink:update";
67
+ declare const ActionOutboundEventName: "action:outbound";
67
68
  interface WorkbookLoadedEvent {
68
69
  type: typeof WorkbookLoadedEventName;
69
70
  workbook: {
@@ -77,7 +78,9 @@ interface WorkbookErrorEvent {
77
78
  }
78
79
  interface WorkbookVariableOnChangeEvent {
79
80
  type: typeof WorkbookVariableEventOnChangeName;
80
- variables: Record<string, string>;
81
+ workbook: {
82
+ variables: Record<string, string>;
83
+ };
81
84
  }
82
85
  interface WorkbookVariableCurrentEvent {
83
86
  type: typeof WorkbookVariablesCurrentEventName;
@@ -165,6 +168,11 @@ type WorkbookBookmarkCreateEvent = {
165
168
  isDefault: boolean;
166
169
  isShared: boolean;
167
170
  };
171
+ type ActionOutboundEvent = {
172
+ type: typeof ActionOutboundEventName;
173
+ name: string;
174
+ values: Record<string, unknown>;
175
+ };
168
176
 
169
177
  declare const workbookLoadedListener: (event: MessageEvent, iframe: HTMLIFrameElement, onLoaded: (event: WorkbookLoadedEvent) => void) => void;
170
178
  declare const workbookErrorListener: (event: MessageEvent, iframe: HTMLIFrameElement, onError: (event: WorkbookErrorEvent) => void) => void;
@@ -186,7 +194,16 @@ declare const workbookExploreKeyOnChangeListener: (event: MessageEvent, iframe:
186
194
  declare const workbookBookmarkOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onBookmarkChange: (event: WorkbookBookmarkOnChangeEvent) => void) => void;
187
195
  declare const urlOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onUrlChange: (event: UrlOnChangeEvent) => void) => void;
188
196
  declare const workbookIdOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onWorkbookIdChange: (event: WorkbookIdOnChangeEvent) => void) => void;
197
+ declare const actionOutboundListener: (event: MessageEvent, iframe: HTMLIFrameElement, onActionOutbound: (event: ActionOutboundEvent) => void) => void;
189
198
 
199
+ /**
200
+ * DO NOT USE IN PRODUCTION.
201
+ *
202
+ * This will override the Sigma Computing URL used for mutations.
203
+ *
204
+ * @param url the URL to use instead of the default
205
+ */
206
+ declare const DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl: (url: string) => void;
190
207
  declare const workbookBookmarkCreate: (iframe: HTMLIFrameElement, bookmark: WorkbookBookmarkCreateEvent) => void;
191
208
  declare const workbookBookmarkUpdate: (iframe: HTMLIFrameElement) => void;
192
209
  declare const workbookFullscreenUpdate: (iframe: HTMLIFrameElement, nodeId: string | null) => void;
@@ -195,4 +212,4 @@ declare const workbookVariablesList: (iframe: HTMLIFrameElement) => void;
195
212
  declare const workbookVariablesUpdate: (iframe: HTMLIFrameElement, variables: Record<string, string>) => void;
196
213
  declare const workbookSharingLinkUpdate: (iframe: HTMLIFrameElement, sharingLink: string | null, sharingExplorationLink?: string | null) => void;
197
214
 
198
- export { CellType_t, type Cell_t, type ChartValue_t, type ChartValues_t, type DataRow_t, type DataRows_t, type Data_t, type LevelTableCell_t, type LevelTableCells, type LevelTableColumnCell_t, type LevelTableValueCell_t, type PathChunk_t, type PivotPath_t, type PivotTableCell_t, type PivotTableCells_t, type UrlOnChangeEvent, UrlOnChangeEventName, type Value_t, type WorkbookBookmarkCreateEvent, WorkbookBookmarkCreateEventName, type WorkbookBookmarkOnChangeEvent, WorkbookBookmarkOnChangeEventName, type WorkbookBookmarkOnCreateEvent, WorkbookBookmarkOnCreateEventName, WorkbookBookmarkUpdateEventName, type WorkbookChartErrorEvent, WorkbookChartErrorEventName, type WorkbookChartValueSelectEvent, WorkbookChartValueSelectEventName, type WorkbookCurrentVariablesEvent, WorkbookCurrentVariablesEventName, type WorkbookDataLoadedEvent, WorkbookDataLoadedEventName, type WorkbookErrorEvent, WorkbookErrorEventName, type WorkbookExploreKeyOnChangeEvent, WorkbookExploreKeyOnChangeEventName, type WorkbookFullScreenEvent, WorkbookFullScreenEventName, WorkbookFullscreenUpdateEventName, type WorkbookIdOnChangeEvent, WorkbookIdOnChangeEventName, type WorkbookLoadedEvent, WorkbookLoadedEventName, type WorkbookPageHeightEvent, WorkbookPageHeightEventName, type WorkbookPivotTableCellSelectEvent, WorkbookPivotTableCellSelectEventName, type WorkbookPublishedEvent, WorkbookPublishedEventName, type WorkbookSelectedNodeEvent, WorkbookSelectedNodeEventName, WorkbookSelectedNodeIdUpdateEventName, type WorkbookSharingLinkUpdateEvent, WorkbookSharingLinkUpdateEventName, type WorkbookTableCellSelectEvent, WorkbookTableCellSelectEventName, type WorkbookVariableCurrentEvent, WorkbookVariableEventOnChangeName, type WorkbookVariableOnChangeEvent, WorkbookVariablesCurrentEventName, WorkbookVariablesListEventName, WorkbookVariablesUpdateEventName, urlOnChangeListener, workbookBookmarkCreate, workbookBookmarkCreateListener, workbookBookmarkOnChangeListener, workbookBookmarkUpdate, workbookChartErrorListener, workbookChartValueSelectListener, workbookCurrentVariablesListener, workbookDataLoadedListener, workbookErrorListener, workbookExploreKeyOnChangeListener, workbookFullScreenListener, workbookFullscreenUpdate, workbookIdOnChangeListener, workbookLinkSharingUpdateListener, workbookLoadedListener, workbookPageHeightListener, workbookPivotTableCellSelectListener, workbookPublishedListener, workbookSelectedNodeIdUpdate, workbookSelectedNodeListener, workbookSharingLinkUpdate, workbookTableCellSelectListener, workbookVariableChangeListener, workbookVariableCurrentListener, workbookVariablesList, workbookVariablesUpdate };
215
+ export { type ActionOutboundEvent, ActionOutboundEventName, CellType_t, type Cell_t, type ChartValue_t, type ChartValues_t, DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl, type DataRow_t, type DataRows_t, type Data_t, type LevelTableCell_t, type LevelTableCells, type LevelTableColumnCell_t, type LevelTableValueCell_t, type PathChunk_t, type PivotPath_t, type PivotTableCell_t, type PivotTableCells_t, type UrlOnChangeEvent, UrlOnChangeEventName, type Value_t, type WorkbookBookmarkCreateEvent, WorkbookBookmarkCreateEventName, type WorkbookBookmarkOnChangeEvent, WorkbookBookmarkOnChangeEventName, type WorkbookBookmarkOnCreateEvent, WorkbookBookmarkOnCreateEventName, WorkbookBookmarkUpdateEventName, type WorkbookChartErrorEvent, WorkbookChartErrorEventName, type WorkbookChartValueSelectEvent, WorkbookChartValueSelectEventName, type WorkbookCurrentVariablesEvent, WorkbookCurrentVariablesEventName, type WorkbookDataLoadedEvent, WorkbookDataLoadedEventName, type WorkbookErrorEvent, WorkbookErrorEventName, type WorkbookExploreKeyOnChangeEvent, WorkbookExploreKeyOnChangeEventName, type WorkbookFullScreenEvent, WorkbookFullScreenEventName, WorkbookFullscreenUpdateEventName, type WorkbookIdOnChangeEvent, WorkbookIdOnChangeEventName, type WorkbookLoadedEvent, WorkbookLoadedEventName, type WorkbookPageHeightEvent, WorkbookPageHeightEventName, type WorkbookPivotTableCellSelectEvent, WorkbookPivotTableCellSelectEventName, type WorkbookPublishedEvent, WorkbookPublishedEventName, type WorkbookSelectedNodeEvent, WorkbookSelectedNodeEventName, WorkbookSelectedNodeIdUpdateEventName, type WorkbookSharingLinkUpdateEvent, WorkbookSharingLinkUpdateEventName, type WorkbookTableCellSelectEvent, WorkbookTableCellSelectEventName, type WorkbookVariableCurrentEvent, WorkbookVariableEventOnChangeName, type WorkbookVariableOnChangeEvent, WorkbookVariablesCurrentEventName, WorkbookVariablesListEventName, WorkbookVariablesUpdateEventName, actionOutboundListener, urlOnChangeListener, workbookBookmarkCreate, workbookBookmarkCreateListener, workbookBookmarkOnChangeListener, workbookBookmarkUpdate, workbookChartErrorListener, workbookChartValueSelectListener, workbookCurrentVariablesListener, workbookDataLoadedListener, workbookErrorListener, workbookExploreKeyOnChangeListener, workbookFullScreenListener, workbookFullscreenUpdate, workbookIdOnChangeListener, workbookLinkSharingUpdateListener, workbookLoadedListener, workbookPageHeightListener, workbookPivotTableCellSelectListener, workbookPublishedListener, workbookSelectedNodeIdUpdate, workbookSelectedNodeListener, workbookSharingLinkUpdate, workbookTableCellSelectListener, workbookVariableChangeListener, workbookVariableCurrentListener, workbookVariablesList, workbookVariablesUpdate };
package/dist/index.d.ts CHANGED
@@ -64,6 +64,7 @@ declare const WorkbookVariablesListEventName: "workbook:variables:list";
64
64
  declare const WorkbookVariablesUpdateEventName: "workbook:variables:update";
65
65
  declare const WorkbookVariablesCurrentEventName: "workbook:variables:current";
66
66
  declare const WorkbookSharingLinkUpdateEventName: "workbook:sharinglink:update";
67
+ declare const ActionOutboundEventName: "action:outbound";
67
68
  interface WorkbookLoadedEvent {
68
69
  type: typeof WorkbookLoadedEventName;
69
70
  workbook: {
@@ -77,7 +78,9 @@ interface WorkbookErrorEvent {
77
78
  }
78
79
  interface WorkbookVariableOnChangeEvent {
79
80
  type: typeof WorkbookVariableEventOnChangeName;
80
- variables: Record<string, string>;
81
+ workbook: {
82
+ variables: Record<string, string>;
83
+ };
81
84
  }
82
85
  interface WorkbookVariableCurrentEvent {
83
86
  type: typeof WorkbookVariablesCurrentEventName;
@@ -165,6 +168,11 @@ type WorkbookBookmarkCreateEvent = {
165
168
  isDefault: boolean;
166
169
  isShared: boolean;
167
170
  };
171
+ type ActionOutboundEvent = {
172
+ type: typeof ActionOutboundEventName;
173
+ name: string;
174
+ values: Record<string, unknown>;
175
+ };
168
176
 
169
177
  declare const workbookLoadedListener: (event: MessageEvent, iframe: HTMLIFrameElement, onLoaded: (event: WorkbookLoadedEvent) => void) => void;
170
178
  declare const workbookErrorListener: (event: MessageEvent, iframe: HTMLIFrameElement, onError: (event: WorkbookErrorEvent) => void) => void;
@@ -186,7 +194,16 @@ declare const workbookExploreKeyOnChangeListener: (event: MessageEvent, iframe:
186
194
  declare const workbookBookmarkOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onBookmarkChange: (event: WorkbookBookmarkOnChangeEvent) => void) => void;
187
195
  declare const urlOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onUrlChange: (event: UrlOnChangeEvent) => void) => void;
188
196
  declare const workbookIdOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onWorkbookIdChange: (event: WorkbookIdOnChangeEvent) => void) => void;
197
+ declare const actionOutboundListener: (event: MessageEvent, iframe: HTMLIFrameElement, onActionOutbound: (event: ActionOutboundEvent) => void) => void;
189
198
 
199
+ /**
200
+ * DO NOT USE IN PRODUCTION.
201
+ *
202
+ * This will override the Sigma Computing URL used for mutations.
203
+ *
204
+ * @param url the URL to use instead of the default
205
+ */
206
+ declare const DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl: (url: string) => void;
190
207
  declare const workbookBookmarkCreate: (iframe: HTMLIFrameElement, bookmark: WorkbookBookmarkCreateEvent) => void;
191
208
  declare const workbookBookmarkUpdate: (iframe: HTMLIFrameElement) => void;
192
209
  declare const workbookFullscreenUpdate: (iframe: HTMLIFrameElement, nodeId: string | null) => void;
@@ -195,4 +212,4 @@ declare const workbookVariablesList: (iframe: HTMLIFrameElement) => void;
195
212
  declare const workbookVariablesUpdate: (iframe: HTMLIFrameElement, variables: Record<string, string>) => void;
196
213
  declare const workbookSharingLinkUpdate: (iframe: HTMLIFrameElement, sharingLink: string | null, sharingExplorationLink?: string | null) => void;
197
214
 
198
- export { CellType_t, type Cell_t, type ChartValue_t, type ChartValues_t, type DataRow_t, type DataRows_t, type Data_t, type LevelTableCell_t, type LevelTableCells, type LevelTableColumnCell_t, type LevelTableValueCell_t, type PathChunk_t, type PivotPath_t, type PivotTableCell_t, type PivotTableCells_t, type UrlOnChangeEvent, UrlOnChangeEventName, type Value_t, type WorkbookBookmarkCreateEvent, WorkbookBookmarkCreateEventName, type WorkbookBookmarkOnChangeEvent, WorkbookBookmarkOnChangeEventName, type WorkbookBookmarkOnCreateEvent, WorkbookBookmarkOnCreateEventName, WorkbookBookmarkUpdateEventName, type WorkbookChartErrorEvent, WorkbookChartErrorEventName, type WorkbookChartValueSelectEvent, WorkbookChartValueSelectEventName, type WorkbookCurrentVariablesEvent, WorkbookCurrentVariablesEventName, type WorkbookDataLoadedEvent, WorkbookDataLoadedEventName, type WorkbookErrorEvent, WorkbookErrorEventName, type WorkbookExploreKeyOnChangeEvent, WorkbookExploreKeyOnChangeEventName, type WorkbookFullScreenEvent, WorkbookFullScreenEventName, WorkbookFullscreenUpdateEventName, type WorkbookIdOnChangeEvent, WorkbookIdOnChangeEventName, type WorkbookLoadedEvent, WorkbookLoadedEventName, type WorkbookPageHeightEvent, WorkbookPageHeightEventName, type WorkbookPivotTableCellSelectEvent, WorkbookPivotTableCellSelectEventName, type WorkbookPublishedEvent, WorkbookPublishedEventName, type WorkbookSelectedNodeEvent, WorkbookSelectedNodeEventName, WorkbookSelectedNodeIdUpdateEventName, type WorkbookSharingLinkUpdateEvent, WorkbookSharingLinkUpdateEventName, type WorkbookTableCellSelectEvent, WorkbookTableCellSelectEventName, type WorkbookVariableCurrentEvent, WorkbookVariableEventOnChangeName, type WorkbookVariableOnChangeEvent, WorkbookVariablesCurrentEventName, WorkbookVariablesListEventName, WorkbookVariablesUpdateEventName, urlOnChangeListener, workbookBookmarkCreate, workbookBookmarkCreateListener, workbookBookmarkOnChangeListener, workbookBookmarkUpdate, workbookChartErrorListener, workbookChartValueSelectListener, workbookCurrentVariablesListener, workbookDataLoadedListener, workbookErrorListener, workbookExploreKeyOnChangeListener, workbookFullScreenListener, workbookFullscreenUpdate, workbookIdOnChangeListener, workbookLinkSharingUpdateListener, workbookLoadedListener, workbookPageHeightListener, workbookPivotTableCellSelectListener, workbookPublishedListener, workbookSelectedNodeIdUpdate, workbookSelectedNodeListener, workbookSharingLinkUpdate, workbookTableCellSelectListener, workbookVariableChangeListener, workbookVariableCurrentListener, workbookVariablesList, workbookVariablesUpdate };
215
+ export { type ActionOutboundEvent, ActionOutboundEventName, CellType_t, type Cell_t, type ChartValue_t, type ChartValues_t, DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl, type DataRow_t, type DataRows_t, type Data_t, type LevelTableCell_t, type LevelTableCells, type LevelTableColumnCell_t, type LevelTableValueCell_t, type PathChunk_t, type PivotPath_t, type PivotTableCell_t, type PivotTableCells_t, type UrlOnChangeEvent, UrlOnChangeEventName, type Value_t, type WorkbookBookmarkCreateEvent, WorkbookBookmarkCreateEventName, type WorkbookBookmarkOnChangeEvent, WorkbookBookmarkOnChangeEventName, type WorkbookBookmarkOnCreateEvent, WorkbookBookmarkOnCreateEventName, WorkbookBookmarkUpdateEventName, type WorkbookChartErrorEvent, WorkbookChartErrorEventName, type WorkbookChartValueSelectEvent, WorkbookChartValueSelectEventName, type WorkbookCurrentVariablesEvent, WorkbookCurrentVariablesEventName, type WorkbookDataLoadedEvent, WorkbookDataLoadedEventName, type WorkbookErrorEvent, WorkbookErrorEventName, type WorkbookExploreKeyOnChangeEvent, WorkbookExploreKeyOnChangeEventName, type WorkbookFullScreenEvent, WorkbookFullScreenEventName, WorkbookFullscreenUpdateEventName, type WorkbookIdOnChangeEvent, WorkbookIdOnChangeEventName, type WorkbookLoadedEvent, WorkbookLoadedEventName, type WorkbookPageHeightEvent, WorkbookPageHeightEventName, type WorkbookPivotTableCellSelectEvent, WorkbookPivotTableCellSelectEventName, type WorkbookPublishedEvent, WorkbookPublishedEventName, type WorkbookSelectedNodeEvent, WorkbookSelectedNodeEventName, WorkbookSelectedNodeIdUpdateEventName, type WorkbookSharingLinkUpdateEvent, WorkbookSharingLinkUpdateEventName, type WorkbookTableCellSelectEvent, WorkbookTableCellSelectEventName, type WorkbookVariableCurrentEvent, WorkbookVariableEventOnChangeName, type WorkbookVariableOnChangeEvent, WorkbookVariablesCurrentEventName, WorkbookVariablesListEventName, WorkbookVariablesUpdateEventName, actionOutboundListener, urlOnChangeListener, workbookBookmarkCreate, workbookBookmarkCreateListener, workbookBookmarkOnChangeListener, workbookBookmarkUpdate, workbookChartErrorListener, workbookChartValueSelectListener, workbookCurrentVariablesListener, workbookDataLoadedListener, workbookErrorListener, workbookExploreKeyOnChangeListener, workbookFullScreenListener, workbookFullscreenUpdate, workbookIdOnChangeListener, workbookLinkSharingUpdateListener, workbookLoadedListener, workbookPageHeightListener, workbookPivotTableCellSelectListener, workbookPublishedListener, workbookSelectedNodeIdUpdate, workbookSelectedNodeListener, workbookSharingLinkUpdate, workbookTableCellSelectListener, workbookVariableChangeListener, workbookVariableCurrentListener, workbookVariablesList, workbookVariablesUpdate };
package/dist/index.js CHANGED
@@ -20,6 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl: () => DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl,
24
+ actionOutboundListener: () => actionOutboundListener,
23
25
  urlOnChangeListener: () => urlOnChangeListener,
24
26
  workbookBookmarkCreate: () => workbookBookmarkCreate,
25
27
  workbookBookmarkCreateListener: () => workbookBookmarkCreateListener,
@@ -77,6 +79,7 @@ var WorkbookVariablesListEventName = "workbook:variables:list";
77
79
  var WorkbookVariablesUpdateEventName = "workbook:variables:update";
78
80
  var WorkbookVariablesCurrentEventName = "workbook:variables:current";
79
81
  var WorkbookSharingLinkUpdateEventName = "workbook:sharinglink:update";
82
+ var ActionOutboundEventName = "action:outbound";
80
83
 
81
84
  // src/wrapper.ts
82
85
  var checkEventOrigin = (url) => {
@@ -225,16 +228,24 @@ var workbookIdOnChangeListener = (event, iframe, onWorkbookIdChange) => {
225
228
  }
226
229
  }
227
230
  };
231
+ var actionOutboundListener = (event, iframe, onActionOutbound) => {
232
+ if (event.source === iframe.contentWindow && checkEventOrigin(event.origin)) {
233
+ if (event.data.type === ActionOutboundEventName) {
234
+ onActionOutbound(event.data);
235
+ }
236
+ }
237
+ };
228
238
 
229
239
  // src/mutations.ts
240
+ var SIGMA_COMPUTING_URL = "https://app.sigmacomputing.com";
230
241
  var sendIframeMessage = (iframe, message) => {
231
242
  if (!iframe.contentWindow) {
232
243
  throw new Error("iframe contentWindow is not available");
233
244
  }
234
- iframe.contentWindow.postMessage(
235
- message,
236
- "https://staging.sigmacomputing.io"
237
- );
245
+ iframe.contentWindow.postMessage(message, SIGMA_COMPUTING_URL);
246
+ };
247
+ var DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl = (url) => {
248
+ SIGMA_COMPUTING_URL = url;
238
249
  };
239
250
  var workbookBookmarkCreate = (iframe, bookmark) => {
240
251
  sendIframeMessage(iframe, {
@@ -280,6 +291,8 @@ var workbookSharingLinkUpdate = (iframe, sharingLink, sharingExplorationLink) =>
280
291
  };
281
292
  // Annotate the CommonJS export names for ESM import in node:
282
293
  0 && (module.exports = {
294
+ DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl,
295
+ actionOutboundListener,
283
296
  urlOnChangeListener,
284
297
  workbookBookmarkCreate,
285
298
  workbookBookmarkCreateListener,
package/dist/index.mjs CHANGED
@@ -25,6 +25,7 @@ var WorkbookVariablesListEventName = "workbook:variables:list";
25
25
  var WorkbookVariablesUpdateEventName = "workbook:variables:update";
26
26
  var WorkbookVariablesCurrentEventName = "workbook:variables:current";
27
27
  var WorkbookSharingLinkUpdateEventName = "workbook:sharinglink:update";
28
+ var ActionOutboundEventName = "action:outbound";
28
29
 
29
30
  // src/wrapper.ts
30
31
  var checkEventOrigin = (url) => {
@@ -173,16 +174,24 @@ var workbookIdOnChangeListener = (event, iframe, onWorkbookIdChange) => {
173
174
  }
174
175
  }
175
176
  };
177
+ var actionOutboundListener = (event, iframe, onActionOutbound) => {
178
+ if (event.source === iframe.contentWindow && checkEventOrigin(event.origin)) {
179
+ if (event.data.type === ActionOutboundEventName) {
180
+ onActionOutbound(event.data);
181
+ }
182
+ }
183
+ };
176
184
 
177
185
  // src/mutations.ts
186
+ var SIGMA_COMPUTING_URL = "https://app.sigmacomputing.com";
178
187
  var sendIframeMessage = (iframe, message) => {
179
188
  if (!iframe.contentWindow) {
180
189
  throw new Error("iframe contentWindow is not available");
181
190
  }
182
- iframe.contentWindow.postMessage(
183
- message,
184
- "https://staging.sigmacomputing.io"
185
- );
191
+ iframe.contentWindow.postMessage(message, SIGMA_COMPUTING_URL);
192
+ };
193
+ var DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl = (url) => {
194
+ SIGMA_COMPUTING_URL = url;
186
195
  };
187
196
  var workbookBookmarkCreate = (iframe, bookmark) => {
188
197
  sendIframeMessage(iframe, {
@@ -227,6 +236,8 @@ var workbookSharingLinkUpdate = (iframe, sharingLink, sharingExplorationLink) =>
227
236
  });
228
237
  };
229
238
  export {
239
+ DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl,
240
+ actionOutboundListener,
230
241
  urlOnChangeListener,
231
242
  workbookBookmarkCreate,
232
243
  workbookBookmarkCreateListener,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sigmacomputing/embed-sdk",
3
3
  "author": "sigmacomputing",
4
- "version": "0.4.0",
4
+ "version": "0.6.0",
5
5
  "description": "JavaScript SDK to interact with Sigma Computing's Embed API",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -18,10 +18,18 @@
18
18
  "sdk",
19
19
  "sigma"
20
20
  ],
21
+ "main": "./dist/index.js",
22
+ "module": "./dist/index.mjs",
23
+ "types": "./dist/index.d.ts",
21
24
  "exports": {
22
- "import": "./dist/index.mjs",
23
- "require": "./dist/index.js",
24
- "types": "./dist/index.d.ts"
25
+ "import": {
26
+ "import": "./dist/index.mjs",
27
+ "types": "./dist/index.d.mts"
28
+ },
29
+ "require": {
30
+ "require": "./dist/index.js",
31
+ "types": "./dist/index.d.ts"
32
+ }
25
33
  },
26
34
  "files": [
27
35
  "dist"
@@ -31,7 +39,7 @@
31
39
  "@sigmacomputing/typescript-config": "0.0.0"
32
40
  },
33
41
  "scripts": {
34
- "prepublish": "pnpm run build",
42
+ "prepublish": "turbo run build",
35
43
  "build": "tsup",
36
44
  "lint": "eslint . --ext .ts",
37
45
  "watch": "tsup --watch",