@northern.tech/store 0.36.2 → 0.37.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/actions.d.cts +2 -1
- package/dist/actions.d.ts +2 -1
- package/dist/api/general-api.cjs +3 -3
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/users-api.cjs +2 -2
- package/dist/api/users-api.cjs.map +1 -1
- package/dist/api/users-api.js.map +1 -1
- package/dist/appSlice/index.cjs +1 -0
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.js +1 -0
- package/dist/appSlice/index.js.map +1 -1
- package/dist/appSlice/selectors.cjs +2 -4
- package/dist/appSlice/selectors.cjs.map +1 -1
- package/dist/appSlice/selectors.d.cts +4 -51
- package/dist/appSlice/selectors.d.ts +4 -51
- package/dist/appSlice/selectors.js +3 -4
- package/dist/appSlice/selectors.js.map +1 -1
- package/dist/appSlice/thunks.d.cts +1 -1
- package/dist/appSlice/thunks.d.ts +1 -1
- package/dist/auth.cjs +2 -2
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/commonSelectors.cjs +2 -2
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.d.cts +10 -2
- package/dist/commonSelectors.d.ts +10 -2
- package/dist/commonSelectors.js.map +1 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.js.map +1 -1
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +2 -2
- package/dist/deploymentsSlice/selectors.d.ts +2 -2
- package/dist/deploymentsSlice/selectors.js.map +1 -1
- package/dist/deploymentsSlice/thunks.cjs +1 -0
- package/dist/deploymentsSlice/thunks.d.cts +9 -4
- package/dist/deploymentsSlice/thunks.d.ts +9 -4
- package/dist/deploymentsSlice/thunks.js +2 -2
- package/dist/devicesSlice/index.cjs +4 -0
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.d.cts +1 -1
- package/dist/devicesSlice/index.d.ts +1 -1
- package/dist/devicesSlice/index.js +4 -0
- package/dist/devicesSlice/index.js.map +1 -1
- package/dist/devicesSlice/mocks.d.cts +1 -0
- package/dist/devicesSlice/mocks.d.ts +1 -0
- package/dist/devicesSlice/selectors.cjs +2 -0
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +4 -3
- package/dist/devicesSlice/selectors.d.ts +4 -3
- package/dist/devicesSlice/selectors.js +2 -1
- package/dist/devicesSlice/selectors.js.map +1 -1
- package/dist/devicesSlice/thunks.cjs +2 -0
- package/dist/devicesSlice/thunks.d.cts +68 -3
- package/dist/devicesSlice/thunks.d.ts +68 -3
- package/dist/devicesSlice/thunks.js +2 -2
- package/dist/{index-CPdMUfRr.d.ts → index-BqJuhvO_.d.ts} +4 -1
- package/dist/{index-DbfM03Gj.d.cts → index-Doc_1P_Y.d.cts} +4 -1
- package/dist/liststatehook.cjs.map +1 -1
- package/dist/liststatehook.js.map +1 -1
- package/dist/locationutils.cjs.map +1 -1
- package/dist/locationutils.d.cts +1 -1
- package/dist/locationutils.d.ts +1 -1
- package/dist/locationutils.js.map +1 -1
- package/dist/monitorSlice/index.cjs.map +1 -1
- package/dist/monitorSlice/index.js.map +1 -1
- package/dist/monitorSlice/mocks.cjs.map +1 -1
- package/dist/monitorSlice/mocks.js.map +1 -1
- package/dist/monitorSlice/selectors.d.cts +1 -1
- package/dist/monitorSlice/selectors.d.ts +1 -1
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.d.cts +2 -2
- package/dist/monitorSlice/thunks.d.ts +2 -2
- package/dist/monitorSlice/thunks.js.map +1 -1
- package/dist/onboardingSlice/index.cjs.map +1 -1
- package/dist/onboardingSlice/mocks.cjs.map +1 -1
- package/dist/onboardingSlice/selectors.d.cts +1 -1
- package/dist/onboardingSlice/selectors.d.ts +1 -1
- package/dist/onboardingSlice/thunks.d.cts +1 -1
- package/dist/onboardingSlice/thunks.d.ts +1 -1
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +2 -2
- package/dist/organizationSlice/selectors.d.ts +2 -2
- package/dist/organizationSlice/selectors.js.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +4 -41
- package/dist/organizationSlice/thunks.d.ts +4 -41
- package/dist/releasesSlice/index.cjs.map +1 -1
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.d.cts +2 -2
- package/dist/releasesSlice/selectors.d.ts +2 -2
- package/dist/releasesSlice/selectors.js.map +1 -1
- package/dist/releasesSlice/thunks.cjs +39 -16
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +3 -9
- package/dist/releasesSlice/thunks.d.ts +3 -9
- package/dist/releasesSlice/thunks.js +38 -15
- package/dist/releasesSlice/thunks.js.map +1 -1
- package/dist/selectors.cjs +1 -1
- package/dist/selectors.d.cts +3 -3
- package/dist/selectors.d.ts +3 -3
- package/dist/selectors.js +3 -3
- package/dist/sockethook.cjs +3 -3
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.js.map +1 -1
- package/dist/{store-Co2ptTSm.d.ts → store-BzrMxxAO.d.ts} +112 -4
- package/dist/{store-Dd0Y2JCN.d.cts → store-xV2zaXAc.d.cts} +112 -4
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +1 -2
- package/dist/store.d.ts +1 -2
- package/dist/store.js.map +1 -1
- package/dist/storehooks.cjs +5 -4
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.d.cts +1 -1
- package/dist/storehooks.d.ts +1 -1
- package/dist/storehooks.js +1 -0
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +85 -25
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.d.cts +3 -3
- package/dist/thunks.d.ts +3 -3
- package/dist/thunks.js +76 -19
- package/dist/thunks.js.map +1 -1
- package/dist/useDeploymentDevice.cjs +2 -2
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js.map +1 -1
- package/dist/usersSlice/index.cjs.map +1 -1
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.d.cts +2 -2
- package/dist/usersSlice/selectors.d.ts +2 -2
- package/dist/usersSlice/selectors.js.map +1 -1
- package/dist/usersSlice/thunks.d.cts +1 -1
- package/dist/usersSlice/thunks.d.ts +1 -1
- package/dist/utils.cjs +2 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +3 -2
- package/dist/utils.js.map +1 -1
- package/package.json +4 -4
- package/dist/utils-C_9XEfi_.d.ts +0 -104
- package/dist/utils-DbXmZmGq.d.cts +0 -104
- /package/dist/{chunk-D6vf50IK.cjs → rolldown-runtime-D6vf50IK.cjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thunks.cjs","names":["DEVICE_LIST_DEFAULTS","createAppAsyncThunk","sliceName","Api","monitorApiUrlv1","commonErrorHandler","actions","headerNames","getDeviceFilters","convertDeviceListStateToFilters","inventoryApiUrlV2","commonErrorFallback","storeActions","alertChannels","TIMEOUTS"],"sources":["../../src/monitorSlice/thunks.ts"],"sourcesContent":["// Copyright 2021 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 type { DeviceFilter } from '@/src/devicesSlice';\nimport type { Alert, DeviceInventory, MonitorConfiguration } from '@northern.tech/types/MenderTypes';\n\nimport { actions, sliceName } from '.';\nimport storeActions from '../actions';\nimport Api from '../api/general-api';\nimport type { AlertChannelKey, DeviceIssueOptionKey } from '../constants';\nimport { DEVICE_LIST_DEFAULTS, TIMEOUTS, alertChannels, headerNames, inventoryApiUrlV2, monitorApiUrlv1 } from '../constants';\nimport { getDeviceFilters } from '../selectors';\nimport { commonErrorFallback, commonErrorHandler, createAppAsyncThunk } from '../store';\nimport { convertDeviceListStateToFilters } from '../utils';\n\nconst { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;\n\nconst cutoffLength = 75;\nconst ellipsis = '...';\nconst longTextTrimmer = (text: string): string =>\n text.length >= cutoffLength + ellipsis.length ? `${text.substring(0, cutoffLength + ellipsis.length)}${ellipsis}` : text;\n\nconst sanitizeDeviceAlerts = (alerts: Alert[]) => alerts.map(alert => ({ ...alert, fullName: alert.name, name: longTextTrimmer(alert.name || '') }));\n\ninterface GetDeviceAlertsPayload {\n config?: { issuedAfter?: string; issuedBefore?: string; page?: number; perPage?: number; sortAscending?: boolean };\n id: string;\n}\nexport const getDeviceAlerts = createAppAsyncThunk(`${sliceName}/getDeviceAlerts`, ({ id, config = {} }: GetDeviceAlertsPayload, { dispatch }) => {\n const { page = defaultPage, perPage = defaultPerPage, issuedBefore, issuedAfter, sortAscending = false } = config;\n const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : '';\n const issued_before = issuedBefore ? `&issued_before=${issuedBefore}` : '';\n return Api.get<Alert[]>(\n `${monitorApiUrlv1}/devices/${id}/alerts?page=${page}&per_page=${perPage}${issued_after}${issued_before}&sort_ascending=${sortAscending}`\n )\n .catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))\n .then(res =>\n Promise.all([\n dispatch(actions.receiveDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) })),\n dispatch(actions.setAlertListState({ total: Number(res.headers[headerNames.total]) }))\n ])\n );\n});\n\ninterface GetLatestDeviceAlertsPayload {\n config?: { page?: number; perPage?: number };\n id: string;\n}\nexport const getLatestDeviceAlerts = createAppAsyncThunk(\n `${sliceName}/getLatestDeviceAlerts`,\n ({ id, config = {} }: GetLatestDeviceAlertsPayload, { dispatch }) => {\n const { page = defaultPage, perPage = 10 } = config;\n return Api.get<Alert[]>(`${monitorApiUrlv1}/devices/${id}/alerts/latest?page=${page}&per_page=${perPage}`)\n .catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))\n .then(res => Promise.resolve(dispatch(actions.receiveLatestDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) }))));\n }\n);\n\ninterface GetIssueCountsByTypePayload {\n options?: Partial<{ filters: DeviceFilter[]; group: string; status: string; type: string }>;\n type: DeviceIssueOptionKey;\n}\nexport const getIssueCountsByType = createAppAsyncThunk(\n `${sliceName}/getIssueCountsByType`,\n async ({ type, options = {} }: GetIssueCountsByTypePayload, { dispatch, getState }) => {\n const state = getState();\n const { filters = getDeviceFilters(state), group, status, ...remainder } = options;\n const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters({\n ...remainder,\n filters,\n group,\n offlineThreshold: state.app.offlineThreshold,\n selectedIssues: [type],\n status\n });\n const res = await Api.post<DeviceInventory[]>(`${inventoryApiUrlV2}/filters/search`, {\n page: 1,\n per_page: 1,\n filters: filterTerms,\n attributes: [{ scope: 'identity', attribute: 'status' }]\n }).catch(err => commonErrorHandler(err, `Retrieving issue counts failed:`, dispatch, commonErrorFallback));\n const total = nonMonitorFilters.length ? state.monitor.issueCounts.byType[type].total : Number(res.headers[headerNames.total]);\n const filtered = nonMonitorFilters.length ? Number(res.headers[headerNames.total]) : total;\n if (total === state.monitor.issueCounts.byType[type].total && filtered === state.monitor.issueCounts.byType[type].filtered) {\n return;\n }\n return dispatch(actions.receiveDeviceIssueCounts({ counts: { filtered, total }, issueType: type }));\n }\n);\n\nexport const getDeviceMonitorConfig = createAppAsyncThunk(`${sliceName}/getDeviceMonitorConfig`, (id: string, { dispatch }) =>\n Api.get<MonitorConfiguration[]>(`${monitorApiUrlv1}/devices/${id}/config`)\n .catch(err => commonErrorHandler(err, `Retrieving device monitor config for device ${id} failed:`, dispatch))\n .then(({ data }) => Promise.all([dispatch(storeActions.receivedDevice({ id, monitors: data }), Promise.resolve(data))]))\n);\n\ninterface ChangeNotificationSettingPayload {\n channel?: AlertChannelKey;\n enabled: boolean;\n}\nexport const changeNotificationSetting = createAppAsyncThunk(\n `${sliceName}/changeNotificationSetting`,\n ({ enabled, channel = alertChannels.email as AlertChannelKey }: ChangeNotificationSettingPayload, { dispatch }) =>\n Api.put(`${monitorApiUrlv1}/settings/global/channel/alerts/${channel}/status`, { enabled })\n .catch(err => commonErrorHandler(err, `${enabled ? 'En' : 'Dis'}abling ${channel} alerts failed:`, dispatch))\n .then(() =>\n Promise.all([\n dispatch(actions.changeAlertChannel({ channel, enabled })),\n dispatch(\n storeActions.setSnackbar({ message: `Successfully ${enabled ? 'en' : 'dis'}abled ${channel} alerts`, autoHideDuration: TIMEOUTS.fiveSeconds })\n )\n ])\n )\n);\n"],"mappings":";;;;;;;;;;AAyBA,MAAM,EAAE,MAAM,aAAa,SAAS,mBAAmBA,+BAAAA;AAGvD,MAAM,WAAW;AACjB,MAAM,mBAAmB,SACvB,KAAK,UAAU,KAAiC,GAAG,KAAK,UAAU,GAAG,EAA8B,IAAI,aAAa;AAEtH,MAAM,wBAAwB,WAAoB,OAAO,KAAI,WAAU;CAAE,GAAG;CAAO,UAAU,MAAM;CAAM,MAAM,gBAAgB,MAAM,QAAQ,EAAE;AAAE,EAAE;AAMnJ,MAAa,kBAAkBC,cAAAA,oBAAoB,GAAGC,2BAAAA,UAAU,oBAAoB,EAAE,IAAI,SAAS,CAAC,KAA6B,EAAE,eAAe;CAChJ,MAAM,EAAE,OAAO,aAAa,UAAU,gBAAgB,cAAc,aAAa,gBAAgB,UAAU;CAC3G,MAAM,eAAe,cAAc,iBAAiB,gBAAgB;CACpE,MAAM,gBAAgB,eAAe,kBAAkB,iBAAiB;CACxE,OAAOC,wBAAAA,QAAI,IACT,GAAGC,+BAAAA,gBAAgB,WAAW,GAAG,eAAe,KAAK,YAAY,UAAU,eAAe,cAAc,kBAAkB,eAC5H,
|
|
1
|
+
{"version":3,"file":"thunks.cjs","names":["DEVICE_LIST_DEFAULTS","createAppAsyncThunk","sliceName","Api","monitorApiUrlv1","commonErrorHandler","actions","headerNames","getDeviceFilters","convertDeviceListStateToFilters","inventoryApiUrlV2","commonErrorFallback","storeActions","alertChannels","TIMEOUTS"],"sources":["../../src/monitorSlice/thunks.ts"],"sourcesContent":["// Copyright 2021 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 type { DeviceFilter } from '@/src/devicesSlice';\nimport type { Alert, DeviceInventory, MonitorConfiguration } from '@northern.tech/types/MenderTypes';\n\nimport { actions, sliceName } from '.';\nimport storeActions from '../actions';\nimport Api from '../api/general-api';\nimport type { AlertChannelKey, DeviceIssueOptionKey } from '../constants';\nimport { DEVICE_LIST_DEFAULTS, TIMEOUTS, alertChannels, headerNames, inventoryApiUrlV2, monitorApiUrlv1 } from '../constants';\nimport { getDeviceFilters } from '../selectors';\nimport { commonErrorFallback, commonErrorHandler, createAppAsyncThunk } from '../store';\nimport { convertDeviceListStateToFilters } from '../utils';\n\nconst { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;\n\nconst cutoffLength = 75;\nconst ellipsis = '...';\nconst longTextTrimmer = (text: string): string =>\n text.length >= cutoffLength + ellipsis.length ? `${text.substring(0, cutoffLength + ellipsis.length)}${ellipsis}` : text;\n\nconst sanitizeDeviceAlerts = (alerts: Alert[]) => alerts.map(alert => ({ ...alert, fullName: alert.name, name: longTextTrimmer(alert.name || '') }));\n\ninterface GetDeviceAlertsPayload {\n config?: { issuedAfter?: string; issuedBefore?: string; page?: number; perPage?: number; sortAscending?: boolean };\n id: string;\n}\nexport const getDeviceAlerts = createAppAsyncThunk(`${sliceName}/getDeviceAlerts`, ({ id, config = {} }: GetDeviceAlertsPayload, { dispatch }) => {\n const { page = defaultPage, perPage = defaultPerPage, issuedBefore, issuedAfter, sortAscending = false } = config;\n const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : '';\n const issued_before = issuedBefore ? `&issued_before=${issuedBefore}` : '';\n return Api.get<Alert[]>(\n `${monitorApiUrlv1}/devices/${id}/alerts?page=${page}&per_page=${perPage}${issued_after}${issued_before}&sort_ascending=${sortAscending}`\n )\n .catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))\n .then(res =>\n Promise.all([\n dispatch(actions.receiveDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) })),\n dispatch(actions.setAlertListState({ total: Number(res.headers[headerNames.total]) }))\n ])\n );\n});\n\ninterface GetLatestDeviceAlertsPayload {\n config?: { page?: number; perPage?: number };\n id: string;\n}\nexport const getLatestDeviceAlerts = createAppAsyncThunk(\n `${sliceName}/getLatestDeviceAlerts`,\n ({ id, config = {} }: GetLatestDeviceAlertsPayload, { dispatch }) => {\n const { page = defaultPage, perPage = 10 } = config;\n return Api.get<Alert[]>(`${monitorApiUrlv1}/devices/${id}/alerts/latest?page=${page}&per_page=${perPage}`)\n .catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))\n .then(res => Promise.resolve(dispatch(actions.receiveLatestDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) }))));\n }\n);\n\ninterface GetIssueCountsByTypePayload {\n options?: Partial<{ filters: DeviceFilter[]; group: string; status: string; type: string }>;\n type: DeviceIssueOptionKey;\n}\nexport const getIssueCountsByType = createAppAsyncThunk(\n `${sliceName}/getIssueCountsByType`,\n async ({ type, options = {} }: GetIssueCountsByTypePayload, { dispatch, getState }) => {\n const state = getState();\n const { filters = getDeviceFilters(state), group, status, ...remainder } = options;\n const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters({\n ...remainder,\n filters,\n group,\n offlineThreshold: state.app.offlineThreshold,\n selectedIssues: [type],\n status\n });\n const res = await Api.post<DeviceInventory[]>(`${inventoryApiUrlV2}/filters/search`, {\n page: 1,\n per_page: 1,\n filters: filterTerms,\n attributes: [{ scope: 'identity', attribute: 'status' }]\n }).catch(err => commonErrorHandler(err, `Retrieving issue counts failed:`, dispatch, commonErrorFallback));\n const total = nonMonitorFilters.length ? state.monitor.issueCounts.byType[type].total : Number(res.headers[headerNames.total]);\n const filtered = nonMonitorFilters.length ? Number(res.headers[headerNames.total]) : total;\n if (total === state.monitor.issueCounts.byType[type].total && filtered === state.monitor.issueCounts.byType[type].filtered) {\n return;\n }\n return dispatch(actions.receiveDeviceIssueCounts({ counts: { filtered, total }, issueType: type }));\n }\n);\n\nexport const getDeviceMonitorConfig = createAppAsyncThunk(`${sliceName}/getDeviceMonitorConfig`, (id: string, { dispatch }) =>\n Api.get<MonitorConfiguration[]>(`${monitorApiUrlv1}/devices/${id}/config`)\n .catch(err => commonErrorHandler(err, `Retrieving device monitor config for device ${id} failed:`, dispatch))\n .then(({ data }) => Promise.all([dispatch(storeActions.receivedDevice({ id, monitors: data }), Promise.resolve(data))]))\n);\n\ninterface ChangeNotificationSettingPayload {\n channel?: AlertChannelKey;\n enabled: boolean;\n}\nexport const changeNotificationSetting = createAppAsyncThunk(\n `${sliceName}/changeNotificationSetting`,\n ({ enabled, channel = alertChannels.email as AlertChannelKey }: ChangeNotificationSettingPayload, { dispatch }) =>\n Api.put(`${monitorApiUrlv1}/settings/global/channel/alerts/${channel}/status`, { enabled })\n .catch(err => commonErrorHandler(err, `${enabled ? 'En' : 'Dis'}abling ${channel} alerts failed:`, dispatch))\n .then(() =>\n Promise.all([\n dispatch(actions.changeAlertChannel({ channel, enabled })),\n dispatch(\n storeActions.setSnackbar({ message: `Successfully ${enabled ? 'en' : 'dis'}abled ${channel} alerts`, autoHideDuration: TIMEOUTS.fiveSeconds })\n )\n ])\n )\n);\n"],"mappings":";;;;;;;;;;AAyBA,MAAM,EAAE,MAAM,aAAa,SAAS,mBAAmBA,+BAAAA;AAGvD,MAAM,WAAW;AACjB,MAAM,mBAAmB,SACvB,KAAK,UAAU,KAAiC,GAAG,KAAK,UAAU,GAAG,EAA8B,IAAI,aAAa;AAEtH,MAAM,wBAAwB,WAAoB,OAAO,KAAI,WAAU;CAAE,GAAG;CAAO,UAAU,MAAM;CAAM,MAAM,gBAAgB,MAAM,QAAQ,EAAE;AAAE,EAAE;AAMnJ,MAAa,kBAAkBC,cAAAA,oBAAoB,GAAGC,2BAAAA,UAAU,oBAAoB,EAAE,IAAI,SAAS,CAAC,KAA6B,EAAE,eAAe;CAChJ,MAAM,EAAE,OAAO,aAAa,UAAU,gBAAgB,cAAc,aAAa,gBAAgB,UAAU;CAC3G,MAAM,eAAe,cAAc,iBAAiB,gBAAgB;CACpE,MAAM,gBAAgB,eAAe,kBAAkB,iBAAiB;CACxE,OAAOC,wBAAAA,QAAI,IACT,GAAGC,+BAAAA,gBAAgB,WAAW,GAAG,eAAe,KAAK,YAAY,UAAU,eAAe,cAAc,kBAAkB,eAC5H,CAAC,CACE,OAAM,QAAOC,cAAAA,mBAAmB,KAAK,uCAAuC,GAAG,WAAW,QAAQ,CAAC,CAAC,CACpG,MAAK,QACJ,QAAQ,IAAI,CACV,SAASC,2BAAAA,QAAQ,oBAAoB;EAAE,UAAU;EAAI,QAAQ,qBAAqB,IAAI,IAAI;CAAE,CAAC,CAAC,GAC9F,SAASA,2BAAAA,QAAQ,kBAAkB,EAAE,OAA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,SAAS,gBAAgB,UAAU,OAAO,MAAM,QAAQ,QAAQ;CAAU,kBAAkBE,kBAAAA,SAAS;AAAY,CAAC,CAC/I,CACF,CAAC,CACH,CACN"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lt as AlertChannelKey, m as DeviceIssueOptionKey } from "../constants-_p6w8uEp.cjs";
|
|
2
|
-
import { n as DeviceFilter, t as Device } from "../index-
|
|
2
|
+
import { n as DeviceFilter, t as Device } from "../index-Doc_1P_Y.cjs";
|
|
3
3
|
import { i as SnackbarContent } from "../index-C8QadAm7.cjs";
|
|
4
|
-
import { r as RootState, t as AppDispatch } from "../store-
|
|
4
|
+
import { r as RootState, t as AppDispatch } from "../store-xV2zaXAc.cjs";
|
|
5
5
|
|
|
6
6
|
//#region src/monitorSlice/thunks.d.ts
|
|
7
7
|
interface GetDeviceAlertsPayload {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lt as AlertChannelKey, m as DeviceIssueOptionKey } from "../constants-OcdoVk6f.js";
|
|
2
|
-
import { n as DeviceFilter, t as Device } from "../index-
|
|
2
|
+
import { n as DeviceFilter, t as Device } from "../index-BqJuhvO_.js";
|
|
3
3
|
import { i as SnackbarContent } from "../index-BLvjQfGj.js";
|
|
4
|
-
import { r as RootState, t as AppDispatch } from "../store-
|
|
4
|
+
import { r as RootState, t as AppDispatch } from "../store-BzrMxxAO.js";
|
|
5
5
|
|
|
6
6
|
//#region src/monitorSlice/thunks.d.ts
|
|
7
7
|
interface GetDeviceAlertsPayload {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thunks.js","names":["storeActions"],"sources":["../../src/monitorSlice/thunks.ts"],"sourcesContent":["// Copyright 2021 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 type { DeviceFilter } from '@/src/devicesSlice';\nimport type { Alert, DeviceInventory, MonitorConfiguration } from '@northern.tech/types/MenderTypes';\n\nimport { actions, sliceName } from '.';\nimport storeActions from '../actions';\nimport Api from '../api/general-api';\nimport type { AlertChannelKey, DeviceIssueOptionKey } from '../constants';\nimport { DEVICE_LIST_DEFAULTS, TIMEOUTS, alertChannels, headerNames, inventoryApiUrlV2, monitorApiUrlv1 } from '../constants';\nimport { getDeviceFilters } from '../selectors';\nimport { commonErrorFallback, commonErrorHandler, createAppAsyncThunk } from '../store';\nimport { convertDeviceListStateToFilters } from '../utils';\n\nconst { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;\n\nconst cutoffLength = 75;\nconst ellipsis = '...';\nconst longTextTrimmer = (text: string): string =>\n text.length >= cutoffLength + ellipsis.length ? `${text.substring(0, cutoffLength + ellipsis.length)}${ellipsis}` : text;\n\nconst sanitizeDeviceAlerts = (alerts: Alert[]) => alerts.map(alert => ({ ...alert, fullName: alert.name, name: longTextTrimmer(alert.name || '') }));\n\ninterface GetDeviceAlertsPayload {\n config?: { issuedAfter?: string; issuedBefore?: string; page?: number; perPage?: number; sortAscending?: boolean };\n id: string;\n}\nexport const getDeviceAlerts = createAppAsyncThunk(`${sliceName}/getDeviceAlerts`, ({ id, config = {} }: GetDeviceAlertsPayload, { dispatch }) => {\n const { page = defaultPage, perPage = defaultPerPage, issuedBefore, issuedAfter, sortAscending = false } = config;\n const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : '';\n const issued_before = issuedBefore ? `&issued_before=${issuedBefore}` : '';\n return Api.get<Alert[]>(\n `${monitorApiUrlv1}/devices/${id}/alerts?page=${page}&per_page=${perPage}${issued_after}${issued_before}&sort_ascending=${sortAscending}`\n )\n .catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))\n .then(res =>\n Promise.all([\n dispatch(actions.receiveDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) })),\n dispatch(actions.setAlertListState({ total: Number(res.headers[headerNames.total]) }))\n ])\n );\n});\n\ninterface GetLatestDeviceAlertsPayload {\n config?: { page?: number; perPage?: number };\n id: string;\n}\nexport const getLatestDeviceAlerts = createAppAsyncThunk(\n `${sliceName}/getLatestDeviceAlerts`,\n ({ id, config = {} }: GetLatestDeviceAlertsPayload, { dispatch }) => {\n const { page = defaultPage, perPage = 10 } = config;\n return Api.get<Alert[]>(`${monitorApiUrlv1}/devices/${id}/alerts/latest?page=${page}&per_page=${perPage}`)\n .catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))\n .then(res => Promise.resolve(dispatch(actions.receiveLatestDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) }))));\n }\n);\n\ninterface GetIssueCountsByTypePayload {\n options?: Partial<{ filters: DeviceFilter[]; group: string; status: string; type: string }>;\n type: DeviceIssueOptionKey;\n}\nexport const getIssueCountsByType = createAppAsyncThunk(\n `${sliceName}/getIssueCountsByType`,\n async ({ type, options = {} }: GetIssueCountsByTypePayload, { dispatch, getState }) => {\n const state = getState();\n const { filters = getDeviceFilters(state), group, status, ...remainder } = options;\n const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters({\n ...remainder,\n filters,\n group,\n offlineThreshold: state.app.offlineThreshold,\n selectedIssues: [type],\n status\n });\n const res = await Api.post<DeviceInventory[]>(`${inventoryApiUrlV2}/filters/search`, {\n page: 1,\n per_page: 1,\n filters: filterTerms,\n attributes: [{ scope: 'identity', attribute: 'status' }]\n }).catch(err => commonErrorHandler(err, `Retrieving issue counts failed:`, dispatch, commonErrorFallback));\n const total = nonMonitorFilters.length ? state.monitor.issueCounts.byType[type].total : Number(res.headers[headerNames.total]);\n const filtered = nonMonitorFilters.length ? Number(res.headers[headerNames.total]) : total;\n if (total === state.monitor.issueCounts.byType[type].total && filtered === state.monitor.issueCounts.byType[type].filtered) {\n return;\n }\n return dispatch(actions.receiveDeviceIssueCounts({ counts: { filtered, total }, issueType: type }));\n }\n);\n\nexport const getDeviceMonitorConfig = createAppAsyncThunk(`${sliceName}/getDeviceMonitorConfig`, (id: string, { dispatch }) =>\n Api.get<MonitorConfiguration[]>(`${monitorApiUrlv1}/devices/${id}/config`)\n .catch(err => commonErrorHandler(err, `Retrieving device monitor config for device ${id} failed:`, dispatch))\n .then(({ data }) => Promise.all([dispatch(storeActions.receivedDevice({ id, monitors: data }), Promise.resolve(data))]))\n);\n\ninterface ChangeNotificationSettingPayload {\n channel?: AlertChannelKey;\n enabled: boolean;\n}\nexport const changeNotificationSetting = createAppAsyncThunk(\n `${sliceName}/changeNotificationSetting`,\n ({ enabled, channel = alertChannels.email as AlertChannelKey }: ChangeNotificationSettingPayload, { dispatch }) =>\n Api.put(`${monitorApiUrlv1}/settings/global/channel/alerts/${channel}/status`, { enabled })\n .catch(err => commonErrorHandler(err, `${enabled ? 'En' : 'Dis'}abling ${channel} alerts failed:`, dispatch))\n .then(() =>\n Promise.all([\n dispatch(actions.changeAlertChannel({ channel, enabled })),\n dispatch(\n storeActions.setSnackbar({ message: `Successfully ${enabled ? 'en' : 'dis'}abled ${channel} alerts`, autoHideDuration: TIMEOUTS.fiveSeconds })\n )\n ])\n )\n);\n"],"mappings":";;;;;;;;AAyBA,MAAM,EAAE,MAAM,aAAa,SAAS,mBAAmB;AAGvD,MAAM,WAAW;AACjB,MAAM,mBAAmB,SACvB,KAAK,UAAU,KAAiC,GAAG,KAAK,UAAU,GAAG,EAA8B,IAAI,aAAa;AAEtH,MAAM,wBAAwB,WAAoB,OAAO,KAAI,WAAU;CAAE,GAAG;CAAO,UAAU,MAAM;CAAM,MAAM,gBAAgB,MAAM,QAAQ,EAAE;AAAE,EAAE;AAMnJ,MAAa,kBAAkB,oBAAoB,GAAG,UAAU,oBAAoB,EAAE,IAAI,SAAS,CAAC,KAA6B,EAAE,eAAe;CAChJ,MAAM,EAAE,OAAO,aAAa,UAAU,gBAAgB,cAAc,aAAa,gBAAgB,UAAU;CAC3G,MAAM,eAAe,cAAc,iBAAiB,gBAAgB;CACpE,MAAM,gBAAgB,eAAe,kBAAkB,iBAAiB;CACxE,OAAO,IAAI,IACT,GAAG,gBAAgB,WAAW,GAAG,eAAe,KAAK,YAAY,UAAU,eAAe,cAAc,kBAAkB,eAC5H,
|
|
1
|
+
{"version":3,"file":"thunks.js","names":["storeActions"],"sources":["../../src/monitorSlice/thunks.ts"],"sourcesContent":["// Copyright 2021 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 type { DeviceFilter } from '@/src/devicesSlice';\nimport type { Alert, DeviceInventory, MonitorConfiguration } from '@northern.tech/types/MenderTypes';\n\nimport { actions, sliceName } from '.';\nimport storeActions from '../actions';\nimport Api from '../api/general-api';\nimport type { AlertChannelKey, DeviceIssueOptionKey } from '../constants';\nimport { DEVICE_LIST_DEFAULTS, TIMEOUTS, alertChannels, headerNames, inventoryApiUrlV2, monitorApiUrlv1 } from '../constants';\nimport { getDeviceFilters } from '../selectors';\nimport { commonErrorFallback, commonErrorHandler, createAppAsyncThunk } from '../store';\nimport { convertDeviceListStateToFilters } from '../utils';\n\nconst { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;\n\nconst cutoffLength = 75;\nconst ellipsis = '...';\nconst longTextTrimmer = (text: string): string =>\n text.length >= cutoffLength + ellipsis.length ? `${text.substring(0, cutoffLength + ellipsis.length)}${ellipsis}` : text;\n\nconst sanitizeDeviceAlerts = (alerts: Alert[]) => alerts.map(alert => ({ ...alert, fullName: alert.name, name: longTextTrimmer(alert.name || '') }));\n\ninterface GetDeviceAlertsPayload {\n config?: { issuedAfter?: string; issuedBefore?: string; page?: number; perPage?: number; sortAscending?: boolean };\n id: string;\n}\nexport const getDeviceAlerts = createAppAsyncThunk(`${sliceName}/getDeviceAlerts`, ({ id, config = {} }: GetDeviceAlertsPayload, { dispatch }) => {\n const { page = defaultPage, perPage = defaultPerPage, issuedBefore, issuedAfter, sortAscending = false } = config;\n const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : '';\n const issued_before = issuedBefore ? `&issued_before=${issuedBefore}` : '';\n return Api.get<Alert[]>(\n `${monitorApiUrlv1}/devices/${id}/alerts?page=${page}&per_page=${perPage}${issued_after}${issued_before}&sort_ascending=${sortAscending}`\n )\n .catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))\n .then(res =>\n Promise.all([\n dispatch(actions.receiveDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) })),\n dispatch(actions.setAlertListState({ total: Number(res.headers[headerNames.total]) }))\n ])\n );\n});\n\ninterface GetLatestDeviceAlertsPayload {\n config?: { page?: number; perPage?: number };\n id: string;\n}\nexport const getLatestDeviceAlerts = createAppAsyncThunk(\n `${sliceName}/getLatestDeviceAlerts`,\n ({ id, config = {} }: GetLatestDeviceAlertsPayload, { dispatch }) => {\n const { page = defaultPage, perPage = 10 } = config;\n return Api.get<Alert[]>(`${monitorApiUrlv1}/devices/${id}/alerts/latest?page=${page}&per_page=${perPage}`)\n .catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))\n .then(res => Promise.resolve(dispatch(actions.receiveLatestDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) }))));\n }\n);\n\ninterface GetIssueCountsByTypePayload {\n options?: Partial<{ filters: DeviceFilter[]; group: string; status: string; type: string }>;\n type: DeviceIssueOptionKey;\n}\nexport const getIssueCountsByType = createAppAsyncThunk(\n `${sliceName}/getIssueCountsByType`,\n async ({ type, options = {} }: GetIssueCountsByTypePayload, { dispatch, getState }) => {\n const state = getState();\n const { filters = getDeviceFilters(state), group, status, ...remainder } = options;\n const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters({\n ...remainder,\n filters,\n group,\n offlineThreshold: state.app.offlineThreshold,\n selectedIssues: [type],\n status\n });\n const res = await Api.post<DeviceInventory[]>(`${inventoryApiUrlV2}/filters/search`, {\n page: 1,\n per_page: 1,\n filters: filterTerms,\n attributes: [{ scope: 'identity', attribute: 'status' }]\n }).catch(err => commonErrorHandler(err, `Retrieving issue counts failed:`, dispatch, commonErrorFallback));\n const total = nonMonitorFilters.length ? state.monitor.issueCounts.byType[type].total : Number(res.headers[headerNames.total]);\n const filtered = nonMonitorFilters.length ? Number(res.headers[headerNames.total]) : total;\n if (total === state.monitor.issueCounts.byType[type].total && filtered === state.monitor.issueCounts.byType[type].filtered) {\n return;\n }\n return dispatch(actions.receiveDeviceIssueCounts({ counts: { filtered, total }, issueType: type }));\n }\n);\n\nexport const getDeviceMonitorConfig = createAppAsyncThunk(`${sliceName}/getDeviceMonitorConfig`, (id: string, { dispatch }) =>\n Api.get<MonitorConfiguration[]>(`${monitorApiUrlv1}/devices/${id}/config`)\n .catch(err => commonErrorHandler(err, `Retrieving device monitor config for device ${id} failed:`, dispatch))\n .then(({ data }) => Promise.all([dispatch(storeActions.receivedDevice({ id, monitors: data }), Promise.resolve(data))]))\n);\n\ninterface ChangeNotificationSettingPayload {\n channel?: AlertChannelKey;\n enabled: boolean;\n}\nexport const changeNotificationSetting = createAppAsyncThunk(\n `${sliceName}/changeNotificationSetting`,\n ({ enabled, channel = alertChannels.email as AlertChannelKey }: ChangeNotificationSettingPayload, { dispatch }) =>\n Api.put(`${monitorApiUrlv1}/settings/global/channel/alerts/${channel}/status`, { enabled })\n .catch(err => commonErrorHandler(err, `${enabled ? 'En' : 'Dis'}abling ${channel} alerts failed:`, dispatch))\n .then(() =>\n Promise.all([\n dispatch(actions.changeAlertChannel({ channel, enabled })),\n dispatch(\n storeActions.setSnackbar({ message: `Successfully ${enabled ? 'en' : 'dis'}abled ${channel} alerts`, autoHideDuration: TIMEOUTS.fiveSeconds })\n )\n ])\n )\n);\n"],"mappings":";;;;;;;;AAyBA,MAAM,EAAE,MAAM,aAAa,SAAS,mBAAmB;AAGvD,MAAM,WAAW;AACjB,MAAM,mBAAmB,SACvB,KAAK,UAAU,KAAiC,GAAG,KAAK,UAAU,GAAG,EAA8B,IAAI,aAAa;AAEtH,MAAM,wBAAwB,WAAoB,OAAO,KAAI,WAAU;CAAE,GAAG;CAAO,UAAU,MAAM;CAAM,MAAM,gBAAgB,MAAM,QAAQ,EAAE;AAAE,EAAE;AAMnJ,MAAa,kBAAkB,oBAAoB,GAAG,UAAU,oBAAoB,EAAE,IAAI,SAAS,CAAC,KAA6B,EAAE,eAAe;CAChJ,MAAM,EAAE,OAAO,aAAa,UAAU,gBAAgB,cAAc,aAAa,gBAAgB,UAAU;CAC3G,MAAM,eAAe,cAAc,iBAAiB,gBAAgB;CACpE,MAAM,gBAAgB,eAAe,kBAAkB,iBAAiB;CACxE,OAAO,IAAI,IACT,GAAG,gBAAgB,WAAW,GAAG,eAAe,KAAK,YAAY,UAAU,eAAe,cAAc,kBAAkB,eAC5H,CAAC,CACE,OAAM,QAAO,mBAAmB,KAAK,uCAAuC,GAAG,WAAW,QAAQ,CAAC,CAAC,CACpG,MAAK,QACJ,QAAQ,IAAI,CACV,SAAS,QAAQ,oBAAoB;EAAE,UAAU;EAAI,QAAQ,qBAAqB,IAAI,IAAI;CAAE,CAAC,CAAC,GAC9F,SAAS,QAAQ,kBAAkB,EAAE,OAAO,OAAO,IAAI,QAAQ,YAAY,MAAM,EAAE,CAAC,CAAC,CACvF,CAAC,CACH;AACJ,CAAC;AAMD,MAAa,wBAAwB,oBACnC,GAAG,UAAU,0BACZ,EAAE,IAAI,SAAS,CAAC,KA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QAAQ,yBAAyB;EAAE,QAAQ;GAAE;GAAU;EAAM;EAAG,WAAW;CAAK,CAAC,CAAC;AACpG,CACF;AAEA,MAAa,yBAAyB,oBAAoB,GAAG,UAAU,2BAA2B,IAAY,EAAE,eAC9G,IAAI,IAA4B,GAAG,gBAAgB,WAAW,GAAG,QAAQ,CAAC,CACvE,OAAM,QAAO,mBAAmB,KAAK,+CAA+C,GAAG,WAAW,QAAQ,CAAC,CAAC,CAC5G,MAAM,EAAE,WAAW,QAAQ,IAAI,CAAC,SAASA,gBAAa,eAAe;CAAE;CAAI,UAAU;AAAK,CAAC,GAAG,QAAQ,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAC3H;AAMA,MAAa,4BAA4B,oBACvC,GAAG,UAAU,8BACZ,EAAE,SAAS,UAAU,cAAc,SAA8D,EAAE,eAClG,IAAI,IAAI,GAAG,gBAAgB,kCAAkC,QAAQ,UAAU,EAAE,QAAQ,CAAC,CAAC,CACxF,OAAM,QAAO,mBAAmB,KAAK,GAAG,UAAU,OAAO,MAAM,UAAU,QAAQ,kBAAkB,QAAQ,CAAC,CAAC,CAC7G,WACC,QAAQ,IAAI,CACV,SAAS,QAAQ,mBAAmB;CAAE;CAAS;AAAQ,CAAC,CAAC,GACzD,SACEA,gBAAa,YAAY;CAAE,SAAS,gBAAgB,UAAU,OAAO,MAAM,QAAQ,QAAQ;CAAU,kBAAkB,SAAS;AAAY,CAAC,CAC/I,CACF,CAAC,CACH,CACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/onboardingSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nexport const sliceName = 'onboarding';\n\nexport type OnboardingApproach = 'virtual' | 'physical' | 'mcu';\n\nexport type OnboardingSliceType = {\n address?: string;\n approach: OnboardingApproach | null;\n complete: boolean;\n demoArtifactPort: number;\n deviceConnection?: string;\n deviceType: string[] | string | null;\n progress: string | null;\n showTips: boolean | null;\n showTipsDialog: boolean;\n};\n\nexport const initialState: OnboardingSliceType = {\n approach: null,\n complete: false,\n deviceType: null,\n demoArtifactPort: 85,\n progress: null,\n showTips: null,\n showTipsDialog: false\n};\n\nexport const onboardingSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setOnboardingState: (state, action: PayloadAction<Partial<OnboardingSliceType>>) => ({ ...state, ...action.payload }),\n setDemoArtifactPort: (state, action: PayloadAction<number>) => {\n state.demoArtifactPort = action.payload;\n },\n setShowOnboardingHelp: (state, action: PayloadAction<boolean>) => {\n state.showTips = action.payload;\n },\n setShowDismissOnboardingTipsDialog: (state, action: PayloadAction<boolean>) => {\n state.showTipsDialog = action.payload;\n },\n setOnboardingComplete: (state, action: PayloadAction<boolean>) => {\n state.complete = action.payload;\n },\n setOnboardingProgress: (state, action: PayloadAction<string>) => {\n state.progress = action.payload;\n },\n setOnboardingDeviceType: (state, action: PayloadAction<string[] | string>) => {\n state.deviceType = action.payload;\n },\n setOnboardingApproach: (state, action: PayloadAction<OnboardingApproach>) => {\n state.approach = action.payload;\n }\n }\n});\n\nexport const actions = onboardingSlice.actions;\nexport default onboardingSlice.reducer;\n"],"mappings":";;;;;;AAgBA,MAAa,YAAY;AAgBzB,MAAa,eAAoC;CAC/C,UAAU;CACV,UAAU;CACV,YAAY;CACZ,kBAAkB;CAClB,UAAU;CACV,UAAU;CACV,gBAAgB;AAClB;AAEA,MAAa,mBAAA,GAAA,iBAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/onboardingSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nexport const sliceName = 'onboarding';\n\nexport type OnboardingApproach = 'virtual' | 'physical' | 'mcu';\n\nexport type OnboardingSliceType = {\n address?: string;\n approach: OnboardingApproach | null;\n complete: boolean;\n demoArtifactPort: number;\n deviceConnection?: string;\n deviceType: string[] | string | null;\n progress: string | null;\n showTips: boolean | null;\n showTipsDialog: boolean;\n};\n\nexport const initialState: OnboardingSliceType = {\n approach: null,\n complete: false,\n deviceType: null,\n demoArtifactPort: 85,\n progress: null,\n showTips: null,\n showTipsDialog: false\n};\n\nexport const onboardingSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setOnboardingState: (state, action: PayloadAction<Partial<OnboardingSliceType>>) => ({ ...state, ...action.payload }),\n setDemoArtifactPort: (state, action: PayloadAction<number>) => {\n state.demoArtifactPort = action.payload;\n },\n setShowOnboardingHelp: (state, action: PayloadAction<boolean>) => {\n state.showTips = action.payload;\n },\n setShowDismissOnboardingTipsDialog: (state, action: PayloadAction<boolean>) => {\n state.showTipsDialog = action.payload;\n },\n setOnboardingComplete: (state, action: PayloadAction<boolean>) => {\n state.complete = action.payload;\n },\n setOnboardingProgress: (state, action: PayloadAction<string>) => {\n state.progress = action.payload;\n },\n setOnboardingDeviceType: (state, action: PayloadAction<string[] | string>) => {\n state.deviceType = action.payload;\n },\n setOnboardingApproach: (state, action: PayloadAction<OnboardingApproach>) => {\n state.approach = action.payload;\n }\n }\n});\n\nexport const actions = onboardingSlice.actions;\nexport default onboardingSlice.reducer;\n"],"mappings":";;;;;;AAgBA,MAAa,YAAY;AAgBzB,MAAa,eAAoC;CAC/C,UAAU;CACV,UAAU;CACV,YAAY;CACZ,kBAAkB;CAClB,UAAU;CACV,UAAU;CACV,gBAAgB;AAClB;AAEA,MAAa,mBAAA,GAAA,iBAAA,YAAA,CAA8B;CACzC,MAAM;CACN;CACA,UAAU;EACR,qBAAqB,OAAO,YAAyD;GAAE,GAAG;GAAO,GAAG,OAAO;EAAQ;EACnH,sBAAsB,OAAO,WAAkC;GAC7D,MAAM,mBAAmB,OAAO;EAClC;EACA,wBAAwB,OAAO,WAAmC;GAChE,MAAM,WAAW,OAAO;EAC1B;EACA,qCAAqC,OAAO,WAAmC;GAC7E,MAAM,iBAAiB,OAAO;EAChC;EACA,wBAAwB,OAAO,WAAmC;GAChE,MAAM,WAAW,OAAO;EAC1B;EACA,wBAAwB,OAAO,WAAkC;GAC/D,MAAM,WAAW,OAAO;EAC1B;EACA,0BAA0B,OAAO,WAA6C;GAC5E,MAAM,aAAa,OAAO;EAC5B;EACA,wBAAwB,OAAO,WAA8C;GAC3E,MAAM,WAAW,OAAO;EAC1B;CACF;AACF,CAAC;AAED,MAAa,UAAU,gBAAgB;AACvC,IAAA,0BAAe,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.cjs","names":["initialState"],"sources":["../../src/onboardingSlice/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 progress: undefined,\n complete: false,\n demoArtifactPort: 85,\n showConnectDeviceDialog: false,\n showTipsDialog: false\n};\n"],"mappings":";;AAeA,MAAa,YAAY;CACvB,wBAAGA,
|
|
1
|
+
{"version":3,"file":"mocks.cjs","names":["initialState"],"sources":["../../src/onboardingSlice/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 progress: undefined,\n complete: false,\n demoArtifactPort: 85,\n showConnectDeviceDialog: false,\n showTipsDialog: false\n};\n"],"mappings":";;AAeA,MAAa,YAAY;CACvB,wBAAGA,CAAAA,CAAAA;CACH,UAAU,KAAA;CACV,UAAU;CACV,kBAAkB;CAClB,yBAAyB;CACzB,gBAAgB;AAClB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as OnboardingSliceType } from "../index-DBUt8xVc.cjs";
|
|
2
|
-
import { r as RootState } from "../store-
|
|
2
|
+
import { r as RootState } from "../store-xV2zaXAc.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/onboardingSlice/selectors.d.ts
|
|
5
5
|
declare const getOnboarding: (state: RootState) => OnboardingSliceType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as OnboardingSliceType } from "../index-DBUt8xVc.js";
|
|
2
|
-
import { r as RootState } from "../store-
|
|
2
|
+
import { r as RootState } from "../store-BzrMxxAO.js";
|
|
3
3
|
|
|
4
4
|
//#region src/onboardingSlice/selectors.d.ts
|
|
5
5
|
declare const getOnboarding: (state: RootState) => OnboardingSliceType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as OnboardingStep } from "../constants-Db_RBdlV.cjs";
|
|
2
2
|
import { a as UserSettings } from "../index-CSk4ENmk.cjs";
|
|
3
3
|
import { n as OnboardingSliceType, t as OnboardingApproach } from "../index-DBUt8xVc.cjs";
|
|
4
|
-
import { r as RootState, t as AppDispatch } from "../store-
|
|
4
|
+
import { r as RootState, t as AppDispatch } from "../store-xV2zaXAc.cjs";
|
|
5
5
|
|
|
6
6
|
//#region src/onboardingSlice/thunks.d.ts
|
|
7
7
|
declare const getOnboardingState: import("@reduxjs/toolkit").AsyncThunk<[{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as OnboardingStep } from "../constants-Db_RBdlV.js";
|
|
2
2
|
import { a as UserSettings } from "../index-Cf81vLTi.js";
|
|
3
3
|
import { n as OnboardingSliceType, t as OnboardingApproach } from "../index-DBUt8xVc.js";
|
|
4
|
-
import { r as RootState, t as AppDispatch } from "../store-
|
|
4
|
+
import { r as RootState, t as AppDispatch } from "../store-BzrMxxAO.js";
|
|
5
5
|
|
|
6
6
|
//#region src/onboardingSlice/thunks.d.ts
|
|
7
7
|
declare const getOnboardingState: import("@reduxjs/toolkit").AsyncThunk<[{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["TENANT_LIST_DEFAULT","SORTING_OPTIONS","DEVICE_LIST_DEFAULTS"],"sources":["../../src/organizationSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { AuditLog as AuditLogEvent, BillingProfile, Integration, Event as WebhookEvent } from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS, TENANT_LIST_DEFAULT } from '../constants';\nimport type { AuditLog, AuditLogSelectionState, Card, Organization, ProductConfig, SSOConfig, TenantList, Webhook } from './types';\n\nexport const sliceName = 'organization';\n\nexport type OrganizationSliceType = {\n auditlog: AuditLog;\n card: Card;\n externalDeviceIntegrations: Integration[];\n intentId: string | null;\n organization: Partial<Organization>;\n products?: ProductConfig;\n ssoConfigs: SSOConfig[];\n tenantList: TenantList;\n webhooks: Webhook;\n};\n\nexport const initialState: OrganizationSliceType = {\n card: {\n last4: '',\n expiration: { month: 1, year: 2020 },\n brand: ''\n },\n intentId: null,\n tenantList: {\n ...TENANT_LIST_DEFAULT,\n total: 0,\n tenants: [],\n selectedTenant: null,\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'name'\n }\n },\n organization: {\n // id, name, status, tenant_token, plan\n },\n auditlog: {\n events: [],\n selectionState: {\n ...DEVICE_LIST_DEFAULTS,\n detail: undefined,\n endDate: undefined,\n selectedIssue: undefined,\n sort: { direction: SORTING_OPTIONS.desc },\n startDate: undefined,\n total: 0,\n type: undefined,\n user: undefined,\n isLoading: false\n }\n },\n externalDeviceIntegrations: [\n // { <connection_string|x509|...>, id, provider }\n ],\n ssoConfigs: [],\n webhooks: {\n // [id]: { events: [] }\n // for now:\n events: [],\n eventsTotal: 0\n }\n};\n\nexport const organizationSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receiveAuditLogs: (state, action: PayloadAction<{ events: AuditLogEvent[]; total: number }>) => {\n const { events, total } = action.payload;\n state.auditlog.events = events;\n state.auditlog.selectionState.total = total;\n },\n setAuditLogState: (state, action: PayloadAction<Partial<AuditLogSelectionState>>) => {\n state.auditlog.selectionState = {\n ...state.auditlog.selectionState,\n ...action.payload\n };\n },\n receiveCurrentCard: (state, action: PayloadAction<Card>) => {\n state.card = action.payload;\n },\n receiveSetupIntent: (state, action: PayloadAction<string | null>) => {\n state.intentId = action.payload;\n },\n setOrganization: (state, action: PayloadAction<Partial<Organization>>) => {\n state.organization = { ...state.organization, ...action.payload };\n },\n setSubscription: (state, action) => {\n state.organization.subscription = { ...state.organization.subscription, ...action.payload };\n },\n setProducts: (state, action: PayloadAction<ProductConfig>) => {\n state.products = action.payload;\n },\n setBillingProfile: (state, action: PayloadAction<BillingProfile>) => {\n state.organization.billing_profile = action.payload;\n },\n setTenantListState: (state, action: PayloadAction<TenantList>) => {\n state.tenantList = action.payload;\n },\n receiveExternalDeviceIntegrations: (state, action: PayloadAction<Integration[]>) => {\n state.externalDeviceIntegrations = action.payload;\n },\n receiveSsoConfigs: (state, action: PayloadAction<SSOConfig[]>) => {\n state.ssoConfigs = action.payload;\n },\n receiveWebhookEvents: (state, action: PayloadAction<{ total: number; value: WebhookEvent[] }>) => {\n const { value, total } = action.payload;\n state.webhooks.events = value;\n state.webhooks.eventsTotal = total;\n }\n }\n});\n\nexport const actions = organizationSlice.actions;\nexport default organizationSlice.reducer;\n"],"mappings":";;;;;;;;AAoBA,MAAa,YAAY;AAczB,MAAa,eAAsC;CACjD,MAAM;EACJ,OAAO;EACP,YAAY;GAAE,OAAO;GAAG,MAAM;EAAK;EACnC,OAAO;CACT;CACA,UAAU;CACV,YAAY;EACV,GAAGA,kBAAAA;EACH,OAAO;EACP,SAAS,CAAC;EACV,gBAAgB;EAChB,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;CACF;CACA,cAAc,CAEd;CACA,UAAU;EACR,QAAQ,CAAC;EACT,gBAAgB;GACd,GAAGC,+BAAAA;GACH,QAAQ,KAAA;GACR,SAAS,KAAA;GACT,eAAe,KAAA;GACf,MAAM,EAAE,WAAWD,+BAAAA,gBAAgB,KAAK;GACxC,WAAW,KAAA;GACX,OAAO;GACP,MAAM,KAAA;GACN,MAAM,KAAA;GACN,WAAW;EACb;CACF;CACA,4BAA4B,CAE5B;CACA,YAAY,CAAC;CACb,UAAU;EAGR,QAAQ,CAAC;EACT,aAAa;CACf;AACF;AAEA,MAAa,qBAAA,GAAA,iBAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["TENANT_LIST_DEFAULT","SORTING_OPTIONS","DEVICE_LIST_DEFAULTS"],"sources":["../../src/organizationSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { AuditLog as AuditLogEvent, BillingProfile, Integration, Event as WebhookEvent } from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS, TENANT_LIST_DEFAULT } from '../constants';\nimport type { AuditLog, AuditLogSelectionState, Card, Organization, ProductConfig, SSOConfig, TenantList, Webhook } from './types';\n\nexport const sliceName = 'organization';\n\nexport type OrganizationSliceType = {\n auditlog: AuditLog;\n card: Card;\n externalDeviceIntegrations: Integration[];\n intentId: string | null;\n organization: Partial<Organization>;\n products?: ProductConfig;\n ssoConfigs: SSOConfig[];\n tenantList: TenantList;\n webhooks: Webhook;\n};\n\nexport const initialState: OrganizationSliceType = {\n card: {\n last4: '',\n expiration: { month: 1, year: 2020 },\n brand: ''\n },\n intentId: null,\n tenantList: {\n ...TENANT_LIST_DEFAULT,\n total: 0,\n tenants: [],\n selectedTenant: null,\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'name'\n }\n },\n organization: {\n // id, name, status, tenant_token, plan\n },\n auditlog: {\n events: [],\n selectionState: {\n ...DEVICE_LIST_DEFAULTS,\n detail: undefined,\n endDate: undefined,\n selectedIssue: undefined,\n sort: { direction: SORTING_OPTIONS.desc },\n startDate: undefined,\n total: 0,\n type: undefined,\n user: undefined,\n isLoading: false\n }\n },\n externalDeviceIntegrations: [\n // { <connection_string|x509|...>, id, provider }\n ],\n ssoConfigs: [],\n webhooks: {\n // [id]: { events: [] }\n // for now:\n events: [],\n eventsTotal: 0\n }\n};\n\nexport const organizationSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receiveAuditLogs: (state, action: PayloadAction<{ events: AuditLogEvent[]; total: number }>) => {\n const { events, total } = action.payload;\n state.auditlog.events = events;\n state.auditlog.selectionState.total = total;\n },\n setAuditLogState: (state, action: PayloadAction<Partial<AuditLogSelectionState>>) => {\n state.auditlog.selectionState = {\n ...state.auditlog.selectionState,\n ...action.payload\n };\n },\n receiveCurrentCard: (state, action: PayloadAction<Card>) => {\n state.card = action.payload;\n },\n receiveSetupIntent: (state, action: PayloadAction<string | null>) => {\n state.intentId = action.payload;\n },\n setOrganization: (state, action: PayloadAction<Partial<Organization>>) => {\n state.organization = { ...state.organization, ...action.payload };\n },\n setSubscription: (state, action) => {\n state.organization.subscription = { ...state.organization.subscription, ...action.payload };\n },\n setProducts: (state, action: PayloadAction<ProductConfig>) => {\n state.products = action.payload;\n },\n setBillingProfile: (state, action: PayloadAction<BillingProfile>) => {\n state.organization.billing_profile = action.payload;\n },\n setTenantListState: (state, action: PayloadAction<TenantList>) => {\n state.tenantList = action.payload;\n },\n receiveExternalDeviceIntegrations: (state, action: PayloadAction<Integration[]>) => {\n state.externalDeviceIntegrations = action.payload;\n },\n receiveSsoConfigs: (state, action: PayloadAction<SSOConfig[]>) => {\n state.ssoConfigs = action.payload;\n },\n receiveWebhookEvents: (state, action: PayloadAction<{ total: number; value: WebhookEvent[] }>) => {\n const { value, total } = action.payload;\n state.webhooks.events = value;\n state.webhooks.eventsTotal = total;\n }\n }\n});\n\nexport const actions = organizationSlice.actions;\nexport default organizationSlice.reducer;\n"],"mappings":";;;;;;;;AAoBA,MAAa,YAAY;AAczB,MAAa,eAAsC;CACjD,MAAM;EACJ,OAAO;EACP,YAAY;GAAE,OAAO;GAAG,MAAM;EAAK;EACnC,OAAO;CACT;CACA,UAAU;CACV,YAAY;EACV,GAAGA,kBAAAA;EACH,OAAO;EACP,SAAS,CAAC;EACV,gBAAgB;EAChB,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;CACF;CACA,cAAc,CAEd;CACA,UAAU;EACR,QAAQ,CAAC;EACT,gBAAgB;GACd,GAAGC,+BAAAA;GACH,QAAQ,KAAA;GACR,SAAS,KAAA;GACT,eAAe,KAAA;GACf,MAAM,EAAE,WAAWD,+BAAAA,gBAAgB,KAAK;GACxC,WAAW,KAAA;GACX,OAAO;GACP,MAAM,KAAA;GACN,MAAM,KAAA;GACN,WAAW;EACb;CACF;CACA,4BAA4B,CAE5B;CACA,YAAY,CAAC;CACb,UAAU;EAGR,QAAQ,CAAC;EACT,aAAa;CACf;AACF;AAEA,MAAa,qBAAA,GAAA,iBAAA,YAAA,CAAgC;CAC3C,MAAM;CACN;CACA,UAAU;EACR,mBAAmB,OAAO,WAAsE;GAC9F,MAAM,EAAE,QAAQ,UAAU,OAAO;GACjC,MAAM,SAAS,SAAS;GACxB,MAAM,SAAS,eAAe,QAAQ;EACxC;EACA,mBAAmB,OAAO,WAA2D;GACnF,MAAM,SAAS,iBAAiB;IAC9B,GAAG,MAAM,SAAS;IAClB,GAAG,OAAO;GACZ;EACF;EACA,qBAAqB,OAAO,WAAgC;GAC1D,MAAM,OAAO,OAAO;EACtB;EACA,qBAAqB,OAAO,WAAyC;GACnE,MAAM,WAAW,OAAO;EAC1B;EACA,kBAAkB,OAAO,WAAiD;GACxE,MAAM,eAAe;IAAE,GAAG,MAAM;IAAc,GAAG,OAAO;GAAQ;EAClE;EACA,kBAAkB,OAAO,WAAW;GAClC,MAAM,aAAa,eAAe;IAAE,GAAG,MAAM,aAAa;IAAc,GAAG,OAAO;GAAQ;EAC5F;EACA,cAAc,OAAO,WAAyC;GAC5D,MAAM,WAAW,OAAO;EAC1B;EACA,oBAAoB,OAAO,WAA0C;GACnE,MAAM,aAAa,kBAAkB,OAAO;EAC9C;EACA,qBAAqB,OAAO,WAAsC;GAChE,MAAM,aAAa,OAAO;EAC5B;EACA,oCAAoC,OAAO,WAAyC;GAClF,MAAM,6BAA6B,OAAO;EAC5C;EACA,oBAAoB,OAAO,WAAuC;GAChE,MAAM,aAAa,OAAO;EAC5B;EACA,uBAAuB,OAAO,WAAoE;GAChG,MAAM,EAAE,OAAO,UAAU,OAAO;GAChC,MAAM,SAAS,SAAS;GACxB,MAAM,SAAS,cAAc;EAC/B;CACF;AACF,CAAC;AAED,MAAa,UAAU,kBAAkB;AACzC,IAAA,4BAAe,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.cjs","names":["EXTERNAL_PROVIDER","productOrder"],"sources":["../../src/organizationSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 type { Tenant } from '@northern.tech/types/MenderTypes';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { EXTERNAL_PROVIDER, productOrder } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getOrganization = (state: RootState) => state.organization.organization;\nexport const getProducts = (state: RootState) => state.organization.products;\nexport const getExternalIntegrations = (state: RootState) => state.organization.externalDeviceIntegrations;\nexport const getAuditlogState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getAuditLog = (state: RootState) => state.organization.auditlog.events;\nexport const getAuditLogSelectionState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getBillingProfile = (state: RootState) => state.organization.organization.billing_profile;\nexport const getSubscription = (state: RootState) => state.organization.organization.subscription;\nexport const getCard = (state: RootState) => state.organization.card;\nexport const getSsoConfig = ({ organization: { ssoConfigs = [] } }: RootState) => ssoConfigs[0];\nexport const getTenantsList = (state: RootState) => state.organization.tenantList;\nexport const getWebhookEvents = (state: RootState) => state.organization.webhooks.events;\nexport const getWebhookEventTotal = (state: RootState) => state.organization.webhooks.eventsTotal;\n\nexport const getDeviceTwinIntegrations = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)\n);\nexport const getIsServiceProvider = (state: RootState) => state.organization.organization.service_provider;\n\nexport const getWebhooks = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)\n);\nexport const getWebhookEventInfo = createSelector([getWebhooks, getWebhookEvents, getWebhookEventTotal], (webhooks, events, eventTotal) =>\n webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }\n);\n\nexport const getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {\n if (!selectedId) {\n return;\n }\n const [eventAction, eventTime] = atob(selectedId).split('|');\n return events.find(item => item.action === eventAction && item.time === eventTime);\n});\n\nconst toTierName = (key: string) => key.replace(/max_|_?devices/g, '') || 'standard';\nconst processDeviceLimits = (deviceLimits: Tenant['device_limits'], skipFilter = false) => {\n const result: { disabled: string[]; limits: Record<string, object> } = { limits: {}, disabled: [] };\n if (!deviceLimits) return result;\n const tiersByName = Object.fromEntries(Object.entries(deviceLimits).map(([key, limit]) => [toTierName(key), { key, limit }]));\n return productOrder.reduce((accu, tierName) => {\n const entry = tiersByName[tierName];\n if (!entry) return accu;\n const { key, limit } = entry;\n if (limit.value === 0) {\n accu.disabled.push(tierName);\n if (!skipFilter) return accu;\n }\n accu.limits[tierName] = {\n id: tierName,\n backendId: key,\n limit: limit.value,\n current: limit.current_value,\n name: tierName,\n quotaLeft: Math.max(limit.value - limit.current_value, 0),\n limitReached: limit.value !== -1 && limit.value <= limit.current_value\n };\n return accu;\n }, result);\n};\nconst getDeviceLimitsInfo = createSelector([getOrganization], ({ device_limits }) => processDeviceLimits(device_limits));\nexport const getDisabledTiers = createSelector([getDeviceLimitsInfo], ({ disabled }) => disabled);\nexport const getSpLimits = createSelector([getDeviceLimitsInfo], ({ limits }) => limits);\nexport const getTenantListWithLimits = createSelector([getTenantsList], tenantList => ({\n ...tenantList,\n tenants: tenantList.tenants.map(tenant => ({\n ...tenant,\n device_limits: processDeviceLimits(tenant.device_limits, true).limits\n }))\n}));\n"],"mappings":";;;;AAmBA,MAAa,mBAAmB,UAAqB,MAAM,aAAa;AACxE,MAAa,eAAe,UAAqB,MAAM,aAAa;AACpE,MAAa,2BAA2B,UAAqB,MAAM,aAAa;AAChF,MAAa,oBAAoB,UAAqB,MAAM,aAAa,SAAS;AAClF,MAAa,eAAe,UAAqB,MAAM,aAAa,SAAS;AAC7E,MAAa,6BAA6B,UAAqB,MAAM,aAAa,SAAS;AAC3F,MAAa,qBAAqB,UAAqB,MAAM,aAAa,aAAa;AACvF,MAAa,mBAAmB,UAAqB,MAAM,aAAa,aAAa;AACrF,MAAa,WAAW,UAAqB,MAAM,aAAa;AAChE,MAAa,gBAAgB,EAAE,cAAc,EAAE,aAAa,CAAC,UAAqB,WAAW;AAC7F,MAAa,kBAAkB,UAAqB,MAAM,aAAa;AACvE,MAAa,oBAAoB,UAAqB,MAAM,aAAa,SAAS;AAClF,MAAa,wBAAwB,UAAqB,MAAM,aAAa,SAAS;AAEtF,MAAa,6BAAA,GAAA,iBAAA,
|
|
1
|
+
{"version":3,"file":"selectors.cjs","names":["EXTERNAL_PROVIDER","productOrder"],"sources":["../../src/organizationSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 type { Tenant } from '@northern.tech/types/MenderTypes';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { EXTERNAL_PROVIDER, productOrder } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getOrganization = (state: RootState) => state.organization.organization;\nexport const getProducts = (state: RootState) => state.organization.products;\nexport const getExternalIntegrations = (state: RootState) => state.organization.externalDeviceIntegrations;\nexport const getAuditlogState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getAuditLog = (state: RootState) => state.organization.auditlog.events;\nexport const getAuditLogSelectionState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getBillingProfile = (state: RootState) => state.organization.organization.billing_profile;\nexport const getSubscription = (state: RootState) => state.organization.organization.subscription;\nexport const getCard = (state: RootState) => state.organization.card;\nexport const getSsoConfig = ({ organization: { ssoConfigs = [] } }: RootState) => ssoConfigs[0];\nexport const getTenantsList = (state: RootState) => state.organization.tenantList;\nexport const getWebhookEvents = (state: RootState) => state.organization.webhooks.events;\nexport const getWebhookEventTotal = (state: RootState) => state.organization.webhooks.eventsTotal;\n\nexport const getDeviceTwinIntegrations = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)\n);\nexport const getIsServiceProvider = (state: RootState) => state.organization.organization.service_provider;\n\nexport const getWebhooks = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)\n);\nexport const getWebhookEventInfo = createSelector([getWebhooks, getWebhookEvents, getWebhookEventTotal], (webhooks, events, eventTotal) =>\n webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }\n);\n\nexport const getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {\n if (!selectedId) {\n return;\n }\n const [eventAction, eventTime] = atob(selectedId).split('|');\n return events.find(item => item.action === eventAction && item.time === eventTime);\n});\n\nconst toTierName = (key: string) => key.replace(/max_|_?devices/g, '') || 'standard';\nconst processDeviceLimits = (deviceLimits: Tenant['device_limits'], skipFilter = false) => {\n const result: { disabled: string[]; limits: Record<string, object> } = { limits: {}, disabled: [] };\n if (!deviceLimits) return result;\n const tiersByName = Object.fromEntries(Object.entries(deviceLimits).map(([key, limit]) => [toTierName(key), { key, limit }]));\n return productOrder.reduce((accu, tierName) => {\n const entry = tiersByName[tierName];\n if (!entry) return accu;\n const { key, limit } = entry;\n if (limit.value === 0) {\n accu.disabled.push(tierName);\n if (!skipFilter) return accu;\n }\n accu.limits[tierName] = {\n id: tierName,\n backendId: key,\n limit: limit.value,\n current: limit.current_value,\n name: tierName,\n quotaLeft: Math.max(limit.value - limit.current_value, 0),\n limitReached: limit.value !== -1 && limit.value <= limit.current_value\n };\n return accu;\n }, result);\n};\nconst getDeviceLimitsInfo = createSelector([getOrganization], ({ device_limits }) => processDeviceLimits(device_limits));\nexport const getDisabledTiers = createSelector([getDeviceLimitsInfo], ({ disabled }) => disabled);\nexport const getSpLimits = createSelector([getDeviceLimitsInfo], ({ limits }) => limits);\nexport const getTenantListWithLimits = createSelector([getTenantsList], tenantList => ({\n ...tenantList,\n tenants: tenantList.tenants.map(tenant => ({\n ...tenant,\n device_limits: processDeviceLimits(tenant.device_limits, true).limits\n }))\n}));\n"],"mappings":";;;;AAmBA,MAAa,mBAAmB,UAAqB,MAAM,aAAa;AACxE,MAAa,eAAe,UAAqB,MAAM,aAAa;AACpE,MAAa,2BAA2B,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YAAW;EACzC,GAAG;EACH,eAAe,oBAAoB,OAAO,eAAe,IAAI,CAAC,CAAC;CACjE,EAAE;AACJ,EAAE"}
|
|
@@ -3,11 +3,11 @@ import { i as ReleaseSliceType } from "../index-Zs9RnVoR.cjs";
|
|
|
3
3
|
import { d as TenantList, i as Organization, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card, u as Tenant } from "../types-B33vKVhi.cjs";
|
|
4
4
|
import { n as OnboardingSliceType } from "../index-DBUt8xVc.cjs";
|
|
5
5
|
import { o as DeploymentsSliceType } from "../index-EPmsL6Lb.cjs";
|
|
6
|
-
import { s as DeviceSliceType } from "../index-
|
|
6
|
+
import { s as DeviceSliceType } from "../index-Doc_1P_Y.cjs";
|
|
7
7
|
import { t as AppSliceType } from "../index-C8QadAm7.cjs";
|
|
8
8
|
import { t as MonitorSliceType } from "../index-5Q-iI4EB.cjs";
|
|
9
9
|
import { t as OrganizationSliceType } from "../index-Bj3OArhr.cjs";
|
|
10
|
-
import { r as RootState } from "../store-
|
|
10
|
+
import { r as RootState } from "../store-xV2zaXAc.cjs";
|
|
11
11
|
|
|
12
12
|
//#region src/organizationSlice/selectors.d.ts
|
|
13
13
|
declare const getOrganization: (state: RootState) => Partial<Organization>;
|
|
@@ -3,11 +3,11 @@ import { i as ReleaseSliceType } from "../index-DLDY7bNT.js";
|
|
|
3
3
|
import { d as TenantList, i as Organization, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card, u as Tenant } from "../types-BjtmX60L.js";
|
|
4
4
|
import { n as OnboardingSliceType } from "../index-DBUt8xVc.js";
|
|
5
5
|
import { o as DeploymentsSliceType } from "../index-Bb4yvvgG.js";
|
|
6
|
-
import { s as DeviceSliceType } from "../index-
|
|
6
|
+
import { s as DeviceSliceType } from "../index-BqJuhvO_.js";
|
|
7
7
|
import { t as AppSliceType } from "../index-BLvjQfGj.js";
|
|
8
8
|
import { t as MonitorSliceType } from "../index-ByfjrTdH.js";
|
|
9
9
|
import { t as OrganizationSliceType } from "../index-BBsUj1a8.js";
|
|
10
|
-
import { r as RootState } from "../store-
|
|
10
|
+
import { r as RootState } from "../store-BzrMxxAO.js";
|
|
11
11
|
|
|
12
12
|
//#region src/organizationSlice/selectors.d.ts
|
|
13
13
|
declare const getOrganization: (state: RootState) => Partial<Organization>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.js","names":[],"sources":["../../src/organizationSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 type { Tenant } from '@northern.tech/types/MenderTypes';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { EXTERNAL_PROVIDER, productOrder } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getOrganization = (state: RootState) => state.organization.organization;\nexport const getProducts = (state: RootState) => state.organization.products;\nexport const getExternalIntegrations = (state: RootState) => state.organization.externalDeviceIntegrations;\nexport const getAuditlogState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getAuditLog = (state: RootState) => state.organization.auditlog.events;\nexport const getAuditLogSelectionState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getBillingProfile = (state: RootState) => state.organization.organization.billing_profile;\nexport const getSubscription = (state: RootState) => state.organization.organization.subscription;\nexport const getCard = (state: RootState) => state.organization.card;\nexport const getSsoConfig = ({ organization: { ssoConfigs = [] } }: RootState) => ssoConfigs[0];\nexport const getTenantsList = (state: RootState) => state.organization.tenantList;\nexport const getWebhookEvents = (state: RootState) => state.organization.webhooks.events;\nexport const getWebhookEventTotal = (state: RootState) => state.organization.webhooks.eventsTotal;\n\nexport const getDeviceTwinIntegrations = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)\n);\nexport const getIsServiceProvider = (state: RootState) => state.organization.organization.service_provider;\n\nexport const getWebhooks = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)\n);\nexport const getWebhookEventInfo = createSelector([getWebhooks, getWebhookEvents, getWebhookEventTotal], (webhooks, events, eventTotal) =>\n webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }\n);\n\nexport const getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {\n if (!selectedId) {\n return;\n }\n const [eventAction, eventTime] = atob(selectedId).split('|');\n return events.find(item => item.action === eventAction && item.time === eventTime);\n});\n\nconst toTierName = (key: string) => key.replace(/max_|_?devices/g, '') || 'standard';\nconst processDeviceLimits = (deviceLimits: Tenant['device_limits'], skipFilter = false) => {\n const result: { disabled: string[]; limits: Record<string, object> } = { limits: {}, disabled: [] };\n if (!deviceLimits) return result;\n const tiersByName = Object.fromEntries(Object.entries(deviceLimits).map(([key, limit]) => [toTierName(key), { key, limit }]));\n return productOrder.reduce((accu, tierName) => {\n const entry = tiersByName[tierName];\n if (!entry) return accu;\n const { key, limit } = entry;\n if (limit.value === 0) {\n accu.disabled.push(tierName);\n if (!skipFilter) return accu;\n }\n accu.limits[tierName] = {\n id: tierName,\n backendId: key,\n limit: limit.value,\n current: limit.current_value,\n name: tierName,\n quotaLeft: Math.max(limit.value - limit.current_value, 0),\n limitReached: limit.value !== -1 && limit.value <= limit.current_value\n };\n return accu;\n }, result);\n};\nconst getDeviceLimitsInfo = createSelector([getOrganization], ({ device_limits }) => processDeviceLimits(device_limits));\nexport const getDisabledTiers = createSelector([getDeviceLimitsInfo], ({ disabled }) => disabled);\nexport const getSpLimits = createSelector([getDeviceLimitsInfo], ({ limits }) => limits);\nexport const getTenantListWithLimits = createSelector([getTenantsList], tenantList => ({\n ...tenantList,\n tenants: tenantList.tenants.map(tenant => ({\n ...tenant,\n device_limits: processDeviceLimits(tenant.device_limits, true).limits\n }))\n}));\n"],"mappings":";;;AAmBA,MAAa,mBAAmB,UAAqB,MAAM,aAAa;AACxE,MAAa,eAAe,UAAqB,MAAM,aAAa;AACpE,MAAa,2BAA2B,UAAqB,MAAM,aAAa;AAChF,MAAa,oBAAoB,UAAqB,MAAM,aAAa,SAAS;AAClF,MAAa,eAAe,UAAqB,MAAM,aAAa,SAAS;AAC7E,MAAa,6BAA6B,UAAqB,MAAM,aAAa,SAAS;AAC3F,MAAa,qBAAqB,UAAqB,MAAM,aAAa,aAAa;AACvF,MAAa,mBAAmB,UAAqB,MAAM,aAAa,aAAa;AACrF,MAAa,WAAW,UAAqB,MAAM,aAAa;AAChE,MAAa,gBAAgB,EAAE,cAAc,EAAE,aAAa,CAAC,UAAqB,WAAW;AAC7F,MAAa,kBAAkB,UAAqB,MAAM,aAAa;AACvE,MAAa,oBAAoB,UAAqB,MAAM,aAAa,SAAS;AAClF,MAAa,wBAAwB,UAAqB,MAAM,aAAa,SAAS;AAEtF,MAAa,4BAA4B,eAAe,CAAC,uBAAuB,IAAG,iBACjF,aAAa,QAAO,gBAAe,YAAY,MAAM,kBAAkB,YAAY,
|
|
1
|
+
{"version":3,"file":"selectors.js","names":[],"sources":["../../src/organizationSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 type { Tenant } from '@northern.tech/types/MenderTypes';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { EXTERNAL_PROVIDER, productOrder } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getOrganization = (state: RootState) => state.organization.organization;\nexport const getProducts = (state: RootState) => state.organization.products;\nexport const getExternalIntegrations = (state: RootState) => state.organization.externalDeviceIntegrations;\nexport const getAuditlogState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getAuditLog = (state: RootState) => state.organization.auditlog.events;\nexport const getAuditLogSelectionState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getBillingProfile = (state: RootState) => state.organization.organization.billing_profile;\nexport const getSubscription = (state: RootState) => state.organization.organization.subscription;\nexport const getCard = (state: RootState) => state.organization.card;\nexport const getSsoConfig = ({ organization: { ssoConfigs = [] } }: RootState) => ssoConfigs[0];\nexport const getTenantsList = (state: RootState) => state.organization.tenantList;\nexport const getWebhookEvents = (state: RootState) => state.organization.webhooks.events;\nexport const getWebhookEventTotal = (state: RootState) => state.organization.webhooks.eventsTotal;\n\nexport const getDeviceTwinIntegrations = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)\n);\nexport const getIsServiceProvider = (state: RootState) => state.organization.organization.service_provider;\n\nexport const getWebhooks = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)\n);\nexport const getWebhookEventInfo = createSelector([getWebhooks, getWebhookEvents, getWebhookEventTotal], (webhooks, events, eventTotal) =>\n webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }\n);\n\nexport const getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {\n if (!selectedId) {\n return;\n }\n const [eventAction, eventTime] = atob(selectedId).split('|');\n return events.find(item => item.action === eventAction && item.time === eventTime);\n});\n\nconst toTierName = (key: string) => key.replace(/max_|_?devices/g, '') || 'standard';\nconst processDeviceLimits = (deviceLimits: Tenant['device_limits'], skipFilter = false) => {\n const result: { disabled: string[]; limits: Record<string, object> } = { limits: {}, disabled: [] };\n if (!deviceLimits) return result;\n const tiersByName = Object.fromEntries(Object.entries(deviceLimits).map(([key, limit]) => [toTierName(key), { key, limit }]));\n return productOrder.reduce((accu, tierName) => {\n const entry = tiersByName[tierName];\n if (!entry) return accu;\n const { key, limit } = entry;\n if (limit.value === 0) {\n accu.disabled.push(tierName);\n if (!skipFilter) return accu;\n }\n accu.limits[tierName] = {\n id: tierName,\n backendId: key,\n limit: limit.value,\n current: limit.current_value,\n name: tierName,\n quotaLeft: Math.max(limit.value - limit.current_value, 0),\n limitReached: limit.value !== -1 && limit.value <= limit.current_value\n };\n return accu;\n }, result);\n};\nconst getDeviceLimitsInfo = createSelector([getOrganization], ({ device_limits }) => processDeviceLimits(device_limits));\nexport const getDisabledTiers = createSelector([getDeviceLimitsInfo], ({ disabled }) => disabled);\nexport const getSpLimits = createSelector([getDeviceLimitsInfo], ({ limits }) => limits);\nexport const getTenantListWithLimits = createSelector([getTenantsList], tenantList => ({\n ...tenantList,\n tenants: tenantList.tenants.map(tenant => ({\n ...tenant,\n device_limits: processDeviceLimits(tenant.device_limits, true).limits\n }))\n}));\n"],"mappings":";;;AAmBA,MAAa,mBAAmB,UAAqB,MAAM,aAAa;AACxE,MAAa,eAAe,UAAqB,MAAM,aAAa;AACpE,MAAa,2BAA2B,UAAqB,MAAM,aAAa;AAChF,MAAa,oBAAoB,UAAqB,MAAM,aAAa,SAAS;AAClF,MAAa,eAAe,UAAqB,MAAM,aAAa,SAAS;AAC7E,MAAa,6BAA6B,UAAqB,MAAM,aAAa,SAAS;AAC3F,MAAa,qBAAqB,UAAqB,MAAM,aAAa,aAAa;AACvF,MAAa,mBAAmB,UAAqB,MAAM,aAAa,aAAa;AACrF,MAAa,WAAW,UAAqB,MAAM,aAAa;AAChE,MAAa,gBAAgB,EAAE,cAAc,EAAE,aAAa,CAAC,UAAqB,WAAW;AAC7F,MAAa,kBAAkB,UAAqB,MAAM,aAAa;AACvE,MAAa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KAAK,UAAU;EACvB,IAAI,MAAM,UAAU,GAAG;GACrB,KAAK,SAAS,KAAK,QAAQ;GAC3B,IAAI,CAAC,YAAY,OAAO;EAC1B;EACA,KAAK,OAAO,YAAY;GACtB,IAAI;GACJ,WAAW;GACX,OAAO,MAAM;GACb,SAAS,MAAM;GACf,MAAM;GACN,WAAW,KAAK,IAAI,MAAM,QAAQ,MAAM,eAAe,CAAC;GACxD,cAAc,MAAM,UAAU,MAAM,MAAM,SAAS,MAAM;EAC3D;EACA,OAAO;CACT,GAAG,MAAM;AACX;AACA,MAAM,sBAAsB,eAAe,CAAC,eAAe,IAAI,EAAE,oBAAoB,oBAAoB,aAAa,CAAC;AACvH,MAAa,mBAAmB,eAAe,CAAC,mBAAmB,IAAI,EAAE,eAAe,QAAQ;AAChG,MAAa,cAAc,eAAe,CAAC,mBAAmB,IAAI,EAAE,aAAa,MAAM;AACvF,MAAa,0BAA0B,eAAe,CAAC,cAAc,IAAG,gBAAe;CACrF,GAAG;CACH,SAAS,WAAW,QAAQ,KAAI,YAAW;EACzC,GAAG;EACH,eAAe,oBAAoB,OAAO,eAAe,IAAI,CAAC,CAAC;CACjE,EAAE;AACJ,EAAE"}
|
|
@@ -3,7 +3,7 @@ import { T as SortOptions, g as PaginationOptions } from "../constants-_p6w8uEp.
|
|
|
3
3
|
import { n as ContentType } from "../constants-OZiiFKiA.cjs";
|
|
4
4
|
import { d as TenantList, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card } from "../types-B33vKVhi.cjs";
|
|
5
5
|
import { i as SnackbarContent } from "../index-C8QadAm7.cjs";
|
|
6
|
-
import { r as RootState, t as AppDispatch } from "../store-
|
|
6
|
+
import { r as RootState, t as AppDispatch } from "../store-xV2zaXAc.cjs";
|
|
7
7
|
import { BillingProfile, Integration, NewTenantTypeManagement, PreviewRequest, Product, ProductInfo, Subscription, SupportRequest, UpdateChildTenant } from "@northern.tech/types/MenderTypes";
|
|
8
8
|
|
|
9
9
|
//#region src/organizationSlice/thunks.d.ts
|
|
@@ -202,10 +202,7 @@ declare const setAuditlogsState: import("@reduxjs/toolkit").AsyncThunk<import("r
|
|
|
202
202
|
rejectedMeta?: unknown;
|
|
203
203
|
}>;
|
|
204
204
|
declare const tenantDataDivergedMessage = "The system detected there is a change in your plan or purchased add-ons. Please log out and log in again";
|
|
205
|
-
declare const addTenant: import("@reduxjs/toolkit").AsyncThunk<
|
|
206
|
-
payload: string | SnackbarContent;
|
|
207
|
-
type: "app/setSnackbar";
|
|
208
|
-
}, unknown], NewTenantTypeManagement & UpdateChildTenant & {
|
|
205
|
+
declare const addTenant: import("@reduxjs/toolkit").AsyncThunk<void, NewTenantTypeManagement & UpdateChildTenant & {
|
|
209
206
|
deviceLimits: Record<string, string>;
|
|
210
207
|
}, {
|
|
211
208
|
dispatch: AppDispatch;
|
|
@@ -245,24 +242,7 @@ type EditTenantArgs = {
|
|
|
245
242
|
id: string;
|
|
246
243
|
name: string;
|
|
247
244
|
};
|
|
248
|
-
declare const editTenant: import("@reduxjs/toolkit").AsyncThunk<
|
|
249
|
-
payload: string | SnackbarContent;
|
|
250
|
-
type: "app/setSnackbar";
|
|
251
|
-
}, import("@reduxjs/toolkit").PayloadAction<unknown, string, {
|
|
252
|
-
arg: void;
|
|
253
|
-
requestId: string;
|
|
254
|
-
requestStatus: "rejected";
|
|
255
|
-
aborted: boolean;
|
|
256
|
-
condition: boolean;
|
|
257
|
-
} & ({
|
|
258
|
-
rejectedWithValue: true;
|
|
259
|
-
} | ({
|
|
260
|
-
rejectedWithValue: false;
|
|
261
|
-
} & {})), import("@reduxjs/toolkit").SerializedError> | import("@reduxjs/toolkit").PayloadAction<import("redux").UnknownAction[], string, {
|
|
262
|
-
arg: void;
|
|
263
|
-
requestId: string;
|
|
264
|
-
requestStatus: "fulfilled";
|
|
265
|
-
}, never>, unknown], EditTenantArgs, {
|
|
245
|
+
declare const editTenant: import("@reduxjs/toolkit").AsyncThunk<void, EditTenantArgs, {
|
|
266
246
|
dispatch: AppDispatch;
|
|
267
247
|
state: RootState;
|
|
268
248
|
extra?: unknown;
|
|
@@ -336,24 +316,7 @@ declare const createBillingProfile: import("@reduxjs/toolkit").AsyncThunk<[{
|
|
|
336
316
|
fulfilledMeta?: unknown;
|
|
337
317
|
rejectedMeta?: unknown;
|
|
338
318
|
}>;
|
|
339
|
-
declare const removeTenant: import("@reduxjs/toolkit").AsyncThunk<
|
|
340
|
-
payload: string | SnackbarContent;
|
|
341
|
-
type: "app/setSnackbar";
|
|
342
|
-
}, import("@reduxjs/toolkit").PayloadAction<unknown, string, {
|
|
343
|
-
arg: void;
|
|
344
|
-
requestId: string;
|
|
345
|
-
requestStatus: "rejected";
|
|
346
|
-
aborted: boolean;
|
|
347
|
-
condition: boolean;
|
|
348
|
-
} & ({
|
|
349
|
-
rejectedWithValue: true;
|
|
350
|
-
} | ({
|
|
351
|
-
rejectedWithValue: false;
|
|
352
|
-
} & {})), import("@reduxjs/toolkit").SerializedError> | import("@reduxjs/toolkit").PayloadAction<import("redux").UnknownAction[], string, {
|
|
353
|
-
arg: void;
|
|
354
|
-
requestId: string;
|
|
355
|
-
requestStatus: "fulfilled";
|
|
356
|
-
}, never>, unknown], {
|
|
319
|
+
declare const removeTenant: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
357
320
|
id: string;
|
|
358
321
|
}, {
|
|
359
322
|
dispatch: AppDispatch;
|
|
@@ -3,7 +3,7 @@ import { T as SortOptions, g as PaginationOptions } from "../constants-OcdoVk6f.
|
|
|
3
3
|
import { n as ContentType } from "../constants-OZiiFKiA.js";
|
|
4
4
|
import { d as TenantList, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card } from "../types-BjtmX60L.js";
|
|
5
5
|
import { i as SnackbarContent } from "../index-BLvjQfGj.js";
|
|
6
|
-
import { r as RootState, t as AppDispatch } from "../store-
|
|
6
|
+
import { r as RootState, t as AppDispatch } from "../store-BzrMxxAO.js";
|
|
7
7
|
import { BillingProfile, Integration, NewTenantTypeManagement, PreviewRequest, Product, ProductInfo, Subscription, SupportRequest, UpdateChildTenant } from "@northern.tech/types/MenderTypes";
|
|
8
8
|
|
|
9
9
|
//#region src/organizationSlice/thunks.d.ts
|
|
@@ -202,10 +202,7 @@ declare const setAuditlogsState: import("@reduxjs/toolkit").AsyncThunk<import("r
|
|
|
202
202
|
rejectedMeta?: unknown;
|
|
203
203
|
}>;
|
|
204
204
|
declare const tenantDataDivergedMessage = "The system detected there is a change in your plan or purchased add-ons. Please log out and log in again";
|
|
205
|
-
declare const addTenant: import("@reduxjs/toolkit").AsyncThunk<
|
|
206
|
-
payload: string | SnackbarContent;
|
|
207
|
-
type: "app/setSnackbar";
|
|
208
|
-
}, unknown], NewTenantTypeManagement & UpdateChildTenant & {
|
|
205
|
+
declare const addTenant: import("@reduxjs/toolkit").AsyncThunk<void, NewTenantTypeManagement & UpdateChildTenant & {
|
|
209
206
|
deviceLimits: Record<string, string>;
|
|
210
207
|
}, {
|
|
211
208
|
dispatch: AppDispatch;
|
|
@@ -245,24 +242,7 @@ type EditTenantArgs = {
|
|
|
245
242
|
id: string;
|
|
246
243
|
name: string;
|
|
247
244
|
};
|
|
248
|
-
declare const editTenant: import("@reduxjs/toolkit").AsyncThunk<
|
|
249
|
-
payload: string | SnackbarContent;
|
|
250
|
-
type: "app/setSnackbar";
|
|
251
|
-
}, import("@reduxjs/toolkit").PayloadAction<unknown, string, {
|
|
252
|
-
arg: void;
|
|
253
|
-
requestId: string;
|
|
254
|
-
requestStatus: "rejected";
|
|
255
|
-
aborted: boolean;
|
|
256
|
-
condition: boolean;
|
|
257
|
-
} & ({
|
|
258
|
-
rejectedWithValue: true;
|
|
259
|
-
} | ({
|
|
260
|
-
rejectedWithValue: false;
|
|
261
|
-
} & {})), import("@reduxjs/toolkit").SerializedError> | import("@reduxjs/toolkit").PayloadAction<import("redux").UnknownAction[], string, {
|
|
262
|
-
arg: void;
|
|
263
|
-
requestId: string;
|
|
264
|
-
requestStatus: "fulfilled";
|
|
265
|
-
}, never>, unknown], EditTenantArgs, {
|
|
245
|
+
declare const editTenant: import("@reduxjs/toolkit").AsyncThunk<void, EditTenantArgs, {
|
|
266
246
|
dispatch: AppDispatch;
|
|
267
247
|
state: RootState;
|
|
268
248
|
extra?: unknown;
|
|
@@ -336,24 +316,7 @@ declare const createBillingProfile: import("@reduxjs/toolkit").AsyncThunk<[{
|
|
|
336
316
|
fulfilledMeta?: unknown;
|
|
337
317
|
rejectedMeta?: unknown;
|
|
338
318
|
}>;
|
|
339
|
-
declare const removeTenant: import("@reduxjs/toolkit").AsyncThunk<
|
|
340
|
-
payload: string | SnackbarContent;
|
|
341
|
-
type: "app/setSnackbar";
|
|
342
|
-
}, import("@reduxjs/toolkit").PayloadAction<unknown, string, {
|
|
343
|
-
arg: void;
|
|
344
|
-
requestId: string;
|
|
345
|
-
requestStatus: "rejected";
|
|
346
|
-
aborted: boolean;
|
|
347
|
-
condition: boolean;
|
|
348
|
-
} & ({
|
|
349
|
-
rejectedWithValue: true;
|
|
350
|
-
} | ({
|
|
351
|
-
rejectedWithValue: false;
|
|
352
|
-
} & {})), import("@reduxjs/toolkit").SerializedError> | import("@reduxjs/toolkit").PayloadAction<import("redux").UnknownAction[], string, {
|
|
353
|
-
arg: void;
|
|
354
|
-
requestId: string;
|
|
355
|
-
requestStatus: "fulfilled";
|
|
356
|
-
}, never>, unknown], {
|
|
319
|
+
declare const removeTenant: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
357
320
|
id: string;
|
|
358
321
|
}, {
|
|
359
322
|
dispatch: AppDispatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DEVICE_LIST_DEFAULTS","SORTING_OPTIONS"],"sources":["../../src/releasesSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type {\n ArtifactV1 as BackendArtifactV1,\n ArtifactV2 as BackendArtifactV2,\n ReleaseV1 as BackendReleaseV1,\n ReleaseV2 as BackendReleaseV2,\n Update as BackendUpdate,\n DeltaJobDetailsItem,\n DeltaJobsListItem,\n Manifest,\n Software,\n Tags\n} from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS } from '../constants';\nimport type { SortOptions } from '../constants';\n\ntype Update = Omit<BackendUpdate, 'meta_data'>;\nexport type Artifact = Omit<BackendArtifactV1, 'updates'> &\n Omit<BackendArtifactV2, 'updates'> & { installCount?: number; updates?: Array<Update>; url?: string };\nexport type Release = BackendReleaseV1 & BackendReleaseV2 & { artifacts: Artifact[]; device_types_compatible: string[]; name: string };\n\nexport type SoftwareKind = Software['kind'];\n\nexport const sliceName = 'releases';\n\ntype EnhancedJobDetailsItem = DeltaJobDetailsItem & DeltaJobsListItem;\n\nexport type ReleasesList = {\n isLoading?: boolean;\n page: number;\n perPage: number;\n releaseIds: string[];\n searchedIds: string[];\n searchOnly?: boolean;\n searchTerm: string;\n searchTotal: number;\n selectedTags: string[];\n selection: number[];\n sort?: SortOptions;\n total: number;\n type: string;\n};\n\nexport type ManifestsList = {\n isLoading?: boolean;\n manifestIds: string[];\n page: number;\n perPage: number;\n searchTerm: string;\n searchTotal: number;\n selectedTags: string[];\n selection: number[];\n sort?: SortOptions;\n total: number;\n};\n\nexport type SoftwareList = {\n isLoading?: boolean;\n kind: SoftwareKind | undefined;\n page: number;\n perPage: number;\n searchTerm: string;\n searchTotal: number;\n selectedTags: string[];\n softwareIds: string[];\n sort?: SortOptions;\n total: number;\n type: string;\n};\n\nexport type ReleaseSliceType = {\n artifacts: never[];\n byId: Record<string, Release>;\n deltaJobs: Record<string, EnhancedJobDetailsItem>;\n deltaJobsList: {\n jobIds: string[];\n page: number;\n perPage: number;\n sort?: SortOptions;\n total: 0;\n };\n manifestsById: Record<string, Manifest>;\n manifestsList: ManifestsList;\n releasesList: ReleasesList;\n selectedJob: string | null;\n selectedManifest: string | null;\n selectedRelease: string | null;\n softwareById: Record<string, Software>;\n softwareList: SoftwareList;\n tab?: 'releases' | 'delta' | 'manifests';\n tags: Record<'releases' | 'manifests' | 'software', Tags>;\n updateTypes: string[];\n};\n\nexport const initialState: ReleaseSliceType = {\n /*\n * Return list of saved artifacts objects\n */\n /*\n * return list of artifacts where duplicate names are collated with device compatibility lists combined\n */\n // artifacts: AppStore.getCollatedArtifacts(AppStore.getArtifactsRepo()),\n artifacts: [],\n /*\n * Return list of saved release objects\n */\n byId: {\n /*\n [releaseName]: {\n artifacts: [\n {\n id: '',\n name: '',\n description: '',\n device_types_compatible: [],\n ...\n updates: [{\n files: [\n { size: 123, name: '' }\n ],\n type_info: { type: '' }\n }],\n url: '' // optional\n }\n ],\n modified: ''\n device_types_compatible,\n name: '',\n tags: ['something'],\n notes: ''\n }\n */\n },\n deltaJobs: {\n /*\n [jobId]: {\n id: '',\n ...\n }\n */\n },\n deltaJobsList: {\n ...DEVICE_LIST_DEFAULTS,\n jobIds: [],\n total: 0,\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'started'\n }\n },\n releasesList: {\n ...DEVICE_LIST_DEFAULTS,\n searchedIds: [],\n releaseIds: [],\n selection: [],\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'modified'\n },\n isLoading: undefined,\n searchTerm: '',\n searchTotal: 0,\n selectedTags: [],\n total: 0,\n type: ''\n },\n /*\n * Return list of saved manifest objects\n */\n manifestsById: {\n /*\n [manifestName]: {\n name: '',\n modified: '',\n artifact: { ... },\n manifest: {\n name: '',\n system_types_compatible: [],\n component_types: { ... }\n ...\n },\n tags: ['something'],\n notes: ''\n }\n */\n },\n manifestsList: {\n ...DEVICE_LIST_DEFAULTS,\n manifestIds: [],\n selection: [],\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'modified'\n },\n isLoading: undefined,\n searchTerm: '',\n searchTotal: 0,\n selectedTags: [],\n total: 0\n },\n softwareById: {},\n softwareList: {\n ...DEVICE_LIST_DEFAULTS,\n softwareIds: [],\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'modified'\n },\n isLoading: undefined,\n kind: undefined,\n searchTerm: '',\n searchTotal: 0,\n selectedTags: [],\n total: 0,\n type: ''\n },\n tab: 'releases',\n tags: {\n manifests: [],\n releases: [],\n software: []\n },\n updateTypes: [],\n selectedJob: null,\n /*\n * Return single manifest\n */\n selectedManifest: null,\n /*\n * Return single release with corresponding Artifacts\n */\n selectedRelease: null\n};\n\nexport const releaseSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receiveRelease: (state, action: PayloadAction<Release>) => {\n const { name } = action.payload;\n state.byId[name] = action.payload;\n },\n receiveReleases: (state, action: PayloadAction<Record<string, Release>>) => {\n state.byId = action.payload;\n },\n receiveSoftwareTags: (state, action: PayloadAction<Tags>) => {\n state.tags.software = action.payload;\n },\n receiveReleaseTags: (state, action: PayloadAction<Tags>) => {\n state.tags.releases = action.payload;\n },\n receiveReleaseTypes: (state, action: PayloadAction<string[]>) => {\n state.updateTypes = action.payload;\n },\n removeRelease: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: toBeRemoved, ...byId } = state.byId;\n state.byId = byId;\n state.selectedRelease = action.payload === state.selectedRelease ? null : state.selectedRelease;\n },\n selectedRelease: (state, action: PayloadAction<string | null>) => {\n state.selectedRelease = action.payload;\n },\n setReleaseListState: (state, action) => {\n state.releasesList = action.payload;\n },\n receivedDeltaJobs: (state, action) => {\n const { jobs, total } = action.payload;\n state.deltaJobs = jobs.reduce(\n (accu, job) => {\n accu[job.id] = {\n ...accu[job.id],\n ...job\n };\n return accu;\n },\n { ...state.deltaJobs }\n );\n state.deltaJobsList.jobIds = jobs.map(job => job.id);\n state.deltaJobsList.total = total;\n },\n receivedDeltaJobDetails: (state, action) => {\n const job: DeltaJobDetailsItem & { id: string } = action.payload;\n state.deltaJobs[job.id] = {\n ...state.deltaJobs[job.id],\n ...job\n };\n },\n setDeltaJobsListState: (state, action) => {\n state.deltaJobsList = { ...state.deltaJobsList, ...action.payload };\n },\n setSelectedJob: (state, action) => {\n state.selectedJob = action.payload;\n },\n setActiveTab: (state, action: PayloadAction<'releases' | 'delta' | 'manifests'>) => {\n state.tab = action.payload;\n },\n receiveManifest: (state, action: PayloadAction<Manifest>) => {\n const { name } = action.payload;\n state.manifestsById[name] = action.payload;\n },\n receiveManifests: (state, action: PayloadAction<Record<string, Manifest>>) => {\n state.manifestsById = action.payload;\n },\n receiveManifestTags: (state, action: PayloadAction<Tags>) => {\n state.tags.manifests = action.payload;\n },\n removeManifest: (state, action: PayloadAction<string>) => {\n const { [action.payload]: _toBeRemoved, ...manifestsById } = state.manifestsById;\n state.manifestsById = manifestsById;\n state.selectedManifest = action.payload === state.selectedManifest ? null : state.selectedManifest;\n },\n removeManifests: (state, action: PayloadAction<string[]>) => {\n const { manifestsById, selectedManifest } = action.payload.reduce(\n (accu, key) => {\n const { [key]: _toBeRemoved, ...manifestsById } = accu.manifestsById;\n\n return { manifestsById, selectedManifest: key === accu.selectedManifest ? null : accu.selectedManifest };\n },\n { manifestsById: { ...state.manifestsById }, selectedManifest: state.selectedManifest }\n );\n state.manifestsById = manifestsById;\n state.selectedManifest = selectedManifest;\n },\n selectedManifest: (state, action: PayloadAction<string | null>) => {\n state.selectedManifest = action.payload;\n },\n setManifestsListState: (state, action: PayloadAction<ManifestsList>) => {\n state.manifestsList = action.payload;\n },\n receiveSoftwareItems: (state, action: PayloadAction<Record<string, Software>>) => {\n state.softwareById = action.payload;\n },\n setSoftwareListState: (state, action: PayloadAction<SoftwareList>) => {\n state.softwareList = action.payload;\n }\n }\n});\n\nexport const actions = releaseSlice.actions;\nexport default releaseSlice.reducer;\n"],"mappings":";;;;;;;AAsCA,MAAa,YAAY;AAuEzB,MAAa,eAAiC;CAQ5C,WAAW,CAAC;CAIZ,MAAM,CA0BN;CACA,WAAW,CAOX;CACA,eAAe;EACb,GAAGA,+BAAAA;EACH,QAAQ,CAAC;EACT,OAAO;EACP,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;CACF;CACA,cAAc;EACZ,GAAGD,+BAAAA;EACH,aAAa,CAAC;EACd,YAAY,CAAC;EACb,WAAW,CAAC;EACZ,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;EACA,WAAW,KAAA;EACX,YAAY;EACZ,aAAa;EACb,cAAc,CAAC;EACf,OAAO;EACP,MAAM;CACR;CAIA,eAAe,CAgBf;CACA,eAAe;EACb,GAAGD,+BAAAA;EACH,aAAa,CAAC;EACd,WAAW,CAAC;EACZ,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;EACA,WAAW,KAAA;EACX,YAAY;EACZ,aAAa;EACb,cAAc,CAAC;EACf,OAAO;CACT;CACA,cAAc,CAAC;CACf,cAAc;EACZ,GAAGD,+BAAAA;EACH,aAAa,CAAC;EACd,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;EACA,WAAW,KAAA;EACX,MAAM,KAAA;EACN,YAAY;EACZ,aAAa;EACb,cAAc,CAAC;EACf,OAAO;EACP,MAAM;CACR;CACA,KAAK;CACL,MAAM;EACJ,WAAW,CAAC;EACZ,UAAU,CAAC;EACX,UAAU,CAAC;CACb;CACA,aAAa,CAAC;CACd,aAAa;CAIb,kBAAkB;CAIlB,iBAAiB;AACnB;AAEA,MAAa,gBAAA,GAAA,iBAAA,aAA2B;CACtC,MAAM;CACN;CACA,UAAU;EACR,iBAAiB,OAAO,WAAmC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;EACrB;EACA,kBAAkB,OAAO,WAAoC;GAC3D,MAAM,EAAE,SAAS,OAAO;GACxB,MAAM,cAAc,QAAQ,OAAO;EACrC;EACA,mBAAmB,OAAO,WAAoD;GAC5E,MAAM,gBAAgB,OAAO;EAC/B;EACA,sBAAsB,OAAO,WAAgC;GAC3D,MAAM,KAAK,YAAY,OAAO;EAChC;EACA,iBAAiB,OAAO,WAAkC;GACxD,MAAM,GAAG,OAAO,UAAU,cAAc,GAAG,kBAAkB,MAAM;GACnE,MAAM,gBAAgB;GACtB,MAAM,mBAAmB,OAAO,YAAY,MAAM,mBAAmB,OAAO,MAAM;EACpF;EACA,kBAAkB,OAAO,WAAoC;GAC3D,MAAM,EAAE,eAAe,qBAAqB,OAAO,QAAQ,QACxD,MAAM,QAAQ;IACb,MAAM,GAAG,MAAM,cAAc,GAAG,kBAAkB,KAAK;IAEvD,OAAO;KAAE;KAAe,kBAAkB,QAAQ,KAAK,mBAAmB,OAAO,KAAK;IAAiB;GACzG,GACA;IAAE,eAAe,EAAE,GAAG,MAAM,cAAc;IAAG,kBAAkB,MAAM;GAAiB,CACxF;GACA,MAAM,gBAAgB;GACtB,MAAM,mBAAmB;EAC3B;EACA,mBAAmB,OAAO,WAAyC;GACjE,MAAM,mBAAmB,OAAO;EAClC;EACA,wBAAwB,OAAO,WAAyC;GACtE,MAAM,gBAAgB,OAAO;EAC/B;EACA,uBAAuB,OAAO,WAAoD;GAChF,MAAM,eAAe,OAAO;EAC9B;EACA,uBAAuB,OAAO,WAAwC;GACpE,MAAM,eAAe,OAAO;EAC9B;CACF;AACF,CAAC;AAED,MAAa,UAAU,aAAa;AACpC,IAAA,wBAAe,aAAa"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["DEVICE_LIST_DEFAULTS","SORTING_OPTIONS"],"sources":["../../src/releasesSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type {\n ArtifactV1 as BackendArtifactV1,\n ArtifactV2 as BackendArtifactV2,\n ReleaseV1 as BackendReleaseV1,\n ReleaseV2 as BackendReleaseV2,\n Update as BackendUpdate,\n DeltaJobDetailsItem,\n DeltaJobsListItem,\n Manifest,\n Software,\n Tags\n} from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS } from '../constants';\nimport type { SortOptions } from '../constants';\n\ntype Update = Omit<BackendUpdate, 'meta_data'>;\nexport type Artifact = Omit<BackendArtifactV1, 'updates'> &\n Omit<BackendArtifactV2, 'updates'> & { installCount?: number; updates?: Array<Update>; url?: string };\nexport type Release = BackendReleaseV1 & BackendReleaseV2 & { artifacts: Artifact[]; device_types_compatible: string[]; name: string };\n\nexport type SoftwareKind = Software['kind'];\n\nexport const sliceName = 'releases';\n\ntype EnhancedJobDetailsItem = DeltaJobDetailsItem & DeltaJobsListItem;\n\nexport type ReleasesList = {\n isLoading?: boolean;\n page: number;\n perPage: number;\n releaseIds: string[];\n searchedIds: string[];\n searchOnly?: boolean;\n searchTerm: string;\n searchTotal: number;\n selectedTags: string[];\n selection: number[];\n sort?: SortOptions;\n total: number;\n type: string;\n};\n\nexport type ManifestsList = {\n isLoading?: boolean;\n manifestIds: string[];\n page: number;\n perPage: number;\n searchTerm: string;\n searchTotal: number;\n selectedTags: string[];\n selection: number[];\n sort?: SortOptions;\n total: number;\n};\n\nexport type SoftwareList = {\n isLoading?: boolean;\n kind: SoftwareKind | undefined;\n page: number;\n perPage: number;\n searchTerm: string;\n searchTotal: number;\n selectedTags: string[];\n softwareIds: string[];\n sort?: SortOptions;\n total: number;\n type: string;\n};\n\nexport type ReleaseSliceType = {\n artifacts: never[];\n byId: Record<string, Release>;\n deltaJobs: Record<string, EnhancedJobDetailsItem>;\n deltaJobsList: {\n jobIds: string[];\n page: number;\n perPage: number;\n sort?: SortOptions;\n total: 0;\n };\n manifestsById: Record<string, Manifest>;\n manifestsList: ManifestsList;\n releasesList: ReleasesList;\n selectedJob: string | null;\n selectedManifest: string | null;\n selectedRelease: string | null;\n softwareById: Record<string, Software>;\n softwareList: SoftwareList;\n tab?: 'releases' | 'delta' | 'manifests';\n tags: Record<'releases' | 'manifests' | 'software', Tags>;\n updateTypes: string[];\n};\n\nexport const initialState: ReleaseSliceType = {\n /*\n * Return list of saved artifacts objects\n */\n /*\n * return list of artifacts where duplicate names are collated with device compatibility lists combined\n */\n // artifacts: AppStore.getCollatedArtifacts(AppStore.getArtifactsRepo()),\n artifacts: [],\n /*\n * Return list of saved release objects\n */\n byId: {\n /*\n [releaseName]: {\n artifacts: [\n {\n id: '',\n name: '',\n description: '',\n device_types_compatible: [],\n ...\n updates: [{\n files: [\n { size: 123, name: '' }\n ],\n type_info: { type: '' }\n }],\n url: '' // optional\n }\n ],\n modified: ''\n device_types_compatible,\n name: '',\n tags: ['something'],\n notes: ''\n }\n */\n },\n deltaJobs: {\n /*\n [jobId]: {\n id: '',\n ...\n }\n */\n },\n deltaJobsList: {\n ...DEVICE_LIST_DEFAULTS,\n jobIds: [],\n total: 0,\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'started'\n }\n },\n releasesList: {\n ...DEVICE_LIST_DEFAULTS,\n searchedIds: [],\n releaseIds: [],\n selection: [],\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'modified'\n },\n isLoading: undefined,\n searchTerm: '',\n searchTotal: 0,\n selectedTags: [],\n total: 0,\n type: ''\n },\n /*\n * Return list of saved manifest objects\n */\n manifestsById: {\n /*\n [manifestName]: {\n name: '',\n modified: '',\n artifact: { ... },\n manifest: {\n name: '',\n system_types_compatible: [],\n component_types: { ... }\n ...\n },\n tags: ['something'],\n notes: ''\n }\n */\n },\n manifestsList: {\n ...DEVICE_LIST_DEFAULTS,\n manifestIds: [],\n selection: [],\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'modified'\n },\n isLoading: undefined,\n searchTerm: '',\n searchTotal: 0,\n selectedTags: [],\n total: 0\n },\n softwareById: {},\n softwareList: {\n ...DEVICE_LIST_DEFAULTS,\n softwareIds: [],\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'modified'\n },\n isLoading: undefined,\n kind: undefined,\n searchTerm: '',\n searchTotal: 0,\n selectedTags: [],\n total: 0,\n type: ''\n },\n tab: 'releases',\n tags: {\n manifests: [],\n releases: [],\n software: []\n },\n updateTypes: [],\n selectedJob: null,\n /*\n * Return single manifest\n */\n selectedManifest: null,\n /*\n * Return single release with corresponding Artifacts\n */\n selectedRelease: null\n};\n\nexport const releaseSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receiveRelease: (state, action: PayloadAction<Release>) => {\n const { name } = action.payload;\n state.byId[name] = action.payload;\n },\n receiveReleases: (state, action: PayloadAction<Record<string, Release>>) => {\n state.byId = action.payload;\n },\n receiveSoftwareTags: (state, action: PayloadAction<Tags>) => {\n state.tags.software = action.payload;\n },\n receiveReleaseTags: (state, action: PayloadAction<Tags>) => {\n state.tags.releases = action.payload;\n },\n receiveReleaseTypes: (state, action: PayloadAction<string[]>) => {\n state.updateTypes = action.payload;\n },\n removeRelease: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: toBeRemoved, ...byId } = state.byId;\n state.byId = byId;\n state.selectedRelease = action.payload === state.selectedRelease ? null : state.selectedRelease;\n },\n selectedRelease: (state, action: PayloadAction<string | null>) => {\n state.selectedRelease = action.payload;\n },\n setReleaseListState: (state, action) => {\n state.releasesList = action.payload;\n },\n receivedDeltaJobs: (state, action) => {\n const { jobs, total } = action.payload;\n state.deltaJobs = jobs.reduce(\n (accu, job) => {\n accu[job.id] = {\n ...accu[job.id],\n ...job\n };\n return accu;\n },\n { ...state.deltaJobs }\n );\n state.deltaJobsList.jobIds = jobs.map(job => job.id);\n state.deltaJobsList.total = total;\n },\n receivedDeltaJobDetails: (state, action) => {\n const job: DeltaJobDetailsItem & { id: string } = action.payload;\n state.deltaJobs[job.id] = {\n ...state.deltaJobs[job.id],\n ...job\n };\n },\n setDeltaJobsListState: (state, action) => {\n state.deltaJobsList = { ...state.deltaJobsList, ...action.payload };\n },\n setSelectedJob: (state, action) => {\n state.selectedJob = action.payload;\n },\n setActiveTab: (state, action: PayloadAction<'releases' | 'delta' | 'manifests'>) => {\n state.tab = action.payload;\n },\n receiveManifest: (state, action: PayloadAction<Manifest>) => {\n const { name } = action.payload;\n state.manifestsById[name] = action.payload;\n },\n receiveManifests: (state, action: PayloadAction<Record<string, Manifest>>) => {\n state.manifestsById = action.payload;\n },\n receiveManifestTags: (state, action: PayloadAction<Tags>) => {\n state.tags.manifests = action.payload;\n },\n removeManifest: (state, action: PayloadAction<string>) => {\n const { [action.payload]: _toBeRemoved, ...manifestsById } = state.manifestsById;\n state.manifestsById = manifestsById;\n state.selectedManifest = action.payload === state.selectedManifest ? null : state.selectedManifest;\n },\n removeManifests: (state, action: PayloadAction<string[]>) => {\n const { manifestsById, selectedManifest } = action.payload.reduce(\n (accu, key) => {\n const { [key]: _toBeRemoved, ...manifestsById } = accu.manifestsById;\n\n return { manifestsById, selectedManifest: key === accu.selectedManifest ? null : accu.selectedManifest };\n },\n { manifestsById: { ...state.manifestsById }, selectedManifest: state.selectedManifest }\n );\n state.manifestsById = manifestsById;\n state.selectedManifest = selectedManifest;\n },\n selectedManifest: (state, action: PayloadAction<string | null>) => {\n state.selectedManifest = action.payload;\n },\n setManifestsListState: (state, action: PayloadAction<ManifestsList>) => {\n state.manifestsList = action.payload;\n },\n receiveSoftwareItems: (state, action: PayloadAction<Record<string, Software>>) => {\n state.softwareById = action.payload;\n },\n setSoftwareListState: (state, action: PayloadAction<SoftwareList>) => {\n state.softwareList = action.payload;\n }\n }\n});\n\nexport const actions = releaseSlice.actions;\nexport default releaseSlice.reducer;\n"],"mappings":";;;;;;;AAsCA,MAAa,YAAY;AAuEzB,MAAa,eAAiC;CAQ5C,WAAW,CAAC;CAIZ,MAAM,CA0BN;CACA,WAAW,CAOX;CACA,eAAe;EACb,GAAGA,+BAAAA;EACH,QAAQ,CAAC;EACT,OAAO;EACP,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;CACF;CACA,cAAc;EACZ,GAAGD,+BAAAA;EACH,aAAa,CAAC;EACd,YAAY,CAAC;EACb,WAAW,CAAC;EACZ,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;EACA,WAAW,KAAA;EACX,YAAY;EACZ,aAAa;EACb,cAAc,CAAC;EACf,OAAO;EACP,MAAM;CACR;CAIA,eAAe,CAgBf;CACA,eAAe;EACb,GAAGD,+BAAAA;EACH,aAAa,CAAC;EACd,WAAW,CAAC;EACZ,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;EACA,WAAW,KAAA;EACX,YAAY;EACZ,aAAa;EACb,cAAc,CAAC;EACf,OAAO;CACT;CACA,cAAc,CAAC;CACf,cAAc;EACZ,GAAGD,+BAAAA;EACH,aAAa,CAAC;EACd,MAAM;GACJ,WAAWC,+BAAAA,gBAAgB;GAC3B,KAAK;EACP;EACA,WAAW,KAAA;EACX,MAAM,KAAA;EACN,YAAY;EACZ,aAAa;EACb,cAAc,CAAC;EACf,OAAO;EACP,MAAM;CACR;CACA,KAAK;CACL,MAAM;EACJ,WAAW,CAAC;EACZ,UAAU,CAAC;EACX,UAAU,CAAC;CACb;CACA,aAAa,CAAC;CACd,aAAa;CAIb,kBAAkB;CAIlB,iBAAiB;AACnB;AAEA,MAAa,gBAAA,GAAA,iBAAA,YAAA,CAA2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;EAC7B;EACA,eAAe,OAAO,WAA8D;GAClF,MAAM,MAAM,OAAO;EACrB;EACA,kBAAkB,OAAO,WAAoC;GAC3D,MAAM,EAAE,SAAS,OAAO;GACxB,MAAM,cAAc,QAAQ,OAAO;EACrC;EACA,mBAAmB,OAAO,WAAoD;GAC5E,MAAM,gBAAgB,OAAO;EAC/B;EACA,sBAAsB,OAAO,WAAgC;GAC3D,MAAM,KAAK,YAAY,OAAO;EAChC;EACA,iBAAiB,OAAO,WAAkC;GACxD,MAAM,GAAG,OAAO,UAAU,cAAc,GAAG,kBAAkB,MAAM;GACnE,MAAM,gBAAgB;GACtB,MAAM,mBAAmB,OAAO,YAAY,MAAM,mBAAmB,OAAO,MAAM;EACpF;EACA,kBAAkB,OAAO,WAAoC;GAC3D,MAAM,EAAE,eAAe,qBAAqB,OAAO,QAAQ,QACxD,MAAM,QAAQ;IACb,MAAM,GAAG,MAAM,cAAc,GAAG,kBAAkB,KAAK;IAEvD,OAAO;KAAE;KAAe,kBAAkB,QAAQ,KAAK,mBAAmB,OAAO,KAAK;IAAiB;GACzG,GACA;IAAE,eAAe,EAAE,GAAG,MAAM,cAAc;IAAG,kBAAkB,MAAM;GAAiB,CACxF;GACA,MAAM,gBAAgB;GACtB,MAAM,mBAAmB;EAC3B;EACA,mBAAmB,OAAO,WAAyC;GACjE,MAAM,mBAAmB,OAAO;EAClC;EACA,wBAAwB,OAAO,WAAyC;GACtE,MAAM,gBAAgB,OAAO;EAC/B;EACA,uBAAuB,OAAO,WAAoD;GAChF,MAAM,eAAe,OAAO;EAC9B;EACA,uBAAuB,OAAO,WAAwC;GACpE,MAAM,eAAe,OAAO;EAC9B;CACF;AACF,CAAC;AAED,MAAa,UAAU,aAAa;AACpC,IAAA,wBAAe,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.cjs","names":["listItemMapper"],"sources":["../../src/releasesSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 type { Manifest, ReleaseV2, Software } from '@northern.tech/types/MenderTypes';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { RootState } from '../store';\nimport { listItemMapper } from '../utils';\n\nconst transformToId = tags => tags.reduce((accu, key) => ({ ...accu, [key]: key }), {});\n\nexport const getActiveTab = (state: RootState) => state.releases.tab;\nconst getSelectedReleaseId = (state: RootState) => state.releases.selectedRelease;\nexport const getReleasesById = (state: RootState) => state.releases.byId;\nconst getTags = (state: RootState) => state.releases.tags;\nexport const getReleaseListState = (state: RootState) => state.releases.releasesList;\nconst getListedReleases = (state: RootState) => state.releases.releasesList.releaseIds;\nexport const getUpdateTypes = (state: RootState) => state.releases.updateTypes;\nconst releaseDefaults = {};\nconst getReleaseMappingDefaults = () => releaseDefaults;\nexport const getSoftwareTags = createSelector([getTags], ({ software }) => software);\nexport const getSoftwareTagsById = createSelector([getSoftwareTags], transformToId);\nexport const getReleasesList = createSelector([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper<ReleaseV2>);\n\nexport const getReleaseTags = createSelector([getTags], ({ releases }) => releases);\nexport const getReleaseTagsById = createSelector([getReleaseTags], transformToId);\nexport const getHasReleases = createSelector(\n [getReleaseListState, getReleasesById],\n ({ searchTotal, total }, byId) => total || searchTotal || !!Object.keys(byId).length\n);\n\nexport const getSelectedRelease = createSelector([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id || ''] ?? {});\n\nexport const getSelectedReleases = createSelector([getReleaseListState, getReleasesList], ({ selection }, releases) => selection.map(index => releases[index]));\n\nexport const getDeltaJobsListState = (state: RootState) => state.releases.deltaJobsList;\nexport const getDeltaJobsById = (state: RootState) => state.releases.deltaJobs;\nexport const getDeltaJobById = createSelector([getDeltaJobsById, (_, jobId) => jobId], (byId, jobId: string) => byId[jobId]);\nconst getSelectedJobId = (state: RootState) => state.releases.selectedJob;\nexport const getSelectedJob = createSelector([getDeltaJobsById, getSelectedJobId], (byId, jobId) => byId[jobId || '']);\n\nconst getSelectedManifestId = (state: RootState) => state.releases.selectedManifest;\nexport const getManifestTags = createSelector([getTags], ({ manifests }) => manifests);\nexport const getManifestTagsById = createSelector([getManifestTags], transformToId);\nexport const getManifestsById = (state: RootState) => state.releases.manifestsById;\nexport const getManifestsListState = (state: RootState) => state.releases.manifestsList;\nconst getListedManifests = (state: RootState) => state.releases.manifestsList.manifestIds;\nconst manifestDefaults = {};\nconst getManifestMappingDefaults = () => manifestDefaults;\nexport const getManifestsList = createSelector([getManifestsById, getListedManifests, getManifestMappingDefaults], listItemMapper<Manifest>);\n\nexport const getHasManifests = createSelector(\n [getManifestsListState, getManifestsById],\n ({ searchTotal, total }, byId) => total || searchTotal || !!Object.keys(byId).length\n);\n\nexport const getSelectedManifest = createSelector([getManifestsById, getSelectedManifestId], (byId, id) => byId[id || ''] ?? {});\n\nexport const getSelectedManifests = createSelector([getManifestsListState, getManifestsList], ({ selection }, manifests) =>\n selection.map(index => manifests[index])\n);\n\nexport const getSoftwareById = (state: RootState) => state.releases.softwareById;\nexport const getSoftwareListState = (state: RootState) => state.releases.softwareList;\nconst getListedSoftware = (state: RootState) => state.releases.softwareList.softwareIds;\nconst softwareDefaults = {};\nconst getSoftwareMappingDefaults = () => softwareDefaults;\nexport const getSoftwareList = createSelector([getSoftwareById, getListedSoftware, getSoftwareMappingDefaults], listItemMapper<Software>);\n\nexport const getHasSoftware = createSelector(\n [getSoftwareListState, getSoftwareById],\n ({ searchTotal, total }, byId) => total || searchTotal || !!Object.keys(byId).length\n);\n"],"mappings":";;;;AAmBA,MAAM,iBAAgB,SAAQ,KAAK,QAAQ,MAAM,SAAS;CAAE,GAAG;EAAO,MAAM;AAAI,IAAI,CAAC,CAAC;AAEtF,MAAa,gBAAgB,UAAqB,MAAM,SAAS;AACjE,MAAM,wBAAwB,UAAqB,MAAM,SAAS;AAClE,MAAa,mBAAmB,UAAqB,MAAM,SAAS;AACpE,MAAM,WAAW,UAAqB,MAAM,SAAS;AACrD,MAAa,uBAAuB,UAAqB,MAAM,SAAS;AACxE,MAAM,qBAAqB,UAAqB,MAAM,SAAS,aAAa;AAC5E,MAAa,kBAAkB,UAAqB,MAAM,SAAS;AACnE,MAAM,kBAAkB,CAAC;AACzB,MAAM,kCAAkC;AACxC,MAAa,mBAAA,GAAA,iBAAA,
|
|
1
|
+
{"version":3,"file":"selectors.cjs","names":["listItemMapper"],"sources":["../../src/releasesSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 type { Manifest, ReleaseV2, Software } from '@northern.tech/types/MenderTypes';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { RootState } from '../store';\nimport { listItemMapper } from '../utils';\n\nconst transformToId = tags => tags.reduce((accu, key) => ({ ...accu, [key]: key }), {});\n\nexport const getActiveTab = (state: RootState) => state.releases.tab;\nconst getSelectedReleaseId = (state: RootState) => state.releases.selectedRelease;\nexport const getReleasesById = (state: RootState) => state.releases.byId;\nconst getTags = (state: RootState) => state.releases.tags;\nexport const getReleaseListState = (state: RootState) => state.releases.releasesList;\nconst getListedReleases = (state: RootState) => state.releases.releasesList.releaseIds;\nexport const getUpdateTypes = (state: RootState) => state.releases.updateTypes;\nconst releaseDefaults = {};\nconst getReleaseMappingDefaults = () => releaseDefaults;\nexport const getSoftwareTags = createSelector([getTags], ({ software }) => software);\nexport const getSoftwareTagsById = createSelector([getSoftwareTags], transformToId);\nexport const getReleasesList = createSelector([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper<ReleaseV2>);\n\nexport const getReleaseTags = createSelector([getTags], ({ releases }) => releases);\nexport const getReleaseTagsById = createSelector([getReleaseTags], transformToId);\nexport const getHasReleases = createSelector(\n [getReleaseListState, getReleasesById],\n ({ searchTotal, total }, byId) => total || searchTotal || !!Object.keys(byId).length\n);\n\nexport const getSelectedRelease = createSelector([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id || ''] ?? {});\n\nexport const getSelectedReleases = createSelector([getReleaseListState, getReleasesList], ({ selection }, releases) => selection.map(index => releases[index]));\n\nexport const getDeltaJobsListState = (state: RootState) => state.releases.deltaJobsList;\nexport const getDeltaJobsById = (state: RootState) => state.releases.deltaJobs;\nexport const getDeltaJobById = createSelector([getDeltaJobsById, (_, jobId) => jobId], (byId, jobId: string) => byId[jobId]);\nconst getSelectedJobId = (state: RootState) => state.releases.selectedJob;\nexport const getSelectedJob = createSelector([getDeltaJobsById, getSelectedJobId], (byId, jobId) => byId[jobId || '']);\n\nconst getSelectedManifestId = (state: RootState) => state.releases.selectedManifest;\nexport const getManifestTags = createSelector([getTags], ({ manifests }) => manifests);\nexport const getManifestTagsById = createSelector([getManifestTags], transformToId);\nexport const getManifestsById = (state: RootState) => state.releases.manifestsById;\nexport const getManifestsListState = (state: RootState) => state.releases.manifestsList;\nconst getListedManifests = (state: RootState) => state.releases.manifestsList.manifestIds;\nconst manifestDefaults = {};\nconst getManifestMappingDefaults = () => manifestDefaults;\nexport const getManifestsList = createSelector([getManifestsById, getListedManifests, getManifestMappingDefaults], listItemMapper<Manifest>);\n\nexport const getHasManifests = createSelector(\n [getManifestsListState, getManifestsById],\n ({ searchTotal, total }, byId) => total || searchTotal || !!Object.keys(byId).length\n);\n\nexport const getSelectedManifest = createSelector([getManifestsById, getSelectedManifestId], (byId, id) => byId[id || ''] ?? {});\n\nexport const getSelectedManifests = createSelector([getManifestsListState, getManifestsList], ({ selection }, manifests) =>\n selection.map(index => manifests[index])\n);\n\nexport const getSoftwareById = (state: RootState) => state.releases.softwareById;\nexport const getSoftwareListState = (state: RootState) => state.releases.softwareList;\nconst getListedSoftware = (state: RootState) => state.releases.softwareList.softwareIds;\nconst softwareDefaults = {};\nconst getSoftwareMappingDefaults = () => softwareDefaults;\nexport const getSoftwareList = createSelector([getSoftwareById, getListedSoftware, getSoftwareMappingDefaults], listItemMapper<Software>);\n\nexport const getHasSoftware = createSelector(\n [getSoftwareListState, getSoftwareById],\n ({ searchTotal, total }, byId) => total || searchTotal || !!Object.keys(byId).length\n);\n"],"mappings":";;;;AAmBA,MAAM,iBAAgB,SAAQ,KAAK,QAAQ,MAAM,SAAS;CAAE,GAAG;EAAO,MAAM;AAAI,IAAI,CAAC,CAAC;AAEtF,MAAa,gBAAgB,UAAqB,MAAM,SAAS;AACjE,MAAM,wBAAwB,UAAqB,MAAM,SAAS;AAClE,MAAa,mBAAmB,UAAqB,MAAM,SAAS;AACpE,MAAM,WAAW,UAAqB,MAAM,SAAS;AACrD,MAAa,uBAAuB,UAAqB,MAAM,SAAS;AACxE,MAAM,qBAAqB,UAAqB,MAAM,SAAS,aAAa;AAC5E,MAAa,kBAAkB,UAAqB,MAAM,SAAS;AACnE,MAAM,kBAAkB,CAAC;AACzB,MAAM,kCAAkC;AACxC,MAAa,mBAAA,GAAA,iBAAA,eAAA,CAAiC,CAAC,OAAO,IAAI,EAAE,eAAe,QAAQ;AACnF,MAAa,uBAAA,GAAA,iBAAA,eAAA,CAAqC,CAAC,eAAe,GAAG,aAAa;AAClF,MAAa,mBAAA,GAAA,iBAAA,eAAA,CAAiC;CAAC;CAAiB;CAAmB;AAAyB,GAAGA,cAAAA,cAAyB;AAExI,MAAa,kBAAA,GAAA,iBAAA,eAAA,CAAgC,CAAC,OA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