codemie-sdk 0.1.417 → 0.1.419

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.d.cts CHANGED
@@ -1035,8 +1035,14 @@ interface BaseDataSourceResponse {
1035
1035
  index_type: DataSourceTypeType;
1036
1036
  /** Embeddings model used */
1037
1037
  embeddings_model?: string;
1038
- /** Current status */
1039
- status: DataSourceStatusType;
1038
+ /** Whether datasource has an error */
1039
+ error?: boolean;
1040
+ /** Whether datasource indexing is complete */
1041
+ completed?: boolean;
1042
+ /** Whether datasource is currently fetching */
1043
+ is_fetching?: boolean;
1044
+ /** Whether datasource is queued */
1045
+ is_queued?: boolean;
1040
1046
  /** Setting ID reference */
1041
1047
  setting_id?: string;
1042
1048
  /** Creation date */
@@ -1137,6 +1143,7 @@ type DataSourceListParams = {
1137
1143
  projects?: string[];
1138
1144
  owner?: string;
1139
1145
  status?: DataSourceStatusType;
1146
+ search?: string;
1140
1147
  };
1141
1148
  interface BaseConfluenceParams {
1142
1149
  /** Confluence Query Language string */
@@ -1861,6 +1868,7 @@ declare const WorkflowListParamsSchema: z.ZodReadonly<z.ZodObject<{
1861
1868
  page: z.ZodPrefault<z.ZodNumber>;
1862
1869
  per_page: z.ZodPrefault<z.ZodNumber>;
1863
1870
  projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
1871
+ search: z.ZodOptional<z.ZodString>;
1864
1872
  }, z.core.$strip>>;
1865
1873
  type WorkflowListParams = Partial<z.infer<typeof WorkflowListParamsSchema>>;
1866
1874
  /**
package/dist/index.d.ts CHANGED
@@ -1035,8 +1035,14 @@ interface BaseDataSourceResponse {
1035
1035
  index_type: DataSourceTypeType;
1036
1036
  /** Embeddings model used */
1037
1037
  embeddings_model?: string;
1038
- /** Current status */
1039
- status: DataSourceStatusType;
1038
+ /** Whether datasource has an error */
1039
+ error?: boolean;
1040
+ /** Whether datasource indexing is complete */
1041
+ completed?: boolean;
1042
+ /** Whether datasource is currently fetching */
1043
+ is_fetching?: boolean;
1044
+ /** Whether datasource is queued */
1045
+ is_queued?: boolean;
1040
1046
  /** Setting ID reference */
1041
1047
  setting_id?: string;
1042
1048
  /** Creation date */
@@ -1137,6 +1143,7 @@ type DataSourceListParams = {
1137
1143
  projects?: string[];
1138
1144
  owner?: string;
1139
1145
  status?: DataSourceStatusType;
1146
+ search?: string;
1140
1147
  };
1141
1148
  interface BaseConfluenceParams {
1142
1149
  /** Confluence Query Language string */
@@ -1861,6 +1868,7 @@ declare const WorkflowListParamsSchema: z.ZodReadonly<z.ZodObject<{
1861
1868
  page: z.ZodPrefault<z.ZodNumber>;
1862
1869
  per_page: z.ZodPrefault<z.ZodNumber>;
1863
1870
  projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
1871
+ search: z.ZodOptional<z.ZodString>;
1864
1872
  }, z.core.$strip>>;
1865
1873
  type WorkflowListParams = Partial<z.infer<typeof WorkflowListParamsSchema>>;
1866
1874
  /**
package/dist/index.js CHANGED
@@ -649,6 +649,16 @@ var DatasourceMapper = class _DatasourceMapper {
649
649
  });
650
650
  }
651
651
  static mapDataSourceResponseCommonFields(response) {
652
+ let status;
653
+ if (response.error) {
654
+ status = DataSourceStatus.FAILED;
655
+ } else if (response.completed) {
656
+ status = DataSourceStatus.COMPLETED;
657
+ } else if (response.is_fetching) {
658
+ status = DataSourceStatus.FETCHING;
659
+ } else {
660
+ status = DataSourceStatus.IN_PROGRESS;
661
+ }
652
662
  return {
653
663
  id: response.id,
654
664
  created_by: response.created_by,
@@ -662,7 +672,7 @@ var DatasourceMapper = class _DatasourceMapper {
662
672
  project_name: response.project_name,
663
673
  setting_id: response.setting_id,
664
674
  shared_with_project: response.project_space_visible,
665
- status: response.status,
675
+ status,
666
676
  tokens_usage: response.tokens_usage,
667
677
  type: response.index_type,
668
678
  update_date: response.update_date,
@@ -860,12 +870,13 @@ var DatasourceService = class {
860
870
  sort_key: params.sort_key || "update_date",
861
871
  sort_order: params.sort_order || "desc"
862
872
  };
863
- if (params.datasource_types || params.projects || params.status || params.owner) {
873
+ if (params.datasource_types || params.projects || params.status || params.owner || params.search) {
864
874
  const filters = {};
865
875
  if (params.datasource_types) filters.index_type = params.datasource_types;
866
876
  if (params.projects) filters.project = params.projects;
867
877
  if (params.status) filters.status = params.status;
868
878
  if (params.owner) filters.created_by = params.owner;
879
+ if (params.search) filters.name = params.search;
869
880
  queryParams.filters = JSON.stringify(filters);
870
881
  }
871
882
  const response = await this.api.get(
@@ -1325,7 +1336,8 @@ var ExecutionStatus = {
1325
1336
  var WorkflowListParamsSchema = z6.object({
1326
1337
  page: z6.number().prefault(0),
1327
1338
  per_page: z6.number().prefault(10),
1328
- projects: z6.array(z6.string()).optional()
1339
+ projects: z6.array(z6.string()).optional(),
1340
+ search: z6.string().optional()
1329
1341
  }).readonly();
1330
1342
  var WorkflowCreateParamsSchema = z6.object({
1331
1343
  project: z6.string(),
@@ -1506,15 +1518,18 @@ var WorkflowService = class {
1506
1518
  async list(_params = {}) {
1507
1519
  const params = WorkflowListParamsSchema.parse(_params);
1508
1520
  const queryParams = {
1509
- filters: JSON.stringify({
1510
- page: params.page,
1511
- per_page: params.per_page,
1512
- ...params.projects?.length ? { projects: params.projects } : {}
1513
- })
1521
+ page: params.page,
1522
+ per_page: params.per_page
1514
1523
  };
1515
- const workflows = await this.api.get("/v1/workflows", {
1516
- params: queryParams
1517
- });
1524
+ const filters = {};
1525
+ if (params.projects?.length) filters.project = params.projects;
1526
+ if (params.search) filters.name = params.search;
1527
+ if (Object.keys(filters).length)
1528
+ queryParams.filters = JSON.stringify(filters);
1529
+ const workflows = await this.api.get(
1530
+ "/v1/workflows",
1531
+ queryParams
1532
+ );
1518
1533
  return workflows.data.map(WorkflowMapper.mapWorkflowResponse);
1519
1534
  }
1520
1535
  /**