@forge/bridge 5.3.0 → 5.4.0-next.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @forge/bridge
2
2
 
3
+ ## 5.4.0-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 32da8c1: Update realtime bridge methods to accept new token variable
8
+
9
+ ## 5.4.0-next.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 58d0e97: Update realtime module to be public.
14
+
3
15
  ## 5.3.0
4
16
 
5
17
  ### Minor Changes
@@ -1,10 +1,18 @@
1
1
  export interface SubscriptionOptions {
2
2
  replay?: number;
3
+ token?: string;
3
4
  }
4
- export declare const __realtime: {
5
- publish: (channel: string, payload: any) => Promise<void>;
6
- subscribe: (channel: string, callback: (payload?: any) => any, options?: SubscriptionOptions) => Promise<void>;
7
- publishGlobal: (channel: string, payload: any) => Promise<void>;
8
- subscribeGlobal: (channel: string, callback: (payload?: any) => any, options?: SubscriptionOptions) => Promise<void>;
5
+ export interface PublishOptions {
6
+ token?: string;
7
+ }
8
+ interface Subscription {
9
+ unsubscribe: () => Promise<void>;
10
+ }
11
+ export declare const realtime: {
12
+ publish: (channel: string, payload: any, options?: PublishOptions) => Promise<void>;
13
+ subscribe: (channel: string, callback: (payload?: any) => any, options?: SubscriptionOptions) => Promise<Subscription>;
14
+ publishGlobal: (channel: string, payload: any, options?: PublishOptions) => Promise<void>;
15
+ subscribeGlobal: (channel: string, callback: (payload?: any) => any, options?: SubscriptionOptions) => Promise<Subscription>;
9
16
  };
17
+ export {};
10
18
  //# sourceMappingURL=realtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../../src/realtime/realtime.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAwBD,eAAO,MAAM,UAAU;uBApBG,MAAM,WAAW,GAAG,KAAG,QAAQ,IAAI,CAAC;yBAIlC,MAAM,uBAAuB,GAAG,KAAK,GAAG,YAAY,mBAAmB,KAAG,QAAQ,IAAI,CAAC;6BAInF,MAAM,WAAW,GAAG,KAAG,QAAQ,IAAI,CAAC;+BAKzD,MAAM,uBACM,GAAG,KAAK,GAAG,YACtB,mBAAmB,KAC5B,QAAQ,IAAI,CAAC;CASf,CAAC"}
1
+ {"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../../src/realtime/realtime.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,YAAY;IACpB,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAiCD,eAAO,MAAM,QAAQ;uBA7BK,MAAM,WAAW,GAAG,YAAY,cAAc,KAAG,QAAQ,IAAI,CAAC;yBAK7E,MAAM,uBACM,GAAG,KAAK,GAAG,YACtB,mBAAmB,KAC5B,QAAQ,YAAY,CAAC;6BAIQ,MAAM,WAAW,GAAG,YAAY,cAAc,KAAG,QAAQ,IAAI,CAAC;+BAKnF,MAAM,uBACM,GAAG,KAAK,GAAG,YACtB,mBAAmB,KAC5B,QAAQ,YAAY,CAAC;CAcvB,CAAC"}
@@ -1,21 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.__realtime = void 0;
3
+ exports.realtime = void 0;
4
4
  const bridge_1 = require("../bridge");
5
5
  const callBridge = (0, bridge_1.getCallBridge)();
6
- const publish = (channel, payload) => {
7
- return callBridge('publishRealtimeChannel', { channelName: channel, eventPayload: payload });
6
+ const publish = (channel, payload, options) => {
7
+ return callBridge('publishRealtimeChannel', { channelName: channel, eventPayload: payload, options });
8
8
  };
9
9
  const subscribe = (channel, callback, options) => {
10
10
  return callBridge('subscribeRealtimeChannel', { channelName: channel, onEvent: callback, options });
11
11
  };
12
- const publishGlobal = (channel, payload) => {
13
- return callBridge('publishRealtimeChannel', { channelName: channel, eventPayload: payload, isGlobal: true });
12
+ const publishGlobal = (channel, payload, options) => {
13
+ return callBridge('publishRealtimeChannel', { channelName: channel, eventPayload: payload, options, isGlobal: true });
14
14
  };
15
15
  const subscribeGlobal = (channel, callback, options) => {
16
- return callBridge('subscribeRealtimeChannel', { channelName: channel, onEvent: callback, options, isGlobal: true });
16
+ return callBridge('subscribeRealtimeChannel', {
17
+ channelName: channel,
18
+ onEvent: callback,
19
+ options,
20
+ isGlobal: true
21
+ });
17
22
  };
18
- exports.__realtime = {
23
+ exports.realtime = {
19
24
  publish,
20
25
  subscribe,
21
26
  publishGlobal,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bridge",
3
- "version": "5.3.0",
3
+ "version": "5.4.0-next.1",
4
4
  "description": "Forge bridge API for custom UI apps",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",