codemie-sdk 0.1.423 → 0.1.424

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
@@ -38,6 +38,7 @@ __export(index_exports, {
38
38
  AssistantUpdateParamsSchema: () => AssistantUpdateParamsSchema,
39
39
  AssistantVersionsListParamsSchema: () => AssistantVersionsListParamsSchema,
40
40
  BackgroundTaskStatus: () => BackgroundTaskStatus,
41
+ CategoryService: () => CategoryService,
41
42
  ChatRole: () => ChatRole,
42
43
  CodeDataSourceType: () => CodeDataSourceType,
43
44
  CodeMieClient: () => CodeMieClient,
@@ -1367,14 +1368,15 @@ var TaskService = class {
1367
1368
  var UserMapper = class {
1368
1369
  static mapAboutUserResponse(response) {
1369
1370
  return omitUndefined({
1370
- user_id: response.userId,
1371
+ user_id: response.user_id,
1371
1372
  name: response.name,
1372
1373
  username: response.username,
1373
- is_admin: response.isAdmin,
1374
+ email: response.email,
1375
+ is_admin: response.is_admin,
1374
1376
  applications: response.applications,
1375
- applications_admin: response.applicationsAdmin,
1377
+ applications_admin: response.applications_admin,
1376
1378
  picture: response.picture,
1377
- knowledge_bases: response.knowledgeBases
1379
+ knowledge_bases: response.knowledge_bases
1378
1380
  });
1379
1381
  }
1380
1382
  };
@@ -1399,6 +1401,64 @@ var UserService = class {
1399
1401
  }
1400
1402
  };
1401
1403
 
1404
+ // src/services/category.ts
1405
+ var CategoryService = class {
1406
+ constructor(config) {
1407
+ this.api = new ApiRequestHandler(config);
1408
+ }
1409
+ /**
1410
+ * Get all available assistant categories (legacy, non-paginated).
1411
+ * Public endpoint — no admin access required.
1412
+ * GET /v1/assistants/categories
1413
+ */
1414
+ async getCategories() {
1415
+ return this.api.get("/v1/assistants/categories");
1416
+ }
1417
+ /**
1418
+ * Get paginated list of categories with marketplace/project assistant counts.
1419
+ * Admin access required.
1420
+ * GET /v1/assistants/categories/list
1421
+ */
1422
+ async listCategories(page = 0, perPage = 10) {
1423
+ return this.api.get("/v1/assistants/categories/list", {
1424
+ page,
1425
+ per_page: perPage
1426
+ });
1427
+ }
1428
+ /**
1429
+ * Get a specific category by ID with assistant counts.
1430
+ * Admin access required.
1431
+ * GET /v1/assistants/categories/{id}
1432
+ */
1433
+ async getCategory(categoryId) {
1434
+ return this.api.get(`/v1/assistants/categories/${categoryId}`);
1435
+ }
1436
+ /**
1437
+ * Create a new category. The ID is auto-generated from the name.
1438
+ * Admin access required.
1439
+ * POST /v1/assistants/categories
1440
+ */
1441
+ async createCategory(params) {
1442
+ return this.api.post("/v1/assistants/categories", params);
1443
+ }
1444
+ /**
1445
+ * Update an existing category.
1446
+ * Admin access required.
1447
+ * PUT /v1/assistants/categories/{id}
1448
+ */
1449
+ async updateCategory(categoryId, params) {
1450
+ return this.api.put(`/v1/assistants/categories/${categoryId}`, params);
1451
+ }
1452
+ /**
1453
+ * Delete a category. Fails with 409 if any assistants are assigned to it.
1454
+ * Admin access required.
1455
+ * DELETE /v1/assistants/categories/{id}
1456
+ */
1457
+ async deleteCategory(categoryId) {
1458
+ return this.api.delete(`/v1/assistants/categories/${categoryId}`);
1459
+ }
1460
+ };
1461
+
1402
1462
  // src/schemas/skill.ts
1403
1463
  var import_zod5 = require("zod");
1404
1464
 
@@ -1439,6 +1499,15 @@ var SkillCategory = /* @__PURE__ */ ((SkillCategory2) => {
1439
1499
  SkillCategory2["PROJECT_MANAGEMENT"] = "project_management";
1440
1500
  SkillCategory2["PRODUCT_MANAGEMENT"] = "product_management";
1441
1501
  SkillCategory2["BUSINESS_ANALYSIS"] = "business_analysis";
1502
+ SkillCategory2["MIGRATION_MODERNIZATION"] = "migration_modernization";
1503
+ SkillCategory2["SUPPORT"] = "support";
1504
+ SkillCategory2["CUSTOMER_EXPERIENCE"] = "customer_experience";
1505
+ SkillCategory2["KNOWLEDGE_MANAGEMENT"] = "knowledge_management";
1506
+ SkillCategory2["TRAINING"] = "training";
1507
+ SkillCategory2["PRESALES"] = "presales";
1508
+ SkillCategory2["INTERVIEW"] = "interview";
1509
+ SkillCategory2["TALENT_ACQUISITION"] = "talent_acquisition";
1510
+ SkillCategory2["OTHER"] = "other";
1442
1511
  return SkillCategory2;
1443
1512
  })(SkillCategory || {});
1444
1513
 
@@ -1448,7 +1517,8 @@ var SkillListParamsSchema = import_zod5.z.object({
1448
1517
  per_page: import_zod5.z.number().default(20),
1449
1518
  filters: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.unknown()).optional(),
1450
1519
  sort_by: import_zod5.z.nativeEnum(SkillSortBy).optional(),
1451
- scope: import_zod5.z.nativeEnum(SkillScopeFilter).optional()
1520
+ scope: import_zod5.z.nativeEnum(SkillScopeFilter).optional(),
1521
+ assistant_id: import_zod5.z.string().optional()
1452
1522
  }).readonly();
1453
1523
 
1454
1524
  // src/services/skill.ts
@@ -1460,10 +1530,12 @@ var SkillService = class {
1460
1530
  * Get paginated list of skills accessible to the current user.
1461
1531
  */
1462
1532
  async listPaginated(_params = {}) {
1463
- const params = SkillListParamsSchema.parse(_params);
1533
+ const { scope, assistant_id, filters: rawFilters, ...rest } = SkillListParamsSchema.parse(_params);
1534
+ const mergedFilters = scope || rawFilters ? { ...rawFilters, ...scope && { scope } } : void 0;
1464
1535
  return this.api.get("/v1/skills", {
1465
- ...params,
1466
- ...params.filters && { filters: JSON.stringify(params.filters) }
1536
+ ...rest,
1537
+ ...assistant_id && { assistant_id },
1538
+ ...mergedFilters && { filters: JSON.stringify(mergedFilters) }
1467
1539
  });
1468
1540
  }
1469
1541
  /**
@@ -1479,6 +1551,105 @@ var SkillService = class {
1479
1551
  async get(skillId) {
1480
1552
  return this.api.get(`/v1/skills/${skillId}`);
1481
1553
  }
1554
+ /**
1555
+ * Create a new skill.
1556
+ */
1557
+ async create(params) {
1558
+ return this.api.post("/v1/skills", params);
1559
+ }
1560
+ /**
1561
+ * Update an existing skill.
1562
+ */
1563
+ async update(skillId, params) {
1564
+ return this.api.put(`/v1/skills/${skillId}`, params);
1565
+ }
1566
+ /**
1567
+ * Delete a skill by ID.
1568
+ */
1569
+ async delete(skillId) {
1570
+ return this.api.delete(`/v1/skills/${skillId}`);
1571
+ }
1572
+ /**
1573
+ * Import a skill from .md file content.
1574
+ */
1575
+ async importSkill(params) {
1576
+ return this.api.post("/v1/skills/import", params);
1577
+ }
1578
+ /**
1579
+ * Export a skill as markdown content.
1580
+ */
1581
+ async export(skillId) {
1582
+ return this.api.get(`/v1/skills/${skillId}/export`, void 0, { responseType: "text" });
1583
+ }
1584
+ /**
1585
+ * Attach a skill to an assistant.
1586
+ */
1587
+ async attachToAssistant(assistantId, skillId) {
1588
+ return this.api.post(`/v1/assistants/${assistantId}/skills`, { skill_id: skillId });
1589
+ }
1590
+ /**
1591
+ * Detach a skill from an assistant.
1592
+ */
1593
+ async detachFromAssistant(assistantId, skillId) {
1594
+ return this.api.delete(`/v1/assistants/${assistantId}/skills/${skillId}`);
1595
+ }
1596
+ /**
1597
+ * Get all skills attached to an assistant.
1598
+ */
1599
+ async getAssistantSkills(assistantId) {
1600
+ return this.api.get(`/v1/assistants/${assistantId}/skills`);
1601
+ }
1602
+ /**
1603
+ * Bulk attach a skill to multiple assistants.
1604
+ */
1605
+ async bulkAttachToAssistants(skillId, assistantIds) {
1606
+ return this.api.post(`/v1/skills/${skillId}/assistants/bulk-attach`, {
1607
+ assistant_ids: assistantIds
1608
+ });
1609
+ }
1610
+ /**
1611
+ * Get all assistants using this skill.
1612
+ */
1613
+ async getSkillAssistants(skillId) {
1614
+ return this.api.get(`/v1/skills/${skillId}/assistants`);
1615
+ }
1616
+ /**
1617
+ * Publish a skill to the marketplace.
1618
+ */
1619
+ async publish(skillId, categories) {
1620
+ const body = categories?.length ? { categories } : void 0;
1621
+ return this.api.post(`/v1/skills/${skillId}/marketplace/publish`, body);
1622
+ }
1623
+ /**
1624
+ * Unpublish a skill from the marketplace.
1625
+ */
1626
+ async unpublish(skillId) {
1627
+ return this.api.post(`/v1/skills/${skillId}/marketplace/unpublish`);
1628
+ }
1629
+ /**
1630
+ * Get list of available skill categories.
1631
+ */
1632
+ async listCategories() {
1633
+ return this.api.get("/v1/skills/categories");
1634
+ }
1635
+ /**
1636
+ * Get users with access to skills.
1637
+ */
1638
+ async getUsers() {
1639
+ return this.api.get("/v1/skills/users");
1640
+ }
1641
+ /**
1642
+ * React to a skill.
1643
+ */
1644
+ async react(skillId, reaction) {
1645
+ return this.api.post(`/v1/skills/${skillId}/reactions`, { reaction });
1646
+ }
1647
+ /**
1648
+ * Remove all reactions from a skill.
1649
+ */
1650
+ async removeReactions(skillId) {
1651
+ return this.api.delete(`/v1/skills/${skillId}/reactions`);
1652
+ }
1482
1653
  };
1483
1654
 
1484
1655
  // src/mappers/workflow.mapper.ts
@@ -1819,6 +1990,7 @@ var CodeMieClient = class {
1819
1990
  this._llms = new LLMService(authConfig);
1820
1991
  this._tasks = new TaskService(authConfig);
1821
1992
  this._users = new UserService(authConfig);
1993
+ this._categories = new CategoryService(authConfig);
1822
1994
  this._skills = new SkillService(authConfig);
1823
1995
  this._workflows = new WorkflowService(authConfig);
1824
1996
  }
@@ -1870,6 +2042,12 @@ var CodeMieClient = class {
1870
2042
  get files() {
1871
2043
  return this._files;
1872
2044
  }
2045
+ /**
2046
+ * Get the CategoryService instance.
2047
+ */
2048
+ get categories() {
2049
+ return this._categories;
2050
+ }
1873
2051
  /**
1874
2052
  * Get the SkillService instance.
1875
2053
  */
@@ -1953,6 +2131,7 @@ var CodeMieClient = class {
1953
2131
  this._llms = new LLMService(authConfig);
1954
2132
  this._tasks = new TaskService(authConfig);
1955
2133
  this._users = new UserService(authConfig);
2134
+ this._categories = new CategoryService(authConfig);
1956
2135
  this._skills = new SkillService(authConfig);
1957
2136
  this._workflows = new WorkflowService(authConfig);
1958
2137
  }
@@ -2130,6 +2309,7 @@ var BackgroundTaskStatus = {
2130
2309
  AssistantUpdateParamsSchema,
2131
2310
  AssistantVersionsListParamsSchema,
2132
2311
  BackgroundTaskStatus,
2312
+ CategoryService,
2133
2313
  ChatRole,
2134
2314
  CodeDataSourceType,
2135
2315
  CodeMieClient,