@overmap-ai/core 1.0.63-selector-standardization.7 → 1.0.63-selector-standardization.8
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 +23 -96
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +23 -96
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/store/slices/assetSlice.d.ts +39 -13
- package/dist/store/slices/emailDomainsSlice.d.ts +6 -2
- package/dist/store/slices/formRevisionSlice.d.ts +1 -2
- package/dist/store/slices/formSlice.d.ts +8 -4
- package/dist/store/slices/organizationSlice.d.ts +7 -4
- package/dist/store/slices/userSlice.d.ts +0 -1
- package/package.json +1 -1
|
@@ -938,42 +938,15 @@ var __publicField = (obj, key, value) => {
|
|
|
938
938
|
initialState: initialState$y,
|
|
939
939
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
940
940
|
reducers: {
|
|
941
|
-
initializeAssets:
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
assetAdapter.addMany(state, action);
|
|
951
|
-
prevAssets = null;
|
|
952
|
-
},
|
|
953
|
-
setAsset: (state, action) => {
|
|
954
|
-
assetAdapter.setOne(state, action);
|
|
955
|
-
prevAssets = null;
|
|
956
|
-
},
|
|
957
|
-
setAssets: (state, action) => {
|
|
958
|
-
assetAdapter.setMany(state, action);
|
|
959
|
-
prevAssets = null;
|
|
960
|
-
},
|
|
961
|
-
updateAsset: (state, action) => {
|
|
962
|
-
assetAdapter.updateOne(state, action);
|
|
963
|
-
prevAssets = null;
|
|
964
|
-
},
|
|
965
|
-
updateAssets: (state, action) => {
|
|
966
|
-
assetAdapter.updateMany(state, action);
|
|
967
|
-
prevAssets = null;
|
|
968
|
-
},
|
|
969
|
-
deleteAsset: (state, action) => {
|
|
970
|
-
assetAdapter.deleteOne(state, action);
|
|
971
|
-
prevAssets = null;
|
|
972
|
-
},
|
|
973
|
-
deleteAssets: (state, action) => {
|
|
974
|
-
assetAdapter.deleteMany(state, action);
|
|
975
|
-
prevAssets = null;
|
|
976
|
-
}
|
|
941
|
+
initializeAssets: assetAdapter.initialize,
|
|
942
|
+
addAsset: assetAdapter.addOne,
|
|
943
|
+
addAssets: assetAdapter.addMany,
|
|
944
|
+
setAsset: assetAdapter.setOne,
|
|
945
|
+
setAssets: assetAdapter.setMany,
|
|
946
|
+
updateAsset: assetAdapter.updateOne,
|
|
947
|
+
updateAssets: assetAdapter.updateMany,
|
|
948
|
+
deleteAsset: assetAdapter.deleteOne,
|
|
949
|
+
deleteAssets: assetAdapter.deleteMany
|
|
977
950
|
}
|
|
978
951
|
});
|
|
979
952
|
const {
|
|
@@ -987,13 +960,6 @@ var __publicField = (obj, key, value) => {
|
|
|
987
960
|
setAsset,
|
|
988
961
|
setAssets
|
|
989
962
|
} = assetSlice.actions;
|
|
990
|
-
let prevAssets = null;
|
|
991
|
-
const _selectAssets = (state) => {
|
|
992
|
-
if (!prevAssets) {
|
|
993
|
-
prevAssets = Object.values(state.assetReducer.instances);
|
|
994
|
-
}
|
|
995
|
-
return prevAssets;
|
|
996
|
-
};
|
|
997
963
|
const selectAssetsMapping = (state) => state.assetReducer.instances;
|
|
998
964
|
const selectAssets = toolkit.createSelector([selectAssetsMapping], (assetsMapping) => {
|
|
999
965
|
return Object.values(assetsMapping);
|
|
@@ -1730,11 +1696,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1730
1696
|
const userReducer = userSlice.reducer;
|
|
1731
1697
|
const selectCurrentUser = (state) => state.userReducer.currentUser;
|
|
1732
1698
|
const selectUsersMapping = (state) => state.userReducer.users;
|
|
1733
|
-
const selectUser = (userId) => (state) => {
|
|
1734
|
-
if (userId === null)
|
|
1735
|
-
return void 0;
|
|
1736
|
-
return state.userReducer.users[userId];
|
|
1737
|
-
};
|
|
1738
1699
|
const selectUserById = (id) => (state) => {
|
|
1739
1700
|
return state.userReducer.users[id];
|
|
1740
1701
|
};
|
|
@@ -2006,19 +1967,19 @@ var __publicField = (obj, key, value) => {
|
|
|
2006
1967
|
}
|
|
2007
1968
|
});
|
|
2008
1969
|
const { setOrganizations } = organizationSlice.actions;
|
|
2009
|
-
const selectOrganizations = (state) => {
|
|
2010
|
-
return Object.values(state.organizationReducer.organizations);
|
|
2011
|
-
};
|
|
2012
1970
|
const selectOrganizationsMapping = (state) => {
|
|
2013
1971
|
return state.organizationReducer.organizations;
|
|
2014
1972
|
};
|
|
1973
|
+
const selectOrganizations = toolkit.createSelector([selectOrganizationsMapping], (organizationsMapping) => {
|
|
1974
|
+
return Object.values(organizationsMapping);
|
|
1975
|
+
});
|
|
1976
|
+
const selectOrganizationById = (id) => (state) => {
|
|
1977
|
+
return state.organizationReducer.organizations[id];
|
|
1978
|
+
};
|
|
2015
1979
|
const selectOrganizationsWithAccess = toolkit.createSelector(
|
|
2016
1980
|
[selectOrganizations],
|
|
2017
1981
|
(organizations) => Object.values(organizations).filter((organization) => organization.has_access)
|
|
2018
1982
|
);
|
|
2019
|
-
const selectOrganizationById = (id) => (state) => {
|
|
2020
|
-
return state.organizationReducer.organizations[id];
|
|
2021
|
-
};
|
|
2022
1983
|
const selectOrganizationUsersIds = toolkit.createSelector(
|
|
2023
1984
|
[selectOrganizationAccesses],
|
|
2024
1985
|
(organizationAccesses) => Object.values(organizationAccesses).map((organizationAccess) => organizationAccess.user)
|
|
@@ -2061,9 +2022,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2061
2022
|
});
|
|
2062
2023
|
}
|
|
2063
2024
|
);
|
|
2064
|
-
const selectOrganization = (id) => (state) => {
|
|
2065
|
-
return state.organizationReducer.organizations[id];
|
|
2066
|
-
};
|
|
2067
2025
|
const organizationReducer = organizationSlice.reducer;
|
|
2068
2026
|
const createOfflineAction = (request2, baseUrl, serviceName) => {
|
|
2069
2027
|
const requestWithUuid = request2.uuid ? request2 : { ...request2, uuid: uuid.v4() };
|
|
@@ -2368,32 +2326,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2368
2326
|
}
|
|
2369
2327
|
)
|
|
2370
2328
|
);
|
|
2371
|
-
const selectLatestFormRevisionsOfAssetTypes = restructureCreateSelectorWithArgs(
|
|
2372
|
-
toolkit.createSelector(
|
|
2373
|
-
[
|
|
2374
|
-
(state) => state.formReducer.instances,
|
|
2375
|
-
selectFormRevisionMapping,
|
|
2376
|
-
(_state, assetTypeIds) => assetTypeIds
|
|
2377
|
-
],
|
|
2378
|
-
(formsMapping, revisions, assetTypeIds) => {
|
|
2379
|
-
const assetTypeIdsSet = new Set(assetTypeIds);
|
|
2380
|
-
const formsOfAssetTypes = {};
|
|
2381
|
-
const ret = {};
|
|
2382
|
-
for (const form of Object.values(formsMapping)) {
|
|
2383
|
-
if (form.asset_type && assetTypeIdsSet.has(form.asset_type)) {
|
|
2384
|
-
formsOfAssetTypes[form.offline_id] = form;
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
for (const revision of Object.values(revisions)) {
|
|
2388
|
-
const form = formsOfAssetTypes[revision.form];
|
|
2389
|
-
if (!form || !form.asset_type || ret[form.asset_type] && formRevisionSortFn(ret[form.asset_type], revision) > 0)
|
|
2390
|
-
continue;
|
|
2391
|
-
ret[form.asset_type] = revision;
|
|
2392
|
-
}
|
|
2393
|
-
return ret;
|
|
2394
|
-
}
|
|
2395
|
-
)
|
|
2396
|
-
);
|
|
2397
2329
|
const selectLatestFormRevisionByForm = toolkit.createSelector([selectFormRevisionMapping], (revisions) => {
|
|
2398
2330
|
const latestRevisions = {};
|
|
2399
2331
|
for (const revision of Object.values(revisions)) {
|
|
@@ -2422,9 +2354,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2422
2354
|
}
|
|
2423
2355
|
});
|
|
2424
2356
|
const { initializeForms, setForm, addForm, addForms, updateForm, deleteForm } = formSlice.actions;
|
|
2425
|
-
const
|
|
2357
|
+
const formReducer = formSlice.reducer;
|
|
2358
|
+
const selectFormMapping = (state) => {
|
|
2426
2359
|
return state.formReducer.instances;
|
|
2427
2360
|
};
|
|
2361
|
+
const selectForms = toolkit.createSelector([selectFormMapping], (formsMapping) => {
|
|
2362
|
+
return Object.values(formsMapping);
|
|
2363
|
+
});
|
|
2428
2364
|
const selectFilteredForms = restructureCreateSelectorWithArgs(
|
|
2429
2365
|
toolkit.createSelector(
|
|
2430
2366
|
[
|
|
@@ -2461,9 +2397,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2461
2397
|
{ memoizeOptions: { equalityCheck: shallowEqual } }
|
|
2462
2398
|
)
|
|
2463
2399
|
);
|
|
2464
|
-
const selectFormMapping = (state) => {
|
|
2465
|
-
return state.formReducer.instances;
|
|
2466
|
-
};
|
|
2467
2400
|
const selectFormById = (formId) => (state) => {
|
|
2468
2401
|
return state.formReducer.instances[formId];
|
|
2469
2402
|
};
|
|
@@ -2489,7 +2422,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2489
2422
|
const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (formsMapping) => {
|
|
2490
2423
|
return Object.values(formsMapping).filter((form) => !form.asset_type).length;
|
|
2491
2424
|
});
|
|
2492
|
-
const formReducer = formSlice.reducer;
|
|
2493
2425
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2494
2426
|
const initialState$d = submissionAdapter.getInitialState({});
|
|
2495
2427
|
const formSubmissionSlice = toolkit.createSlice({
|
|
@@ -2808,7 +2740,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2808
2740
|
});
|
|
2809
2741
|
const { initializeEmailDomains, addEmailDomain, deleteEmailDomain } = emailDomainsSlice.actions;
|
|
2810
2742
|
const selectEmailDomainsAsMapping = (state) => state.emailDomainsReducer.instances;
|
|
2811
|
-
const selectEmailDomains = (
|
|
2743
|
+
const selectEmailDomains = toolkit.createSelector([selectEmailDomainsAsMapping], (mapping) => Object.values(mapping));
|
|
2812
2744
|
const selectEmailDomainsOfOrganization = restructureCreateSelectorWithArgs(
|
|
2813
2745
|
toolkit.createSelector(
|
|
2814
2746
|
[selectEmailDomains, (_, organizationId) => organizationId],
|
|
@@ -4300,7 +4232,6 @@ var __publicField = (obj, key, value) => {
|
|
|
4300
4232
|
}
|
|
4301
4233
|
// TODO: payload does not require asset_type
|
|
4302
4234
|
bulkAdd(assetsToCreate, workspaceId, assetTypeId, batchSize) {
|
|
4303
|
-
const { store } = this.client;
|
|
4304
4235
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4305
4236
|
const transactionId = uuid.v4();
|
|
4306
4237
|
const assetBatches = chunkArray(assetsToCreate, batchSize).map((assetBatch) => {
|
|
@@ -4344,7 +4275,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4344
4275
|
}
|
|
4345
4276
|
void Promise.all(batchPromises).then((result) => {
|
|
4346
4277
|
const allCreatedAssets = result.flat();
|
|
4347
|
-
|
|
4278
|
+
this.dispatch(addAssets(allCreatedAssets));
|
|
4348
4279
|
});
|
|
4349
4280
|
return batchPromises;
|
|
4350
4281
|
}
|
|
@@ -7558,7 +7489,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7558
7489
|
exports2.VerificationCodeType = VerificationCodeType;
|
|
7559
7490
|
exports2.WorkspaceService = WorkspaceService;
|
|
7560
7491
|
exports2.YELLOW = YELLOW;
|
|
7561
|
-
exports2._selectAssets = _selectAssets;
|
|
7562
7492
|
exports2._selectLatestFormRevision = _selectLatestFormRevision;
|
|
7563
7493
|
exports2._setLatestRetryTime = _setLatestRetryTime;
|
|
7564
7494
|
exports2.acceptProjectInvite = acceptProjectInvite;
|
|
@@ -7909,8 +7839,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7909
7839
|
exports2.selectFormSubmissionsOfAsset = selectFormSubmissionsOfAsset;
|
|
7910
7840
|
exports2.selectFormSubmissionsOfForm = selectFormSubmissionsOfForm;
|
|
7911
7841
|
exports2.selectFormSubmissionsOfIssue = selectFormSubmissionsOfIssue;
|
|
7842
|
+
exports2.selectForms = selectForms;
|
|
7912
7843
|
exports2.selectFormsCount = selectFormsCount;
|
|
7913
|
-
exports2.selectFormsMapping = selectFormsMapping;
|
|
7914
7844
|
exports2.selectGeneralFormCount = selectGeneralFormCount;
|
|
7915
7845
|
exports2.selectGeoImageById = selectGeoImageById;
|
|
7916
7846
|
exports2.selectGeoImageMapping = selectGeoImageMapping;
|
|
@@ -7943,7 +7873,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7943
7873
|
exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
|
|
7944
7874
|
exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
|
|
7945
7875
|
exports2.selectLatestFormRevisionOfForm = selectLatestFormRevisionOfForm;
|
|
7946
|
-
exports2.selectLatestFormRevisionsOfAssetTypes = selectLatestFormRevisionsOfAssetTypes;
|
|
7947
7876
|
exports2.selectLatestRetryTime = selectLatestRetryTime;
|
|
7948
7877
|
exports2.selectLicense = selectLicense;
|
|
7949
7878
|
exports2.selectLicenseForProject = selectLicenseForProject;
|
|
@@ -7952,7 +7881,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7952
7881
|
exports2.selectLicensesOfOrganization = selectLicensesOfOrganization;
|
|
7953
7882
|
exports2.selectMainWorkspace = selectMainWorkspace;
|
|
7954
7883
|
exports2.selectNumberOfAssetsOfAssetType = selectNumberOfAssetsOfAssetType;
|
|
7955
|
-
exports2.selectOrganization = selectOrganization;
|
|
7956
7884
|
exports2.selectOrganizationAccessById = selectOrganizationAccessById;
|
|
7957
7885
|
exports2.selectOrganizationAccessForUser = selectOrganizationAccessForUser;
|
|
7958
7886
|
exports2.selectOrganizationAccessUserMapping = selectOrganizationAccessUserMapping;
|
|
@@ -7997,7 +7925,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7997
7925
|
exports2.selectTeamsOfOrganization = selectTeamsOfOrganization;
|
|
7998
7926
|
exports2.selectTeamsOfUser = selectTeamsOfUser;
|
|
7999
7927
|
exports2.selectUploadUrl = selectUploadUrl;
|
|
8000
|
-
exports2.selectUser = selectUser;
|
|
8001
7928
|
exports2.selectUserById = selectUserById;
|
|
8002
7929
|
exports2.selectUsersByIds = selectUsersByIds;
|
|
8003
7930
|
exports2.selectUsersMapping = selectUsersMapping;
|