@overmap-ai/core 1.0.53-issue-types.0 → 1.0.53-team-links.1

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.
@@ -678,15 +678,15 @@ const wrapMigration = (migrator) => (state) => {
678
678
  };
679
679
  const migrations = [initialVersioning, signOut, signOut, createOutboxState];
680
680
  const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
681
- const initialState$r = {
681
+ const initialState$u = {
682
682
  accessToken: "",
683
683
  refreshToken: "",
684
684
  isLoggedIn: false
685
685
  };
686
686
  const authSlice = createSlice({
687
687
  name: "auth",
688
- initialState: initialState$r,
689
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
688
+ initialState: initialState$u,
689
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
690
690
  reducers: {
691
691
  setTokens: (state, action) => {
692
692
  state.accessToken = action.payload.accessToken;
@@ -1430,7 +1430,7 @@ const getLocalRelativeDateString = memoize((date, min, max) => {
1430
1430
  return getLocalDateString(date);
1431
1431
  return relative.format(days, "days");
1432
1432
  });
1433
- const initialState$q = {
1433
+ const initialState$t = {
1434
1434
  categories: {},
1435
1435
  usedCategoryColors: [],
1436
1436
  categoryVisibility: {
@@ -1440,8 +1440,8 @@ const initialState$q = {
1440
1440
  };
1441
1441
  const categorySlice = createSlice({
1442
1442
  name: "categories",
1443
- initialState: initialState$q,
1444
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1443
+ initialState: initialState$t,
1444
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$t)),
1445
1445
  reducers: {
1446
1446
  setCategories: (state, action) => {
1447
1447
  if (!Array.isArray(action.payload))
@@ -1613,14 +1613,14 @@ function removeAttachments(state, action) {
1613
1613
  delete state.attachments[attachmentId];
1614
1614
  }
1615
1615
  }
1616
- const initialState$p = {
1616
+ const initialState$s = {
1617
1617
  components: {},
1618
1618
  attachments: {}
1619
1619
  };
1620
1620
  const componentSlice = createSlice({
1621
1621
  name: "components",
1622
- initialState: initialState$p,
1623
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1622
+ initialState: initialState$s,
1623
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
1624
1624
  reducers: {
1625
1625
  addComponent: (state, action) => {
1626
1626
  state.components[action.payload.offline_id] = action.payload;
@@ -1776,13 +1776,13 @@ const {
1776
1776
  removeAllComponentsOfType
1777
1777
  } = componentSlice.actions;
1778
1778
  const componentReducer = componentSlice.reducer;
1779
- const initialState$o = {
1779
+ const initialState$r = {
1780
1780
  completionsByComponentId: {}
1781
1781
  };
1782
1782
  const componentStageCompletionSlice = createSlice({
1783
1783
  name: "componentStageCompletions",
1784
- initialState: initialState$o,
1785
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1784
+ initialState: initialState$r,
1785
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
1786
1786
  reducers: {
1787
1787
  addStageCompletion: (state, action) => {
1788
1788
  let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
@@ -1833,13 +1833,13 @@ const selectCompletedStageIdsForComponent = (component) => (state) => {
1833
1833
  return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1834
1834
  };
1835
1835
  const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1836
- const initialState$n = {
1836
+ const initialState$q = {
1837
1837
  stages: {}
1838
1838
  };
1839
1839
  const componentStageSlice = createSlice({
1840
1840
  name: "componentStages",
1841
- initialState: initialState$n,
1842
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1841
+ initialState: initialState$q,
1842
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1843
1843
  reducers: {
1844
1844
  addStages: (state, action) => {
1845
1845
  Object.assign(state.stages, toOfflineIdRecord(action.payload));
@@ -1949,15 +1949,15 @@ const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
1949
1949
  );
1950
1950
  const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
1951
1951
  const componentStageReducer = componentStageSlice.reducer;
1952
- const initialState$m = {
1952
+ const initialState$p = {
1953
1953
  componentTypes: {},
1954
1954
  hiddenComponentTypeIds: {},
1955
1955
  attachments: {}
1956
1956
  };
1957
1957
  const componentTypeSlice = createSlice({
1958
1958
  name: "componentTypes",
1959
- initialState: initialState$m,
1960
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
1959
+ initialState: initialState$p,
1960
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1961
1961
  reducers: {
1962
1962
  addComponentType: (state, action) => {
1963
1963
  state.componentTypes[action.payload.offline_id] = action.payload;
@@ -2068,13 +2068,13 @@ const {
2068
2068
  deleteComponentType
2069
2069
  } = componentTypeSlice.actions;
2070
2070
  const componentTypeReducer = componentTypeSlice.reducer;
2071
- const initialState$l = {
2071
+ const initialState$o = {
2072
2072
  workspaces: {},
2073
2073
  activeWorkspaceId: null
2074
2074
  };
2075
2075
  const workspaceSlice = createSlice({
2076
2076
  name: "workspace",
2077
- initialState: initialState$l,
2077
+ initialState: initialState$o,
2078
2078
  // The `reducers` field lets us define reducers and generate associated actions
2079
2079
  reducers: {
2080
2080
  setWorkspaces: (state, action) => {
@@ -2131,7 +2131,7 @@ const selectPermittedWorkspaceIds = createSelector(
2131
2131
  );
2132
2132
  const workspaceReducer = workspaceSlice.reducer;
2133
2133
  const maxRecentIssues = 10;
2134
- const initialState$k = {
2134
+ const initialState$n = {
2135
2135
  issues: {},
2136
2136
  attachments: {},
2137
2137
  comments: {},
@@ -2143,9 +2143,9 @@ const initialState$k = {
2143
2143
  };
2144
2144
  const issueSlice = createSlice({
2145
2145
  name: "issues",
2146
- initialState: initialState$k,
2146
+ initialState: initialState$n,
2147
2147
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2148
- Object.assign(state, initialState$k);
2148
+ Object.assign(state, initialState$n);
2149
2149
  }),
2150
2150
  reducers: {
2151
2151
  setIssues: (state, action) => {
@@ -2570,14 +2570,14 @@ const selectRecentIssuesAsSearchResults = createSelector(
2570
2570
  }
2571
2571
  );
2572
2572
  const issueReducer = issueSlice.reducer;
2573
- const initialState$j = {
2573
+ const initialState$m = {
2574
2574
  issueTypes: {}
2575
2575
  };
2576
2576
  const issueTypeSlice = createSlice({
2577
2577
  name: "issueTypes",
2578
- initialState: initialState$j,
2578
+ initialState: initialState$m,
2579
2579
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2580
- Object.assign(state, initialState$j);
2580
+ Object.assign(state, initialState$m);
2581
2581
  }),
2582
2582
  reducers: {
2583
2583
  setIssueTypes: (state, action) => {
@@ -2644,15 +2644,15 @@ const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
2644
2644
  return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
2645
2645
  };
2646
2646
  const issueTypeReducer = issueTypeSlice.reducer;
2647
- const initialState$i = {
2647
+ const initialState$l = {
2648
2648
  s3Urls: {}
2649
2649
  };
2650
2650
  const msPerHour = 1e3 * 60 * 60;
2651
2651
  const msPerWeek = msPerHour * 24 * 7;
2652
2652
  const fileSlice = createSlice({
2653
2653
  name: "file",
2654
- initialState: initialState$i,
2655
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2654
+ initialState: initialState$l,
2655
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
2656
2656
  reducers: {
2657
2657
  setUploadUrl: (state, action) => {
2658
2658
  const { url, fields, sha1 } = action.payload;
@@ -2679,7 +2679,7 @@ const selectUploadUrl = (sha1) => (state) => {
2679
2679
  return url;
2680
2680
  };
2681
2681
  const fileReducer = fileSlice.reducer;
2682
- const initialState$h = {
2682
+ const initialState$k = {
2683
2683
  // TODO: Change first MapStyle.SATELLITE to MaptStyle.None when project creation map is fixed
2684
2684
  mapStyle: MapStyle.SATELLITE,
2685
2685
  showTooltips: false,
@@ -2687,8 +2687,8 @@ const initialState$h = {
2687
2687
  };
2688
2688
  const mapSlice = createSlice({
2689
2689
  name: "map",
2690
- initialState: initialState$h,
2691
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2690
+ initialState: initialState$k,
2691
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
2692
2692
  reducers: {
2693
2693
  setMapStyle: (state, action) => {
2694
2694
  state.mapStyle = action.payload;
@@ -2757,7 +2757,7 @@ var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
2757
2757
  LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
2758
2758
  return LicenseStatus2;
2759
2759
  })(LicenseStatus || {});
2760
- const initialState$g = {
2760
+ const initialState$j = {
2761
2761
  users: {},
2762
2762
  currentUser: {
2763
2763
  id: 0,
@@ -2768,8 +2768,8 @@ const initialState$g = {
2768
2768
  };
2769
2769
  const userSlice = createSlice({
2770
2770
  name: "users",
2771
- initialState: initialState$g,
2772
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2771
+ initialState: initialState$j,
2772
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
2773
2773
  reducers: {
2774
2774
  setUsers: (state, action) => {
2775
2775
  const usersMapping = {};
@@ -2831,13 +2831,13 @@ const selectUser = (userId) => (state) => {
2831
2831
  const selectUsersAsMapping = (state) => state.userReducer.users;
2832
2832
  const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
2833
2833
  const userReducer = userSlice.reducer;
2834
- const initialState$f = {
2834
+ const initialState$i = {
2835
2835
  organizationAccesses: {}
2836
2836
  };
2837
2837
  const organizationAccessSlice = createSlice({
2838
2838
  name: "organizationAccess",
2839
- initialState: initialState$f,
2840
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
2839
+ initialState: initialState$i,
2840
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2841
2841
  reducers: {
2842
2842
  setOrganizationAccesses: (state, action) => {
2843
2843
  if (!Array.isArray(action.payload))
@@ -2900,13 +2900,13 @@ const selectOrganizationAccessUserMapping = (state) => {
2900
2900
  return organizationAccesses;
2901
2901
  };
2902
2902
  const organizationAccessReducer = organizationAccessSlice.reducer;
2903
- const initialState$e = {
2903
+ const initialState$h = {
2904
2904
  licenses: {}
2905
2905
  };
2906
2906
  const licenseSlice = createSlice({
2907
2907
  name: "license",
2908
- initialState: initialState$e,
2909
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2908
+ initialState: initialState$h,
2909
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2910
2910
  reducers: {
2911
2911
  setLicenses: (state, action) => {
2912
2912
  if (!Array.isArray(action.payload))
@@ -2951,13 +2951,13 @@ const selectLicensesForProjectsMapping = createSelector(
2951
2951
  (licenses) => Object.values(licenses).filter((license) => license.project).reduce((accum, license) => ({ ...accum, [license.project]: license }), {})
2952
2952
  );
2953
2953
  const licenseReducer = licenseSlice.reducer;
2954
- const initialState$d = {
2954
+ const initialState$g = {
2955
2955
  projectAccesses: {}
2956
2956
  };
2957
2957
  const projectAccessSlice = createSlice({
2958
2958
  name: "projectAccess",
2959
- initialState: initialState$d,
2960
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2959
+ initialState: initialState$g,
2960
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2961
2961
  reducers: {
2962
2962
  setProjectAccesses: (state, action) => {
2963
2963
  if (!Array.isArray(action.payload))
@@ -3025,7 +3025,7 @@ const selectProjectAccessUserMapping = (state) => {
3025
3025
  return projectAccesses;
3026
3026
  };
3027
3027
  const projectAccessReducer = projectAccessSlice.reducer;
3028
- const initialState$c = {
3028
+ const initialState$f = {
3029
3029
  projects: {},
3030
3030
  activeProjectId: null,
3031
3031
  recentProjectIds: [],
@@ -3035,7 +3035,7 @@ const initialState$c = {
3035
3035
  };
3036
3036
  const projectSlice = createSlice({
3037
3037
  name: "projects",
3038
- initialState: initialState$c,
3038
+ initialState: initialState$f,
3039
3039
  reducers: {
3040
3040
  setProjects: (state, action) => {
3041
3041
  const projectsMap = {};
@@ -3222,14 +3222,14 @@ const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
3222
3222
  }
3223
3223
  )
3224
3224
  );
3225
- const initialState$b = {
3225
+ const initialState$e = {
3226
3226
  organizations: {},
3227
3227
  activeOrganizationId: null
3228
3228
  };
3229
3229
  const organizationSlice = createSlice({
3230
3230
  name: "organizations",
3231
- initialState: initialState$b,
3232
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
3231
+ initialState: initialState$e,
3232
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
3233
3233
  reducers: {
3234
3234
  setOrganizations: (state, action) => {
3235
3235
  for (const org of action.payload) {
@@ -3348,14 +3348,14 @@ const createOfflineAction = (request2, baseUrl) => {
3348
3348
  }
3349
3349
  };
3350
3350
  };
3351
- const initialState$a = {
3351
+ const initialState$d = {
3352
3352
  deletedRequests: [],
3353
3353
  latestRetryTime: 0
3354
3354
  };
3355
3355
  const outboxSlice = createSlice({
3356
3356
  name: "outbox",
3357
- initialState: initialState$a,
3358
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
3357
+ initialState: initialState$d,
3358
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
3359
3359
  reducers: {
3360
3360
  // enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
3361
3361
  // Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
@@ -3387,7 +3387,7 @@ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
3387
3387
  const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
3388
3388
  const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
3389
3389
  const outboxReducer = outboxSlice.reducer;
3390
- const initialState$9 = {
3390
+ const initialState$c = {
3391
3391
  projectFiles: {},
3392
3392
  activeProjectFileId: null,
3393
3393
  isImportingProjectFile: false,
@@ -3395,8 +3395,8 @@ const initialState$9 = {
3395
3395
  };
3396
3396
  const projectFileSlice = createSlice({
3397
3397
  name: "projectFiles",
3398
- initialState: initialState$9,
3399
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
3398
+ initialState: initialState$c,
3399
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
3400
3400
  reducers: {
3401
3401
  addOrReplaceProjectFiles: (state, action) => {
3402
3402
  for (let fileObj of action.payload) {
@@ -3497,12 +3497,12 @@ const selectProjectFiles = createSelector(
3497
3497
  const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
3498
3498
  const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
3499
3499
  const projectFileReducer = projectFileSlice.reducer;
3500
- const initialState$8 = {
3500
+ const initialState$b = {
3501
3501
  isRehydrated: false
3502
3502
  };
3503
3503
  const rehydratedSlice = createSlice({
3504
3504
  name: "rehydrated",
3505
- initialState: initialState$8,
3505
+ initialState: initialState$b,
3506
3506
  // The `reducers` field lets us define reducers and generate associated actions
3507
3507
  reducers: {
3508
3508
  setRehydrated: (state, action) => {
@@ -3512,7 +3512,7 @@ const rehydratedSlice = createSlice({
3512
3512
  });
3513
3513
  const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
3514
3514
  const rehydratedReducer = rehydratedSlice.reducer;
3515
- const initialState$7 = {
3515
+ const initialState$a = {
3516
3516
  useIssueTemplate: false,
3517
3517
  placementMode: false,
3518
3518
  enableClustering: false,
@@ -3529,8 +3529,8 @@ const initialState$7 = {
3529
3529
  };
3530
3530
  const settingSlice = createSlice({
3531
3531
  name: "settings",
3532
- initialState: initialState$7,
3533
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3532
+ initialState: initialState$a,
3533
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
3534
3534
  reducers: {
3535
3535
  setEnableDuplicateIssues: (state, action) => {
3536
3536
  state.useIssueTemplate = action.payload;
@@ -3589,14 +3589,14 @@ const formRevisionSortFn = (formRevisionA, formRevisionB) => {
3589
3589
  return revisionA < revisionB ? -1 : 1;
3590
3590
  }
3591
3591
  };
3592
- const initialState$6 = {
3592
+ const initialState$9 = {
3593
3593
  formRevisions: {},
3594
3594
  attachments: {}
3595
3595
  };
3596
3596
  const formRevisionsSlice = createSlice({
3597
3597
  name: "formRevisions",
3598
- initialState: initialState$6,
3599
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
3598
+ initialState: initialState$9,
3599
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
3600
3600
  reducers: {
3601
3601
  // revision related actions
3602
3602
  setFormRevision: (state, action) => {
@@ -3776,13 +3776,13 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
3776
3776
  )
3777
3777
  );
3778
3778
  const formRevisionReducer = formRevisionsSlice.reducer;
3779
- const initialState$5 = {
3779
+ const initialState$8 = {
3780
3780
  forms: {}
3781
3781
  };
3782
3782
  const formSlice = createSlice({
3783
3783
  name: "forms",
3784
- initialState: initialState$5,
3785
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
3784
+ initialState: initialState$8,
3785
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
3786
3786
  reducers: {
3787
3787
  setForms: (state, action) => {
3788
3788
  state.forms = {};
@@ -3887,14 +3887,14 @@ const selectGeneralFormCount = createSelector([selectFormMapping], (userForms) =
3887
3887
  return Object.values(userForms).filter((form) => !form.component_type).length;
3888
3888
  });
3889
3889
  const formReducer = formSlice.reducer;
3890
- const initialState$4 = {
3890
+ const initialState$7 = {
3891
3891
  formSubmissions: {},
3892
3892
  attachments: {}
3893
3893
  };
3894
3894
  const formSubmissionSlice = createSlice({
3895
3895
  name: "formSubmissions",
3896
- initialState: initialState$4,
3897
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
3896
+ initialState: initialState$7,
3897
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3898
3898
  reducers: {
3899
3899
  setFormSubmission: (state, action) => {
3900
3900
  state.formSubmissions[action.payload.offline_id] = action.payload;
@@ -4131,12 +4131,12 @@ const selectAttachmentsOfFormSubmission = restructureCreateSelectorWithArgs(
4131
4131
  )
4132
4132
  );
4133
4133
  const formSubmissionReducer = formSubmissionSlice.reducer;
4134
- const initialState$3 = {
4134
+ const initialState$6 = {
4135
4135
  emailDomains: {}
4136
4136
  };
4137
4137
  const emailDomainsSlice = createSlice({
4138
4138
  name: "emailDomains",
4139
- initialState: initialState$3,
4139
+ initialState: initialState$6,
4140
4140
  reducers: {
4141
4141
  setEmailDomains: (state, action) => {
4142
4142
  const emailDomains = {};
@@ -4163,15 +4163,15 @@ const selectSortedEmailDomains = (state) => Object.values(state.emailDomainsRedu
4163
4163
  (ed1, ed2) => ed1.domain.localeCompare(ed2.domain)
4164
4164
  );
4165
4165
  const emailDomainsReducer = emailDomainsSlice.reducer;
4166
- const initialState$2 = {
4166
+ const initialState$5 = {
4167
4167
  documents: {},
4168
4168
  attachments: {}
4169
4169
  };
4170
4170
  const documentSlice = createSlice({
4171
4171
  name: "documents",
4172
- initialState: initialState$2,
4172
+ initialState: initialState$5,
4173
4173
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
4174
- Object.assign(state, initialState$2);
4174
+ Object.assign(state, initialState$5);
4175
4175
  }),
4176
4176
  reducers: {
4177
4177
  setDocuments: (state, action) => {
@@ -4396,13 +4396,13 @@ const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
4396
4396
  )
4397
4397
  );
4398
4398
  const documentsReducer = documentSlice.reducer;
4399
- const initialState$1 = {
4399
+ const initialState$4 = {
4400
4400
  teams: {}
4401
4401
  };
4402
4402
  const teamSlice = createSlice({
4403
4403
  name: "teams",
4404
- initialState: initialState$1,
4405
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
4404
+ initialState: initialState$4,
4405
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
4406
4406
  reducers: {
4407
4407
  setTeam: (state, action) => {
4408
4408
  state.teams[action.payload.offline_id] = action.payload;
@@ -4452,6 +4452,260 @@ const selectTeamsOfUser = restructureCreateSelectorWithArgs(
4452
4452
  })
4453
4453
  );
4454
4454
  const teamReducer = teamSlice.reducer;
4455
+ const initialState$3 = {
4456
+ documentTeamLinks: {}
4457
+ };
4458
+ const documentTeamLinkSlice = createSlice({
4459
+ name: "documentTeamLink",
4460
+ initialState: initialState$3,
4461
+ extraReducers: (builder) => builder.addCase("RESET", (state) => {
4462
+ Object.assign(state, initialState$3);
4463
+ }),
4464
+ reducers: {
4465
+ setDocumentTeamLink: (state, action) => {
4466
+ state.documentTeamLinks[action.payload.offline_id] = action.payload;
4467
+ },
4468
+ setDocumentTeamLinks: (state, action) => {
4469
+ for (const documentTeamLink of action.payload) {
4470
+ state.documentTeamLinks[documentTeamLink.offline_id] = documentTeamLink;
4471
+ }
4472
+ },
4473
+ addDocumentTeamLink: (state, action) => {
4474
+ if (action.payload.offline_id in state.documentTeamLinks) {
4475
+ throw new Error(`DocumentTeamLink with offline_id ${action.payload.offline_id} already exists`);
4476
+ }
4477
+ state.documentTeamLinks[action.payload.offline_id] = action.payload;
4478
+ },
4479
+ deleteDocumentTeamLink: (state, action) => {
4480
+ if (!(action.payload in state.documentTeamLinks)) {
4481
+ throw new Error(`DocumentTeamLink with offline_id ${action.payload} does not exist`);
4482
+ }
4483
+ delete state.documentTeamLinks[action.payload];
4484
+ },
4485
+ deleteDocumentTeamLinks: (state, action) => {
4486
+ for (const offlineId of action.payload) {
4487
+ if (!(offlineId in state.documentTeamLinks)) {
4488
+ throw new Error(`DocumentTeamLink with offline_id ${offlineId} does not exist`);
4489
+ }
4490
+ }
4491
+ for (const offlineId of action.payload) {
4492
+ delete state.documentTeamLinks[offlineId];
4493
+ }
4494
+ }
4495
+ }
4496
+ });
4497
+ const {
4498
+ setDocumentTeamLink,
4499
+ setDocumentTeamLinks,
4500
+ addDocumentTeamLink,
4501
+ deleteDocumentTeamLink,
4502
+ deleteDocumentTeamLinks
4503
+ } = documentTeamLinkSlice.actions;
4504
+ const selectDocumentTeamLinksMapping = (state) => state.documentTeamLinkReducer.documentTeamLinks;
4505
+ const selectDocumentTeamLinks = (state) => Object.values(state.documentTeamLinkReducer.documentTeamLinks);
4506
+ const selectDocumentTeamLinksOfDocument = restructureCreateSelectorWithArgs(
4507
+ createSelector(
4508
+ [selectDocumentTeamLinks, (_, documentId) => documentId],
4509
+ (documentTeamLinks, documentId) => {
4510
+ return documentTeamLinks.filter((documentTeamLink) => documentTeamLink.document === documentId);
4511
+ }
4512
+ )
4513
+ );
4514
+ const selectDocumentTeamLinksOfTeam = restructureCreateSelectorWithArgs(
4515
+ createSelector([selectDocumentTeamLinks, (_, teamId) => teamId], (documentTeamLinks, teamId) => {
4516
+ return documentTeamLinks.filter((documentTeamLink) => documentTeamLink.team === teamId);
4517
+ })
4518
+ );
4519
+ const selectDocumentsLinkedToTeam = restructureCreateSelectorWithArgs(
4520
+ createSelector(
4521
+ [
4522
+ selectDocumentTeamLinks,
4523
+ (state) => state.documentsReducer.documents,
4524
+ (_, teamId) => teamId
4525
+ ],
4526
+ (documentTeamLinks, documents, teamId) => {
4527
+ return documentTeamLinks.filter((documentTeamLink) => documentTeamLink.team === teamId).map((documentTeamLink) => documents[documentTeamLink.document]).filter((document2) => !!document2);
4528
+ }
4529
+ )
4530
+ );
4531
+ const selectTeamsLinkedToDocument = restructureCreateSelectorWithArgs(
4532
+ createSelector(
4533
+ [selectDocumentTeamLinks, (state) => state.teamReducer.teams, (_, documentId) => documentId],
4534
+ (documentTeamLinks, teams, documentId) => {
4535
+ return documentTeamLinks.filter((documentTeamLink) => documentTeamLink.document === documentId).map((documentTeamLink) => teams[documentTeamLink.team]).filter((team) => !!team);
4536
+ }
4537
+ )
4538
+ );
4539
+ const documentTeamLinkReducer = documentTeamLinkSlice.reducer;
4540
+ const initialState$2 = {
4541
+ issueTypeTeamLinks: {}
4542
+ };
4543
+ const issueTypeTeamLinkSlice = createSlice({
4544
+ name: "issueTypeTeamLink",
4545
+ initialState: initialState$2,
4546
+ extraReducers: (builder) => builder.addCase("RESET", (state) => {
4547
+ Object.assign(state, initialState$2);
4548
+ }),
4549
+ reducers: {
4550
+ setIssueTypeTeamLink: (state, action) => {
4551
+ state.issueTypeTeamLinks[action.payload.offline_id] = action.payload;
4552
+ },
4553
+ setIssueTypeTeamLinks: (state, action) => {
4554
+ state.issueTypeTeamLinks = {};
4555
+ for (const issueTypeTeamLink of action.payload) {
4556
+ state.issueTypeTeamLinks[issueTypeTeamLink.offline_id] = issueTypeTeamLink;
4557
+ }
4558
+ },
4559
+ addIssueTypeTeamLink: (state, action) => {
4560
+ if (action.payload.offline_id in state.issueTypeTeamLinks) {
4561
+ throw new Error(`IssueTypeTeamLink with offline_id ${action.payload.offline_id} already exists`);
4562
+ }
4563
+ state.issueTypeTeamLinks[action.payload.offline_id] = action.payload;
4564
+ },
4565
+ deleteIssueTypeTeamLink: (state, action) => {
4566
+ if (!(action.payload in state.issueTypeTeamLinks)) {
4567
+ throw new Error(`IssueTypeTeamLink with offline_id ${action.payload} does not exist`);
4568
+ }
4569
+ delete state.issueTypeTeamLinks[action.payload];
4570
+ },
4571
+ deleteIssueTypeTeamLinks: (state, action) => {
4572
+ for (const offlineId of action.payload) {
4573
+ if (!(offlineId in state.issueTypeTeamLinks)) {
4574
+ throw new Error(`IssueTypeTeamLink with offline_id ${offlineId} does not exist`);
4575
+ }
4576
+ }
4577
+ for (const offlineId of action.payload) {
4578
+ delete state.issueTypeTeamLinks[offlineId];
4579
+ }
4580
+ }
4581
+ }
4582
+ });
4583
+ const {
4584
+ setIssueTypeTeamLink,
4585
+ setIssueTypeTeamLinks,
4586
+ addIssueTypeTeamLink,
4587
+ deleteIssueTypeTeamLink,
4588
+ deleteIssueTypeTeamLinks
4589
+ } = issueTypeTeamLinkSlice.actions;
4590
+ const selectIssueTypeTeamLinkMapping = (state) => state.issueTypeTeamLinkReducer.issueTypeTeamLinks;
4591
+ const selectIssueTypeTeamLinks = (state) => Object.values(state.issueTypeTeamLinkReducer.issueTypeTeamLinks);
4592
+ const selectIssueTypeTeamLinksOfIssueType = restructureCreateSelectorWithArgs(
4593
+ createSelector(
4594
+ [selectIssueTypeTeamLinks, (_, issueTypeId) => issueTypeId],
4595
+ (issueTypeTeamLinks, issueTypeId) => {
4596
+ return issueTypeTeamLinks.filter((issueTypeTeamLink) => issueTypeTeamLink.issue_type === issueTypeId);
4597
+ }
4598
+ )
4599
+ );
4600
+ const selectIssueTypeTeamLinksOfTeam = restructureCreateSelectorWithArgs(
4601
+ createSelector([selectIssueTypeTeamLinks, (_, teamId) => teamId], (issueTypeTeamLinks, teamId) => {
4602
+ return issueTypeTeamLinks.filter((issueTypeTeamLink) => issueTypeTeamLink.team === teamId);
4603
+ })
4604
+ );
4605
+ const selectIssueTypesLinkedToTeam = restructureCreateSelectorWithArgs(
4606
+ createSelector(
4607
+ [
4608
+ selectIssueTypeTeamLinks,
4609
+ (state) => state.issueTypeReducer.issueTypes,
4610
+ (_, teamId) => teamId
4611
+ ],
4612
+ (issueTypeTeamLinks, issueTypes, teamId) => {
4613
+ return issueTypeTeamLinks.filter((issueTypeTeamLink) => issueTypeTeamLink.team === teamId).map((issueTypeTeamLink) => issueTypes[issueTypeTeamLink.issue_type]).filter((issueType) => !!issueType);
4614
+ }
4615
+ )
4616
+ );
4617
+ const selectTeamsLinkedToIssueType = restructureCreateSelectorWithArgs(
4618
+ createSelector(
4619
+ [
4620
+ selectIssueTypeTeamLinks,
4621
+ (state) => state.teamReducer.teams,
4622
+ (_, issueTypeId) => issueTypeId
4623
+ ],
4624
+ (issueTypeTeamLinks, teams, issueTypeId) => {
4625
+ return issueTypeTeamLinks.filter((issueTypeTeamLink) => issueTypeTeamLink.issue_type === issueTypeId).map((issueTypeTeamLink) => teams[issueTypeTeamLink.team]).filter((team) => !!team);
4626
+ }
4627
+ )
4628
+ );
4629
+ const issueTypeTeamLinkReducer = issueTypeTeamLinkSlice.reducer;
4630
+ const initialState$1 = {
4631
+ userFormTeamLinks: {}
4632
+ };
4633
+ const userFormTeamLinkSlice = createSlice({
4634
+ name: "userFormTeamLink",
4635
+ initialState: initialState$1,
4636
+ extraReducers: (builder) => builder.addCase("RESET", (state) => {
4637
+ Object.assign(state, initialState$1);
4638
+ }),
4639
+ reducers: {
4640
+ setUserFormTeamLink: (state, action) => {
4641
+ state.userFormTeamLinks[action.payload.offline_id] = action.payload;
4642
+ },
4643
+ setUserFormTeamLinks: (state, action) => {
4644
+ state.userFormTeamLinks = {};
4645
+ for (const userFormTeamLink of action.payload) {
4646
+ state.userFormTeamLinks[userFormTeamLink.offline_id] = userFormTeamLink;
4647
+ }
4648
+ },
4649
+ addUserFormTeamLink: (state, action) => {
4650
+ if (action.payload.offline_id in state.userFormTeamLinks) {
4651
+ throw new Error(`UserFormTeamLink with offline_id ${action.payload.offline_id} already exists`);
4652
+ }
4653
+ state.userFormTeamLinks[action.payload.offline_id] = action.payload;
4654
+ },
4655
+ deleteUserFormTeamLink: (state, action) => {
4656
+ if (!(action.payload in state.userFormTeamLinks)) {
4657
+ throw new Error(`UserFormTeamLink with offline_id ${action.payload} does not exist`);
4658
+ }
4659
+ delete state.userFormTeamLinks[action.payload];
4660
+ },
4661
+ deleteUserFormTeamLinks: (state, action) => {
4662
+ for (const offlineId of action.payload) {
4663
+ if (!(offlineId in state.userFormTeamLinks)) {
4664
+ throw new Error(`UserFormTeamLink with offline_id ${offlineId} does not exist`);
4665
+ }
4666
+ }
4667
+ for (const offlineId of action.payload) {
4668
+ delete state.userFormTeamLinks[offlineId];
4669
+ }
4670
+ }
4671
+ }
4672
+ });
4673
+ const {
4674
+ setUserFormTeamLink,
4675
+ setUserFormTeamLinks,
4676
+ addUserFormTeamLink,
4677
+ deleteUserFormTeamLink,
4678
+ deleteUserFormTeamLinks
4679
+ } = userFormTeamLinkSlice.actions;
4680
+ const selectUserFormTeamLinkMapping = (state) => state.userFormTeamLinkReducer.userFormTeamLinks;
4681
+ const selectUserFormTeamLinks = (state) => Object.values(state.userFormTeamLinkReducer.userFormTeamLinks);
4682
+ const selectUserFormLinksOfTeam = restructureCreateSelectorWithArgs(
4683
+ createSelector([selectUserFormTeamLinks, (_, teamId) => teamId], (userFormTeamLinks, teamId) => {
4684
+ return userFormTeamLinks.filter((userFormTeamLink) => userFormTeamLink.team === teamId);
4685
+ })
4686
+ );
4687
+ const selectUserFormLinksOfForm = restructureCreateSelectorWithArgs(
4688
+ createSelector([selectUserFormTeamLinks, (_, formId2) => formId2], (userFormTeamLinks, formId2) => {
4689
+ return userFormTeamLinks.filter((userFormTeamLink) => userFormTeamLink.form === formId2);
4690
+ })
4691
+ );
4692
+ const selectUserFormsLinkedToTeam = restructureCreateSelectorWithArgs(
4693
+ createSelector(
4694
+ [selectUserFormTeamLinks, (state) => state.formReducer.forms, (_, teamId) => teamId],
4695
+ (userFormTeamLinks, userForms, teamId) => {
4696
+ return userFormTeamLinks.filter((userFormTeamLink) => userFormTeamLink.team === teamId).map((userFormTeamLink) => userForms[userFormTeamLink.form]).filter((form) => !!form);
4697
+ }
4698
+ )
4699
+ );
4700
+ const selectTeamsLinkedToUserForm = restructureCreateSelectorWithArgs(
4701
+ createSelector(
4702
+ [selectUserFormTeamLinks, (state) => state.teamReducer.teams, (_, formId2) => formId2],
4703
+ (userFormTeamLinks, teams, formId2) => {
4704
+ return userFormTeamLinks.filter((userFormTeamLink) => userFormTeamLink.form === formId2).map((userFormTeamLink) => teams[userFormTeamLink.team]).filter((team) => !!team);
4705
+ }
4706
+ )
4707
+ );
4708
+ const userFormTeamLinkReducer = userFormTeamLinkSlice.reducer;
4455
4709
  const initialState = {
4456
4710
  version: 0
4457
4711
  };
@@ -4502,7 +4756,10 @@ const overmapReducers = {
4502
4756
  emailDomainsReducer,
4503
4757
  licenseReducer,
4504
4758
  documentsReducer,
4505
- teamReducer
4759
+ teamReducer,
4760
+ documentTeamLinkReducer,
4761
+ issueTypeTeamLinkReducer,
4762
+ userFormTeamLinkReducer
4506
4763
  };
4507
4764
  const overmapReducer = combineReducers(overmapReducers);
4508
4765
  const resetStore = "RESET";
@@ -6709,17 +6966,20 @@ class IssueTypeService extends BaseApiService {
6709
6966
  throw new Error(`IssueType with offline_id ${issueTypeId} does not exist in the store.`);
6710
6967
  }
6711
6968
  const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(store.getState()) ?? [];
6969
+ const issueTypeTeamLinks = selectIssueTypeTeamLinksOfIssueType(issueTypeId)(store.getState()) ?? [];
6712
6970
  store.dispatch(removeIssueType(issueTypeId));
6713
6971
  store.dispatch(removeIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
6972
+ store.dispatch(deleteIssueTypeTeamLinks(issueTypeTeamLinks.map((link) => link.offline_id)));
6714
6973
  const promise = this.enqueueRequest({
6715
6974
  method: HttpMethod.DELETE,
6716
6975
  url: `/issues/types/${issueTypeId}/`,
6717
6976
  blockers: [issueTypeId],
6718
- blocks: []
6977
+ blocks: [issueTypeId]
6719
6978
  });
6720
6979
  promise.catch(() => {
6721
6980
  store.dispatch(setIssueType(issueTypeToDelete));
6722
6981
  store.dispatch(addIssues(issuesOfIssueType));
6982
+ store.dispatch(setIssueTypeTeamLinks(issueTypeTeamLinks));
6723
6983
  });
6724
6984
  return promise;
6725
6985
  }
@@ -6893,6 +7153,7 @@ class MainService extends BaseApiService {
6893
7153
  });
6894
7154
  void this.client.userForms.refreshStore().then(() => {
6895
7155
  void this.client.userFormSubmissions.refreshStore().then();
7156
+ void this.client.userFormTeamLinks.refreshStore().then();
6896
7157
  });
6897
7158
  }
6898
7159
  if (currentProjectId) {
@@ -6911,9 +7172,13 @@ class MainService extends BaseApiService {
6911
7172
  store.dispatch(setProjectAttachments(project_attachments));
6912
7173
  store.dispatch(setDocumentAttachments(document_attachments));
6913
7174
  });
6914
- void this.client.documents.refreshStore();
7175
+ void this.client.documents.refreshStore().then(() => {
7176
+ void this.client.documentTeamLinks.refreshStore().then();
7177
+ });
6915
7178
  void this.client.issueUpdates.refreshStore();
6916
- void this.client.issueTypes.refreshStore();
7179
+ void this.client.issueTypes.refreshStore().then(() => {
7180
+ void this.client.issueTypeTeamLinks.refreshStore().then();
7181
+ });
6917
7182
  }
6918
7183
  store.dispatch(setIsFetchingInitialData(false));
6919
7184
  if (overwrite) {
@@ -7458,6 +7723,8 @@ class UserFormService extends BaseApiService {
7458
7723
  if (userFormRevisions && userFormRevisions.length > 0) {
7459
7724
  store.dispatch(deleteFormRevisions(userFormRevisions.map(({ offline_id }) => offline_id)));
7460
7725
  }
7726
+ const userFormTeamLinks = selectUserFormLinksOfForm(formId2)(state) ?? [];
7727
+ store.dispatch(deleteUserFormTeamLinks(userFormTeamLinks.map((link) => link.offline_id)));
7461
7728
  store.dispatch(deleteForm(formId2));
7462
7729
  try {
7463
7730
  return await this.enqueueRequest({
@@ -7475,6 +7742,7 @@ class UserFormService extends BaseApiService {
7475
7742
  if (userFormSubmissions && userFormSubmissions.length > 0) {
7476
7743
  store.dispatch(addFormSubmissions(userFormSubmissions));
7477
7744
  }
7745
+ store.dispatch(setUserFormTeamLinks(userFormTeamLinks));
7478
7746
  throw e;
7479
7747
  }
7480
7748
  }
@@ -8419,7 +8687,8 @@ class DocumentService extends BaseApiService {
8419
8687
  }
8420
8688
  delete(documentId) {
8421
8689
  const { store } = this.client;
8422
- const documentsMapping = selectDocumentsMapping(store.getState());
8690
+ const state = store.getState();
8691
+ const documentsMapping = selectDocumentsMapping(state);
8423
8692
  const documentToBeDeleted = documentsMapping[documentId];
8424
8693
  if (!documentToBeDeleted) {
8425
8694
  throw new Error(
@@ -8427,7 +8696,9 @@ class DocumentService extends BaseApiService {
8427
8696
  );
8428
8697
  }
8429
8698
  const parentDocument = documentToBeDeleted.parent_document ? documentsMapping[documentToBeDeleted.parent_document] : void 0;
8699
+ const documentTeamLinks = selectDocumentTeamLinksOfDocument(documentId)(state) ?? [];
8430
8700
  store.dispatch(removeDocuments([documentId]));
8701
+ store.dispatch(deleteDocumentTeamLinks(documentTeamLinks.map((link) => link.offline_id)));
8431
8702
  const promise = this.enqueueRequest({
8432
8703
  description: "Delete Document",
8433
8704
  method: HttpMethod.DELETE,
@@ -8442,6 +8713,7 @@ class DocumentService extends BaseApiService {
8442
8713
  if (parentDocument) {
8443
8714
  store.dispatch(updateDocuments([parentDocument]));
8444
8715
  }
8716
+ store.dispatch(setDocumentTeamLinks(documentTeamLinks));
8445
8717
  });
8446
8718
  return promise;
8447
8719
  }
@@ -8563,7 +8835,13 @@ class TeamService extends BaseApiService {
8563
8835
  if (!team) {
8564
8836
  throw new Error(`Expected team with id ${teamId} to exist`);
8565
8837
  }
8838
+ const documentTeamLinks = selectDocumentTeamLinksOfTeam(team.offline_id)(state) ?? [];
8839
+ const issueTypeTeamLinks = selectIssueTypeTeamLinksOfTeam(team.offline_id)(state) ?? [];
8840
+ const userFormTeamLinks = selectUserFormLinksOfTeam(team.offline_id)(state) ?? [];
8566
8841
  store.dispatch(deleteTeam(teamId));
8842
+ store.dispatch(deleteDocumentTeamLinks(documentTeamLinks.map((link) => link.offline_id)));
8843
+ store.dispatch(deleteIssueTypeTeamLinks(issueTypeTeamLinks.map((link) => link.offline_id)));
8844
+ store.dispatch(deleteUserFormTeamLinks(userFormTeamLinks.map((link) => link.offline_id)));
8567
8845
  try {
8568
8846
  return await this.enqueueRequest({
8569
8847
  description: "Delete team",
@@ -8574,6 +8852,9 @@ class TeamService extends BaseApiService {
8574
8852
  });
8575
8853
  } catch (e) {
8576
8854
  store.dispatch(setTeam(team));
8855
+ store.dispatch(setDocumentTeamLinks(documentTeamLinks));
8856
+ store.dispatch(setIssueTypeTeamLinks(issueTypeTeamLinks));
8857
+ store.dispatch(setUserFormTeamLinks(userFormTeamLinks));
8577
8858
  throw e;
8578
8859
  }
8579
8860
  }
@@ -8636,6 +8917,171 @@ class TeamService extends BaseApiService {
8636
8917
  store.dispatch(setTeams(result));
8637
8918
  }
8638
8919
  }
8920
+ class DocumentTeamLinkService extends BaseApiService {
8921
+ add(payload) {
8922
+ const { store } = this.client;
8923
+ const offlineDocumentTeamLink = offline({
8924
+ ...payload,
8925
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
8926
+ });
8927
+ store.dispatch(addDocumentTeamLink(offlineDocumentTeamLink));
8928
+ const promise = this.enqueueRequest({
8929
+ method: HttpMethod.POST,
8930
+ url: `/organizations/teams/${payload.team}/link-document/`,
8931
+ payload: offlineDocumentTeamLink,
8932
+ blockers: [payload.team, payload.document],
8933
+ blocks: [offlineDocumentTeamLink.offline_id]
8934
+ });
8935
+ promise.then((createdDocumentLink) => {
8936
+ store.dispatch(setDocumentTeamLink(createdDocumentLink));
8937
+ }).catch(() => {
8938
+ store.dispatch(deleteDocumentTeamLink(offlineDocumentTeamLink.offline_id));
8939
+ });
8940
+ return [offlineDocumentTeamLink, promise];
8941
+ }
8942
+ delete(documentTeamLinkId) {
8943
+ const { store } = this.client;
8944
+ const documentTeamLink = store.getState().documentTeamLinkReducer.documentTeamLinks[documentTeamLinkId];
8945
+ if (!documentTeamLink) {
8946
+ throw new Error(`No document team link found for ${documentTeamLinkId}`);
8947
+ }
8948
+ store.dispatch(deleteDocumentTeamLink(documentTeamLinkId));
8949
+ const promise = this.enqueueRequest({
8950
+ method: HttpMethod.DELETE,
8951
+ url: `/organizations/teams/document-links/${documentTeamLinkId}/`,
8952
+ blockers: [documentTeamLinkId],
8953
+ blocks: [documentTeamLinkId]
8954
+ });
8955
+ promise.catch(() => {
8956
+ store.dispatch(setDocumentTeamLink(documentTeamLink));
8957
+ });
8958
+ return promise;
8959
+ }
8960
+ async refreshStore() {
8961
+ const { store } = this.client;
8962
+ const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
8963
+ if (!activeOrganizationId) {
8964
+ throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
8965
+ }
8966
+ const result = await this.enqueueRequest({
8967
+ method: HttpMethod.GET,
8968
+ url: `/organizations/${activeOrganizationId}/teams/document-links/`,
8969
+ blockers: [],
8970
+ blocks: []
8971
+ });
8972
+ store.dispatch(setDocumentTeamLinks(result));
8973
+ }
8974
+ }
8975
+ class IssueTypeTeamLinkService extends BaseApiService {
8976
+ add(payload) {
8977
+ const { store } = this.client;
8978
+ const offlineIssueTypeTeamLink = offline({
8979
+ ...payload,
8980
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
8981
+ });
8982
+ store.dispatch(addIssueTypeTeamLink(offlineIssueTypeTeamLink));
8983
+ const promise = this.enqueueRequest({
8984
+ method: HttpMethod.POST,
8985
+ url: `/organizations/teams/${payload.team}/link-issue-type/`,
8986
+ payload: offlineIssueTypeTeamLink,
8987
+ blockers: [payload.team, payload.issue_type],
8988
+ blocks: [offlineIssueTypeTeamLink.offline_id]
8989
+ });
8990
+ promise.then((createdIssueTypeLink) => {
8991
+ store.dispatch(setIssueTypeTeamLink(createdIssueTypeLink));
8992
+ }).catch(() => {
8993
+ store.dispatch(deleteIssueTypeTeamLink(offlineIssueTypeTeamLink.offline_id));
8994
+ });
8995
+ return [offlineIssueTypeTeamLink, promise];
8996
+ }
8997
+ delete(issueTypeTeamLinkId) {
8998
+ const { store } = this.client;
8999
+ const issueTypeTeamLink = store.getState().issueTypeTeamLinkReducer.issueTypeTeamLinks[issueTypeTeamLinkId];
9000
+ if (!issueTypeTeamLink) {
9001
+ throw new Error(`No issue type team link found for ${issueTypeTeamLinkId}`);
9002
+ }
9003
+ store.dispatch(deleteIssueTypeTeamLink(issueTypeTeamLinkId));
9004
+ const promise = this.enqueueRequest({
9005
+ method: HttpMethod.DELETE,
9006
+ url: `/organizations/teams/issue-type-links/${issueTypeTeamLinkId}/`,
9007
+ blockers: [issueTypeTeamLink.offline_id],
9008
+ blocks: [issueTypeTeamLink.offline_id]
9009
+ });
9010
+ promise.catch(() => {
9011
+ store.dispatch(setIssueTypeTeamLink(issueTypeTeamLink));
9012
+ });
9013
+ return promise;
9014
+ }
9015
+ async refreshStore() {
9016
+ const { store } = this.client;
9017
+ const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
9018
+ if (!activeOrganizationId) {
9019
+ throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
9020
+ }
9021
+ const result = await this.enqueueRequest({
9022
+ method: HttpMethod.GET,
9023
+ url: `/organizations/${activeOrganizationId}/teams/issue-type-links/`,
9024
+ blockers: [],
9025
+ blocks: []
9026
+ });
9027
+ store.dispatch(setIssueTypeTeamLinks(result));
9028
+ }
9029
+ }
9030
+ class UserFormTeamLinkService extends BaseApiService {
9031
+ add(payload) {
9032
+ const { store } = this.client;
9033
+ const offlineUserFormTeamLink = offline({
9034
+ ...payload,
9035
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
9036
+ });
9037
+ store.dispatch(addUserFormTeamLink(offlineUserFormTeamLink));
9038
+ const promise = this.enqueueRequest({
9039
+ method: HttpMethod.POST,
9040
+ url: `/organizations/teams/${payload.team}/link-form/`,
9041
+ payload: offlineUserFormTeamLink,
9042
+ blockers: [payload.team, payload.form],
9043
+ blocks: [offlineUserFormTeamLink.offline_id]
9044
+ });
9045
+ promise.then((createdUserFormLink) => {
9046
+ store.dispatch(setUserFormTeamLink(createdUserFormLink));
9047
+ }).catch(() => {
9048
+ store.dispatch(deleteUserFormTeamLink(offlineUserFormTeamLink.offline_id));
9049
+ });
9050
+ return [offlineUserFormTeamLink, promise];
9051
+ }
9052
+ delete(userFormTeamLinkId) {
9053
+ const { store } = this.client;
9054
+ const userFormTeamLink = store.getState().userFormTeamLinkReducer.userFormTeamLinks[userFormTeamLinkId];
9055
+ if (!userFormTeamLink) {
9056
+ throw new Error(`No user form team link found for ${userFormTeamLinkId}`);
9057
+ }
9058
+ store.dispatch(deleteUserFormTeamLink(userFormTeamLinkId));
9059
+ const promise = this.enqueueRequest({
9060
+ method: HttpMethod.DELETE,
9061
+ url: `/organizations/teams/form-links/${userFormTeamLinkId}/`,
9062
+ blockers: [userFormTeamLink.offline_id],
9063
+ blocks: [userFormTeamLink.offline_id]
9064
+ });
9065
+ promise.catch(() => {
9066
+ store.dispatch(setUserFormTeamLink(userFormTeamLink));
9067
+ });
9068
+ return promise;
9069
+ }
9070
+ async refreshStore() {
9071
+ const { store } = this.client;
9072
+ const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
9073
+ if (!activeOrganizationId) {
9074
+ throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
9075
+ }
9076
+ const result = await this.enqueueRequest({
9077
+ method: HttpMethod.GET,
9078
+ url: `/organizations/${activeOrganizationId}/teams/form-links/`,
9079
+ blockers: [],
9080
+ blocks: []
9081
+ });
9082
+ store.dispatch(setUserFormTeamLinks(result));
9083
+ }
9084
+ }
8639
9085
  class OvermapSDK {
8640
9086
  constructor(apiUrl, store) {
8641
9087
  __publicField(this, "API_URL");
@@ -8667,6 +9113,9 @@ class OvermapSDK {
8667
9113
  __publicField(this, "licenses", new LicenseService(this));
8668
9114
  __publicField(this, "documents", new DocumentService(this));
8669
9115
  __publicField(this, "teams", new TeamService(this));
9116
+ __publicField(this, "documentTeamLinks", new DocumentTeamLinkService(this));
9117
+ __publicField(this, "issueTypeTeamLinks", new IssueTypeTeamLinkService(this));
9118
+ __publicField(this, "userFormTeamLinks", new UserFormTeamLinkService(this));
8670
9119
  this.API_URL = apiUrl;
8671
9120
  this.store = store;
8672
9121
  }
@@ -16520,6 +16969,7 @@ export {
16520
16969
  DateField,
16521
16970
  DateInput,
16522
16971
  DocumentService,
16972
+ DocumentTeamLinkService,
16523
16973
  EmailDomainsService,
16524
16974
  EmailVerificationService,
16525
16975
  FieldSection,
@@ -16613,6 +17063,7 @@ export {
16613
17063
  addComponentsInBatches,
16614
17064
  addDocumentAttachment,
16615
17065
  addDocumentAttachments,
17066
+ addDocumentTeamLink,
16616
17067
  addDocuments,
16617
17068
  addEmailDomain,
16618
17069
  addFavouriteProjectId,
@@ -16632,6 +17083,7 @@ export {
16632
17083
  addIssueComment,
16633
17084
  addIssueComments,
16634
17085
  addIssueType,
17086
+ addIssueTypeTeamLink,
16635
17087
  addIssueUpdate,
16636
17088
  addIssueUpdates,
16637
17089
  addIssues,
@@ -16649,6 +17101,7 @@ export {
16649
17101
  addStages,
16650
17102
  addTeam,
16651
17103
  addToRecentIssues,
17104
+ addUserFormTeamLink,
16652
17105
  addUsers,
16653
17106
  addWorkspace,
16654
17107
  areArraysEqual,
@@ -16680,6 +17133,8 @@ export {
16680
17133
  defaultBadgeColor,
16681
17134
  defaultStore,
16682
17135
  deleteComponentType,
17136
+ deleteDocumentTeamLink,
17137
+ deleteDocumentTeamLinks,
16683
17138
  deleteForm,
16684
17139
  deleteFormRevision,
16685
17140
  deleteFormRevisionAttachment,
@@ -16689,13 +17144,19 @@ export {
16689
17144
  deleteFormSubmissionAttachment,
16690
17145
  deleteFormSubmissionAttachments,
16691
17146
  deleteFormSubmissions,
17147
+ deleteIssueTypeTeamLink,
17148
+ deleteIssueTypeTeamLinks,
16692
17149
  deleteProject,
16693
17150
  deleteTeam,
17151
+ deleteUserFormTeamLink,
17152
+ deleteUserFormTeamLinks,
16694
17153
  dequeue,
16695
17154
  deserialize,
16696
17155
  deserializeField,
16697
17156
  discard,
16698
17157
  documentSlice,
17158
+ documentTeamLinkReducer,
17159
+ documentTeamLinkSlice,
16699
17160
  documentsReducer,
16700
17161
  downloadFile,
16701
17162
  downloadInMemoryFile,
@@ -16748,6 +17209,8 @@ export {
16748
17209
  issueToSearchResult,
16749
17210
  issueTypeReducer,
16750
17211
  issueTypeSlice,
17212
+ issueTypeTeamLinkReducer,
17213
+ issueTypeTeamLinkSlice,
16751
17214
  licenseReducer,
16752
17215
  licenseSlice,
16753
17216
  linkStageToForm,
@@ -16897,7 +17360,12 @@ export {
16897
17360
  selectDocument,
16898
17361
  selectDocumentAttachment,
16899
17362
  selectDocumentAttachmentMapping,
17363
+ selectDocumentTeamLinks,
17364
+ selectDocumentTeamLinksMapping,
17365
+ selectDocumentTeamLinksOfDocument,
17366
+ selectDocumentTeamLinksOfTeam,
16900
17367
  selectDocuments,
17368
+ selectDocumentsLinkedToTeam,
16901
17369
  selectDocumentsMapping,
16902
17370
  selectEmailDomainsAsMapping,
16903
17371
  selectEnableClustering,
@@ -16943,7 +17411,12 @@ export {
16943
17411
  selectIssueMapping,
16944
17412
  selectIssueType,
16945
17413
  selectIssueTypeMapping,
17414
+ selectIssueTypeTeamLinkMapping,
17415
+ selectIssueTypeTeamLinks,
17416
+ selectIssueTypeTeamLinksOfIssueType,
17417
+ selectIssueTypeTeamLinksOfTeam,
16946
17418
  selectIssueTypes,
17419
+ selectIssueTypesLinkedToTeam,
16947
17420
  selectIssueTypesOfOrganization,
16948
17421
  selectIssueUpdateMapping,
16949
17422
  selectIssueUpdatesOfIssue,
@@ -17006,13 +17479,21 @@ export {
17006
17479
  selectStagesFromStageIds,
17007
17480
  selectTeam,
17008
17481
  selectTeams,
17482
+ selectTeamsLinkedToDocument,
17483
+ selectTeamsLinkedToIssueType,
17484
+ selectTeamsLinkedToUserForm,
17009
17485
  selectTeamsMapping,
17010
17486
  selectTeamsOfOrganization,
17011
17487
  selectTeamsOfUser,
17012
17488
  selectUploadUrl,
17013
17489
  selectUsedColors,
17014
17490
  selectUser,
17491
+ selectUserFormLinksOfForm,
17492
+ selectUserFormLinksOfTeam,
17015
17493
  selectUserFormRevisionAttachmentsMapping,
17494
+ selectUserFormTeamLinkMapping,
17495
+ selectUserFormTeamLinks,
17496
+ selectUserFormsLinkedToTeam,
17016
17497
  selectUsersAsMapping,
17017
17498
  selectVisibleStatuses,
17018
17499
  selectVisibleUserIds,
@@ -17034,6 +17515,8 @@ export {
17034
17515
  setCreateProjectType,
17035
17516
  setCurrentUser,
17036
17517
  setDocumentAttachments,
17518
+ setDocumentTeamLink,
17519
+ setDocumentTeamLinks,
17037
17520
  setDocuments,
17038
17521
  setEmailDomains,
17039
17522
  setEnableClustering,
@@ -17053,6 +17536,8 @@ export {
17053
17536
  setIssueComment,
17054
17537
  setIssueComments,
17055
17538
  setIssueType,
17539
+ setIssueTypeTeamLink,
17540
+ setIssueTypeTeamLinks,
17056
17541
  setIssueTypes,
17057
17542
  setIssueUpdates,
17058
17543
  setIssues,
@@ -17074,6 +17559,8 @@ export {
17074
17559
  setTokens,
17075
17560
  setTourStep,
17076
17561
  setUploadUrl,
17562
+ setUserFormTeamLink,
17563
+ setUserFormTeamLinks,
17077
17564
  setUsers,
17078
17565
  setVisibleStatuses,
17079
17566
  setVisibleUserIds,
@@ -17122,6 +17609,8 @@ export {
17122
17609
  useFormikInput,
17123
17610
  useMemoCompare,
17124
17611
  useSDK,
17612
+ userFormTeamLinkReducer,
17613
+ userFormTeamLinkSlice,
17125
17614
  userReducer,
17126
17615
  userSlice,
17127
17616
  valueIsFile,