@crowdstrike/foundry-js 0.20.0 → 0.21.0

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/README.md CHANGED
@@ -169,36 +169,23 @@ To call API Integration, App should be initially provisioned, and configuration
169
169
 
170
170
  ### Navigation utilities
171
171
 
172
- As Page or UI extension will run inside sandboxed iframe, clicking links or navigating will be limited.
173
- When browser URL changes, Foundry UI Page will receive that data via iframe hash change event.
174
- You can listen to hash change event and process your app internal navigation.
172
+ As the Page or UI extension will run inside a sandboxed iframe, the `navigateTo` method must be used to change the url of the parent context (Falcon Console).
175
173
 
176
- ```javascript
177
- window.addEventListener("hashchange", (event) => {
178
- let rawHash = new URL(event.newURL).hash;
179
-
180
- const path = rawHash.substring(1);
181
- }, false);
182
-
183
- // to read initial hash when your app loads:
184
- const initialPath = document.location.hash.substring(1);
185
- ```
186
-
187
- If you have links in your application, that point to the internal URLs of your application (for example navigation from /page-1 to /page-2) -
188
- you can add `data-` attribute to those links, and add onClick handler, that will handle navigation outside of iframe and will update iframe hash.
174
+ To open an external url (in a new tab):
189
175
 
190
176
  ```javascript
191
- // find all links with data attribute - `data-internal-link`
192
- document.querySelector('[data-internal-link]')
193
- .addEventListener('click', (event) => falcon.navigation.onClick(event, '_self', 'internal'));
177
+ falcon.navigation.navigateTo({
178
+ path: 'https://www.github.com',
179
+ });
194
180
  ```
195
181
 
196
- If you have external links that you want to navigate to, for example www.crowdstrike.com, you can add `data-` attribute to identify those:
182
+ To navigate to a new url within Falcon Console:
197
183
 
198
184
  ```javascript
199
- // find all links with data attribute - `data-external-link`
200
- document.querySelector('[data-external-link]')
201
- .addEventListener('click', (event) => falcon.navigation.onClick(event));
185
+ falcon.navigation.navigateTo({
186
+ path: '/login',
187
+ type: "falcon",
188
+ });
202
189
  ```
203
190
 
204
191
  ### Modal utility
package/dist/index.js CHANGED
@@ -3265,6 +3265,9 @@ class Navigation {
3265
3265
  },
3266
3266
  });
3267
3267
  }
3268
+ /**
3269
+ * @deprecated Use navigateTo directly
3270
+ */
3268
3271
  async onClick(event, defaultTarget = '_self', defaultType = 'falcon') {
3269
3272
  if (!(event instanceof Event)) {
3270
3273
  throw Error('"event" property should be subclass of Event');
@@ -13,6 +13,9 @@ export declare class Navigation<DATA extends LocalData = LocalData> {
13
13
  ctrlKey?: boolean;
14
14
  shiftKey?: boolean;
15
15
  }): Promise<void>;
16
+ /**
17
+ * @deprecated Use navigateTo directly
18
+ */
16
19
  onClick(event: MouseEvent | KeyboardEvent, defaultTarget?: (typeof ALLOWED_TARGETS)[number], defaultType?: NavigateToRequestMessage['payload']['type']): Promise<void>;
17
20
  }
18
21
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdstrike/foundry-js",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "foundry-js is the JavaScript SDK for authoring UI Extensions for CrowdStrike's Foundry platform.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,21 +29,6 @@
29
29
  "files": [
30
30
  "dist"
31
31
  ],
32
- "scripts": {
33
- "_build": "concurrently 'npm:build:*'",
34
- "_start": "concurrently 'npm:watch:*'",
35
- "build": "rollup -c ./config/rollup.config.ts --configPlugin typescript",
36
- "api-docs": "typedoc",
37
- "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
38
- "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
39
- "lint:js": "eslint . --cache",
40
- "lint:js:fix": "eslint . --fix",
41
- "lint:types": "tsc --noEmit",
42
- "prepublishOnly": "yarn build",
43
- "release": "changeset publish",
44
- "start": "yarn build --watch",
45
- "test": "vitest"
46
- },
47
32
  "dependencies": {
48
33
  "emittery": "1.2.0",
49
34
  "typescript-memoize": "1.1.1",
@@ -56,27 +41,30 @@
56
41
  "@rollup/plugin-node-resolve": "16.0.1",
57
42
  "@rollup/plugin-replace": "6.0.2",
58
43
  "@rollup/plugin-typescript": "12.1.4",
44
+ "@types/node": "25.0.3",
59
45
  "@typescript-eslint/eslint-plugin": "8.45.0",
60
46
  "@typescript-eslint/parser": "8.45.0",
61
47
  "concurrently": "9.2.1",
62
- "eslint": "9.36.0",
63
- "eslint-config-prettier": "10.1.8",
64
- "eslint-plugin-import": "2.32.0",
65
- "eslint-plugin-prettier": "5.5.4",
66
- "eslint-plugin-sort-imports-es6-autofix": "0.6.0",
67
- "happy-dom": "20.0.0",
68
- "jsdom": "27.0.0",
48
+ "eslint": "9.39.1",
49
+ "happy-dom": "20.0.2",
69
50
  "p-event": "7.0.0",
70
- "prettier": "3.6.2",
71
- "rollup": "4.52.3",
51
+ "rollup": "4.54.0",
72
52
  "tslib": "2.8.1",
73
- "typedoc": "0.28.13",
74
- "typedoc-plugin-missing-exports": "4.1.0",
75
- "typedoc-plugin-rename-defaults": "0.7.3",
76
- "typescript": "5.9.2",
77
- "vitest": "3.2.4"
53
+ "typescript": "5.9.3",
54
+ "vitest": "4.0.13"
78
55
  },
79
56
  "engines": {
80
57
  "node": ">=22"
58
+ },
59
+ "scripts": {
60
+ "build": "rollup -c ./config/rollup.config.ts --configPlugin typescript",
61
+ "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
62
+ "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
63
+ "lint:js": "eslint . --cache",
64
+ "lint:js:fix": "eslint . --fix",
65
+ "lint:types": "tsc --noEmit",
66
+ "release": "changeset publish",
67
+ "start": "pnpm build --watch",
68
+ "test": "vitest"
81
69
  }
82
- }
70
+ }