@forge/dashboards-bridge 1.1.3-next.0 → 1.2.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,5 +1,17 @@
1
1
  # @forge/dashboards-bridge
2
2
 
3
+ ## 1.2.0-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - fca9900: Add useFilter hook and export bridge types
8
+
9
+ ## 1.2.0-next.1
10
+
11
+ ### Minor Changes
12
+
13
+ - d2d8203: Add dashboard filter bridge methods
14
+
3
15
  ## 1.1.3-next.0
4
16
 
5
17
  ### Patch Changes
@@ -0,0 +1,7 @@
1
+ export declare const getFilterBridge: () => Promise<{
2
+ onSave: (onSave: import("./types").FilterOnSave) => void;
3
+ onProductSave: (onProductSave: import("./types").FilterOnProductSave) => void;
4
+ updateOverrides: (overrides: import("./types").FilterOverride) => import("./types").FilterOverride;
5
+ onOverrideClear: (onOverrideClear: import("./types").OnOverrideClear) => void;
6
+ }>;
7
+ //# sourceMappingURL=get-filter-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-filter-bridge.d.ts","sourceRoot":"","sources":["../../src/filters/get-filter-bridge.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;EAAiD,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFilterBridge = void 0;
4
+ const bridge_1 = require("../bridge");
5
+ const getFilterBridge = () => (0, bridge_1.getCallBridge)()('getDashboardFilterApi');
6
+ exports.getFilterBridge = getFilterBridge;
@@ -0,0 +1,12 @@
1
+ import { onProductSave } from './onProductSave';
2
+ import { onSave } from './onSave';
3
+ import { updateOverrides } from './updateOverrides';
4
+ import { onOverrideClear } from './onOverrideClear';
5
+ export declare const filter: {
6
+ onProductSave: typeof onProductSave;
7
+ onSave: typeof onSave;
8
+ updateOverrides: typeof updateOverrides;
9
+ onOverrideClear: typeof onOverrideClear;
10
+ };
11
+ export type { FilterPayload, FilterGroupPayload, FilterDimension, Filter, FilterGroup, FilterOverride, FilterOnProductSave, FilterOnSave, OnOverrideClear } from './types';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,MAAM;;;;;CAKlB,CAAC;AAEF,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,MAAM,EACN,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,eAAe,EAChB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filter = void 0;
4
+ const onProductSave_1 = require("./onProductSave");
5
+ const onSave_1 = require("./onSave");
6
+ const updateOverrides_1 = require("./updateOverrides");
7
+ const onOverrideClear_1 = require("./onOverrideClear");
8
+ exports.filter = {
9
+ onProductSave: onProductSave_1.onProductSave,
10
+ onSave: onSave_1.onSave,
11
+ updateOverrides: updateOverrides_1.updateOverrides,
12
+ onOverrideClear: onOverrideClear_1.onOverrideClear
13
+ };
@@ -0,0 +1,3 @@
1
+ import { OnOverrideClear } from './types';
2
+ export declare function onOverrideClear(onOverrideClear: OnOverrideClear): Promise<void>;
3
+ //# sourceMappingURL=onOverrideClear.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onOverrideClear.d.ts","sourceRoot":"","sources":["../../src/filters/onOverrideClear.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAc1C,wBAAsB,eAAe,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAOrF"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onOverrideClear = onOverrideClear;
4
+ const errors_1 = require("../errors");
5
+ const get_filter_bridge_1 = require("./get-filter-bridge");
6
+ async function onOverrideClear(onOverrideClear) {
7
+ try {
8
+ const bridge = await (0, get_filter_bridge_1.getFilterBridge)();
9
+ bridge.onOverrideClear(onOverrideClear);
10
+ }
11
+ catch (err) {
12
+ throw new errors_1.BridgeAPIError('Unable to set filter.onOverrideClear: ' + err.message);
13
+ }
14
+ }
@@ -0,0 +1,3 @@
1
+ import { FilterOnProductSave } from './types';
2
+ export declare function onProductSave(onProductSave: FilterOnProductSave): Promise<void>;
3
+ //# sourceMappingURL=onProductSave.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onProductSave.d.ts","sourceRoot":"","sources":["../../src/filters/onProductSave.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAkC9C,wBAAsB,aAAa,CAAC,aAAa,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAOrF"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onProductSave = onProductSave;
4
+ const errors_1 = require("../errors");
5
+ const get_filter_bridge_1 = require("./get-filter-bridge");
6
+ async function onProductSave(onProductSave) {
7
+ try {
8
+ const bridge = await (0, get_filter_bridge_1.getFilterBridge)();
9
+ bridge.onProductSave(onProductSave);
10
+ }
11
+ catch (err) {
12
+ throw new errors_1.BridgeAPIError('Unable to set filter.onProductSave: ' + err.message);
13
+ }
14
+ }
@@ -0,0 +1,3 @@
1
+ import { FilterOnSave } from './types';
2
+ export declare function onSave(onSave: FilterOnSave): Promise<void>;
3
+ //# sourceMappingURL=onSave.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onSave.d.ts","sourceRoot":"","sources":["../../src/filters/onSave.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAavC,wBAAsB,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhE"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onSave = onSave;
4
+ const errors_1 = require("../errors");
5
+ const get_filter_bridge_1 = require("./get-filter-bridge");
6
+ async function onSave(onSave) {
7
+ try {
8
+ const bridge = await (0, get_filter_bridge_1.getFilterBridge)();
9
+ bridge.onSave(onSave);
10
+ }
11
+ catch (err) {
12
+ throw new errors_1.BridgeAPIError('Unable to set filter.onSave: ' + err.message);
13
+ }
14
+ }
@@ -0,0 +1,22 @@
1
+ import type { Filter, FilterDimension, FilterGroup } from '../widgets/types';
2
+ export type { Filter, FilterDimension, FilterGroup };
3
+ export type FilterPayload = {
4
+ id?: string;
5
+ label?: string | null;
6
+ comparison: string;
7
+ defaultValues?: Array<string | null> | null;
8
+ dimensions: string[];
9
+ };
10
+ export type FilterGroupPayload = {
11
+ id?: string;
12
+ operator: 'AND' | 'OR';
13
+ groups: FilterPayload[];
14
+ };
15
+ export type FilterOverride = {
16
+ values?: (string | null)[];
17
+ comparison?: string;
18
+ };
19
+ export type FilterOnProductSave = (filterGroupPayload: FilterGroupPayload | undefined) => Promise<FilterGroupPayload | null | undefined>;
20
+ export type FilterOnSave = (filterGroup: FilterGroup) => Promise<void>;
21
+ export type OnOverrideClear = () => Promise<void>;
22
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/filters/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE7E,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAK1B,EAAE,CAAC,EAAE,MAAM,CAAC;IAIZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAItB,UAAU,EAAE,MAAM,CAAC;IAInB,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAI5C,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAQF,MAAM,MAAM,kBAAkB,GAAG;IAK/B,EAAE,CAAC,EAAE,MAAM,CAAC;IAIZ,QAAQ,EAAE,KAAK,GAAG,IAAI,CAAC;IAIvB,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB,CAAC;AAKF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAChC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,KAC/C,OAAO,CAAC,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,CAAC,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEvE,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import type { FilterOverride } from './types';
2
+ export declare function updateOverrides(overrides: FilterOverride): Promise<FilterOverride>;
3
+ //# sourceMappingURL=updateOverrides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateOverrides.d.ts","sourceRoot":"","sources":["../../src/filters/updateOverrides.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAc9C,wBAAsB,eAAe,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAOxF"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateOverrides = updateOverrides;
4
+ const errors_1 = require("../errors");
5
+ const get_filter_bridge_1 = require("./get-filter-bridge");
6
+ async function updateOverrides(overrides) {
7
+ try {
8
+ const bridge = await (0, get_filter_bridge_1.getFilterBridge)();
9
+ return bridge.updateOverrides(overrides);
10
+ }
11
+ catch (err) {
12
+ throw new errors_1.BridgeAPIError('Unable to update overrides: ' + err.message);
13
+ }
14
+ }
package/out/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './widgets';
2
+ export { filter } from './filters';
3
+ export type { FilterPayload, FilterGroupPayload, FilterOverride, OnOverrideClear, FilterOnSave, FilterOnProductSave } from './filters';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,mBAAmB,EACpB,MAAM,WAAW,CAAC"}
package/out/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filter = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  tslib_1.__exportStar(require("./widgets"), exports);
6
+ var filters_1 = require("./filters");
7
+ Object.defineProperty(exports, "filter", { enumerable: true, get: function () { return filters_1.filter; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/dashboards-bridge",
3
- "version": "1.1.3-next.0",
3
+ "version": "1.2.0-next.2",
4
4
  "description": "Forge Dashboards custom bridge API",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",