npm package diff

Package: @forge/bridge

Versions: 5.3.0-next.0-experimental-b695d2e - 5.3.0-next.2

Modified: package/out/invoke/invoke.js

Index: package/out/invoke/invoke.js
===================================================================
--- package/out/invoke/invoke.js
+++ package/out/invoke/invoke.js
@@ -1,7 +1,7 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
-exports.invoke = void 0;
+exports.makeInvoke = exports.invoke = void 0;
 const bridge_1 = require("../bridge");
 const errors_1 = require("../errors");
 const utils_1 = require("../utils");
 const callBridge = (0, bridge_1.getCallBridge)();
@@ -19,4 +19,8 @@
     validatePayload(payload);
     return callBridge('invoke', { functionKey, payload });
 };
 exports.invoke = (0, utils_1.withRateLimiter)(_invoke, 500, 1000 * 25, 'Resolver calls are rate limited at 500req/25s');
+function makeInvoke() {
+    return exports.invoke;
+}
+exports.makeInvoke = makeInvoke;

Modified: package/out/realtime/realtime.js

Index: package/out/realtime/realtime.js
===================================================================
--- package/out/realtime/realtime.js
+++ package/out/realtime/realtime.js
@@ -8,8 +8,16 @@
 };
 const subscribe = (channel, callback, options) => {
     return callBridge('subscribeRealtimeChannel', { channelName: channel, onEvent: callback, options });
 };
+const publishGlobal = (channel, payload) => {
+    return callBridge('publishRealtimeChannel', { channelName: channel, eventPayload: payload, isGlobal: true });
+};
+const subscribeGlobal = (channel, callback, options) => {
+    return callBridge('subscribeRealtimeChannel', { channelName: channel, onEvent: callback, options, isGlobal: true });
+};
 exports.__realtime = {
     publish,
-    subscribe
+    subscribe,
+    publishGlobal,
+    subscribeGlobal
 };

Modified: package/package.json

Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
 {
   "name": "@forge/bridge",
-  "version": "5.3.0-next.0-experimental-b695d2e",
+  "version": "5.3.0-next.2",
   "description": "Forge bridge API for custom UI apps",
   "author": "Atlassian",
   "license": "SEE LICENSE IN LICENSE.txt",
   "main": "out/index.js",
@@ -14,9 +14,10 @@
   },
   "dependencies": {
     "@atlaskit/tokens": "^1.58.0",
     "@types/history": "^4.7.11",
-    "@forge/i18n": "0.0.7"
+    "@forge/i18n": "0.0.7",
+    "@forge/resolver": "1.7.0-next.1"
   },
   "devDependencies": {
     "history": "5.3.0",
     "isomorphic-fetch": "^3.0.0",

Modified: package/out/invoke/invoke.d.ts.map

Index: package/out/invoke/invoke.d.ts.map
===================================================================
--- package/out/invoke/invoke.d.ts.map
+++ package/out/invoke/invoke.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../src/invoke/invoke.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAuBzD,eAAO,MAAM,MAAM,6EAA4F,CAAC"}
\ No newline at end of file
+{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../src/invoke/invoke.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInF,OAAO,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAuBzD,eAAO,MAAM,MAAM,6EAA4F,CAAC;AAEhH,aAAK,MAAM,CAAC,IAAI,SAAS,WAAW,IAAI,CAAC,GAAG,SAAS,MAAM,IAAI,GAAG,MAAM,EACtE,IAAI,EAAE,GAAG,EACT,GAAG,GAAG,EAAE,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,KAC5B,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AAOnC,wBAAgB,UAAU,CAAC,IAAI,SAAS,WAAW,KAAK,MAAM,CAAC,IAAI,CAAC,CAEnE"}
\ No newline at end of file

Modified: package/out/realtime/realtime.d.ts.map

Index: package/out/realtime/realtime.d.ts.map
===================================================================
--- package/out/realtime/realtime.d.ts.map
+++ package/out/realtime/realtime.d.ts.map
@@ -1,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;AAYD,eAAO,MAAM,UAAU;uBARG,MAAM,WAAW,GAAG,KAAG,QAAQ,IAAI,CAAC;yBAIlC,MAAM,uBAAuB,GAAG,KAAK,GAAG,YAAY,mBAAmB,KAAG,QAAQ,IAAI,CAAC;CAOlH,CAAC"}
\ No newline at end of file
+{"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"}
\ No newline at end of file

Modified: package/CHANGELOG.md

Index: package/CHANGELOG.md
===================================================================
--- package/CHANGELOG.md
+++ package/CHANGELOG.md
@@ -1,12 +1,23 @@
 # @forge/bridge
 
-## 5.3.0-next.0-experimental-b695d2e
+## 5.3.0-next.2
 
 ### Minor Changes
 
-- 331ccdf: Add message replay option to Realtime subscriptions
+- 1a5bad3: Typed interface for invoking resolvers
 
+### Patch Changes
+
+- Updated dependencies [1a5bad3]
+  - @forge/[email protected]
+
+## 5.3.0-next.1
+
+### Patch Changes
+
+- 8dfe9b9: Adds new subscribeGlobal and publishGlobal realtime bridge methods
+
 ## 5.3.0-next.0
 
 ### Minor Changes

Modified: package/out/invoke/invoke.d.ts

Index: package/out/invoke/invoke.d.ts
===================================================================
--- package/out/invoke/invoke.d.ts
+++ package/out/invoke/invoke.d.ts
@@ -1,3 +1,7 @@
+import type { Definitions, DefArguments, DefResult } from '@forge/resolver/shared';
 import { InvokePayload } from '../types';
 export declare const invoke: <T>(functionKey: string, payload?: InvokePayload | undefined) => Promise<T>;
+declare type Invoke<Defs extends Definitions> = <Def extends keyof Defs & string>(call: Def, ...arg: DefArguments<Defs, Def>) => Promise<DefResult<Defs, Def>>;
+export declare function makeInvoke<Defs extends Definitions>(): Invoke<Defs>;
+export {};
 //# sourceMappingURL=invoke.d.ts.map
\ No newline at end of file

Modified: package/out/realtime/realtime.d.ts

Index: package/out/realtime/realtime.d.ts
===================================================================
--- package/out/realtime/realtime.d.ts
+++ package/out/realtime/realtime.d.ts
@@ -3,6 +3,8 @@
 }
 export declare const __realtime: {
     publish: (channel: string, payload: any) => Promise<void>;
     subscribe: (channel: string, callback: (payload?: any) => any, options?: SubscriptionOptions) => Promise<void>;
+    publishGlobal: (channel: string, payload: any) => Promise<void>;
+    subscribeGlobal: (channel: string, callback: (payload?: any) => any, options?: SubscriptionOptions) => Promise<void>;
 };
 //# sourceMappingURL=realtime.d.ts.map
\ No newline at end of file