@overmap-ai/core 1.0.38-projects-licensing.3 → 1.0.38

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.
@@ -626,15 +626,15 @@ const wrapMigration = (migrator) => (state) => {
626
626
  };
627
627
  const migrations = [initialVersioning, signOut, signOut, createOutboxState];
628
628
  const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
629
- const initialState$m = {
629
+ const initialState$l = {
630
630
  accessToken: "",
631
631
  refreshToken: "",
632
632
  isLoggedIn: false
633
633
  };
634
634
  const authSlice = createSlice({
635
635
  name: "auth",
636
- initialState: initialState$m,
637
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
636
+ initialState: initialState$l,
637
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
638
638
  reducers: {
639
639
  setTokens: (state, action) => {
640
640
  state.accessToken = action.payload.accessToken;
@@ -1338,7 +1338,7 @@ const getLocalRelativeDateString = memoize((date, min, max) => {
1338
1338
  return getLocalDateString(date);
1339
1339
  return relative.format(days, "days");
1340
1340
  });
1341
- const initialState$l = {
1341
+ const initialState$k = {
1342
1342
  categories: {},
1343
1343
  usedCategoryColors: [],
1344
1344
  categoryVisibility: {
@@ -1348,8 +1348,8 @@ const initialState$l = {
1348
1348
  };
1349
1349
  const categorySlice = createSlice({
1350
1350
  name: "categories",
1351
- initialState: initialState$l,
1352
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
1351
+ initialState: initialState$k,
1352
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
1353
1353
  reducers: {
1354
1354
  setCategories: (state, action) => {
1355
1355
  if (!Array.isArray(action.payload))
@@ -1482,13 +1482,13 @@ const selectHiddenCategoryCount = (state) => {
1482
1482
  return hiddenCategoryCount;
1483
1483
  };
1484
1484
  const categoryReducer = categorySlice.reducer;
1485
- const initialState$k = {
1485
+ const initialState$j = {
1486
1486
  components: {}
1487
1487
  };
1488
1488
  const componentSlice = createSlice({
1489
1489
  name: "components",
1490
- initialState: initialState$k,
1491
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
1490
+ initialState: initialState$j,
1491
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
1492
1492
  reducers: {
1493
1493
  addComponent: (state, action) => {
1494
1494
  state.components[action.payload.offline_id] = action.payload;
@@ -1600,13 +1600,13 @@ const {
1600
1600
  removeAllComponentsOfType
1601
1601
  } = componentSlice.actions;
1602
1602
  const componentReducer = componentSlice.reducer;
1603
- const initialState$j = {
1603
+ const initialState$i = {
1604
1604
  completionsByComponentId: {}
1605
1605
  };
1606
1606
  const componentStageCompletionSlice = createSlice({
1607
1607
  name: "componentStageCompletions",
1608
- initialState: initialState$j,
1609
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
1608
+ initialState: initialState$i,
1609
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
1610
1610
  reducers: {
1611
1611
  addStageCompletion: (state, action) => {
1612
1612
  let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
@@ -1657,13 +1657,13 @@ const selectCompletedStageIdsForComponent = (component) => (state) => {
1657
1657
  return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1658
1658
  };
1659
1659
  const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1660
- const initialState$i = {
1660
+ const initialState$h = {
1661
1661
  stages: {}
1662
1662
  };
1663
1663
  const componentStageSlice = createSlice({
1664
1664
  name: "componentStages",
1665
- initialState: initialState$i,
1666
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
1665
+ initialState: initialState$h,
1666
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
1667
1667
  reducers: {
1668
1668
  addStages: (state, action) => {
1669
1669
  Object.assign(state.stages, toOfflineIdRecord(action.payload));
@@ -1723,14 +1723,14 @@ const selectStagesFromStageIds = restructureCreateSelectorWithArgs(
1723
1723
  );
1724
1724
  const { addStages, updateStages, removeStages } = componentStageSlice.actions;
1725
1725
  const componentStageReducer = componentStageSlice.reducer;
1726
- const initialState$h = {
1726
+ const initialState$g = {
1727
1727
  componentTypes: {},
1728
1728
  hiddenComponentTypeIds: {}
1729
1729
  };
1730
1730
  const componentTypeSlice = createSlice({
1731
1731
  name: "componentTypes",
1732
- initialState: initialState$h,
1733
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
1732
+ initialState: initialState$g,
1733
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
1734
1734
  reducers: {
1735
1735
  addComponentType: (state, action) => {
1736
1736
  state.componentTypes[action.payload.offline_id] = action.payload;
@@ -1789,13 +1789,13 @@ const selectComponentTypesByName = restructureCreateSelectorWithArgs(
1789
1789
  const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
1790
1790
  const { addComponentType, setComponentTypes, toggleComponentTypeVisibility, deleteComponentType } = componentTypeSlice.actions;
1791
1791
  const componentTypeReducer = componentTypeSlice.reducer;
1792
- const initialState$g = {
1792
+ const initialState$f = {
1793
1793
  workspaces: {},
1794
1794
  activeWorkspaceId: null
1795
1795
  };
1796
1796
  const workspaceSlice = createSlice({
1797
1797
  name: "workspace",
1798
- initialState: initialState$g,
1798
+ initialState: initialState$f,
1799
1799
  // The `reducers` field lets us define reducers and generate associated actions
1800
1800
  reducers: {
1801
1801
  setWorkspaces: (state, action) => {
@@ -1852,20 +1852,21 @@ const selectPermittedWorkspaceIds = createSelector(
1852
1852
  );
1853
1853
  const workspaceReducer = workspaceSlice.reducer;
1854
1854
  const maxRecentIssues = 10;
1855
- const initialState$f = {
1855
+ const initialState$e = {
1856
1856
  issues: {},
1857
1857
  attachments: {},
1858
1858
  comments: {},
1859
1859
  visibleStatuses: [IssueStatus.BACKLOG, IssueStatus.SELECTED],
1860
+ isFetchingInitialData: false,
1860
1861
  visibleUserIds: null,
1861
1862
  recentIssueIds: [],
1862
1863
  activeIssueId: null
1863
1864
  };
1864
1865
  const issueSlice = createSlice({
1865
1866
  name: "issues",
1866
- initialState: initialState$f,
1867
+ initialState: initialState$e,
1867
1868
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
1868
- Object.assign(state, initialState$f);
1869
+ Object.assign(state, initialState$e);
1869
1870
  }),
1870
1871
  reducers: {
1871
1872
  setIssues: (state, action) => {
@@ -1944,6 +1945,9 @@ const issueSlice = createSlice({
1944
1945
  setVisibleStatuses: (state, action) => {
1945
1946
  state.visibleStatuses = action.payload;
1946
1947
  },
1948
+ setIsFetchingInitialData: (state, action) => {
1949
+ state.isFetchingInitialData = action.payload;
1950
+ },
1947
1951
  setVisibleUserIds: (state, action) => {
1948
1952
  state.visibleUserIds = [...new Set(action.payload)];
1949
1953
  },
@@ -2002,6 +2006,7 @@ const {
2002
2006
  resetRecentIssues,
2003
2007
  setActiveIssueId,
2004
2008
  setAttachments,
2009
+ setIsFetchingInitialData,
2005
2010
  setIssueComments,
2006
2011
  setIssues,
2007
2012
  setVisibleStatuses,
@@ -2100,6 +2105,7 @@ const selectIssue = restructureCreateSelectorWithArgs(
2100
2105
  return mapping[id];
2101
2106
  })
2102
2107
  );
2108
+ const selectIsFetchingInitialData = (state) => state.issueReducer.isFetchingInitialData;
2103
2109
  const selectAllAttachments = createSelector([selectIssueAttachmentMapping], (mapping) => Object.values(mapping));
2104
2110
  const searchIssues = restructureCreateSelectorWithArgs(
2105
2111
  createSelector(
@@ -2191,15 +2197,15 @@ const selectRecentIssuesAsSearchResults = createSelector(
2191
2197
  }
2192
2198
  );
2193
2199
  const issueReducer = issueSlice.reducer;
2194
- const initialState$e = {
2200
+ const initialState$d = {
2195
2201
  s3Urls: {}
2196
2202
  };
2197
2203
  const msPerHour = 1e3 * 60 * 60;
2198
2204
  const msPerWeek = msPerHour * 24 * 7;
2199
2205
  const fileSlice = createSlice({
2200
2206
  name: "file",
2201
- initialState: initialState$e,
2202
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2207
+ initialState: initialState$d,
2208
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2203
2209
  reducers: {
2204
2210
  setUploadUrl: (state, action) => {
2205
2211
  const { url, fields, sha1 } = action.payload;
@@ -2226,7 +2232,7 @@ const selectUploadUrl = (sha1) => (state) => {
2226
2232
  return url;
2227
2233
  };
2228
2234
  const fileReducer = fileSlice.reducer;
2229
- const initialState$d = {
2235
+ const initialState$c = {
2230
2236
  // TODO: Change first MapStyle.SATELLITE to MaptStyle.None when project creation map is fixed
2231
2237
  mapStyle: MapStyle.SATELLITE,
2232
2238
  showTooltips: false,
@@ -2234,8 +2240,8 @@ const initialState$d = {
2234
2240
  };
2235
2241
  const mapSlice = createSlice({
2236
2242
  name: "map",
2237
- initialState: initialState$d,
2238
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2243
+ initialState: initialState$c,
2244
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
2239
2245
  reducers: {
2240
2246
  setMapStyle: (state, action) => {
2241
2247
  state.mapStyle = action.payload;
@@ -2277,23 +2283,7 @@ var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
2277
2283
  VerificationCodeType2[VerificationCodeType2["RESET_PASSWORD"] = 10] = "RESET_PASSWORD";
2278
2284
  return VerificationCodeType2;
2279
2285
  })(VerificationCodeType || {});
2280
- var PaddleCheckoutEvent = /* @__PURE__ */ ((PaddleCheckoutEvent2) => {
2281
- PaddleCheckoutEvent2["COMPLETED"] = "checkout.completed";
2282
- PaddleCheckoutEvent2["CLOSED"] = "checkout.closed";
2283
- return PaddleCheckoutEvent2;
2284
- })(PaddleCheckoutEvent || {});
2285
- var LicenseLevel = /* @__PURE__ */ ((LicenseLevel2) => {
2286
- LicenseLevel2[LicenseLevel2["PRO"] = 0] = "PRO";
2287
- return LicenseLevel2;
2288
- })(LicenseLevel || {});
2289
- var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
2290
- LicenseStatus2[LicenseStatus2["ACTIVE"] = 0] = "ACTIVE";
2291
- LicenseStatus2[LicenseStatus2["PAUSED"] = 2] = "PAUSED";
2292
- LicenseStatus2[LicenseStatus2["CANCELLED"] = 4] = "CANCELLED";
2293
- LicenseStatus2[LicenseStatus2["INACTIVE"] = 6] = "INACTIVE";
2294
- return LicenseStatus2;
2295
- })(LicenseStatus || {});
2296
- const initialState$c = {
2286
+ const initialState$b = {
2297
2287
  users: {},
2298
2288
  currentUser: {
2299
2289
  id: 0,
@@ -2304,8 +2294,8 @@ const initialState$c = {
2304
2294
  };
2305
2295
  const userSlice = createSlice({
2306
2296
  name: "users",
2307
- initialState: initialState$c,
2308
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
2297
+ initialState: initialState$b,
2298
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
2309
2299
  reducers: {
2310
2300
  setUsers: (state, action) => {
2311
2301
  const usersMapping = {};
@@ -2367,13 +2357,13 @@ const selectUser = (userId) => (state) => {
2367
2357
  const selectUsersAsMapping = (state) => state.userReducer.users;
2368
2358
  const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
2369
2359
  const userReducer = userSlice.reducer;
2370
- const initialState$b = {
2360
+ const initialState$a = {
2371
2361
  organizationAccesses: {}
2372
2362
  };
2373
2363
  const organizationAccessSlice = createSlice({
2374
2364
  name: "organizationAccess",
2375
- initialState: initialState$b,
2376
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
2365
+ initialState: initialState$a,
2366
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
2377
2367
  reducers: {
2378
2368
  setOrganizationAccesses: (state, action) => {
2379
2369
  if (!Array.isArray(action.payload))
@@ -2436,64 +2426,151 @@ const selectOrganizationAccessUserMapping = (state) => {
2436
2426
  return organizationAccesses;
2437
2427
  };
2438
2428
  const organizationAccessReducer = organizationAccessSlice.reducer;
2439
- const initialState$a = {
2440
- licenses: {}
2429
+ const initialState$9 = {
2430
+ organizations: {},
2431
+ activeOrganizationId: null
2441
2432
  };
2442
- const licenseSlice = createSlice({
2443
- name: "license",
2444
- initialState: initialState$a,
2445
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
2433
+ const organizationSlice = createSlice({
2434
+ name: "organizations",
2435
+ initialState: initialState$9,
2436
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
2446
2437
  reducers: {
2447
- setLicenses: (state, action) => {
2448
- if (!Array.isArray(action.payload))
2449
- throw new Error("Expected an array of Licenses");
2450
- if (action.payload.filter(onlyUniqueOfflineIds).length !== action.payload.length) {
2451
- throw new Error("Tried to use setLicenses reducer with duplicate ID's");
2452
- }
2453
- const licenses = {};
2454
- for (const license of action.payload) {
2455
- licenses[license.offline_id] = license;
2438
+ setOrganizations: (state, action) => {
2439
+ for (const org of action.payload) {
2440
+ state.organizations[org.id] = org;
2456
2441
  }
2457
- state.licenses = licenses;
2458
2442
  },
2459
- addLicenses: (state, action) => {
2460
- for (const license of action.payload) {
2461
- state.licenses[license.offline_id] = license;
2443
+ updateActiveOrganization: (state, action) => {
2444
+ if (!state.activeOrganizationId) {
2445
+ throw new Error("Cannot update name of active organization. Active organization ID does not exist");
2462
2446
  }
2463
- },
2464
- updateLicense: (state, action) => {
2465
- if (!(action.payload.offline_id in state.licenses)) {
2466
- throw new Error("Tried to update license that does not exist.");
2447
+ if (state.activeOrganizationId !== action.payload.id) {
2448
+ throw new Error("Tried updating active organization with different organization");
2467
2449
  }
2468
- state.licenses[action.payload.offline_id] = action.payload;
2450
+ state.organizations[state.activeOrganizationId] = action.payload;
2451
+ },
2452
+ setActiveOrganizationId: (state, action) => {
2453
+ state.activeOrganizationId = action.payload;
2469
2454
  }
2470
2455
  }
2471
2456
  });
2472
- const { setLicenses, addLicenses, updateLicense } = licenseSlice.actions;
2473
- const selectLicenses = (state) => {
2474
- return state.licenseReducer.licenses;
2475
- };
2476
- const selectLicense = (licenseId) => (state) => state.licenseReducer.licenses[licenseId];
2477
- const selectActiveLicense = (state) => Object.values(state.licenseReducer.licenses).find(
2478
- (license) => license.project === state.projectReducer.activeProjectId
2479
- ) ?? null;
2480
- const selectLicenseForProject = (projectId) => (state) => Object.values(state.licenseReducer.licenses).find((license) => license.project === projectId) ?? null;
2481
- const selectActiveStatusLicenses = createSelector(
2482
- [selectLicenses],
2483
- (licenses) => Object.values(licenses).filter((license) => license.is_active)
2457
+ const { setOrganizations, setActiveOrganizationId, updateActiveOrganization } = organizationSlice.actions;
2458
+ const selectActiveOrganizationId = (state) => {
2459
+ return state.organizationReducer.activeOrganizationId;
2460
+ };
2461
+ const selectOrganizations = (state) => {
2462
+ return Object.values(state.organizationReducer.organizations);
2463
+ };
2464
+ const selectOrganizationsWithAccess = createSelector(
2465
+ [selectOrganizations],
2466
+ (organizations) => Object.values(organizations).filter((organization) => organization.has_access)
2467
+ );
2468
+ const selectActiveOrganization = (state) => {
2469
+ const id = selectActiveOrganizationId(state);
2470
+ if (!id) {
2471
+ return null;
2472
+ }
2473
+ const organization = state.organizationReducer.organizations[id];
2474
+ if (!organization) {
2475
+ return null;
2476
+ }
2477
+ return organization;
2478
+ };
2479
+ const selectOrganizationUsersIds = createSelector(
2480
+ [selectOrganizationAccesses],
2481
+ (organizationAccesses) => Object.values(organizationAccesses).map((organizationAccess) => organizationAccess.user)
2484
2482
  );
2485
- const selectLicensesForProjectsMapping = createSelector(
2486
- [selectLicenses],
2487
- (licenses) => Object.values(licenses).filter((license) => license.project).reduce((accum, license) => ({ ...accum, [license.project]: license }), {})
2483
+ const selectOrganizationUsersAsMapping = createSelector(
2484
+ [selectOrganizationUsersIds, selectUsersAsMapping],
2485
+ (organizationUserIds, users) => organizationUserIds.reduce((accum, userId) => ({ ...accum, [userId]: users[userId] }), {})
2488
2486
  );
2489
- const licenseReducer = licenseSlice.reducer;
2490
- const initialState$9 = {
2487
+ const selectSortedOrganizationUsers = createSelector(
2488
+ [selectCurrentUser, selectOrganizationUsersAsMapping, selectOrganizationAccessUserMapping],
2489
+ (currentUser, userMapping, organizationAccessMapping) => {
2490
+ return Object.values(userMapping).sort((userA, userB) => {
2491
+ if (userA.id === currentUser.id) {
2492
+ return -1;
2493
+ } else if (userB.id === currentUser.id) {
2494
+ return 1;
2495
+ }
2496
+ const organizationAccessesA = organizationAccessMapping[userA.id];
2497
+ const organizationAccessesB = organizationAccessMapping[userB.id];
2498
+ if ((organizationAccessesA == null ? void 0 : organizationAccessesA.access_level) === (organizationAccessesB == null ? void 0 : organizationAccessesB.access_level)) {
2499
+ return userA.username.localeCompare(userB.username);
2500
+ }
2501
+ if ((organizationAccessesA == null ? void 0 : organizationAccessesA.access_level) === OrganizationAccessLevel.ADMIN) {
2502
+ return -1;
2503
+ }
2504
+ return 1;
2505
+ });
2506
+ }
2507
+ );
2508
+ const selectOrganization = (id) => (state) => {
2509
+ return state.organizationReducer.organizations[id];
2510
+ };
2511
+ const organizationReducer = organizationSlice.reducer;
2512
+ const createOfflineAction = (request2, baseUrl) => {
2513
+ const requestWithUuid = request2.uuid ? request2 : { ...request2, uuid: v4() };
2514
+ return {
2515
+ payload: requestWithUuid,
2516
+ type: "",
2517
+ meta: {
2518
+ offline: {
2519
+ effect: {
2520
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2521
+ request: requestWithUuid,
2522
+ BASE_URL: baseUrl
2523
+ }
2524
+ }
2525
+ }
2526
+ };
2527
+ };
2528
+ const initialState$8 = {
2529
+ deletedRequests: [],
2530
+ latestRetryTime: 0
2531
+ };
2532
+ const outboxSlice = createSlice({
2533
+ name: "outbox",
2534
+ initialState: initialState$8,
2535
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
2536
+ reducers: {
2537
+ // enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
2538
+ // Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
2539
+ // Then this reducer enqueueRequest() is responsible for adding the actual request data to the outbox
2540
+ enqueueRequest: {
2541
+ reducer: (state, _action) => {
2542
+ return state;
2543
+ },
2544
+ prepare: (payload) => {
2545
+ console.debug("Preparing to enqueue request", payload);
2546
+ const { BASE_URL, ...rest } = payload;
2547
+ return createOfflineAction(rest, BASE_URL);
2548
+ }
2549
+ },
2550
+ markForDeletion(state, action) {
2551
+ state.deletedRequests.push(action.payload);
2552
+ },
2553
+ markAsDeleted(state, action) {
2554
+ const index2 = state.deletedRequests.indexOf(action.payload);
2555
+ if (index2 !== -1)
2556
+ state.deletedRequests.splice(index2, 1);
2557
+ },
2558
+ _setLatestRetryTime: (state, action) => {
2559
+ state.latestRetryTime = action.payload;
2560
+ }
2561
+ }
2562
+ });
2563
+ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
2564
+ const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
2565
+ const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
2566
+ const outboxReducer = outboxSlice.reducer;
2567
+ const initialState$7 = {
2491
2568
  projectAccesses: {}
2492
2569
  };
2493
2570
  const projectAccessSlice = createSlice({
2494
2571
  name: "projectAccess",
2495
- initialState: initialState$9,
2496
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
2572
+ initialState: initialState$7,
2573
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
2497
2574
  reducers: {
2498
2575
  setProjectAccesses: (state, action) => {
2499
2576
  if (!Array.isArray(action.payload))
@@ -2561,7 +2638,7 @@ const selectProjectAccessUserMapping = (state) => {
2561
2638
  return projectAccesses;
2562
2639
  };
2563
2640
  const projectAccessReducer = projectAccessSlice.reducer;
2564
- const initialState$8 = {
2641
+ const initialState$6 = {
2565
2642
  projects: {},
2566
2643
  activeProjectId: null,
2567
2644
  recentProjectIds: [],
@@ -2570,7 +2647,7 @@ const initialState$8 = {
2570
2647
  };
2571
2648
  const projectSlice = createSlice({
2572
2649
  name: "projects",
2573
- initialState: initialState$8,
2650
+ initialState: initialState$6,
2574
2651
  reducers: {
2575
2652
  setProjects: (state, action) => {
2576
2653
  const projectsMap = {};
@@ -2616,27 +2693,6 @@ const projectSlice = createSlice({
2616
2693
  } else {
2617
2694
  throw new Error("Accept project invite: user is not in this project");
2618
2695
  }
2619
- },
2620
- addActiveProjectIssuesCount: (state, action) => {
2621
- if (!state.activeProjectId || !(state.activeProjectId in state.projects)) {
2622
- throw new Error("Update issues count: no active project");
2623
- }
2624
- if (!state.projects[state.activeProjectId].issues_count) {
2625
- state.projects[state.activeProjectId].issues_count = action.payload;
2626
- } else {
2627
- state.projects[state.activeProjectId].issues_count += action.payload;
2628
- }
2629
- },
2630
- addActiveProjectFormSubmissionsCount: (state, action) => {
2631
- if (state.activeProjectId && state.activeProjectId in state.projects) {
2632
- if (!state.projects[state.activeProjectId].form_submissions_count) {
2633
- state.projects[state.activeProjectId].form_submissions_count = action.payload;
2634
- } else {
2635
- state.projects[state.activeProjectId].form_submissions_count += action.payload;
2636
- }
2637
- } else {
2638
- throw new Error("Update form submissions count: no active project");
2639
- }
2640
2696
  }
2641
2697
  }
2642
2698
  });
@@ -2647,9 +2703,7 @@ const {
2647
2703
  setActiveProjectId,
2648
2704
  setCreateProjectType,
2649
2705
  deleteProject,
2650
- acceptProjectInvite,
2651
- addActiveProjectIssuesCount,
2652
- addActiveProjectFormSubmissionsCount
2706
+ acceptProjectInvite
2653
2707
  } = projectSlice.actions;
2654
2708
  const selectProjects = (state) => state.projectReducer.projects;
2655
2709
  const selectActiveProjectId = (state) => state.projectReducer.activeProjectId;
@@ -2713,171 +2767,6 @@ const selectSortedProjectUsers = createSelector(
2713
2767
  });
2714
2768
  }
2715
2769
  );
2716
- const initialState$7 = {
2717
- organizations: {},
2718
- activeOrganizationId: null
2719
- };
2720
- const organizationSlice = createSlice({
2721
- name: "organizations",
2722
- initialState: initialState$7,
2723
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
2724
- reducers: {
2725
- setOrganizations: (state, action) => {
2726
- for (const org of action.payload) {
2727
- state.organizations[org.id] = org;
2728
- }
2729
- },
2730
- updateActiveOrganization: (state, action) => {
2731
- if (!state.activeOrganizationId) {
2732
- throw new Error("Cannot update name of active organization. Active organization ID does not exist");
2733
- }
2734
- if (state.activeOrganizationId !== action.payload.id) {
2735
- throw new Error("Tried updating active organization with different organization");
2736
- }
2737
- state.organizations[state.activeOrganizationId] = action.payload;
2738
- },
2739
- setActiveOrganizationId: (state, action) => {
2740
- state.activeOrganizationId = action.payload;
2741
- }
2742
- }
2743
- });
2744
- const { setOrganizations, setActiveOrganizationId, updateActiveOrganization } = organizationSlice.actions;
2745
- const selectActiveOrganizationId = (state) => {
2746
- return state.organizationReducer.activeOrganizationId;
2747
- };
2748
- const selectOrganizations = (state) => {
2749
- return Object.values(state.organizationReducer.organizations);
2750
- };
2751
- const selectOrganizationsMapping = (state) => {
2752
- return state.organizationReducer.organizations;
2753
- };
2754
- const selectOrganizationsWithAccess = createSelector(
2755
- [selectOrganizations],
2756
- (organizations) => Object.values(organizations).filter((organization) => organization.has_access)
2757
- );
2758
- const selectActiveOrganization = (state) => {
2759
- const id = selectActiveOrganizationId(state);
2760
- if (!id) {
2761
- return null;
2762
- }
2763
- const organization = state.organizationReducer.organizations[id];
2764
- if (!organization) {
2765
- return null;
2766
- }
2767
- return organization;
2768
- };
2769
- const selectOrganizationUsersIds = createSelector(
2770
- [selectOrganizationAccesses],
2771
- (organizationAccesses) => Object.values(organizationAccesses).map((organizationAccess) => organizationAccess.user)
2772
- );
2773
- const selectActiveOrganizationProjects = createSelector(
2774
- [selectProjects, selectActiveOrganizationId],
2775
- (projects, activeOrganizationId) => activeOrganizationId ? Object.values(projects).filter((project) => project.owner_organization === activeOrganizationId) : []
2776
- );
2777
- const selectActiveOrganizationLicenses = createSelector(
2778
- [selectActiveOrganizationId, selectLicenses],
2779
- (activeOrganizationId, licenses) => !activeOrganizationId ? [] : Object.values(licenses).filter((license) => license.organization_owner === activeOrganizationId)
2780
- );
2781
- const selectSortedOrganizationLicenses = createSelector(
2782
- [selectActiveOrganizationLicenses, selectProjects],
2783
- (licences, projects) => licences.sort((licenseA, licenseB) => {
2784
- if (!licenseA.project) {
2785
- return 1;
2786
- }
2787
- if (!licenseB.project) {
2788
- return -1;
2789
- }
2790
- return projects[licenseA.project].name.toLowerCase().localeCompare(
2791
- projects[licenseB.project].name.toLowerCase(),
2792
- void 0,
2793
- { numeric: true }
2794
- );
2795
- })
2796
- );
2797
- const selectOrganizationUsersAsMapping = createSelector(
2798
- [selectOrganizationUsersIds, selectUsersAsMapping],
2799
- (organizationUserIds, users) => organizationUserIds.reduce((accum, userId) => ({ ...accum, [userId]: users[userId] }), {})
2800
- );
2801
- const selectSortedOrganizationUsers = createSelector(
2802
- [selectCurrentUser, selectOrganizationUsersAsMapping, selectOrganizationAccessUserMapping],
2803
- (currentUser, userMapping, organizationAccessMapping) => {
2804
- return Object.values(userMapping).sort((userA, userB) => {
2805
- if (userA.id === currentUser.id) {
2806
- return -1;
2807
- } else if (userB.id === currentUser.id) {
2808
- return 1;
2809
- }
2810
- const organizationAccessesA = organizationAccessMapping[userA.id];
2811
- const organizationAccessesB = organizationAccessMapping[userB.id];
2812
- if ((organizationAccessesA == null ? void 0 : organizationAccessesA.access_level) === (organizationAccessesB == null ? void 0 : organizationAccessesB.access_level)) {
2813
- return userA.username.localeCompare(userB.username);
2814
- }
2815
- if ((organizationAccessesA == null ? void 0 : organizationAccessesA.access_level) === OrganizationAccessLevel.ADMIN) {
2816
- return -1;
2817
- }
2818
- return 1;
2819
- });
2820
- }
2821
- );
2822
- const selectOrganization = (id) => (state) => {
2823
- return state.organizationReducer.organizations[id];
2824
- };
2825
- const organizationReducer = organizationSlice.reducer;
2826
- const createOfflineAction = (request2, baseUrl) => {
2827
- const requestWithUuid = request2.uuid ? request2 : { ...request2, uuid: v4() };
2828
- return {
2829
- payload: requestWithUuid,
2830
- type: "",
2831
- meta: {
2832
- offline: {
2833
- effect: {
2834
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2835
- request: requestWithUuid,
2836
- BASE_URL: baseUrl
2837
- }
2838
- }
2839
- }
2840
- };
2841
- };
2842
- const initialState$6 = {
2843
- deletedRequests: [],
2844
- latestRetryTime: 0
2845
- };
2846
- const outboxSlice = createSlice({
2847
- name: "outbox",
2848
- initialState: initialState$6,
2849
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
2850
- reducers: {
2851
- // enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
2852
- // Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
2853
- // Then this reducer enqueueRequest() is responsible for adding the actual request data to the outbox
2854
- enqueueRequest: {
2855
- reducer: (state, _action) => {
2856
- return state;
2857
- },
2858
- prepare: (payload) => {
2859
- console.debug("Preparing to enqueue request", payload);
2860
- const { BASE_URL, ...rest } = payload;
2861
- return createOfflineAction(rest, BASE_URL);
2862
- }
2863
- },
2864
- markForDeletion(state, action) {
2865
- state.deletedRequests.push(action.payload);
2866
- },
2867
- markAsDeleted(state, action) {
2868
- const index2 = state.deletedRequests.indexOf(action.payload);
2869
- if (index2 !== -1)
2870
- state.deletedRequests.splice(index2, 1);
2871
- },
2872
- _setLatestRetryTime: (state, action) => {
2873
- state.latestRetryTime = action.payload;
2874
- }
2875
- }
2876
- });
2877
- const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
2878
- const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
2879
- const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
2880
- const outboxReducer = outboxSlice.reducer;
2881
2770
  const initialState$5 = {
2882
2771
  projectFiles: {},
2883
2772
  activeProjectFileId: null,
@@ -3014,9 +2903,7 @@ const initialState$3 = {
3014
2903
  Components: false,
3015
2904
  Experimental: false
3016
2905
  },
3017
- appearance: "dark",
3018
- isFetchingInitialData: false,
3019
- isLoading: false
2906
+ appearance: "dark"
3020
2907
  };
3021
2908
  const settingSlice = createSlice({
3022
2909
  name: "settings",
@@ -3040,12 +2927,6 @@ const settingSlice = createSlice({
3040
2927
  },
3041
2928
  setAppearance: (state, action) => {
3042
2929
  state.appearance = action.payload;
3043
- },
3044
- setIsFetchingInitialData: (state, action) => {
3045
- state.isFetchingInitialData = action.payload;
3046
- },
3047
- setIsLoading: (state, action) => {
3048
- state.isLoading = action.payload;
3049
2930
  }
3050
2931
  }
3051
2932
  });
@@ -3054,9 +2935,7 @@ const {
3054
2935
  setEnablePlacementMode,
3055
2936
  setSectionExpanded,
3056
2937
  setEnableClustering,
3057
- setAppearance,
3058
- setIsFetchingInitialData,
3059
- setIsLoading
2938
+ setAppearance
3060
2939
  } = settingSlice.actions;
3061
2940
  const selectEnablePlacementMode = (state) => state.settingReducer.placementMode;
3062
2941
  const selectEnableDuplicateIssues = (state) => state.settingReducer.useIssueTemplate;
@@ -3065,8 +2944,6 @@ const selectExpandedSections = (state) => state.settingReducer.expandedSections;
3065
2944
  const selectEnableClustering = (state) => state.settingReducer.enableClustering;
3066
2945
  const selectAppearance = (state) => state.settingReducer.appearance;
3067
2946
  const settingReducer = settingSlice.reducer;
3068
- const selectIsFetchingInitialData = (state) => state.settingReducer.isFetchingInitialData;
3069
- const selectIsLoading = (state) => state.settingReducer.isLoading;
3070
2947
  const LATEST_REVISION_CACHE = {};
3071
2948
  function considerCachingRevision(revision, formId2, preferPending = false) {
3072
2949
  var _a2;
@@ -3468,8 +3345,7 @@ const overmapReducers = {
3468
3345
  userFormReducer,
3469
3346
  userReducer,
3470
3347
  workspaceReducer,
3471
- emailDomainsReducer,
3472
- licenseReducer
3348
+ emailDomainsReducer
3473
3349
  };
3474
3350
  const overmapReducer = combineReducers(overmapReducers);
3475
3351
  const resetStore = "RESET";
@@ -4923,7 +4799,6 @@ class IssueService extends BaseApiService {
4923
4799
  });
4924
4800
  store.dispatch(addIssue(issuePayload));
4925
4801
  store.dispatch(addToRecentIssues(issuePayload.offline_id));
4926
- store.dispatch(addActiveProjectIssuesCount(1));
4927
4802
  const promise = this.enqueueRequest({
4928
4803
  description: "Create issue",
4929
4804
  method: HttpMethod.POST,
@@ -4933,7 +4808,6 @@ class IssueService extends BaseApiService {
4933
4808
  },
4934
4809
  payload: issuePayload,
4935
4810
  blockers: [
4936
- "add-issue",
4937
4811
  ...issuePayload.index_workspace ? [issuePayload.index_workspace] : [],
4938
4812
  ...issuePayload.visible_in_workspaces
4939
4813
  ],
@@ -4951,7 +4825,6 @@ class IssueService extends BaseApiService {
4951
4825
  });
4952
4826
  }
4953
4827
  store.dispatch(removeIssue(issuePayload.offline_id));
4954
- store.dispatch(addActiveProjectIssuesCount(-1));
4955
4828
  throw error2;
4956
4829
  });
4957
4830
  return [issuePayload, promise];
@@ -4990,18 +4863,16 @@ class IssueService extends BaseApiService {
4990
4863
  return [fullIssue, promise];
4991
4864
  }
4992
4865
  async remove(id) {
4993
- const { store } = this.client;
4994
- const state = store.getState();
4866
+ const state = this.client.store.getState();
4995
4867
  const backup = state.issueReducer.issues[id];
4996
4868
  if (!backup) {
4997
4869
  throw new Error(`No issue with id ${id} found in the store`);
4998
4870
  }
4999
4871
  const attachments = Object.values(state.issueReducer.attachments).filter((a) => a.issue_id === id);
5000
4872
  const attachmentsOfIssue = selectPhotoAttachmentsOfIssue(id)(state);
5001
- store.dispatch(removeIssue(id));
5002
- store.dispatch(addActiveProjectIssuesCount(-1));
4873
+ this.client.store.dispatch(removeIssue(id));
5003
4874
  if (attachmentsOfIssue) {
5004
- store.dispatch(removeAttachmentsOfIssue(id));
4875
+ this.client.store.dispatch(removeAttachmentsOfIssue(id));
5005
4876
  }
5006
4877
  try {
5007
4878
  return await this.enqueueRequest({
@@ -5012,9 +4883,8 @@ class IssueService extends BaseApiService {
5012
4883
  blocks: []
5013
4884
  });
5014
4885
  } catch (e) {
5015
- store.dispatch(addIssue(backup));
5016
- store.dispatch(addAttachments(attachments));
5017
- store.dispatch(addActiveProjectIssuesCount(1));
4886
+ this.client.store.dispatch(addIssue(backup));
4887
+ this.client.store.dispatch(addAttachments(attachments));
5018
4888
  throw e;
5019
4889
  }
5020
4890
  }
@@ -5090,9 +4960,7 @@ class MainService extends BaseApiService {
5090
4960
  owner_organization: projectData.organization_owner,
5091
4961
  owner_user: projectData.user_owner,
5092
4962
  bounds: projectData.bounds,
5093
- invited: projectData.invited || false,
5094
- issues_count: projectData.issues_count,
5095
- form_submissions_count: projectData.form_submissions_count
4963
+ invited: projectData.invited || false
5096
4964
  });
5097
4965
  if (currentProjectId === projectData.id && !projectData.invited) {
5098
4966
  isProjectIdValid = true;
@@ -5110,7 +4978,6 @@ class MainService extends BaseApiService {
5110
4978
  }
5111
4979
  store.dispatch(setCurrentUser(data.user));
5112
4980
  store.dispatch(addUsers(data.project_owners));
5113
- store.dispatch(setLicenses(data.licenses));
5114
4981
  const organizationsData = data.organizations;
5115
4982
  store.dispatch(setOrganizations(organizationsData));
5116
4983
  const validProjects = projects.filter((project) => !project.invited);
@@ -5224,7 +5091,7 @@ class ProjectAccessService extends BaseApiService {
5224
5091
  method: HttpMethod.PATCH,
5225
5092
  url: `/access/${projectAccess.offline_id}/`,
5226
5093
  payload: projectAccess,
5227
- blockers: [projectAccess.offline_id, "change-access-level"],
5094
+ blockers: [projectAccess.offline_id],
5228
5095
  blocks: [projectAccess.offline_id]
5229
5096
  });
5230
5097
  }
@@ -5423,7 +5290,6 @@ class ProjectService extends BaseApiService {
5423
5290
  if (!project) {
5424
5291
  throw new Error("Expected project to exist");
5425
5292
  }
5426
- const license = selectLicenseForProject(project.id);
5427
5293
  const activeProjectId = state.projectReducer.activeProjectId;
5428
5294
  if (activeProjectId === projectId) {
5429
5295
  store.dispatch({ type: "project/setActiveProjectId", payload: null });
@@ -5434,9 +5300,6 @@ class ProjectService extends BaseApiService {
5434
5300
  store.dispatch(removeProjectAccessesOfProject(project.id));
5435
5301
  store.dispatch({ type: "rehydrated/setRehydrated", payload: false });
5436
5302
  store.dispatch(deleteProject(project));
5437
- if (license) {
5438
- store.dispatch(updateLicense({ ...license, project: null }));
5439
- }
5440
5303
  try {
5441
5304
  await this.enqueueRequest({
5442
5305
  description: "Delete project",
@@ -5452,9 +5315,6 @@ class ProjectService extends BaseApiService {
5452
5315
  store.dispatch(addOrReplaceProjectFiles(filesToDelete));
5453
5316
  store.dispatch(setActiveProjectId(activeProjectId));
5454
5317
  store.dispatch({ type: "rehydrated/setRehydrated", payload: true });
5455
- if (license) {
5456
- store.dispatch(updateLicense({ ...license, project: project.id }));
5457
- }
5458
5318
  throw e;
5459
5319
  }
5460
5320
  }
@@ -5786,7 +5646,7 @@ class UserFormSubmissionService extends BaseApiService {
5786
5646
  method: HttpMethod.POST,
5787
5647
  url: `/forms/revisions/${payload.form_revision}/respond/`,
5788
5648
  payload: { ...payloadWithoutFiles, project: activeProjectId },
5789
- blockers: [payload.issue, payload.component, "add-form-entry"].filter((x) => x !== void 0),
5649
+ blockers: [payload.issue, payload.component].filter((x) => x !== void 0),
5790
5650
  blocks: [payload.offline_id]
5791
5651
  });
5792
5652
  const attachFilesPromises = Object.entries(files).map(async ([key, fileArray]) => {
@@ -5831,11 +5691,9 @@ class UserFormSubmissionService extends BaseApiService {
5831
5691
  store.dispatch(addUserFormSubmission(offlineResultWithoutFiles));
5832
5692
  void promise.then((result) => {
5833
5693
  store.dispatch(addUserFormSubmission(result));
5834
- store.dispatch(addActiveProjectFormSubmissionsCount(1));
5835
5694
  return result;
5836
5695
  }).catch(() => {
5837
5696
  store.dispatch(deleteUserFormSubmission(payload.offline_id));
5838
- store.dispatch(addActiveProjectFormSubmissionsCount(-1));
5839
5697
  });
5840
5698
  const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
5841
5699
  return [fullOfflineResult, settledPromise];
@@ -5845,7 +5703,6 @@ class UserFormSubmissionService extends BaseApiService {
5845
5703
  const state = store.getState();
5846
5704
  const submission = state.userFormReducer.submissions[submissionId];
5847
5705
  store.dispatch(deleteUserFormSubmission(submissionId));
5848
- store.dispatch(addActiveProjectFormSubmissionsCount(-1));
5849
5706
  try {
5850
5707
  return await this.enqueueRequest({
5851
5708
  description: "Delete user form submissions",
@@ -5857,7 +5714,6 @@ class UserFormSubmissionService extends BaseApiService {
5857
5714
  } catch (e) {
5858
5715
  if (submission) {
5859
5716
  store.dispatch(addUserFormSubmission(submission));
5860
- store.dispatch(addActiveProjectFormSubmissionsCount(1));
5861
5717
  }
5862
5718
  throw e;
5863
5719
  }
@@ -5893,7 +5749,7 @@ class WorkspaceService extends BaseApiService {
5893
5749
  method: HttpMethod.POST,
5894
5750
  url: `/projects/${store.getState().projectReducer.activeProjectId}/workspaces/`,
5895
5751
  payload: offlineWorkspace,
5896
- blockers: ["add-workspace"],
5752
+ blockers: [],
5897
5753
  blocks: [offlineWorkspace.offline_id]
5898
5754
  });
5899
5755
  void promise.then((result) => {
@@ -6270,12 +6126,10 @@ class OrganizationService extends BaseApiService {
6270
6126
  const organizationAccesses = data.organization_accesses;
6271
6127
  const emailDomains = data.email_domains;
6272
6128
  const users = data.users;
6273
- const licenses = data.licenses;
6274
6129
  store.dispatch(addUsers(users));
6275
6130
  store.dispatch(setActiveOrganizationId(activeOrganization.id));
6276
6131
  store.dispatch(setOrganizationAccesses(organizationAccesses));
6277
6132
  store.dispatch(setEmailDomains(emailDomains));
6278
- store.dispatch(addLicenses(licenses));
6279
6133
  if (showLoading) {
6280
6134
  store.dispatch(setIsFetchingInitialData(false));
6281
6135
  }
@@ -6316,103 +6170,6 @@ class OrganizationService extends BaseApiService {
6316
6170
  });
6317
6171
  }
6318
6172
  }
6319
- class LicenseService extends BaseApiService {
6320
- async getLicensesForOrganization(organizationId, showLoading = false) {
6321
- if (showLoading) {
6322
- this.client.store.dispatch(setIsFetchingInitialData(true));
6323
- }
6324
- return this.enqueueRequest({
6325
- description: "Get licenses",
6326
- method: HttpMethod.GET,
6327
- url: `/organizations/${organizationId}/licenses/`,
6328
- isAuthNeeded: true,
6329
- blockers: [organizationId.toString()],
6330
- blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
6331
- }).then((result) => {
6332
- if (showLoading) {
6333
- this.client.store.dispatch(setIsFetchingInitialData(false));
6334
- }
6335
- return result;
6336
- });
6337
- }
6338
- async pauseLicense(license) {
6339
- return this.enqueueRequest({
6340
- description: "Pause license",
6341
- method: HttpMethod.DELETE,
6342
- url: `/billing/${license.offline_id}/suspend/`,
6343
- isAuthNeeded: true,
6344
- blockers: [
6345
- license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
6346
- ],
6347
- blocks: []
6348
- }).then((result) => {
6349
- this.client.store.dispatch(updateLicense(result));
6350
- return result;
6351
- });
6352
- }
6353
- async resumeLicense(license) {
6354
- return this.enqueueRequest({
6355
- description: "Resume license",
6356
- method: HttpMethod.PATCH,
6357
- url: `/billing/${license.offline_id}/suspend/`,
6358
- isAuthNeeded: true,
6359
- blockers: [
6360
- license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
6361
- ],
6362
- blocks: []
6363
- }).then((result) => {
6364
- this.client.store.dispatch(updateLicense(result));
6365
- return result;
6366
- });
6367
- }
6368
- async cancelLicense(license) {
6369
- return this.enqueueRequest({
6370
- description: "Cancel license",
6371
- method: HttpMethod.DELETE,
6372
- url: `/billing/${license.offline_id}/`,
6373
- isAuthNeeded: true,
6374
- blockers: [
6375
- license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
6376
- ],
6377
- blocks: []
6378
- }).then((result) => {
6379
- this.client.store.dispatch(updateLicense(result));
6380
- return result;
6381
- });
6382
- }
6383
- async attachLicenseToProject(license, project) {
6384
- return this.enqueueRequest({
6385
- description: "Attach license",
6386
- method: HttpMethod.PATCH,
6387
- url: `/billing/${license.offline_id}/project/`,
6388
- isAuthNeeded: true,
6389
- payload: { project: project.id },
6390
- blockers: [
6391
- license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : "",
6392
- project.id ? project.id.toString() : ""
6393
- ],
6394
- blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
6395
- }).then((result) => {
6396
- this.client.store.dispatch(updateLicense(result));
6397
- return result;
6398
- });
6399
- }
6400
- async detachLicenseFromProject(license) {
6401
- return this.enqueueRequest({
6402
- description: "Detach license",
6403
- method: HttpMethod.DELETE,
6404
- url: `/billing/${license.offline_id}/project/`,
6405
- isAuthNeeded: true,
6406
- blockers: [
6407
- license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
6408
- ],
6409
- blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
6410
- }).then((result) => {
6411
- this.client.store.dispatch(updateLicense(result));
6412
- return result;
6413
- });
6414
- }
6415
- }
6416
6173
  class OvermapSDK {
6417
6174
  constructor(apiUrl, store) {
6418
6175
  __publicField(this, "API_URL");
@@ -6438,7 +6195,6 @@ class OvermapSDK {
6438
6195
  __publicField(this, "projectFiles", new ProjectFileService(this));
6439
6196
  __publicField(this, "emailVerification", new EmailVerificationService(this));
6440
6197
  __publicField(this, "emailDomains", new EmailDomainsService(this));
6441
- __publicField(this, "licenses", new LicenseService(this));
6442
6198
  this.API_URL = apiUrl;
6443
6199
  this.store = store;
6444
6200
  }
@@ -12004,9 +11760,6 @@ export {
12004
11760
  IssuePriority,
12005
11761
  IssueService,
12006
11762
  IssueStatus,
12007
- LicenseLevel,
12008
- LicenseService,
12009
- LicenseStatus,
12010
11763
  MainService,
12011
11764
  MapStyle,
12012
11765
  MultiSelectField,
@@ -12023,7 +11776,6 @@ export {
12023
11776
  OvermapContext,
12024
11777
  OvermapProvider,
12025
11778
  OvermapSDK,
12026
- PaddleCheckoutEvent,
12027
11779
  PatchField,
12028
11780
  PatchFormProvider,
12029
11781
  ProjectAccessLevel,
@@ -12046,8 +11798,6 @@ export {
12046
11798
  YELLOW,
12047
11799
  _setLatestRetryTime,
12048
11800
  acceptProjectInvite,
12049
- addActiveProjectFormSubmissionsCount,
12050
- addActiveProjectIssuesCount,
12051
11801
  addAttachment,
12052
11802
  addAttachments,
12053
11803
  addCategory,
@@ -12057,7 +11807,6 @@ export {
12057
11807
  addEmailDomain,
12058
11808
  addFavouriteProjectId,
12059
11809
  addIssue,
12060
- addLicenses,
12061
11810
  addOrReplaceCategories,
12062
11811
  addOrReplaceIssueComment,
12063
11812
  addOrReplaceProjectFile,
@@ -12157,8 +11906,6 @@ export {
12157
11906
  issueReducer,
12158
11907
  issueSlice,
12159
11908
  issueToSearchResult,
12160
- licenseReducer,
12161
- licenseSlice,
12162
11909
  literalToCoordinates,
12163
11910
  logOnlyOnce,
12164
11911
  makeClient,
@@ -12225,17 +11972,13 @@ export {
12225
11972
  searchIssues,
12226
11973
  selectAccessToken,
12227
11974
  selectActiveIssueId,
12228
- selectActiveLicense,
12229
11975
  selectActiveOrganization,
12230
11976
  selectActiveOrganizationAccess,
12231
11977
  selectActiveOrganizationId,
12232
- selectActiveOrganizationLicenses,
12233
- selectActiveOrganizationProjects,
12234
11978
  selectActiveProject,
12235
11979
  selectActiveProjectAccess,
12236
11980
  selectActiveProjectFileId,
12237
11981
  selectActiveProjectId,
12238
- selectActiveStatusLicenses,
12239
11982
  selectActiveWorkspace,
12240
11983
  selectActiveWorkspaceId,
12241
11984
  selectAllAttachments,
@@ -12281,7 +12024,6 @@ export {
12281
12024
  selectHiddenComponentTypeIds,
12282
12025
  selectIsFetchingInitialData,
12283
12026
  selectIsImportingProjectFile,
12284
- selectIsLoading,
12285
12027
  selectIsLoggedIn,
12286
12028
  selectIssue,
12287
12029
  selectIssueAttachmentMapping,
@@ -12291,10 +12033,6 @@ export {
12291
12033
  selectLatestFormRevision,
12292
12034
  selectLatestRetryTime,
12293
12035
  selectLatestRevisionByFormId,
12294
- selectLicense,
12295
- selectLicenseForProject,
12296
- selectLicenses,
12297
- selectLicensesForProjectsMapping,
12298
12036
  selectMainWorkspace,
12299
12037
  selectMapStyle,
12300
12038
  selectNumberOfComponentTypesMatchingCaseInsensitiveName,
@@ -12308,7 +12046,6 @@ export {
12308
12046
  selectOrganizationUsersAsMapping,
12309
12047
  selectOrganizationUsersIds,
12310
12048
  selectOrganizations,
12311
- selectOrganizationsMapping,
12312
12049
  selectOrganizationsWithAccess,
12313
12050
  selectPermittedWorkspaceIds,
12314
12051
  selectPhotoAttachmentsOfIssue,
@@ -12330,7 +12067,6 @@ export {
12330
12067
  selectRevisionsForForm,
12331
12068
  selectShowTooltips,
12332
12069
  selectSortedEmailDomains,
12333
- selectSortedOrganizationLicenses,
12334
12070
  selectSortedOrganizationUsers,
12335
12071
  selectSortedProjectUsers,
12336
12072
  selectSortedProjects,
@@ -12373,10 +12109,8 @@ export {
12373
12109
  setEnablePlacementMode,
12374
12110
  setIsFetchingInitialData,
12375
12111
  setIsImportingProjectFile,
12376
- setIsLoading,
12377
12112
  setIssueComments,
12378
12113
  setIssues,
12379
- setLicenses,
12380
12114
  setLoggedIn,
12381
12115
  setMapStyle,
12382
12116
  setOrganizationAccesses,
@@ -12415,7 +12149,6 @@ export {
12415
12149
  updateAttachment,
12416
12150
  updateComponent,
12417
12151
  updateIssue,
12418
- updateLicense,
12419
12152
  updateOrCreateProject,
12420
12153
  updateOrganizationAccess,
12421
12154
  updateProjectAccess,