@overmap-ai/core 1.0.65-asset-models-improvements.2 → 1.0.65-asset-models-improvements.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/enums/access.d.ts +8 -0
  2. package/dist/enums/attachments.d.ts +7 -0
  3. package/dist/enums/index.d.ts +3 -0
  4. package/dist/enums/issue.d.ts +9 -0
  5. package/dist/enums/licenses.d.ts +14 -0
  6. package/dist/overmap-core.js +192 -248
  7. package/dist/overmap-core.js.map +1 -1
  8. package/dist/overmap-core.umd.cjs +189 -245
  9. package/dist/overmap-core.umd.cjs.map +1 -1
  10. package/dist/sdk/base.d.ts +1 -1
  11. package/dist/sdk/globals.d.ts +2 -2
  12. package/dist/sdk/sdk.d.ts +3 -3
  13. package/dist/sdk/services/AgentService.d.ts +1 -1
  14. package/dist/sdk/services/AssetAttachmentService.d.ts +3 -2
  15. package/dist/sdk/services/AssetService.d.ts +2 -2
  16. package/dist/sdk/services/AssetStageCompletionService.d.ts +2 -2
  17. package/dist/sdk/services/AssetStageService.d.ts +1 -1
  18. package/dist/sdk/services/AssetTypeAttachmentService.d.ts +3 -2
  19. package/dist/sdk/services/AssetTypeService.d.ts +2 -2
  20. package/dist/sdk/services/BaseApiService.d.ts +1 -1
  21. package/dist/sdk/services/BaseAttachmentService.d.ts +3 -2
  22. package/dist/sdk/services/BaseAuthService.d.ts +1 -1
  23. package/dist/sdk/services/BaseService.d.ts +2 -2
  24. package/dist/sdk/services/BaseUploadService.d.ts +2 -2
  25. package/dist/sdk/services/CategoryService.d.ts +2 -2
  26. package/dist/sdk/services/DocumentAttachmentService.d.ts +3 -2
  27. package/dist/sdk/services/DocumentService.d.ts +2 -2
  28. package/dist/sdk/services/EmailDomainsService.d.ts +1 -1
  29. package/dist/sdk/services/EmailVerificationService.d.ts +1 -1
  30. package/dist/sdk/services/FileService.d.ts +1 -1
  31. package/dist/sdk/services/FormService.d.ts +1 -2
  32. package/dist/sdk/services/FormSubmissionService.d.ts +2 -3
  33. package/dist/sdk/services/GeoImageService.d.ts +2 -2
  34. package/dist/sdk/services/IssueAttachmentService.d.ts +3 -2
  35. package/dist/sdk/services/IssueCommentService.d.ts +2 -2
  36. package/dist/sdk/services/IssueService.d.ts +2 -2
  37. package/dist/sdk/services/IssueTypeService.d.ts +2 -2
  38. package/dist/sdk/services/IssueUpdateService.d.ts +1 -1
  39. package/dist/sdk/services/JWTAuthService.d.ts +2 -2
  40. package/dist/sdk/services/LicenseService.d.ts +1 -1
  41. package/dist/sdk/services/OrganizationAccessService.d.ts +1 -1
  42. package/dist/sdk/services/OrganizationService.d.ts +1 -1
  43. package/dist/sdk/services/ProjectAccessService.d.ts +1 -1
  44. package/dist/sdk/services/ProjectAttachmentService.d.ts +3 -2
  45. package/dist/sdk/services/ProjectFileService.d.ts +2 -3
  46. package/dist/sdk/services/ProjectService.d.ts +1 -2
  47. package/dist/sdk/services/TeamService.d.ts +2 -2
  48. package/dist/sdk/services/UserService.d.ts +2 -2
  49. package/dist/sdk/services/WorkspaceService.d.ts +2 -4
  50. package/dist/store/slices/assetStageSlice.d.ts +0 -1
  51. package/dist/store/slices/userSlice.d.ts +13 -33
  52. package/dist/typings/models/access.d.ts +2 -9
  53. package/dist/typings/models/agents.d.ts +1 -1
  54. package/dist/typings/models/assets.d.ts +2 -2
  55. package/dist/typings/models/attachments.d.ts +2 -9
  56. package/dist/typings/models/base.d.ts +2 -2
  57. package/dist/typings/models/categories.d.ts +2 -2
  58. package/dist/typings/models/documents.d.ts +1 -1
  59. package/dist/typings/models/emailDomain.d.ts +1 -1
  60. package/dist/typings/models/emailVerification.d.ts +2 -2
  61. package/dist/typings/models/forms.d.ts +2 -2
  62. package/dist/typings/models/geoImages.d.ts +3 -3
  63. package/dist/typings/models/issueTypes.d.ts +2 -2
  64. package/dist/typings/models/issues.d.ts +1 -10
  65. package/dist/typings/models/license.d.ts +2 -15
  66. package/dist/typings/models/organizations.d.ts +1 -1
  67. package/dist/typings/models/projects.d.ts +3 -3
  68. package/dist/typings/models/store.d.ts +1 -1
  69. package/dist/typings/models/teams.d.ts +3 -3
  70. package/dist/typings/models/users.d.ts +1 -1
  71. package/dist/typings/models/workspace.d.ts +1 -1
  72. package/dist/typings/store.d.ts +1 -1
  73. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ export declare enum ProjectAccessLevel {
2
+ BASIC = 0,
3
+ ADMIN = 2
4
+ }
5
+ export declare enum OrganizationAccessLevel {
6
+ BASIC = 0,
7
+ ADMIN = 2
8
+ }
@@ -0,0 +1,7 @@
1
+ export declare enum AttachmentModel {
2
+ Issue = "issue",
3
+ Asset = "asset",
4
+ AssetType = "asset_type",
5
+ Project = "project",
6
+ Document = "document"
7
+ }
@@ -1,2 +1,5 @@
1
1
  export * from "./api";
2
+ export * from "./attachments";
2
3
  export * from "./issue";
4
+ export * from "./access";
5
+ export * from "./licenses";
@@ -10,3 +10,12 @@ export declare enum IssueStatus {
10
10
  SELECTED = 2,
11
11
  DONE = 4
12
12
  }
13
+ export declare enum IssueUpdateChange {
14
+ STATUS = "status",
15
+ PRIORITY = "priority",
16
+ CATEGORY = "category",
17
+ DESCRIPTION = "description",
18
+ TITLE = "title",
19
+ ASSIGNED_TO = "assigned_to",
20
+ DUE_DATE = "due_date"
21
+ }
@@ -0,0 +1,14 @@
1
+ export declare enum PaddleCheckoutEvent {
2
+ COMPLETED = "checkout.completed",
3
+ CLOSED = "checkout.closed"
4
+ }
5
+ export declare enum LicenseLevel {
6
+ PRO = 0
7
+ }
8
+ export declare enum LicenseStatus {
9
+ ACTIVE = 0,
10
+ PAUSED = 2,
11
+ CANCELLED = 4,
12
+ INACTIVE = 6,
13
+ PAST_DUE = 8
14
+ }
@@ -7,20 +7,20 @@ var __publicField = (obj, key, value) => {
7
7
  var _a;
8
8
  import { DepGraph } from "dependency-graph";
9
9
  import { v4 } from "uuid";
10
+ import { saveAs } from "file-saver";
11
+ import React, { useRef, useEffect } from "react";
12
+ import ColorCls from "color";
13
+ import { gray, gold, brown, yellow, amber, orange, red, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, jade, grass, lime, mint, sky } from "@radix-ui/colors";
10
14
  import { offline as offline$1 } from "@redux-offline/redux-offline";
11
15
  import offlineConfig from "@redux-offline/redux-offline/lib/defaults";
12
16
  import localforage from "localforage";
13
17
  import createMigration from "redux-persist-migrate";
14
18
  import { createSlice, createSelector, combineReducers, createNextState } from "@reduxjs/toolkit";
15
19
  import request from "superagent";
16
- import { saveAs } from "file-saver";
17
- import React, { useRef, useEffect } from "react";
18
- import ColorCls from "color";
19
- import { gray, gold, brown, yellow, amber, orange, red, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, jade, grass, lime, mint, sky } from "@radix-ui/colors";
20
20
  import { RESET_STATE } from "@redux-offline/redux-offline/lib/constants";
21
21
  import jwtDecode from "jwt-decode";
22
- import { unsafeShowToast } from "@overmap-ai/blocks";
23
22
  import { openDB } from "idb";
23
+ import { unsafeShowToast } from "@overmap-ai/blocks";
24
24
  var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
25
25
  HttpMethod2["GET"] = "GET";
26
26
  HttpMethod2["POST"] = "POST";
@@ -29,6 +29,14 @@ var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
29
29
  HttpMethod2["DELETE"] = "DELETE";
30
30
  return HttpMethod2;
31
31
  })(HttpMethod || {});
32
+ var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
33
+ AttachmentModel2["Issue"] = "issue";
34
+ AttachmentModel2["Asset"] = "asset";
35
+ AttachmentModel2["AssetType"] = "asset_type";
36
+ AttachmentModel2["Project"] = "project";
37
+ AttachmentModel2["Document"] = "document";
38
+ return AttachmentModel2;
39
+ })(AttachmentModel || {});
32
40
  var IssuePriority = /* @__PURE__ */ ((IssuePriority2) => {
33
41
  IssuePriority2[IssuePriority2["LOWEST"] = 0] = "LOWEST";
34
42
  IssuePriority2[IssuePriority2["LOW"] = 2] = "LOW";
@@ -43,6 +51,43 @@ var IssueStatus = /* @__PURE__ */ ((IssueStatus2) => {
43
51
  IssueStatus2[IssueStatus2["DONE"] = 4] = "DONE";
44
52
  return IssueStatus2;
45
53
  })(IssueStatus || {});
54
+ var IssueUpdateChange = /* @__PURE__ */ ((IssueUpdateChange2) => {
55
+ IssueUpdateChange2["STATUS"] = "status";
56
+ IssueUpdateChange2["PRIORITY"] = "priority";
57
+ IssueUpdateChange2["CATEGORY"] = "category";
58
+ IssueUpdateChange2["DESCRIPTION"] = "description";
59
+ IssueUpdateChange2["TITLE"] = "title";
60
+ IssueUpdateChange2["ASSIGNED_TO"] = "assigned_to";
61
+ IssueUpdateChange2["DUE_DATE"] = "due_date";
62
+ return IssueUpdateChange2;
63
+ })(IssueUpdateChange || {});
64
+ var ProjectAccessLevel = /* @__PURE__ */ ((ProjectAccessLevel2) => {
65
+ ProjectAccessLevel2[ProjectAccessLevel2["BASIC"] = 0] = "BASIC";
66
+ ProjectAccessLevel2[ProjectAccessLevel2["ADMIN"] = 2] = "ADMIN";
67
+ return ProjectAccessLevel2;
68
+ })(ProjectAccessLevel || {});
69
+ var OrganizationAccessLevel = /* @__PURE__ */ ((OrganizationAccessLevel2) => {
70
+ OrganizationAccessLevel2[OrganizationAccessLevel2["BASIC"] = 0] = "BASIC";
71
+ OrganizationAccessLevel2[OrganizationAccessLevel2["ADMIN"] = 2] = "ADMIN";
72
+ return OrganizationAccessLevel2;
73
+ })(OrganizationAccessLevel || {});
74
+ var PaddleCheckoutEvent = /* @__PURE__ */ ((PaddleCheckoutEvent2) => {
75
+ PaddleCheckoutEvent2["COMPLETED"] = "checkout.completed";
76
+ PaddleCheckoutEvent2["CLOSED"] = "checkout.closed";
77
+ return PaddleCheckoutEvent2;
78
+ })(PaddleCheckoutEvent || {});
79
+ var LicenseLevel = /* @__PURE__ */ ((LicenseLevel2) => {
80
+ LicenseLevel2[LicenseLevel2["PRO"] = 0] = "PRO";
81
+ return LicenseLevel2;
82
+ })(LicenseLevel || {});
83
+ var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
84
+ LicenseStatus2[LicenseStatus2["ACTIVE"] = 0] = "ACTIVE";
85
+ LicenseStatus2[LicenseStatus2["PAUSED"] = 2] = "PAUSED";
86
+ LicenseStatus2[LicenseStatus2["CANCELLED"] = 4] = "CANCELLED";
87
+ LicenseStatus2[LicenseStatus2["INACTIVE"] = 6] = "INACTIVE";
88
+ LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
89
+ return LicenseStatus2;
90
+ })(LicenseStatus || {});
46
91
  class OutboxCoordinator {
47
92
  constructor() {
48
93
  __publicField(this, "graph");
@@ -285,130 +330,6 @@ class APIError extends Error {
285
330
  this.options = options;
286
331
  }
287
332
  }
288
- class DeferredPromise {
289
- constructor() {
290
- __publicField(this, _a, "Promise");
291
- __publicField(this, "_promise");
292
- __publicField(this, "_resolve");
293
- __publicField(this, "_reject");
294
- __publicField(this, "_state", "pending");
295
- this._resolve = null;
296
- this._reject = null;
297
- this._promise = new Promise((resolve, reject) => {
298
- this._resolve = resolve;
299
- this._reject = reject;
300
- });
301
- }
302
- get state() {
303
- return this._state;
304
- }
305
- then(onFulfilled, onRejected) {
306
- return this._promise.then(onFulfilled, onRejected);
307
- }
308
- catch(onRejected) {
309
- return this._promise.catch(onRejected);
310
- }
311
- resolve(value) {
312
- if (!this._resolve)
313
- throw new Error("No resolve callback");
314
- this._resolve(value);
315
- this._state = "fulfilled";
316
- }
317
- reject(reason) {
318
- if (!this._reject)
319
- throw reason;
320
- this._reject(reason);
321
- this._state = "rejected";
322
- }
323
- finally(_onFinally) {
324
- throw new Error("`finally` not implemented");
325
- }
326
- }
327
- _a = Symbol.toStringTag;
328
- var randomString = function randomString2() {
329
- return Math.random().toString(36).substring(7).split("").join(".");
330
- };
331
- ({
332
- INIT: "@@redux/INIT" + randomString(),
333
- REPLACE: "@@redux/REPLACE" + randomString(),
334
- PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
335
- return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
336
- }
337
- });
338
- function compose() {
339
- for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
340
- funcs[_key] = arguments[_key];
341
- }
342
- if (funcs.length === 0) {
343
- return function(arg) {
344
- return arg;
345
- };
346
- }
347
- if (funcs.length === 1) {
348
- return funcs[0];
349
- }
350
- return funcs.reduce(function(a, b) {
351
- return function() {
352
- return a(b.apply(void 0, arguments));
353
- };
354
- });
355
- }
356
- const VERSION_REDUCER_KEY$1 = "versioning";
357
- const latestVersion = () => migrations.length - 1;
358
- const initialVersioning = (state) => {
359
- state[VERSION_REDUCER_KEY$1] = { version: latestVersion() };
360
- return state;
361
- };
362
- const signOut = () => {
363
- return initialVersioning({});
364
- };
365
- const createOutboxState = (state) => {
366
- if (state.outboxReducer) {
367
- state.outboxReducer.deletedRequests = [];
368
- }
369
- return state;
370
- };
371
- const wrapMigration = (migrator) => (state) => {
372
- var _a2;
373
- if (state === void 0) {
374
- state = {};
375
- }
376
- if (((_a2 = state[VERSION_REDUCER_KEY$1]) == null ? void 0 : _a2.version) === latestVersion())
377
- return state;
378
- return migrator(state);
379
- };
380
- const migrations = [initialVersioning, signOut, signOut, createOutboxState];
381
- const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
382
- const initialState$B = {
383
- accessToken: "",
384
- refreshToken: "",
385
- isLoggedIn: false
386
- };
387
- const authSlice = createSlice({
388
- name: "auth",
389
- initialState: initialState$B,
390
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
391
- reducers: {
392
- setTokens: (state, action) => {
393
- state.accessToken = action.payload.accessToken;
394
- state.refreshToken = action.payload.refreshToken;
395
- },
396
- clearTokens: (state) => {
397
- state.accessToken = "";
398
- state.refreshToken = "";
399
- },
400
- setLoggedIn: (state, action) => {
401
- if (!action.payload) {
402
- authSlice.caseReducers.clearTokens(state);
403
- }
404
- state.isLoggedIn = action.payload;
405
- }
406
- }
407
- });
408
- const { setTokens, clearTokens, setLoggedIn } = authSlice.actions;
409
- const selectAccessToken = (state) => state.authReducer.accessToken;
410
- const selectIsLoggedIn = (state) => state.authReducer.isLoggedIn;
411
- const authReducer = authSlice.reducer;
412
333
  const coordinatesToLiteral = (coordinates) => {
413
334
  return { lng: coordinates[0], lat: coordinates[1] };
414
335
  };
@@ -783,6 +704,130 @@ const getLocalRelativeDateString = memoize((date, min, max) => {
783
704
  return getLocalDateString(date);
784
705
  return relative.format(days, "days");
785
706
  });
707
+ class DeferredPromise {
708
+ constructor() {
709
+ __publicField(this, _a, "Promise");
710
+ __publicField(this, "_promise");
711
+ __publicField(this, "_resolve");
712
+ __publicField(this, "_reject");
713
+ __publicField(this, "_state", "pending");
714
+ this._resolve = null;
715
+ this._reject = null;
716
+ this._promise = new Promise((resolve, reject) => {
717
+ this._resolve = resolve;
718
+ this._reject = reject;
719
+ });
720
+ }
721
+ get state() {
722
+ return this._state;
723
+ }
724
+ then(onFulfilled, onRejected) {
725
+ return this._promise.then(onFulfilled, onRejected);
726
+ }
727
+ catch(onRejected) {
728
+ return this._promise.catch(onRejected);
729
+ }
730
+ resolve(value) {
731
+ if (!this._resolve)
732
+ throw new Error("No resolve callback");
733
+ this._resolve(value);
734
+ this._state = "fulfilled";
735
+ }
736
+ reject(reason) {
737
+ if (!this._reject)
738
+ throw reason;
739
+ this._reject(reason);
740
+ this._state = "rejected";
741
+ }
742
+ finally(_onFinally) {
743
+ throw new Error("`finally` not implemented");
744
+ }
745
+ }
746
+ _a = Symbol.toStringTag;
747
+ var randomString = function randomString2() {
748
+ return Math.random().toString(36).substring(7).split("").join(".");
749
+ };
750
+ ({
751
+ INIT: "@@redux/INIT" + randomString(),
752
+ REPLACE: "@@redux/REPLACE" + randomString(),
753
+ PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
754
+ return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
755
+ }
756
+ });
757
+ function compose() {
758
+ for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
759
+ funcs[_key] = arguments[_key];
760
+ }
761
+ if (funcs.length === 0) {
762
+ return function(arg) {
763
+ return arg;
764
+ };
765
+ }
766
+ if (funcs.length === 1) {
767
+ return funcs[0];
768
+ }
769
+ return funcs.reduce(function(a, b) {
770
+ return function() {
771
+ return a(b.apply(void 0, arguments));
772
+ };
773
+ });
774
+ }
775
+ const VERSION_REDUCER_KEY$1 = "versioning";
776
+ const latestVersion = () => migrations.length - 1;
777
+ const initialVersioning = (state) => {
778
+ state[VERSION_REDUCER_KEY$1] = { version: latestVersion() };
779
+ return state;
780
+ };
781
+ const signOut = () => {
782
+ return initialVersioning({});
783
+ };
784
+ const createOutboxState = (state) => {
785
+ if (state.outboxReducer) {
786
+ state.outboxReducer.deletedRequests = [];
787
+ }
788
+ return state;
789
+ };
790
+ const wrapMigration = (migrator) => (state) => {
791
+ var _a2;
792
+ if (state === void 0) {
793
+ state = {};
794
+ }
795
+ if (((_a2 = state[VERSION_REDUCER_KEY$1]) == null ? void 0 : _a2.version) === latestVersion())
796
+ return state;
797
+ return migrator(state);
798
+ };
799
+ const migrations = [initialVersioning, signOut, signOut, createOutboxState];
800
+ const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
801
+ const initialState$B = {
802
+ accessToken: "",
803
+ refreshToken: "",
804
+ isLoggedIn: false
805
+ };
806
+ const authSlice = createSlice({
807
+ name: "auth",
808
+ initialState: initialState$B,
809
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
810
+ reducers: {
811
+ setTokens: (state, action) => {
812
+ state.accessToken = action.payload.accessToken;
813
+ state.refreshToken = action.payload.refreshToken;
814
+ },
815
+ clearTokens: (state) => {
816
+ state.accessToken = "";
817
+ state.refreshToken = "";
818
+ },
819
+ setLoggedIn: (state, action) => {
820
+ if (!action.payload) {
821
+ authSlice.caseReducers.clearTokens(state);
822
+ }
823
+ state.isLoggedIn = action.payload;
824
+ }
825
+ }
826
+ });
827
+ const { setTokens, clearTokens, setLoggedIn } = authSlice.actions;
828
+ const selectAccessToken = (state) => state.authReducer.accessToken;
829
+ const selectIsLoggedIn = (state) => state.authReducer.isLoggedIn;
830
+ const authReducer = authSlice.reducer;
786
831
  function createModelAdapter(computeModelId) {
787
832
  const addOne = (state, action) => {
788
833
  const id = computeModelId(action.payload);
@@ -1120,24 +1165,6 @@ const selectAssetStageById = (id) => (state) => {
1120
1165
  const selectAssetStages = createSelector([selectStageMapping], (stageMapping) => {
1121
1166
  return Object.values(stageMapping);
1122
1167
  });
1123
- const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
1124
- createSelector([selectAssetStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
1125
- const assetTypeIdsSet = new Set(assetTypeIds);
1126
- const ret = {};
1127
- for (const stage of stages) {
1128
- if (assetTypeIdsSet.has(stage.asset_type)) {
1129
- if (!ret[stage.asset_type]) {
1130
- ret[stage.asset_type] = [];
1131
- }
1132
- ret[stage.asset_type].push(stage);
1133
- }
1134
- }
1135
- for (const key in ret) {
1136
- ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
1137
- }
1138
- return ret;
1139
- })
1140
- );
1141
1168
  const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
1142
1169
  createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
1143
1170
  const assetTypeStagesMapping = {};
@@ -1601,68 +1628,9 @@ const selectUploadUrl = (sha1) => (state) => {
1601
1628
  return url;
1602
1629
  };
1603
1630
  const fileReducer = fileSlice.reducer;
1604
- var ProjectAccessLevel = /* @__PURE__ */ ((ProjectAccessLevel2) => {
1605
- ProjectAccessLevel2[ProjectAccessLevel2["BASIC"] = 0] = "BASIC";
1606
- ProjectAccessLevel2[ProjectAccessLevel2["ADMIN"] = 2] = "ADMIN";
1607
- return ProjectAccessLevel2;
1608
- })(ProjectAccessLevel || {});
1609
- var OrganizationAccessLevel = /* @__PURE__ */ ((OrganizationAccessLevel2) => {
1610
- OrganizationAccessLevel2[OrganizationAccessLevel2["BASIC"] = 0] = "BASIC";
1611
- OrganizationAccessLevel2[OrganizationAccessLevel2["ADMIN"] = 2] = "ADMIN";
1612
- return OrganizationAccessLevel2;
1613
- })(OrganizationAccessLevel || {});
1614
- var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
1615
- AttachmentModel2["Issue"] = "issue";
1616
- AttachmentModel2["Asset"] = "asset";
1617
- AttachmentModel2["AssetType"] = "asset_type";
1618
- AttachmentModel2["Project"] = "project";
1619
- AttachmentModel2["Document"] = "document";
1620
- return AttachmentModel2;
1621
- })(AttachmentModel || {});
1622
- var IssueUpdateChange = /* @__PURE__ */ ((IssueUpdateChange2) => {
1623
- IssueUpdateChange2["STATUS"] = "status";
1624
- IssueUpdateChange2["PRIORITY"] = "priority";
1625
- IssueUpdateChange2["CATEGORY"] = "category";
1626
- IssueUpdateChange2["DESCRIPTION"] = "description";
1627
- IssueUpdateChange2["TITLE"] = "title";
1628
- IssueUpdateChange2["ASSIGNED_TO"] = "assigned_to";
1629
- IssueUpdateChange2["DUE_DATE"] = "due_date";
1630
- return IssueUpdateChange2;
1631
- })(IssueUpdateChange || {});
1632
- var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
1633
- VerificationCodeType2[VerificationCodeType2["USER_REGISTRATION"] = 0] = "USER_REGISTRATION";
1634
- VerificationCodeType2[VerificationCodeType2["APPLICATION_INVITE"] = 2] = "APPLICATION_INVITE";
1635
- VerificationCodeType2[VerificationCodeType2["PROJECT_INVITE"] = 4] = "PROJECT_INVITE";
1636
- VerificationCodeType2[VerificationCodeType2["ORGANIZATION_INVITE"] = 6] = "ORGANIZATION_INVITE";
1637
- VerificationCodeType2[VerificationCodeType2["ADD_EMAIL_DOMAIN"] = 8] = "ADD_EMAIL_DOMAIN";
1638
- VerificationCodeType2[VerificationCodeType2["RESET_PASSWORD"] = 10] = "RESET_PASSWORD";
1639
- return VerificationCodeType2;
1640
- })(VerificationCodeType || {});
1641
- var PaddleCheckoutEvent = /* @__PURE__ */ ((PaddleCheckoutEvent2) => {
1642
- PaddleCheckoutEvent2["COMPLETED"] = "checkout.completed";
1643
- PaddleCheckoutEvent2["CLOSED"] = "checkout.closed";
1644
- return PaddleCheckoutEvent2;
1645
- })(PaddleCheckoutEvent || {});
1646
- var LicenseLevel = /* @__PURE__ */ ((LicenseLevel2) => {
1647
- LicenseLevel2[LicenseLevel2["PRO"] = 0] = "PRO";
1648
- return LicenseLevel2;
1649
- })(LicenseLevel || {});
1650
- var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
1651
- LicenseStatus2[LicenseStatus2["ACTIVE"] = 0] = "ACTIVE";
1652
- LicenseStatus2[LicenseStatus2["PAUSED"] = 2] = "PAUSED";
1653
- LicenseStatus2[LicenseStatus2["CANCELLED"] = 4] = "CANCELLED";
1654
- LicenseStatus2[LicenseStatus2["INACTIVE"] = 6] = "INACTIVE";
1655
- LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
1656
- return LicenseStatus2;
1657
- })(LicenseStatus || {});
1658
1631
  const initialState$p = {
1659
1632
  users: {},
1660
- currentUser: {
1661
- id: 0,
1662
- username: "",
1663
- email: "",
1664
- profile: { file: null, file_sha1: null, favourite_project_ids: [], tour_step: -1 }
1665
- }
1633
+ currentUser: null
1666
1634
  };
1667
1635
  const userSlice = createSlice({
1668
1636
  name: "users",
@@ -1685,6 +1653,8 @@ const userSlice = createSlice({
1685
1653
  state.currentUser = action.payload;
1686
1654
  },
1687
1655
  setProfilePicture: (state, action) => {
1656
+ if (!state.currentUser)
1657
+ return;
1688
1658
  state.currentUser.profile.file = action.payload.file ?? null;
1689
1659
  state.currentUser.profile.file_sha1 = action.payload.file_sha1 ?? null;
1690
1660
  const currentUser = state.users[state.currentUser.id];
@@ -1694,32 +1664,12 @@ const userSlice = createSlice({
1694
1664
  currentUser.profile.file = action.payload.file ?? null;
1695
1665
  currentUser.profile.file_sha1 = action.payload.file_sha1 ?? null;
1696
1666
  },
1697
- addFavouriteProjectId: (state, action) => {
1698
- state.currentUser.profile.favourite_project_ids.push(action.payload);
1699
- },
1700
- removeFavouriteProjectId: (state, action) => {
1701
- state.currentUser.profile.favourite_project_ids = state.currentUser.profile.favourite_project_ids.filter(
1702
- (id) => id !== action.payload
1703
- );
1704
- },
1705
- setTourStep: (state, action) => {
1706
- state.currentUser.profile.tour_step = action.payload;
1707
- },
1708
1667
  removeUser: (state, action) => {
1709
1668
  delete state.users[action.payload];
1710
1669
  }
1711
1670
  }
1712
1671
  });
1713
- const {
1714
- setCurrentUser,
1715
- setProfilePicture,
1716
- setUsers,
1717
- addUsers,
1718
- addFavouriteProjectId,
1719
- removeFavouriteProjectId,
1720
- setTourStep,
1721
- removeUser
1722
- } = userSlice.actions;
1672
+ const { setCurrentUser, setProfilePicture, setUsers, addUsers, removeUser } = userSlice.actions;
1723
1673
  const userReducer = userSlice.reducer;
1724
1674
  const selectCurrentUser = (state) => state.userReducer.currentUser;
1725
1675
  const selectUsersMapping = (state) => state.userReducer.users;
@@ -1740,7 +1690,6 @@ const selectUsersByIds = restructureCreateSelectorWithArgs(
1740
1690
  return fallbackToEmptyArray(users);
1741
1691
  })
1742
1692
  );
1743
- const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
1744
1693
  const organizationAccessAdapter = createModelAdapter(
1745
1694
  (organizationAccess) => organizationAccess.offline_id
1746
1695
  );
@@ -1766,7 +1715,7 @@ const selectActiveOrganizationAccess = createSelector(
1766
1715
  [selectCurrentUser, selectOrganizationAccesses],
1767
1716
  (currentUser, organizationAccesses) => {
1768
1717
  const activeOrganizationAccess = Object.values(organizationAccesses).find(
1769
- (organizationAccess) => organizationAccess.user === currentUser.id
1718
+ (organizationAccess) => organizationAccess.user === (currentUser == null ? void 0 : currentUser.id)
1770
1719
  );
1771
1720
  return activeOrganizationAccess ?? null;
1772
1721
  }
@@ -1956,9 +1905,9 @@ const selectSortedProjectUsers = createSelector(
1956
1905
  [selectCurrentUser, selectProjectUsersAsMapping, selectProjectAccessUserMapping],
1957
1906
  (currentUser, userMapping, projectAccessMapping) => {
1958
1907
  return Object.values(userMapping).sort((userA, userB) => {
1959
- if (userA.id === currentUser.id) {
1908
+ if (userA.id === (currentUser == null ? void 0 : currentUser.id)) {
1960
1909
  return -1;
1961
- } else if (userB.id === currentUser.id) {
1910
+ } else if (userB.id === (currentUser == null ? void 0 : currentUser.id)) {
1962
1911
  return 1;
1963
1912
  }
1964
1913
  const projectAccessesA = projectAccessMapping[userA.id];
@@ -2035,9 +1984,9 @@ const selectSortedOrganizationUsers = createSelector(
2035
1984
  [selectCurrentUser, selectOrganizationUsersAsMapping, selectOrganizationAccessUserMapping],
2036
1985
  (currentUser, userMapping, organizationAccessMapping) => {
2037
1986
  return Object.values(userMapping).sort((userA, userB) => {
2038
- if (userA.id === currentUser.id) {
1987
+ if (userA.id === (currentUser == null ? void 0 : currentUser.id)) {
2039
1988
  return -1;
2040
- } else if (userB.id === currentUser.id) {
1989
+ } else if (userB.id === (currentUser == null ? void 0 : currentUser.id)) {
2041
1990
  return 1;
2042
1991
  }
2043
1992
  const organizationAccessesA = organizationAccessMapping[userA.id];
@@ -5109,15 +5058,6 @@ class IssueService extends BaseApiService {
5109
5058
  void promise.then((result) => {
5110
5059
  this.dispatch(updateIssue(result));
5111
5060
  }).catch((error) => {
5112
- var _a2;
5113
- console.error(error);
5114
- if (error instanceof APIError) {
5115
- (_a2 = unsafeShowToast) == null ? void 0 : _a2({
5116
- title: "Could not create issue",
5117
- description: error.message,
5118
- accentColor: "red"
5119
- });
5120
- }
5121
5061
  this.dispatch(deleteIssue(issuePayload.offline_id));
5122
5062
  this.dispatch(addActiveProjectIssuesCount(-1));
5123
5063
  throw error;
@@ -7673,6 +7613,15 @@ class IssueAssociationService extends BaseUploadService {
7673
7613
  this.dispatch(initializeIssueAssociations(issueAssociations));
7674
7614
  }
7675
7615
  }
7616
+ var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
7617
+ VerificationCodeType2[VerificationCodeType2["USER_REGISTRATION"] = 0] = "USER_REGISTRATION";
7618
+ VerificationCodeType2[VerificationCodeType2["APPLICATION_INVITE"] = 2] = "APPLICATION_INVITE";
7619
+ VerificationCodeType2[VerificationCodeType2["PROJECT_INVITE"] = 4] = "PROJECT_INVITE";
7620
+ VerificationCodeType2[VerificationCodeType2["ORGANIZATION_INVITE"] = 6] = "ORGANIZATION_INVITE";
7621
+ VerificationCodeType2[VerificationCodeType2["ADD_EMAIL_DOMAIN"] = 8] = "ADD_EMAIL_DOMAIN";
7622
+ VerificationCodeType2[VerificationCodeType2["RESET_PASSWORD"] = 10] = "RESET_PASSWORD";
7623
+ return VerificationCodeType2;
7624
+ })(VerificationCodeType || {});
7676
7625
  export {
7677
7626
  APIError,
7678
7627
  AgentService,
@@ -7754,7 +7703,6 @@ export {
7754
7703
  addDocumentAttachments,
7755
7704
  addDocuments,
7756
7705
  addEmailDomain,
7757
- addFavouriteProjectId,
7758
7706
  addForm,
7759
7707
  addFormRevision,
7760
7708
  addFormRevisionAttachment,
@@ -7986,7 +7934,6 @@ export {
7986
7934
  rehydratedReducer,
7987
7935
  rehydratedSlice,
7988
7936
  removeDocuments,
7989
- removeFavouriteProjectId,
7990
7937
  removeIssueType,
7991
7938
  removeProjectFile,
7992
7939
  removeProjectFilesOfProject,
@@ -8066,7 +8013,6 @@ export {
8066
8013
  selectEmailDomains,
8067
8014
  selectEmailDomainsAsMapping,
8068
8015
  selectEmailDomainsOfOrganization,
8069
- selectFavouriteProjects,
8070
8016
  selectFilteredForms,
8071
8017
  selectFormById,
8072
8018
  selectFormMapping,
@@ -8165,7 +8111,6 @@ export {
8165
8111
  selectSortedProjectUsers,
8166
8112
  selectStageFormIdsFromStageIds,
8167
8113
  selectStageMapping,
8168
- selectStagesFromAssetTypeIds,
8169
8114
  selectStagesOfAssetType,
8170
8115
  selectTeamById,
8171
8116
  selectTeams,
@@ -8225,7 +8170,6 @@ export {
8225
8170
  setRehydrated,
8226
8171
  setTeam,
8227
8172
  setTokens,
8228
- setTourStep,
8229
8173
  setUploadUrl,
8230
8174
  setUsers,
8231
8175
  setWorkspaces,