@overmap-ai/core 1.0.55 → 1.0.57-component-asset-renames.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.
Files changed (48) hide show
  1. package/README.md +4 -4
  2. package/dist/constants/ui.d.ts +1 -1
  3. package/dist/enums/ui.d.ts +1 -1
  4. package/dist/forms/builder/constants.d.ts +1 -1
  5. package/dist/forms/builder/hooks.d.ts +1 -1
  6. package/dist/overmap-core.js +565 -615
  7. package/dist/overmap-core.js.map +1 -1
  8. package/dist/overmap-core.umd.cjs +565 -615
  9. package/dist/overmap-core.umd.cjs.map +1 -1
  10. package/dist/sdk/sdk.d.ts +7 -7
  11. package/dist/sdk/services/AssetAttachmentService.d.ts +10 -0
  12. package/dist/sdk/services/AssetService.d.ts +11 -0
  13. package/dist/sdk/services/AssetStageCompletionService.d.ts +16 -0
  14. package/dist/sdk/services/AssetStageService.d.ts +11 -0
  15. package/dist/sdk/services/AssetTypeAttachmentService.d.ts +10 -0
  16. package/dist/sdk/services/AssetTypeService.d.ts +9 -0
  17. package/dist/sdk/services/UserFormService.d.ts +2 -2
  18. package/dist/sdk/services/UserFormSubmissionService.d.ts +1 -1
  19. package/dist/sdk/services/index.d.ts +6 -6
  20. package/dist/store/slices/assetSlice.d.ts +63 -0
  21. package/dist/store/slices/assetStageCompletionSlice.d.ts +15 -0
  22. package/dist/store/slices/assetStageSlice.d.ts +32 -0
  23. package/dist/store/slices/assetTypeSlice.d.ts +74 -0
  24. package/dist/store/slices/categorySlice.d.ts +4 -4
  25. package/dist/store/slices/documentSlice.d.ts +6 -7
  26. package/dist/store/slices/formRevisionSlice.d.ts +5 -5
  27. package/dist/store/slices/formSlice.d.ts +7 -7
  28. package/dist/store/slices/formSubmissionSlice.d.ts +2 -2
  29. package/dist/store/slices/index.d.ts +4 -4
  30. package/dist/store/slices/issueSlice.d.ts +4 -4
  31. package/dist/store/slices/projectFileSlice.d.ts +4 -4
  32. package/dist/store/slices/workspaceSlice.d.ts +4 -4
  33. package/dist/store/store.d.ts +15 -14
  34. package/dist/typings/models/attachments.d.ts +6 -6
  35. package/dist/typings/models/components.d.ts +11 -7
  36. package/dist/typings/models/forms.d.ts +3 -3
  37. package/dist/utils/colors.d.ts +1 -1
  38. package/package.json +153 -153
  39. package/dist/sdk/services/ComponentAttachmentService.d.ts +0 -10
  40. package/dist/sdk/services/ComponentService.d.ts +0 -11
  41. package/dist/sdk/services/ComponentStageCompletionService.d.ts +0 -17
  42. package/dist/sdk/services/ComponentStageService.d.ts +0 -11
  43. package/dist/sdk/services/ComponentTypeAttachmentService.d.ts +0 -10
  44. package/dist/sdk/services/ComponentTypeService.d.ts +0 -9
  45. package/dist/store/slices/ComponentStageCompletionSlice.d.ts +0 -27
  46. package/dist/store/slices/componentSlice.d.ts +0 -73
  47. package/dist/store/slices/componentStageSlice.d.ts +0 -42
  48. package/dist/store/slices/componentTypeSlice.d.ts +0 -75
@@ -1350,7 +1350,7 @@ const ColorsToString = {
1350
1350
  [mint.mint9]: "mint",
1351
1351
  [sky.sky9]: "sky"
1352
1352
  };
1353
- const ComponentStageColors = {
1353
+ const AssetStageColors = {
1354
1354
  indigo: indigo.indigo9,
1355
1355
  red: red.red9,
1356
1356
  violet: violet.violet9,
@@ -1372,7 +1372,7 @@ const generateBadgeColors = (rawColor) => {
1372
1372
  return { backgroundColor, textColor };
1373
1373
  };
1374
1374
  function getStageColor(index2) {
1375
- return Object.values(ComponentStageColors)[index2 % Object.keys(ComponentStageColors).length];
1375
+ return Object.values(AssetStageColors)[index2 % Object.keys(AssetStageColors).length];
1376
1376
  }
1377
1377
  const getLocalDateString = memoize((date) => {
1378
1378
  if (!date)
@@ -1592,122 +1592,115 @@ function removeAttachments(state, action) {
1592
1592
  }
1593
1593
  }
1594
1594
  const initialState$q = {
1595
- componentTypes: {},
1596
- hiddenComponentTypeIds: {},
1595
+ assetTypes: {},
1596
+ hiddenAssetTypeIds: {},
1597
1597
  attachments: {}
1598
1598
  };
1599
- const componentTypeSlice = createSlice({
1600
- name: "componentTypes",
1599
+ const assetTypeSlice = createSlice({
1600
+ name: "assetTypes",
1601
1601
  initialState: initialState$q,
1602
1602
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1603
1603
  reducers: {
1604
- addComponentType: (state, action) => {
1605
- state.componentTypes[action.payload.offline_id] = action.payload;
1604
+ addAssetType: (state, action) => {
1605
+ state.assetTypes[action.payload.offline_id] = action.payload;
1606
1606
  },
1607
- setComponentTypes: (state, action) => {
1608
- state.componentTypes = toOfflineIdRecord(action.payload);
1607
+ setAssetTypes: (state, action) => {
1608
+ state.assetTypes = toOfflineIdRecord(action.payload);
1609
1609
  },
1610
- toggleComponentTypeVisibility: (state, action) => {
1611
- state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
1610
+ toggleAssetTypeVisibility: (state, action) => {
1611
+ state.hiddenAssetTypeIds[action.payload] = !state.hiddenAssetTypeIds[action.payload];
1612
1612
  },
1613
- deleteComponentType: (state, action) => {
1614
- delete state.componentTypes[action.payload];
1613
+ deleteAssetType: (state, action) => {
1614
+ delete state.assetTypes[action.payload];
1615
1615
  },
1616
1616
  // Attachments
1617
- setComponentTypeAttachment: setAttachment,
1618
- setComponentTypeAttachments: setAttachments,
1619
- addComponentTypeAttachment: addAttachment,
1620
- addComponentTypeAttachments: addAttachments,
1621
- updateComponentTypeAttachment: updateAttachment,
1622
- updateComponentTypeAttachments: updateAttachments,
1623
- removeComponentTypeAttachment: removeAttachment,
1624
- removeComponentTypeAttachments: removeAttachments
1617
+ setAssetTypeAttachment: setAttachment,
1618
+ setAssetTypeAttachments: setAttachments,
1619
+ addAssetTypeAttachment: addAttachment,
1620
+ addAssetTypeAttachments: addAttachments,
1621
+ updateAssetTypeAttachment: updateAttachment,
1622
+ updateAssetTypeAttachments: updateAttachments,
1623
+ removeAssetTypeAttachment: removeAttachment,
1624
+ removeAssetTypeAttachments: removeAttachments
1625
1625
  }
1626
1626
  });
1627
1627
  const {
1628
- addComponentType,
1629
- setComponentTypes,
1630
- toggleComponentTypeVisibility,
1631
- deleteComponentType,
1628
+ addAssetType,
1629
+ setAssetTypes,
1630
+ toggleAssetTypeVisibility,
1631
+ deleteAssetType,
1632
1632
  // Attachmet
1633
- setComponentTypeAttachment,
1634
- setComponentTypeAttachments,
1635
- addComponentTypeAttachment,
1636
- addComponentTypeAttachments,
1637
- updateComponentTypeAttachment,
1638
- updateComponentTypeAttachments,
1639
- removeComponentTypeAttachment,
1640
- removeComponentTypeAttachments
1641
- } = componentTypeSlice.actions;
1642
- const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
1643
- const selectComponentTypes = createSelector(
1644
- [selectComponentTypesMapping],
1633
+ setAssetTypeAttachment,
1634
+ setAssetTypeAttachments,
1635
+ addAssetTypeAttachment,
1636
+ addAssetTypeAttachments,
1637
+ updateAssetTypeAttachment,
1638
+ updateAssetTypeAttachments,
1639
+ removeAssetTypeAttachment,
1640
+ removeAssetTypeAttachments
1641
+ } = assetTypeSlice.actions;
1642
+ const selectAssetTypesMapping = (state) => state.assetTypeReducer.assetTypes;
1643
+ const selectAssetTypes = createSelector(
1644
+ [selectAssetTypesMapping],
1645
1645
  (mapping) => Object.values(mapping)
1646
1646
  );
1647
- const selectComponentType = restructureCreateSelectorWithArgs(
1648
- createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
1647
+ const selectAssetType = restructureCreateSelectorWithArgs(
1648
+ createSelector(
1649
+ [selectAssetTypesMapping, (_state, assetTypeId) => assetTypeId],
1650
+ (mapping, assetTypeId) => mapping[assetTypeId]
1651
+ )
1649
1652
  );
1650
- const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
1653
+ const selectNumberOfAssetTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
1651
1654
  createSelector(
1652
- [
1653
- selectComponentTypesMapping,
1654
- (_state, args) => args
1655
- ],
1655
+ [selectAssetTypesMapping, (_state, args) => args],
1656
1656
  (mapping, args) => {
1657
1657
  var _a2;
1658
1658
  const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
1659
1659
  return Object.values(mapping).filter(
1660
- (componentType) => {
1660
+ (assetType) => {
1661
1661
  var _a3;
1662
- return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
1662
+ return (((_a3 = assetType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && assetType.offline_id !== args.assetTypeId;
1663
1663
  }
1664
1664
  ).length;
1665
1665
  }
1666
1666
  )
1667
1667
  );
1668
- const selectComponentTypesByName = restructureCreateSelectorWithArgs(
1669
- createSelector(
1670
- [selectComponentTypesMapping, (_state, name) => name],
1671
- (mapping, name) => {
1672
- name = (name == null ? void 0 : name.toLowerCase()) ?? null;
1673
- return Object.values(mapping).filter(
1674
- (componentType) => {
1675
- var _a2;
1676
- return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
1677
- }
1678
- );
1679
- }
1680
- )
1668
+ const selectAssetTypesByName = restructureCreateSelectorWithArgs(
1669
+ createSelector([selectAssetTypesMapping, (_state, name) => name], (mapping, name) => {
1670
+ name = (name == null ? void 0 : name.toLowerCase()) ?? null;
1671
+ return Object.values(mapping).filter((assetType) => {
1672
+ var _a2;
1673
+ return (((_a2 = assetType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
1674
+ });
1675
+ })
1681
1676
  );
1682
- const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
1683
- const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
1684
- const selectAllComponentTypeAttachments = createSelector(
1685
- [selectComponentTypeAttachmentMapping],
1677
+ const selectHiddenAssetTypeIds = (state) => state.assetTypeReducer.hiddenAssetTypeIds;
1678
+ const selectAssetTypeAttachmentMapping = (state) => state.assetTypeReducer.attachments;
1679
+ const selectAssetTypeAttachments = createSelector(
1680
+ [selectAssetTypeAttachmentMapping],
1686
1681
  (mapping) => Object.values(mapping)
1687
1682
  );
1688
- const selectComponentTypeAttachment = (attachmentId) => (state) => {
1689
- return state.componentTypeReducer.attachments[attachmentId];
1683
+ const selectAssetTypeAttachment = (attachmentId) => (state) => {
1684
+ return state.assetTypeReducer.attachments[attachmentId];
1690
1685
  };
1691
- const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
1686
+ const selectAttachmentsOfAssetType = restructureCreateSelectorWithArgs(
1692
1687
  createSelector(
1693
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1694
- (attachments, componentTypeId) => {
1695
- return attachments.filter(({ component_type }) => componentTypeId === component_type);
1688
+ [selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
1689
+ (attachments, assetTypeId) => {
1690
+ return attachments.filter(({ asset_type }) => assetTypeId === asset_type);
1696
1691
  }
1697
1692
  )
1698
1693
  );
1699
- const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
1694
+ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
1700
1695
  createSelector(
1701
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1702
- (attachments, componentTypeId) => {
1703
- const attachmentsOfComponent = attachments.filter(
1704
- ({ component_type }) => component_type === componentTypeId
1705
- );
1706
- const fileAttachments = attachmentsOfComponent.filter(
1696
+ [selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
1697
+ (attachments, assetTypeId) => {
1698
+ const attachmentsOfAssetType = attachments.filter(({ asset_type }) => asset_type === assetTypeId);
1699
+ const fileAttachments = attachmentsOfAssetType.filter(
1707
1700
  // this null check here is necessary, there are cases where file_type is null or undefined
1708
1701
  ({ file_type }) => !file_type || !file_type.startsWith("image/")
1709
1702
  );
1710
- const imageAttachments = attachmentsOfComponent.filter(
1703
+ const imageAttachments = attachmentsOfAssetType.filter(
1711
1704
  // this null check here is necessary, there are cases where file_type is null or undefined
1712
1705
  ({ file_type }) => file_type && file_type.startsWith("image/")
1713
1706
  );
@@ -1715,173 +1708,157 @@ const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs
1715
1708
  }
1716
1709
  )
1717
1710
  );
1718
- const componentTypeReducer = componentTypeSlice.reducer;
1711
+ const assetTypeReducer = assetTypeSlice.reducer;
1719
1712
  const initialState$p = {
1720
- components: {},
1713
+ assets: {},
1721
1714
  attachments: {}
1722
1715
  };
1723
- const componentSlice = createSlice({
1724
- name: "components",
1716
+ const assetSlice = createSlice({
1717
+ name: "assets",
1725
1718
  initialState: initialState$p,
1726
1719
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1727
1720
  reducers: {
1728
- addComponent: (state, action) => {
1729
- state.components[action.payload.offline_id] = action.payload;
1730
- prevComponents = null;
1721
+ addAsset: (state, action) => {
1722
+ state.assets[action.payload.offline_id] = action.payload;
1723
+ prevAssets = null;
1731
1724
  },
1732
- addComponentsInBatches: (state, action) => {
1733
- Object.assign(state.components, toOfflineIdRecord(action.payload));
1734
- prevComponents = null;
1725
+ addAssetsInBatches: (state, action) => {
1726
+ Object.assign(state.assets, toOfflineIdRecord(action.payload));
1727
+ prevAssets = null;
1735
1728
  },
1736
- setComponents: (state, action) => {
1737
- state.components = toOfflineIdRecord(action.payload);
1738
- prevComponents = null;
1729
+ setAssets: (state, action) => {
1730
+ state.assets = toOfflineIdRecord(action.payload);
1731
+ prevAssets = null;
1739
1732
  },
1740
- updateComponent: (state, action) => {
1741
- if (action.payload.offline_id in state.components) {
1742
- state.components[action.payload.offline_id] = action.payload;
1733
+ updateAsset: (state, action) => {
1734
+ if (action.payload.offline_id in state.assets) {
1735
+ state.assets[action.payload.offline_id] = action.payload;
1743
1736
  } else {
1744
- throw new Error(`Tried to update component with ID that doesn't exist: ${action.payload.offline_id}`);
1737
+ throw new Error(`Tried to update asset with ID that doesn't exist: ${action.payload.offline_id}`);
1745
1738
  }
1746
- prevComponents = null;
1739
+ prevAssets = null;
1747
1740
  },
1748
- removeComponent: (state, action) => {
1749
- if (action.payload in state.components) {
1750
- delete state.components[action.payload];
1741
+ removeAsset: (state, action) => {
1742
+ if (action.payload in state.assets) {
1743
+ delete state.assets[action.payload];
1751
1744
  } else {
1752
- throw new Error(`Failed to remove component because ID doesn't exist: ${action.payload}`);
1745
+ throw new Error(`Failed to remove asset because ID doesn't exist: ${action.payload}`);
1753
1746
  }
1754
- prevComponents = null;
1747
+ prevAssets = null;
1755
1748
  },
1756
- removeAllComponentsOfType: (state, action) => {
1749
+ removeAllAssetsOfType: (state, action) => {
1757
1750
  var _a2;
1758
- for (const componentId in state.components) {
1759
- if (((_a2 = state.components[componentId]) == null ? void 0 : _a2.component_type) === action.payload) {
1760
- delete state.components[componentId];
1751
+ for (const componentId in state.assets) {
1752
+ if (((_a2 = state.assets[componentId]) == null ? void 0 : _a2.asset_type) === action.payload) {
1753
+ delete state.assets[componentId];
1761
1754
  }
1762
1755
  }
1763
- prevComponents = null;
1756
+ prevAssets = null;
1764
1757
  },
1765
1758
  // Attachments
1766
- setComponentAttachment: setAttachment,
1767
- setComponentAttachments: setAttachments,
1768
- addComponentAttachment: addAttachment,
1769
- addComponentAttachments: addAttachments,
1770
- updateComponentAttachment: updateAttachment,
1771
- updateComponentAttachments: updateAttachments,
1772
- removeComponentAttachment: removeAttachment,
1773
- removeComponentAttachments: removeAttachments
1759
+ setAssetAttachment: setAttachment,
1760
+ setAssetAttachments: setAttachments,
1761
+ addAssetAttachment: addAttachment,
1762
+ addAssetAttachments: addAttachments,
1763
+ updateAssetAttachment: updateAttachment,
1764
+ updateAssetAttachments: updateAttachments,
1765
+ removeAssetAttachment: removeAttachment,
1766
+ removeAssetAttachments: removeAttachments
1774
1767
  }
1775
1768
  });
1776
1769
  const {
1777
- addComponent,
1778
- updateComponent,
1779
- removeComponent,
1780
- addComponentsInBatches,
1781
- setComponents,
1782
- removeAllComponentsOfType,
1770
+ addAsset,
1771
+ updateAsset,
1772
+ removeAsset,
1773
+ addAssetsInBatches,
1774
+ setAssets,
1775
+ removeAllAssetsOfType,
1783
1776
  // Attachments
1784
- setComponentAttachment,
1785
- setComponentAttachments,
1786
- addComponentAttachment,
1787
- addComponentAttachments,
1788
- updateComponentAttachment,
1789
- updateComponentAttachments,
1790
- removeComponentAttachment,
1791
- removeComponentAttachments
1792
- } = componentSlice.actions;
1793
- let prevComponents = null;
1794
- const selectComponents = (state) => {
1795
- if (!prevComponents) {
1796
- prevComponents = Object.values(state.componentReducer.components);
1797
- }
1798
- return prevComponents;
1777
+ setAssetAttachment,
1778
+ setAssetAttachments,
1779
+ addAssetAttachment,
1780
+ addAssetAttachments,
1781
+ updateAssetAttachment,
1782
+ updateAssetAttachments,
1783
+ removeAssetAttachment,
1784
+ removeAssetAttachments
1785
+ } = assetSlice.actions;
1786
+ let prevAssets = null;
1787
+ const selectAssets = (state) => {
1788
+ if (!prevAssets) {
1789
+ prevAssets = Object.values(state.assetReducer.assets);
1790
+ }
1791
+ return prevAssets;
1799
1792
  };
1800
- const selectComponentsMapping = (state) => state.componentReducer.components;
1801
- const selectComponentsFromComponentType = restructureCreateSelectorWithArgs(
1802
- createSelector(
1803
- [selectComponents, (_state, componentTypeId) => componentTypeId],
1804
- (components, componentTypeId) => {
1805
- if (!componentTypeId)
1806
- return [];
1807
- return components.filter((component) => component.component_type === componentTypeId);
1808
- }
1809
- )
1793
+ const selectAssetsMapping = (state) => state.assetReducer.assets;
1794
+ const selectAssetsOfAssetType = restructureCreateSelectorWithArgs(
1795
+ createSelector([selectAssets, (_state, assetTypeId) => assetTypeId], (components, assetTypeId) => {
1796
+ return components.filter((asset) => asset.asset_type === assetTypeId);
1797
+ })
1810
1798
  );
1811
- const selectComponent = (componentId) => (state) => {
1812
- return state.componentReducer.components[componentId];
1813
- };
1814
- const selectComponentTypeFromComponent = (componentTypeId) => (state) => {
1815
- return state.componentTypeReducer.componentTypes[componentTypeId];
1799
+ const selectAsset = (assetId) => (state) => {
1800
+ return state.assetReducer.assets[assetId];
1816
1801
  };
1817
- const selectComponentTypeFromComponents = createSelector(
1818
- [selectComponents, selectComponentTypesMapping],
1819
- (components, componentTypeMapping) => {
1802
+ const selectAssetToAssetTypeMapping = createSelector(
1803
+ [selectAssets, selectAssetTypesMapping],
1804
+ (assets, assetTypeMapping) => {
1820
1805
  const ret = {};
1821
- for (const component of components) {
1822
- const componentType = componentTypeMapping[component.component_type];
1823
- if (!componentType) {
1806
+ for (const asset of assets) {
1807
+ const assetType = assetTypeMapping[asset.asset_type];
1808
+ if (!assetType) {
1824
1809
  console.error(
1825
- `Component type with ID ${component.component_type} not found.
1826
- Expected all referenced component types to be populated.
1810
+ `Asset type with ID ${asset.asset_type} not found.
1811
+ Expected all referenced asset types to be populated.
1827
1812
  Returning empty object to avoid fatal errors.`
1828
1813
  );
1829
1814
  return {};
1830
1815
  }
1831
- ret[component.offline_id] = componentType;
1816
+ ret[asset.offline_id] = assetType;
1832
1817
  }
1833
1818
  return ret;
1834
1819
  }
1835
1820
  );
1836
- const selectComponentsByType = restructureCreateSelectorWithArgs(
1837
- createSelector(
1838
- [selectComponents, (_state, componentTypeId) => componentTypeId],
1839
- (components, componentTypeId) => {
1840
- return components.filter((component) => component.component_type === componentTypeId);
1841
- }
1842
- )
1843
- );
1844
- const selectNumberOfComponentsOfComponentType = (componentTypeId) => (state) => {
1821
+ const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
1845
1822
  var _a2;
1846
- if (!componentTypeId)
1823
+ if (!assetTypeId)
1847
1824
  return 0;
1848
- return (_a2 = selectComponentsByType(componentTypeId)(state)) == null ? void 0 : _a2.length;
1825
+ return (_a2 = selectAssetsOfAssetType(assetTypeId)(state)) == null ? void 0 : _a2.length;
1849
1826
  };
1850
- const selectComponentTypesFromIds = (componentTypeIds) => (state) => {
1851
- return componentTypeIds.reduce((acc, componentTypeId) => {
1852
- const componentType = state.componentTypeReducer.componentTypes[componentTypeId];
1853
- if (componentType) {
1854
- acc.push(componentType);
1827
+ const selectAssetTypesFromIds = (assetTypeIds) => (state) => {
1828
+ return assetTypeIds.reduce((acc, assetTypeId) => {
1829
+ const assetType = state.assetTypeReducer.assetTypes[assetTypeId];
1830
+ if (assetType) {
1831
+ acc.push(assetType);
1855
1832
  }
1856
1833
  return acc;
1857
1834
  }, []);
1858
1835
  };
1859
- const selectComponentAttachmentMapping = (state) => state.componentReducer.attachments;
1860
- const selectAllComponentAttachments = createSelector(
1861
- [selectComponentAttachmentMapping],
1836
+ const selectAssetAttachmentMapping = (state) => state.assetReducer.attachments;
1837
+ const selectAssetAttachments = createSelector(
1838
+ [selectAssetAttachmentMapping],
1862
1839
  (mapping) => Object.values(mapping)
1863
1840
  );
1864
- const selectComponentAttachment = (attachmentId) => (state) => {
1865
- return state.componentReducer.attachments[attachmentId];
1841
+ const selectAssetAttachment = (attachmentId) => (state) => {
1842
+ return state.assetReducer.attachments[attachmentId];
1866
1843
  };
1867
- const selectAttachmentsOfComponent = restructureCreateSelectorWithArgs(
1844
+ const selectAttachmentsOfAsset = restructureCreateSelectorWithArgs(
1868
1845
  createSelector(
1869
- [selectAllComponentAttachments, (_state, componentId) => componentId],
1870
- (attachments, componentId) => {
1871
- return attachments.filter(({ component }) => componentId === component);
1846
+ [selectAssetAttachments, (_state, assetId) => assetId],
1847
+ (attachments, assetId) => {
1848
+ return attachments.filter(({ asset }) => assetId === asset);
1872
1849
  }
1873
1850
  )
1874
1851
  );
1875
- const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
1852
+ const selectAttachmentsOfAssetByType = restructureCreateSelectorWithArgs(
1876
1853
  createSelector(
1877
- [selectAllComponentAttachments, (_state, componentId) => componentId],
1878
- (attachments, componentId) => {
1879
- const attachmentsOfComponent = attachments.filter(({ component }) => componentId === component);
1880
- const fileAttachments = attachmentsOfComponent.filter(
1854
+ [selectAssetAttachments, (_state, assetId) => assetId],
1855
+ (attachments, assetId) => {
1856
+ const attachmentsOfAsset = attachments.filter(({ asset }) => assetId === asset);
1857
+ const fileAttachments = attachmentsOfAsset.filter(
1881
1858
  // this null check here is necessary, there are cases where file_type is null or undefined
1882
1859
  ({ file_type }) => !file_type || !file_type.startsWith("image/")
1883
1860
  );
1884
- const imageAttachments = attachmentsOfComponent.filter(
1861
+ const imageAttachments = attachmentsOfAsset.filter(
1885
1862
  // this null check here is necessary, there are cases where file_type is null or undefined
1886
1863
  ({ file_type }) => file_type && file_type.startsWith("image/")
1887
1864
  );
@@ -1889,69 +1866,67 @@ const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
1889
1866
  }
1890
1867
  )
1891
1868
  );
1892
- const componentReducer = componentSlice.reducer;
1869
+ const assetReducer = assetSlice.reducer;
1893
1870
  const initialState$o = {
1894
- completionsByComponentId: {}
1871
+ completionsByAssetId: {}
1895
1872
  };
1896
- const componentStageCompletionSlice = createSlice({
1897
- name: "componentStageCompletions",
1873
+ const assetStageCompletionSlice = createSlice({
1874
+ name: "assetStageCompletions",
1898
1875
  initialState: initialState$o,
1899
1876
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1900
1877
  reducers: {
1901
1878
  addStageCompletion: (state, action) => {
1902
- let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
1879
+ let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
1903
1880
  if (!stageToCompletionDateMapping) {
1904
1881
  stageToCompletionDateMapping = {};
1905
- state.completionsByComponentId[action.payload.component] = stageToCompletionDateMapping;
1882
+ state.completionsByAssetId[action.payload.asset] = stageToCompletionDateMapping;
1906
1883
  }
1907
1884
  stageToCompletionDateMapping[action.payload.stage] = (/* @__PURE__ */ new Date()).toISOString();
1908
1885
  },
1909
1886
  addStageCompletions: (state, action) => {
1910
- for (const [componentId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
1887
+ for (const [assetId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
1911
1888
  if (Object.keys(stageIdToCompletionDateMapping).length === 0)
1912
- throw new Error(
1913
- `Encountered empty stageIdToCompletionDateMapping argument for component ${componentId}`
1914
- );
1915
- let thisComponentCompletions = state.completionsByComponentId[componentId];
1916
- if (thisComponentCompletions === void 0) {
1917
- thisComponentCompletions = {};
1889
+ throw new Error(`Encountered empty stageIdToCompletionDateMapping argument for asset ${assetId}`);
1890
+ let thisAssetCompletions = state.completionsByAssetId[assetId];
1891
+ if (thisAssetCompletions === void 0) {
1892
+ thisAssetCompletions = {};
1918
1893
  }
1919
1894
  for (const [stageId, completionDate] of Object.entries(stageIdToCompletionDateMapping)) {
1920
- thisComponentCompletions[stageId] = completionDate;
1895
+ thisAssetCompletions[stageId] = completionDate;
1921
1896
  }
1922
- state.completionsByComponentId[componentId] = thisComponentCompletions;
1897
+ state.completionsByAssetId[assetId] = thisAssetCompletions;
1923
1898
  }
1924
1899
  },
1925
1900
  removeStageCompletions: (state, action) => {
1926
1901
  for (const completion of action.payload) {
1927
- const thisComponentCompletions = state.completionsByComponentId[completion.component];
1928
- if (!thisComponentCompletions || !(completion.stage in thisComponentCompletions)) {
1902
+ const thisAssetCompletions = state.completionsByAssetId[completion.asset];
1903
+ if (!thisAssetCompletions || !(completion.stage in thisAssetCompletions)) {
1929
1904
  console.warn(
1930
1905
  "Skipping removal of uncompleted stage. This message indicates completion objects are created unnecessarily."
1931
1906
  );
1932
1907
  continue;
1933
1908
  }
1934
- delete thisComponentCompletions[completion.stage];
1909
+ delete thisAssetCompletions[completion.stage];
1935
1910
  }
1936
1911
  },
1937
1912
  setStageCompletions: (state, action) => {
1938
- state.completionsByComponentId = action.payload;
1913
+ state.completionsByAssetId = action.payload;
1939
1914
  }
1940
1915
  }
1941
1916
  });
1942
- const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = componentStageCompletionSlice.actions;
1917
+ const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = assetStageCompletionSlice.actions;
1943
1918
  const selectCompletedStages = (state) => {
1944
- return state.componentStageCompletionReducer.completionsByComponentId;
1919
+ return state.assetStageCompletionReducer.completionsByAssetId;
1945
1920
  };
1946
- const selectCompletedStageIdsForComponent = (component) => (state) => {
1947
- return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1921
+ const selectCompletedStageIdsForAsset = (asset) => (state) => {
1922
+ return Object.keys(state.assetStageCompletionReducer.completionsByAssetId[asset.offline_id] ?? {});
1948
1923
  };
1949
- const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1924
+ const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
1950
1925
  const initialState$n = {
1951
1926
  stages: {}
1952
1927
  };
1953
- const componentStageSlice = createSlice({
1954
- name: "componentStages",
1928
+ const assetStageSlice = createSlice({
1929
+ name: "assetStages",
1955
1930
  initialState: initialState$n,
1956
1931
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1957
1932
  reducers: {
@@ -1986,60 +1961,48 @@ const componentStageSlice = createSlice({
1986
1961
  }
1987
1962
  }
1988
1963
  });
1989
- const selectStageMapping = (state) => state.componentStageReducer.stages;
1964
+ const selectStageMapping = (state) => state.assetStageReducer.stages;
1990
1965
  const selectStage = restructureCreateSelectorWithArgs(
1991
1966
  createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
1992
1967
  return stageMapping[stageId];
1993
1968
  })
1994
1969
  );
1995
- const selectStages = createSelector(
1996
- [selectStageMapping],
1997
- (stageMapping) => {
1998
- return Object.values(stageMapping);
1999
- }
2000
- );
2001
- const selectStagesFromComponentTypeIds = restructureCreateSelectorWithArgs(
2002
- createSelector(
2003
- [selectStages, (_state, componentTypeIds) => componentTypeIds],
2004
- (stages, componentTypeIds) => {
2005
- const componentTypeIdsSet = new Set(componentTypeIds);
2006
- const ret = {};
2007
- for (const stage of stages) {
2008
- if (componentTypeIdsSet.has(stage.component_type)) {
2009
- if (!ret[stage.component_type]) {
2010
- ret[stage.component_type] = [];
2011
- }
2012
- ret[stage.component_type].push(stage);
1970
+ const selectStages = createSelector([selectStageMapping], (stageMapping) => {
1971
+ return Object.values(stageMapping);
1972
+ });
1973
+ const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
1974
+ createSelector([selectStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
1975
+ const assetTypeIdsSet = new Set(assetTypeIds);
1976
+ const ret = {};
1977
+ for (const stage of stages) {
1978
+ if (assetTypeIdsSet.has(stage.asset_type)) {
1979
+ if (!ret[stage.asset_type]) {
1980
+ ret[stage.asset_type] = [];
2013
1981
  }
1982
+ ret[stage.asset_type].push(stage);
2014
1983
  }
2015
- for (const key in ret) {
2016
- ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
2017
- }
2018
- return ret;
2019
1984
  }
2020
- )
1985
+ for (const key in ret) {
1986
+ ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
1987
+ }
1988
+ return ret;
1989
+ })
2021
1990
  );
2022
- const selectComponentTypeStagesMapping = restructureCreateSelectorWithArgs(
2023
- createSelector(
2024
- [selectStageMapping, (_state, componentTypeId) => componentTypeId],
2025
- (stagesMapping, componentTypeId) => {
2026
- const componentTypeStagesMapping = {};
2027
- for (const [stageId, stage] of Object.entries(stagesMapping)) {
2028
- if (stage.component_type === componentTypeId) {
2029
- componentTypeStagesMapping[stageId] = stage;
2030
- }
1991
+ const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
1992
+ createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
1993
+ const assetTypeStagesMapping = {};
1994
+ for (const [stageId, stage] of Object.entries(stagesMapping)) {
1995
+ if (stage.asset_type === assetTypeId) {
1996
+ assetTypeStagesMapping[stageId] = stage;
2031
1997
  }
2032
- return componentTypeStagesMapping;
2033
1998
  }
2034
- )
1999
+ return assetTypeStagesMapping;
2000
+ })
2035
2001
  );
2036
- const selectStagesFromComponentType = restructureCreateSelectorWithArgs(
2037
- createSelector(
2038
- [selectStages, (_state, componentTypeId) => componentTypeId],
2039
- (stages, componentTypeId) => {
2040
- return stages.filter((stage) => stage.component_type === componentTypeId).sort((a, b) => a.priority - b.priority);
2041
- }
2042
- )
2002
+ const selectStagesOfAssetType = restructureCreateSelectorWithArgs(
2003
+ createSelector([selectStages, (_state, assetTypeId) => assetTypeId], (stages, assetTypeId) => {
2004
+ return stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority);
2005
+ })
2043
2006
  );
2044
2007
  const selectStagesFromStageIds = restructureCreateSelectorWithArgs(
2045
2008
  createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
@@ -2061,8 +2024,8 @@ const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
2061
2024
  return ret;
2062
2025
  })
2063
2026
  );
2064
- const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
2065
- const componentStageReducer = componentStageSlice.reducer;
2027
+ const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = assetStageSlice.actions;
2028
+ const assetStageReducer = assetStageSlice.reducer;
2066
2029
  const initialState$m = {
2067
2030
  workspaces: {},
2068
2031
  activeWorkspaceId: null
@@ -2721,8 +2684,8 @@ var OrganizationAccessLevel = /* @__PURE__ */ ((OrganizationAccessLevel2) => {
2721
2684
  })(OrganizationAccessLevel || {});
2722
2685
  var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
2723
2686
  AttachmentModel2["Issue"] = "issue";
2724
- AttachmentModel2["Component"] = "component";
2725
- AttachmentModel2["ComponentType"] = "component_type";
2687
+ AttachmentModel2["Asset"] = "asset";
2688
+ AttachmentModel2["AssetType"] = "asset_type";
2726
2689
  AttachmentModel2["Project"] = "project";
2727
2690
  AttachmentModel2["Document"] = "document";
2728
2691
  return AttachmentModel2;
@@ -3535,6 +3498,7 @@ const initialState$8 = {
3535
3498
  placementMode: false,
3536
3499
  enableClustering: false,
3537
3500
  svgLayout: false,
3501
+ // TODO: this is no longer used
3538
3502
  expandedSections: {
3539
3503
  Issues: true,
3540
3504
  "Map Layers": false,
@@ -3745,27 +3709,27 @@ const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
3745
3709
  });
3746
3710
  })
3747
3711
  );
3748
- const selectLatestFormRevisionsOfComponentTypes = restructureCreateSelectorWithArgs(
3712
+ const selectLatestFormRevisionsOfAssetTypes = restructureCreateSelectorWithArgs(
3749
3713
  createSelector(
3750
3714
  [
3751
3715
  (state) => state.formReducer.forms,
3752
3716
  selectFormRevisionMapping,
3753
- (_state, componentTypeIds) => componentTypeIds
3717
+ (_state, assetTypeIds) => assetTypeIds
3754
3718
  ],
3755
- (userForms, revisions, componentTypeIds) => {
3756
- const componentTypeIdsSet = new Set(componentTypeIds);
3757
- const formsOfComponentTypes = {};
3719
+ (userForms, revisions, assetTypeIds) => {
3720
+ const assetTypeIdsSet = new Set(assetTypeIds);
3721
+ const formsOfAssetTypes = {};
3758
3722
  const ret = {};
3759
3723
  for (const form of Object.values(userForms)) {
3760
- if (form.component_type && componentTypeIdsSet.has(form.component_type)) {
3761
- formsOfComponentTypes[form.offline_id] = form;
3724
+ if (form.asset_type && assetTypeIdsSet.has(form.asset_type)) {
3725
+ formsOfAssetTypes[form.offline_id] = form;
3762
3726
  }
3763
3727
  }
3764
3728
  for (const revision of Object.values(revisions)) {
3765
- const form = formsOfComponentTypes[revision.form];
3766
- if (!form || !form.component_type || ret[form.component_type] && formRevisionSortFn(ret[form.component_type], revision) > 0)
3729
+ const form = formsOfAssetTypes[revision.form];
3730
+ if (!form || !form.asset_type || ret[form.asset_type] && formRevisionSortFn(ret[form.asset_type], revision) > 0)
3767
3731
  continue;
3768
- ret[form.component_type] = revision;
3732
+ ret[form.asset_type] = revision;
3769
3733
  }
3770
3734
  return ret;
3771
3735
  }
@@ -3882,11 +3846,11 @@ const selectForm = (formId2) => (state) => {
3882
3846
  const selectFormMapping = (state) => {
3883
3847
  return state.formReducer.forms;
3884
3848
  };
3885
- const selectFormOfComponentType = restructureCreateSelectorWithArgs(
3849
+ const selectFormOfAssetType = restructureCreateSelectorWithArgs(
3886
3850
  createSelector(
3887
- [selectFormMapping, (_state, componentTypeId) => componentTypeId],
3888
- (userForms, componentTypeId) => {
3889
- return Object.values(userForms).find((userForm) => userForm.component_type === componentTypeId);
3851
+ [selectFormMapping, (_state, assetTypeId) => assetTypeId],
3852
+ (userForms, assetTypeId) => {
3853
+ return Object.values(userForms).find((userForm) => userForm.asset_type === assetTypeId);
3890
3854
  }
3891
3855
  )
3892
3856
  );
@@ -3902,7 +3866,7 @@ const selectFormsCount = createSelector([selectFormMapping], (userForms) => {
3902
3866
  return Object.keys(userForms).length;
3903
3867
  });
3904
3868
  const selectGeneralFormCount = createSelector([selectFormMapping], (userForms) => {
3905
- return Object.values(userForms).filter((form) => !form.component_type).length;
3869
+ return Object.values(userForms).filter((form) => !form.asset_type).length;
3906
3870
  });
3907
3871
  const formReducer = formSlice.reducer;
3908
3872
  const initialState$5 = {
@@ -4110,31 +4074,31 @@ const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
4110
4074
  }
4111
4075
  )
4112
4076
  );
4113
- const selectFormSubmissionsOfComponent = restructureCreateSelectorWithArgs(
4077
+ const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
4114
4078
  createSelector(
4115
- [selectFormSubmissions, (_state, componentId) => componentId],
4116
- (submissions, componentId) => {
4079
+ [selectFormSubmissions, (_state, assetId) => assetId],
4080
+ (submissions, assetId) => {
4117
4081
  return submissions.filter((submission) => {
4118
- return submission.component === componentId;
4082
+ return submission.asset === assetId;
4119
4083
  });
4120
4084
  }
4121
4085
  )
4122
4086
  );
4123
- const selectFormSubmissionsByComponents = createSelector(
4124
- [selectFormSubmissionsMapping, selectComponentsMapping],
4125
- (submissions, components) => {
4087
+ const selectFormSubmissionsByAssets = createSelector(
4088
+ [selectFormSubmissionsMapping, selectAssetsMapping],
4089
+ (submissions, assets) => {
4126
4090
  var _a2;
4127
- const componentSubmissionMapping = {};
4128
- for (const componentId in components) {
4129
- componentSubmissionMapping[componentId] = [];
4091
+ const assetSubmissionMapping = {};
4092
+ for (const assetId in assets) {
4093
+ assetSubmissionMapping[assetId] = [];
4130
4094
  }
4131
4095
  for (const submissionId in submissions) {
4132
4096
  const submission = submissions[submissionId];
4133
- if (submission.component) {
4134
- (_a2 = componentSubmissionMapping[submission.component]) == null ? void 0 : _a2.push(submission);
4097
+ if (submission.asset) {
4098
+ (_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
4135
4099
  }
4136
4100
  }
4137
- return componentSubmissionMapping;
4101
+ return assetSubmissionMapping;
4138
4102
  }
4139
4103
  );
4140
4104
  const selectFormSubmissionAttachmentsMapping = (state) => {
@@ -4533,7 +4497,7 @@ const versioningSlice = createSlice({
4533
4497
  reducers: {}
4534
4498
  });
4535
4499
  const versioningReducer = versioningSlice.reducer;
4536
- const fullComponentMarkerSize = 45;
4500
+ const fullAssetMarkerSize = 45;
4537
4501
  const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
4538
4502
  const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
4539
4503
  const OUTBOX_RETRY_DELAY = 5e3;
@@ -4551,10 +4515,10 @@ const overmapReducers = {
4551
4515
  fileReducer,
4552
4516
  authReducer,
4553
4517
  categoryReducer,
4554
- componentReducer,
4555
- componentStageCompletionReducer,
4556
- componentStageReducer,
4557
- componentTypeReducer,
4518
+ assetReducer,
4519
+ assetStageCompletionReducer,
4520
+ assetStageReducer,
4521
+ assetTypeReducer,
4558
4522
  issueReducer,
4559
4523
  issueTypeReducer,
4560
4524
  mapReducer,
@@ -5396,110 +5360,108 @@ class CategoryService extends BaseApiService {
5396
5360
  store.dispatch(setCategories(result));
5397
5361
  }
5398
5362
  }
5399
- class ComponentService extends BaseApiService {
5363
+ class AssetService extends BaseApiService {
5400
5364
  // Basic CRUD functions
5401
- add(component, workspaceId) {
5402
- const offlineComponent = offline(component);
5403
- this.client.store.dispatch(addComponent(offlineComponent));
5365
+ add(asset, workspaceId) {
5366
+ const offlineAsset = offline(asset);
5367
+ this.client.store.dispatch(addAsset(offlineAsset));
5404
5368
  const promise = this.client.enqueueRequest({
5405
- description: "Create Component",
5369
+ description: "Create asset",
5406
5370
  method: HttpMethod.POST,
5407
- url: `/components/types/${offlineComponent.component_type}/add-components/`,
5371
+ url: `/assets/types/${offlineAsset.asset_type}/add-assets/`,
5408
5372
  queryParams: {
5409
5373
  workspace_id: workspaceId.toString()
5410
5374
  },
5411
- payload: { components: [offlineComponent] },
5375
+ payload: { assets: [offlineAsset] },
5412
5376
  blockers: [],
5413
- blocks: [offlineComponent.offline_id]
5377
+ blocks: [offlineAsset.offline_id]
5414
5378
  });
5415
- return [offlineComponent, promise];
5379
+ return [offlineAsset, promise];
5416
5380
  }
5417
- update(component, workspaceId) {
5418
- this.client.store.dispatch(updateComponent(component));
5381
+ update(asset, workspaceId) {
5382
+ this.client.store.dispatch(updateAsset(asset));
5419
5383
  const promise = this.client.enqueueRequest({
5420
- description: "Edit component",
5384
+ description: "Edit asset",
5421
5385
  method: HttpMethod.PATCH,
5422
- url: `/components/${component.offline_id}/`,
5386
+ url: `/assets/${asset.offline_id}/`,
5423
5387
  queryParams: {
5424
5388
  workspace_id: workspaceId.toString()
5425
5389
  },
5426
- payload: component,
5427
- blockers: [component.offline_id],
5428
- blocks: [component.offline_id]
5390
+ payload: asset,
5391
+ blockers: [asset.offline_id],
5392
+ blocks: [asset.offline_id]
5429
5393
  });
5430
- return [component, promise];
5394
+ return [asset, promise];
5431
5395
  }
5432
- async remove(id) {
5396
+ async remove(assetId) {
5433
5397
  const { store } = this.client;
5434
- const backupComponent = selectComponent(id)(store.getState());
5435
- if (!backupComponent)
5436
- throw new Error(`No component with id ${id} found in the store`);
5437
- const attachmentsOfComponent = selectAttachmentsOfComponent(id)(store.getState());
5438
- store.dispatch(removeComponent(id));
5439
- if (attachmentsOfComponent.length > 0) {
5440
- const attachmentsOfComponentIds = attachmentsOfComponent.map(({ offline_id }) => offline_id);
5441
- store.dispatch(removeComponentAttachments(attachmentsOfComponentIds));
5398
+ const assetToBeDeleted = selectAsset(assetId)(store.getState());
5399
+ if (!assetToBeDeleted)
5400
+ throw new Error(`No asset with id ${assetId} found in the store`);
5401
+ const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(store.getState());
5402
+ store.dispatch(removeAsset(assetId));
5403
+ if (attachmentsOfAssets.length > 0) {
5404
+ const attachmentsOfAssetIds = attachmentsOfAssets.map(({ offline_id }) => offline_id);
5405
+ store.dispatch(removeAssetAttachments(attachmentsOfAssetIds));
5442
5406
  }
5443
5407
  return this.client.enqueueRequest({
5444
- description: "Delete issue",
5408
+ description: "Delete asset",
5445
5409
  method: HttpMethod.DELETE,
5446
- url: `/components/${id}/`,
5447
- blockers: [id],
5410
+ url: `/assets/${assetId}/`,
5411
+ blockers: [assetId],
5448
5412
  blocks: []
5449
5413
  }).catch((err) => {
5450
- store.dispatch(addComponent(backupComponent));
5451
- store.dispatch(addComponentAttachments(attachmentsOfComponent));
5414
+ store.dispatch(addAsset(assetToBeDeleted));
5415
+ store.dispatch(addAssetAttachments(attachmentsOfAssets));
5452
5416
  throw err;
5453
5417
  });
5454
5418
  }
5455
- async deleteAllByComponentType(componentTypeId) {
5456
- const clientStore2 = this.client.store;
5457
- const allComponentsOfType = selectComponentsFromComponentType(componentTypeId)(clientStore2.getState());
5458
- const affectedComponentIds = (allComponentsOfType || []).map((c) => c.offline_id);
5459
- const affectedOfflineIds = [componentTypeId, ...affectedComponentIds];
5419
+ async deleteAllAssetsOfAssetType(assetTypeId) {
5460
5420
  const { store } = this.client;
5461
5421
  const state = store.getState();
5462
- const componentsOfThisType = selectComponentsByType(componentTypeId)(state);
5463
- store.dispatch(removeAllComponentsOfType(componentTypeId));
5422
+ const allAssetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state);
5423
+ const allAssetsOfAssetTypeIds = (allAssetsOfAssetType || []).map((c) => c.offline_id);
5424
+ const affectedOfflineIds = [assetTypeId, ...allAssetsOfAssetTypeIds];
5425
+ store.dispatch(removeAllAssetsOfType(assetTypeId));
5464
5426
  return this.client.enqueueRequest({
5465
- description: "Batch delete components by component type",
5427
+ description: "Delete all assets of asset type",
5466
5428
  method: HttpMethod.DELETE,
5467
- url: `/components/types/${componentTypeId}/delete-all-of-type/`,
5429
+ url: `/assets/types/${assetTypeId}/delete-all-of-type/`,
5468
5430
  blockers: affectedOfflineIds,
5469
5431
  blocks: affectedOfflineIds
5470
5432
  }).catch((err) => {
5471
- if (componentsOfThisType) {
5472
- store.dispatch(addComponentsInBatches(componentsOfThisType));
5433
+ if (allAssetsOfAssetType) {
5434
+ store.dispatch(addAssetsInBatches(allAssetsOfAssetType));
5473
5435
  }
5474
5436
  throw err;
5475
5437
  });
5476
5438
  }
5477
- async addBatch(componentsToCreate, workspaceId, componentTypeId) {
5478
- const fullComponents = componentsToCreate.map((component) => {
5479
- return { ...offline(component), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
5439
+ async addBatch(assetsToCreate, workspaceId, assetTypeId) {
5440
+ const fullAssets = assetsToCreate.map((asset) => {
5441
+ return { ...offline(asset), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
5480
5442
  });
5481
5443
  const { store } = this.client;
5482
- store.dispatch(addComponentsInBatches(fullComponents));
5444
+ store.dispatch(addAssetsInBatches(fullAssets));
5483
5445
  const promise = this.client.enqueueRequest({
5484
- description: "Batch create components",
5446
+ description: "Batch create assets",
5485
5447
  method: HttpMethod.POST,
5486
- url: `/components/types/${componentTypeId}/add-components/`,
5448
+ url: `/assets/types/${assetTypeId}/add-assets/`,
5487
5449
  queryParams: {
5488
5450
  workspace_id: workspaceId.toString()
5489
5451
  },
5490
5452
  payload: {
5491
- components: fullComponents
5453
+ assets: fullAssets
5492
5454
  },
5493
- blockers: [componentTypeId],
5494
- blocks: fullComponents.map((c) => c.offline_id)
5455
+ blockers: [assetTypeId],
5456
+ blocks: fullAssets.map((c) => c.offline_id)
5495
5457
  });
5496
5458
  void promise.then((result) => {
5497
- for (const component of Object.values(result)) {
5498
- store.dispatch(updateComponent(component));
5459
+ for (const assets of Object.values(result)) {
5460
+ store.dispatch(updateAsset(assets));
5499
5461
  }
5500
5462
  }).catch((e) => {
5501
- for (const component of fullComponents) {
5502
- store.dispatch(removeComponent(component.offline_id));
5463
+ for (const asset of fullAssets) {
5464
+ store.dispatch(removeAsset(asset.offline_id));
5503
5465
  }
5504
5466
  throw e;
5505
5467
  });
@@ -5508,128 +5470,124 @@ class ComponentService extends BaseApiService {
5508
5470
  async refreshStore() {
5509
5471
  const { store } = this.client;
5510
5472
  const result = await this.client.enqueueRequest({
5511
- description: "Get components",
5473
+ description: "Get assets",
5512
5474
  method: HttpMethod.GET,
5513
- url: `/projects/${store.getState().projectReducer.activeProjectId}/components/`,
5475
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/assets/`,
5514
5476
  blockers: [],
5515
5477
  blocks: []
5516
5478
  });
5517
- store.dispatch(setComponents(result));
5479
+ store.dispatch(setAssets(result));
5518
5480
  }
5519
5481
  }
5520
- class ComponentStageCompletionService extends BaseApiService {
5521
- add(componentId, stageId) {
5482
+ class AssetStageCompletionService extends BaseApiService {
5483
+ add(assetId, stageId) {
5522
5484
  var _a2;
5523
5485
  const { store } = this.client;
5524
- const componentType = (_a2 = store.getState().componentReducer.components[componentId]) == null ? void 0 : _a2.component_type;
5525
- if (!componentType) {
5526
- throw new Error(`Component ${componentId} not found`);
5486
+ const assetTypeId = (_a2 = store.getState().assetReducer.assets[assetId]) == null ? void 0 : _a2.asset_type;
5487
+ if (!assetTypeId) {
5488
+ throw new Error(`Asset with offline_id ${assetId} not found`);
5527
5489
  }
5528
- const offlineCompletion = offline({
5529
- component: componentId,
5490
+ const offlineStageCompletion = offline({
5491
+ asset: assetId,
5530
5492
  stage: stageId
5531
5493
  });
5532
- store.dispatch(addStageCompletion(offlineCompletion));
5494
+ store.dispatch(addStageCompletion(offlineStageCompletion));
5533
5495
  const promise = this.client.enqueueRequest({
5534
- description: "Mark stage as completed",
5496
+ description: "Complete stage",
5535
5497
  method: HttpMethod.POST,
5536
- url: `/components/types/${componentType}/complete-stages/`,
5498
+ url: `/assets/types/${assetTypeId}/complete-stages/`,
5537
5499
  // TODO: Add submitted_at to model
5538
- payload: { completions: [{ ...offlineCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
5539
- blockers: [componentId, stageId],
5540
- blocks: [offlineCompletion.offline_id]
5500
+ payload: { completions: [{ ...offlineStageCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
5501
+ blockers: [assetId, stageId],
5502
+ blocks: [offlineStageCompletion.offline_id]
5541
5503
  });
5542
- return [offlineCompletion, promise];
5504
+ return [offlineStageCompletion, promise];
5543
5505
  }
5544
5506
  async refreshStore() {
5545
5507
  const { store } = this.client;
5546
5508
  const result = await this.client.enqueueRequest({
5547
- description: "Get completed stages",
5509
+ description: "Get stage completions",
5548
5510
  method: HttpMethod.GET,
5549
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stage-completions/`,
5511
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stage-completions/`,
5550
5512
  blockers: [],
5551
5513
  blocks: []
5552
5514
  });
5553
5515
  store.dispatch(addStageCompletions(result));
5554
5516
  }
5555
5517
  /**
5556
- * Creates a collection of ComponentStageCompletions, marking the referenced stages as completed for the referenced
5557
- * components. It's REQUIRED that all components referenced all have the SAME component type.
5558
- * @param componentTypeId The ID of the component type for which we are completing stages (we can only complete
5559
- * stages for one component type at a time)
5518
+ * Creates a collection of AssetStageCompletions, marking the referenced stages as completed for the referenced
5519
+ * assets. It's REQUIRED that all assets referenced all have the SAME asset type.
5520
+ * @param assetTypeId The ID of the asset type for which we are completing stages (we can only complete
5521
+ * stages for one asset type at a time)
5560
5522
  * @param stageCompletions
5561
5523
  */
5562
- async bulkAdd(componentTypeId, stageCompletions) {
5563
- const offlineStagesCompletions = stageCompletions.map((completion) => {
5524
+ async bulkAdd(assetTypeId, stageCompletions) {
5525
+ const offlineStageCompletions = stageCompletions.map((completion) => {
5564
5526
  return offline(completion);
5565
5527
  });
5566
5528
  const asMapping = {};
5567
5529
  for (const completion of stageCompletions) {
5568
- const stageToCompletionDateMapping = asMapping[completion.component] || {};
5530
+ const stageToCompletionDateMapping = asMapping[completion.asset] || {};
5569
5531
  stageToCompletionDateMapping[completion.stage] = (/* @__PURE__ */ new Date()).toISOString();
5570
- asMapping[completion.component] = stageToCompletionDateMapping;
5532
+ asMapping[completion.asset] = stageToCompletionDateMapping;
5571
5533
  }
5572
5534
  this.client.store.dispatch(addStageCompletions(asMapping));
5573
5535
  await this.client.enqueueRequest({
5574
- description: "Mark multiple stage as completed",
5536
+ description: "Bulk complete stages",
5575
5537
  method: HttpMethod.POST,
5576
- url: `/components/types/${componentTypeId}/complete-stages/`,
5538
+ url: `/assets/types/${assetTypeId}/complete-stages/`,
5577
5539
  payload: {
5578
- completions: offlineStagesCompletions
5540
+ completions: offlineStageCompletions
5579
5541
  },
5580
- blockers: [
5581
- componentTypeId,
5582
- ...stageCompletions.map((c) => c.component),
5583
- ...stageCompletions.map((c) => c.stage)
5584
- ],
5585
- blocks: offlineStagesCompletions.map((c) => c.offline_id)
5542
+ blockers: [assetTypeId, ...stageCompletions.map((c) => c.asset), ...stageCompletions.map((c) => c.stage)],
5543
+ blocks: offlineStageCompletions.map((c) => c.offline_id)
5586
5544
  });
5587
5545
  }
5588
- bulkDelete(stageId, componentIds) {
5589
- const completionsToRemove = componentIds.map((componentId) => {
5546
+ bulkDelete(stageId, assetIds) {
5547
+ const stageCompletionsToRemove = assetIds.map((assetId) => {
5590
5548
  return {
5591
- component: componentId,
5549
+ asset: assetId,
5592
5550
  stage: stageId
5593
5551
  };
5594
5552
  });
5595
- this.client.store.dispatch(removeStageCompletions(completionsToRemove));
5553
+ this.client.store.dispatch(removeStageCompletions(stageCompletionsToRemove));
5596
5554
  return this.client.enqueueRequest({
5597
- description: `Undo stage for ${componentIds.length} component(s)`,
5555
+ description: `Undo stage for ${assetIds.length} assets(s)`,
5598
5556
  // TODO: Rename to setCompletedStages
5599
5557
  method: HttpMethod.DELETE,
5600
- url: `/components/stages/${stageId}/undo-stages/`,
5558
+ url: `/assets/stages/${stageId}/undo-stages/`,
5601
5559
  payload: {
5602
- components: componentIds
5560
+ assets: assetIds
5603
5561
  },
5604
- blockers: [stageId, ...componentIds],
5562
+ blockers: [stageId, ...assetIds],
5605
5563
  blocks: []
5606
5564
  });
5607
5565
  }
5608
5566
  }
5609
- class ComponentStageService extends BaseApiService {
5610
- async bulkCreateStages(stagesToSubmit, componentTypeId, workspaceId) {
5567
+ class AssetStageService extends BaseApiService {
5568
+ async bulkCreateStages(stagesToSubmit, assetTypeId, workspaceId) {
5611
5569
  const payload = stagesToSubmit.map((stage) => {
5612
5570
  return offline(stage);
5613
5571
  });
5614
5572
  const fullStages = payload.map((stage) => {
5615
- return { ...stage, component_type: componentTypeId };
5573
+ return { ...stage, asset_type: assetTypeId };
5616
5574
  });
5617
5575
  this.client.store.dispatch(addStages(fullStages));
5618
5576
  return this.client.enqueueRequest({
5619
- description: "Add component stages",
5577
+ description: "Add asset stages",
5620
5578
  method: HttpMethod.POST,
5621
- url: `/components/types/${componentTypeId}/add-stages/`,
5579
+ url: `/assets/types/${assetTypeId}/add-stages/`,
5622
5580
  payload: {
5623
5581
  stages: payload
5624
5582
  },
5625
5583
  queryParams: {
5626
5584
  workspace_id: workspaceId.toString()
5627
5585
  },
5628
- blockers: [componentTypeId, workspaceId],
5586
+ blockers: [assetTypeId, workspaceId],
5629
5587
  blocks: payload.map(({ offline_id }) => offline_id)
5630
5588
  });
5631
5589
  }
5632
- async bulkUpdateStages(stagesToUpdate, componentTypeId) {
5590
+ async bulkUpdateStages(stagesToUpdate, assetTypeId) {
5633
5591
  const store = this.client.store;
5634
5592
  const state = store.getState();
5635
5593
  const prevStages = selectStagesFromStageIds(
@@ -5640,13 +5598,13 @@ class ComponentStageService extends BaseApiService {
5640
5598
  }
5641
5599
  store.dispatch(updateStages(stagesToUpdate));
5642
5600
  return this.client.enqueueRequest({
5643
- description: "Edit component stages",
5601
+ description: "Edit asset stages",
5644
5602
  method: HttpMethod.PATCH,
5645
- url: `/components/types/${componentTypeId}/bulk-update-stages/`,
5603
+ url: `/assets/types/${assetTypeId}/bulk-update-stages/`,
5646
5604
  payload: {
5647
5605
  stages: stagesToUpdate
5648
5606
  },
5649
- blockers: [componentTypeId],
5607
+ blockers: [assetTypeId],
5650
5608
  blocks: stagesToUpdate.map(({ offline_id }) => offline_id)
5651
5609
  }).catch((e) => {
5652
5610
  store.dispatch(updateStages(prevStages));
@@ -5656,9 +5614,9 @@ class ComponentStageService extends BaseApiService {
5656
5614
  async bulkDelete(idsToDelete) {
5657
5615
  this.client.store.dispatch(removeStages(idsToDelete));
5658
5616
  return this.client.enqueueRequest({
5659
- description: "Delete component stages",
5617
+ description: "Delete asset stages",
5660
5618
  method: HttpMethod.DELETE,
5661
- url: "/components/stages/bulk-delete/",
5619
+ url: "/assets/stages/bulk-delete/",
5662
5620
  payload: {
5663
5621
  stage_ids: idsToDelete
5664
5622
  },
@@ -5666,15 +5624,15 @@ class ComponentStageService extends BaseApiService {
5666
5624
  blocks: []
5667
5625
  });
5668
5626
  }
5669
- async update(componentStage) {
5670
- this.client.store.dispatch(addStages([componentStage]));
5627
+ async update(assetStage) {
5628
+ this.client.store.dispatch(addStages([assetStage]));
5671
5629
  return this.client.enqueueRequest({
5672
- description: "Update component stage",
5630
+ description: "Update asset stage",
5673
5631
  method: HttpMethod.PATCH,
5674
- url: `/components/stages/${componentStage.offline_id}/`,
5675
- payload: componentStage,
5676
- blockers: [componentStage.offline_id],
5677
- blocks: [componentStage.offline_id]
5632
+ url: `/assets/stages/${assetStage.offline_id}/`,
5633
+ payload: assetStage,
5634
+ blockers: [assetStage.offline_id],
5635
+ blocks: [assetStage.offline_id]
5678
5636
  });
5679
5637
  }
5680
5638
  async linkForm(stageId, formId2) {
@@ -5682,9 +5640,9 @@ class ComponentStageService extends BaseApiService {
5682
5640
  store.dispatch(linkStageToForm({ stageId, formId: formId2 }));
5683
5641
  try {
5684
5642
  await this.client.enqueueRequest({
5685
- description: "Link component stage to form",
5643
+ description: "Link asset stage to form",
5686
5644
  method: HttpMethod.POST,
5687
- url: `/components/stages/${stageId}/associate-with-form/`,
5645
+ url: `/assets/stages/${stageId}/associate-with-form/`,
5688
5646
  payload: { user_form: formId2 },
5689
5647
  blockers: [stageId, formId2],
5690
5648
  blocks: [stageId]
@@ -5699,9 +5657,9 @@ class ComponentStageService extends BaseApiService {
5699
5657
  store.dispatch(unlinkStageToForm({ stageId }));
5700
5658
  try {
5701
5659
  await this.client.enqueueRequest({
5702
- description: "Unlink component stage from form",
5660
+ description: "Unlink asset stage from form",
5703
5661
  method: HttpMethod.DELETE,
5704
- url: `/components/stages/${stageId}/associate-with-form/`,
5662
+ url: `/assets/stages/${stageId}/associate-with-form/`,
5705
5663
  blockers: [stageId, formId2],
5706
5664
  blocks: [stageId]
5707
5665
  });
@@ -5713,9 +5671,9 @@ class ComponentStageService extends BaseApiService {
5713
5671
  async refreshStore() {
5714
5672
  const { store } = this.client;
5715
5673
  const result = await this.client.enqueueRequest({
5716
- description: "Get component stages",
5674
+ description: "Get asset stages",
5717
5675
  method: HttpMethod.GET,
5718
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stages/`,
5676
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stages/`,
5719
5677
  blockers: [],
5720
5678
  blocks: []
5721
5679
  });
@@ -5729,20 +5687,20 @@ const AttachmentModelMeta = {
5729
5687
  deleteUrlPrefix: "/issues",
5730
5688
  fetchUrlPostfix: "/issue-attachments"
5731
5689
  },
5732
- [AttachmentModel.Component]: {
5733
- name: "component",
5734
- attachUrlPrefix: "/components",
5735
- deleteUrlPrefix: "/components",
5736
- fetchUrlPostfix: "/component-attachments"
5690
+ [AttachmentModel.Asset]: {
5691
+ name: "asset",
5692
+ attachUrlPrefix: "/assets",
5693
+ deleteUrlPrefix: "/assets",
5694
+ fetchUrlPostfix: "/asset-attachments"
5737
5695
  },
5738
- [AttachmentModel.ComponentType]: {
5739
- name: "component type",
5740
- attachUrlPrefix: "/components/types",
5741
- deleteUrlPrefix: "/components/types",
5742
- fetchUrlPostfix: "/component-type-attachments"
5696
+ [AttachmentModel.AssetType]: {
5697
+ name: "asset type",
5698
+ attachUrlPrefix: "/assets/types",
5699
+ deleteUrlPrefix: "/assets/types",
5700
+ fetchUrlPostfix: "/asset-type-attachments"
5743
5701
  },
5744
5702
  [AttachmentModel.Project]: {
5745
- name: "component project",
5703
+ name: "project",
5746
5704
  attachUrlPrefix: "/projects",
5747
5705
  deleteUrlPrefix: "/projects",
5748
5706
  fetchUrlPostfix: "/attachments"
@@ -5758,8 +5716,8 @@ class BaseAttachmentService extends BaseApiService {
5758
5716
  getNumberOfAttachmentsWithSha1(sha1) {
5759
5717
  const {
5760
5718
  issueReducer: issueReducer2,
5761
- componentReducer: componentReducer2,
5762
- componentTypeReducer: componentTypeReducer2,
5719
+ assetReducer: assetReducer2,
5720
+ assetTypeReducer: assetTypeReducer2,
5763
5721
  documentsReducer: documentsReducer2,
5764
5722
  projectReducer: projectReducer2,
5765
5723
  formSubmissionReducer: formSubmissionReducer2,
@@ -5767,8 +5725,8 @@ class BaseAttachmentService extends BaseApiService {
5767
5725
  } = this.client.store.getState();
5768
5726
  const objectsWithSha1 = [].concat(
5769
5727
  Object.values(issueReducer2.attachments),
5770
- Object.values(componentReducer2.attachments),
5771
- Object.values(componentTypeReducer2.attachments),
5728
+ Object.values(assetReducer2.attachments),
5729
+ Object.values(assetTypeReducer2.attachments),
5772
5730
  Object.values(documentsReducer2.attachments),
5773
5731
  Object.values(projectReducer2.attachments),
5774
5732
  Object.values(formRevisionReducer2.attachments),
@@ -5890,10 +5848,10 @@ class BaseAttachmentService extends BaseApiService {
5890
5848
  return promise;
5891
5849
  }
5892
5850
  }
5893
- class ComponentAttachmentService extends BaseAttachmentService {
5851
+ class AssetAttachmentService extends BaseAttachmentService {
5894
5852
  constructor() {
5895
5853
  super(...arguments);
5896
- __publicField(this, "attachmentModel", AttachmentModel.Component);
5854
+ __publicField(this, "attachmentModel", AttachmentModel.Asset);
5897
5855
  }
5898
5856
  buildOfflineAttachment(data) {
5899
5857
  return offline({
@@ -5904,115 +5862,108 @@ class ComponentAttachmentService extends BaseAttachmentService {
5904
5862
  file_type: data.file.type,
5905
5863
  submitted_at: data.submittedAt,
5906
5864
  description: data.description,
5907
- component: data.modelId
5865
+ asset: data.modelId
5908
5866
  });
5909
5867
  }
5910
- async attachFilesToComponent(files, componentId) {
5911
- return this.attachFiles(
5912
- files,
5913
- componentId,
5914
- this.buildOfflineAttachment.bind(this),
5915
- {
5916
- addAttachments: addComponentAttachments,
5917
- updateAttachments: updateComponentAttachments,
5918
- removeAttachments: removeComponentAttachments
5919
- }
5920
- );
5868
+ async attachFilesToAsset(files, assetId) {
5869
+ return this.attachFiles(files, assetId, this.buildOfflineAttachment.bind(this), {
5870
+ addAttachments: addAssetAttachments,
5871
+ updateAttachments: updateAssetAttachments,
5872
+ removeAttachments: removeAssetAttachments
5873
+ });
5921
5874
  }
5922
- deleteComponentAttachment(attachmentId) {
5875
+ deleteAssetAttachment(attachmentId) {
5923
5876
  return this.deleteAttachment(
5924
5877
  attachmentId,
5925
5878
  {
5926
- setAttachment: setComponentAttachment,
5927
- removeAttachment: removeComponentAttachment
5879
+ setAttachment: setAssetAttachment,
5880
+ removeAttachment: removeAssetAttachment
5928
5881
  },
5929
5882
  {
5930
- selectAttachment: selectComponentAttachment
5883
+ selectAttachment: selectAssetAttachment
5931
5884
  }
5932
5885
  );
5933
5886
  }
5934
5887
  async refreshStore() {
5935
5888
  return this.getAttachments({
5936
- setAttachments: setComponentAttachments
5889
+ setAttachments: setAssetAttachments
5937
5890
  });
5938
5891
  }
5939
5892
  }
5940
- class ComponentTypeService extends BaseApiService {
5941
- add(componentType) {
5942
- const offlineComponentType = offline(componentType);
5893
+ class AssetTypeService extends BaseApiService {
5894
+ add(assetType) {
5895
+ const offlineAssetType = offline(assetType);
5943
5896
  const { store } = this.client;
5944
5897
  const activeProjectId = store.getState().projectReducer.activeProjectId;
5945
- store.dispatch(addComponentType(offlineComponentType));
5898
+ store.dispatch(addAssetType(offlineAssetType));
5946
5899
  const promise = this.client.enqueueRequest({
5947
- description: "Create ComponentType",
5900
+ description: "Create asset type",
5948
5901
  method: HttpMethod.POST,
5949
- url: `/projects/${activeProjectId}/component-types/`,
5950
- payload: { ...offlineComponentType },
5902
+ url: `/projects/${activeProjectId}/asset-types/`,
5903
+ payload: { ...offlineAssetType },
5951
5904
  blockers: [],
5952
- blocks: [offlineComponentType.offline_id]
5905
+ blocks: [offlineAssetType.offline_id]
5953
5906
  });
5954
- return [offlineComponentType, promise];
5907
+ return [offlineAssetType, promise];
5955
5908
  }
5956
- update(componentType) {
5957
- this.client.store.dispatch(addComponentType(componentType));
5909
+ update(assetType) {
5910
+ this.client.store.dispatch(addAssetType(assetType));
5958
5911
  return this.client.enqueueRequest({
5959
- description: "Update ComponentType",
5912
+ description: "Update asset type",
5960
5913
  method: HttpMethod.PATCH,
5961
- url: `/components/types/${componentType.offline_id}/`,
5962
- payload: componentType,
5963
- blockers: [componentType.offline_id],
5964
- blocks: [componentType.offline_id]
5914
+ url: `/assets/types/${assetType.offline_id}/`,
5915
+ payload: assetType,
5916
+ blockers: [assetType.offline_id],
5917
+ blocks: [assetType.offline_id]
5965
5918
  });
5966
5919
  }
5967
- async delete(componentTypeId) {
5920
+ async delete(assetTypeId) {
5968
5921
  const { store } = this.client;
5969
5922
  const state = store.getState();
5970
- const componentType = selectComponentType(componentTypeId)(state);
5971
- if (!componentType) {
5972
- throw new Error("Expected componentType to exist");
5973
- }
5974
- const stagesOfComponentType = selectStagesFromComponentType(componentTypeId)(state) ?? [];
5975
- const attachmentsOfComponentType = selectAttachmentsOfComponentType(componentTypeId)(state);
5976
- store.dispatch(deleteComponentType(componentTypeId));
5977
- if (stagesOfComponentType.length > 0) {
5978
- const stagesOfComponentTypeIds = stagesOfComponentType.map(
5979
- (componentTypeStage) => componentTypeStage.offline_id
5980
- );
5981
- store.dispatch(removeStages(stagesOfComponentTypeIds));
5923
+ const assetType = selectAssetType(assetTypeId)(state);
5924
+ if (!assetType) {
5925
+ throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
5926
+ }
5927
+ const stagesOfAssetType = selectStagesOfAssetType(assetTypeId)(state) ?? [];
5928
+ const attachmentsOfAssetType = selectAttachmentsOfAssetType(assetTypeId)(state);
5929
+ store.dispatch(deleteAssetType(assetTypeId));
5930
+ if (stagesOfAssetType.length > 0) {
5931
+ const stagesOfAssetTypeIds = stagesOfAssetType.map((assetStage) => assetStage.offline_id);
5932
+ store.dispatch(removeStages(stagesOfAssetTypeIds));
5982
5933
  }
5983
- if (attachmentsOfComponentType.length > 0) {
5984
- const attachmentsOfComponentTypeIds = attachmentsOfComponentType.map(({ offline_id }) => offline_id);
5985
- store.dispatch(removeComponentTypeAttachments(attachmentsOfComponentTypeIds));
5934
+ if (attachmentsOfAssetType.length > 0) {
5935
+ const attachmentsOfAssetTypeIds = attachmentsOfAssetType.map(({ offline_id }) => offline_id);
5936
+ store.dispatch(removeAssetTypeAttachments(attachmentsOfAssetTypeIds));
5986
5937
  }
5987
5938
  return this.client.enqueueRequest({
5988
- description: "Delete ComponentType",
5939
+ description: "Delete asset type",
5989
5940
  method: HttpMethod.DELETE,
5990
- url: `/components/types/${componentTypeId}/`,
5991
- blockers: [componentTypeId],
5941
+ url: `/assets/types/${assetTypeId}/`,
5942
+ blockers: [assetTypeId],
5992
5943
  blocks: []
5993
5944
  }).catch((e) => {
5994
- store.dispatch(addComponentType(componentType));
5995
- store.dispatch(addStages(stagesOfComponentType));
5996
- store.dispatch(addComponentTypeAttachments(attachmentsOfComponentType));
5945
+ store.dispatch(addAssetType(assetType));
5946
+ store.dispatch(addStages(stagesOfAssetType));
5947
+ store.dispatch(addAssetTypeAttachments(attachmentsOfAssetType));
5997
5948
  throw e;
5998
5949
  });
5999
5950
  }
6000
5951
  async refreshStore() {
6001
5952
  const { store } = this.client;
6002
5953
  const result = await this.client.enqueueRequest({
6003
- description: "Get component types",
5954
+ description: "Get asset types",
6004
5955
  method: HttpMethod.GET,
6005
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-types/`,
5956
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-types/`,
6006
5957
  blockers: [],
6007
5958
  blocks: []
6008
5959
  });
6009
- store.dispatch(setComponentTypes(result));
5960
+ store.dispatch(setAssetTypes(result));
6010
5961
  }
6011
5962
  }
6012
- class ComponentTypeAttachmentService extends BaseAttachmentService {
5963
+ class AssetTypeAttachmentService extends BaseAttachmentService {
6013
5964
  constructor() {
6014
5965
  super(...arguments);
6015
- __publicField(this, "attachmentModel", AttachmentModel.ComponentType);
5966
+ __publicField(this, "attachmentModel", AttachmentModel.AssetType);
6016
5967
  }
6017
5968
  buildOfflineAttachment(data) {
6018
5969
  return offline({
@@ -6023,36 +5974,36 @@ class ComponentTypeAttachmentService extends BaseAttachmentService {
6023
5974
  file_type: data.file.type,
6024
5975
  submitted_at: data.submittedAt,
6025
5976
  description: data.description,
6026
- component_type: data.modelId
5977
+ asset_type: data.modelId
6027
5978
  });
6028
5979
  }
6029
- async attachFilesToComponentType(files, componentTypeId) {
5980
+ async attachFilesToAssetType(files, assetTypeId) {
6030
5981
  return this.attachFiles(
6031
5982
  files,
6032
- componentTypeId,
5983
+ assetTypeId,
6033
5984
  this.buildOfflineAttachment.bind(this),
6034
5985
  {
6035
- addAttachments: addComponentTypeAttachments,
6036
- updateAttachments: updateComponentTypeAttachments,
6037
- removeAttachments: removeComponentTypeAttachments
5986
+ addAttachments: addAssetTypeAttachments,
5987
+ updateAttachments: updateAssetTypeAttachments,
5988
+ removeAttachments: removeAssetTypeAttachments
6038
5989
  }
6039
5990
  );
6040
5991
  }
6041
- deleteComponentTypeAttachment(attachmentId) {
5992
+ deleteAssetTypeAttachment(attachmentId) {
6042
5993
  return this.deleteAttachment(
6043
5994
  attachmentId,
6044
5995
  {
6045
- setAttachment: setComponentTypeAttachment,
6046
- removeAttachment: removeComponentTypeAttachment
5996
+ setAttachment: setAssetTypeAttachment,
5997
+ removeAttachment: removeAssetTypeAttachment
6047
5998
  },
6048
5999
  {
6049
- selectAttachment: selectComponentTypeAttachment
6000
+ selectAttachment: selectAssetTypeAttachment
6050
6001
  }
6051
6002
  );
6052
6003
  }
6053
6004
  async refreshStore() {
6054
6005
  return this.getAttachments({
6055
- setAttachments: setComponentTypeAttachments
6006
+ setAttachments: setAssetTypeAttachments
6056
6007
  });
6057
6008
  }
6058
6009
  }
@@ -6550,8 +6501,8 @@ class MainService extends BaseApiService {
6550
6501
  });
6551
6502
  }
6552
6503
  // TODO:
6553
- // Don't accept updateStore in ComponentService.list. Just return the offline objects and promise. Here, if
6554
- // overwrite, use setComponents. Otherwise, use bulkAddComponents.
6504
+ // Don't accept updateStore in AssetService.list. Just return the offline objects and promise. Here, if
6505
+ // overwrite, use setAssets. Otherwise, use bulkAddAssets.
6555
6506
  // TODO: This needs major cleanup. Send less in the initial data: Only the basic project info and anything needed
6556
6507
  // literally immediately.
6557
6508
  async _processInitialData(data, overwrite) {
@@ -6656,10 +6607,10 @@ class MainService extends BaseApiService {
6656
6607
  } finally {
6657
6608
  store.dispatch(setIsFetchingInitialData(false));
6658
6609
  }
6659
- void this.client.componentTypes.refreshStore();
6660
- void this.client.componentStages.refreshStore();
6661
- void this.client.components.refreshStore();
6662
- void this.client.componentStageCompletions.refreshStore();
6610
+ void this.client.assetTypes.refreshStore();
6611
+ void this.client.assetStages.refreshStore();
6612
+ void this.client.assets.refreshStore();
6613
+ void this.client.assetStageCompletions.refreshStore();
6663
6614
  void this.client.categories.refreshStore();
6664
6615
  void this.client.issueTypes.refreshStore();
6665
6616
  void this.client.issues.refreshStore();
@@ -6674,8 +6625,8 @@ class MainService extends BaseApiService {
6674
6625
  void this.client.issueUpdates.refreshStore();
6675
6626
  void this.client.projectAccesses.refreshStore();
6676
6627
  void this.client.projectAttachments.refreshStore();
6677
- void this.client.componentTypeAttachments.refreshStore();
6678
- void this.client.componentAttachments.refreshStore();
6628
+ void this.client.assetTypeAttachments.refreshStore();
6629
+ void this.client.assetAttachments.refreshStore();
6679
6630
  }
6680
6631
  void this.client.teams.refreshStore();
6681
6632
  }
@@ -7071,7 +7022,7 @@ class UserFormService extends BaseApiService {
7071
7022
  });
7072
7023
  });
7073
7024
  }
7074
- async add(state, initialRevision, url, ownerUser, ownerOrganization, componentTypeId, issueTypeId) {
7025
+ async add(state, initialRevision, url, ownerUser, ownerOrganization, assetTypeId, issueTypeId) {
7075
7026
  if (!!ownerUser === !!ownerOrganization) {
7076
7027
  throw new Error("Exactly one of ownerUser and ownerOrganization must be defined.");
7077
7028
  }
@@ -7090,7 +7041,7 @@ class UserFormService extends BaseApiService {
7090
7041
  favorite: true,
7091
7042
  submitted_at: submittedAt,
7092
7043
  created_by: currentUser.id,
7093
- ...componentTypeId && { component_type: componentTypeId },
7044
+ ...assetTypeId && { asset_type: assetTypeId },
7094
7045
  ...issueTypeId && { issue_type: issueTypeId },
7095
7046
  ...ownerAttrs
7096
7047
  };
@@ -7114,11 +7065,11 @@ class UserFormService extends BaseApiService {
7114
7065
  } : void 0,
7115
7066
  payload: {
7116
7067
  ...offlineFormPayload,
7117
- ...componentTypeId && { component_type: componentTypeId },
7068
+ ...assetTypeId && { asset_type: assetTypeId },
7118
7069
  ...issueTypeId && { issue_type: issueTypeId },
7119
7070
  initial_revision: payloadWithoutImage
7120
7071
  },
7121
- blockers: componentTypeId ? [componentTypeId] : issueTypeId ? [issueTypeId] : [],
7072
+ blockers: assetTypeId ? [assetTypeId] : issueTypeId ? [issueTypeId] : [],
7122
7073
  blocks: [offlineFormPayload.offline_id, payloadWithoutImage.offline_id]
7123
7074
  });
7124
7075
  const attachImagesPromises = this.getAttachImagePromises(images, offlineRevisionPayload.offline_id);
@@ -7142,7 +7093,7 @@ class UserFormService extends BaseApiService {
7142
7093
  `/forms/in-organization/${activeOrganizationId}/`,
7143
7094
  void 0,
7144
7095
  activeOrganizationId,
7145
- attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
7096
+ attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
7146
7097
  attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
7147
7098
  );
7148
7099
  }
@@ -7155,7 +7106,7 @@ class UserFormService extends BaseApiService {
7155
7106
  "/forms/my-forms/",
7156
7107
  currentUser.id,
7157
7108
  void 0,
7158
- attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
7109
+ attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
7159
7110
  attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
7160
7111
  );
7161
7112
  }
@@ -7323,8 +7274,8 @@ class UserFormSubmissionService extends BaseApiService {
7323
7274
  url: `/forms/submission/${submission.offline_id}/attachments/`,
7324
7275
  payload: submissionAttachmentPayload,
7325
7276
  blockers: [
7326
- submission.component,
7327
- submission.component_stage,
7277
+ submission.asset,
7278
+ submission.asset_stage,
7328
7279
  submission.issue,
7329
7280
  submission.form_revision
7330
7281
  ].filter((x) => x !== void 0),
@@ -7360,7 +7311,7 @@ class UserFormSubmissionService extends BaseApiService {
7360
7311
  method: HttpMethod.POST,
7361
7312
  url: `/forms/revisions/${payload.form_revision}/respond/`,
7362
7313
  payload: { ...offlineSubmission, project: activeProjectId },
7363
- blockers: [payload.issue, payload.component, payload.component_stage, "add-form-entry"].filter(
7314
+ blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
7364
7315
  (x) => x !== void 0
7365
7316
  ),
7366
7317
  blocks: [payload.offline_id]
@@ -7378,10 +7329,10 @@ class UserFormSubmissionService extends BaseApiService {
7378
7329
  const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
7379
7330
  return [offlineSubmission, settledPromise];
7380
7331
  }
7381
- // Note currently the bulkAdd method is specific to form submissions for components
7332
+ // Note currently the bulkAdd method is specific to form submissions for assets
7382
7333
  // TODO: adapt the support bulk adding to any model type
7383
7334
  async bulkAdd(args) {
7384
- const { formRevision, values: argsValues, componentOfflineIds } = args;
7335
+ const { formRevision, values: argsValues, assetOfflineIds } = args;
7385
7336
  const { store } = this.client;
7386
7337
  const offlineSubmissions = [];
7387
7338
  const offlineAttachments = [];
@@ -7391,16 +7342,16 @@ class UserFormSubmissionService extends BaseApiService {
7391
7342
  const { values, files } = separateFilesFromValues(argsValues);
7392
7343
  const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
7393
7344
  const createdBy = store.getState().userReducer.currentUser.id;
7394
- for (const component_id of componentOfflineIds) {
7345
+ for (const assetId of assetOfflineIds) {
7395
7346
  const submission = offline({
7396
7347
  form_revision: formRevision,
7397
7348
  values,
7398
7349
  created_by: createdBy,
7399
7350
  submitted_at: submittedAt,
7400
- component: component_id
7351
+ asset: assetId
7401
7352
  });
7402
7353
  submissionOfflineIds.push(submission.offline_id);
7403
- submissionsPayload.push({ offline_id: submission.offline_id, component_id });
7354
+ submissionsPayload.push({ offline_id: submission.offline_id, asset_id: assetId });
7404
7355
  offlineSubmissions.push(submission);
7405
7356
  for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
7406
7357
  for (const file of fileArray) {
@@ -7447,7 +7398,7 @@ class UserFormSubmissionService extends BaseApiService {
7447
7398
  attachments: attachmentsPayload,
7448
7399
  files: Object.values(filesRecord)
7449
7400
  },
7450
- blockers: componentOfflineIds,
7401
+ blockers: assetOfflineIds,
7451
7402
  blocks: submissionOfflineIds
7452
7403
  });
7453
7404
  promise.then(({ submissions, attachments, presigned_urls }) => {
@@ -7490,7 +7441,7 @@ class UserFormSubmissionService extends BaseApiService {
7490
7441
  method: HttpMethod.PATCH,
7491
7442
  url: `/forms/submissions/${submission.offline_id}/`,
7492
7443
  payload: offlineSubmission,
7493
- blockers: [offlineSubmission.issue, offlineSubmission.component, offlineSubmission.component_stage].filter(
7444
+ blockers: [offlineSubmission.issue, offlineSubmission.asset, offlineSubmission.asset_stage].filter(
7494
7445
  (x) => x !== void 0
7495
7446
  ),
7496
7447
  blocks: [offlineSubmission.offline_id]
@@ -8576,12 +8527,12 @@ class OvermapSDK {
8576
8527
  __publicField(this, "issueAttachments", new IssueAttachmentService(this));
8577
8528
  __publicField(this, "workspaces", new WorkspaceService(this));
8578
8529
  __publicField(this, "main", new MainService(this));
8579
- __publicField(this, "components", new ComponentService(this));
8580
- __publicField(this, "componentAttachments", new ComponentAttachmentService(this));
8581
- __publicField(this, "componentTypes", new ComponentTypeService(this));
8582
- __publicField(this, "componentTypeAttachments", new ComponentTypeAttachmentService(this));
8583
- __publicField(this, "componentStages", new ComponentStageService(this));
8584
- __publicField(this, "componentStageCompletions", new ComponentStageCompletionService(this));
8530
+ __publicField(this, "assets", new AssetService(this));
8531
+ __publicField(this, "assetAttachments", new AssetAttachmentService(this));
8532
+ __publicField(this, "assetTypes", new AssetTypeService(this));
8533
+ __publicField(this, "assetTypeAttachments", new AssetTypeAttachmentService(this));
8534
+ __publicField(this, "assetStages", new AssetStageService(this));
8535
+ __publicField(this, "assetStageCompletions", new AssetStageCompletionService(this));
8585
8536
  __publicField(this, "userForms", new UserFormService(this));
8586
8537
  __publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
8587
8538
  __publicField(this, "projects", new ProjectService(this));
@@ -15293,9 +15244,9 @@ const FormBrowser = memo(
15293
15244
  }, [filter, maxResults, ownerFilter]);
15294
15245
  const userForms = useAppSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
15295
15246
  const userFormMapping = useAppSelector(selectFormMapping);
15296
- const attachableUserForms = userForms.filter((form) => !form.component_type && !form.issue_type);
15247
+ const attachableUserForms = userForms.filter((form) => !form.asset_type && !form.issue_type);
15297
15248
  const attachableUserFormMapping = Object.values(userFormMapping).filter(
15298
- (form) => !form.component_type
15249
+ (form) => !form.asset_type
15299
15250
  );
15300
15251
  const handleToggleFavorite = useCallback(
15301
15252
  (form) => {
@@ -15727,7 +15678,7 @@ const styles = {
15727
15678
  const formId = "form-builder";
15728
15679
  const fieldsToChoose = [
15729
15680
  ["string", "text"],
15730
- ["select", "multi-select", "upload"],
15681
+ ["select", "multi-select", "upload", "qr"],
15731
15682
  ["boolean", "date", "number", "multi-string"]
15732
15683
  ];
15733
15684
  const CompleteFieldTypeToClsMapping = {
@@ -16700,6 +16651,13 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
16700
16651
  export {
16701
16652
  APIError,
16702
16653
  AgentService,
16654
+ AssetAttachmentService,
16655
+ AssetService,
16656
+ AssetStageColors,
16657
+ AssetStageCompletionService,
16658
+ AssetStageService,
16659
+ AssetTypeAttachmentService,
16660
+ AssetTypeService,
16703
16661
  AttachmentModel,
16704
16662
  AuthService,
16705
16663
  BaseApiService,
@@ -16711,13 +16669,6 @@ export {
16711
16669
  ColorPicker,
16712
16670
  Colors,
16713
16671
  ColorsToString,
16714
- ComponentAttachmentService,
16715
- ComponentService,
16716
- ComponentStageColors,
16717
- ComponentStageCompletionService,
16718
- ComponentStageService,
16719
- ComponentTypeAttachmentService,
16720
- ComponentTypeService,
16721
16672
  DEFAULT_ISSUE_PRIORITY,
16722
16673
  DEFAULT_ISSUE_STATUS,
16723
16674
  DateField,
@@ -16809,14 +16760,14 @@ export {
16809
16760
  acceptProjectInvite,
16810
16761
  addActiveProjectFormSubmissionsCount,
16811
16762
  addActiveProjectIssuesCount,
16763
+ addAsset,
16764
+ addAssetAttachment,
16765
+ addAssetAttachments,
16766
+ addAssetType,
16767
+ addAssetTypeAttachment,
16768
+ addAssetTypeAttachments,
16769
+ addAssetsInBatches,
16812
16770
  addCategory,
16813
- addComponent,
16814
- addComponentAttachment,
16815
- addComponentAttachments,
16816
- addComponentType,
16817
- addComponentTypeAttachment,
16818
- addComponentTypeAttachments,
16819
- addComponentsInBatches,
16820
16771
  addConversation,
16821
16772
  addDocumentAttachment,
16822
16773
  addDocumentAttachments,
@@ -16861,6 +16812,14 @@ export {
16861
16812
  agentsReducer,
16862
16813
  agentsSlice,
16863
16814
  areArraysEqual,
16815
+ assetReducer,
16816
+ assetSlice,
16817
+ assetStageCompletionReducer,
16818
+ assetStageCompletionSlice,
16819
+ assetStageReducer,
16820
+ assetStageSlice,
16821
+ assetTypeReducer,
16822
+ assetTypeSlice,
16864
16823
  authReducer,
16865
16824
  authSlice,
16866
16825
  blobToBase64,
@@ -16870,14 +16829,6 @@ export {
16870
16829
  classNames$1 as classNames,
16871
16830
  cleanRecentIssues,
16872
16831
  clearTokens,
16873
- componentReducer,
16874
- componentSlice,
16875
- componentStageCompletionReducer,
16876
- componentStageCompletionSlice,
16877
- componentStageReducer,
16878
- componentStageSlice,
16879
- componentTypeReducer,
16880
- componentTypeSlice,
16881
16832
  constructUploadedFilePayloads,
16882
16833
  coordinatesAreEqual,
16883
16834
  coordinatesToLiteral,
@@ -16888,7 +16839,7 @@ export {
16888
16839
  createPointMarker,
16889
16840
  defaultBadgeColor,
16890
16841
  defaultStore,
16891
- deleteComponentType,
16842
+ deleteAssetType,
16892
16843
  deleteForm,
16893
16844
  deleteFormRevision,
16894
16845
  deleteFormRevisionAttachment,
@@ -16937,7 +16888,7 @@ export {
16937
16888
  formSubmissionReducer,
16938
16889
  formSubmissionSlice,
16939
16890
  index as forms,
16940
- fullComponentMarkerSize,
16891
+ fullAssetMarkerSize,
16941
16892
  generateBadgeColors,
16942
16893
  genericMemo,
16943
16894
  getFileIdentifier,
@@ -16945,6 +16896,7 @@ export {
16945
16896
  getLocalDateString,
16946
16897
  getLocalRelativeDateString,
16947
16898
  getMarkerCoordinates,
16899
+ getOutboxCoordinator,
16948
16900
  getRenamedFile,
16949
16901
  getStageColor,
16950
16902
  hashFile,
@@ -16997,15 +16949,15 @@ export {
16997
16949
  projectSlice,
16998
16950
  rehydratedReducer,
16999
16951
  rehydratedSlice,
17000
- removeAllComponentsOfType,
16952
+ removeAllAssetsOfType,
16953
+ removeAsset,
16954
+ removeAssetAttachment,
16955
+ removeAssetAttachments,
16956
+ removeAssetTypeAttachment,
16957
+ removeAssetTypeAttachments,
17001
16958
  removeAttachmentsOfIssue,
17002
16959
  removeCategory,
17003
16960
  removeColor,
17004
- removeComponent,
17005
- removeComponentAttachment,
17006
- removeComponentAttachments,
17007
- removeComponentTypeAttachment,
17008
- removeComponentTypeAttachments,
17009
16961
  removeDocumentAttachment,
17010
16962
  removeDocumentAttachments,
17011
16963
  removeDocuments,
@@ -17056,16 +17008,31 @@ export {
17056
17008
  selectActiveWorkspace,
17057
17009
  selectActiveWorkspaceId,
17058
17010
  selectAllAttachments,
17059
- selectAllComponentAttachments,
17060
- selectAllComponentTypeAttachments,
17061
17011
  selectAllDocumentAttachments,
17062
17012
  selectAllProjectAttachments,
17063
17013
  selectAncestorIdsOfDocument,
17064
17014
  selectAppearance,
17065
- selectAttachmentsOfComponent,
17066
- selectAttachmentsOfComponentByType,
17067
- selectAttachmentsOfComponentType,
17068
- selectAttachmentsOfComponentTypeByType,
17015
+ selectAsset,
17016
+ selectAssetAttachment,
17017
+ selectAssetAttachmentMapping,
17018
+ selectAssetAttachments,
17019
+ selectAssetToAssetTypeMapping,
17020
+ selectAssetType,
17021
+ selectAssetTypeAttachment,
17022
+ selectAssetTypeAttachmentMapping,
17023
+ selectAssetTypeAttachments,
17024
+ selectAssetTypeStagesMapping,
17025
+ selectAssetTypes,
17026
+ selectAssetTypesByName,
17027
+ selectAssetTypesFromIds,
17028
+ selectAssetTypesMapping,
17029
+ selectAssets,
17030
+ selectAssetsMapping,
17031
+ selectAssetsOfAssetType,
17032
+ selectAttachmentsOfAsset,
17033
+ selectAttachmentsOfAssetByType,
17034
+ selectAttachmentsOfAssetType,
17035
+ selectAttachmentsOfAssetTypeByType,
17069
17036
  selectAttachmentsOfDocument,
17070
17037
  selectAttachmentsOfDocumentByType,
17071
17038
  selectAttachmentsOfFormRevision,
@@ -17082,25 +17049,8 @@ export {
17082
17049
  selectCenterMapToProject,
17083
17050
  selectCommentMapping,
17084
17051
  selectCommentsOfIssue,
17085
- selectCompletedStageIdsForComponent,
17052
+ selectCompletedStageIdsForAsset,
17086
17053
  selectCompletedStages,
17087
- selectComponent,
17088
- selectComponentAttachment,
17089
- selectComponentAttachmentMapping,
17090
- selectComponentType,
17091
- selectComponentTypeAttachment,
17092
- selectComponentTypeAttachmentMapping,
17093
- selectComponentTypeFromComponent,
17094
- selectComponentTypeFromComponents,
17095
- selectComponentTypeStagesMapping,
17096
- selectComponentTypes,
17097
- selectComponentTypesByName,
17098
- selectComponentTypesFromIds,
17099
- selectComponentTypesMapping,
17100
- selectComponents,
17101
- selectComponentsByType,
17102
- selectComponentsFromComponentType,
17103
- selectComponentsMapping,
17104
17054
  selectConversation,
17105
17055
  selectConversationMapping,
17106
17056
  selectConversations,
@@ -17125,7 +17075,7 @@ export {
17125
17075
  selectFilteredForms,
17126
17076
  selectForm,
17127
17077
  selectFormMapping,
17128
- selectFormOfComponentType,
17078
+ selectFormOfAssetType,
17129
17079
  selectFormOfIssueType,
17130
17080
  selectFormRevision,
17131
17081
  selectFormRevisionMapping,
@@ -17134,16 +17084,16 @@ export {
17134
17084
  selectFormSubmission,
17135
17085
  selectFormSubmissionAttachmentsMapping,
17136
17086
  selectFormSubmissions,
17137
- selectFormSubmissionsByComponents,
17087
+ selectFormSubmissionsByAssets,
17138
17088
  selectFormSubmissionsByFormRevisions,
17139
17089
  selectFormSubmissionsMapping,
17140
- selectFormSubmissionsOfComponent,
17090
+ selectFormSubmissionsOfAsset,
17141
17091
  selectFormSubmissionsOfForm,
17142
17092
  selectFormSubmissionsOfIssue,
17143
17093
  selectFormsCount,
17144
17094
  selectGeneralFormCount,
17095
+ selectHiddenAssetTypeIds,
17145
17096
  selectHiddenCategoryCount,
17146
- selectHiddenComponentTypeIds,
17147
17097
  selectIsFetchingInitialData,
17148
17098
  selectIsImportingProjectFile,
17149
17099
  selectIsLoading,
@@ -17165,7 +17115,7 @@ export {
17165
17115
  selectIssuesOfIssueTypeCount,
17166
17116
  selectLatestFormRevisionByForm,
17167
17117
  selectLatestFormRevisionOfForm,
17168
- selectLatestFormRevisionsOfComponentTypes,
17118
+ selectLatestFormRevisionsOfAssetTypes,
17169
17119
  selectLatestRetryTime,
17170
17120
  selectLicense,
17171
17121
  selectLicenseForProject,
@@ -17173,8 +17123,8 @@ export {
17173
17123
  selectLicensesForProjectsMapping,
17174
17124
  selectMainWorkspace,
17175
17125
  selectMapStyle,
17176
- selectNumberOfComponentTypesMatchingCaseInsensitiveName,
17177
- selectNumberOfComponentsOfComponentType,
17126
+ selectNumberOfAssetTypesMatchingCaseInsensitiveName,
17127
+ selectNumberOfAssetsOfAssetType,
17178
17128
  selectOrganization,
17179
17129
  selectOrganizationAccess,
17180
17130
  selectOrganizationAccessForUser,
@@ -17215,9 +17165,9 @@ export {
17215
17165
  selectStageFormIdsFromStageIds,
17216
17166
  selectStageMapping,
17217
17167
  selectStages,
17218
- selectStagesFromComponentType,
17219
- selectStagesFromComponentTypeIds,
17168
+ selectStagesFromAssetTypeIds,
17220
17169
  selectStagesFromStageIds,
17170
+ selectStagesOfAssetType,
17221
17171
  selectTeam,
17222
17172
  selectTeams,
17223
17173
  selectTeamsMapping,
@@ -17239,14 +17189,14 @@ export {
17239
17189
  setActiveProjectId,
17240
17190
  setActiveWorkspaceId,
17241
17191
  setAppearance,
17192
+ setAssetAttachment,
17193
+ setAssetAttachments,
17194
+ setAssetTypeAttachment,
17195
+ setAssetTypeAttachments,
17196
+ setAssetTypes,
17197
+ setAssets,
17242
17198
  setCategories,
17243
17199
  setCenterMapToProject,
17244
- setComponentAttachment,
17245
- setComponentAttachments,
17246
- setComponentTypeAttachment,
17247
- setComponentTypeAttachments,
17248
- setComponentTypes,
17249
- setComponents,
17250
17200
  setConversation,
17251
17201
  setConversations,
17252
17202
  setCreateProjectType,
@@ -17309,18 +17259,18 @@ export {
17309
17259
  teamSlice,
17310
17260
  toFileNameSafeString,
17311
17261
  toOfflineIdRecord,
17312
- toggleComponentTypeVisibility,
17262
+ toggleAssetTypeVisibility,
17313
17263
  truncate,
17314
17264
  unfavoriteForm,
17315
17265
  unhideAllCategories,
17316
17266
  unhideCategory,
17317
17267
  unlinkStageToForm,
17318
17268
  updateActiveOrganization,
17319
- updateComponent,
17320
- updateComponentAttachment,
17321
- updateComponentAttachments,
17322
- updateComponentTypeAttachment,
17323
- updateComponentTypeAttachments,
17269
+ updateAsset,
17270
+ updateAssetAttachment,
17271
+ updateAssetAttachments,
17272
+ updateAssetTypeAttachment,
17273
+ updateAssetTypeAttachments,
17324
17274
  updateConversation,
17325
17275
  updateDocumentAttachment,
17326
17276
  updateDocumentAttachments,