codemie-sdk 0.1.369 → 0.1.375

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 CHANGED
@@ -34,6 +34,7 @@ __export(index_exports, {
34
34
  AssistantChatParamsSchema: () => AssistantChatParamsSchema,
35
35
  AssistantCreateParamsSchema: () => AssistantCreateParamsSchema,
36
36
  AssistantListParamsSchema: () => AssistantListParamsSchema,
37
+ AssistantService: () => AssistantService,
37
38
  AssistantUpdateParamsSchema: () => AssistantUpdateParamsSchema,
38
39
  AssistantVersionsListParamsSchema: () => AssistantVersionsListParamsSchema,
39
40
  BackgroundTaskStatus: () => BackgroundTaskStatus,
@@ -43,29 +44,39 @@ __export(index_exports, {
43
44
  CodeMieError: () => CodeMieError,
44
45
  ContextType: () => ContextType,
45
46
  ConversationCreateParamsSchema: () => ConversationCreateParamsSchema,
47
+ ConversationService: () => ConversationService,
46
48
  CredentialTypes: () => CredentialTypes,
47
49
  DataSourceStatus: () => DataSourceStatus,
48
50
  DataSourceType: () => DataSourceType,
51
+ DatasourceService: () => DatasourceService,
49
52
  ERROR_MESSAGE_PATTERNS: () => ERROR_MESSAGE_PATTERNS,
50
53
  ErrorCategory: () => ErrorCategory,
51
54
  ErrorCode: () => ErrorCode,
52
55
  ErrorDetailLevel: () => ErrorDetailLevel,
53
56
  ExecutionStatus: () => ExecutionStatus,
57
+ FileService: () => FileService,
54
58
  HTTP_STATUS_TO_ERROR_CODE: () => HTTP_STATUS_TO_ERROR_CODE,
55
59
  IntegrationCreateParamsSchema: () => IntegrationCreateParamsSchema,
56
60
  IntegrationGetByAliasParamsSchema: () => IntegrationGetByAliasParamsSchema,
57
61
  IntegrationGetParamsSchema: () => IntegrationGetParamsSchema,
58
62
  IntegrationListParamsSchema: () => IntegrationListParamsSchema,
63
+ IntegrationService: () => IntegrationService,
59
64
  IntegrationType: () => IntegrationType,
60
65
  IntegrationUpdateParamsSchema: () => IntegrationUpdateParamsSchema,
61
66
  LLMProvider: () => LLMProvider,
67
+ LLMService: () => LLMService,
62
68
  NotFoundError: () => NotFoundError,
69
+ TaskService: () => TaskService,
70
+ UserService: () => UserService,
63
71
  WorkflowCreateParamsSchema: () => WorkflowCreateParamsSchema,
64
72
  WorkflowExecutionCreateParamsSchema: () => WorkflowExecutionCreateParamsSchema,
65
73
  WorkflowExecutionListParamsSchema: () => WorkflowExecutionListParamsSchema,
74
+ WorkflowExecutionService: () => WorkflowExecutionService,
66
75
  WorkflowExecutionStateListParamsSchema: () => WorkflowExecutionStateListParamsSchema,
76
+ WorkflowExecutionStateService: () => WorkflowExecutionStateService,
67
77
  WorkflowListParamsSchema: () => WorkflowListParamsSchema,
68
78
  WorkflowMode: () => WorkflowMode,
79
+ WorkflowService: () => WorkflowService,
69
80
  WorkflowUpdateParamsSchema: () => WorkflowUpdateParamsSchema,
70
81
  classifyHttpError: () => classifyHttpError,
71
82
  formatCookies: () => formatCookies,
@@ -966,6 +977,50 @@ var DatasourceService = class {
966
977
  }
967
978
  };
968
979
 
980
+ // src/services/files.ts
981
+ var import_form_data2 = __toESM(require("form-data"), 1);
982
+ var FileService = class {
983
+ constructor(config) {
984
+ this.api = new ApiRequestHandler(config);
985
+ }
986
+ /**
987
+ * Upload a single file
988
+ * POST /v1/files/
989
+ */
990
+ async upload(file) {
991
+ const formData = new import_form_data2.default();
992
+ formData.append("file", file.content, {
993
+ filename: file.name,
994
+ contentType: file.mimeType
995
+ });
996
+ return this.api.postMultipart("/v1/files/", formData);
997
+ }
998
+ /**
999
+ * Upload multiple files
1000
+ * POST /v1/files/bulk
1001
+ */
1002
+ async bulkUpload(files) {
1003
+ const formData = new import_form_data2.default();
1004
+ for (const file of files) {
1005
+ formData.append("files", file.content, {
1006
+ filename: file.name,
1007
+ contentType: file.mimeType
1008
+ });
1009
+ }
1010
+ return this.api.postMultipart("/v1/files/bulk", formData);
1011
+ }
1012
+ /**
1013
+ * Get file by URL/ID
1014
+ * GET /v1/files/{file_name}
1015
+ */
1016
+ async getFile(fileUrl) {
1017
+ const response = await this.api.get(`/v1/files/${fileUrl}`, void 0, {
1018
+ responseType: "arraybuffer"
1019
+ });
1020
+ return Buffer.from(response);
1021
+ }
1022
+ };
1023
+
969
1024
  // src/models/integration.ts
970
1025
  var CredentialTypes = {
971
1026
  JIRA: "Jira",
@@ -1520,11 +1575,12 @@ var CodeMieClient = class {
1520
1575
  };
1521
1576
  this._assistants = new AssistantService(authConfig);
1522
1577
  this._conversations = new ConversationService(authConfig);
1523
- this._llms = new LLMService(authConfig);
1578
+ this._datasources = new DatasourceService(authConfig);
1579
+ this._files = new FileService(authConfig);
1524
1580
  this._integrations = new IntegrationService(authConfig);
1581
+ this._llms = new LLMService(authConfig);
1525
1582
  this._tasks = new TaskService(authConfig);
1526
1583
  this._users = new UserService(authConfig);
1527
- this._datasources = new DatasourceService(authConfig);
1528
1584
  this._workflows = new WorkflowService(authConfig);
1529
1585
  }
1530
1586
  /**
@@ -1569,6 +1625,12 @@ var CodeMieClient = class {
1569
1625
  get datasources() {
1570
1626
  return this._datasources;
1571
1627
  }
1628
+ /**
1629
+ * Get the FileService instance.
1630
+ */
1631
+ get files() {
1632
+ return this._files;
1633
+ }
1572
1634
  /**
1573
1635
  * Get the WorkflowService instance.
1574
1636
  */
@@ -1640,11 +1702,12 @@ var CodeMieClient = class {
1640
1702
  };
1641
1703
  this._assistants = new AssistantService(authConfig);
1642
1704
  this._conversations = new ConversationService(authConfig);
1643
- this._llms = new LLMService(authConfig);
1705
+ this._datasources = new DatasourceService(authConfig);
1706
+ this._files = new FileService(authConfig);
1644
1707
  this._integrations = new IntegrationService(authConfig);
1708
+ this._llms = new LLMService(authConfig);
1645
1709
  this._tasks = new TaskService(authConfig);
1646
1710
  this._users = new UserService(authConfig);
1647
- this._datasources = new DatasourceService(authConfig);
1648
1711
  this._workflows = new WorkflowService(authConfig);
1649
1712
  }
1650
1713
  };
@@ -1817,6 +1880,7 @@ var BackgroundTaskStatus = {
1817
1880
  AssistantChatParamsSchema,
1818
1881
  AssistantCreateParamsSchema,
1819
1882
  AssistantListParamsSchema,
1883
+ AssistantService,
1820
1884
  AssistantUpdateParamsSchema,
1821
1885
  AssistantVersionsListParamsSchema,
1822
1886
  BackgroundTaskStatus,
@@ -1826,29 +1890,39 @@ var BackgroundTaskStatus = {
1826
1890
  CodeMieError,
1827
1891
  ContextType,
1828
1892
  ConversationCreateParamsSchema,
1893
+ ConversationService,
1829
1894
  CredentialTypes,
1830
1895
  DataSourceStatus,
1831
1896
  DataSourceType,
1897
+ DatasourceService,
1832
1898
  ERROR_MESSAGE_PATTERNS,
1833
1899
  ErrorCategory,
1834
1900
  ErrorCode,
1835
1901
  ErrorDetailLevel,
1836
1902
  ExecutionStatus,
1903
+ FileService,
1837
1904
  HTTP_STATUS_TO_ERROR_CODE,
1838
1905
  IntegrationCreateParamsSchema,
1839
1906
  IntegrationGetByAliasParamsSchema,
1840
1907
  IntegrationGetParamsSchema,
1841
1908
  IntegrationListParamsSchema,
1909
+ IntegrationService,
1842
1910
  IntegrationType,
1843
1911
  IntegrationUpdateParamsSchema,
1844
1912
  LLMProvider,
1913
+ LLMService,
1845
1914
  NotFoundError,
1915
+ TaskService,
1916
+ UserService,
1846
1917
  WorkflowCreateParamsSchema,
1847
1918
  WorkflowExecutionCreateParamsSchema,
1848
1919
  WorkflowExecutionListParamsSchema,
1920
+ WorkflowExecutionService,
1849
1921
  WorkflowExecutionStateListParamsSchema,
1922
+ WorkflowExecutionStateService,
1850
1923
  WorkflowListParamsSchema,
1851
1924
  WorkflowMode,
1925
+ WorkflowService,
1852
1926
  WorkflowUpdateParamsSchema,
1853
1927
  classifyHttpError,
1854
1928
  formatCookies,