codemie-sdk 0.1.422 → 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.js CHANGED
@@ -1272,14 +1272,15 @@ var TaskService = class {
1272
1272
  var UserMapper = class {
1273
1273
  static mapAboutUserResponse(response) {
1274
1274
  return omitUndefined({
1275
- user_id: response.userId,
1275
+ user_id: response.user_id,
1276
1276
  name: response.name,
1277
1277
  username: response.username,
1278
- is_admin: response.isAdmin,
1278
+ email: response.email,
1279
+ is_admin: response.is_admin,
1279
1280
  applications: response.applications,
1280
- applications_admin: response.applicationsAdmin,
1281
+ applications_admin: response.applications_admin,
1281
1282
  picture: response.picture,
1282
- knowledge_bases: response.knowledgeBases
1283
+ knowledge_bases: response.knowledge_bases
1283
1284
  });
1284
1285
  }
1285
1286
  };
@@ -1304,6 +1305,64 @@ var UserService = class {
1304
1305
  }
1305
1306
  };
1306
1307
 
1308
+ // src/services/category.ts
1309
+ var CategoryService = class {
1310
+ constructor(config) {
1311
+ this.api = new ApiRequestHandler(config);
1312
+ }
1313
+ /**
1314
+ * Get all available assistant categories (legacy, non-paginated).
1315
+ * Public endpoint — no admin access required.
1316
+ * GET /v1/assistants/categories
1317
+ */
1318
+ async getCategories() {
1319
+ return this.api.get("/v1/assistants/categories");
1320
+ }
1321
+ /**
1322
+ * Get paginated list of categories with marketplace/project assistant counts.
1323
+ * Admin access required.
1324
+ * GET /v1/assistants/categories/list
1325
+ */
1326
+ async listCategories(page = 0, perPage = 10) {
1327
+ return this.api.get("/v1/assistants/categories/list", {
1328
+ page,
1329
+ per_page: perPage
1330
+ });
1331
+ }
1332
+ /**
1333
+ * Get a specific category by ID with assistant counts.
1334
+ * Admin access required.
1335
+ * GET /v1/assistants/categories/{id}
1336
+ */
1337
+ async getCategory(categoryId) {
1338
+ return this.api.get(`/v1/assistants/categories/${categoryId}`);
1339
+ }
1340
+ /**
1341
+ * Create a new category. The ID is auto-generated from the name.
1342
+ * Admin access required.
1343
+ * POST /v1/assistants/categories
1344
+ */
1345
+ async createCategory(params) {
1346
+ return this.api.post("/v1/assistants/categories", params);
1347
+ }
1348
+ /**
1349
+ * Update an existing category.
1350
+ * Admin access required.
1351
+ * PUT /v1/assistants/categories/{id}
1352
+ */
1353
+ async updateCategory(categoryId, params) {
1354
+ return this.api.put(`/v1/assistants/categories/${categoryId}`, params);
1355
+ }
1356
+ /**
1357
+ * Delete a category. Fails with 409 if any assistants are assigned to it.
1358
+ * Admin access required.
1359
+ * DELETE /v1/assistants/categories/{id}
1360
+ */
1361
+ async deleteCategory(categoryId) {
1362
+ return this.api.delete(`/v1/assistants/categories/${categoryId}`);
1363
+ }
1364
+ };
1365
+
1307
1366
  // src/schemas/skill.ts
1308
1367
  import { z as z5 } from "zod";
1309
1368
 
@@ -1344,6 +1403,15 @@ var SkillCategory = /* @__PURE__ */ ((SkillCategory2) => {
1344
1403
  SkillCategory2["PROJECT_MANAGEMENT"] = "project_management";
1345
1404
  SkillCategory2["PRODUCT_MANAGEMENT"] = "product_management";
1346
1405
  SkillCategory2["BUSINESS_ANALYSIS"] = "business_analysis";
1406
+ SkillCategory2["MIGRATION_MODERNIZATION"] = "migration_modernization";
1407
+ SkillCategory2["SUPPORT"] = "support";
1408
+ SkillCategory2["CUSTOMER_EXPERIENCE"] = "customer_experience";
1409
+ SkillCategory2["KNOWLEDGE_MANAGEMENT"] = "knowledge_management";
1410
+ SkillCategory2["TRAINING"] = "training";
1411
+ SkillCategory2["PRESALES"] = "presales";
1412
+ SkillCategory2["INTERVIEW"] = "interview";
1413
+ SkillCategory2["TALENT_ACQUISITION"] = "talent_acquisition";
1414
+ SkillCategory2["OTHER"] = "other";
1347
1415
  return SkillCategory2;
1348
1416
  })(SkillCategory || {});
1349
1417
 
@@ -1353,7 +1421,8 @@ var SkillListParamsSchema = z5.object({
1353
1421
  per_page: z5.number().default(20),
1354
1422
  filters: z5.record(z5.string(), z5.unknown()).optional(),
1355
1423
  sort_by: z5.nativeEnum(SkillSortBy).optional(),
1356
- scope: z5.nativeEnum(SkillScopeFilter).optional()
1424
+ scope: z5.nativeEnum(SkillScopeFilter).optional(),
1425
+ assistant_id: z5.string().optional()
1357
1426
  }).readonly();
1358
1427
 
1359
1428
  // src/services/skill.ts
@@ -1365,10 +1434,12 @@ var SkillService = class {
1365
1434
  * Get paginated list of skills accessible to the current user.
1366
1435
  */
1367
1436
  async listPaginated(_params = {}) {
1368
- const params = SkillListParamsSchema.parse(_params);
1437
+ const { scope, assistant_id, filters: rawFilters, ...rest } = SkillListParamsSchema.parse(_params);
1438
+ const mergedFilters = scope || rawFilters ? { ...rawFilters, ...scope && { scope } } : void 0;
1369
1439
  return this.api.get("/v1/skills", {
1370
- ...params,
1371
- ...params.filters && { filters: JSON.stringify(params.filters) }
1440
+ ...rest,
1441
+ ...assistant_id && { assistant_id },
1442
+ ...mergedFilters && { filters: JSON.stringify(mergedFilters) }
1372
1443
  });
1373
1444
  }
1374
1445
  /**
@@ -1384,6 +1455,105 @@ var SkillService = class {
1384
1455
  async get(skillId) {
1385
1456
  return this.api.get(`/v1/skills/${skillId}`);
1386
1457
  }
1458
+ /**
1459
+ * Create a new skill.
1460
+ */
1461
+ async create(params) {
1462
+ return this.api.post("/v1/skills", params);
1463
+ }
1464
+ /**
1465
+ * Update an existing skill.
1466
+ */
1467
+ async update(skillId, params) {
1468
+ return this.api.put(`/v1/skills/${skillId}`, params);
1469
+ }
1470
+ /**
1471
+ * Delete a skill by ID.
1472
+ */
1473
+ async delete(skillId) {
1474
+ return this.api.delete(`/v1/skills/${skillId}`);
1475
+ }
1476
+ /**
1477
+ * Import a skill from .md file content.
1478
+ */
1479
+ async importSkill(params) {
1480
+ return this.api.post("/v1/skills/import", params);
1481
+ }
1482
+ /**
1483
+ * Export a skill as markdown content.
1484
+ */
1485
+ async export(skillId) {
1486
+ return this.api.get(`/v1/skills/${skillId}/export`, void 0, { responseType: "text" });
1487
+ }
1488
+ /**
1489
+ * Attach a skill to an assistant.
1490
+ */
1491
+ async attachToAssistant(assistantId, skillId) {
1492
+ return this.api.post(`/v1/assistants/${assistantId}/skills`, { skill_id: skillId });
1493
+ }
1494
+ /**
1495
+ * Detach a skill from an assistant.
1496
+ */
1497
+ async detachFromAssistant(assistantId, skillId) {
1498
+ return this.api.delete(`/v1/assistants/${assistantId}/skills/${skillId}`);
1499
+ }
1500
+ /**
1501
+ * Get all skills attached to an assistant.
1502
+ */
1503
+ async getAssistantSkills(assistantId) {
1504
+ return this.api.get(`/v1/assistants/${assistantId}/skills`);
1505
+ }
1506
+ /**
1507
+ * Bulk attach a skill to multiple assistants.
1508
+ */
1509
+ async bulkAttachToAssistants(skillId, assistantIds) {
1510
+ return this.api.post(`/v1/skills/${skillId}/assistants/bulk-attach`, {
1511
+ assistant_ids: assistantIds
1512
+ });
1513
+ }
1514
+ /**
1515
+ * Get all assistants using this skill.
1516
+ */
1517
+ async getSkillAssistants(skillId) {
1518
+ return this.api.get(`/v1/skills/${skillId}/assistants`);
1519
+ }
1520
+ /**
1521
+ * Publish a skill to the marketplace.
1522
+ */
1523
+ async publish(skillId, categories) {
1524
+ const body = categories?.length ? { categories } : void 0;
1525
+ return this.api.post(`/v1/skills/${skillId}/marketplace/publish`, body);
1526
+ }
1527
+ /**
1528
+ * Unpublish a skill from the marketplace.
1529
+ */
1530
+ async unpublish(skillId) {
1531
+ return this.api.post(`/v1/skills/${skillId}/marketplace/unpublish`);
1532
+ }
1533
+ /**
1534
+ * Get list of available skill categories.
1535
+ */
1536
+ async listCategories() {
1537
+ return this.api.get("/v1/skills/categories");
1538
+ }
1539
+ /**
1540
+ * Get users with access to skills.
1541
+ */
1542
+ async getUsers() {
1543
+ return this.api.get("/v1/skills/users");
1544
+ }
1545
+ /**
1546
+ * React to a skill.
1547
+ */
1548
+ async react(skillId, reaction) {
1549
+ return this.api.post(`/v1/skills/${skillId}/reactions`, { reaction });
1550
+ }
1551
+ /**
1552
+ * Remove all reactions from a skill.
1553
+ */
1554
+ async removeReactions(skillId) {
1555
+ return this.api.delete(`/v1/skills/${skillId}/reactions`);
1556
+ }
1387
1557
  };
1388
1558
 
1389
1559
  // src/mappers/workflow.mapper.ts
@@ -1724,6 +1894,7 @@ var CodeMieClient = class {
1724
1894
  this._llms = new LLMService(authConfig);
1725
1895
  this._tasks = new TaskService(authConfig);
1726
1896
  this._users = new UserService(authConfig);
1897
+ this._categories = new CategoryService(authConfig);
1727
1898
  this._skills = new SkillService(authConfig);
1728
1899
  this._workflows = new WorkflowService(authConfig);
1729
1900
  }
@@ -1775,6 +1946,12 @@ var CodeMieClient = class {
1775
1946
  get files() {
1776
1947
  return this._files;
1777
1948
  }
1949
+ /**
1950
+ * Get the CategoryService instance.
1951
+ */
1952
+ get categories() {
1953
+ return this._categories;
1954
+ }
1778
1955
  /**
1779
1956
  * Get the SkillService instance.
1780
1957
  */
@@ -1858,6 +2035,7 @@ var CodeMieClient = class {
1858
2035
  this._llms = new LLMService(authConfig);
1859
2036
  this._tasks = new TaskService(authConfig);
1860
2037
  this._users = new UserService(authConfig);
2038
+ this._categories = new CategoryService(authConfig);
1861
2039
  this._skills = new SkillService(authConfig);
1862
2040
  this._workflows = new WorkflowService(authConfig);
1863
2041
  }
@@ -2034,6 +2212,7 @@ export {
2034
2212
  AssistantUpdateParamsSchema,
2035
2213
  AssistantVersionsListParamsSchema,
2036
2214
  BackgroundTaskStatus,
2215
+ CategoryService,
2037
2216
  ChatRole,
2038
2217
  CodeDataSourceType,
2039
2218
  CodeMieClient,