@forge/bridge 4.2.0 → 4.3.0-next.0-experimental-d6acbbd

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,18 @@
1
1
  # @forge/bridge
2
2
 
3
+ ## 4.3.0-next.0-experimental-d6acbbd
4
+
5
+ ### Minor Changes
6
+
7
+ - d516a64: Update router.navigate to allow navigation to an object containing a specified target and context properties
8
+ - e771326: Adding types for userAccess field as a part of license decoupling M1
9
+
10
+ ## 4.3.0-next.0
11
+
12
+ ### Minor Changes
13
+
14
+ - e771326: Adding types for userAccess field as a part of license decoupling M1
15
+
3
16
  ## 4.2.0
4
17
 
5
18
  ### Minor Changes
@@ -1,6 +1,20 @@
1
+ import { NavigationLocation } from './types';
2
+ declare type Navigate = (location: string | NavigationLocation) => Promise<void>;
1
3
  export declare const router: {
2
- navigate: (url: string) => Promise<void>;
3
- open: (url: string) => Promise<void>;
4
+ navigate: Navigate;
5
+ open: Navigate;
4
6
  reload: () => Promise<void>;
7
+ NAVIGATION_TARGET: {
8
+ readonly CONTENT_VIEW: "contentView";
9
+ readonly CONTENT_EDIT: "contentEdit";
10
+ readonly CONTENT_LIST: "contentList";
11
+ readonly SPACE_VIEW: "spaceView";
12
+ readonly MODULE: "module";
13
+ readonly USER_PROFILE: "userProfile";
14
+ readonly DASHBOARD: "dashboard";
15
+ readonly ISSUE: "issue";
16
+ readonly PROJECT_SETTINGS_DETAILS: "projectSettingsDetails";
17
+ };
5
18
  };
19
+ export {};
6
20
  //# sourceMappingURL=router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM;oBANG,MAAM,KAAK,QAAQ,IAAI,CAAC;gBAE5B,MAAM,KAAK,QAAQ,IAAI,CAAC;kBAEtB,QAAQ,IAAI,CAAC;CAMhC,CAAC"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAI7C,aAAK,QAAQ,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AA2CzE,eAAO,MAAM,MAAM;;;kBAFC,QAAQ,IAAI,CAAC;;;;;;;;;;;;CAOhC,CAAC"}
@@ -2,12 +2,34 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.router = void 0;
4
4
  const bridge_1 = require("../bridge");
5
+ const targets_1 = require("./targets");
5
6
  const callBridge = (0, bridge_1.getCallBridge)();
6
- const navigate = async (url) => callBridge('navigate', { url, type: 'same-tab' });
7
- const open = async (url) => callBridge('navigate', { url, type: 'new-tab' });
7
+ const navigate = async (location) => {
8
+ if (typeof location === 'string') {
9
+ return callBridge('navigate', { url: location, type: 'same-tab' });
10
+ }
11
+ else {
12
+ if (!(location === null || location === void 0 ? void 0 : location.target)) {
13
+ throw new Error('target is required for navigation');
14
+ }
15
+ return callBridge('navigate', { ...location, type: 'same-tab' });
16
+ }
17
+ };
18
+ const open = async (location) => {
19
+ if (typeof location === 'string') {
20
+ return callBridge('navigate', { url: location, type: 'new-tab' });
21
+ }
22
+ else {
23
+ if (!(location === null || location === void 0 ? void 0 : location.target)) {
24
+ throw new Error('target is required for navigation');
25
+ }
26
+ return callBridge('navigate', { ...location, type: 'new-tab' });
27
+ }
28
+ };
8
29
  const reload = async () => callBridge('reload');
9
30
  exports.router = {
10
31
  navigate,
11
32
  open,
12
- reload
33
+ reload,
34
+ NAVIGATION_TARGET: targets_1.NAVIGATION_TARGET
13
35
  };
@@ -0,0 +1,12 @@
1
+ export declare const NAVIGATION_TARGET: {
2
+ readonly CONTENT_VIEW: "contentView";
3
+ readonly CONTENT_EDIT: "contentEdit";
4
+ readonly CONTENT_LIST: "contentList";
5
+ readonly SPACE_VIEW: "spaceView";
6
+ readonly MODULE: "module";
7
+ readonly USER_PROFILE: "userProfile";
8
+ readonly DASHBOARD: "dashboard";
9
+ readonly ISSUE: "issue";
10
+ readonly PROJECT_SETTINGS_DETAILS: "projectSettingsDetails";
11
+ };
12
+ //# sourceMappingURL=targets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../../src/router/targets.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB;;;;;;;;;;CAqCpB,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NAVIGATION_TARGET = void 0;
4
+ exports.NAVIGATION_TARGET = {
5
+ CONTENT_VIEW: 'contentView',
6
+ CONTENT_EDIT: 'contentEdit',
7
+ CONTENT_LIST: 'contentList',
8
+ SPACE_VIEW: 'spaceView',
9
+ MODULE: 'module',
10
+ USER_PROFILE: 'userProfile',
11
+ DASHBOARD: 'dashboard',
12
+ ISSUE: 'issue',
13
+ PROJECT_SETTINGS_DETAILS: 'projectSettingsDetails'
14
+ };
@@ -0,0 +1,49 @@
1
+ import { NAVIGATION_TARGET } from './targets';
2
+ declare type ContentView = {
3
+ target: typeof NAVIGATION_TARGET.CONTENT_VIEW;
4
+ contentId: string;
5
+ version?: string;
6
+ };
7
+ declare type ContentEdit = {
8
+ target: typeof NAVIGATION_TARGET.CONTENT_EDIT;
9
+ contentId: string;
10
+ };
11
+ declare type SpaceView = {
12
+ target: typeof NAVIGATION_TARGET.SPACE_VIEW;
13
+ spaceKey: string;
14
+ };
15
+ declare type ContentList = {
16
+ target: typeof NAVIGATION_TARGET.CONTENT_LIST;
17
+ contentType: 'page' | 'blogpost' | 'customContent';
18
+ } & ({
19
+ contentType: 'page' | 'blogpost';
20
+ spaceKey: string;
21
+ } | {
22
+ contentType: 'customContent';
23
+ moduleKey: string;
24
+ });
25
+ declare type Module = {
26
+ target: typeof NAVIGATION_TARGET.MODULE;
27
+ moduleKey: string;
28
+ spaceKey?: string;
29
+ projectKey?: string;
30
+ };
31
+ declare type UserProfile = {
32
+ target: typeof NAVIGATION_TARGET.USER_PROFILE;
33
+ accountId: string;
34
+ };
35
+ declare type Dashboard = {
36
+ target: typeof NAVIGATION_TARGET.DASHBOARD;
37
+ dashboardId: string;
38
+ };
39
+ declare type Issue = {
40
+ target: typeof NAVIGATION_TARGET.ISSUE;
41
+ issueKey: string;
42
+ };
43
+ declare type ProjectSettingsDetails = {
44
+ target: typeof NAVIGATION_TARGET.PROJECT_SETTINGS_DETAILS;
45
+ projectKey: string;
46
+ };
47
+ export declare type NavigationLocation = ContentView | ContentEdit | SpaceView | UserProfile | ContentList | Module | Dashboard | Issue | ProjectSettingsDetails;
48
+ export {};
49
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/router/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C,aAAK,WAAW,GAAG;IACjB,MAAM,EAAE,OAAO,iBAAiB,CAAC,YAAY,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,aAAK,WAAW,GAAG;IACjB,MAAM,EAAE,OAAO,iBAAiB,CAAC,YAAY,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,aAAK,SAAS,GAAG;IACf,MAAM,EAAE,OAAO,iBAAiB,CAAC,UAAU,CAAC;IAC5C,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,aAAK,WAAW,GAAG;IACjB,MAAM,EAAE,OAAO,iBAAiB,CAAC,YAAY,CAAC;IAC9C,WAAW,EAAE,MAAM,GAAG,UAAU,GAAG,eAAe,CAAC;CACpD,GAAG,CACA;IACE,WAAW,EAAE,MAAM,GAAG,UAAU,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,GACD;IACE,WAAW,EAAE,eAAe,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB,CACJ,CAAC;AAGF,aAAK,MAAM,GAAG;IACZ,MAAM,EAAE,OAAO,iBAAiB,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,aAAK,WAAW,GAAG;IACjB,MAAM,EAAE,OAAO,iBAAiB,CAAC,YAAY,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,aAAK,SAAS,GAAG;IACf,MAAM,EAAE,OAAO,iBAAiB,CAAC,SAAS,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,aAAK,KAAK,GAAG;IACX,MAAM,EAAE,OAAO,iBAAiB,CAAC,KAAK,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,aAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,OAAO,iBAAiB,CAAC,wBAAwB,CAAC;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,kBAAkB,GAC1B,WAAW,GACX,WAAW,GACX,SAAS,GACT,WAAW,GACX,WAAW,GACX,MAAM,GACN,SAAS,GACT,KAAK,GACL,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/out/types.d.ts CHANGED
@@ -16,6 +16,9 @@ export declare enum ExtensionEnvironment {
16
16
  STAGING = "STAGING",
17
17
  PRODUCTION = "PRODUCTION"
18
18
  }
19
+ declare type UserAccessDetails = {
20
+ hasAccess: boolean;
21
+ };
19
22
  export declare type EnvironmentType = keyof typeof ExtensionEnvironment;
20
23
  export interface FullContext {
21
24
  accountId?: string;
@@ -32,6 +35,7 @@ export interface FullContext {
32
35
  timezone: string;
33
36
  theme?: Partial<ThemeState> | null;
34
37
  surfaceColor?: string | null;
38
+ userAccess?: UserAccessDetails;
35
39
  }
36
40
  interface ExtensionData {
37
41
  [k: string]: any;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,oBAAY,aAAa,GAAG;KACzB,GAAG,IAAI,MAAM,GAAG,MAAM,GAAG,GAAG;CAC9B,CAAC;AAEF,oBAAY,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AAExD,oBAAY,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;AAEhD,oBAAY,oBAAoB;IAC9B,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;CAC1B;AAED,oBAAY,eAAe,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAEhE,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,aAAa,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,wBAAwB,CAAC;IACjC,SAAS,EAAE,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MAAM,CAAC;CACd;AAED,oBAAY,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bridge",
3
- "version": "4.2.0",
3
+ "version": "4.3.0-next.0-experimental-d6acbbd",
4
4
  "description": "Forge bridge API for custom UI apps",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",