@northern.tech/store 0.39.0 → 0.40.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/dist/api/general-api.cjs +1 -1
- package/dist/api/general-api.js +1 -1
- package/dist/appSlice/index.js +1 -1
- package/dist/auth.cjs +1 -1
- package/dist/auth.js +1 -1
- package/dist/commonConstants.cjs +1 -1
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +1 -1
- package/dist/commonSelectors.js +1 -1
- package/dist/constants-CNZ5L0A0.cjs +957 -0
- package/dist/constants-CNZ5L0A0.cjs.map +1 -0
- package/dist/constants-Cj2kp3Iy.js +676 -0
- package/dist/constants-Cj2kp3Iy.js.map +1 -0
- package/dist/{constants-BwKiHHaB.d.ts → constants-D9o0Cnk_.d.cts} +2 -1
- package/dist/{constants-BwKiHHaB.d.cts → constants-D9o0Cnk_.d.ts} +2 -1
- package/dist/constants.cjs +48 -718
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -672
- package/dist/deploymentsSlice/constants.cjs +1 -1
- package/dist/deploymentsSlice/constants.d.cts +1 -1
- package/dist/deploymentsSlice/constants.d.ts +1 -1
- package/dist/deploymentsSlice/constants.js +1 -1
- package/dist/deploymentsSlice/index.cjs +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/mocks.cjs +1 -1
- package/dist/deploymentsSlice/mocks.cjs.map +1 -1
- package/dist/deploymentsSlice/mocks.d.cts +1 -1
- package/dist/deploymentsSlice/mocks.d.ts +1 -1
- package/dist/deploymentsSlice/mocks.js +1 -1
- package/dist/deploymentsSlice/mocks.js.map +1 -1
- package/dist/deploymentsSlice/selectors.cjs +1 -1
- package/dist/deploymentsSlice/selectors.js +1 -1
- package/dist/devicesSlice/constants.cjs +1 -1
- package/dist/devicesSlice/constants.js +1 -1
- package/dist/devicesSlice/index.js +1 -1
- package/dist/devicesSlice/mocks.js +1 -1
- package/dist/devicesSlice/selectors.cjs +1 -1
- package/dist/devicesSlice/selectors.js +1 -1
- package/dist/liststatehook.cjs +2 -1
- package/dist/liststatehook.cjs.map +1 -1
- package/dist/liststatehook.js +2 -1
- package/dist/liststatehook.js.map +1 -1
- package/dist/locationutils.cjs +1 -1
- package/dist/locationutils.js +1 -1
- package/dist/monitorSlice/index.js +1 -1
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/thunks.cjs +1 -1
- package/dist/monitorSlice/thunks.js +1 -1
- package/dist/organizationSlice/constants.cjs +1 -1
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.cjs +1 -1
- package/dist/organizationSlice/index.js +1 -1
- package/dist/organizationSlice/mocks.js +1 -1
- package/dist/organizationSlice/selectors.cjs +1 -1
- package/dist/organizationSlice/selectors.js +1 -1
- package/dist/releasesSlice/index.js +1 -1
- package/dist/releasesSlice/mocks.js +1 -1
- package/dist/releasesSlice/thunks.cjs +6 -4
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.js +6 -4
- package/dist/releasesSlice/thunks.js.map +1 -1
- package/dist/sockethook.cjs +1 -1
- package/dist/sockethook.js +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.js +1 -1
- package/dist/storehooks.cjs +1 -1
- package/dist/storehooks.js +1 -1
- package/dist/thunks.cjs +46 -40
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +46 -40
- package/dist/thunks.js.map +1 -1
- package/dist/usersSlice/constants.cjs +1 -1
- package/dist/usersSlice/constants.js +1 -1
- package/dist/usersSlice/index.cjs +1 -1
- package/dist/usersSlice/index.js +1 -1
- package/dist/usersSlice/mocks.js +1 -1
- package/dist/usersSlice/selectors.cjs +1 -1
- package/dist/usersSlice/selectors.js +1 -1
- package/dist/utils.cjs +11 -21
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +11 -21
- package/dist/utils.js.map +1 -1
- package/package.json +3 -3
- package/dist/constants.cjs.map +0 -1
- package/dist/constants.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("../constants.cjs");
|
|
2
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
3
3
|
exports.DEFAULT_PENDING_INPROGRESS_COUNT = require_constants.DEFAULT_PENDING_INPROGRESS_COUNT;
|
|
4
4
|
exports.DEPLOYMENT_ROUTES = require_constants.DEPLOYMENT_ROUTES;
|
|
5
5
|
exports.DEPLOYMENT_STATES = require_constants.DEPLOYMENT_STATES;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as DeploymentSubstateMapping, c as deploymentPrototype, d as deploymentSubstates, f as installationSubstatesMap, i as DEPLOYMENT_TYPES, l as deploymentStatesToSubstates, m as pauseMap, n as DEPLOYMENT_ROUTES, o as defaultStats, p as listDefaultsByState, r as DEPLOYMENT_STATES, s as deploymentDisplayStates, t as DEFAULT_PENDING_INPROGRESS_COUNT, u as deploymentStatesToSubstatesWithSkipped } from "../constants-
|
|
1
|
+
import { a as DeploymentSubstateMapping, c as deploymentPrototype, d as deploymentSubstates, f as installationSubstatesMap, i as DEPLOYMENT_TYPES, l as deploymentStatesToSubstates, m as pauseMap, n as DEPLOYMENT_ROUTES, o as defaultStats, p as listDefaultsByState, r as DEPLOYMENT_STATES, s as deploymentDisplayStates, t as DEFAULT_PENDING_INPROGRESS_COUNT, u as deploymentStatesToSubstatesWithSkipped } from "../constants-D9o0Cnk_.cjs";
|
|
2
2
|
export { DEFAULT_PENDING_INPROGRESS_COUNT, DEPLOYMENT_ROUTES, DEPLOYMENT_STATES, DEPLOYMENT_TYPES, DeploymentSubstateMapping, defaultStats, deploymentDisplayStates, deploymentPrototype, deploymentStatesToSubstates, deploymentStatesToSubstatesWithSkipped, deploymentSubstates, installationSubstatesMap, listDefaultsByState, pauseMap };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as DeploymentSubstateMapping, c as deploymentPrototype, d as deploymentSubstates, f as installationSubstatesMap, i as DEPLOYMENT_TYPES, l as deploymentStatesToSubstates, m as pauseMap, n as DEPLOYMENT_ROUTES, o as defaultStats, p as listDefaultsByState, r as DEPLOYMENT_STATES, s as deploymentDisplayStates, t as DEFAULT_PENDING_INPROGRESS_COUNT, u as deploymentStatesToSubstatesWithSkipped } from "../constants-
|
|
1
|
+
import { a as DeploymentSubstateMapping, c as deploymentPrototype, d as deploymentSubstates, f as installationSubstatesMap, i as DEPLOYMENT_TYPES, l as deploymentStatesToSubstates, m as pauseMap, n as DEPLOYMENT_ROUTES, o as defaultStats, p as listDefaultsByState, r as DEPLOYMENT_STATES, s as deploymentDisplayStates, t as DEFAULT_PENDING_INPROGRESS_COUNT, u as deploymentStatesToSubstatesWithSkipped } from "../constants-D9o0Cnk_.js";
|
|
2
2
|
export { DEFAULT_PENDING_INPROGRESS_COUNT, DEPLOYMENT_ROUTES, DEPLOYMENT_STATES, DEPLOYMENT_TYPES, DeploymentSubstateMapping, defaultStats, deploymentDisplayStates, deploymentPrototype, deploymentStatesToSubstates, deploymentStatesToSubstatesWithSkipped, deploymentSubstates, installationSubstatesMap, listDefaultsByState, pauseMap };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as deploymentSubstates, Et as pauseMap, St as deploymentStatesToSubstatesWithSkipped, Tt as listDefaultsByState, _t as DEPLOYMENT_TYPES, bt as deploymentPrototype, gt as DEPLOYMENT_STATES, ht as DEPLOYMENT_ROUTES, mt as DEFAULT_PENDING_INPROGRESS_COUNT, vt as defaultStats, wt as installationSubstatesMap, xt as deploymentStatesToSubstates, yt as deploymentDisplayStates } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
export { DEFAULT_PENDING_INPROGRESS_COUNT, DEPLOYMENT_ROUTES, DEPLOYMENT_STATES, DEPLOYMENT_TYPES, defaultStats, deploymentDisplayStates, deploymentPrototype, deploymentStatesToSubstates, deploymentStatesToSubstatesWithSkipped, deploymentSubstates, installationSubstatesMap, listDefaultsByState, pauseMap };
|
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_constants = require("../constants.cjs");
|
|
5
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
6
6
|
let _reduxjs_toolkit = require("@reduxjs/toolkit");
|
|
7
7
|
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
8
8
|
//#region src/deploymentsSlice/index.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as limitDefault, bt as deploymentPrototype, gt as DEPLOYMENT_STATES, ht as DEPLOYMENT_ROUTES, l as DEVICE_LIST_DEFAULTS } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { createSlice } from "@reduxjs/toolkit";
|
|
3
3
|
//#region src/deploymentsSlice/index.ts
|
|
4
4
|
const sliceName = "deployments";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.cjs","names":["initialState"],"sources":["../../src/deploymentsSlice/mocks.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { initialState } from './index';\n\nexport const mockState = {\n ...initialState,\n byId: {\n d1: {\n id: 'd1',\n name: 'test deployment',\n artifact_name: 'r1',\n artifacts: ['123'],\n created: '2019-01-01T12:30:00.000Z',\n device_count: 1,\n devices: {\n a1: {\n attributes: {},\n id: 'a1',\n image: { size: 123 },\n status: 'installing'\n }\n },\n filter: undefined,\n group: undefined,\n statistics: {\n status: {\n downloading: 0,\n decommissioned: 0,\n failure: 0,\n installing: 1,\n noartifact: 0,\n pending: 0,\n rebooting: 0,\n success: 0,\n 'already-installed': 0\n },\n total_size: 1234\n }\n },\n d2: {\n id: 'd2',\n name: 'test deployment 2',\n artifact_name: 'r1',\n artifacts: ['123'],\n created: '2019-01-01T12:25:00.000Z',\n device_count: 1,\n devices: {\n b1: {\n attributes: {},\n id: 'b1',\n status: 'pending'\n }\n },\n filter: undefined,\n group: undefined,\n statistics: {\n status: {\n downloading: 0,\n decommissioned: 0,\n failure: 0,\n installing: 0,\n noartifact: 0,\n pending: 1,\n rebooting: 0,\n success: 0,\n 'already-installed': 0\n }\n }\n },\n d3: {\n id: 'd3',\n name: 'Test',\n phases: [\n { id: '0', batch_size: 2, device_count: 2 },\n { id: '1', start_ts: '2019-02-04T11:45:10.002Z', batch_size: 3, device_count: 3 },\n { id: '2', start_ts: '2019-02-05T11:45:10.002Z', batch_size: 5, device_count: 5 },\n { id: '3', start_ts: '2019-02-06T11:45:10.002Z', batch_size: 5, device_count: 5 },\n { id: '4', start_ts: '2019-02-21T11:45:10.002Z', batch_size: 5, device_count: 0 }\n ],\n max_devices: 0,\n created: '2019-01-31T12:59:30.020Z',\n devices: {},\n filter: undefined,\n group: undefined,\n stats: {\n pending: 3,\n decommissioned: 0,\n failure: 23,\n pause_before_committing: 0,\n pause_before_rebooting: 0,\n installing: 0,\n rebooting: 0,\n 'already-installed': 0,\n pause_before_installing: 0,\n downloading: 0,\n success: 6,\n aborted: 0,\n noartifact: 0\n },\n statistics: { total_size: '1234' },\n status: 'inprogress',\n active: true,\n device_count: 100,\n retries:
|
|
1
|
+
{"version":3,"file":"mocks.cjs","names":["initialState"],"sources":["../../src/deploymentsSlice/mocks.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { initialState } from './index';\n\nexport const mockState = {\n ...initialState,\n byId: {\n d1: {\n id: 'd1',\n name: 'test deployment',\n artifact_name: 'r1',\n artifacts: ['123'],\n created: '2019-01-01T12:30:00.000Z',\n device_count: 1,\n devices: {\n a1: {\n attributes: {},\n id: 'a1',\n image: { size: 123 },\n status: 'installing'\n }\n },\n filter: undefined,\n group: undefined,\n statistics: {\n status: {\n downloading: 0,\n decommissioned: 0,\n failure: 0,\n installing: 1,\n noartifact: 0,\n pending: 0,\n rebooting: 0,\n success: 0,\n 'already-installed': 0\n },\n total_size: 1234\n }\n },\n d2: {\n id: 'd2',\n name: 'test deployment 2',\n artifact_name: 'r1',\n artifacts: ['123'],\n created: '2019-01-01T12:25:00.000Z',\n device_count: 1,\n devices: {\n b1: {\n attributes: {},\n id: 'b1',\n status: 'pending'\n }\n },\n filter: undefined,\n group: undefined,\n statistics: {\n status: {\n downloading: 0,\n decommissioned: 0,\n failure: 0,\n installing: 0,\n noartifact: 0,\n pending: 1,\n rebooting: 0,\n success: 0,\n 'already-installed': 0\n }\n }\n },\n d3: {\n id: 'd3',\n name: 'Test',\n phases: [\n { id: '0', batch_size: 2, device_count: 2 },\n { id: '1', start_ts: '2019-02-04T11:45:10.002Z', batch_size: 3, device_count: 3 },\n { id: '2', start_ts: '2019-02-05T11:45:10.002Z', batch_size: 5, device_count: 5 },\n { id: '3', start_ts: '2019-02-06T11:45:10.002Z', batch_size: 5, device_count: 5 },\n { id: '4', start_ts: '2019-02-21T11:45:10.002Z', batch_size: 5, device_count: 0 }\n ],\n max_devices: 0,\n created: '2019-01-31T12:59:30.020Z',\n devices: {},\n filter: undefined,\n group: undefined,\n stats: {\n pending: 3,\n decommissioned: 0,\n failure: 23,\n pause_before_committing: 0,\n pause_before_rebooting: 0,\n installing: 0,\n rebooting: 0,\n 'already-installed': 0,\n pause_before_installing: 0,\n downloading: 0,\n success: 6,\n aborted: 0,\n noartifact: 0\n },\n statistics: { total_size: '1234' },\n status: 'inprogress',\n active: true,\n device_count: 100,\n retries: 0,\n type: 'software'\n }\n },\n byStatus: {\n finished: { deploymentIds: ['d1'], total: 1 },\n inprogress: { deploymentIds: ['d3'], total: 1 },\n pending: { deploymentIds: ['d2'], total: 1 },\n scheduled: { deploymentIds: ['d2'], total: 1 }\n },\n deploymentDeviceLimit: 500,\n selectedDeviceIds: [],\n selectionState: {\n finished: {\n ...initialState.selectionState.finished,\n selection: ['d1'],\n endDate: undefined,\n search: '',\n total: 1,\n type: ''\n },\n inprogress: { ...initialState.selectionState.inprogress, selection: ['d1'], total: 1 },\n pending: { ...initialState.selectionState.pending, selection: ['d2'], total: 1 },\n scheduled: { ...initialState.selectionState.scheduled, selection: ['d2'], total: 1 },\n general: {\n state: 'active',\n showCreationDialog: false,\n showReportDialog: false,\n reportType: null\n },\n selectedId: 'd1'\n }\n};\n"],"mappings":";;;AAeA,MAAa,YAAY;CACvB,GAAGA,+BAAAA;CACH,MAAM;EACJ,IAAI;GACF,IAAI;GACJ,MAAM;GACN,eAAe;GACf,WAAW,CAAC,KAAK;GACjB,SAAS;GACT,cAAc;GACd,SAAS,EACP,IAAI;IACF,YAAY,CAAC;IACb,IAAI;IACJ,OAAO,EAAE,MAAM,IAAI;IACnB,QAAQ;GACV,EACF;GACA,QAAQ,KAAA;GACR,OAAO,KAAA;GACP,YAAY;IACV,QAAQ;KACN,aAAa;KACb,gBAAgB;KAChB,SAAS;KACT,YAAY;KACZ,YAAY;KACZ,SAAS;KACT,WAAW;KACX,SAAS;KACT,qBAAqB;IACvB;IACA,YAAY;GACd;EACF;EACA,IAAI;GACF,IAAI;GACJ,MAAM;GACN,eAAe;GACf,WAAW,CAAC,KAAK;GACjB,SAAS;GACT,cAAc;GACd,SAAS,EACP,IAAI;IACF,YAAY,CAAC;IACb,IAAI;IACJ,QAAQ;GACV,EACF;GACA,QAAQ,KAAA;GACR,OAAO,KAAA;GACP,YAAY,EACV,QAAQ;IACN,aAAa;IACb,gBAAgB;IAChB,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,WAAW;IACX,SAAS;IACT,qBAAqB;GACvB,EACF;EACF;EACA,IAAI;GACF,IAAI;GACJ,MAAM;GACN,QAAQ;IACN;KAAE,IAAI;KAAK,YAAY;KAAG,cAAc;IAAE;IAC1C;KAAE,IAAI;KAAK,UAAU;KAA4B,YAAY;KAAG,cAAc;IAAE;IAChF;KAAE,IAAI;KAAK,UAAU;KAA4B,YAAY;KAAG,cAAc;IAAE;IAChF;KAAE,IAAI;KAAK,UAAU;KAA4B,YAAY;KAAG,cAAc;IAAE;IAChF;KAAE,IAAI;KAAK,UAAU;KAA4B,YAAY;KAAG,cAAc;IAAE;GAClF;GACA,aAAa;GACb,SAAS;GACT,SAAS,CAAC;GACV,QAAQ,KAAA;GACR,OAAO,KAAA;GACP,OAAO;IACL,SAAS;IACT,gBAAgB;IAChB,SAAS;IACT,yBAAyB;IACzB,wBAAwB;IACxB,YAAY;IACZ,WAAW;IACX,qBAAqB;IACrB,yBAAyB;IACzB,aAAa;IACb,SAAS;IACT,SAAS;IACT,YAAY;GACd;GACA,YAAY,EAAE,YAAY,OAAO;GACjC,QAAQ;GACR,QAAQ;GACR,cAAc;GACd,SAAS;GACT,MAAM;EACR;CACF;CACA,UAAU;EACR,UAAU;GAAE,eAAe,CAAC,IAAI;GAAG,OAAO;EAAE;EAC5C,YAAY;GAAE,eAAe,CAAC,IAAI;GAAG,OAAO;EAAE;EAC9C,SAAS;GAAE,eAAe,CAAC,IAAI;GAAG,OAAO;EAAE;EAC3C,WAAW;GAAE,eAAe,CAAC,IAAI;GAAG,OAAO;EAAE;CAC/C;CACA,uBAAuB;CACvB,mBAAmB,CAAC;CACpB,gBAAgB;EACd,UAAU;GACR,GAAGA,+BAAAA,aAAa,eAAe;GAC/B,WAAW,CAAC,IAAI;GAChB,SAAS,KAAA;GACT,QAAQ;GACR,OAAO;GACP,MAAM;EACR;EACA,YAAY;GAAE,GAAGA,+BAAAA,aAAa,eAAe;GAAY,WAAW,CAAC,IAAI;GAAG,OAAO;EAAE;EACrF,SAAS;GAAE,GAAGA,+BAAAA,aAAa,eAAe;GAAS,WAAW,CAAC,IAAI;GAAG,OAAO;EAAE;EAC/E,WAAW;GAAE,GAAGA,+BAAAA,aAAa,eAAe;GAAW,WAAW,CAAC,IAAI;GAAG,OAAO;EAAE;EACnF,SAAS;GACP,OAAO;GACP,oBAAoB;GACpB,kBAAkB;GAClB,YAAY;EACd;EACA,YAAY;CACd;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.js","names":[],"sources":["../../src/deploymentsSlice/mocks.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { initialState } from './index';\n\nexport const mockState = {\n ...initialState,\n byId: {\n d1: {\n id: 'd1',\n name: 'test deployment',\n artifact_name: 'r1',\n artifacts: ['123'],\n created: '2019-01-01T12:30:00.000Z',\n device_count: 1,\n devices: {\n a1: {\n attributes: {},\n id: 'a1',\n image: { size: 123 },\n status: 'installing'\n }\n },\n filter: undefined,\n group: undefined,\n statistics: {\n status: {\n downloading: 0,\n decommissioned: 0,\n failure: 0,\n installing: 1,\n noartifact: 0,\n pending: 0,\n rebooting: 0,\n success: 0,\n 'already-installed': 0\n },\n total_size: 1234\n }\n },\n d2: {\n id: 'd2',\n name: 'test deployment 2',\n artifact_name: 'r1',\n artifacts: ['123'],\n created: '2019-01-01T12:25:00.000Z',\n device_count: 1,\n devices: {\n b1: {\n attributes: {},\n id: 'b1',\n status: 'pending'\n }\n },\n filter: undefined,\n group: undefined,\n statistics: {\n status: {\n downloading: 0,\n decommissioned: 0,\n failure: 0,\n installing: 0,\n noartifact: 0,\n pending: 1,\n rebooting: 0,\n success: 0,\n 'already-installed': 0\n }\n }\n },\n d3: {\n id: 'd3',\n name: 'Test',\n phases: [\n { id: '0', batch_size: 2, device_count: 2 },\n { id: '1', start_ts: '2019-02-04T11:45:10.002Z', batch_size: 3, device_count: 3 },\n { id: '2', start_ts: '2019-02-05T11:45:10.002Z', batch_size: 5, device_count: 5 },\n { id: '3', start_ts: '2019-02-06T11:45:10.002Z', batch_size: 5, device_count: 5 },\n { id: '4', start_ts: '2019-02-21T11:45:10.002Z', batch_size: 5, device_count: 0 }\n ],\n max_devices: 0,\n created: '2019-01-31T12:59:30.020Z',\n devices: {},\n filter: undefined,\n group: undefined,\n stats: {\n pending: 3,\n decommissioned: 0,\n failure: 23,\n pause_before_committing: 0,\n pause_before_rebooting: 0,\n installing: 0,\n rebooting: 0,\n 'already-installed': 0,\n pause_before_installing: 0,\n downloading: 0,\n success: 6,\n aborted: 0,\n noartifact: 0\n },\n statistics: { total_size: '1234' },\n status: 'inprogress',\n active: true,\n device_count: 100,\n retries:
|
|
1
|
+
{"version":3,"file":"mocks.js","names":[],"sources":["../../src/deploymentsSlice/mocks.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { initialState } from './index';\n\nexport const mockState = {\n ...initialState,\n byId: {\n d1: {\n id: 'd1',\n name: 'test deployment',\n artifact_name: 'r1',\n artifacts: ['123'],\n created: '2019-01-01T12:30:00.000Z',\n device_count: 1,\n devices: {\n a1: {\n attributes: {},\n id: 'a1',\n image: { size: 123 },\n status: 'installing'\n }\n },\n filter: undefined,\n group: undefined,\n statistics: {\n status: {\n downloading: 0,\n decommissioned: 0,\n failure: 0,\n installing: 1,\n noartifact: 0,\n pending: 0,\n rebooting: 0,\n success: 0,\n 'already-installed': 0\n },\n total_size: 1234\n }\n },\n d2: {\n id: 'd2',\n name: 'test deployment 2',\n artifact_name: 'r1',\n artifacts: ['123'],\n created: '2019-01-01T12:25:00.000Z',\n device_count: 1,\n devices: {\n b1: {\n attributes: {},\n id: 'b1',\n status: 'pending'\n }\n },\n filter: undefined,\n group: undefined,\n statistics: {\n status: {\n downloading: 0,\n decommissioned: 0,\n failure: 0,\n installing: 0,\n noartifact: 0,\n pending: 1,\n rebooting: 0,\n success: 0,\n 'already-installed': 0\n }\n }\n },\n d3: {\n id: 'd3',\n name: 'Test',\n phases: [\n { id: '0', batch_size: 2, device_count: 2 },\n { id: '1', start_ts: '2019-02-04T11:45:10.002Z', batch_size: 3, device_count: 3 },\n { id: '2', start_ts: '2019-02-05T11:45:10.002Z', batch_size: 5, device_count: 5 },\n { id: '3', start_ts: '2019-02-06T11:45:10.002Z', batch_size: 5, device_count: 5 },\n { id: '4', start_ts: '2019-02-21T11:45:10.002Z', batch_size: 5, device_count: 0 }\n ],\n max_devices: 0,\n created: '2019-01-31T12:59:30.020Z',\n devices: {},\n filter: undefined,\n group: undefined,\n stats: {\n pending: 3,\n decommissioned: 0,\n failure: 23,\n pause_before_committing: 0,\n pause_before_rebooting: 0,\n installing: 0,\n rebooting: 0,\n 'already-installed': 0,\n pause_before_installing: 0,\n downloading: 0,\n success: 6,\n aborted: 0,\n noartifact: 0\n },\n statistics: { total_size: '1234' },\n status: 'inprogress',\n active: true,\n device_count: 100,\n retries: 0,\n type: 'software'\n }\n },\n byStatus: {\n finished: { deploymentIds: ['d1'], total: 1 },\n inprogress: { deploymentIds: ['d3'], total: 1 },\n pending: { deploymentIds: ['d2'], total: 1 },\n scheduled: { deploymentIds: ['d2'], total: 1 }\n },\n deploymentDeviceLimit: 500,\n selectedDeviceIds: [],\n selectionState: {\n finished: {\n ...initialState.selectionState.finished,\n selection: ['d1'],\n endDate: undefined,\n search: '',\n total: 1,\n type: ''\n },\n inprogress: { ...initialState.selectionState.inprogress, selection: ['d1'], total: 1 },\n pending: { ...initialState.selectionState.pending, selection: ['d2'], total: 1 },\n scheduled: { ...initialState.selectionState.scheduled, selection: ['d2'], total: 1 },\n general: {\n state: 'active',\n showCreationDialog: false,\n showReportDialog: false,\n reportType: null\n },\n selectedId: 'd1'\n }\n};\n"],"mappings":";;AAeA,MAAa,YAAY;CACvB,GAAG;CACH,MAAM;EACJ,IAAI;GACF,IAAI;GACJ,MAAM;GACN,eAAe;GACf,WAAW,CAAC,KAAK;GACjB,SAAS;GACT,cAAc;GACd,SAAS,EACP,IAAI;IACF,YAAY,CAAC;IACb,IAAI;IACJ,OAAO,EAAE,MAAM,IAAI;IACnB,QAAQ;GACV,EACF;GACA,QAAQ,KAAA;GACR,OAAO,KAAA;GACP,YAAY;IACV,QAAQ;KACN,aAAa;KACb,gBAAgB;KAChB,SAAS;KACT,YAAY;KACZ,YAAY;KACZ,SAAS;KACT,WAAW;KACX,SAAS;KACT,qBAAqB;IACvB;IACA,YAAY;GACd;EACF;EACA,IAAI;GACF,IAAI;GACJ,MAAM;GACN,eAAe;GACf,WAAW,CAAC,KAAK;GACjB,SAAS;GACT,cAAc;GACd,SAAS,EACP,IAAI;IACF,YAAY,CAAC;IACb,IAAI;IACJ,QAAQ;GACV,EACF;GACA,QAAQ,KAAA;GACR,OAAO,KAAA;GACP,YAAY,EACV,QAAQ;IACN,aAAa;IACb,gBAAgB;IAChB,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,WAAW;IACX,SAAS;IACT,qBAAqB;GACvB,EACF;EACF;EACA,IAAI;GACF,IAAI;GACJ,MAAM;GACN,QAAQ;IACN;KAAE,IAAI;KAAK,YAAY;KAAG,cAAc;IAAE;IAC1C;KAAE,IAAI;KAAK,UAAU;KAA4B,YAAY;KAAG,cAAc;IAAE;IAChF;KAAE,IAAI;KAAK,UAAU;KAA4B,YAAY;KAAG,cAAc;IAAE;IAChF;KAAE,IAAI;KAAK,UAAU;KAA4B,YAAY;KAAG,cAAc;IAAE;IAChF;KAAE,IAAI;KAAK,UAAU;KAA4B,YAAY;KAAG,cAAc;IAAE;GAClF;GACA,aAAa;GACb,SAAS;GACT,SAAS,CAAC;GACV,QAAQ,KAAA;GACR,OAAO,KAAA;GACP,OAAO;IACL,SAAS;IACT,gBAAgB;IAChB,SAAS;IACT,yBAAyB;IACzB,wBAAwB;IACxB,YAAY;IACZ,WAAW;IACX,qBAAqB;IACrB,yBAAyB;IACzB,aAAa;IACb,SAAS;IACT,SAAS;IACT,YAAY;GACd;GACA,YAAY,EAAE,YAAY,OAAO;GACjC,QAAQ;GACR,QAAQ;GACR,cAAc;GACd,SAAS;GACT,MAAM;EACR;CACF;CACA,UAAU;EACR,UAAU;GAAE,eAAe,CAAC,IAAI;GAAG,OAAO;EAAE;EAC5C,YAAY;GAAE,eAAe,CAAC,IAAI;GAAG,OAAO;EAAE;EAC9C,SAAS;GAAE,eAAe,CAAC,IAAI;GAAG,OAAO;EAAE;EAC3C,WAAW;GAAE,eAAe,CAAC,IAAI;GAAG,OAAO;EAAE;CAC/C;CACA,uBAAuB;CACvB,mBAAmB,CAAC;CACpB,gBAAgB;EACd,UAAU;GACR,GAAG,aAAa,eAAe;GAC/B,WAAW,CAAC,IAAI;GAChB,SAAS,KAAA;GACT,QAAQ;GACR,OAAO;GACP,MAAM;EACR;EACA,YAAY;GAAE,GAAG,aAAa,eAAe;GAAY,WAAW,CAAC,IAAI;GAAG,OAAO;EAAE;EACrF,SAAS;GAAE,GAAG,aAAa,eAAe;GAAS,WAAW,CAAC,IAAI;GAAG,OAAO;EAAE;EAC/E,WAAW;GAAE,GAAG,aAAa,eAAe;GAAW,WAAW,CAAC,IAAI;GAAG,OAAO;EAAE;EACnF,SAAS;GACP,OAAO;GACP,oBAAoB;GACpB,kBAAkB;GAClB,YAAY;EACd;EACA,YAAY;CACd;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("../constants.cjs");
|
|
2
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
3
3
|
let _reduxjs_toolkit = require("@reduxjs/toolkit");
|
|
4
4
|
//#region src/deploymentsSlice/selectors.ts
|
|
5
5
|
const getDeploymentsById = (state) => state.deployments.byId;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEPLOYMENT_STATES } from "../constants.js";
|
|
1
|
+
import { gt as DEPLOYMENT_STATES } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { createSelector } from "@reduxjs/toolkit";
|
|
3
3
|
//#region src/deploymentsSlice/selectors.ts
|
|
4
4
|
const getDeploymentsById = (state) => state.deployments.byId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("../constants.cjs");
|
|
2
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
3
3
|
exports.DEVICE_CONNECT_STATES = require_constants.DEVICE_CONNECT_STATES;
|
|
4
4
|
exports.DEVICE_DISMISSAL_STATE = require_constants.DEVICE_DISMISSAL_STATE;
|
|
5
5
|
exports.DEVICE_MESSAGE_PROTOCOLS = require_constants.DEVICE_MESSAGE_PROTOCOLS;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ct as DEVICE_DISMISSAL_STATE, dt as REPORT_CHART_SIZE_LIMIT, ft as emptyFilter, lt as DEVICE_MESSAGE_PROTOCOLS, pt as geoAttributes, st as DEVICE_CONNECT_STATES, ut as DEVICE_MESSAGE_TYPES } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
export { DEVICE_CONNECT_STATES, DEVICE_DISMISSAL_STATE, DEVICE_MESSAGE_PROTOCOLS, DEVICE_MESSAGE_TYPES, REPORT_CHART_SIZE_LIMIT, emptyFilter, geoAttributes };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEVICE_LIST_DEFAULTS, DEVICE_STATES
|
|
1
|
+
import { f as SORTING_OPTIONS, l as DEVICE_LIST_DEFAULTS, u as DEVICE_STATES } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { createSlice } from "@reduxjs/toolkit";
|
|
3
3
|
import { deepCompare, duplicateFilter } from "@northern.tech/utils/helpers";
|
|
4
4
|
//#region src/devicesSlice/index.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as SORTING_OPTIONS, u as DEVICE_STATES } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { initialState } from "./index.js";
|
|
3
3
|
//#region src/devicesSlice/mocks.ts
|
|
4
4
|
const deviceTypes = { qemu: "qemux86-64" };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("../constants.cjs");
|
|
2
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
3
3
|
let _reduxjs_toolkit = require("@reduxjs/toolkit");
|
|
4
4
|
let _northern_tech_utils_helpers = require("@northern.tech/utils/helpers");
|
|
5
5
|
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as UNGROUPED_GROUP, u as DEVICE_STATES } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { createSelector } from "@reduxjs/toolkit";
|
|
3
3
|
import { duplicateFilter } from "@northern.tech/utils/helpers";
|
|
4
4
|
//#region src/devicesSlice/selectors.ts
|
package/dist/liststatehook.cjs
CHANGED
|
@@ -69,10 +69,11 @@ const useLocationParams = (key, extras, processors = defaultProcessors) => {
|
|
|
69
69
|
location
|
|
70
70
|
});
|
|
71
71
|
const formatFn = processors[key].format;
|
|
72
|
+
const searchQuery = [processors.common.format(newValue.pageState, extras), formatFn(newValue, extras)].filter((i) => i).join("&");
|
|
72
73
|
navigate({
|
|
73
74
|
pathname,
|
|
74
75
|
replace: true,
|
|
75
|
-
search: `?${
|
|
76
|
+
search: `?${searchQuery}`,
|
|
76
77
|
...options
|
|
77
78
|
});
|
|
78
79
|
}, [extrasString, key]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liststatehook.cjs","names":["formatAuditlogs","parseAuditlogsQuery","formatPageState","commonProcessor","formatDeployments","generateDeploymentsPath","parseDeploymentsQuery","formatDeviceSearch","generateDevicePath","parseDeviceQuery","formatReleases","generateReleasesPath","parseReleasesQuery","formatTenants","generateTenantPath","parseTenantsQuery"],"sources":["../src/liststatehook.ts"],"sourcesContent":["// Copyright 2022 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { useCallback, useMemo } from 'react';\nimport type { Location, NavigateOptions } from 'react-router';\nimport { useLocation, useNavigate, useNavigationType, useSearchParams } from 'react-router';\n\nimport type { CommonProcessorResult, FormatPageStateDefaults, PageState } from './locationutils';\nimport {\n commonProcessor,\n formatAuditlogs,\n formatDeployments,\n formatDeviceSearch,\n formatPageState,\n formatReleases,\n formatTenants,\n generateDeploymentsPath,\n generateDevicePath,\n generateReleasesPath,\n generateTenantPath,\n parseAuditlogsQuery,\n parseDeploymentsQuery,\n parseDeviceQuery,\n parseReleasesQuery,\n parseTenantsQuery\n} from './locationutils';\n\ntype ProcessorConfig<TFormat, TLocate, TParse> = {\n format: TFormat;\n locate: TLocate;\n parse: TParse;\n};\n\ntype Processors = {\n auditlogs: ProcessorConfig<typeof formatAuditlogs, () => undefined, typeof parseAuditlogsQuery>;\n common: ProcessorConfig<typeof formatPageState, () => undefined, typeof commonProcessor>;\n deployments: ProcessorConfig<typeof formatDeployments, typeof generateDeploymentsPath, typeof parseDeploymentsQuery>;\n devices: ProcessorConfig<typeof formatDeviceSearch, typeof generateDevicePath, typeof parseDeviceQuery>;\n releases: ProcessorConfig<typeof formatReleases, typeof generateReleasesPath, typeof parseReleasesQuery>;\n tenants: ProcessorConfig<typeof formatTenants, typeof generateTenantPath, typeof parseTenantsQuery>;\n};\n\nexport const defaultProcessors: Processors = {\n auditlogs: {\n format: formatAuditlogs,\n locate: () => undefined,\n parse: parseAuditlogsQuery\n },\n common: {\n format: formatPageState,\n locate: () => undefined,\n parse: commonProcessor\n },\n deployments: {\n format: formatDeployments,\n locate: generateDeploymentsPath,\n parse: parseDeploymentsQuery\n },\n devices: {\n format: formatDeviceSearch,\n locate: generateDevicePath,\n parse: parseDeviceQuery\n },\n releases: {\n format: formatReleases,\n locate: generateReleasesPath,\n parse: parseReleasesQuery\n },\n tenants: {\n format: formatTenants,\n locate: generateTenantPath,\n parse: parseTenantsQuery\n }\n};\n\ntype ProcessorKey = keyof Omit<Processors, 'common'>;\n\ntype LocationExtras = Record<string, unknown>;\n\ntype LocationParamsValue = PageState & CommonProcessorResult['sort'] & Record<string, unknown>;\n\ntype SetValueParams = {\n [key: string]: unknown;\n pageState: PageState;\n};\n\ntype UseLocationParamsReturn = [\n value: LocationParamsValue,\n setValue: (newValue: SetValueParams, options?: NavigateOptions) => void,\n options: { shouldInitializeFromUrl: boolean }\n];\n\nexport const useLocationParams = (key: ProcessorKey, extras: LocationExtras, processors: Processors = defaultProcessors): UseLocationParamsReturn => {\n const [searchParams] = useSearchParams();\n const navigate = useNavigate();\n const location = useLocation();\n const navigationType = useNavigationType();\n\n // POP (back/ forward/ initial load) -> rely on url state - otherwise on stored redux state\n const shouldInitializeFromUrl = navigationType === 'POP';\n\n const extrasString = JSON.stringify(extras);\n const searchParamsString = searchParams.toString();\n\n const value = useMemo(() => {\n const { pageState, params, sort } = processors.common.parse(searchParams);\n const extendedExtras = { ...extras, pageState, location };\n return {\n ...pageState,\n sort,\n ...(processors[key].parse as (params: URLSearchParams, extras: typeof extendedExtras) => Record<string, unknown>)(params, extendedExtras)\n } as LocationParamsValue;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [extrasString, key, location.search, location.pathname, searchParamsString]);\n\n const setValue = useCallback(\n (newValue: SetValueParams, options: NavigateOptions = {}): void => {\n const locateFn = processors[key].locate as (params: { location: Location; pageState: PageState }) => string | undefined;\n const pathname = locateFn({ pageState: newValue.pageState, location });\n const formatFn = processors[key].format as (value: SetValueParams, extras: LocationExtras) => string;\n const searchQuery = [processors.common.format(newValue.pageState, extras as FormatPageStateDefaults), formatFn(newValue, extras)]\n .filter(i => i)\n .join('&');\n navigate({ pathname, replace: true, search: `?${searchQuery}`, ...options });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [extrasString, key]\n );\n\n return [value, setValue, { shouldInitializeFromUrl }];\n};\n"],"mappings":";;;;;AAoDA,MAAa,oBAAgC;CAC3C,WAAW;EACT,QAAQA,sBAAAA;EACR,cAAc,KAAA;EACd,OAAOC,sBAAAA;CACT;CACA,QAAQ;EACN,QAAQC,sBAAAA;EACR,cAAc,KAAA;EACd,OAAOC,sBAAAA;CACT;CACA,aAAa;EACX,QAAQC,sBAAAA;EACR,QAAQC,sBAAAA;EACR,OAAOC,sBAAAA;CACT;CACA,SAAS;EACP,QAAQC,sBAAAA;EACR,QAAQC,sBAAAA;EACR,OAAOC,sBAAAA;CACT;CACA,UAAU;EACR,QAAQC,sBAAAA;EACR,QAAQC,sBAAAA;EACR,OAAOC,sBAAAA;CACT;CACA,SAAS;EACP,QAAQC,sBAAAA;EACR,QAAQC,sBAAAA;EACR,OAAOC,sBAAAA;CACT;AACF;AAmBA,MAAa,qBAAqB,KAAmB,QAAwB,aAAyB,sBAA+C;CACnJ,MAAM,CAAC,iBAAA,GAAA,aAAA,gBAAA,CAAgC;CACvC,MAAM,YAAA,GAAA,aAAA,YAAA,CAAuB;CAC7B,MAAM,YAAA,GAAA,aAAA,YAAA,CAAuB;CAI7B,MAAM,2BAAA,GAAA,aAAA,kBAAA,CAAuC,MAAM;CAEnD,MAAM,eAAe,KAAK,UAAU,MAAM;CAC1C,MAAM,qBAAqB,aAAa,SAAS;CA2BjD,OAAO;2BAzBqB;GAC1B,MAAM,EAAE,WAAW,QAAQ,SAAS,WAAW,OAAO,MAAM,YAAY;GACxE,MAAM,iBAAiB;IAAE,GAAG;IAAQ;IAAW;GAAS;GACxD,OAAO;IACL,GAAG;IACH;IACA,GAAI,WAAW,IAAI,CAAC,MAA8F,QAAQ,cAAc;GAC1I;EAEF,GAAG;GAAC;GAAc;GAAK,SAAS;GAAQ,SAAS;GAAU;EAAkB,CAgBjE;0BAbT,UAA0B,UAA2B,CAAC,MAAY;GACjE,MAAM,WAAW,WAAW,IAAI,CAAC;GACjC,MAAM,WAAW,SAAS;IAAE,WAAW,SAAS;IAAW;GAAS,CAAC;GACrE,MAAM,WAAW,WAAW,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"liststatehook.cjs","names":["formatAuditlogs","parseAuditlogsQuery","formatPageState","commonProcessor","formatDeployments","generateDeploymentsPath","parseDeploymentsQuery","formatDeviceSearch","generateDevicePath","parseDeviceQuery","formatReleases","generateReleasesPath","parseReleasesQuery","formatTenants","generateTenantPath","parseTenantsQuery"],"sources":["../src/liststatehook.ts"],"sourcesContent":["// Copyright 2022 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { useCallback, useMemo } from 'react';\nimport type { Location, NavigateOptions } from 'react-router';\nimport { useLocation, useNavigate, useNavigationType, useSearchParams } from 'react-router';\n\nimport type { CommonProcessorResult, FormatPageStateDefaults, PageState } from './locationutils';\nimport {\n commonProcessor,\n formatAuditlogs,\n formatDeployments,\n formatDeviceSearch,\n formatPageState,\n formatReleases,\n formatTenants,\n generateDeploymentsPath,\n generateDevicePath,\n generateReleasesPath,\n generateTenantPath,\n parseAuditlogsQuery,\n parseDeploymentsQuery,\n parseDeviceQuery,\n parseReleasesQuery,\n parseTenantsQuery\n} from './locationutils';\n\ntype ProcessorConfig<TFormat, TLocate, TParse> = {\n format: TFormat;\n locate: TLocate;\n parse: TParse;\n};\n\ntype Processors = {\n auditlogs: ProcessorConfig<typeof formatAuditlogs, () => undefined, typeof parseAuditlogsQuery>;\n common: ProcessorConfig<typeof formatPageState, () => undefined, typeof commonProcessor>;\n deployments: ProcessorConfig<typeof formatDeployments, typeof generateDeploymentsPath, typeof parseDeploymentsQuery>;\n devices: ProcessorConfig<typeof formatDeviceSearch, typeof generateDevicePath, typeof parseDeviceQuery>;\n releases: ProcessorConfig<typeof formatReleases, typeof generateReleasesPath, typeof parseReleasesQuery>;\n tenants: ProcessorConfig<typeof formatTenants, typeof generateTenantPath, typeof parseTenantsQuery>;\n};\n\nexport const defaultProcessors: Processors = {\n auditlogs: {\n format: formatAuditlogs,\n locate: () => undefined,\n parse: parseAuditlogsQuery\n },\n common: {\n format: formatPageState,\n locate: () => undefined,\n parse: commonProcessor\n },\n deployments: {\n format: formatDeployments,\n locate: generateDeploymentsPath,\n parse: parseDeploymentsQuery\n },\n devices: {\n format: formatDeviceSearch,\n locate: generateDevicePath,\n parse: parseDeviceQuery\n },\n releases: {\n format: formatReleases,\n locate: generateReleasesPath,\n parse: parseReleasesQuery\n },\n tenants: {\n format: formatTenants,\n locate: generateTenantPath,\n parse: parseTenantsQuery\n }\n};\n\ntype ProcessorKey = keyof Omit<Processors, 'common'>;\n\ntype LocationExtras = Record<string, unknown>;\n\ntype LocationParamsValue = PageState & CommonProcessorResult['sort'] & Record<string, unknown>;\n\ntype SetValueParams = {\n [key: string]: unknown;\n pageState: PageState;\n};\n\ntype UseLocationParamsReturn = [\n value: LocationParamsValue,\n setValue: (newValue: SetValueParams, options?: NavigateOptions) => void,\n options: { shouldInitializeFromUrl: boolean }\n];\n\nexport const useLocationParams = (key: ProcessorKey, extras: LocationExtras, processors: Processors = defaultProcessors): UseLocationParamsReturn => {\n const [searchParams] = useSearchParams();\n const navigate = useNavigate();\n const location = useLocation();\n const navigationType = useNavigationType();\n\n // POP (back/ forward/ initial load) -> rely on url state - otherwise on stored redux state\n const shouldInitializeFromUrl = navigationType === 'POP';\n\n const extrasString = JSON.stringify(extras);\n const searchParamsString = searchParams.toString();\n\n const value = useMemo(() => {\n const { pageState, params, sort } = processors.common.parse(searchParams);\n const extendedExtras = { ...extras, pageState, location };\n return {\n ...pageState,\n sort,\n ...(processors[key].parse as (params: URLSearchParams, extras: typeof extendedExtras) => Record<string, unknown>)(params, extendedExtras)\n } as LocationParamsValue;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [extrasString, key, location.search, location.pathname, searchParamsString]);\n\n const setValue = useCallback(\n (newValue: SetValueParams, options: NavigateOptions = {}): void => {\n const locateFn = processors[key].locate as (params: { location: Location; pageState: PageState }) => string | undefined;\n const pathname = locateFn({ pageState: newValue.pageState, location });\n const formatFn = processors[key].format as (value: SetValueParams, extras: LocationExtras) => string;\n const searchQuery = [processors.common.format(newValue.pageState, extras as FormatPageStateDefaults), formatFn(newValue, extras)]\n .filter(i => i)\n .join('&');\n navigate({ pathname, replace: true, search: `?${searchQuery}`, ...options });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [extrasString, key]\n );\n\n return [value, setValue, { shouldInitializeFromUrl }];\n};\n"],"mappings":";;;;;AAoDA,MAAa,oBAAgC;CAC3C,WAAW;EACT,QAAQA,sBAAAA;EACR,cAAc,KAAA;EACd,OAAOC,sBAAAA;CACT;CACA,QAAQ;EACN,QAAQC,sBAAAA;EACR,cAAc,KAAA;EACd,OAAOC,sBAAAA;CACT;CACA,aAAa;EACX,QAAQC,sBAAAA;EACR,QAAQC,sBAAAA;EACR,OAAOC,sBAAAA;CACT;CACA,SAAS;EACP,QAAQC,sBAAAA;EACR,QAAQC,sBAAAA;EACR,OAAOC,sBAAAA;CACT;CACA,UAAU;EACR,QAAQC,sBAAAA;EACR,QAAQC,sBAAAA;EACR,OAAOC,sBAAAA;CACT;CACA,SAAS;EACP,QAAQC,sBAAAA;EACR,QAAQC,sBAAAA;EACR,OAAOC,sBAAAA;CACT;AACF;AAmBA,MAAa,qBAAqB,KAAmB,QAAwB,aAAyB,sBAA+C;CACnJ,MAAM,CAAC,iBAAA,GAAA,aAAA,gBAAA,CAAgC;CACvC,MAAM,YAAA,GAAA,aAAA,YAAA,CAAuB;CAC7B,MAAM,YAAA,GAAA,aAAA,YAAA,CAAuB;CAI7B,MAAM,2BAAA,GAAA,aAAA,kBAAA,CAAuC,MAAM;CAEnD,MAAM,eAAe,KAAK,UAAU,MAAM;CAC1C,MAAM,qBAAqB,aAAa,SAAS;CA2BjD,OAAO;2BAzBqB;GAC1B,MAAM,EAAE,WAAW,QAAQ,SAAS,WAAW,OAAO,MAAM,YAAY;GACxE,MAAM,iBAAiB;IAAE,GAAG;IAAQ;IAAW;GAAS;GACxD,OAAO;IACL,GAAG;IACH;IACA,GAAI,WAAW,IAAI,CAAC,MAA8F,QAAQ,cAAc;GAC1I;EAEF,GAAG;GAAC;GAAc;GAAK,SAAS;GAAQ,SAAS;GAAU;EAAkB,CAgBjE;0BAbT,UAA0B,UAA2B,CAAC,MAAY;GACjE,MAAM,WAAW,WAAW,IAAI,CAAC;GACjC,MAAM,WAAW,SAAS;IAAE,WAAW,SAAS;IAAW;GAAS,CAAC;GACrE,MAAM,WAAW,WAAW,IAAI,CAAC;GACjC,MAAM,cAAc,CAAC,WAAW,OAAO,OAAO,SAAS,WAAW,MAAiC,GAAG,SAAS,UAAU,MAAM,CAAC,CAAC,CAC9H,QAAO,MAAK,CAAC,CAAC,CACd,KAAK,GAAG;GACX,SAAS;IAAE;IAAU,SAAS;IAAM,QAAQ,IAAI;IAAe,GAAG;GAAQ,CAAC;EAC7E,GAEA,CAAC,cAAc,GAAG,CAGE;EAAG,EAAE,wBAAwB;CAAC;AACtD"}
|
package/dist/liststatehook.js
CHANGED
|
@@ -68,10 +68,11 @@ const useLocationParams = (key, extras, processors = defaultProcessors) => {
|
|
|
68
68
|
location
|
|
69
69
|
});
|
|
70
70
|
const formatFn = processors[key].format;
|
|
71
|
+
const searchQuery = [processors.common.format(newValue.pageState, extras), formatFn(newValue, extras)].filter((i) => i).join("&");
|
|
71
72
|
navigate({
|
|
72
73
|
pathname,
|
|
73
74
|
replace: true,
|
|
74
|
-
search: `?${
|
|
75
|
+
search: `?${searchQuery}`,
|
|
75
76
|
...options
|
|
76
77
|
});
|
|
77
78
|
}, [extrasString, key]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liststatehook.js","names":[],"sources":["../src/liststatehook.ts"],"sourcesContent":["// Copyright 2022 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { useCallback, useMemo } from 'react';\nimport type { Location, NavigateOptions } from 'react-router';\nimport { useLocation, useNavigate, useNavigationType, useSearchParams } from 'react-router';\n\nimport type { CommonProcessorResult, FormatPageStateDefaults, PageState } from './locationutils';\nimport {\n commonProcessor,\n formatAuditlogs,\n formatDeployments,\n formatDeviceSearch,\n formatPageState,\n formatReleases,\n formatTenants,\n generateDeploymentsPath,\n generateDevicePath,\n generateReleasesPath,\n generateTenantPath,\n parseAuditlogsQuery,\n parseDeploymentsQuery,\n parseDeviceQuery,\n parseReleasesQuery,\n parseTenantsQuery\n} from './locationutils';\n\ntype ProcessorConfig<TFormat, TLocate, TParse> = {\n format: TFormat;\n locate: TLocate;\n parse: TParse;\n};\n\ntype Processors = {\n auditlogs: ProcessorConfig<typeof formatAuditlogs, () => undefined, typeof parseAuditlogsQuery>;\n common: ProcessorConfig<typeof formatPageState, () => undefined, typeof commonProcessor>;\n deployments: ProcessorConfig<typeof formatDeployments, typeof generateDeploymentsPath, typeof parseDeploymentsQuery>;\n devices: ProcessorConfig<typeof formatDeviceSearch, typeof generateDevicePath, typeof parseDeviceQuery>;\n releases: ProcessorConfig<typeof formatReleases, typeof generateReleasesPath, typeof parseReleasesQuery>;\n tenants: ProcessorConfig<typeof formatTenants, typeof generateTenantPath, typeof parseTenantsQuery>;\n};\n\nexport const defaultProcessors: Processors = {\n auditlogs: {\n format: formatAuditlogs,\n locate: () => undefined,\n parse: parseAuditlogsQuery\n },\n common: {\n format: formatPageState,\n locate: () => undefined,\n parse: commonProcessor\n },\n deployments: {\n format: formatDeployments,\n locate: generateDeploymentsPath,\n parse: parseDeploymentsQuery\n },\n devices: {\n format: formatDeviceSearch,\n locate: generateDevicePath,\n parse: parseDeviceQuery\n },\n releases: {\n format: formatReleases,\n locate: generateReleasesPath,\n parse: parseReleasesQuery\n },\n tenants: {\n format: formatTenants,\n locate: generateTenantPath,\n parse: parseTenantsQuery\n }\n};\n\ntype ProcessorKey = keyof Omit<Processors, 'common'>;\n\ntype LocationExtras = Record<string, unknown>;\n\ntype LocationParamsValue = PageState & CommonProcessorResult['sort'] & Record<string, unknown>;\n\ntype SetValueParams = {\n [key: string]: unknown;\n pageState: PageState;\n};\n\ntype UseLocationParamsReturn = [\n value: LocationParamsValue,\n setValue: (newValue: SetValueParams, options?: NavigateOptions) => void,\n options: { shouldInitializeFromUrl: boolean }\n];\n\nexport const useLocationParams = (key: ProcessorKey, extras: LocationExtras, processors: Processors = defaultProcessors): UseLocationParamsReturn => {\n const [searchParams] = useSearchParams();\n const navigate = useNavigate();\n const location = useLocation();\n const navigationType = useNavigationType();\n\n // POP (back/ forward/ initial load) -> rely on url state - otherwise on stored redux state\n const shouldInitializeFromUrl = navigationType === 'POP';\n\n const extrasString = JSON.stringify(extras);\n const searchParamsString = searchParams.toString();\n\n const value = useMemo(() => {\n const { pageState, params, sort } = processors.common.parse(searchParams);\n const extendedExtras = { ...extras, pageState, location };\n return {\n ...pageState,\n sort,\n ...(processors[key].parse as (params: URLSearchParams, extras: typeof extendedExtras) => Record<string, unknown>)(params, extendedExtras)\n } as LocationParamsValue;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [extrasString, key, location.search, location.pathname, searchParamsString]);\n\n const setValue = useCallback(\n (newValue: SetValueParams, options: NavigateOptions = {}): void => {\n const locateFn = processors[key].locate as (params: { location: Location; pageState: PageState }) => string | undefined;\n const pathname = locateFn({ pageState: newValue.pageState, location });\n const formatFn = processors[key].format as (value: SetValueParams, extras: LocationExtras) => string;\n const searchQuery = [processors.common.format(newValue.pageState, extras as FormatPageStateDefaults), formatFn(newValue, extras)]\n .filter(i => i)\n .join('&');\n navigate({ pathname, replace: true, search: `?${searchQuery}`, ...options });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [extrasString, key]\n );\n\n return [value, setValue, { shouldInitializeFromUrl }];\n};\n"],"mappings":";;;;AAoDA,MAAa,oBAAgC;CAC3C,WAAW;EACT,QAAQ;EACR,cAAc,KAAA;EACd,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,cAAc,KAAA;EACd,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF;AAmBA,MAAa,qBAAqB,KAAmB,QAAwB,aAAyB,sBAA+C;CACnJ,MAAM,CAAC,gBAAgB,gBAAgB;CACvC,MAAM,WAAW,YAAY;CAC7B,MAAM,WAAW,YAAY;CAI7B,MAAM,0BAHiB,kBAGsB,MAAM;CAEnD,MAAM,eAAe,KAAK,UAAU,MAAM;CAC1C,MAAM,qBAAqB,aAAa,SAAS;CA2BjD,OAAO;EAzBO,cAAc;GAC1B,MAAM,EAAE,WAAW,QAAQ,SAAS,WAAW,OAAO,MAAM,YAAY;GACxE,MAAM,iBAAiB;IAAE,GAAG;IAAQ;IAAW;GAAS;GACxD,OAAO;IACL,GAAG;IACH;IACA,GAAI,WAAW,IAAI,CAAC,MAA8F,QAAQ,cAAc;GAC1I;EAEF,GAAG;GAAC;GAAc;GAAK,SAAS;GAAQ,SAAS;GAAU;EAAkB,CAgBjE;EAdK,aACd,UAA0B,UAA2B,CAAC,MAAY;GACjE,MAAM,WAAW,WAAW,IAAI,CAAC;GACjC,MAAM,WAAW,SAAS;IAAE,WAAW,SAAS;IAAW;GAAS,CAAC;GACrE,MAAM,WAAW,WAAW,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"liststatehook.js","names":[],"sources":["../src/liststatehook.ts"],"sourcesContent":["// Copyright 2022 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { useCallback, useMemo } from 'react';\nimport type { Location, NavigateOptions } from 'react-router';\nimport { useLocation, useNavigate, useNavigationType, useSearchParams } from 'react-router';\n\nimport type { CommonProcessorResult, FormatPageStateDefaults, PageState } from './locationutils';\nimport {\n commonProcessor,\n formatAuditlogs,\n formatDeployments,\n formatDeviceSearch,\n formatPageState,\n formatReleases,\n formatTenants,\n generateDeploymentsPath,\n generateDevicePath,\n generateReleasesPath,\n generateTenantPath,\n parseAuditlogsQuery,\n parseDeploymentsQuery,\n parseDeviceQuery,\n parseReleasesQuery,\n parseTenantsQuery\n} from './locationutils';\n\ntype ProcessorConfig<TFormat, TLocate, TParse> = {\n format: TFormat;\n locate: TLocate;\n parse: TParse;\n};\n\ntype Processors = {\n auditlogs: ProcessorConfig<typeof formatAuditlogs, () => undefined, typeof parseAuditlogsQuery>;\n common: ProcessorConfig<typeof formatPageState, () => undefined, typeof commonProcessor>;\n deployments: ProcessorConfig<typeof formatDeployments, typeof generateDeploymentsPath, typeof parseDeploymentsQuery>;\n devices: ProcessorConfig<typeof formatDeviceSearch, typeof generateDevicePath, typeof parseDeviceQuery>;\n releases: ProcessorConfig<typeof formatReleases, typeof generateReleasesPath, typeof parseReleasesQuery>;\n tenants: ProcessorConfig<typeof formatTenants, typeof generateTenantPath, typeof parseTenantsQuery>;\n};\n\nexport const defaultProcessors: Processors = {\n auditlogs: {\n format: formatAuditlogs,\n locate: () => undefined,\n parse: parseAuditlogsQuery\n },\n common: {\n format: formatPageState,\n locate: () => undefined,\n parse: commonProcessor\n },\n deployments: {\n format: formatDeployments,\n locate: generateDeploymentsPath,\n parse: parseDeploymentsQuery\n },\n devices: {\n format: formatDeviceSearch,\n locate: generateDevicePath,\n parse: parseDeviceQuery\n },\n releases: {\n format: formatReleases,\n locate: generateReleasesPath,\n parse: parseReleasesQuery\n },\n tenants: {\n format: formatTenants,\n locate: generateTenantPath,\n parse: parseTenantsQuery\n }\n};\n\ntype ProcessorKey = keyof Omit<Processors, 'common'>;\n\ntype LocationExtras = Record<string, unknown>;\n\ntype LocationParamsValue = PageState & CommonProcessorResult['sort'] & Record<string, unknown>;\n\ntype SetValueParams = {\n [key: string]: unknown;\n pageState: PageState;\n};\n\ntype UseLocationParamsReturn = [\n value: LocationParamsValue,\n setValue: (newValue: SetValueParams, options?: NavigateOptions) => void,\n options: { shouldInitializeFromUrl: boolean }\n];\n\nexport const useLocationParams = (key: ProcessorKey, extras: LocationExtras, processors: Processors = defaultProcessors): UseLocationParamsReturn => {\n const [searchParams] = useSearchParams();\n const navigate = useNavigate();\n const location = useLocation();\n const navigationType = useNavigationType();\n\n // POP (back/ forward/ initial load) -> rely on url state - otherwise on stored redux state\n const shouldInitializeFromUrl = navigationType === 'POP';\n\n const extrasString = JSON.stringify(extras);\n const searchParamsString = searchParams.toString();\n\n const value = useMemo(() => {\n const { pageState, params, sort } = processors.common.parse(searchParams);\n const extendedExtras = { ...extras, pageState, location };\n return {\n ...pageState,\n sort,\n ...(processors[key].parse as (params: URLSearchParams, extras: typeof extendedExtras) => Record<string, unknown>)(params, extendedExtras)\n } as LocationParamsValue;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [extrasString, key, location.search, location.pathname, searchParamsString]);\n\n const setValue = useCallback(\n (newValue: SetValueParams, options: NavigateOptions = {}): void => {\n const locateFn = processors[key].locate as (params: { location: Location; pageState: PageState }) => string | undefined;\n const pathname = locateFn({ pageState: newValue.pageState, location });\n const formatFn = processors[key].format as (value: SetValueParams, extras: LocationExtras) => string;\n const searchQuery = [processors.common.format(newValue.pageState, extras as FormatPageStateDefaults), formatFn(newValue, extras)]\n .filter(i => i)\n .join('&');\n navigate({ pathname, replace: true, search: `?${searchQuery}`, ...options });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [extrasString, key]\n );\n\n return [value, setValue, { shouldInitializeFromUrl }];\n};\n"],"mappings":";;;;AAoDA,MAAa,oBAAgC;CAC3C,WAAW;EACT,QAAQ;EACR,cAAc,KAAA;EACd,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,cAAc,KAAA;EACd,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF;AAmBA,MAAa,qBAAqB,KAAmB,QAAwB,aAAyB,sBAA+C;CACnJ,MAAM,CAAC,gBAAgB,gBAAgB;CACvC,MAAM,WAAW,YAAY;CAC7B,MAAM,WAAW,YAAY;CAI7B,MAAM,0BAHiB,kBAGsB,MAAM;CAEnD,MAAM,eAAe,KAAK,UAAU,MAAM;CAC1C,MAAM,qBAAqB,aAAa,SAAS;CA2BjD,OAAO;EAzBO,cAAc;GAC1B,MAAM,EAAE,WAAW,QAAQ,SAAS,WAAW,OAAO,MAAM,YAAY;GACxE,MAAM,iBAAiB;IAAE,GAAG;IAAQ;IAAW;GAAS;GACxD,OAAO;IACL,GAAG;IACH;IACA,GAAI,WAAW,IAAI,CAAC,MAA8F,QAAQ,cAAc;GAC1I;EAEF,GAAG;GAAC;GAAc;GAAK,SAAS;GAAQ,SAAS;GAAU;EAAkB,CAgBjE;EAdK,aACd,UAA0B,UAA2B,CAAC,MAAY;GACjE,MAAM,WAAW,WAAW,IAAI,CAAC;GACjC,MAAM,WAAW,SAAS;IAAE,WAAW,SAAS;IAAW;GAAS,CAAC;GACrE,MAAM,WAAW,WAAW,IAAI,CAAC;GACjC,MAAM,cAAc,CAAC,WAAW,OAAO,OAAO,SAAS,WAAW,MAAiC,GAAG,SAAS,UAAU,MAAM,CAAC,CAAC,CAC9H,QAAO,MAAK,CAAC,CAAC,CACd,KAAK,GAAG;GACX,SAAS;IAAE;IAAU,SAAS;IAAM,QAAQ,IAAI;IAAe,GAAG;GAAQ,CAAC;EAC7E,GAEA,CAAC,cAAc,GAAG,CAGE;EAAG,EAAE,wBAAwB;CAAC;AACtD"}
|
package/dist/locationutils.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("./constants.cjs");
|
|
2
|
+
const require_constants = require("./constants-CNZ5L0A0.cjs");
|
|
3
3
|
let _northern_tech_utils_helpers = require("@northern.tech/utils/helpers");
|
|
4
4
|
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
5
5
|
//#region src/locationutils.ts
|
package/dist/locationutils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as UNGROUPED_GROUP, Q as AUDIT_LOGS_TYPES, _t as DEPLOYMENT_TYPES, ft as emptyFilter, gt as DEPLOYMENT_STATES, ht as DEPLOYMENT_ROUTES, l as DEVICE_LIST_DEFAULTS, o as ATTRIBUTE_SCOPES, s as DEVICE_FILTERING_OPTIONS, t as ALL_DEVICES } from "./constants-Cj2kp3Iy.js";
|
|
2
2
|
import { deepCompare, getISOStringBoundaries } from "@northern.tech/utils/helpers";
|
|
3
3
|
//#region src/locationutils.ts
|
|
4
4
|
const SEPARATOR = ":";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS, alertChannels } from "../constants.js";
|
|
1
|
+
import { c as DEVICE_ISSUE_OPTIONS, l as DEVICE_LIST_DEFAULTS, p as alertChannels } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { createSlice } from "@reduxjs/toolkit";
|
|
3
3
|
//#region src/monitorSlice/index.ts
|
|
4
4
|
const sliceName = "monitor";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS } from "../constants.js";
|
|
1
|
+
import { c as DEVICE_ISSUE_OPTIONS, l as DEVICE_LIST_DEFAULTS } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { initialState } from "./index.js";
|
|
3
3
|
//#region src/monitorSlice/mocks.ts
|
|
4
4
|
const mockState = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("../constants.cjs");
|
|
2
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
3
3
|
const require_monitorSlice_index = require("./index.cjs");
|
|
4
4
|
const require_actions = require("../actions.cjs");
|
|
5
5
|
const require_devicesSlice_selectors = require("../devicesSlice/selectors.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as headerNames, M as monitorApiUrlv1, O as inventoryApiUrlV2, jt as TIMEOUTS, l as DEVICE_LIST_DEFAULTS, p as alertChannels } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { actions, sliceName } from "./index.js";
|
|
3
3
|
import actions_default from "../actions.js";
|
|
4
4
|
import { getDeviceFilters } from "../devicesSlice/selectors.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("../constants.cjs");
|
|
2
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
3
3
|
exports.AUDIT_LOGS_TYPES = require_constants.AUDIT_LOGS_TYPES;
|
|
4
4
|
exports.JSON_METADATA_FORMAT = require_constants.JSON_METADATA_FORMAT;
|
|
5
5
|
exports.SP_AUDIT_LOGS_TYPES = require_constants.SP_AUDIT_LOGS_TYPES;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AUDIT_LOGS_TYPES,
|
|
1
|
+
import { $ as JSON_METADATA_FORMAT, Q as AUDIT_LOGS_TYPES, at as getOidcStartUrl, et as SP_AUDIT_LOGS_TYPES, it as auditlogTypes, nt as TENANT_LIST_DEFAULT, ot as getSamlStartUrl, rt as XML_METADATA_FORMAT, tt as SSO_TYPES } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
export { AUDIT_LOGS_TYPES, JSON_METADATA_FORMAT, SP_AUDIT_LOGS_TYPES, SSO_TYPES, TENANT_LIST_DEFAULT, XML_METADATA_FORMAT, auditlogTypes, getOidcStartUrl, getSamlStartUrl };
|
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_constants = require("../constants.cjs");
|
|
5
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
6
6
|
let _reduxjs_toolkit = require("@reduxjs/toolkit");
|
|
7
7
|
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
8
8
|
//#region src/organizationSlice/index.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as SORTING_OPTIONS, l as DEVICE_LIST_DEFAULTS, nt as TENANT_LIST_DEFAULT } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { createSlice } from "@reduxjs/toolkit";
|
|
3
3
|
//#region src/organizationSlice/index.ts
|
|
4
4
|
const sliceName = "organization";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PLANS } from "../appSlice/constants.js";
|
|
2
|
-
import { DEVICE_LIST_DEFAULTS } from "../constants.js";
|
|
2
|
+
import { l as DEVICE_LIST_DEFAULTS } from "../constants-Cj2kp3Iy.js";
|
|
3
3
|
import { initialState } from "./index.js";
|
|
4
4
|
//#region src/organizationSlice/mocks.ts
|
|
5
5
|
const basicPlanId = PLANS.os.id;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_constants = require("../constants.cjs");
|
|
2
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
3
3
|
let _reduxjs_toolkit = require("@reduxjs/toolkit");
|
|
4
4
|
//#region src/organizationSlice/selectors.ts
|
|
5
5
|
const getOrganization = (state) => state.organization.organization;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Lt as productOrder, kt as EXTERNAL_PROVIDER } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { createSelector } from "@reduxjs/toolkit";
|
|
3
3
|
//#region src/organizationSlice/selectors.ts
|
|
4
4
|
const getOrganization = (state) => state.organization.organization;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as SORTING_OPTIONS, l as DEVICE_LIST_DEFAULTS } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { createSlice } from "@reduxjs/toolkit";
|
|
3
3
|
//#region src/releasesSlice/index.ts
|
|
4
4
|
const sliceName = "releases";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as SORTING_OPTIONS, l as DEVICE_LIST_DEFAULTS } from "../constants-Cj2kp3Iy.js";
|
|
2
2
|
import { initialState } from "./index.js";
|
|
3
3
|
//#region src/releasesSlice/mocks.ts
|
|
4
4
|
const deviceTypes = { qemu: "qemux86-64" };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("../rolldown-runtime-D6vf50IK.cjs");
|
|
3
|
+
const require_constants = require("../constants-CNZ5L0A0.cjs");
|
|
3
4
|
const require_releasesSlice_constants = require("./constants.cjs");
|
|
4
|
-
const require_constants = require("../constants.cjs");
|
|
5
5
|
const require_releasesSlice_index = require("./index.cjs");
|
|
6
6
|
const require_actions = require("../actions.cjs");
|
|
7
7
|
const require_utils = require("../utils.cjs");
|
|
@@ -47,7 +47,8 @@ const flattenRelease = (release, stateRelease) => {
|
|
|
47
47
|
};
|
|
48
48
|
const reduceReceivedReleases = (releases, stateReleasesById) => releases.reduce((accu, release) => {
|
|
49
49
|
const name = release.name ?? release.Name;
|
|
50
|
-
|
|
50
|
+
const stateRelease = stateReleasesById[name] || {};
|
|
51
|
+
accu[name] = flattenRelease(release, stateRelease);
|
|
51
52
|
return accu;
|
|
52
53
|
}, {});
|
|
53
54
|
const findArtifactIndexInRelease = (releases, id) => Object.values(releases).reduce((accu, item) => {
|
|
@@ -154,7 +155,8 @@ const createArtifact = require_store.createAppAsyncThunk(`${require_releasesSlic
|
|
|
154
155
|
progress: require_utils.progress(e)
|
|
155
156
|
})), cancelSource.signal)
|
|
156
157
|
]).then((tasks) => {
|
|
157
|
-
|
|
158
|
+
const location = tasks[tasks.length - 1].headers[_northern_tech_utils_constants.headerNames.location].replace("/generate", "");
|
|
159
|
+
return pollLocation(location);
|
|
158
160
|
}).then(() => Promise.all([
|
|
159
161
|
dispatch(getReleases()),
|
|
160
162
|
dispatch(selectRelease(meta.name)),
|
|
@@ -392,7 +394,7 @@ const setReleasesTags = require_store.createAppAsyncThunk(`${require_releasesSli
|
|
|
392
394
|
const addRequests = releases.reduce((accu, release) => {
|
|
393
395
|
accu.push(dispatch(setSingleReleaseTags({
|
|
394
396
|
name: release.name,
|
|
395
|
-
tags: [
|
|
397
|
+
tags: [.../* @__PURE__ */ new Set([...release.tags ? release.tags : [], ...tags])]
|
|
396
398
|
})));
|
|
397
399
|
return accu;
|
|
398
400
|
}, []);
|