mitra-interactions-sdk 1.0.37 → 1.0.39
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/README.md +81 -2
- package/dist/index.d.mts +199 -1
- package/dist/index.d.ts +199 -1
- package/dist/index.js +155 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +145 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -496,6 +496,59 @@ function createMitraInstance(initialConfig) {
|
|
|
496
496
|
const { tableName, records, jdbcConnectionConfigId } = options;
|
|
497
497
|
const pid = resolveProjectId2(options.projectId);
|
|
498
498
|
return requestTenant("POST", `/interactions/records/${tableName}/batch`, pid, { body: records, params: { jdbcConnectionConfigId } });
|
|
499
|
+
},
|
|
500
|
+
// Profile Management
|
|
501
|
+
async listProfiles(options = {}) {
|
|
502
|
+
return request("GET", "/interactions/profiles", { params: { projectId: resolveProjectId2(options.projectId) } });
|
|
503
|
+
},
|
|
504
|
+
async getProfileDetails(options) {
|
|
505
|
+
return request("GET", `/interactions/profiles/${options.profileId}`, { params: { projectId: resolveProjectId2(options.projectId) } });
|
|
506
|
+
},
|
|
507
|
+
async createProfile(options) {
|
|
508
|
+
const body = { projectId: resolveProjectId2(options.projectId), name: options.name };
|
|
509
|
+
if (options.color !== void 0) body.color = options.color;
|
|
510
|
+
if (options.homeScreenId !== void 0) body.homeScreenId = options.homeScreenId;
|
|
511
|
+
return request("POST", "/interactions/profiles", { body });
|
|
512
|
+
},
|
|
513
|
+
async updateProfile(options) {
|
|
514
|
+
const body = { projectId: resolveProjectId2(options.projectId), profileId: options.profileId };
|
|
515
|
+
if (options.name !== void 0) body.name = options.name;
|
|
516
|
+
if (options.color !== void 0) body.color = options.color;
|
|
517
|
+
if (options.homeScreenId !== void 0) body.homeScreenId = options.homeScreenId;
|
|
518
|
+
return request("PUT", "/interactions/profiles", { body });
|
|
519
|
+
},
|
|
520
|
+
async deleteProfile(options) {
|
|
521
|
+
return request("DELETE", "/interactions/profiles", { body: { projectId: resolveProjectId2(options.projectId), profileId: options.profileId } });
|
|
522
|
+
},
|
|
523
|
+
async setProfileUsers(options) {
|
|
524
|
+
return request("POST", "/interactions/profiles/users", {
|
|
525
|
+
body: { projectId: resolveProjectId2(options.projectId), profileId: options.profileId, userIds: options.userIds }
|
|
526
|
+
});
|
|
527
|
+
},
|
|
528
|
+
async setProfileSelectTables(options) {
|
|
529
|
+
return request("POST", "/interactions/profiles/selectTables", {
|
|
530
|
+
body: { projectId: resolveProjectId2(options.projectId), profileId: options.profileId, tables: options.tables }
|
|
531
|
+
});
|
|
532
|
+
},
|
|
533
|
+
async setProfileDmlTables(options) {
|
|
534
|
+
return request("POST", "/interactions/profiles/dmlTables", {
|
|
535
|
+
body: { projectId: resolveProjectId2(options.projectId), profileId: options.profileId, tables: options.tables }
|
|
536
|
+
});
|
|
537
|
+
},
|
|
538
|
+
async setProfileActions(options) {
|
|
539
|
+
return request("POST", "/interactions/profiles/actions", {
|
|
540
|
+
body: { projectId: resolveProjectId2(options.projectId), profileId: options.profileId, actionIds: options.actionIds }
|
|
541
|
+
});
|
|
542
|
+
},
|
|
543
|
+
async setProfileScreens(options) {
|
|
544
|
+
return request("POST", "/interactions/profiles/screens", {
|
|
545
|
+
body: { projectId: resolveProjectId2(options.projectId), profileId: options.profileId, screenIds: options.screenIds }
|
|
546
|
+
});
|
|
547
|
+
},
|
|
548
|
+
async setProfileServerFunctions(options) {
|
|
549
|
+
return request("POST", "/interactions/profiles/serverFunctions", {
|
|
550
|
+
body: { projectId: resolveProjectId2(options.projectId), profileId: options.profileId, serverFunctionIds: options.serverFunctionIds }
|
|
551
|
+
});
|
|
499
552
|
}
|
|
500
553
|
};
|
|
501
554
|
return instance;
|
|
@@ -644,12 +697,26 @@ var http = {
|
|
|
644
697
|
body: body !== void 0 ? JSON.stringify(body) : void 0
|
|
645
698
|
});
|
|
646
699
|
},
|
|
700
|
+
async put(endpoint, body) {
|
|
701
|
+
return fetchWithRefresh(buildUrl(endpoint), {
|
|
702
|
+
method: "PUT",
|
|
703
|
+
headers: buildHeaders(),
|
|
704
|
+
body: body !== void 0 ? JSON.stringify(body) : void 0
|
|
705
|
+
});
|
|
706
|
+
},
|
|
647
707
|
async del(endpoint, params) {
|
|
648
708
|
return fetchWithRefresh(buildUrl(endpoint, params), {
|
|
649
709
|
method: "DELETE",
|
|
650
710
|
headers: buildHeaders()
|
|
651
711
|
});
|
|
652
712
|
},
|
|
713
|
+
async delBody(endpoint, body) {
|
|
714
|
+
return fetchWithRefresh(buildUrl(endpoint), {
|
|
715
|
+
method: "DELETE",
|
|
716
|
+
headers: buildHeaders(),
|
|
717
|
+
body: body !== void 0 ? JSON.stringify(body) : void 0
|
|
718
|
+
});
|
|
719
|
+
},
|
|
653
720
|
async upload(endpoint, formData) {
|
|
654
721
|
const config = getConfig();
|
|
655
722
|
const headers = {};
|
|
@@ -846,12 +913,91 @@ async function createRecordsBatchMitra(options) {
|
|
|
846
913
|
const pid = resolveProjectId(options.projectId);
|
|
847
914
|
return httpTenant.post(`/interactions/records/${tableName}/batch`, pid, records, { jdbcConnectionConfigId });
|
|
848
915
|
}
|
|
916
|
+
async function listProfilesMitra(options = {}) {
|
|
917
|
+
return http.get("/interactions/profiles", { projectId: resolveProjectId(options.projectId) });
|
|
918
|
+
}
|
|
919
|
+
async function getProfileDetailsMitra(options) {
|
|
920
|
+
return http.get(`/interactions/profiles/${options.profileId}`, { projectId: resolveProjectId(options.projectId) });
|
|
921
|
+
}
|
|
922
|
+
async function createProfileMitra(options) {
|
|
923
|
+
const body = {
|
|
924
|
+
projectId: resolveProjectId(options.projectId),
|
|
925
|
+
name: options.name
|
|
926
|
+
};
|
|
927
|
+
if (options.color !== void 0) body.color = options.color;
|
|
928
|
+
if (options.homeScreenId !== void 0) body.homeScreenId = options.homeScreenId;
|
|
929
|
+
return http.post("/interactions/profiles", body);
|
|
930
|
+
}
|
|
931
|
+
async function updateProfileMitra(options) {
|
|
932
|
+
const body = {
|
|
933
|
+
projectId: resolveProjectId(options.projectId),
|
|
934
|
+
profileId: options.profileId
|
|
935
|
+
};
|
|
936
|
+
if (options.name !== void 0) body.name = options.name;
|
|
937
|
+
if (options.color !== void 0) body.color = options.color;
|
|
938
|
+
if (options.homeScreenId !== void 0) body.homeScreenId = options.homeScreenId;
|
|
939
|
+
return http.put("/interactions/profiles", body);
|
|
940
|
+
}
|
|
941
|
+
async function deleteProfileMitra(options) {
|
|
942
|
+
return http.delBody("/interactions/profiles", {
|
|
943
|
+
projectId: resolveProjectId(options.projectId),
|
|
944
|
+
profileId: options.profileId
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
async function setProfileUsersMitra(options) {
|
|
948
|
+
return http.post("/interactions/profiles/users", {
|
|
949
|
+
projectId: resolveProjectId(options.projectId),
|
|
950
|
+
profileId: options.profileId,
|
|
951
|
+
userIds: options.userIds
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
async function setProfileSelectTablesMitra(options) {
|
|
955
|
+
const body = {
|
|
956
|
+
projectId: resolveProjectId(options.projectId),
|
|
957
|
+
profileId: options.profileId,
|
|
958
|
+
tables: options.tables
|
|
959
|
+
};
|
|
960
|
+
if (options.jdbcConnectionConfigId !== void 0) body.jdbcConnectionConfigId = options.jdbcConnectionConfigId;
|
|
961
|
+
return http.post("/interactions/profiles/selectTables", body);
|
|
962
|
+
}
|
|
963
|
+
async function setProfileDmlTablesMitra(options) {
|
|
964
|
+
const body = {
|
|
965
|
+
projectId: resolveProjectId(options.projectId),
|
|
966
|
+
profileId: options.profileId,
|
|
967
|
+
tables: options.tables
|
|
968
|
+
};
|
|
969
|
+
if (options.jdbcConnectionConfigId !== void 0) body.jdbcConnectionConfigId = options.jdbcConnectionConfigId;
|
|
970
|
+
return http.post("/interactions/profiles/dmlTables", body);
|
|
971
|
+
}
|
|
972
|
+
async function setProfileActionsMitra(options) {
|
|
973
|
+
return http.post("/interactions/profiles/actions", {
|
|
974
|
+
projectId: resolveProjectId(options.projectId),
|
|
975
|
+
profileId: options.profileId,
|
|
976
|
+
actionIds: options.actionIds
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
async function setProfileScreensMitra(options) {
|
|
980
|
+
return http.post("/interactions/profiles/screens", {
|
|
981
|
+
projectId: resolveProjectId(options.projectId),
|
|
982
|
+
profileId: options.profileId,
|
|
983
|
+
screenIds: options.screenIds
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
async function setProfileServerFunctionsMitra(options) {
|
|
987
|
+
return http.post("/interactions/profiles/serverFunctions", {
|
|
988
|
+
projectId: resolveProjectId(options.projectId),
|
|
989
|
+
profileId: options.profileId,
|
|
990
|
+
serverFunctionIds: options.serverFunctionIds
|
|
991
|
+
});
|
|
992
|
+
}
|
|
849
993
|
|
|
850
994
|
exports.callIntegrationMitra = callIntegrationMitra;
|
|
851
995
|
exports.configureSdkMitra = configureSdkMitra;
|
|
852
996
|
exports.createMitraInstance = createMitraInstance;
|
|
997
|
+
exports.createProfileMitra = createProfileMitra;
|
|
853
998
|
exports.createRecordMitra = createRecordMitra;
|
|
854
999
|
exports.createRecordsBatchMitra = createRecordsBatchMitra;
|
|
1000
|
+
exports.deleteProfileMitra = deleteProfileMitra;
|
|
855
1001
|
exports.deleteRecordMitra = deleteRecordMitra;
|
|
856
1002
|
exports.emailLoginMitra = emailLoginMitra;
|
|
857
1003
|
exports.emailResendCodeMitra = emailResendCodeMitra;
|
|
@@ -861,9 +1007,11 @@ exports.executeDbActionMitra = executeDbActionMitra;
|
|
|
861
1007
|
exports.executeServerFunctionAsyncMitra = executeServerFunctionAsyncMitra;
|
|
862
1008
|
exports.executeServerFunctionMitra = executeServerFunctionMitra;
|
|
863
1009
|
exports.getConfig = getConfig;
|
|
1010
|
+
exports.getProfileDetailsMitra = getProfileDetailsMitra;
|
|
864
1011
|
exports.getRecordMitra = getRecordMitra;
|
|
865
1012
|
exports.getVariableMitra = getVariableMitra;
|
|
866
1013
|
exports.listIntegrationsMitra = listIntegrationsMitra;
|
|
1014
|
+
exports.listProfilesMitra = listProfilesMitra;
|
|
867
1015
|
exports.listRecordsMitra = listRecordsMitra;
|
|
868
1016
|
exports.listVariablesMitra = listVariablesMitra;
|
|
869
1017
|
exports.loginMitra = loginMitra;
|
|
@@ -876,8 +1024,15 @@ exports.resolveProjectId = resolveProjectId;
|
|
|
876
1024
|
exports.runActionMitra = runActionMitra;
|
|
877
1025
|
exports.runQueryMitra = runQueryMitra;
|
|
878
1026
|
exports.setFileStatusMitra = setFileStatusMitra;
|
|
1027
|
+
exports.setProfileActionsMitra = setProfileActionsMitra;
|
|
1028
|
+
exports.setProfileDmlTablesMitra = setProfileDmlTablesMitra;
|
|
1029
|
+
exports.setProfileScreensMitra = setProfileScreensMitra;
|
|
1030
|
+
exports.setProfileSelectTablesMitra = setProfileSelectTablesMitra;
|
|
1031
|
+
exports.setProfileServerFunctionsMitra = setProfileServerFunctionsMitra;
|
|
1032
|
+
exports.setProfileUsersMitra = setProfileUsersMitra;
|
|
879
1033
|
exports.setVariableMitra = setVariableMitra;
|
|
880
1034
|
exports.stopServerFunctionExecutionMitra = stopServerFunctionExecutionMitra;
|
|
1035
|
+
exports.updateProfileMitra = updateProfileMitra;
|
|
881
1036
|
exports.updateRecordMitra = updateRecordMitra;
|
|
882
1037
|
exports.uploadFileLoadableMitra = uploadFileLoadableMitra;
|
|
883
1038
|
exports.uploadFilePublicMitra = uploadFilePublicMitra;
|