@forge/bridge 5.3.0-next.0-experimental-b695d2e → 5.3.0-next.2

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,10 +1,21 @@
1
1
  # @forge/bridge
2
2
 
3
- ## 5.3.0-next.0-experimental-b695d2e
3
+ ## 5.3.0-next.2
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - 331ccdf: Add message replay option to Realtime subscriptions
7
+ - 1a5bad3: Typed interface for invoking resolvers
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [1a5bad3]
12
+ - @forge/resolver@1.7.0-next.1
13
+
14
+ ## 5.3.0-next.1
15
+
16
+ ### Patch Changes
17
+
18
+ - 8dfe9b9: Adds new subscribeGlobal and publishGlobal realtime bridge methods
8
19
 
9
20
  ## 5.3.0-next.0
10
21
 
@@ -1,3 +1,7 @@
1
+ import type { Definitions, DefArguments, DefResult } from '@forge/resolver/shared';
1
2
  import { InvokePayload } from '../types';
2
3
  export declare const invoke: <T>(functionKey: string, payload?: InvokePayload | undefined) => Promise<T>;
4
+ declare type Invoke<Defs extends Definitions> = <Def extends keyof Defs & string>(call: Def, ...arg: DefArguments<Defs, Def>) => Promise<DefResult<Defs, Def>>;
5
+ export declare function makeInvoke<Defs extends Definitions>(): Invoke<Defs>;
6
+ export {};
3
7
  //# sourceMappingURL=invoke.d.ts.map
@@ -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"}
1
+ {"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"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.invoke = void 0;
3
+ exports.makeInvoke = exports.invoke = void 0;
4
4
  const bridge_1 = require("../bridge");
5
5
  const errors_1 = require("../errors");
6
6
  const utils_1 = require("../utils");
@@ -20,3 +20,7 @@ const _invoke = (functionKey, payload) => {
20
20
  return callBridge('invoke', { functionKey, payload });
21
21
  };
22
22
  exports.invoke = (0, utils_1.withRateLimiter)(_invoke, 500, 1000 * 25, 'Resolver calls are rate limited at 500req/25s');
23
+ function makeInvoke() {
24
+ return exports.invoke;
25
+ }
26
+ exports.makeInvoke = makeInvoke;
@@ -4,5 +4,7 @@ export interface SubscriptionOptions {
4
4
  export declare const __realtime: {
5
5
  publish: (channel: string, payload: any) => Promise<void>;
6
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>;
7
9
  };
8
10
  //# 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;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"}
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"}
@@ -9,7 +9,15 @@ const publish = (channel, payload) => {
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 });
14
+ };
15
+ const subscribeGlobal = (channel, callback, options) => {
16
+ return callBridge('subscribeRealtimeChannel', { channelName: channel, onEvent: callback, options, isGlobal: true });
17
+ };
12
18
  exports.__realtime = {
13
19
  publish,
14
- subscribe
20
+ subscribe,
21
+ publishGlobal,
22
+ subscribeGlobal
15
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bridge",
3
- "version": "5.3.0-next.0-experimental-b695d2e",
3
+ "version": "5.3.0-next.2",
4
4
  "description": "Forge bridge API for custom UI apps",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -15,7 +15,8 @@
15
15
  "dependencies": {
16
16
  "@atlaskit/tokens": "^1.58.0",
17
17
  "@types/history": "^4.7.11",
18
- "@forge/i18n": "0.0.7"
18
+ "@forge/i18n": "0.0.7",
19
+ "@forge/resolver": "1.7.0-next.1"
19
20
  },
20
21
  "devDependencies": {
21
22
  "history": "5.3.0",