@overmap-ai/core 1.0.60-sdk-refactor.17 → 1.0.60-sdk-refactor.20
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.
- package/dist/overmap-core.js +130 -166
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +130 -166
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AgentService.d.ts +1 -1
- package/dist/sdk/services/AssetService.d.ts +1 -1
- package/dist/sdk/services/AssetStageCompletionService.d.ts +1 -1
- package/dist/sdk/services/AssetStageService.d.ts +1 -1
- package/dist/sdk/services/AssetTypeService.d.ts +1 -1
- package/dist/sdk/services/BaseAttachmentService.d.ts +1 -1
- package/dist/sdk/services/CategoryService.d.ts +1 -1
- package/dist/sdk/services/DocumentService.d.ts +1 -1
- package/dist/sdk/services/EmailDomainsService.d.ts +1 -1
- package/dist/sdk/services/IssueCommentService.d.ts +1 -1
- package/dist/sdk/services/IssueService.d.ts +1 -1
- package/dist/sdk/services/IssueTypeService.d.ts +2 -2
- package/dist/sdk/services/IssueUpdateService.d.ts +1 -1
- package/dist/sdk/services/LicenseService.d.ts +1 -1
- package/dist/sdk/services/OrganizationAccessService.d.ts +1 -1
- package/dist/sdk/services/OrganizationService.d.ts +2 -3
- package/dist/sdk/services/ProjectAccessService.d.ts +1 -1
- package/dist/sdk/services/ProjectFileService.d.ts +1 -1
- package/dist/sdk/services/TeamService.d.ts +2 -2
- package/dist/sdk/services/UserFormService.d.ts +1 -1
- package/dist/sdk/services/UserFormSubmissionService.d.ts +1 -1
- package/dist/sdk/services/UserService.d.ts +6 -0
- package/dist/sdk/services/WorkspaceService.d.ts +1 -0
- package/dist/sdk/services/index.d.ts +1 -0
- package/dist/typings/models/organizations.d.ts +0 -11
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -15659,12 +15659,7 @@ class CategoryService extends BaseApiService {
|
|
|
15659
15659
|
blocks: []
|
|
15660
15660
|
});
|
|
15661
15661
|
}
|
|
15662
|
-
async refreshStore() {
|
|
15663
|
-
const { store } = this.client;
|
|
15664
|
-
const projectId = store.getState().projectReducer.activeProjectId;
|
|
15665
|
-
if (!projectId) {
|
|
15666
|
-
throw new Error("No active project");
|
|
15667
|
-
}
|
|
15662
|
+
async refreshStore(projectId) {
|
|
15668
15663
|
const result = await this.enqueueRequest({
|
|
15669
15664
|
description: "Get categories",
|
|
15670
15665
|
method: HttpMethod.GET,
|
|
@@ -15808,16 +15803,15 @@ class AssetService extends BaseApiService {
|
|
|
15808
15803
|
});
|
|
15809
15804
|
return batchPromises;
|
|
15810
15805
|
}
|
|
15811
|
-
async refreshStore() {
|
|
15812
|
-
const { store } = this.client;
|
|
15806
|
+
async refreshStore(projectId) {
|
|
15813
15807
|
const result = await this.enqueueRequest({
|
|
15814
15808
|
description: "Get assets",
|
|
15815
15809
|
method: HttpMethod.GET,
|
|
15816
|
-
url: `/projects/${
|
|
15810
|
+
url: `/projects/${projectId}/assets/`,
|
|
15817
15811
|
blockers: [],
|
|
15818
15812
|
blocks: []
|
|
15819
15813
|
});
|
|
15820
|
-
|
|
15814
|
+
this.dispatch(initializeAssets(result));
|
|
15821
15815
|
}
|
|
15822
15816
|
}
|
|
15823
15817
|
class AssetStageCompletionService extends BaseApiService {
|
|
@@ -15844,12 +15838,11 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
15844
15838
|
});
|
|
15845
15839
|
return [offlineStageCompletion, promise];
|
|
15846
15840
|
}
|
|
15847
|
-
async refreshStore() {
|
|
15848
|
-
const { store } = this.client;
|
|
15841
|
+
async refreshStore(projectId) {
|
|
15849
15842
|
const result = await this.enqueueRequest({
|
|
15850
15843
|
description: "Get stage completions",
|
|
15851
15844
|
method: HttpMethod.GET,
|
|
15852
|
-
url: `/projects/${
|
|
15845
|
+
url: `/projects/${projectId}/asset-stage-completions/`,
|
|
15853
15846
|
blockers: [],
|
|
15854
15847
|
blocks: []
|
|
15855
15848
|
});
|
|
@@ -16017,12 +16010,11 @@ class AssetStageService extends BaseApiService {
|
|
|
16017
16010
|
throw e;
|
|
16018
16011
|
}
|
|
16019
16012
|
}
|
|
16020
|
-
async refreshStore() {
|
|
16021
|
-
const { store } = this.client;
|
|
16013
|
+
async refreshStore(projectId) {
|
|
16022
16014
|
const result = await this.enqueueRequest({
|
|
16023
16015
|
description: "Get asset stages",
|
|
16024
16016
|
method: HttpMethod.GET,
|
|
16025
|
-
url: `/projects/${
|
|
16017
|
+
url: `/projects/${projectId}/asset-stages/`,
|
|
16026
16018
|
blockers: [],
|
|
16027
16019
|
blocks: []
|
|
16028
16020
|
});
|
|
@@ -16183,14 +16175,12 @@ class BaseAttachmentService extends BaseApiService {
|
|
|
16183
16175
|
}
|
|
16184
16176
|
// Note that currently the fetching of attachments for all models dependds on the active projectId. This may change in the future. And
|
|
16185
16177
|
// so for some attachment model services, this method will have to be overridden.
|
|
16186
|
-
async refreshStore() {
|
|
16187
|
-
const { store } = this.client;
|
|
16188
|
-
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
16178
|
+
async refreshStore(projectId) {
|
|
16189
16179
|
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
16190
16180
|
const result = await this.enqueueRequest({
|
|
16191
16181
|
description: `Get ${meta.name} attachments`,
|
|
16192
16182
|
method: HttpMethod.GET,
|
|
16193
|
-
url: `/projects/${
|
|
16183
|
+
url: `/projects/${projectId}${meta.fetchUrlPostfix}/`,
|
|
16194
16184
|
blocks: [],
|
|
16195
16185
|
blockers: []
|
|
16196
16186
|
});
|
|
@@ -16286,12 +16276,11 @@ class AssetTypeService extends BaseApiService {
|
|
|
16286
16276
|
throw e;
|
|
16287
16277
|
});
|
|
16288
16278
|
}
|
|
16289
|
-
async refreshStore() {
|
|
16290
|
-
const { store } = this.client;
|
|
16279
|
+
async refreshStore(projectId) {
|
|
16291
16280
|
const result = await this.enqueueRequest({
|
|
16292
16281
|
description: "Get asset types",
|
|
16293
16282
|
method: HttpMethod.GET,
|
|
16294
|
-
url: `/projects/${
|
|
16283
|
+
url: `/projects/${projectId}/asset-types/`,
|
|
16295
16284
|
blockers: [],
|
|
16296
16285
|
blocks: []
|
|
16297
16286
|
});
|
|
@@ -16390,13 +16379,11 @@ class IssueCommentService extends BaseApiService {
|
|
|
16390
16379
|
});
|
|
16391
16380
|
return promise;
|
|
16392
16381
|
}
|
|
16393
|
-
async refreshStore() {
|
|
16394
|
-
const { store } = this.client;
|
|
16382
|
+
async refreshStore(projectId) {
|
|
16395
16383
|
const result = await this.enqueueRequest({
|
|
16396
16384
|
description: "Get comments",
|
|
16397
16385
|
method: HttpMethod.GET,
|
|
16398
|
-
|
|
16399
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/comments/`,
|
|
16386
|
+
url: `/projects/${projectId}/comments/`,
|
|
16400
16387
|
blockers: [],
|
|
16401
16388
|
blocks: []
|
|
16402
16389
|
});
|
|
@@ -16404,12 +16391,11 @@ class IssueCommentService extends BaseApiService {
|
|
|
16404
16391
|
}
|
|
16405
16392
|
}
|
|
16406
16393
|
class IssueUpdateService extends BaseApiService {
|
|
16407
|
-
async refreshStore() {
|
|
16408
|
-
const { store } = this.client;
|
|
16394
|
+
async refreshStore(projectId) {
|
|
16409
16395
|
const result = await this.enqueueRequest({
|
|
16410
16396
|
description: "Get issue updates",
|
|
16411
16397
|
method: HttpMethod.GET,
|
|
16412
|
-
url: `/projects/${
|
|
16398
|
+
url: `/projects/${projectId}/issues/updates/`,
|
|
16413
16399
|
blockers: [],
|
|
16414
16400
|
blocks: []
|
|
16415
16401
|
});
|
|
@@ -16640,12 +16626,7 @@ class IssueService extends BaseApiService {
|
|
|
16640
16626
|
}
|
|
16641
16627
|
}
|
|
16642
16628
|
// Special functions
|
|
16643
|
-
async refreshStore() {
|
|
16644
|
-
const { store } = this.client;
|
|
16645
|
-
const projectId = store.getState().projectReducer.activeProjectId;
|
|
16646
|
-
if (!projectId) {
|
|
16647
|
-
throw new Error("No active project");
|
|
16648
|
-
}
|
|
16629
|
+
async refreshStore(projectId) {
|
|
16649
16630
|
const result = await this.enqueueRequest({
|
|
16650
16631
|
description: "Get issues",
|
|
16651
16632
|
method: HttpMethod.GET,
|
|
@@ -16666,23 +16647,19 @@ class IssueService extends BaseApiService {
|
|
|
16666
16647
|
}
|
|
16667
16648
|
}
|
|
16668
16649
|
class IssueTypeService extends BaseApiService {
|
|
16669
|
-
add(payload) {
|
|
16650
|
+
add(payload, organizationId) {
|
|
16670
16651
|
const { store } = this.client;
|
|
16671
16652
|
const state = store.getState();
|
|
16672
|
-
const activeOrganizationId = state.organizationReducer.activeOrganizationId;
|
|
16673
|
-
if (!activeOrganizationId) {
|
|
16674
|
-
throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
|
|
16675
|
-
}
|
|
16676
16653
|
const offlineIssueType = offline({
|
|
16677
16654
|
...payload,
|
|
16678
16655
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
16679
16656
|
created_by: state.userReducer.currentUser.id,
|
|
16680
|
-
organization:
|
|
16657
|
+
organization: organizationId
|
|
16681
16658
|
});
|
|
16682
16659
|
this.dispatch(addIssueType(offlineIssueType));
|
|
16683
16660
|
const promise = this.enqueueRequest({
|
|
16684
16661
|
method: HttpMethod.POST,
|
|
16685
|
-
url: `/organizations/${
|
|
16662
|
+
url: `/organizations/${organizationId}/issue-types/`,
|
|
16686
16663
|
// Sending only whats needed here
|
|
16687
16664
|
payload: {
|
|
16688
16665
|
offline_id: offlineIssueType.offline_id,
|
|
@@ -16750,15 +16727,10 @@ class IssueTypeService extends BaseApiService {
|
|
|
16750
16727
|
});
|
|
16751
16728
|
return promise;
|
|
16752
16729
|
}
|
|
16753
|
-
async refreshStore() {
|
|
16754
|
-
const { store } = this.client;
|
|
16755
|
-
const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
|
|
16756
|
-
if (!activeOrganizationId) {
|
|
16757
|
-
throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
|
|
16758
|
-
}
|
|
16730
|
+
async refreshStore(organizationId) {
|
|
16759
16731
|
const result = await this.enqueueRequest({
|
|
16760
16732
|
method: HttpMethod.GET,
|
|
16761
|
-
url: `/organizations/${
|
|
16733
|
+
url: `/organizations/${organizationId}/issue-types/`,
|
|
16762
16734
|
blockers: [],
|
|
16763
16735
|
blocks: []
|
|
16764
16736
|
});
|
|
@@ -16797,25 +16769,18 @@ class ProjectAccessService extends BaseApiService {
|
|
|
16797
16769
|
blocks: []
|
|
16798
16770
|
});
|
|
16799
16771
|
}
|
|
16800
|
-
async refreshStore() {
|
|
16801
|
-
const { store } = this.client;
|
|
16802
|
-
const state = store.getState();
|
|
16803
|
-
const projectId = state.projectReducer.activeProjectId;
|
|
16804
|
-
if (!projectId) {
|
|
16805
|
-
throw new Error("No active project");
|
|
16806
|
-
}
|
|
16772
|
+
async refreshStore(projectId) {
|
|
16807
16773
|
const promise = this.fetchAll(projectId);
|
|
16808
16774
|
const result = await promise;
|
|
16809
16775
|
this.dispatch(setProjectAccesses(result));
|
|
16810
16776
|
}
|
|
16811
16777
|
}
|
|
16812
16778
|
class ProjectFileService extends BaseApiService {
|
|
16813
|
-
async refreshStore() {
|
|
16814
|
-
const { store } = this.client;
|
|
16779
|
+
async refreshStore(projectId) {
|
|
16815
16780
|
const result = await this.enqueueRequest({
|
|
16816
16781
|
description: "Get project files",
|
|
16817
16782
|
method: HttpMethod.GET,
|
|
16818
|
-
url: `/projects/${
|
|
16783
|
+
url: `/projects/${projectId}/files/`,
|
|
16819
16784
|
blockers: [],
|
|
16820
16785
|
blocks: []
|
|
16821
16786
|
});
|
|
@@ -16953,10 +16918,6 @@ class ProjectService extends BaseApiService {
|
|
|
16953
16918
|
throw new Error("Project type was not chosen when trying to create a project");
|
|
16954
16919
|
}
|
|
16955
16920
|
const isOrganizationProject = !!project.owner_organization;
|
|
16956
|
-
const activeOrganization = this.client.store.getState().organizationReducer.activeOrganizationId;
|
|
16957
|
-
if (isOrganizationProject && (!activeOrganization || project.owner_organization !== activeOrganization)) {
|
|
16958
|
-
throw new Error("User tried creating organization project for organization they do not belong to.");
|
|
16959
|
-
}
|
|
16960
16921
|
const url = isOrganizationProject ? `/organizations/${project.owner_organization}/projects/` : "/projects/";
|
|
16961
16922
|
const projectType = isOrganizationProject ? { organization_owner: project.owner_organization } : { user_owner: project.owner_user };
|
|
16962
16923
|
const result = await this.enqueueRequest({
|
|
@@ -17343,20 +17304,15 @@ class UserFormService extends BaseApiService {
|
|
|
17343
17304
|
throw e;
|
|
17344
17305
|
}
|
|
17345
17306
|
}
|
|
17346
|
-
async refreshStore() {
|
|
17347
|
-
const { store } = this.client;
|
|
17348
|
-
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
17349
|
-
if (!activeProjectId) {
|
|
17350
|
-
throw new Error("No active project");
|
|
17351
|
-
}
|
|
17307
|
+
async refreshStore(projectId) {
|
|
17352
17308
|
const forms = [];
|
|
17353
17309
|
const revisions = [];
|
|
17354
17310
|
const attachments = [];
|
|
17355
17311
|
const projectFormsResult = await this.enqueueRequest({
|
|
17356
17312
|
description: "Fetch project forms",
|
|
17357
17313
|
method: HttpMethod.GET,
|
|
17358
|
-
url: `/projects/${
|
|
17359
|
-
blockers: [
|
|
17314
|
+
url: `/projects/${projectId}/forms/`,
|
|
17315
|
+
blockers: [projectId.toString()],
|
|
17360
17316
|
blocks: []
|
|
17361
17317
|
});
|
|
17362
17318
|
for (const form of projectFormsResult.forms)
|
|
@@ -17368,8 +17324,8 @@ class UserFormService extends BaseApiService {
|
|
|
17368
17324
|
const organizationFormsResult = await this.enqueueRequest({
|
|
17369
17325
|
description: "Fetch organization forms",
|
|
17370
17326
|
method: HttpMethod.GET,
|
|
17371
|
-
url: `/projects/${
|
|
17372
|
-
blockers: [
|
|
17327
|
+
url: `/projects/${projectId}/organizations/forms/`,
|
|
17328
|
+
blockers: [projectId.toString()],
|
|
17373
17329
|
blocks: []
|
|
17374
17330
|
});
|
|
17375
17331
|
for (const form of organizationFormsResult.forms)
|
|
@@ -17381,8 +17337,8 @@ class UserFormService extends BaseApiService {
|
|
|
17381
17337
|
const assetTypeFormsResult = await this.enqueueRequest({
|
|
17382
17338
|
description: "Fetch asset type forms",
|
|
17383
17339
|
method: HttpMethod.GET,
|
|
17384
|
-
url: `/projects/${
|
|
17385
|
-
blockers: [
|
|
17340
|
+
url: `/projects/${projectId}/asset-types/forms/`,
|
|
17341
|
+
blockers: [projectId.toString()],
|
|
17386
17342
|
blocks: []
|
|
17387
17343
|
});
|
|
17388
17344
|
for (const form of assetTypeFormsResult.forms)
|
|
@@ -17394,8 +17350,8 @@ class UserFormService extends BaseApiService {
|
|
|
17394
17350
|
const issueTypeFormsResult = await this.enqueueRequest({
|
|
17395
17351
|
description: "Fetch issue type forms",
|
|
17396
17352
|
method: HttpMethod.GET,
|
|
17397
|
-
url: `/projects/${
|
|
17398
|
-
blockers: [
|
|
17353
|
+
url: `/projects/${projectId}/issue-types/forms/`,
|
|
17354
|
+
blockers: [projectId.toString()],
|
|
17399
17355
|
blocks: []
|
|
17400
17356
|
});
|
|
17401
17357
|
for (const form of issueTypeFormsResult.forms)
|
|
@@ -17678,9 +17634,7 @@ class UserFormSubmissionService extends BaseApiService {
|
|
|
17678
17634
|
throw e;
|
|
17679
17635
|
}
|
|
17680
17636
|
}
|
|
17681
|
-
async refreshStore() {
|
|
17682
|
-
const { store } = this.client;
|
|
17683
|
-
const projectId = store.getState().projectReducer.activeProjectId;
|
|
17637
|
+
async refreshStore(projectId) {
|
|
17684
17638
|
const submissions = await this.enqueueRequest({
|
|
17685
17639
|
description: "Fetch form submissions",
|
|
17686
17640
|
method: HttpMethod.GET,
|
|
@@ -17751,6 +17705,16 @@ class WorkspaceService extends BaseApiService {
|
|
|
17751
17705
|
});
|
|
17752
17706
|
return promise;
|
|
17753
17707
|
}
|
|
17708
|
+
async refreshStore(projectId) {
|
|
17709
|
+
const result = await this.enqueueRequest({
|
|
17710
|
+
description: "Get workspaces",
|
|
17711
|
+
method: HttpMethod.GET,
|
|
17712
|
+
url: `/projects/${projectId}/workspaces/`,
|
|
17713
|
+
blockers: [],
|
|
17714
|
+
blocks: []
|
|
17715
|
+
});
|
|
17716
|
+
this.dispatch(initializeWorkspaces(result));
|
|
17717
|
+
}
|
|
17754
17718
|
}
|
|
17755
17719
|
class OrganizationAccessService extends BaseApiService {
|
|
17756
17720
|
async update(organizationAccess) {
|
|
@@ -17778,13 +17742,7 @@ class OrganizationAccessService extends BaseApiService {
|
|
|
17778
17742
|
blocks: []
|
|
17779
17743
|
});
|
|
17780
17744
|
}
|
|
17781
|
-
async refreshStore() {
|
|
17782
|
-
const { store } = this.client;
|
|
17783
|
-
const state = store.getState();
|
|
17784
|
-
const organizationId = state.organizationReducer.activeOrganizationId;
|
|
17785
|
-
if (!organizationId) {
|
|
17786
|
-
return;
|
|
17787
|
-
}
|
|
17745
|
+
async refreshStore(organizationId) {
|
|
17788
17746
|
const result = await this.enqueueRequest({
|
|
17789
17747
|
description: "Get organization accesses",
|
|
17790
17748
|
method: HttpMethod.GET,
|
|
@@ -18049,11 +18007,7 @@ class EmailDomainsService extends BaseApiService {
|
|
|
18049
18007
|
throw e;
|
|
18050
18008
|
});
|
|
18051
18009
|
}
|
|
18052
|
-
async refreshStore() {
|
|
18053
|
-
const organizationId = this.client.store.getState().organizationReducer.activeOrganizationId;
|
|
18054
|
-
if (!organizationId) {
|
|
18055
|
-
throw new Error("No active organization");
|
|
18056
|
-
}
|
|
18010
|
+
async refreshStore(organizationId) {
|
|
18057
18011
|
const result = await this.enqueueRequest({
|
|
18058
18012
|
description: "Fetch email domains for organization",
|
|
18059
18013
|
method: HttpMethod.GET,
|
|
@@ -18065,36 +18019,6 @@ class EmailDomainsService extends BaseApiService {
|
|
|
18065
18019
|
}
|
|
18066
18020
|
}
|
|
18067
18021
|
class OrganizationService extends BaseApiService {
|
|
18068
|
-
async fetchInitialOrganizationData(organizationId, showLoading) {
|
|
18069
|
-
if (showLoading) {
|
|
18070
|
-
this.dispatch(setIsFetchingInitialData(true));
|
|
18071
|
-
}
|
|
18072
|
-
return this.enqueueRequest({
|
|
18073
|
-
description: "Get initial organization data",
|
|
18074
|
-
method: HttpMethod.GET,
|
|
18075
|
-
url: `/organizations/${organizationId}/initial-data/`,
|
|
18076
|
-
payload: {},
|
|
18077
|
-
isAuthNeeded: true,
|
|
18078
|
-
blockers: [],
|
|
18079
|
-
blocks: [organizationId.toString()]
|
|
18080
|
-
}).then((result) => {
|
|
18081
|
-
this._processInitialOrganizationData(result, showLoading);
|
|
18082
|
-
return result;
|
|
18083
|
-
});
|
|
18084
|
-
}
|
|
18085
|
-
_processInitialOrganizationData(data, showLoading) {
|
|
18086
|
-
const activeOrganization = data.organization;
|
|
18087
|
-
const organizationAccesses = data.organization_accesses;
|
|
18088
|
-
const emailDomains = data.email_domains;
|
|
18089
|
-
const users = data.users;
|
|
18090
|
-
this.dispatch(addUsers(users));
|
|
18091
|
-
this.dispatch(setActiveOrganizationId(activeOrganization.id));
|
|
18092
|
-
this.dispatch(initializeOrganizationAccesses(organizationAccesses));
|
|
18093
|
-
this.dispatch(initializeEmailDomains(emailDomains));
|
|
18094
|
-
if (showLoading) {
|
|
18095
|
-
this.dispatch(setIsFetchingInitialData(false));
|
|
18096
|
-
}
|
|
18097
|
-
}
|
|
18098
18022
|
create(name) {
|
|
18099
18023
|
return this.enqueueRequest({
|
|
18100
18024
|
description: "Create organization",
|
|
@@ -18128,26 +18052,30 @@ class OrganizationService extends BaseApiService {
|
|
|
18128
18052
|
blocks: []
|
|
18129
18053
|
});
|
|
18130
18054
|
}
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
this.dispatch(setIsFetchingInitialData(true));
|
|
18136
|
-
}
|
|
18137
|
-
const result = await this.enqueueRequest({
|
|
18138
|
-
description: "Get licenses",
|
|
18055
|
+
async refreshStore(projectId, organizationId) {
|
|
18056
|
+
const organizationsRecord = {};
|
|
18057
|
+
const projectOrganizations = await this.enqueueRequest({
|
|
18058
|
+
description: "Get organizations",
|
|
18139
18059
|
method: HttpMethod.GET,
|
|
18140
|
-
url: `/
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
18060
|
+
url: `/projects/${projectId}/organizations/`,
|
|
18061
|
+
blockers: [],
|
|
18062
|
+
blocks: []
|
|
18144
18063
|
});
|
|
18145
|
-
|
|
18146
|
-
|
|
18064
|
+
for (const organization2 of projectOrganizations) {
|
|
18065
|
+
organizationsRecord[organization2.id] = organization2;
|
|
18147
18066
|
}
|
|
18148
|
-
this.
|
|
18149
|
-
|
|
18067
|
+
const organization = await this.enqueueRequest({
|
|
18068
|
+
description: "Get organization",
|
|
18069
|
+
method: HttpMethod.GET,
|
|
18070
|
+
url: `/organizations/${organizationId}/`,
|
|
18071
|
+
blockers: [],
|
|
18072
|
+
blocks: []
|
|
18073
|
+
});
|
|
18074
|
+
organizationsRecord[organization.id] = organization;
|
|
18075
|
+
this.dispatch(setOrganizations(Object.values(organizationsRecord)));
|
|
18150
18076
|
}
|
|
18077
|
+
}
|
|
18078
|
+
class LicenseService extends BaseApiService {
|
|
18151
18079
|
async getLicense(license) {
|
|
18152
18080
|
const result = await this.enqueueRequest({
|
|
18153
18081
|
description: "Get license",
|
|
@@ -18244,6 +18172,32 @@ class LicenseService extends BaseApiService {
|
|
|
18244
18172
|
blocks: [license.offline_id]
|
|
18245
18173
|
});
|
|
18246
18174
|
}
|
|
18175
|
+
async refreshStore(projectId, organizationId) {
|
|
18176
|
+
const licencesRecord = {};
|
|
18177
|
+
const organizationLicences = await this.enqueueRequest({
|
|
18178
|
+
description: "Get licenses",
|
|
18179
|
+
method: HttpMethod.GET,
|
|
18180
|
+
url: `/organizations/${organizationId}/licenses/`,
|
|
18181
|
+
isAuthNeeded: true,
|
|
18182
|
+
blockers: [organizationId.toString()],
|
|
18183
|
+
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
18184
|
+
});
|
|
18185
|
+
for (const license of organizationLicences) {
|
|
18186
|
+
licencesRecord[license.offline_id] = license;
|
|
18187
|
+
}
|
|
18188
|
+
const projectLicences = await this.enqueueRequest({
|
|
18189
|
+
description: "Get licenses",
|
|
18190
|
+
method: HttpMethod.GET,
|
|
18191
|
+
url: `/projects/${projectId}/licenses/`,
|
|
18192
|
+
isAuthNeeded: true,
|
|
18193
|
+
blockers: [projectId.toString()],
|
|
18194
|
+
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
18195
|
+
});
|
|
18196
|
+
for (const license of projectLicences) {
|
|
18197
|
+
licencesRecord[license.offline_id] = license;
|
|
18198
|
+
}
|
|
18199
|
+
this.dispatch(setLicenses(Object.values(licencesRecord)));
|
|
18200
|
+
}
|
|
18247
18201
|
}
|
|
18248
18202
|
class DocumentService extends BaseApiService {
|
|
18249
18203
|
// TODO: Support adding for project or organization
|
|
@@ -18376,22 +18330,18 @@ class DocumentService extends BaseApiService {
|
|
|
18376
18330
|
});
|
|
18377
18331
|
return promise;
|
|
18378
18332
|
}
|
|
18379
|
-
async refreshStore() {
|
|
18380
|
-
const { store } = this.client;
|
|
18381
|
-
const state = store.getState();
|
|
18382
|
-
const activeProjectId = state.projectReducer.activeProjectId;
|
|
18333
|
+
async refreshStore(projectId, organizationId) {
|
|
18383
18334
|
const projectDocumentsPromise = this.enqueueRequest({
|
|
18384
18335
|
description: "Get project documents",
|
|
18385
18336
|
method: HttpMethod.GET,
|
|
18386
|
-
url: `/projects/${
|
|
18337
|
+
url: `/projects/${projectId}/documents/`,
|
|
18387
18338
|
blockers: [],
|
|
18388
18339
|
blocks: []
|
|
18389
18340
|
});
|
|
18390
|
-
const activeOrganizationId = state.organizationReducer.activeOrganizationId;
|
|
18391
18341
|
const organizationDocumentsPromise = this.enqueueRequest({
|
|
18392
18342
|
description: "Get organization documents",
|
|
18393
18343
|
method: HttpMethod.GET,
|
|
18394
|
-
url: `/organizations/${
|
|
18344
|
+
url: `/organizations/${organizationId}/documents/`,
|
|
18395
18345
|
blockers: [],
|
|
18396
18346
|
blocks: []
|
|
18397
18347
|
});
|
|
@@ -18504,13 +18454,11 @@ class AgentService extends BaseApiService {
|
|
|
18504
18454
|
blocks: ["rate"]
|
|
18505
18455
|
});
|
|
18506
18456
|
}
|
|
18507
|
-
async refreshStore() {
|
|
18508
|
-
const { store } = this.client;
|
|
18509
|
-
const activeProject = store.getState().projectReducer.activeProjectId;
|
|
18457
|
+
async refreshStore(projectId) {
|
|
18510
18458
|
const result = await this.enqueueRequest({
|
|
18511
18459
|
description: "Get agent conversation history",
|
|
18512
18460
|
method: HttpMethod.GET,
|
|
18513
|
-
url: `/projects/${
|
|
18461
|
+
url: `/projects/${projectId}/agent-conversations/`,
|
|
18514
18462
|
blockers: ["agent-conversations"],
|
|
18515
18463
|
blocks: ["agent-conversations"]
|
|
18516
18464
|
});
|
|
@@ -18518,16 +18466,10 @@ class AgentService extends BaseApiService {
|
|
|
18518
18466
|
}
|
|
18519
18467
|
}
|
|
18520
18468
|
class TeamService extends BaseApiService {
|
|
18521
|
-
add(teamPayload) {
|
|
18522
|
-
const { store } = this.client;
|
|
18523
|
-
const state = store.getState();
|
|
18524
|
-
const activeOrganizationId = state.organizationReducer.activeOrganizationId;
|
|
18525
|
-
if (!activeOrganizationId) {
|
|
18526
|
-
throw new Error(`Expected active organization to be set, got ${activeOrganizationId}`);
|
|
18527
|
-
}
|
|
18469
|
+
add(teamPayload, organizationId) {
|
|
18528
18470
|
const offlineTeam = offline({
|
|
18529
18471
|
...teamPayload,
|
|
18530
|
-
organization:
|
|
18472
|
+
organization: organizationId,
|
|
18531
18473
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
18532
18474
|
// TODO: uncomment once supported
|
|
18533
18475
|
// created_by: state.userReducer.currentUser.id,
|
|
@@ -18536,7 +18478,7 @@ class TeamService extends BaseApiService {
|
|
|
18536
18478
|
const promise = this.enqueueRequest({
|
|
18537
18479
|
description: "Create team",
|
|
18538
18480
|
method: HttpMethod.POST,
|
|
18539
|
-
url: `/organizations/${
|
|
18481
|
+
url: `/organizations/${organizationId}/teams/`,
|
|
18540
18482
|
payload: offlineTeam,
|
|
18541
18483
|
// No blocks since users and organizations are not offline
|
|
18542
18484
|
blockers: [],
|
|
@@ -18640,22 +18582,43 @@ class TeamService extends BaseApiService {
|
|
|
18640
18582
|
const newMembers = team.members.filter((member) => !members.includes(member));
|
|
18641
18583
|
return this.setMembers(teamId, newMembers);
|
|
18642
18584
|
}
|
|
18643
|
-
async refreshStore() {
|
|
18644
|
-
const { store } = this.client;
|
|
18645
|
-
const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
|
|
18646
|
-
if (!activeOrganizationId) {
|
|
18647
|
-
throw new Error(`Expected active organization to be set, got ${activeOrganizationId}`);
|
|
18648
|
-
}
|
|
18585
|
+
async refreshStore(organizationId) {
|
|
18649
18586
|
const result = await this.enqueueRequest({
|
|
18650
18587
|
description: "Fetch teams",
|
|
18651
18588
|
method: HttpMethod.GET,
|
|
18652
|
-
url: `/organizations/${
|
|
18589
|
+
url: `/organizations/${organizationId}/teams/`,
|
|
18653
18590
|
blockers: [],
|
|
18654
18591
|
blocks: []
|
|
18655
18592
|
});
|
|
18656
18593
|
this.dispatch(setTeams(result));
|
|
18657
18594
|
}
|
|
18658
18595
|
}
|
|
18596
|
+
class UserService extends BaseApiService {
|
|
18597
|
+
async refreshStore(projectId, organizationId) {
|
|
18598
|
+
const usersRecord = {};
|
|
18599
|
+
const organizationUsers = await this.enqueueRequest({
|
|
18600
|
+
description: "Fetch organization users",
|
|
18601
|
+
method: HttpMethod.GET,
|
|
18602
|
+
url: `/organizations/${organizationId}/users/`,
|
|
18603
|
+
blockers: [],
|
|
18604
|
+
blocks: []
|
|
18605
|
+
});
|
|
18606
|
+
for (const user of organizationUsers) {
|
|
18607
|
+
usersRecord[user.id] = user;
|
|
18608
|
+
}
|
|
18609
|
+
const projectUsers = await this.enqueueRequest({
|
|
18610
|
+
description: "Fetch project users",
|
|
18611
|
+
method: HttpMethod.GET,
|
|
18612
|
+
url: `/projects/${projectId}/users/`,
|
|
18613
|
+
blockers: [],
|
|
18614
|
+
blocks: []
|
|
18615
|
+
});
|
|
18616
|
+
for (const user of projectUsers) {
|
|
18617
|
+
usersRecord[user.id] = user;
|
|
18618
|
+
}
|
|
18619
|
+
this.dispatch(setUsers(Object.values(usersRecord)));
|
|
18620
|
+
}
|
|
18621
|
+
}
|
|
18659
18622
|
export {
|
|
18660
18623
|
APIError,
|
|
18661
18624
|
AgentService,
|
|
@@ -18751,6 +18714,7 @@ export {
|
|
|
18751
18714
|
TextInput,
|
|
18752
18715
|
UserFormService,
|
|
18753
18716
|
UserFormSubmissionService,
|
|
18717
|
+
UserService,
|
|
18754
18718
|
VERSION_REDUCER_KEY,
|
|
18755
18719
|
VerificationCodeType,
|
|
18756
18720
|
WorkspaceService,
|