codemie-sdk 0.1.419 → 0.1.421
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/index.cjs +109 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +170 -8
- package/dist/index.d.ts +170 -8
- package/dist/index.js +109 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -712,7 +712,12 @@ var DataSourceType = {
|
|
|
712
712
|
SUMMARY: "summary",
|
|
713
713
|
CHUNK_SUMMARY: "chunk-summary",
|
|
714
714
|
JSON: "knowledge_base_json",
|
|
715
|
-
BEDROCK: "knowledge_base_bedrock"
|
|
715
|
+
BEDROCK: "knowledge_base_bedrock",
|
|
716
|
+
XRAY: "knowledge_base_xray",
|
|
717
|
+
PLATFORM: "platform_marketplace_assistant",
|
|
718
|
+
AZURE_DEVOPS_WIKI: "knowledge_base_azure_devops_wiki",
|
|
719
|
+
AZURE_DEVOPS_WORK_ITEM: "knowledge_base_azure_devops_work_item",
|
|
720
|
+
SHAREPOINT: "knowledge_base_sharepoint"
|
|
716
721
|
};
|
|
717
722
|
var DataSourceStatus = {
|
|
718
723
|
COMPLETED: "completed",
|
|
@@ -740,6 +745,15 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
740
745
|
code: _DatasourceMapper.extractCodeDataSourceResponseFields(
|
|
741
746
|
response
|
|
742
747
|
)
|
|
748
|
+
},
|
|
749
|
+
...response.index_type === DataSourceType.AZURE_DEVOPS_WIKI && {
|
|
750
|
+
azure_devops_wiki: response.azure_devops_wiki
|
|
751
|
+
},
|
|
752
|
+
...response.index_type === DataSourceType.AZURE_DEVOPS_WORK_ITEM && {
|
|
753
|
+
azure_devops_work_item: response.azure_devops_work_item
|
|
754
|
+
},
|
|
755
|
+
...response.index_type === DataSourceType.SHAREPOINT && {
|
|
756
|
+
sharepoint: response.sharepoint
|
|
743
757
|
}
|
|
744
758
|
});
|
|
745
759
|
}
|
|
@@ -808,7 +822,15 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
808
822
|
...create.type === DataSourceType.JIRA && _DatasourceMapper.mapJiraDataSourceParams(create),
|
|
809
823
|
...create.type === DataSourceType.GOOGLE && _DatasourceMapper.mapGoogleDataSourceParams(create),
|
|
810
824
|
...create.type === DataSourceType.FILE && _DatasourceMapper.mapFileDataSourceParams(create),
|
|
811
|
-
...create.type === DataSourceType.CODE && _DatasourceMapper.mapCodeDataSourceParams(create)
|
|
825
|
+
...create.type === DataSourceType.CODE && _DatasourceMapper.mapCodeDataSourceParams(create),
|
|
826
|
+
...create.type === DataSourceType.AZURE_DEVOPS_WIKI && _DatasourceMapper.mapAzureDevOpsWikiParams(
|
|
827
|
+
create
|
|
828
|
+
),
|
|
829
|
+
...create.type === DataSourceType.AZURE_DEVOPS_WORK_ITEM && _DatasourceMapper.mapAzureDevOpsWorkItemParams(
|
|
830
|
+
create
|
|
831
|
+
),
|
|
832
|
+
...create.type === DataSourceType.XRAY && _DatasourceMapper.mapXrayDataSourceParams(create),
|
|
833
|
+
...create.type === DataSourceType.SHAREPOINT && _DatasourceMapper.mapSharePointParams(create)
|
|
812
834
|
});
|
|
813
835
|
}
|
|
814
836
|
/** Converts datasource update parameters to DTO format with conditional inclusion of type-specific properties */
|
|
@@ -819,7 +841,15 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
819
841
|
...update.type === DataSourceType.JIRA && _DatasourceMapper.mapJiraDataSourceParams(update),
|
|
820
842
|
...update.type === DataSourceType.GOOGLE && _DatasourceMapper.mapGoogleDataSourceParams(update),
|
|
821
843
|
...update.type === DataSourceType.FILE && _DatasourceMapper.mapFileDataSourceParams(update),
|
|
822
|
-
...update.type === DataSourceType.CODE && _DatasourceMapper.mapCodeDataSourceParams(update)
|
|
844
|
+
...update.type === DataSourceType.CODE && _DatasourceMapper.mapCodeDataSourceParams(update),
|
|
845
|
+
...update.type === DataSourceType.AZURE_DEVOPS_WIKI && _DatasourceMapper.mapAzureDevOpsWikiParams(
|
|
846
|
+
update
|
|
847
|
+
),
|
|
848
|
+
...update.type === DataSourceType.AZURE_DEVOPS_WORK_ITEM && _DatasourceMapper.mapAzureDevOpsWorkItemParams(
|
|
849
|
+
update
|
|
850
|
+
),
|
|
851
|
+
...update.type === DataSourceType.XRAY && _DatasourceMapper.mapXrayDataSourceParams(update),
|
|
852
|
+
...update.type === DataSourceType.SHAREPOINT && _DatasourceMapper.mapSharePointParams(update)
|
|
823
853
|
});
|
|
824
854
|
}
|
|
825
855
|
/** Maps Confluence-specific configuration parameters for content filtering and pagination options */
|
|
@@ -842,6 +872,29 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
842
872
|
jql: params.jql
|
|
843
873
|
};
|
|
844
874
|
}
|
|
875
|
+
/** Maps Xray-specific parameters, transforming JQL filter configuration */
|
|
876
|
+
static mapXrayDataSourceParams(params) {
|
|
877
|
+
return {
|
|
878
|
+
jql: params.jql
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
/** Maps SharePoint-specific configuration parameters */
|
|
882
|
+
static mapSharePointParams(params) {
|
|
883
|
+
return {
|
|
884
|
+
site_url: params.site_url,
|
|
885
|
+
include_pages: params.include_pages,
|
|
886
|
+
include_documents: params.include_documents,
|
|
887
|
+
include_lists: params.include_lists,
|
|
888
|
+
max_file_size_mb: params.max_file_size_mb,
|
|
889
|
+
files_filter: params.files_filter,
|
|
890
|
+
auth_type: params.auth_type,
|
|
891
|
+
access_token: params.access_token,
|
|
892
|
+
oauth_client_id: params.oauth_client_id,
|
|
893
|
+
oauth_tenant_id: params.oauth_tenant_id,
|
|
894
|
+
embedding_model: params.embedding_model,
|
|
895
|
+
cron_expression: params.cron_expression
|
|
896
|
+
};
|
|
897
|
+
}
|
|
845
898
|
/** Maps Google Doc specific parameters with proper API naming conventions */
|
|
846
899
|
static mapGoogleDataSourceParams(params) {
|
|
847
900
|
return {
|
|
@@ -869,6 +922,23 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
869
922
|
docsGeneration: params.docs_generation || false
|
|
870
923
|
};
|
|
871
924
|
}
|
|
925
|
+
/** Maps Azure DevOps Wiki-specific configuration parameters */
|
|
926
|
+
static mapAzureDevOpsWikiParams(params) {
|
|
927
|
+
return {
|
|
928
|
+
wiki_query: params.wiki_query,
|
|
929
|
+
organization: params.organization,
|
|
930
|
+
project: params.project,
|
|
931
|
+
wiki_name: params.wiki_name
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
/** Maps Azure DevOps Work Item-specific configuration parameters */
|
|
935
|
+
static mapAzureDevOpsWorkItemParams(params) {
|
|
936
|
+
return {
|
|
937
|
+
wiql_query: params.wiql_query,
|
|
938
|
+
organization: params.organization,
|
|
939
|
+
project: params.project
|
|
940
|
+
};
|
|
941
|
+
}
|
|
872
942
|
/** Maps general datasource parameters common across all datasource types with appropriate fallback values */
|
|
873
943
|
static mapCommonDataSourceParams(params) {
|
|
874
944
|
return {
|
|
@@ -903,7 +973,12 @@ var DATA_SOURCE_TO_PATH_PARAM = {
|
|
|
903
973
|
[DataSourceType.SUMMARY]: "SUMMARY",
|
|
904
974
|
[DataSourceType.CHUNK_SUMMARY]: "CHUNK_SUMMARY",
|
|
905
975
|
[DataSourceType.JSON]: "JSON",
|
|
906
|
-
[DataSourceType.BEDROCK]: "BEDROCK"
|
|
976
|
+
[DataSourceType.BEDROCK]: "BEDROCK",
|
|
977
|
+
[DataSourceType.XRAY]: "XRAY",
|
|
978
|
+
[DataSourceType.PLATFORM]: "PLATFORM_MARKETPLACE_ASSISTANT",
|
|
979
|
+
[DataSourceType.AZURE_DEVOPS_WIKI]: "AZURE_DEVOPS_WIKI",
|
|
980
|
+
[DataSourceType.AZURE_DEVOPS_WORK_ITEM]: "AZURE_DEVOPS_WORK_ITEM",
|
|
981
|
+
[DataSourceType.SHAREPOINT]: "SHAREPOINT"
|
|
907
982
|
};
|
|
908
983
|
var DatasourceService = class {
|
|
909
984
|
constructor(config) {
|
|
@@ -993,6 +1068,29 @@ var DatasourceService = class {
|
|
|
993
1068
|
async delete(datasourceId) {
|
|
994
1069
|
return this.api.delete(`/v1/index/${datasourceId}`);
|
|
995
1070
|
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Get all assistants that use a specific datasource.
|
|
1073
|
+
*/
|
|
1074
|
+
async getAssistantsUsingDatasource(datasourceId) {
|
|
1075
|
+
return this.api.get(`/v1/index/${datasourceId}/assistants`);
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Create a provider datasource (CodeAnalysis or CodeExploration).
|
|
1079
|
+
*/
|
|
1080
|
+
async createProvider(toolkitId, providerName, params) {
|
|
1081
|
+
const { shared_with_project, ...rest } = params;
|
|
1082
|
+
return this.api.post(
|
|
1083
|
+
"/v1/index/provider",
|
|
1084
|
+
{ ...rest, project_space_visible: shared_with_project ?? false },
|
|
1085
|
+
{ params: { toolkit_id: toolkitId, provider_name: providerName } }
|
|
1086
|
+
);
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Get Elasticsearch index statistics for a datasource.
|
|
1090
|
+
*/
|
|
1091
|
+
async getElasticsearchStats(datasourceId) {
|
|
1092
|
+
return this.api.get(`/v1/index/${datasourceId}/elasticsearch`);
|
|
1093
|
+
}
|
|
996
1094
|
getCreateDatasourceUrl(type, projectName) {
|
|
997
1095
|
if (type === DataSourceType.CODE) {
|
|
998
1096
|
return `/v1/application/${projectName}/index`;
|
|
@@ -1019,6 +1117,9 @@ var DatasourceService = class {
|
|
|
1019
1117
|
if (updateParams.type === DataSourceType.GOOGLE && updateParams.incremental_reindex) {
|
|
1020
1118
|
throw new Error("Google data sources only support full_reindex");
|
|
1021
1119
|
}
|
|
1120
|
+
if (updateParams.type === DataSourceType.SHAREPOINT && (updateParams.incremental_reindex || updateParams.resume_indexing)) {
|
|
1121
|
+
throw new Error("SharePoint data sources only support full_reindex");
|
|
1122
|
+
}
|
|
1022
1123
|
}
|
|
1023
1124
|
};
|
|
1024
1125
|
|
|
@@ -1087,14 +1188,16 @@ var CredentialTypes = {
|
|
|
1087
1188
|
SONAR: "Sonar",
|
|
1088
1189
|
SQL: "SQL",
|
|
1089
1190
|
TELEGRAM: "Telegram",
|
|
1090
|
-
|
|
1191
|
+
ZEPHYR_SCALE: "ZephyrScale",
|
|
1091
1192
|
ZEPHYR_SQUAD: "ZephyrSquad",
|
|
1092
1193
|
SERVICE_NOW: "ServiceNow",
|
|
1093
1194
|
DIAL: "DIAL",
|
|
1094
1195
|
A2A: "A2A",
|
|
1095
1196
|
MCP: "MCP",
|
|
1096
1197
|
LITE_LLM: "LiteLLM",
|
|
1097
|
-
REPORT_PORTAL: "ReportPortal"
|
|
1198
|
+
REPORT_PORTAL: "ReportPortal",
|
|
1199
|
+
XRAY: "Xray",
|
|
1200
|
+
SHAREPOINT: "SharePoint"
|
|
1098
1201
|
};
|
|
1099
1202
|
var IntegrationType = {
|
|
1100
1203
|
USER: "user",
|