@overmap-ai/core 1.0.57-fix-agent-responses.1 → 1.0.57-project-view-only-flag.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 (50) 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 +567 -621
  7. package/dist/overmap-core.js.map +1 -1
  8. package/dist/overmap-core.umd.cjs +567 -621
  9. package/dist/overmap-core.umd.cjs.map +1 -1
  10. package/dist/sdk/sdk.d.ts +7 -7
  11. package/dist/sdk/services/AgentService.d.ts +21 -2
  12. package/dist/sdk/services/AssetAttachmentService.d.ts +10 -0
  13. package/dist/sdk/services/AssetService.d.ts +11 -0
  14. package/dist/sdk/services/AssetStageCompletionService.d.ts +16 -0
  15. package/dist/sdk/services/AssetStageService.d.ts +11 -0
  16. package/dist/sdk/services/AssetTypeAttachmentService.d.ts +10 -0
  17. package/dist/sdk/services/AssetTypeService.d.ts +9 -0
  18. package/dist/sdk/services/UserFormService.d.ts +2 -2
  19. package/dist/sdk/services/UserFormSubmissionService.d.ts +1 -1
  20. package/dist/sdk/services/index.d.ts +6 -6
  21. package/dist/store/slices/assetSlice.d.ts +63 -0
  22. package/dist/store/slices/assetStageCompletionSlice.d.ts +15 -0
  23. package/dist/store/slices/assetStageSlice.d.ts +32 -0
  24. package/dist/store/slices/assetTypeSlice.d.ts +74 -0
  25. package/dist/store/slices/categorySlice.d.ts +4 -4
  26. package/dist/store/slices/documentSlice.d.ts +6 -7
  27. package/dist/store/slices/formRevisionSlice.d.ts +5 -5
  28. package/dist/store/slices/formSlice.d.ts +7 -7
  29. package/dist/store/slices/formSubmissionSlice.d.ts +2 -2
  30. package/dist/store/slices/index.d.ts +4 -4
  31. package/dist/store/slices/issueSlice.d.ts +4 -4
  32. package/dist/store/slices/projectFileSlice.d.ts +4 -4
  33. package/dist/store/slices/workspaceSlice.d.ts +4 -4
  34. package/dist/store/store.d.ts +13 -13
  35. package/dist/typings/models/access.d.ts +1 -0
  36. package/dist/typings/models/attachments.d.ts +6 -6
  37. package/dist/typings/models/components.d.ts +11 -7
  38. package/dist/typings/models/forms.d.ts +3 -3
  39. package/dist/utils/colors.d.ts +1 -1
  40. package/package.json +153 -153
  41. package/dist/sdk/services/ComponentAttachmentService.d.ts +0 -10
  42. package/dist/sdk/services/ComponentService.d.ts +0 -11
  43. package/dist/sdk/services/ComponentStageCompletionService.d.ts +0 -17
  44. package/dist/sdk/services/ComponentStageService.d.ts +0 -11
  45. package/dist/sdk/services/ComponentTypeAttachmentService.d.ts +0 -10
  46. package/dist/sdk/services/ComponentTypeService.d.ts +0 -9
  47. package/dist/store/slices/ComponentStageCompletionSlice.d.ts +0 -27
  48. package/dist/store/slices/componentSlice.d.ts +0 -73
  49. package/dist/store/slices/componentStageSlice.d.ts +0 -42
  50. package/dist/store/slices/componentTypeSlice.d.ts +0 -75
@@ -1340,7 +1340,7 @@ var __publicField = (obj, key, value) => {
1340
1340
  [mint.mint9]: "mint",
1341
1341
  [sky.sky9]: "sky"
1342
1342
  };
1343
- const ComponentStageColors = {
1343
+ const AssetStageColors = {
1344
1344
  indigo: indigo.indigo9,
1345
1345
  red: red.red9,
1346
1346
  violet: violet.violet9,
@@ -1362,7 +1362,7 @@ var __publicField = (obj, key, value) => {
1362
1362
  return { backgroundColor, textColor };
1363
1363
  };
1364
1364
  function getStageColor(index2) {
1365
- return Object.values(ComponentStageColors)[index2 % Object.keys(ComponentStageColors).length];
1365
+ return Object.values(AssetStageColors)[index2 % Object.keys(AssetStageColors).length];
1366
1366
  }
1367
1367
  const getLocalDateString = memoize((date) => {
1368
1368
  if (!date)
@@ -1582,122 +1582,115 @@ var __publicField = (obj, key, value) => {
1582
1582
  }
1583
1583
  }
1584
1584
  const initialState$q = {
1585
- componentTypes: {},
1586
- hiddenComponentTypeIds: {},
1585
+ assetTypes: {},
1586
+ hiddenAssetTypeIds: {},
1587
1587
  attachments: {}
1588
1588
  };
1589
- const componentTypeSlice = toolkit.createSlice({
1590
- name: "componentTypes",
1589
+ const assetTypeSlice = toolkit.createSlice({
1590
+ name: "assetTypes",
1591
1591
  initialState: initialState$q,
1592
1592
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1593
1593
  reducers: {
1594
- addComponentType: (state, action) => {
1595
- state.componentTypes[action.payload.offline_id] = action.payload;
1594
+ addAssetType: (state, action) => {
1595
+ state.assetTypes[action.payload.offline_id] = action.payload;
1596
1596
  },
1597
- setComponentTypes: (state, action) => {
1598
- state.componentTypes = toOfflineIdRecord(action.payload);
1597
+ setAssetTypes: (state, action) => {
1598
+ state.assetTypes = toOfflineIdRecord(action.payload);
1599
1599
  },
1600
- toggleComponentTypeVisibility: (state, action) => {
1601
- state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
1600
+ toggleAssetTypeVisibility: (state, action) => {
1601
+ state.hiddenAssetTypeIds[action.payload] = !state.hiddenAssetTypeIds[action.payload];
1602
1602
  },
1603
- deleteComponentType: (state, action) => {
1604
- delete state.componentTypes[action.payload];
1603
+ deleteAssetType: (state, action) => {
1604
+ delete state.assetTypes[action.payload];
1605
1605
  },
1606
1606
  // Attachments
1607
- setComponentTypeAttachment: setAttachment,
1608
- setComponentTypeAttachments: setAttachments,
1609
- addComponentTypeAttachment: addAttachment,
1610
- addComponentTypeAttachments: addAttachments,
1611
- updateComponentTypeAttachment: updateAttachment,
1612
- updateComponentTypeAttachments: updateAttachments,
1613
- removeComponentTypeAttachment: removeAttachment,
1614
- removeComponentTypeAttachments: removeAttachments
1607
+ setAssetTypeAttachment: setAttachment,
1608
+ setAssetTypeAttachments: setAttachments,
1609
+ addAssetTypeAttachment: addAttachment,
1610
+ addAssetTypeAttachments: addAttachments,
1611
+ updateAssetTypeAttachment: updateAttachment,
1612
+ updateAssetTypeAttachments: updateAttachments,
1613
+ removeAssetTypeAttachment: removeAttachment,
1614
+ removeAssetTypeAttachments: removeAttachments
1615
1615
  }
1616
1616
  });
1617
1617
  const {
1618
- addComponentType,
1619
- setComponentTypes,
1620
- toggleComponentTypeVisibility,
1621
- deleteComponentType,
1618
+ addAssetType,
1619
+ setAssetTypes,
1620
+ toggleAssetTypeVisibility,
1621
+ deleteAssetType,
1622
1622
  // Attachmet
1623
- setComponentTypeAttachment,
1624
- setComponentTypeAttachments,
1625
- addComponentTypeAttachment,
1626
- addComponentTypeAttachments,
1627
- updateComponentTypeAttachment,
1628
- updateComponentTypeAttachments,
1629
- removeComponentTypeAttachment,
1630
- removeComponentTypeAttachments
1631
- } = componentTypeSlice.actions;
1632
- const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
1633
- const selectComponentTypes = toolkit.createSelector(
1634
- [selectComponentTypesMapping],
1623
+ setAssetTypeAttachment,
1624
+ setAssetTypeAttachments,
1625
+ addAssetTypeAttachment,
1626
+ addAssetTypeAttachments,
1627
+ updateAssetTypeAttachment,
1628
+ updateAssetTypeAttachments,
1629
+ removeAssetTypeAttachment,
1630
+ removeAssetTypeAttachments
1631
+ } = assetTypeSlice.actions;
1632
+ const selectAssetTypesMapping = (state) => state.assetTypeReducer.assetTypes;
1633
+ const selectAssetTypes = toolkit.createSelector(
1634
+ [selectAssetTypesMapping],
1635
1635
  (mapping) => Object.values(mapping)
1636
1636
  );
1637
- const selectComponentType = restructureCreateSelectorWithArgs(
1638
- toolkit.createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
1637
+ const selectAssetType = restructureCreateSelectorWithArgs(
1638
+ toolkit.createSelector(
1639
+ [selectAssetTypesMapping, (_state, assetTypeId) => assetTypeId],
1640
+ (mapping, assetTypeId) => mapping[assetTypeId]
1641
+ )
1639
1642
  );
1640
- const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
1643
+ const selectNumberOfAssetTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
1641
1644
  toolkit.createSelector(
1642
- [
1643
- selectComponentTypesMapping,
1644
- (_state, args) => args
1645
- ],
1645
+ [selectAssetTypesMapping, (_state, args) => args],
1646
1646
  (mapping, args) => {
1647
1647
  var _a2;
1648
1648
  const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
1649
1649
  return Object.values(mapping).filter(
1650
- (componentType) => {
1650
+ (assetType) => {
1651
1651
  var _a3;
1652
- return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
1652
+ return (((_a3 = assetType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && assetType.offline_id !== args.assetTypeId;
1653
1653
  }
1654
1654
  ).length;
1655
1655
  }
1656
1656
  )
1657
1657
  );
1658
- const selectComponentTypesByName = restructureCreateSelectorWithArgs(
1659
- toolkit.createSelector(
1660
- [selectComponentTypesMapping, (_state, name) => name],
1661
- (mapping, name) => {
1662
- name = (name == null ? void 0 : name.toLowerCase()) ?? null;
1663
- return Object.values(mapping).filter(
1664
- (componentType) => {
1665
- var _a2;
1666
- return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
1667
- }
1668
- );
1669
- }
1670
- )
1658
+ const selectAssetTypesByName = restructureCreateSelectorWithArgs(
1659
+ toolkit.createSelector([selectAssetTypesMapping, (_state, name) => name], (mapping, name) => {
1660
+ name = (name == null ? void 0 : name.toLowerCase()) ?? null;
1661
+ return Object.values(mapping).filter((assetType) => {
1662
+ var _a2;
1663
+ return (((_a2 = assetType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
1664
+ });
1665
+ })
1671
1666
  );
1672
- const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
1673
- const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
1674
- const selectAllComponentTypeAttachments = toolkit.createSelector(
1675
- [selectComponentTypeAttachmentMapping],
1667
+ const selectHiddenAssetTypeIds = (state) => state.assetTypeReducer.hiddenAssetTypeIds;
1668
+ const selectAssetTypeAttachmentMapping = (state) => state.assetTypeReducer.attachments;
1669
+ const selectAssetTypeAttachments = toolkit.createSelector(
1670
+ [selectAssetTypeAttachmentMapping],
1676
1671
  (mapping) => Object.values(mapping)
1677
1672
  );
1678
- const selectComponentTypeAttachment = (attachmentId) => (state) => {
1679
- return state.componentTypeReducer.attachments[attachmentId];
1673
+ const selectAssetTypeAttachment = (attachmentId) => (state) => {
1674
+ return state.assetTypeReducer.attachments[attachmentId];
1680
1675
  };
1681
- const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
1676
+ const selectAttachmentsOfAssetType = restructureCreateSelectorWithArgs(
1682
1677
  toolkit.createSelector(
1683
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1684
- (attachments, componentTypeId) => {
1685
- return attachments.filter(({ component_type }) => componentTypeId === component_type);
1678
+ [selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
1679
+ (attachments, assetTypeId) => {
1680
+ return attachments.filter(({ asset_type }) => assetTypeId === asset_type);
1686
1681
  }
1687
1682
  )
1688
1683
  );
1689
- const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
1684
+ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
1690
1685
  toolkit.createSelector(
1691
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1692
- (attachments, componentTypeId) => {
1693
- const attachmentsOfComponent = attachments.filter(
1694
- ({ component_type }) => component_type === componentTypeId
1695
- );
1696
- const fileAttachments = attachmentsOfComponent.filter(
1686
+ [selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
1687
+ (attachments, assetTypeId) => {
1688
+ const attachmentsOfAssetType = attachments.filter(({ asset_type }) => asset_type === assetTypeId);
1689
+ const fileAttachments = attachmentsOfAssetType.filter(
1697
1690
  // this null check here is necessary, there are cases where file_type is null or undefined
1698
1691
  ({ file_type }) => !file_type || !file_type.startsWith("image/")
1699
1692
  );
1700
- const imageAttachments = attachmentsOfComponent.filter(
1693
+ const imageAttachments = attachmentsOfAssetType.filter(
1701
1694
  // this null check here is necessary, there are cases where file_type is null or undefined
1702
1695
  ({ file_type }) => file_type && file_type.startsWith("image/")
1703
1696
  );
@@ -1705,173 +1698,157 @@ var __publicField = (obj, key, value) => {
1705
1698
  }
1706
1699
  )
1707
1700
  );
1708
- const componentTypeReducer = componentTypeSlice.reducer;
1701
+ const assetTypeReducer = assetTypeSlice.reducer;
1709
1702
  const initialState$p = {
1710
- components: {},
1703
+ assets: {},
1711
1704
  attachments: {}
1712
1705
  };
1713
- const componentSlice = toolkit.createSlice({
1714
- name: "components",
1706
+ const assetSlice = toolkit.createSlice({
1707
+ name: "assets",
1715
1708
  initialState: initialState$p,
1716
1709
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1717
1710
  reducers: {
1718
- addComponent: (state, action) => {
1719
- state.components[action.payload.offline_id] = action.payload;
1720
- prevComponents = null;
1711
+ addAsset: (state, action) => {
1712
+ state.assets[action.payload.offline_id] = action.payload;
1713
+ prevAssets = null;
1721
1714
  },
1722
- addComponentsInBatches: (state, action) => {
1723
- Object.assign(state.components, toOfflineIdRecord(action.payload));
1724
- prevComponents = null;
1715
+ addAssetsInBatches: (state, action) => {
1716
+ Object.assign(state.assets, toOfflineIdRecord(action.payload));
1717
+ prevAssets = null;
1725
1718
  },
1726
- setComponents: (state, action) => {
1727
- state.components = toOfflineIdRecord(action.payload);
1728
- prevComponents = null;
1719
+ setAssets: (state, action) => {
1720
+ state.assets = toOfflineIdRecord(action.payload);
1721
+ prevAssets = null;
1729
1722
  },
1730
- updateComponent: (state, action) => {
1731
- if (action.payload.offline_id in state.components) {
1732
- state.components[action.payload.offline_id] = action.payload;
1723
+ updateAsset: (state, action) => {
1724
+ if (action.payload.offline_id in state.assets) {
1725
+ state.assets[action.payload.offline_id] = action.payload;
1733
1726
  } else {
1734
- throw new Error(`Tried to update component with ID that doesn't exist: ${action.payload.offline_id}`);
1727
+ throw new Error(`Tried to update asset with ID that doesn't exist: ${action.payload.offline_id}`);
1735
1728
  }
1736
- prevComponents = null;
1729
+ prevAssets = null;
1737
1730
  },
1738
- removeComponent: (state, action) => {
1739
- if (action.payload in state.components) {
1740
- delete state.components[action.payload];
1731
+ removeAsset: (state, action) => {
1732
+ if (action.payload in state.assets) {
1733
+ delete state.assets[action.payload];
1741
1734
  } else {
1742
- throw new Error(`Failed to remove component because ID doesn't exist: ${action.payload}`);
1735
+ throw new Error(`Failed to remove asset because ID doesn't exist: ${action.payload}`);
1743
1736
  }
1744
- prevComponents = null;
1737
+ prevAssets = null;
1745
1738
  },
1746
- removeAllComponentsOfType: (state, action) => {
1739
+ removeAllAssetsOfType: (state, action) => {
1747
1740
  var _a2;
1748
- for (const componentId in state.components) {
1749
- if (((_a2 = state.components[componentId]) == null ? void 0 : _a2.component_type) === action.payload) {
1750
- delete state.components[componentId];
1741
+ for (const componentId in state.assets) {
1742
+ if (((_a2 = state.assets[componentId]) == null ? void 0 : _a2.asset_type) === action.payload) {
1743
+ delete state.assets[componentId];
1751
1744
  }
1752
1745
  }
1753
- prevComponents = null;
1746
+ prevAssets = null;
1754
1747
  },
1755
1748
  // Attachments
1756
- setComponentAttachment: setAttachment,
1757
- setComponentAttachments: setAttachments,
1758
- addComponentAttachment: addAttachment,
1759
- addComponentAttachments: addAttachments,
1760
- updateComponentAttachment: updateAttachment,
1761
- updateComponentAttachments: updateAttachments,
1762
- removeComponentAttachment: removeAttachment,
1763
- removeComponentAttachments: removeAttachments
1749
+ setAssetAttachment: setAttachment,
1750
+ setAssetAttachments: setAttachments,
1751
+ addAssetAttachment: addAttachment,
1752
+ addAssetAttachments: addAttachments,
1753
+ updateAssetAttachment: updateAttachment,
1754
+ updateAssetAttachments: updateAttachments,
1755
+ removeAssetAttachment: removeAttachment,
1756
+ removeAssetAttachments: removeAttachments
1764
1757
  }
1765
1758
  });
1766
1759
  const {
1767
- addComponent,
1768
- updateComponent,
1769
- removeComponent,
1770
- addComponentsInBatches,
1771
- setComponents,
1772
- removeAllComponentsOfType,
1760
+ addAsset,
1761
+ updateAsset,
1762
+ removeAsset,
1763
+ addAssetsInBatches,
1764
+ setAssets,
1765
+ removeAllAssetsOfType,
1773
1766
  // Attachments
1774
- setComponentAttachment,
1775
- setComponentAttachments,
1776
- addComponentAttachment,
1777
- addComponentAttachments,
1778
- updateComponentAttachment,
1779
- updateComponentAttachments,
1780
- removeComponentAttachment,
1781
- removeComponentAttachments
1782
- } = componentSlice.actions;
1783
- let prevComponents = null;
1784
- const selectComponents = (state) => {
1785
- if (!prevComponents) {
1786
- prevComponents = Object.values(state.componentReducer.components);
1787
- }
1788
- return prevComponents;
1767
+ setAssetAttachment,
1768
+ setAssetAttachments,
1769
+ addAssetAttachment,
1770
+ addAssetAttachments,
1771
+ updateAssetAttachment,
1772
+ updateAssetAttachments,
1773
+ removeAssetAttachment,
1774
+ removeAssetAttachments
1775
+ } = assetSlice.actions;
1776
+ let prevAssets = null;
1777
+ const selectAssets = (state) => {
1778
+ if (!prevAssets) {
1779
+ prevAssets = Object.values(state.assetReducer.assets);
1780
+ }
1781
+ return prevAssets;
1789
1782
  };
1790
- const selectComponentsMapping = (state) => state.componentReducer.components;
1791
- const selectComponentsFromComponentType = restructureCreateSelectorWithArgs(
1792
- toolkit.createSelector(
1793
- [selectComponents, (_state, componentTypeId) => componentTypeId],
1794
- (components, componentTypeId) => {
1795
- if (!componentTypeId)
1796
- return [];
1797
- return components.filter((component) => component.component_type === componentTypeId);
1798
- }
1799
- )
1783
+ const selectAssetsMapping = (state) => state.assetReducer.assets;
1784
+ const selectAssetsOfAssetType = restructureCreateSelectorWithArgs(
1785
+ toolkit.createSelector([selectAssets, (_state, assetTypeId) => assetTypeId], (components, assetTypeId) => {
1786
+ return components.filter((asset) => asset.asset_type === assetTypeId);
1787
+ })
1800
1788
  );
1801
- const selectComponent = (componentId) => (state) => {
1802
- return state.componentReducer.components[componentId];
1803
- };
1804
- const selectComponentTypeFromComponent = (componentTypeId) => (state) => {
1805
- return state.componentTypeReducer.componentTypes[componentTypeId];
1789
+ const selectAsset = (assetId) => (state) => {
1790
+ return state.assetReducer.assets[assetId];
1806
1791
  };
1807
- const selectComponentTypeFromComponents = toolkit.createSelector(
1808
- [selectComponents, selectComponentTypesMapping],
1809
- (components, componentTypeMapping) => {
1792
+ const selectAssetToAssetTypeMapping = toolkit.createSelector(
1793
+ [selectAssets, selectAssetTypesMapping],
1794
+ (assets, assetTypeMapping) => {
1810
1795
  const ret = {};
1811
- for (const component of components) {
1812
- const componentType = componentTypeMapping[component.component_type];
1813
- if (!componentType) {
1796
+ for (const asset of assets) {
1797
+ const assetType = assetTypeMapping[asset.asset_type];
1798
+ if (!assetType) {
1814
1799
  console.error(
1815
- `Component type with ID ${component.component_type} not found.
1816
- Expected all referenced component types to be populated.
1800
+ `Asset type with ID ${asset.asset_type} not found.
1801
+ Expected all referenced asset types to be populated.
1817
1802
  Returning empty object to avoid fatal errors.`
1818
1803
  );
1819
1804
  return {};
1820
1805
  }
1821
- ret[component.offline_id] = componentType;
1806
+ ret[asset.offline_id] = assetType;
1822
1807
  }
1823
1808
  return ret;
1824
1809
  }
1825
1810
  );
1826
- const selectComponentsByType = restructureCreateSelectorWithArgs(
1827
- toolkit.createSelector(
1828
- [selectComponents, (_state, componentTypeId) => componentTypeId],
1829
- (components, componentTypeId) => {
1830
- return components.filter((component) => component.component_type === componentTypeId);
1831
- }
1832
- )
1833
- );
1834
- const selectNumberOfComponentsOfComponentType = (componentTypeId) => (state) => {
1811
+ const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
1835
1812
  var _a2;
1836
- if (!componentTypeId)
1813
+ if (!assetTypeId)
1837
1814
  return 0;
1838
- return (_a2 = selectComponentsByType(componentTypeId)(state)) == null ? void 0 : _a2.length;
1815
+ return (_a2 = selectAssetsOfAssetType(assetTypeId)(state)) == null ? void 0 : _a2.length;
1839
1816
  };
1840
- const selectComponentTypesFromIds = (componentTypeIds) => (state) => {
1841
- return componentTypeIds.reduce((acc, componentTypeId) => {
1842
- const componentType = state.componentTypeReducer.componentTypes[componentTypeId];
1843
- if (componentType) {
1844
- acc.push(componentType);
1817
+ const selectAssetTypesFromIds = (assetTypeIds) => (state) => {
1818
+ return assetTypeIds.reduce((acc, assetTypeId) => {
1819
+ const assetType = state.assetTypeReducer.assetTypes[assetTypeId];
1820
+ if (assetType) {
1821
+ acc.push(assetType);
1845
1822
  }
1846
1823
  return acc;
1847
1824
  }, []);
1848
1825
  };
1849
- const selectComponentAttachmentMapping = (state) => state.componentReducer.attachments;
1850
- const selectAllComponentAttachments = toolkit.createSelector(
1851
- [selectComponentAttachmentMapping],
1826
+ const selectAssetAttachmentMapping = (state) => state.assetReducer.attachments;
1827
+ const selectAssetAttachments = toolkit.createSelector(
1828
+ [selectAssetAttachmentMapping],
1852
1829
  (mapping) => Object.values(mapping)
1853
1830
  );
1854
- const selectComponentAttachment = (attachmentId) => (state) => {
1855
- return state.componentReducer.attachments[attachmentId];
1831
+ const selectAssetAttachment = (attachmentId) => (state) => {
1832
+ return state.assetReducer.attachments[attachmentId];
1856
1833
  };
1857
- const selectAttachmentsOfComponent = restructureCreateSelectorWithArgs(
1834
+ const selectAttachmentsOfAsset = restructureCreateSelectorWithArgs(
1858
1835
  toolkit.createSelector(
1859
- [selectAllComponentAttachments, (_state, componentId) => componentId],
1860
- (attachments, componentId) => {
1861
- return attachments.filter(({ component }) => componentId === component);
1836
+ [selectAssetAttachments, (_state, assetId) => assetId],
1837
+ (attachments, assetId) => {
1838
+ return attachments.filter(({ asset }) => assetId === asset);
1862
1839
  }
1863
1840
  )
1864
1841
  );
1865
- const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
1842
+ const selectAttachmentsOfAssetByType = restructureCreateSelectorWithArgs(
1866
1843
  toolkit.createSelector(
1867
- [selectAllComponentAttachments, (_state, componentId) => componentId],
1868
- (attachments, componentId) => {
1869
- const attachmentsOfComponent = attachments.filter(({ component }) => componentId === component);
1870
- const fileAttachments = attachmentsOfComponent.filter(
1844
+ [selectAssetAttachments, (_state, assetId) => assetId],
1845
+ (attachments, assetId) => {
1846
+ const attachmentsOfAsset = attachments.filter(({ asset }) => assetId === asset);
1847
+ const fileAttachments = attachmentsOfAsset.filter(
1871
1848
  // this null check here is necessary, there are cases where file_type is null or undefined
1872
1849
  ({ file_type }) => !file_type || !file_type.startsWith("image/")
1873
1850
  );
1874
- const imageAttachments = attachmentsOfComponent.filter(
1851
+ const imageAttachments = attachmentsOfAsset.filter(
1875
1852
  // this null check here is necessary, there are cases where file_type is null or undefined
1876
1853
  ({ file_type }) => file_type && file_type.startsWith("image/")
1877
1854
  );
@@ -1879,69 +1856,67 @@ var __publicField = (obj, key, value) => {
1879
1856
  }
1880
1857
  )
1881
1858
  );
1882
- const componentReducer = componentSlice.reducer;
1859
+ const assetReducer = assetSlice.reducer;
1883
1860
  const initialState$o = {
1884
- completionsByComponentId: {}
1861
+ completionsByAssetId: {}
1885
1862
  };
1886
- const componentStageCompletionSlice = toolkit.createSlice({
1887
- name: "componentStageCompletions",
1863
+ const assetStageCompletionSlice = toolkit.createSlice({
1864
+ name: "assetStageCompletions",
1888
1865
  initialState: initialState$o,
1889
1866
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1890
1867
  reducers: {
1891
1868
  addStageCompletion: (state, action) => {
1892
- let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
1869
+ let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
1893
1870
  if (!stageToCompletionDateMapping) {
1894
1871
  stageToCompletionDateMapping = {};
1895
- state.completionsByComponentId[action.payload.component] = stageToCompletionDateMapping;
1872
+ state.completionsByAssetId[action.payload.asset] = stageToCompletionDateMapping;
1896
1873
  }
1897
1874
  stageToCompletionDateMapping[action.payload.stage] = (/* @__PURE__ */ new Date()).toISOString();
1898
1875
  },
1899
1876
  addStageCompletions: (state, action) => {
1900
- for (const [componentId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
1877
+ for (const [assetId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
1901
1878
  if (Object.keys(stageIdToCompletionDateMapping).length === 0)
1902
- throw new Error(
1903
- `Encountered empty stageIdToCompletionDateMapping argument for component ${componentId}`
1904
- );
1905
- let thisComponentCompletions = state.completionsByComponentId[componentId];
1906
- if (thisComponentCompletions === void 0) {
1907
- thisComponentCompletions = {};
1879
+ throw new Error(`Encountered empty stageIdToCompletionDateMapping argument for asset ${assetId}`);
1880
+ let thisAssetCompletions = state.completionsByAssetId[assetId];
1881
+ if (thisAssetCompletions === void 0) {
1882
+ thisAssetCompletions = {};
1908
1883
  }
1909
1884
  for (const [stageId, completionDate] of Object.entries(stageIdToCompletionDateMapping)) {
1910
- thisComponentCompletions[stageId] = completionDate;
1885
+ thisAssetCompletions[stageId] = completionDate;
1911
1886
  }
1912
- state.completionsByComponentId[componentId] = thisComponentCompletions;
1887
+ state.completionsByAssetId[assetId] = thisAssetCompletions;
1913
1888
  }
1914
1889
  },
1915
1890
  removeStageCompletions: (state, action) => {
1916
1891
  for (const completion of action.payload) {
1917
- const thisComponentCompletions = state.completionsByComponentId[completion.component];
1918
- if (!thisComponentCompletions || !(completion.stage in thisComponentCompletions)) {
1892
+ const thisAssetCompletions = state.completionsByAssetId[completion.asset];
1893
+ if (!thisAssetCompletions || !(completion.stage in thisAssetCompletions)) {
1919
1894
  console.warn(
1920
1895
  "Skipping removal of uncompleted stage. This message indicates completion objects are created unnecessarily."
1921
1896
  );
1922
1897
  continue;
1923
1898
  }
1924
- delete thisComponentCompletions[completion.stage];
1899
+ delete thisAssetCompletions[completion.stage];
1925
1900
  }
1926
1901
  },
1927
1902
  setStageCompletions: (state, action) => {
1928
- state.completionsByComponentId = action.payload;
1903
+ state.completionsByAssetId = action.payload;
1929
1904
  }
1930
1905
  }
1931
1906
  });
1932
- const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = componentStageCompletionSlice.actions;
1907
+ const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = assetStageCompletionSlice.actions;
1933
1908
  const selectCompletedStages = (state) => {
1934
- return state.componentStageCompletionReducer.completionsByComponentId;
1909
+ return state.assetStageCompletionReducer.completionsByAssetId;
1935
1910
  };
1936
- const selectCompletedStageIdsForComponent = (component) => (state) => {
1937
- return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1911
+ const selectCompletedStageIdsForAsset = (asset) => (state) => {
1912
+ return Object.keys(state.assetStageCompletionReducer.completionsByAssetId[asset.offline_id] ?? {});
1938
1913
  };
1939
- const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1914
+ const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
1940
1915
  const initialState$n = {
1941
1916
  stages: {}
1942
1917
  };
1943
- const componentStageSlice = toolkit.createSlice({
1944
- name: "componentStages",
1918
+ const assetStageSlice = toolkit.createSlice({
1919
+ name: "assetStages",
1945
1920
  initialState: initialState$n,
1946
1921
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1947
1922
  reducers: {
@@ -1976,60 +1951,48 @@ var __publicField = (obj, key, value) => {
1976
1951
  }
1977
1952
  }
1978
1953
  });
1979
- const selectStageMapping = (state) => state.componentStageReducer.stages;
1954
+ const selectStageMapping = (state) => state.assetStageReducer.stages;
1980
1955
  const selectStage = restructureCreateSelectorWithArgs(
1981
1956
  toolkit.createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
1982
1957
  return stageMapping[stageId];
1983
1958
  })
1984
1959
  );
1985
- const selectStages = toolkit.createSelector(
1986
- [selectStageMapping],
1987
- (stageMapping) => {
1988
- return Object.values(stageMapping);
1989
- }
1990
- );
1991
- const selectStagesFromComponentTypeIds = restructureCreateSelectorWithArgs(
1992
- toolkit.createSelector(
1993
- [selectStages, (_state, componentTypeIds) => componentTypeIds],
1994
- (stages, componentTypeIds) => {
1995
- const componentTypeIdsSet = new Set(componentTypeIds);
1996
- const ret = {};
1997
- for (const stage of stages) {
1998
- if (componentTypeIdsSet.has(stage.component_type)) {
1999
- if (!ret[stage.component_type]) {
2000
- ret[stage.component_type] = [];
2001
- }
2002
- ret[stage.component_type].push(stage);
1960
+ const selectStages = toolkit.createSelector([selectStageMapping], (stageMapping) => {
1961
+ return Object.values(stageMapping);
1962
+ });
1963
+ const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
1964
+ toolkit.createSelector([selectStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
1965
+ const assetTypeIdsSet = new Set(assetTypeIds);
1966
+ const ret = {};
1967
+ for (const stage of stages) {
1968
+ if (assetTypeIdsSet.has(stage.asset_type)) {
1969
+ if (!ret[stage.asset_type]) {
1970
+ ret[stage.asset_type] = [];
2003
1971
  }
1972
+ ret[stage.asset_type].push(stage);
2004
1973
  }
2005
- for (const key in ret) {
2006
- ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
2007
- }
2008
- return ret;
2009
1974
  }
2010
- )
1975
+ for (const key in ret) {
1976
+ ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
1977
+ }
1978
+ return ret;
1979
+ })
2011
1980
  );
2012
- const selectComponentTypeStagesMapping = restructureCreateSelectorWithArgs(
2013
- toolkit.createSelector(
2014
- [selectStageMapping, (_state, componentTypeId) => componentTypeId],
2015
- (stagesMapping, componentTypeId) => {
2016
- const componentTypeStagesMapping = {};
2017
- for (const [stageId, stage] of Object.entries(stagesMapping)) {
2018
- if (stage.component_type === componentTypeId) {
2019
- componentTypeStagesMapping[stageId] = stage;
2020
- }
1981
+ const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
1982
+ toolkit.createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
1983
+ const assetTypeStagesMapping = {};
1984
+ for (const [stageId, stage] of Object.entries(stagesMapping)) {
1985
+ if (stage.asset_type === assetTypeId) {
1986
+ assetTypeStagesMapping[stageId] = stage;
2021
1987
  }
2022
- return componentTypeStagesMapping;
2023
1988
  }
2024
- )
1989
+ return assetTypeStagesMapping;
1990
+ })
2025
1991
  );
2026
- const selectStagesFromComponentType = restructureCreateSelectorWithArgs(
2027
- toolkit.createSelector(
2028
- [selectStages, (_state, componentTypeId) => componentTypeId],
2029
- (stages, componentTypeId) => {
2030
- return stages.filter((stage) => stage.component_type === componentTypeId).sort((a, b) => a.priority - b.priority);
2031
- }
2032
- )
1992
+ const selectStagesOfAssetType = restructureCreateSelectorWithArgs(
1993
+ toolkit.createSelector([selectStages, (_state, assetTypeId) => assetTypeId], (stages, assetTypeId) => {
1994
+ return stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority);
1995
+ })
2033
1996
  );
2034
1997
  const selectStagesFromStageIds = restructureCreateSelectorWithArgs(
2035
1998
  toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
@@ -2051,8 +2014,8 @@ var __publicField = (obj, key, value) => {
2051
2014
  return ret;
2052
2015
  })
2053
2016
  );
2054
- const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
2055
- const componentStageReducer = componentStageSlice.reducer;
2017
+ const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = assetStageSlice.actions;
2018
+ const assetStageReducer = assetStageSlice.reducer;
2056
2019
  const initialState$m = {
2057
2020
  workspaces: {},
2058
2021
  activeWorkspaceId: null
@@ -2711,8 +2674,8 @@ var __publicField = (obj, key, value) => {
2711
2674
  })(OrganizationAccessLevel || {});
2712
2675
  var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
2713
2676
  AttachmentModel2["Issue"] = "issue";
2714
- AttachmentModel2["Component"] = "component";
2715
- AttachmentModel2["ComponentType"] = "component_type";
2677
+ AttachmentModel2["Asset"] = "asset";
2678
+ AttachmentModel2["AssetType"] = "asset_type";
2716
2679
  AttachmentModel2["Project"] = "project";
2717
2680
  AttachmentModel2["Document"] = "document";
2718
2681
  return AttachmentModel2;
@@ -3525,6 +3488,7 @@ var __publicField = (obj, key, value) => {
3525
3488
  placementMode: false,
3526
3489
  enableClustering: false,
3527
3490
  svgLayout: false,
3491
+ // TODO: this is no longer used
3528
3492
  expandedSections: {
3529
3493
  Issues: true,
3530
3494
  "Map Layers": false,
@@ -3735,27 +3699,27 @@ var __publicField = (obj, key, value) => {
3735
3699
  });
3736
3700
  })
3737
3701
  );
3738
- const selectLatestFormRevisionsOfComponentTypes = restructureCreateSelectorWithArgs(
3702
+ const selectLatestFormRevisionsOfAssetTypes = restructureCreateSelectorWithArgs(
3739
3703
  toolkit.createSelector(
3740
3704
  [
3741
3705
  (state) => state.formReducer.forms,
3742
3706
  selectFormRevisionMapping,
3743
- (_state, componentTypeIds) => componentTypeIds
3707
+ (_state, assetTypeIds) => assetTypeIds
3744
3708
  ],
3745
- (userForms, revisions, componentTypeIds) => {
3746
- const componentTypeIdsSet = new Set(componentTypeIds);
3747
- const formsOfComponentTypes = {};
3709
+ (userForms, revisions, assetTypeIds) => {
3710
+ const assetTypeIdsSet = new Set(assetTypeIds);
3711
+ const formsOfAssetTypes = {};
3748
3712
  const ret = {};
3749
3713
  for (const form of Object.values(userForms)) {
3750
- if (form.component_type && componentTypeIdsSet.has(form.component_type)) {
3751
- formsOfComponentTypes[form.offline_id] = form;
3714
+ if (form.asset_type && assetTypeIdsSet.has(form.asset_type)) {
3715
+ formsOfAssetTypes[form.offline_id] = form;
3752
3716
  }
3753
3717
  }
3754
3718
  for (const revision of Object.values(revisions)) {
3755
- const form = formsOfComponentTypes[revision.form];
3756
- if (!form || !form.component_type || ret[form.component_type] && formRevisionSortFn(ret[form.component_type], revision) > 0)
3719
+ const form = formsOfAssetTypes[revision.form];
3720
+ if (!form || !form.asset_type || ret[form.asset_type] && formRevisionSortFn(ret[form.asset_type], revision) > 0)
3757
3721
  continue;
3758
- ret[form.component_type] = revision;
3722
+ ret[form.asset_type] = revision;
3759
3723
  }
3760
3724
  return ret;
3761
3725
  }
@@ -3872,11 +3836,11 @@ var __publicField = (obj, key, value) => {
3872
3836
  const selectFormMapping = (state) => {
3873
3837
  return state.formReducer.forms;
3874
3838
  };
3875
- const selectFormOfComponentType = restructureCreateSelectorWithArgs(
3839
+ const selectFormOfAssetType = restructureCreateSelectorWithArgs(
3876
3840
  toolkit.createSelector(
3877
- [selectFormMapping, (_state, componentTypeId) => componentTypeId],
3878
- (userForms, componentTypeId) => {
3879
- return Object.values(userForms).find((userForm) => userForm.component_type === componentTypeId);
3841
+ [selectFormMapping, (_state, assetTypeId) => assetTypeId],
3842
+ (userForms, assetTypeId) => {
3843
+ return Object.values(userForms).find((userForm) => userForm.asset_type === assetTypeId);
3880
3844
  }
3881
3845
  )
3882
3846
  );
@@ -3892,7 +3856,7 @@ var __publicField = (obj, key, value) => {
3892
3856
  return Object.keys(userForms).length;
3893
3857
  });
3894
3858
  const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (userForms) => {
3895
- return Object.values(userForms).filter((form) => !form.component_type).length;
3859
+ return Object.values(userForms).filter((form) => !form.asset_type).length;
3896
3860
  });
3897
3861
  const formReducer = formSlice.reducer;
3898
3862
  const initialState$5 = {
@@ -4100,31 +4064,31 @@ var __publicField = (obj, key, value) => {
4100
4064
  }
4101
4065
  )
4102
4066
  );
4103
- const selectFormSubmissionsOfComponent = restructureCreateSelectorWithArgs(
4067
+ const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
4104
4068
  toolkit.createSelector(
4105
- [selectFormSubmissions, (_state, componentId) => componentId],
4106
- (submissions, componentId) => {
4069
+ [selectFormSubmissions, (_state, assetId) => assetId],
4070
+ (submissions, assetId) => {
4107
4071
  return submissions.filter((submission) => {
4108
- return submission.component === componentId;
4072
+ return submission.asset === assetId;
4109
4073
  });
4110
4074
  }
4111
4075
  )
4112
4076
  );
4113
- const selectFormSubmissionsByComponents = toolkit.createSelector(
4114
- [selectFormSubmissionsMapping, selectComponentsMapping],
4115
- (submissions, components) => {
4077
+ const selectFormSubmissionsByAssets = toolkit.createSelector(
4078
+ [selectFormSubmissionsMapping, selectAssetsMapping],
4079
+ (submissions, assets) => {
4116
4080
  var _a2;
4117
- const componentSubmissionMapping = {};
4118
- for (const componentId in components) {
4119
- componentSubmissionMapping[componentId] = [];
4081
+ const assetSubmissionMapping = {};
4082
+ for (const assetId in assets) {
4083
+ assetSubmissionMapping[assetId] = [];
4120
4084
  }
4121
4085
  for (const submissionId in submissions) {
4122
4086
  const submission = submissions[submissionId];
4123
- if (submission.component) {
4124
- (_a2 = componentSubmissionMapping[submission.component]) == null ? void 0 : _a2.push(submission);
4087
+ if (submission.asset) {
4088
+ (_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
4125
4089
  }
4126
4090
  }
4127
- return componentSubmissionMapping;
4091
+ return assetSubmissionMapping;
4128
4092
  }
4129
4093
  );
4130
4094
  const selectFormSubmissionAttachmentsMapping = (state) => {
@@ -4523,7 +4487,7 @@ var __publicField = (obj, key, value) => {
4523
4487
  reducers: {}
4524
4488
  });
4525
4489
  const versioningReducer = versioningSlice.reducer;
4526
- const fullComponentMarkerSize = 45;
4490
+ const fullAssetMarkerSize = 45;
4527
4491
  const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
4528
4492
  const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
4529
4493
  const OUTBOX_RETRY_DELAY = 5e3;
@@ -4541,10 +4505,10 @@ var __publicField = (obj, key, value) => {
4541
4505
  fileReducer,
4542
4506
  authReducer,
4543
4507
  categoryReducer,
4544
- componentReducer,
4545
- componentStageCompletionReducer,
4546
- componentStageReducer,
4547
- componentTypeReducer,
4508
+ assetReducer,
4509
+ assetStageCompletionReducer,
4510
+ assetStageReducer,
4511
+ assetTypeReducer,
4548
4512
  issueReducer,
4549
4513
  issueTypeReducer,
4550
4514
  mapReducer,
@@ -5386,110 +5350,108 @@ var __publicField = (obj, key, value) => {
5386
5350
  store.dispatch(setCategories(result));
5387
5351
  }
5388
5352
  }
5389
- class ComponentService extends BaseApiService {
5353
+ class AssetService extends BaseApiService {
5390
5354
  // Basic CRUD functions
5391
- add(component, workspaceId) {
5392
- const offlineComponent = offline(component);
5393
- this.client.store.dispatch(addComponent(offlineComponent));
5355
+ add(asset, workspaceId) {
5356
+ const offlineAsset = offline(asset);
5357
+ this.client.store.dispatch(addAsset(offlineAsset));
5394
5358
  const promise = this.client.enqueueRequest({
5395
- description: "Create Component",
5359
+ description: "Create asset",
5396
5360
  method: HttpMethod.POST,
5397
- url: `/components/types/${offlineComponent.component_type}/add-components/`,
5361
+ url: `/assets/types/${offlineAsset.asset_type}/add-assets/`,
5398
5362
  queryParams: {
5399
5363
  workspace_id: workspaceId.toString()
5400
5364
  },
5401
- payload: { components: [offlineComponent] },
5365
+ payload: { assets: [offlineAsset] },
5402
5366
  blockers: [],
5403
- blocks: [offlineComponent.offline_id]
5367
+ blocks: [offlineAsset.offline_id]
5404
5368
  });
5405
- return [offlineComponent, promise];
5369
+ return [offlineAsset, promise];
5406
5370
  }
5407
- update(component, workspaceId) {
5408
- this.client.store.dispatch(updateComponent(component));
5371
+ update(asset, workspaceId) {
5372
+ this.client.store.dispatch(updateAsset(asset));
5409
5373
  const promise = this.client.enqueueRequest({
5410
- description: "Edit component",
5374
+ description: "Edit asset",
5411
5375
  method: HttpMethod.PATCH,
5412
- url: `/components/${component.offline_id}/`,
5376
+ url: `/assets/${asset.offline_id}/`,
5413
5377
  queryParams: {
5414
5378
  workspace_id: workspaceId.toString()
5415
5379
  },
5416
- payload: component,
5417
- blockers: [component.offline_id],
5418
- blocks: [component.offline_id]
5380
+ payload: asset,
5381
+ blockers: [asset.offline_id],
5382
+ blocks: [asset.offline_id]
5419
5383
  });
5420
- return [component, promise];
5384
+ return [asset, promise];
5421
5385
  }
5422
- async remove(id) {
5386
+ async remove(assetId) {
5423
5387
  const { store } = this.client;
5424
- const backupComponent = selectComponent(id)(store.getState());
5425
- if (!backupComponent)
5426
- throw new Error(`No component with id ${id} found in the store`);
5427
- const attachmentsOfComponent = selectAttachmentsOfComponent(id)(store.getState());
5428
- store.dispatch(removeComponent(id));
5429
- if (attachmentsOfComponent.length > 0) {
5430
- const attachmentsOfComponentIds = attachmentsOfComponent.map(({ offline_id }) => offline_id);
5431
- store.dispatch(removeComponentAttachments(attachmentsOfComponentIds));
5388
+ const assetToBeDeleted = selectAsset(assetId)(store.getState());
5389
+ if (!assetToBeDeleted)
5390
+ throw new Error(`No asset with id ${assetId} found in the store`);
5391
+ const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(store.getState());
5392
+ store.dispatch(removeAsset(assetId));
5393
+ if (attachmentsOfAssets.length > 0) {
5394
+ const attachmentsOfAssetIds = attachmentsOfAssets.map(({ offline_id }) => offline_id);
5395
+ store.dispatch(removeAssetAttachments(attachmentsOfAssetIds));
5432
5396
  }
5433
5397
  return this.client.enqueueRequest({
5434
- description: "Delete issue",
5398
+ description: "Delete asset",
5435
5399
  method: HttpMethod.DELETE,
5436
- url: `/components/${id}/`,
5437
- blockers: [id],
5400
+ url: `/assets/${assetId}/`,
5401
+ blockers: [assetId],
5438
5402
  blocks: []
5439
5403
  }).catch((err) => {
5440
- store.dispatch(addComponent(backupComponent));
5441
- store.dispatch(addComponentAttachments(attachmentsOfComponent));
5404
+ store.dispatch(addAsset(assetToBeDeleted));
5405
+ store.dispatch(addAssetAttachments(attachmentsOfAssets));
5442
5406
  throw err;
5443
5407
  });
5444
5408
  }
5445
- async deleteAllByComponentType(componentTypeId) {
5446
- const clientStore2 = this.client.store;
5447
- const allComponentsOfType = selectComponentsFromComponentType(componentTypeId)(clientStore2.getState());
5448
- const affectedComponentIds = (allComponentsOfType || []).map((c) => c.offline_id);
5449
- const affectedOfflineIds = [componentTypeId, ...affectedComponentIds];
5409
+ async deleteAllAssetsOfAssetType(assetTypeId) {
5450
5410
  const { store } = this.client;
5451
5411
  const state = store.getState();
5452
- const componentsOfThisType = selectComponentsByType(componentTypeId)(state);
5453
- store.dispatch(removeAllComponentsOfType(componentTypeId));
5412
+ const allAssetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state);
5413
+ const allAssetsOfAssetTypeIds = (allAssetsOfAssetType || []).map((c) => c.offline_id);
5414
+ const affectedOfflineIds = [assetTypeId, ...allAssetsOfAssetTypeIds];
5415
+ store.dispatch(removeAllAssetsOfType(assetTypeId));
5454
5416
  return this.client.enqueueRequest({
5455
- description: "Batch delete components by component type",
5417
+ description: "Delete all assets of asset type",
5456
5418
  method: HttpMethod.DELETE,
5457
- url: `/components/types/${componentTypeId}/delete-all-of-type/`,
5419
+ url: `/assets/types/${assetTypeId}/delete-all-of-type/`,
5458
5420
  blockers: affectedOfflineIds,
5459
5421
  blocks: affectedOfflineIds
5460
5422
  }).catch((err) => {
5461
- if (componentsOfThisType) {
5462
- store.dispatch(addComponentsInBatches(componentsOfThisType));
5423
+ if (allAssetsOfAssetType) {
5424
+ store.dispatch(addAssetsInBatches(allAssetsOfAssetType));
5463
5425
  }
5464
5426
  throw err;
5465
5427
  });
5466
5428
  }
5467
- async addBatch(componentsToCreate, workspaceId, componentTypeId) {
5468
- const fullComponents = componentsToCreate.map((component) => {
5469
- return { ...offline(component), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
5429
+ async addBatch(assetsToCreate, workspaceId, assetTypeId) {
5430
+ const fullAssets = assetsToCreate.map((asset) => {
5431
+ return { ...offline(asset), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
5470
5432
  });
5471
5433
  const { store } = this.client;
5472
- store.dispatch(addComponentsInBatches(fullComponents));
5434
+ store.dispatch(addAssetsInBatches(fullAssets));
5473
5435
  const promise = this.client.enqueueRequest({
5474
- description: "Batch create components",
5436
+ description: "Batch create assets",
5475
5437
  method: HttpMethod.POST,
5476
- url: `/components/types/${componentTypeId}/add-components/`,
5438
+ url: `/assets/types/${assetTypeId}/add-assets/`,
5477
5439
  queryParams: {
5478
5440
  workspace_id: workspaceId.toString()
5479
5441
  },
5480
5442
  payload: {
5481
- components: fullComponents
5443
+ assets: fullAssets
5482
5444
  },
5483
- blockers: [componentTypeId],
5484
- blocks: fullComponents.map((c) => c.offline_id)
5445
+ blockers: [assetTypeId],
5446
+ blocks: fullAssets.map((c) => c.offline_id)
5485
5447
  });
5486
5448
  void promise.then((result) => {
5487
- for (const component of Object.values(result)) {
5488
- store.dispatch(updateComponent(component));
5449
+ for (const assets of Object.values(result)) {
5450
+ store.dispatch(updateAsset(assets));
5489
5451
  }
5490
5452
  }).catch((e) => {
5491
- for (const component of fullComponents) {
5492
- store.dispatch(removeComponent(component.offline_id));
5453
+ for (const asset of fullAssets) {
5454
+ store.dispatch(removeAsset(asset.offline_id));
5493
5455
  }
5494
5456
  throw e;
5495
5457
  });
@@ -5498,128 +5460,124 @@ var __publicField = (obj, key, value) => {
5498
5460
  async refreshStore() {
5499
5461
  const { store } = this.client;
5500
5462
  const result = await this.client.enqueueRequest({
5501
- description: "Get components",
5463
+ description: "Get assets",
5502
5464
  method: HttpMethod.GET,
5503
- url: `/projects/${store.getState().projectReducer.activeProjectId}/components/`,
5465
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/assets/`,
5504
5466
  blockers: [],
5505
5467
  blocks: []
5506
5468
  });
5507
- store.dispatch(setComponents(result));
5469
+ store.dispatch(setAssets(result));
5508
5470
  }
5509
5471
  }
5510
- class ComponentStageCompletionService extends BaseApiService {
5511
- add(componentId, stageId) {
5472
+ class AssetStageCompletionService extends BaseApiService {
5473
+ add(assetId, stageId) {
5512
5474
  var _a2;
5513
5475
  const { store } = this.client;
5514
- const componentType = (_a2 = store.getState().componentReducer.components[componentId]) == null ? void 0 : _a2.component_type;
5515
- if (!componentType) {
5516
- throw new Error(`Component ${componentId} not found`);
5476
+ const assetTypeId = (_a2 = store.getState().assetReducer.assets[assetId]) == null ? void 0 : _a2.asset_type;
5477
+ if (!assetTypeId) {
5478
+ throw new Error(`Asset with offline_id ${assetId} not found`);
5517
5479
  }
5518
- const offlineCompletion = offline({
5519
- component: componentId,
5480
+ const offlineStageCompletion = offline({
5481
+ asset: assetId,
5520
5482
  stage: stageId
5521
5483
  });
5522
- store.dispatch(addStageCompletion(offlineCompletion));
5484
+ store.dispatch(addStageCompletion(offlineStageCompletion));
5523
5485
  const promise = this.client.enqueueRequest({
5524
- description: "Mark stage as completed",
5486
+ description: "Complete stage",
5525
5487
  method: HttpMethod.POST,
5526
- url: `/components/types/${componentType}/complete-stages/`,
5488
+ url: `/assets/types/${assetTypeId}/complete-stages/`,
5527
5489
  // TODO: Add submitted_at to model
5528
- payload: { completions: [{ ...offlineCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
5529
- blockers: [componentId, stageId],
5530
- blocks: [offlineCompletion.offline_id]
5490
+ payload: { completions: [{ ...offlineStageCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
5491
+ blockers: [assetId, stageId],
5492
+ blocks: [offlineStageCompletion.offline_id]
5531
5493
  });
5532
- return [offlineCompletion, promise];
5494
+ return [offlineStageCompletion, promise];
5533
5495
  }
5534
5496
  async refreshStore() {
5535
5497
  const { store } = this.client;
5536
5498
  const result = await this.client.enqueueRequest({
5537
- description: "Get completed stages",
5499
+ description: "Get stage completions",
5538
5500
  method: HttpMethod.GET,
5539
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stage-completions/`,
5501
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stage-completions/`,
5540
5502
  blockers: [],
5541
5503
  blocks: []
5542
5504
  });
5543
5505
  store.dispatch(addStageCompletions(result));
5544
5506
  }
5545
5507
  /**
5546
- * Creates a collection of ComponentStageCompletions, marking the referenced stages as completed for the referenced
5547
- * components. It's REQUIRED that all components referenced all have the SAME component type.
5548
- * @param componentTypeId The ID of the component type for which we are completing stages (we can only complete
5549
- * stages for one component type at a time)
5508
+ * Creates a collection of AssetStageCompletions, marking the referenced stages as completed for the referenced
5509
+ * assets. It's REQUIRED that all assets referenced all have the SAME asset type.
5510
+ * @param assetTypeId The ID of the asset type for which we are completing stages (we can only complete
5511
+ * stages for one asset type at a time)
5550
5512
  * @param stageCompletions
5551
5513
  */
5552
- async bulkAdd(componentTypeId, stageCompletions) {
5553
- const offlineStagesCompletions = stageCompletions.map((completion) => {
5514
+ async bulkAdd(assetTypeId, stageCompletions) {
5515
+ const offlineStageCompletions = stageCompletions.map((completion) => {
5554
5516
  return offline(completion);
5555
5517
  });
5556
5518
  const asMapping = {};
5557
5519
  for (const completion of stageCompletions) {
5558
- const stageToCompletionDateMapping = asMapping[completion.component] || {};
5520
+ const stageToCompletionDateMapping = asMapping[completion.asset] || {};
5559
5521
  stageToCompletionDateMapping[completion.stage] = (/* @__PURE__ */ new Date()).toISOString();
5560
- asMapping[completion.component] = stageToCompletionDateMapping;
5522
+ asMapping[completion.asset] = stageToCompletionDateMapping;
5561
5523
  }
5562
5524
  this.client.store.dispatch(addStageCompletions(asMapping));
5563
5525
  await this.client.enqueueRequest({
5564
- description: "Mark multiple stage as completed",
5526
+ description: "Bulk complete stages",
5565
5527
  method: HttpMethod.POST,
5566
- url: `/components/types/${componentTypeId}/complete-stages/`,
5528
+ url: `/assets/types/${assetTypeId}/complete-stages/`,
5567
5529
  payload: {
5568
- completions: offlineStagesCompletions
5530
+ completions: offlineStageCompletions
5569
5531
  },
5570
- blockers: [
5571
- componentTypeId,
5572
- ...stageCompletions.map((c) => c.component),
5573
- ...stageCompletions.map((c) => c.stage)
5574
- ],
5575
- blocks: offlineStagesCompletions.map((c) => c.offline_id)
5532
+ blockers: [assetTypeId, ...stageCompletions.map((c) => c.asset), ...stageCompletions.map((c) => c.stage)],
5533
+ blocks: offlineStageCompletions.map((c) => c.offline_id)
5576
5534
  });
5577
5535
  }
5578
- bulkDelete(stageId, componentIds) {
5579
- const completionsToRemove = componentIds.map((componentId) => {
5536
+ bulkDelete(stageId, assetIds) {
5537
+ const stageCompletionsToRemove = assetIds.map((assetId) => {
5580
5538
  return {
5581
- component: componentId,
5539
+ asset: assetId,
5582
5540
  stage: stageId
5583
5541
  };
5584
5542
  });
5585
- this.client.store.dispatch(removeStageCompletions(completionsToRemove));
5543
+ this.client.store.dispatch(removeStageCompletions(stageCompletionsToRemove));
5586
5544
  return this.client.enqueueRequest({
5587
- description: `Undo stage for ${componentIds.length} component(s)`,
5545
+ description: `Undo stage for ${assetIds.length} assets(s)`,
5588
5546
  // TODO: Rename to setCompletedStages
5589
5547
  method: HttpMethod.DELETE,
5590
- url: `/components/stages/${stageId}/undo-stages/`,
5548
+ url: `/assets/stages/${stageId}/undo-stages/`,
5591
5549
  payload: {
5592
- components: componentIds
5550
+ assets: assetIds
5593
5551
  },
5594
- blockers: [stageId, ...componentIds],
5552
+ blockers: [stageId, ...assetIds],
5595
5553
  blocks: []
5596
5554
  });
5597
5555
  }
5598
5556
  }
5599
- class ComponentStageService extends BaseApiService {
5600
- async bulkCreateStages(stagesToSubmit, componentTypeId, workspaceId) {
5557
+ class AssetStageService extends BaseApiService {
5558
+ async bulkCreateStages(stagesToSubmit, assetTypeId, workspaceId) {
5601
5559
  const payload = stagesToSubmit.map((stage) => {
5602
5560
  return offline(stage);
5603
5561
  });
5604
5562
  const fullStages = payload.map((stage) => {
5605
- return { ...stage, component_type: componentTypeId };
5563
+ return { ...stage, asset_type: assetTypeId };
5606
5564
  });
5607
5565
  this.client.store.dispatch(addStages(fullStages));
5608
5566
  return this.client.enqueueRequest({
5609
- description: "Add component stages",
5567
+ description: "Add asset stages",
5610
5568
  method: HttpMethod.POST,
5611
- url: `/components/types/${componentTypeId}/add-stages/`,
5569
+ url: `/assets/types/${assetTypeId}/add-stages/`,
5612
5570
  payload: {
5613
5571
  stages: payload
5614
5572
  },
5615
5573
  queryParams: {
5616
5574
  workspace_id: workspaceId.toString()
5617
5575
  },
5618
- blockers: [componentTypeId, workspaceId],
5576
+ blockers: [assetTypeId, workspaceId],
5619
5577
  blocks: payload.map(({ offline_id }) => offline_id)
5620
5578
  });
5621
5579
  }
5622
- async bulkUpdateStages(stagesToUpdate, componentTypeId) {
5580
+ async bulkUpdateStages(stagesToUpdate, assetTypeId) {
5623
5581
  const store = this.client.store;
5624
5582
  const state = store.getState();
5625
5583
  const prevStages = selectStagesFromStageIds(
@@ -5630,13 +5588,13 @@ var __publicField = (obj, key, value) => {
5630
5588
  }
5631
5589
  store.dispatch(updateStages(stagesToUpdate));
5632
5590
  return this.client.enqueueRequest({
5633
- description: "Edit component stages",
5591
+ description: "Edit asset stages",
5634
5592
  method: HttpMethod.PATCH,
5635
- url: `/components/types/${componentTypeId}/bulk-update-stages/`,
5593
+ url: `/assets/types/${assetTypeId}/bulk-update-stages/`,
5636
5594
  payload: {
5637
5595
  stages: stagesToUpdate
5638
5596
  },
5639
- blockers: [componentTypeId],
5597
+ blockers: [assetTypeId],
5640
5598
  blocks: stagesToUpdate.map(({ offline_id }) => offline_id)
5641
5599
  }).catch((e) => {
5642
5600
  store.dispatch(updateStages(prevStages));
@@ -5646,9 +5604,9 @@ var __publicField = (obj, key, value) => {
5646
5604
  async bulkDelete(idsToDelete) {
5647
5605
  this.client.store.dispatch(removeStages(idsToDelete));
5648
5606
  return this.client.enqueueRequest({
5649
- description: "Delete component stages",
5607
+ description: "Delete asset stages",
5650
5608
  method: HttpMethod.DELETE,
5651
- url: "/components/stages/bulk-delete/",
5609
+ url: "/assets/stages/bulk-delete/",
5652
5610
  payload: {
5653
5611
  stage_ids: idsToDelete
5654
5612
  },
@@ -5656,15 +5614,15 @@ var __publicField = (obj, key, value) => {
5656
5614
  blocks: []
5657
5615
  });
5658
5616
  }
5659
- async update(componentStage) {
5660
- this.client.store.dispatch(addStages([componentStage]));
5617
+ async update(assetStage) {
5618
+ this.client.store.dispatch(addStages([assetStage]));
5661
5619
  return this.client.enqueueRequest({
5662
- description: "Update component stage",
5620
+ description: "Update asset stage",
5663
5621
  method: HttpMethod.PATCH,
5664
- url: `/components/stages/${componentStage.offline_id}/`,
5665
- payload: componentStage,
5666
- blockers: [componentStage.offline_id],
5667
- blocks: [componentStage.offline_id]
5622
+ url: `/assets/stages/${assetStage.offline_id}/`,
5623
+ payload: assetStage,
5624
+ blockers: [assetStage.offline_id],
5625
+ blocks: [assetStage.offline_id]
5668
5626
  });
5669
5627
  }
5670
5628
  async linkForm(stageId, formId2) {
@@ -5672,9 +5630,9 @@ var __publicField = (obj, key, value) => {
5672
5630
  store.dispatch(linkStageToForm({ stageId, formId: formId2 }));
5673
5631
  try {
5674
5632
  await this.client.enqueueRequest({
5675
- description: "Link component stage to form",
5633
+ description: "Link asset stage to form",
5676
5634
  method: HttpMethod.POST,
5677
- url: `/components/stages/${stageId}/associate-with-form/`,
5635
+ url: `/assets/stages/${stageId}/associate-with-form/`,
5678
5636
  payload: { user_form: formId2 },
5679
5637
  blockers: [stageId, formId2],
5680
5638
  blocks: [stageId]
@@ -5689,9 +5647,9 @@ var __publicField = (obj, key, value) => {
5689
5647
  store.dispatch(unlinkStageToForm({ stageId }));
5690
5648
  try {
5691
5649
  await this.client.enqueueRequest({
5692
- description: "Unlink component stage from form",
5650
+ description: "Unlink asset stage from form",
5693
5651
  method: HttpMethod.DELETE,
5694
- url: `/components/stages/${stageId}/associate-with-form/`,
5652
+ url: `/assets/stages/${stageId}/associate-with-form/`,
5695
5653
  blockers: [stageId, formId2],
5696
5654
  blocks: [stageId]
5697
5655
  });
@@ -5703,9 +5661,9 @@ var __publicField = (obj, key, value) => {
5703
5661
  async refreshStore() {
5704
5662
  const { store } = this.client;
5705
5663
  const result = await this.client.enqueueRequest({
5706
- description: "Get component stages",
5664
+ description: "Get asset stages",
5707
5665
  method: HttpMethod.GET,
5708
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stages/`,
5666
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stages/`,
5709
5667
  blockers: [],
5710
5668
  blocks: []
5711
5669
  });
@@ -5719,20 +5677,20 @@ var __publicField = (obj, key, value) => {
5719
5677
  deleteUrlPrefix: "/issues",
5720
5678
  fetchUrlPostfix: "/issue-attachments"
5721
5679
  },
5722
- [AttachmentModel.Component]: {
5723
- name: "component",
5724
- attachUrlPrefix: "/components",
5725
- deleteUrlPrefix: "/components",
5726
- fetchUrlPostfix: "/component-attachments"
5680
+ [AttachmentModel.Asset]: {
5681
+ name: "asset",
5682
+ attachUrlPrefix: "/assets",
5683
+ deleteUrlPrefix: "/assets",
5684
+ fetchUrlPostfix: "/asset-attachments"
5727
5685
  },
5728
- [AttachmentModel.ComponentType]: {
5729
- name: "component type",
5730
- attachUrlPrefix: "/components/types",
5731
- deleteUrlPrefix: "/components/types",
5732
- fetchUrlPostfix: "/component-type-attachments"
5686
+ [AttachmentModel.AssetType]: {
5687
+ name: "asset type",
5688
+ attachUrlPrefix: "/assets/types",
5689
+ deleteUrlPrefix: "/assets/types",
5690
+ fetchUrlPostfix: "/asset-type-attachments"
5733
5691
  },
5734
5692
  [AttachmentModel.Project]: {
5735
- name: "component project",
5693
+ name: "project",
5736
5694
  attachUrlPrefix: "/projects",
5737
5695
  deleteUrlPrefix: "/projects",
5738
5696
  fetchUrlPostfix: "/attachments"
@@ -5748,8 +5706,8 @@ var __publicField = (obj, key, value) => {
5748
5706
  getNumberOfAttachmentsWithSha1(sha1) {
5749
5707
  const {
5750
5708
  issueReducer: issueReducer2,
5751
- componentReducer: componentReducer2,
5752
- componentTypeReducer: componentTypeReducer2,
5709
+ assetReducer: assetReducer2,
5710
+ assetTypeReducer: assetTypeReducer2,
5753
5711
  documentsReducer: documentsReducer2,
5754
5712
  projectReducer: projectReducer2,
5755
5713
  formSubmissionReducer: formSubmissionReducer2,
@@ -5757,8 +5715,8 @@ var __publicField = (obj, key, value) => {
5757
5715
  } = this.client.store.getState();
5758
5716
  const objectsWithSha1 = [].concat(
5759
5717
  Object.values(issueReducer2.attachments),
5760
- Object.values(componentReducer2.attachments),
5761
- Object.values(componentTypeReducer2.attachments),
5718
+ Object.values(assetReducer2.attachments),
5719
+ Object.values(assetTypeReducer2.attachments),
5762
5720
  Object.values(documentsReducer2.attachments),
5763
5721
  Object.values(projectReducer2.attachments),
5764
5722
  Object.values(formRevisionReducer2.attachments),
@@ -5880,10 +5838,10 @@ var __publicField = (obj, key, value) => {
5880
5838
  return promise;
5881
5839
  }
5882
5840
  }
5883
- class ComponentAttachmentService extends BaseAttachmentService {
5841
+ class AssetAttachmentService extends BaseAttachmentService {
5884
5842
  constructor() {
5885
5843
  super(...arguments);
5886
- __publicField(this, "attachmentModel", AttachmentModel.Component);
5844
+ __publicField(this, "attachmentModel", AttachmentModel.Asset);
5887
5845
  }
5888
5846
  buildOfflineAttachment(data) {
5889
5847
  return offline({
@@ -5894,115 +5852,108 @@ var __publicField = (obj, key, value) => {
5894
5852
  file_type: data.file.type,
5895
5853
  submitted_at: data.submittedAt,
5896
5854
  description: data.description,
5897
- component: data.modelId
5855
+ asset: data.modelId
5898
5856
  });
5899
5857
  }
5900
- async attachFilesToComponent(files, componentId) {
5901
- return this.attachFiles(
5902
- files,
5903
- componentId,
5904
- this.buildOfflineAttachment.bind(this),
5905
- {
5906
- addAttachments: addComponentAttachments,
5907
- updateAttachments: updateComponentAttachments,
5908
- removeAttachments: removeComponentAttachments
5909
- }
5910
- );
5858
+ async attachFilesToAsset(files, assetId) {
5859
+ return this.attachFiles(files, assetId, this.buildOfflineAttachment.bind(this), {
5860
+ addAttachments: addAssetAttachments,
5861
+ updateAttachments: updateAssetAttachments,
5862
+ removeAttachments: removeAssetAttachments
5863
+ });
5911
5864
  }
5912
- deleteComponentAttachment(attachmentId) {
5865
+ deleteAssetAttachment(attachmentId) {
5913
5866
  return this.deleteAttachment(
5914
5867
  attachmentId,
5915
5868
  {
5916
- setAttachment: setComponentAttachment,
5917
- removeAttachment: removeComponentAttachment
5869
+ setAttachment: setAssetAttachment,
5870
+ removeAttachment: removeAssetAttachment
5918
5871
  },
5919
5872
  {
5920
- selectAttachment: selectComponentAttachment
5873
+ selectAttachment: selectAssetAttachment
5921
5874
  }
5922
5875
  );
5923
5876
  }
5924
5877
  async refreshStore() {
5925
5878
  return this.getAttachments({
5926
- setAttachments: setComponentAttachments
5879
+ setAttachments: setAssetAttachments
5927
5880
  });
5928
5881
  }
5929
5882
  }
5930
- class ComponentTypeService extends BaseApiService {
5931
- add(componentType) {
5932
- const offlineComponentType = offline(componentType);
5883
+ class AssetTypeService extends BaseApiService {
5884
+ add(assetType) {
5885
+ const offlineAssetType = offline(assetType);
5933
5886
  const { store } = this.client;
5934
5887
  const activeProjectId = store.getState().projectReducer.activeProjectId;
5935
- store.dispatch(addComponentType(offlineComponentType));
5888
+ store.dispatch(addAssetType(offlineAssetType));
5936
5889
  const promise = this.client.enqueueRequest({
5937
- description: "Create ComponentType",
5890
+ description: "Create asset type",
5938
5891
  method: HttpMethod.POST,
5939
- url: `/projects/${activeProjectId}/component-types/`,
5940
- payload: { ...offlineComponentType },
5892
+ url: `/projects/${activeProjectId}/asset-types/`,
5893
+ payload: { ...offlineAssetType },
5941
5894
  blockers: [],
5942
- blocks: [offlineComponentType.offline_id]
5895
+ blocks: [offlineAssetType.offline_id]
5943
5896
  });
5944
- return [offlineComponentType, promise];
5897
+ return [offlineAssetType, promise];
5945
5898
  }
5946
- update(componentType) {
5947
- this.client.store.dispatch(addComponentType(componentType));
5899
+ update(assetType) {
5900
+ this.client.store.dispatch(addAssetType(assetType));
5948
5901
  return this.client.enqueueRequest({
5949
- description: "Update ComponentType",
5902
+ description: "Update asset type",
5950
5903
  method: HttpMethod.PATCH,
5951
- url: `/components/types/${componentType.offline_id}/`,
5952
- payload: componentType,
5953
- blockers: [componentType.offline_id],
5954
- blocks: [componentType.offline_id]
5904
+ url: `/assets/types/${assetType.offline_id}/`,
5905
+ payload: assetType,
5906
+ blockers: [assetType.offline_id],
5907
+ blocks: [assetType.offline_id]
5955
5908
  });
5956
5909
  }
5957
- async delete(componentTypeId) {
5910
+ async delete(assetTypeId) {
5958
5911
  const { store } = this.client;
5959
5912
  const state = store.getState();
5960
- const componentType = selectComponentType(componentTypeId)(state);
5961
- if (!componentType) {
5962
- throw new Error("Expected componentType to exist");
5963
- }
5964
- const stagesOfComponentType = selectStagesFromComponentType(componentTypeId)(state) ?? [];
5965
- const attachmentsOfComponentType = selectAttachmentsOfComponentType(componentTypeId)(state);
5966
- store.dispatch(deleteComponentType(componentTypeId));
5967
- if (stagesOfComponentType.length > 0) {
5968
- const stagesOfComponentTypeIds = stagesOfComponentType.map(
5969
- (componentTypeStage) => componentTypeStage.offline_id
5970
- );
5971
- store.dispatch(removeStages(stagesOfComponentTypeIds));
5913
+ const assetType = selectAssetType(assetTypeId)(state);
5914
+ if (!assetType) {
5915
+ throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
5916
+ }
5917
+ const stagesOfAssetType = selectStagesOfAssetType(assetTypeId)(state) ?? [];
5918
+ const attachmentsOfAssetType = selectAttachmentsOfAssetType(assetTypeId)(state);
5919
+ store.dispatch(deleteAssetType(assetTypeId));
5920
+ if (stagesOfAssetType.length > 0) {
5921
+ const stagesOfAssetTypeIds = stagesOfAssetType.map((assetStage) => assetStage.offline_id);
5922
+ store.dispatch(removeStages(stagesOfAssetTypeIds));
5972
5923
  }
5973
- if (attachmentsOfComponentType.length > 0) {
5974
- const attachmentsOfComponentTypeIds = attachmentsOfComponentType.map(({ offline_id }) => offline_id);
5975
- store.dispatch(removeComponentTypeAttachments(attachmentsOfComponentTypeIds));
5924
+ if (attachmentsOfAssetType.length > 0) {
5925
+ const attachmentsOfAssetTypeIds = attachmentsOfAssetType.map(({ offline_id }) => offline_id);
5926
+ store.dispatch(removeAssetTypeAttachments(attachmentsOfAssetTypeIds));
5976
5927
  }
5977
5928
  return this.client.enqueueRequest({
5978
- description: "Delete ComponentType",
5929
+ description: "Delete asset type",
5979
5930
  method: HttpMethod.DELETE,
5980
- url: `/components/types/${componentTypeId}/`,
5981
- blockers: [componentTypeId],
5931
+ url: `/assets/types/${assetTypeId}/`,
5932
+ blockers: [assetTypeId],
5982
5933
  blocks: []
5983
5934
  }).catch((e) => {
5984
- store.dispatch(addComponentType(componentType));
5985
- store.dispatch(addStages(stagesOfComponentType));
5986
- store.dispatch(addComponentTypeAttachments(attachmentsOfComponentType));
5935
+ store.dispatch(addAssetType(assetType));
5936
+ store.dispatch(addStages(stagesOfAssetType));
5937
+ store.dispatch(addAssetTypeAttachments(attachmentsOfAssetType));
5987
5938
  throw e;
5988
5939
  });
5989
5940
  }
5990
5941
  async refreshStore() {
5991
5942
  const { store } = this.client;
5992
5943
  const result = await this.client.enqueueRequest({
5993
- description: "Get component types",
5944
+ description: "Get asset types",
5994
5945
  method: HttpMethod.GET,
5995
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-types/`,
5946
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-types/`,
5996
5947
  blockers: [],
5997
5948
  blocks: []
5998
5949
  });
5999
- store.dispatch(setComponentTypes(result));
5950
+ store.dispatch(setAssetTypes(result));
6000
5951
  }
6001
5952
  }
6002
- class ComponentTypeAttachmentService extends BaseAttachmentService {
5953
+ class AssetTypeAttachmentService extends BaseAttachmentService {
6003
5954
  constructor() {
6004
5955
  super(...arguments);
6005
- __publicField(this, "attachmentModel", AttachmentModel.ComponentType);
5956
+ __publicField(this, "attachmentModel", AttachmentModel.AssetType);
6006
5957
  }
6007
5958
  buildOfflineAttachment(data) {
6008
5959
  return offline({
@@ -6013,36 +5964,36 @@ var __publicField = (obj, key, value) => {
6013
5964
  file_type: data.file.type,
6014
5965
  submitted_at: data.submittedAt,
6015
5966
  description: data.description,
6016
- component_type: data.modelId
5967
+ asset_type: data.modelId
6017
5968
  });
6018
5969
  }
6019
- async attachFilesToComponentType(files, componentTypeId) {
5970
+ async attachFilesToAssetType(files, assetTypeId) {
6020
5971
  return this.attachFiles(
6021
5972
  files,
6022
- componentTypeId,
5973
+ assetTypeId,
6023
5974
  this.buildOfflineAttachment.bind(this),
6024
5975
  {
6025
- addAttachments: addComponentTypeAttachments,
6026
- updateAttachments: updateComponentTypeAttachments,
6027
- removeAttachments: removeComponentTypeAttachments
5976
+ addAttachments: addAssetTypeAttachments,
5977
+ updateAttachments: updateAssetTypeAttachments,
5978
+ removeAttachments: removeAssetTypeAttachments
6028
5979
  }
6029
5980
  );
6030
5981
  }
6031
- deleteComponentTypeAttachment(attachmentId) {
5982
+ deleteAssetTypeAttachment(attachmentId) {
6032
5983
  return this.deleteAttachment(
6033
5984
  attachmentId,
6034
5985
  {
6035
- setAttachment: setComponentTypeAttachment,
6036
- removeAttachment: removeComponentTypeAttachment
5986
+ setAttachment: setAssetTypeAttachment,
5987
+ removeAttachment: removeAssetTypeAttachment
6037
5988
  },
6038
5989
  {
6039
- selectAttachment: selectComponentTypeAttachment
5990
+ selectAttachment: selectAssetTypeAttachment
6040
5991
  }
6041
5992
  );
6042
5993
  }
6043
5994
  async refreshStore() {
6044
5995
  return this.getAttachments({
6045
- setAttachments: setComponentTypeAttachments
5996
+ setAttachments: setAssetTypeAttachments
6046
5997
  });
6047
5998
  }
6048
5999
  }
@@ -6540,8 +6491,8 @@ var __publicField = (obj, key, value) => {
6540
6491
  });
6541
6492
  }
6542
6493
  // TODO:
6543
- // Don't accept updateStore in ComponentService.list. Just return the offline objects and promise. Here, if
6544
- // overwrite, use setComponents. Otherwise, use bulkAddComponents.
6494
+ // Don't accept updateStore in AssetService.list. Just return the offline objects and promise. Here, if
6495
+ // overwrite, use setAssets. Otherwise, use bulkAddAssets.
6545
6496
  // TODO: This needs major cleanup. Send less in the initial data: Only the basic project info and anything needed
6546
6497
  // literally immediately.
6547
6498
  async _processInitialData(data, overwrite) {
@@ -6646,10 +6597,10 @@ var __publicField = (obj, key, value) => {
6646
6597
  } finally {
6647
6598
  store.dispatch(setIsFetchingInitialData(false));
6648
6599
  }
6649
- void this.client.componentTypes.refreshStore();
6650
- void this.client.componentStages.refreshStore();
6651
- void this.client.components.refreshStore();
6652
- void this.client.componentStageCompletions.refreshStore();
6600
+ void this.client.assetTypes.refreshStore();
6601
+ void this.client.assetStages.refreshStore();
6602
+ void this.client.assets.refreshStore();
6603
+ void this.client.assetStageCompletions.refreshStore();
6653
6604
  void this.client.categories.refreshStore();
6654
6605
  void this.client.issueTypes.refreshStore();
6655
6606
  void this.client.issues.refreshStore();
@@ -6664,8 +6615,8 @@ var __publicField = (obj, key, value) => {
6664
6615
  void this.client.issueUpdates.refreshStore();
6665
6616
  void this.client.projectAccesses.refreshStore();
6666
6617
  void this.client.projectAttachments.refreshStore();
6667
- void this.client.componentTypeAttachments.refreshStore();
6668
- void this.client.componentAttachments.refreshStore();
6618
+ void this.client.assetTypeAttachments.refreshStore();
6619
+ void this.client.assetAttachments.refreshStore();
6669
6620
  }
6670
6621
  void this.client.teams.refreshStore();
6671
6622
  }
@@ -7061,7 +7012,7 @@ var __publicField = (obj, key, value) => {
7061
7012
  });
7062
7013
  });
7063
7014
  }
7064
- async add(state, initialRevision, url, ownerUser, ownerOrganization, componentTypeId, issueTypeId) {
7015
+ async add(state, initialRevision, url, ownerUser, ownerOrganization, assetTypeId, issueTypeId) {
7065
7016
  if (!!ownerUser === !!ownerOrganization) {
7066
7017
  throw new Error("Exactly one of ownerUser and ownerOrganization must be defined.");
7067
7018
  }
@@ -7080,7 +7031,7 @@ var __publicField = (obj, key, value) => {
7080
7031
  favorite: true,
7081
7032
  submitted_at: submittedAt,
7082
7033
  created_by: currentUser.id,
7083
- ...componentTypeId && { component_type: componentTypeId },
7034
+ ...assetTypeId && { asset_type: assetTypeId },
7084
7035
  ...issueTypeId && { issue_type: issueTypeId },
7085
7036
  ...ownerAttrs
7086
7037
  };
@@ -7104,11 +7055,11 @@ var __publicField = (obj, key, value) => {
7104
7055
  } : void 0,
7105
7056
  payload: {
7106
7057
  ...offlineFormPayload,
7107
- ...componentTypeId && { component_type: componentTypeId },
7058
+ ...assetTypeId && { asset_type: assetTypeId },
7108
7059
  ...issueTypeId && { issue_type: issueTypeId },
7109
7060
  initial_revision: payloadWithoutImage
7110
7061
  },
7111
- blockers: componentTypeId ? [componentTypeId] : issueTypeId ? [issueTypeId] : [],
7062
+ blockers: assetTypeId ? [assetTypeId] : issueTypeId ? [issueTypeId] : [],
7112
7063
  blocks: [offlineFormPayload.offline_id, payloadWithoutImage.offline_id]
7113
7064
  });
7114
7065
  const attachImagesPromises = this.getAttachImagePromises(images, offlineRevisionPayload.offline_id);
@@ -7132,7 +7083,7 @@ var __publicField = (obj, key, value) => {
7132
7083
  `/forms/in-organization/${activeOrganizationId}/`,
7133
7084
  void 0,
7134
7085
  activeOrganizationId,
7135
- attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
7086
+ attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
7136
7087
  attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
7137
7088
  );
7138
7089
  }
@@ -7145,7 +7096,7 @@ var __publicField = (obj, key, value) => {
7145
7096
  "/forms/my-forms/",
7146
7097
  currentUser.id,
7147
7098
  void 0,
7148
- attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
7099
+ attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
7149
7100
  attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
7150
7101
  );
7151
7102
  }
@@ -7313,8 +7264,8 @@ var __publicField = (obj, key, value) => {
7313
7264
  url: `/forms/submission/${submission.offline_id}/attachments/`,
7314
7265
  payload: submissionAttachmentPayload,
7315
7266
  blockers: [
7316
- submission.component,
7317
- submission.component_stage,
7267
+ submission.asset,
7268
+ submission.asset_stage,
7318
7269
  submission.issue,
7319
7270
  submission.form_revision
7320
7271
  ].filter((x) => x !== void 0),
@@ -7350,7 +7301,7 @@ var __publicField = (obj, key, value) => {
7350
7301
  method: HttpMethod.POST,
7351
7302
  url: `/forms/revisions/${payload.form_revision}/respond/`,
7352
7303
  payload: { ...offlineSubmission, project: activeProjectId },
7353
- blockers: [payload.issue, payload.component, payload.component_stage, "add-form-entry"].filter(
7304
+ blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
7354
7305
  (x) => x !== void 0
7355
7306
  ),
7356
7307
  blocks: [payload.offline_id]
@@ -7368,10 +7319,10 @@ var __publicField = (obj, key, value) => {
7368
7319
  const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
7369
7320
  return [offlineSubmission, settledPromise];
7370
7321
  }
7371
- // Note currently the bulkAdd method is specific to form submissions for components
7322
+ // Note currently the bulkAdd method is specific to form submissions for assets
7372
7323
  // TODO: adapt the support bulk adding to any model type
7373
7324
  async bulkAdd(args) {
7374
- const { formRevision, values: argsValues, componentOfflineIds } = args;
7325
+ const { formRevision, values: argsValues, assetOfflineIds } = args;
7375
7326
  const { store } = this.client;
7376
7327
  const offlineSubmissions = [];
7377
7328
  const offlineAttachments = [];
@@ -7381,16 +7332,16 @@ var __publicField = (obj, key, value) => {
7381
7332
  const { values, files } = separateFilesFromValues(argsValues);
7382
7333
  const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
7383
7334
  const createdBy = store.getState().userReducer.currentUser.id;
7384
- for (const component_id of componentOfflineIds) {
7335
+ for (const assetId of assetOfflineIds) {
7385
7336
  const submission = offline({
7386
7337
  form_revision: formRevision,
7387
7338
  values,
7388
7339
  created_by: createdBy,
7389
7340
  submitted_at: submittedAt,
7390
- component: component_id
7341
+ asset: assetId
7391
7342
  });
7392
7343
  submissionOfflineIds.push(submission.offline_id);
7393
- submissionsPayload.push({ offline_id: submission.offline_id, component_id });
7344
+ submissionsPayload.push({ offline_id: submission.offline_id, asset_id: assetId });
7394
7345
  offlineSubmissions.push(submission);
7395
7346
  for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
7396
7347
  for (const file of fileArray) {
@@ -7437,7 +7388,7 @@ var __publicField = (obj, key, value) => {
7437
7388
  attachments: attachmentsPayload,
7438
7389
  files: Object.values(filesRecord)
7439
7390
  },
7440
- blockers: componentOfflineIds,
7391
+ blockers: assetOfflineIds,
7441
7392
  blocks: submissionOfflineIds
7442
7393
  });
7443
7394
  promise.then(({ submissions, attachments, presigned_urls }) => {
@@ -7480,7 +7431,7 @@ var __publicField = (obj, key, value) => {
7480
7431
  method: HttpMethod.PATCH,
7481
7432
  url: `/forms/submissions/${submission.offline_id}/`,
7482
7433
  payload: offlineSubmission,
7483
- blockers: [offlineSubmission.issue, offlineSubmission.component, offlineSubmission.component_stage].filter(
7434
+ blockers: [offlineSubmission.issue, offlineSubmission.asset, offlineSubmission.asset_stage].filter(
7484
7435
  (x) => x !== void 0
7485
7436
  ),
7486
7437
  blocks: [offlineSubmission.offline_id]
@@ -8327,16 +8278,13 @@ var __publicField = (obj, key, value) => {
8327
8278
  queryParams: { conversation_id: conversationId }
8328
8279
  }).then((response) => {
8329
8280
  const conversation = store.getState().agentsReducer.conversations[conversationId];
8330
- if (!(conversation == null ? void 0 : conversation.offline_id)) {
8281
+ if (!conversation) {
8331
8282
  throw new Error("Conversation not found");
8332
8283
  }
8333
- if (!Array.isArray(response)) {
8334
- response = [response];
8335
- }
8336
8284
  store.dispatch(
8337
8285
  updateConversation({
8338
- ...conversation,
8339
- tiptap_content: [...conversation.tiptap_content || [], ...response]
8286
+ offline_id: conversationId,
8287
+ tiptap_content: [...conversation.tiptap_content || [], response.response]
8340
8288
  })
8341
8289
  );
8342
8290
  });
@@ -8569,12 +8517,12 @@ var __publicField = (obj, key, value) => {
8569
8517
  __publicField(this, "issueAttachments", new IssueAttachmentService(this));
8570
8518
  __publicField(this, "workspaces", new WorkspaceService(this));
8571
8519
  __publicField(this, "main", new MainService(this));
8572
- __publicField(this, "components", new ComponentService(this));
8573
- __publicField(this, "componentAttachments", new ComponentAttachmentService(this));
8574
- __publicField(this, "componentTypes", new ComponentTypeService(this));
8575
- __publicField(this, "componentTypeAttachments", new ComponentTypeAttachmentService(this));
8576
- __publicField(this, "componentStages", new ComponentStageService(this));
8577
- __publicField(this, "componentStageCompletions", new ComponentStageCompletionService(this));
8520
+ __publicField(this, "assets", new AssetService(this));
8521
+ __publicField(this, "assetAttachments", new AssetAttachmentService(this));
8522
+ __publicField(this, "assetTypes", new AssetTypeService(this));
8523
+ __publicField(this, "assetTypeAttachments", new AssetTypeAttachmentService(this));
8524
+ __publicField(this, "assetStages", new AssetStageService(this));
8525
+ __publicField(this, "assetStageCompletions", new AssetStageCompletionService(this));
8578
8526
  __publicField(this, "userForms", new UserFormService(this));
8579
8527
  __publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
8580
8528
  __publicField(this, "projects", new ProjectService(this));
@@ -15286,9 +15234,9 @@ var __publicField = (obj, key, value) => {
15286
15234
  }, [filter, maxResults, ownerFilter]);
15287
15235
  const userForms = useAppSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
15288
15236
  const userFormMapping = useAppSelector(selectFormMapping);
15289
- const attachableUserForms = userForms.filter((form) => !form.component_type && !form.issue_type);
15237
+ const attachableUserForms = userForms.filter((form) => !form.asset_type && !form.issue_type);
15290
15238
  const attachableUserFormMapping = Object.values(userFormMapping).filter(
15291
- (form) => !form.component_type
15239
+ (form) => !form.asset_type
15292
15240
  );
15293
15241
  const handleToggleFavorite = React.useCallback(
15294
15242
  (form) => {
@@ -15720,7 +15668,7 @@ var __publicField = (obj, key, value) => {
15720
15668
  const formId = "form-builder";
15721
15669
  const fieldsToChoose = [
15722
15670
  ["string", "text"],
15723
- ["select", "multi-select", "upload"],
15671
+ ["select", "multi-select", "upload", "qr"],
15724
15672
  ["boolean", "date", "number", "multi-string"]
15725
15673
  ];
15726
15674
  const CompleteFieldTypeToClsMapping = {
@@ -16692,6 +16640,13 @@ var __publicField = (obj, key, value) => {
16692
16640
  }, Symbol.toStringTag, { value: "Module" }));
16693
16641
  exports2.APIError = APIError;
16694
16642
  exports2.AgentService = AgentService;
16643
+ exports2.AssetAttachmentService = AssetAttachmentService;
16644
+ exports2.AssetService = AssetService;
16645
+ exports2.AssetStageColors = AssetStageColors;
16646
+ exports2.AssetStageCompletionService = AssetStageCompletionService;
16647
+ exports2.AssetStageService = AssetStageService;
16648
+ exports2.AssetTypeAttachmentService = AssetTypeAttachmentService;
16649
+ exports2.AssetTypeService = AssetTypeService;
16695
16650
  exports2.AttachmentModel = AttachmentModel;
16696
16651
  exports2.AuthService = AuthService;
16697
16652
  exports2.BaseApiService = BaseApiService;
@@ -16703,13 +16658,6 @@ var __publicField = (obj, key, value) => {
16703
16658
  exports2.ColorPicker = ColorPicker;
16704
16659
  exports2.Colors = Colors;
16705
16660
  exports2.ColorsToString = ColorsToString;
16706
- exports2.ComponentAttachmentService = ComponentAttachmentService;
16707
- exports2.ComponentService = ComponentService;
16708
- exports2.ComponentStageColors = ComponentStageColors;
16709
- exports2.ComponentStageCompletionService = ComponentStageCompletionService;
16710
- exports2.ComponentStageService = ComponentStageService;
16711
- exports2.ComponentTypeAttachmentService = ComponentTypeAttachmentService;
16712
- exports2.ComponentTypeService = ComponentTypeService;
16713
16661
  exports2.DEFAULT_ISSUE_PRIORITY = DEFAULT_ISSUE_PRIORITY;
16714
16662
  exports2.DEFAULT_ISSUE_STATUS = DEFAULT_ISSUE_STATUS;
16715
16663
  exports2.DateField = DateField;
@@ -16801,14 +16749,14 @@ var __publicField = (obj, key, value) => {
16801
16749
  exports2.acceptProjectInvite = acceptProjectInvite;
16802
16750
  exports2.addActiveProjectFormSubmissionsCount = addActiveProjectFormSubmissionsCount;
16803
16751
  exports2.addActiveProjectIssuesCount = addActiveProjectIssuesCount;
16752
+ exports2.addAsset = addAsset;
16753
+ exports2.addAssetAttachment = addAssetAttachment;
16754
+ exports2.addAssetAttachments = addAssetAttachments;
16755
+ exports2.addAssetType = addAssetType;
16756
+ exports2.addAssetTypeAttachment = addAssetTypeAttachment;
16757
+ exports2.addAssetTypeAttachments = addAssetTypeAttachments;
16758
+ exports2.addAssetsInBatches = addAssetsInBatches;
16804
16759
  exports2.addCategory = addCategory;
16805
- exports2.addComponent = addComponent;
16806
- exports2.addComponentAttachment = addComponentAttachment;
16807
- exports2.addComponentAttachments = addComponentAttachments;
16808
- exports2.addComponentType = addComponentType;
16809
- exports2.addComponentTypeAttachment = addComponentTypeAttachment;
16810
- exports2.addComponentTypeAttachments = addComponentTypeAttachments;
16811
- exports2.addComponentsInBatches = addComponentsInBatches;
16812
16760
  exports2.addConversation = addConversation;
16813
16761
  exports2.addDocumentAttachment = addDocumentAttachment;
16814
16762
  exports2.addDocumentAttachments = addDocumentAttachments;
@@ -16853,6 +16801,14 @@ var __publicField = (obj, key, value) => {
16853
16801
  exports2.agentsReducer = agentsReducer;
16854
16802
  exports2.agentsSlice = agentsSlice;
16855
16803
  exports2.areArraysEqual = areArraysEqual;
16804
+ exports2.assetReducer = assetReducer;
16805
+ exports2.assetSlice = assetSlice;
16806
+ exports2.assetStageCompletionReducer = assetStageCompletionReducer;
16807
+ exports2.assetStageCompletionSlice = assetStageCompletionSlice;
16808
+ exports2.assetStageReducer = assetStageReducer;
16809
+ exports2.assetStageSlice = assetStageSlice;
16810
+ exports2.assetTypeReducer = assetTypeReducer;
16811
+ exports2.assetTypeSlice = assetTypeSlice;
16856
16812
  exports2.authReducer = authReducer;
16857
16813
  exports2.authSlice = authSlice;
16858
16814
  exports2.blobToBase64 = blobToBase64;
@@ -16862,14 +16818,6 @@ var __publicField = (obj, key, value) => {
16862
16818
  exports2.classNames = classNames$1;
16863
16819
  exports2.cleanRecentIssues = cleanRecentIssues;
16864
16820
  exports2.clearTokens = clearTokens;
16865
- exports2.componentReducer = componentReducer;
16866
- exports2.componentSlice = componentSlice;
16867
- exports2.componentStageCompletionReducer = componentStageCompletionReducer;
16868
- exports2.componentStageCompletionSlice = componentStageCompletionSlice;
16869
- exports2.componentStageReducer = componentStageReducer;
16870
- exports2.componentStageSlice = componentStageSlice;
16871
- exports2.componentTypeReducer = componentTypeReducer;
16872
- exports2.componentTypeSlice = componentTypeSlice;
16873
16821
  exports2.constructUploadedFilePayloads = constructUploadedFilePayloads;
16874
16822
  exports2.coordinatesAreEqual = coordinatesAreEqual;
16875
16823
  exports2.coordinatesToLiteral = coordinatesToLiteral;
@@ -16880,7 +16828,7 @@ var __publicField = (obj, key, value) => {
16880
16828
  exports2.createPointMarker = createPointMarker;
16881
16829
  exports2.defaultBadgeColor = defaultBadgeColor;
16882
16830
  exports2.defaultStore = defaultStore;
16883
- exports2.deleteComponentType = deleteComponentType;
16831
+ exports2.deleteAssetType = deleteAssetType;
16884
16832
  exports2.deleteForm = deleteForm;
16885
16833
  exports2.deleteFormRevision = deleteFormRevision;
16886
16834
  exports2.deleteFormRevisionAttachment = deleteFormRevisionAttachment;
@@ -16929,7 +16877,7 @@ var __publicField = (obj, key, value) => {
16929
16877
  exports2.formSubmissionReducer = formSubmissionReducer;
16930
16878
  exports2.formSubmissionSlice = formSubmissionSlice;
16931
16879
  exports2.forms = index;
16932
- exports2.fullComponentMarkerSize = fullComponentMarkerSize;
16880
+ exports2.fullAssetMarkerSize = fullAssetMarkerSize;
16933
16881
  exports2.generateBadgeColors = generateBadgeColors;
16934
16882
  exports2.genericMemo = genericMemo;
16935
16883
  exports2.getFileIdentifier = getFileIdentifier;
@@ -16990,15 +16938,15 @@ var __publicField = (obj, key, value) => {
16990
16938
  exports2.projectSlice = projectSlice;
16991
16939
  exports2.rehydratedReducer = rehydratedReducer;
16992
16940
  exports2.rehydratedSlice = rehydratedSlice;
16993
- exports2.removeAllComponentsOfType = removeAllComponentsOfType;
16941
+ exports2.removeAllAssetsOfType = removeAllAssetsOfType;
16942
+ exports2.removeAsset = removeAsset;
16943
+ exports2.removeAssetAttachment = removeAssetAttachment;
16944
+ exports2.removeAssetAttachments = removeAssetAttachments;
16945
+ exports2.removeAssetTypeAttachment = removeAssetTypeAttachment;
16946
+ exports2.removeAssetTypeAttachments = removeAssetTypeAttachments;
16994
16947
  exports2.removeAttachmentsOfIssue = removeAttachmentsOfIssue;
16995
16948
  exports2.removeCategory = removeCategory;
16996
16949
  exports2.removeColor = removeColor;
16997
- exports2.removeComponent = removeComponent;
16998
- exports2.removeComponentAttachment = removeComponentAttachment;
16999
- exports2.removeComponentAttachments = removeComponentAttachments;
17000
- exports2.removeComponentTypeAttachment = removeComponentTypeAttachment;
17001
- exports2.removeComponentTypeAttachments = removeComponentTypeAttachments;
17002
16950
  exports2.removeDocumentAttachment = removeDocumentAttachment;
17003
16951
  exports2.removeDocumentAttachments = removeDocumentAttachments;
17004
16952
  exports2.removeDocuments = removeDocuments;
@@ -17049,16 +16997,31 @@ var __publicField = (obj, key, value) => {
17049
16997
  exports2.selectActiveWorkspace = selectActiveWorkspace;
17050
16998
  exports2.selectActiveWorkspaceId = selectActiveWorkspaceId;
17051
16999
  exports2.selectAllAttachments = selectAllAttachments;
17052
- exports2.selectAllComponentAttachments = selectAllComponentAttachments;
17053
- exports2.selectAllComponentTypeAttachments = selectAllComponentTypeAttachments;
17054
17000
  exports2.selectAllDocumentAttachments = selectAllDocumentAttachments;
17055
17001
  exports2.selectAllProjectAttachments = selectAllProjectAttachments;
17056
17002
  exports2.selectAncestorIdsOfDocument = selectAncestorIdsOfDocument;
17057
17003
  exports2.selectAppearance = selectAppearance;
17058
- exports2.selectAttachmentsOfComponent = selectAttachmentsOfComponent;
17059
- exports2.selectAttachmentsOfComponentByType = selectAttachmentsOfComponentByType;
17060
- exports2.selectAttachmentsOfComponentType = selectAttachmentsOfComponentType;
17061
- exports2.selectAttachmentsOfComponentTypeByType = selectAttachmentsOfComponentTypeByType;
17004
+ exports2.selectAsset = selectAsset;
17005
+ exports2.selectAssetAttachment = selectAssetAttachment;
17006
+ exports2.selectAssetAttachmentMapping = selectAssetAttachmentMapping;
17007
+ exports2.selectAssetAttachments = selectAssetAttachments;
17008
+ exports2.selectAssetToAssetTypeMapping = selectAssetToAssetTypeMapping;
17009
+ exports2.selectAssetType = selectAssetType;
17010
+ exports2.selectAssetTypeAttachment = selectAssetTypeAttachment;
17011
+ exports2.selectAssetTypeAttachmentMapping = selectAssetTypeAttachmentMapping;
17012
+ exports2.selectAssetTypeAttachments = selectAssetTypeAttachments;
17013
+ exports2.selectAssetTypeStagesMapping = selectAssetTypeStagesMapping;
17014
+ exports2.selectAssetTypes = selectAssetTypes;
17015
+ exports2.selectAssetTypesByName = selectAssetTypesByName;
17016
+ exports2.selectAssetTypesFromIds = selectAssetTypesFromIds;
17017
+ exports2.selectAssetTypesMapping = selectAssetTypesMapping;
17018
+ exports2.selectAssets = selectAssets;
17019
+ exports2.selectAssetsMapping = selectAssetsMapping;
17020
+ exports2.selectAssetsOfAssetType = selectAssetsOfAssetType;
17021
+ exports2.selectAttachmentsOfAsset = selectAttachmentsOfAsset;
17022
+ exports2.selectAttachmentsOfAssetByType = selectAttachmentsOfAssetByType;
17023
+ exports2.selectAttachmentsOfAssetType = selectAttachmentsOfAssetType;
17024
+ exports2.selectAttachmentsOfAssetTypeByType = selectAttachmentsOfAssetTypeByType;
17062
17025
  exports2.selectAttachmentsOfDocument = selectAttachmentsOfDocument;
17063
17026
  exports2.selectAttachmentsOfDocumentByType = selectAttachmentsOfDocumentByType;
17064
17027
  exports2.selectAttachmentsOfFormRevision = selectAttachmentsOfFormRevision;
@@ -17075,25 +17038,8 @@ var __publicField = (obj, key, value) => {
17075
17038
  exports2.selectCenterMapToProject = selectCenterMapToProject;
17076
17039
  exports2.selectCommentMapping = selectCommentMapping;
17077
17040
  exports2.selectCommentsOfIssue = selectCommentsOfIssue;
17078
- exports2.selectCompletedStageIdsForComponent = selectCompletedStageIdsForComponent;
17041
+ exports2.selectCompletedStageIdsForAsset = selectCompletedStageIdsForAsset;
17079
17042
  exports2.selectCompletedStages = selectCompletedStages;
17080
- exports2.selectComponent = selectComponent;
17081
- exports2.selectComponentAttachment = selectComponentAttachment;
17082
- exports2.selectComponentAttachmentMapping = selectComponentAttachmentMapping;
17083
- exports2.selectComponentType = selectComponentType;
17084
- exports2.selectComponentTypeAttachment = selectComponentTypeAttachment;
17085
- exports2.selectComponentTypeAttachmentMapping = selectComponentTypeAttachmentMapping;
17086
- exports2.selectComponentTypeFromComponent = selectComponentTypeFromComponent;
17087
- exports2.selectComponentTypeFromComponents = selectComponentTypeFromComponents;
17088
- exports2.selectComponentTypeStagesMapping = selectComponentTypeStagesMapping;
17089
- exports2.selectComponentTypes = selectComponentTypes;
17090
- exports2.selectComponentTypesByName = selectComponentTypesByName;
17091
- exports2.selectComponentTypesFromIds = selectComponentTypesFromIds;
17092
- exports2.selectComponentTypesMapping = selectComponentTypesMapping;
17093
- exports2.selectComponents = selectComponents;
17094
- exports2.selectComponentsByType = selectComponentsByType;
17095
- exports2.selectComponentsFromComponentType = selectComponentsFromComponentType;
17096
- exports2.selectComponentsMapping = selectComponentsMapping;
17097
17043
  exports2.selectConversation = selectConversation;
17098
17044
  exports2.selectConversationMapping = selectConversationMapping;
17099
17045
  exports2.selectConversations = selectConversations;
@@ -17118,7 +17064,7 @@ var __publicField = (obj, key, value) => {
17118
17064
  exports2.selectFilteredForms = selectFilteredForms;
17119
17065
  exports2.selectForm = selectForm;
17120
17066
  exports2.selectFormMapping = selectFormMapping;
17121
- exports2.selectFormOfComponentType = selectFormOfComponentType;
17067
+ exports2.selectFormOfAssetType = selectFormOfAssetType;
17122
17068
  exports2.selectFormOfIssueType = selectFormOfIssueType;
17123
17069
  exports2.selectFormRevision = selectFormRevision;
17124
17070
  exports2.selectFormRevisionMapping = selectFormRevisionMapping;
@@ -17127,16 +17073,16 @@ var __publicField = (obj, key, value) => {
17127
17073
  exports2.selectFormSubmission = selectFormSubmission;
17128
17074
  exports2.selectFormSubmissionAttachmentsMapping = selectFormSubmissionAttachmentsMapping;
17129
17075
  exports2.selectFormSubmissions = selectFormSubmissions;
17130
- exports2.selectFormSubmissionsByComponents = selectFormSubmissionsByComponents;
17076
+ exports2.selectFormSubmissionsByAssets = selectFormSubmissionsByAssets;
17131
17077
  exports2.selectFormSubmissionsByFormRevisions = selectFormSubmissionsByFormRevisions;
17132
17078
  exports2.selectFormSubmissionsMapping = selectFormSubmissionsMapping;
17133
- exports2.selectFormSubmissionsOfComponent = selectFormSubmissionsOfComponent;
17079
+ exports2.selectFormSubmissionsOfAsset = selectFormSubmissionsOfAsset;
17134
17080
  exports2.selectFormSubmissionsOfForm = selectFormSubmissionsOfForm;
17135
17081
  exports2.selectFormSubmissionsOfIssue = selectFormSubmissionsOfIssue;
17136
17082
  exports2.selectFormsCount = selectFormsCount;
17137
17083
  exports2.selectGeneralFormCount = selectGeneralFormCount;
17084
+ exports2.selectHiddenAssetTypeIds = selectHiddenAssetTypeIds;
17138
17085
  exports2.selectHiddenCategoryCount = selectHiddenCategoryCount;
17139
- exports2.selectHiddenComponentTypeIds = selectHiddenComponentTypeIds;
17140
17086
  exports2.selectIsFetchingInitialData = selectIsFetchingInitialData;
17141
17087
  exports2.selectIsImportingProjectFile = selectIsImportingProjectFile;
17142
17088
  exports2.selectIsLoading = selectIsLoading;
@@ -17158,7 +17104,7 @@ var __publicField = (obj, key, value) => {
17158
17104
  exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
17159
17105
  exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
17160
17106
  exports2.selectLatestFormRevisionOfForm = selectLatestFormRevisionOfForm;
17161
- exports2.selectLatestFormRevisionsOfComponentTypes = selectLatestFormRevisionsOfComponentTypes;
17107
+ exports2.selectLatestFormRevisionsOfAssetTypes = selectLatestFormRevisionsOfAssetTypes;
17162
17108
  exports2.selectLatestRetryTime = selectLatestRetryTime;
17163
17109
  exports2.selectLicense = selectLicense;
17164
17110
  exports2.selectLicenseForProject = selectLicenseForProject;
@@ -17166,8 +17112,8 @@ var __publicField = (obj, key, value) => {
17166
17112
  exports2.selectLicensesForProjectsMapping = selectLicensesForProjectsMapping;
17167
17113
  exports2.selectMainWorkspace = selectMainWorkspace;
17168
17114
  exports2.selectMapStyle = selectMapStyle;
17169
- exports2.selectNumberOfComponentTypesMatchingCaseInsensitiveName = selectNumberOfComponentTypesMatchingCaseInsensitiveName;
17170
- exports2.selectNumberOfComponentsOfComponentType = selectNumberOfComponentsOfComponentType;
17115
+ exports2.selectNumberOfAssetTypesMatchingCaseInsensitiveName = selectNumberOfAssetTypesMatchingCaseInsensitiveName;
17116
+ exports2.selectNumberOfAssetsOfAssetType = selectNumberOfAssetsOfAssetType;
17171
17117
  exports2.selectOrganization = selectOrganization;
17172
17118
  exports2.selectOrganizationAccess = selectOrganizationAccess;
17173
17119
  exports2.selectOrganizationAccessForUser = selectOrganizationAccessForUser;
@@ -17208,9 +17154,9 @@ var __publicField = (obj, key, value) => {
17208
17154
  exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
17209
17155
  exports2.selectStageMapping = selectStageMapping;
17210
17156
  exports2.selectStages = selectStages;
17211
- exports2.selectStagesFromComponentType = selectStagesFromComponentType;
17212
- exports2.selectStagesFromComponentTypeIds = selectStagesFromComponentTypeIds;
17157
+ exports2.selectStagesFromAssetTypeIds = selectStagesFromAssetTypeIds;
17213
17158
  exports2.selectStagesFromStageIds = selectStagesFromStageIds;
17159
+ exports2.selectStagesOfAssetType = selectStagesOfAssetType;
17214
17160
  exports2.selectTeam = selectTeam;
17215
17161
  exports2.selectTeams = selectTeams;
17216
17162
  exports2.selectTeamsMapping = selectTeamsMapping;
@@ -17232,14 +17178,14 @@ var __publicField = (obj, key, value) => {
17232
17178
  exports2.setActiveProjectId = setActiveProjectId;
17233
17179
  exports2.setActiveWorkspaceId = setActiveWorkspaceId;
17234
17180
  exports2.setAppearance = setAppearance;
17181
+ exports2.setAssetAttachment = setAssetAttachment;
17182
+ exports2.setAssetAttachments = setAssetAttachments;
17183
+ exports2.setAssetTypeAttachment = setAssetTypeAttachment;
17184
+ exports2.setAssetTypeAttachments = setAssetTypeAttachments;
17185
+ exports2.setAssetTypes = setAssetTypes;
17186
+ exports2.setAssets = setAssets;
17235
17187
  exports2.setCategories = setCategories;
17236
17188
  exports2.setCenterMapToProject = setCenterMapToProject;
17237
- exports2.setComponentAttachment = setComponentAttachment;
17238
- exports2.setComponentAttachments = setComponentAttachments;
17239
- exports2.setComponentTypeAttachment = setComponentTypeAttachment;
17240
- exports2.setComponentTypeAttachments = setComponentTypeAttachments;
17241
- exports2.setComponentTypes = setComponentTypes;
17242
- exports2.setComponents = setComponents;
17243
17189
  exports2.setConversation = setConversation;
17244
17190
  exports2.setConversations = setConversations;
17245
17191
  exports2.setCreateProjectType = setCreateProjectType;
@@ -17302,18 +17248,18 @@ var __publicField = (obj, key, value) => {
17302
17248
  exports2.teamSlice = teamSlice;
17303
17249
  exports2.toFileNameSafeString = toFileNameSafeString;
17304
17250
  exports2.toOfflineIdRecord = toOfflineIdRecord;
17305
- exports2.toggleComponentTypeVisibility = toggleComponentTypeVisibility;
17251
+ exports2.toggleAssetTypeVisibility = toggleAssetTypeVisibility;
17306
17252
  exports2.truncate = truncate;
17307
17253
  exports2.unfavoriteForm = unfavoriteForm;
17308
17254
  exports2.unhideAllCategories = unhideAllCategories;
17309
17255
  exports2.unhideCategory = unhideCategory;
17310
17256
  exports2.unlinkStageToForm = unlinkStageToForm;
17311
17257
  exports2.updateActiveOrganization = updateActiveOrganization;
17312
- exports2.updateComponent = updateComponent;
17313
- exports2.updateComponentAttachment = updateComponentAttachment;
17314
- exports2.updateComponentAttachments = updateComponentAttachments;
17315
- exports2.updateComponentTypeAttachment = updateComponentTypeAttachment;
17316
- exports2.updateComponentTypeAttachments = updateComponentTypeAttachments;
17258
+ exports2.updateAsset = updateAsset;
17259
+ exports2.updateAssetAttachment = updateAssetAttachment;
17260
+ exports2.updateAssetAttachments = updateAssetAttachments;
17261
+ exports2.updateAssetTypeAttachment = updateAssetTypeAttachment;
17262
+ exports2.updateAssetTypeAttachments = updateAssetTypeAttachments;
17317
17263
  exports2.updateConversation = updateConversation;
17318
17264
  exports2.updateDocumentAttachment = updateDocumentAttachment;
17319
17265
  exports2.updateDocumentAttachments = updateDocumentAttachments;