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.js
CHANGED
|
@@ -617,7 +617,12 @@ var DataSourceType = {
|
|
|
617
617
|
SUMMARY: "summary",
|
|
618
618
|
CHUNK_SUMMARY: "chunk-summary",
|
|
619
619
|
JSON: "knowledge_base_json",
|
|
620
|
-
BEDROCK: "knowledge_base_bedrock"
|
|
620
|
+
BEDROCK: "knowledge_base_bedrock",
|
|
621
|
+
XRAY: "knowledge_base_xray",
|
|
622
|
+
PLATFORM: "platform_marketplace_assistant",
|
|
623
|
+
AZURE_DEVOPS_WIKI: "knowledge_base_azure_devops_wiki",
|
|
624
|
+
AZURE_DEVOPS_WORK_ITEM: "knowledge_base_azure_devops_work_item",
|
|
625
|
+
SHAREPOINT: "knowledge_base_sharepoint"
|
|
621
626
|
};
|
|
622
627
|
var DataSourceStatus = {
|
|
623
628
|
COMPLETED: "completed",
|
|
@@ -645,6 +650,15 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
645
650
|
code: _DatasourceMapper.extractCodeDataSourceResponseFields(
|
|
646
651
|
response
|
|
647
652
|
)
|
|
653
|
+
},
|
|
654
|
+
...response.index_type === DataSourceType.AZURE_DEVOPS_WIKI && {
|
|
655
|
+
azure_devops_wiki: response.azure_devops_wiki
|
|
656
|
+
},
|
|
657
|
+
...response.index_type === DataSourceType.AZURE_DEVOPS_WORK_ITEM && {
|
|
658
|
+
azure_devops_work_item: response.azure_devops_work_item
|
|
659
|
+
},
|
|
660
|
+
...response.index_type === DataSourceType.SHAREPOINT && {
|
|
661
|
+
sharepoint: response.sharepoint
|
|
648
662
|
}
|
|
649
663
|
});
|
|
650
664
|
}
|
|
@@ -713,7 +727,15 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
713
727
|
...create.type === DataSourceType.JIRA && _DatasourceMapper.mapJiraDataSourceParams(create),
|
|
714
728
|
...create.type === DataSourceType.GOOGLE && _DatasourceMapper.mapGoogleDataSourceParams(create),
|
|
715
729
|
...create.type === DataSourceType.FILE && _DatasourceMapper.mapFileDataSourceParams(create),
|
|
716
|
-
...create.type === DataSourceType.CODE && _DatasourceMapper.mapCodeDataSourceParams(create)
|
|
730
|
+
...create.type === DataSourceType.CODE && _DatasourceMapper.mapCodeDataSourceParams(create),
|
|
731
|
+
...create.type === DataSourceType.AZURE_DEVOPS_WIKI && _DatasourceMapper.mapAzureDevOpsWikiParams(
|
|
732
|
+
create
|
|
733
|
+
),
|
|
734
|
+
...create.type === DataSourceType.AZURE_DEVOPS_WORK_ITEM && _DatasourceMapper.mapAzureDevOpsWorkItemParams(
|
|
735
|
+
create
|
|
736
|
+
),
|
|
737
|
+
...create.type === DataSourceType.XRAY && _DatasourceMapper.mapXrayDataSourceParams(create),
|
|
738
|
+
...create.type === DataSourceType.SHAREPOINT && _DatasourceMapper.mapSharePointParams(create)
|
|
717
739
|
});
|
|
718
740
|
}
|
|
719
741
|
/** Converts datasource update parameters to DTO format with conditional inclusion of type-specific properties */
|
|
@@ -724,7 +746,15 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
724
746
|
...update.type === DataSourceType.JIRA && _DatasourceMapper.mapJiraDataSourceParams(update),
|
|
725
747
|
...update.type === DataSourceType.GOOGLE && _DatasourceMapper.mapGoogleDataSourceParams(update),
|
|
726
748
|
...update.type === DataSourceType.FILE && _DatasourceMapper.mapFileDataSourceParams(update),
|
|
727
|
-
...update.type === DataSourceType.CODE && _DatasourceMapper.mapCodeDataSourceParams(update)
|
|
749
|
+
...update.type === DataSourceType.CODE && _DatasourceMapper.mapCodeDataSourceParams(update),
|
|
750
|
+
...update.type === DataSourceType.AZURE_DEVOPS_WIKI && _DatasourceMapper.mapAzureDevOpsWikiParams(
|
|
751
|
+
update
|
|
752
|
+
),
|
|
753
|
+
...update.type === DataSourceType.AZURE_DEVOPS_WORK_ITEM && _DatasourceMapper.mapAzureDevOpsWorkItemParams(
|
|
754
|
+
update
|
|
755
|
+
),
|
|
756
|
+
...update.type === DataSourceType.XRAY && _DatasourceMapper.mapXrayDataSourceParams(update),
|
|
757
|
+
...update.type === DataSourceType.SHAREPOINT && _DatasourceMapper.mapSharePointParams(update)
|
|
728
758
|
});
|
|
729
759
|
}
|
|
730
760
|
/** Maps Confluence-specific configuration parameters for content filtering and pagination options */
|
|
@@ -747,6 +777,29 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
747
777
|
jql: params.jql
|
|
748
778
|
};
|
|
749
779
|
}
|
|
780
|
+
/** Maps Xray-specific parameters, transforming JQL filter configuration */
|
|
781
|
+
static mapXrayDataSourceParams(params) {
|
|
782
|
+
return {
|
|
783
|
+
jql: params.jql
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
/** Maps SharePoint-specific configuration parameters */
|
|
787
|
+
static mapSharePointParams(params) {
|
|
788
|
+
return {
|
|
789
|
+
site_url: params.site_url,
|
|
790
|
+
include_pages: params.include_pages,
|
|
791
|
+
include_documents: params.include_documents,
|
|
792
|
+
include_lists: params.include_lists,
|
|
793
|
+
max_file_size_mb: params.max_file_size_mb,
|
|
794
|
+
files_filter: params.files_filter,
|
|
795
|
+
auth_type: params.auth_type,
|
|
796
|
+
access_token: params.access_token,
|
|
797
|
+
oauth_client_id: params.oauth_client_id,
|
|
798
|
+
oauth_tenant_id: params.oauth_tenant_id,
|
|
799
|
+
embedding_model: params.embedding_model,
|
|
800
|
+
cron_expression: params.cron_expression
|
|
801
|
+
};
|
|
802
|
+
}
|
|
750
803
|
/** Maps Google Doc specific parameters with proper API naming conventions */
|
|
751
804
|
static mapGoogleDataSourceParams(params) {
|
|
752
805
|
return {
|
|
@@ -774,6 +827,23 @@ var DatasourceMapper = class _DatasourceMapper {
|
|
|
774
827
|
docsGeneration: params.docs_generation || false
|
|
775
828
|
};
|
|
776
829
|
}
|
|
830
|
+
/** Maps Azure DevOps Wiki-specific configuration parameters */
|
|
831
|
+
static mapAzureDevOpsWikiParams(params) {
|
|
832
|
+
return {
|
|
833
|
+
wiki_query: params.wiki_query,
|
|
834
|
+
organization: params.organization,
|
|
835
|
+
project: params.project,
|
|
836
|
+
wiki_name: params.wiki_name
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
/** Maps Azure DevOps Work Item-specific configuration parameters */
|
|
840
|
+
static mapAzureDevOpsWorkItemParams(params) {
|
|
841
|
+
return {
|
|
842
|
+
wiql_query: params.wiql_query,
|
|
843
|
+
organization: params.organization,
|
|
844
|
+
project: params.project
|
|
845
|
+
};
|
|
846
|
+
}
|
|
777
847
|
/** Maps general datasource parameters common across all datasource types with appropriate fallback values */
|
|
778
848
|
static mapCommonDataSourceParams(params) {
|
|
779
849
|
return {
|
|
@@ -808,7 +878,12 @@ var DATA_SOURCE_TO_PATH_PARAM = {
|
|
|
808
878
|
[DataSourceType.SUMMARY]: "SUMMARY",
|
|
809
879
|
[DataSourceType.CHUNK_SUMMARY]: "CHUNK_SUMMARY",
|
|
810
880
|
[DataSourceType.JSON]: "JSON",
|
|
811
|
-
[DataSourceType.BEDROCK]: "BEDROCK"
|
|
881
|
+
[DataSourceType.BEDROCK]: "BEDROCK",
|
|
882
|
+
[DataSourceType.XRAY]: "XRAY",
|
|
883
|
+
[DataSourceType.PLATFORM]: "PLATFORM_MARKETPLACE_ASSISTANT",
|
|
884
|
+
[DataSourceType.AZURE_DEVOPS_WIKI]: "AZURE_DEVOPS_WIKI",
|
|
885
|
+
[DataSourceType.AZURE_DEVOPS_WORK_ITEM]: "AZURE_DEVOPS_WORK_ITEM",
|
|
886
|
+
[DataSourceType.SHAREPOINT]: "SHAREPOINT"
|
|
812
887
|
};
|
|
813
888
|
var DatasourceService = class {
|
|
814
889
|
constructor(config) {
|
|
@@ -898,6 +973,29 @@ var DatasourceService = class {
|
|
|
898
973
|
async delete(datasourceId) {
|
|
899
974
|
return this.api.delete(`/v1/index/${datasourceId}`);
|
|
900
975
|
}
|
|
976
|
+
/**
|
|
977
|
+
* Get all assistants that use a specific datasource.
|
|
978
|
+
*/
|
|
979
|
+
async getAssistantsUsingDatasource(datasourceId) {
|
|
980
|
+
return this.api.get(`/v1/index/${datasourceId}/assistants`);
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Create a provider datasource (CodeAnalysis or CodeExploration).
|
|
984
|
+
*/
|
|
985
|
+
async createProvider(toolkitId, providerName, params) {
|
|
986
|
+
const { shared_with_project, ...rest } = params;
|
|
987
|
+
return this.api.post(
|
|
988
|
+
"/v1/index/provider",
|
|
989
|
+
{ ...rest, project_space_visible: shared_with_project ?? false },
|
|
990
|
+
{ params: { toolkit_id: toolkitId, provider_name: providerName } }
|
|
991
|
+
);
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* Get Elasticsearch index statistics for a datasource.
|
|
995
|
+
*/
|
|
996
|
+
async getElasticsearchStats(datasourceId) {
|
|
997
|
+
return this.api.get(`/v1/index/${datasourceId}/elasticsearch`);
|
|
998
|
+
}
|
|
901
999
|
getCreateDatasourceUrl(type, projectName) {
|
|
902
1000
|
if (type === DataSourceType.CODE) {
|
|
903
1001
|
return `/v1/application/${projectName}/index`;
|
|
@@ -924,6 +1022,9 @@ var DatasourceService = class {
|
|
|
924
1022
|
if (updateParams.type === DataSourceType.GOOGLE && updateParams.incremental_reindex) {
|
|
925
1023
|
throw new Error("Google data sources only support full_reindex");
|
|
926
1024
|
}
|
|
1025
|
+
if (updateParams.type === DataSourceType.SHAREPOINT && (updateParams.incremental_reindex || updateParams.resume_indexing)) {
|
|
1026
|
+
throw new Error("SharePoint data sources only support full_reindex");
|
|
1027
|
+
}
|
|
927
1028
|
}
|
|
928
1029
|
};
|
|
929
1030
|
|
|
@@ -992,14 +1093,16 @@ var CredentialTypes = {
|
|
|
992
1093
|
SONAR: "Sonar",
|
|
993
1094
|
SQL: "SQL",
|
|
994
1095
|
TELEGRAM: "Telegram",
|
|
995
|
-
|
|
1096
|
+
ZEPHYR_SCALE: "ZephyrScale",
|
|
996
1097
|
ZEPHYR_SQUAD: "ZephyrSquad",
|
|
997
1098
|
SERVICE_NOW: "ServiceNow",
|
|
998
1099
|
DIAL: "DIAL",
|
|
999
1100
|
A2A: "A2A",
|
|
1000
1101
|
MCP: "MCP",
|
|
1001
1102
|
LITE_LLM: "LiteLLM",
|
|
1002
|
-
REPORT_PORTAL: "ReportPortal"
|
|
1103
|
+
REPORT_PORTAL: "ReportPortal",
|
|
1104
|
+
XRAY: "Xray",
|
|
1105
|
+
SHAREPOINT: "SharePoint"
|
|
1003
1106
|
};
|
|
1004
1107
|
var IntegrationType = {
|
|
1005
1108
|
USER: "user",
|