@getmodus/sdk 0.11.0 → 0.12.0

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.
@@ -253,6 +253,17 @@ var OPERATIONS = {
253
253
  responseSchema: "BatchCreateCustomContextItemsResponseDto",
254
254
  idempotent: false
255
255
  },
256
+ "CustomContextItemsController_batchDelete": {
257
+ method: "POST",
258
+ path: "/api/v1/context/custom-items/batchDelete",
259
+ service: "modus-api",
260
+ serverUrl: "https://api.getmodus.com",
261
+ pathParams: [],
262
+ queryParams: [],
263
+ requestSchema: "BatchDeleteCustomContextItemsDto",
264
+ responseSchema: "BatchDeleteCustomContextItemsResponseDto",
265
+ idempotent: false
266
+ },
256
267
  "CustomContextItemsController_create": {
257
268
  method: "POST",
258
269
  path: "/api/v1/context/custom-items",
@@ -303,7 +314,7 @@ var OPERATIONS = {
303
314
  service: "modus-api",
304
315
  serverUrl: "https://api.getmodus.com",
305
316
  pathParams: [],
306
- queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
317
+ queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics", "sourceId", "collectionId", "externalId"],
307
318
  requestSchema: null,
308
319
  responseSchema: "ListCustomContextItemsResponseDto",
309
320
  idempotent: false
@@ -1774,7 +1785,7 @@ function headerValue(headers, name) {
1774
1785
  }
1775
1786
 
1776
1787
  // src/_http.ts
1777
- var USER_AGENT = `modus-typescript/${"0.11.0"} (node/${process.version}; ${process.platform})`;
1788
+ var USER_AGENT = `modus-typescript/${"0.12.0"} (node/${process.version}; ${process.platform})`;
1778
1789
  function buildUrl(baseUrl, path, params) {
1779
1790
  const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
1780
1791
  if (params) {
@@ -2099,10 +2110,11 @@ var WRITE_BODY_ALLOWED_KEYS = {
2099
2110
  ContextFilesController_uploadUrls: ["files"],
2100
2111
  ContextItemAccessController_updateAccess: ["visibility", "groupPermissions", "sharedWith"],
2101
2112
  ContextItemsController_lookup: ["contextType", "dataPath", "contentProjection"],
2102
- ContextItemsController_move: ["destinationFolderUid"],
2113
+ ContextItemsController_move: ["destinationFolderUid", "destinationFolderPath"],
2103
2114
  ContextItemsController_update: ["contextType", "content", "description", "userFeedback", "topics"],
2104
2115
  ContextItemsQueryController_query: ["sql", "maxRows"],
2105
2116
  CustomContextItemsController_batchCreate: ["items"],
2117
+ CustomContextItemsController_batchDelete: ["sourceId", "collectionId", "externalId", "kind", "cascade", "cursor"],
2106
2118
  CustomContextItemsController_create: ["kind", "sourceId", "sourceName", "collectionId", "collectionName", "externalId", "fieldName", "name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics", "idempotencyKey", "access"],
2107
2119
  CustomContextItemsController_createRelations: ["relations"],
2108
2120
  CustomContextItemsController_update: ["name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics"],
@@ -2134,7 +2146,7 @@ var WRITE_BODY_ALLOWED_KEYS = {
2134
2146
  ScopesController_acceptOwnershipTransfer: [],
2135
2147
  ScopesController_addEvaluationCase: ["id", "task", "expectedOutput"],
2136
2148
  ScopesController_applySelectionOps: ["ops", "toolset", "validateOnly"],
2137
- ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "includeOwnLearnings", "interfaces", "accessConfig"],
2149
+ ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "includeOwnLearnings", "includeOrgLearnings", "interfaces", "accessConfig"],
2138
2150
  ScopesController_deploy: [],
2139
2151
  ScopesController_mcpExposureCatalog: ["toolset", "connectionSet", "mcpToolExposure"],
2140
2152
  ScopesController_patchMcpConfig: ["config"],
@@ -2214,7 +2226,7 @@ var CHAT_MODELS = [
2214
2226
  ];
2215
2227
  var ALLOWED_CHAT_MODELS = new Set(CHAT_MODELS);
2216
2228
  function validateChatModel(model) {
2217
- if (!ALLOWED_CHAT_MODELS.has(model)) {
2229
+ if (model === void 0 || !ALLOWED_CHAT_MODELS.has(model)) {
2218
2230
  const supported = [...ALLOWED_CHAT_MODELS].sort().join(", ");
2219
2231
  throw new ValidationError(`Unsupported model ${JSON.stringify(model)}. Choose one of: ${supported}.`);
2220
2232
  }
@@ -2352,11 +2364,14 @@ var CustomContextItemsResource = class {
2352
2364
  * @param options.pageToken - Opaque token from a previous page.
2353
2365
  * @param options.searchQuery - Word search: returns rows that contain every word of the query, case-insensitive.
2354
2366
  * @param options.topics - Filter to items tagged with any of these topics.
2367
+ * @param options.sourceId - Restrict to one customer-defined source and everything beneath it.
2368
+ * @param options.collectionId - Restrict to one collection inside the source. Requires `sourceId`.
2369
+ * @param options.externalId - Restrict to one entity inside the collection. Requires `sourceId` and `collectionId`.
2355
2370
  * @returns A page of custom context items.
2356
2371
  * @example
2357
2372
  * ```ts
2358
2373
  * const client = new Modus()
2359
- * const page = await client.context.customItems.list({ pageSize: 25 })
2374
+ * const page = await client.context.customItems.list({ sourceId: 'billing-db' })
2360
2375
  * for (const item of page.items) console.log(item.uid, item.contextType)
2361
2376
  * ```
2362
2377
  */
@@ -2370,7 +2385,10 @@ var CustomContextItemsResource = class {
2370
2385
  await invokeWithRetry(this.config, this.http, "CustomContextItemsController_list", {
2371
2386
  query: aipListParams(pageSize, pageToken, {
2372
2387
  searchQuery: options.searchQuery,
2373
- topics: options.topics
2388
+ topics: options.topics,
2389
+ sourceId: options.sourceId,
2390
+ collectionId: options.collectionId,
2391
+ externalId: options.externalId
2374
2392
  })
2375
2393
  })
2376
2394
  );
@@ -2474,7 +2492,7 @@ var CustomContextItemsResource = class {
2474
2492
  /**
2475
2493
  * Create or update typed relations between context items.
2476
2494
  *
2477
- * @param relations - Relations with source and target item uids, a snake_case type, and optional content.
2495
+ * @param relations - Relations with source and target item uids, a snake_case type, and optional flat edgeProperties. Omitting edgeProperties on an existing relation replaces its stored properties with `{}`.
2478
2496
  * @returns Number of relations created or updated.
2479
2497
  * @example
2480
2498
  * ```ts
@@ -2483,6 +2501,7 @@ var CustomContextItemsResource = class {
2483
2501
  * fromUid: 'SOURCE_UID',
2484
2502
  * toUid: 'TARGET_UID',
2485
2503
  * relationType: 'depends_on',
2504
+ * edgeProperties: { source_file: 'go.mod' },
2486
2505
  * }])
2487
2506
  * ```
2488
2507
  */
@@ -2537,6 +2556,37 @@ var CustomContextItemsResource = class {
2537
2556
  })
2538
2557
  );
2539
2558
  }
2559
+ /**
2560
+ * Delete custom context items selected by source key.
2561
+ *
2562
+ * Only items you can manage are deleted, and integration-derived context items
2563
+ * are never affected. By default only the targeted node is removed; set
2564
+ * `cascade` to also remove everything beneath it. Processes up to 1000 items
2565
+ * per call — when `truncated` is true, call again to continue.
2566
+ *
2567
+ * @param input.sourceId - Source to delete from. Required.
2568
+ * @param input.collectionId - Narrow to one collection inside the source.
2569
+ * @param input.externalId - Narrow to one entity inside the collection.
2570
+ * @param input.cascade - Also delete everything beneath the targeted node.
2571
+ * @returns Counts of deleted and skipped items, and whether more remain.
2572
+ * @example
2573
+ * ```ts
2574
+ * const client = new Modus()
2575
+ * const result = await client.context.customItems.batchDelete({
2576
+ * sourceId: 'billing-db',
2577
+ * collectionId: 'contracts',
2578
+ * cascade: true,
2579
+ * })
2580
+ * console.log(result.deletedCount, result.truncated)
2581
+ * ```
2582
+ */
2583
+ async batchDelete(input) {
2584
+ return asRecord(
2585
+ await invokeWithRetry(this.config, this.http, "CustomContextItemsController_batchDelete", {
2586
+ jsonBody: omitUndefined(input)
2587
+ })
2588
+ );
2589
+ }
2540
2590
  };
2541
2591
 
2542
2592
  // src/_generated/resources/consumption/scopes/conversations.ts
@@ -2551,15 +2601,16 @@ var ScopesConversationsResourceBase = class {
2551
2601
  * List scope conversations.
2552
2602
  *
2553
2603
  * Returns a page of conversation summaries (most recently updated first) for a scope. Use `id=0`
2554
- * for your cross-scope recent history. Pass `nextPageToken` as `pageToken` to fetch the next
2555
- * page.
2604
+ * for your cross-scope recent history. A conversation you took no part in shows only who took
2605
+ * part and when. Pass `nextPageToken` as `pageToken` for the next page.
2556
2606
  *
2557
2607
  * **Requires:** `scopes:read`
2558
2608
  *
2559
2609
  * @param options.pageSize - Items per page. Defaults to 25.
2560
2610
  * @param options.pageToken - Opaque page token from a previous response's `nextPageToken`. Omit
2561
2611
  * for the first page.
2562
- * @param options.source - Return only conversations started from this UI surface.
2612
+ * @param options.source - Return only conversations started from this UI surface. Matches only
2613
+ * conversations you took part in.
2563
2614
  * @param options.sourceRef - Narrow `source` to one instance of that surface — for
2564
2615
  * `dashboard_copilot` or `dashboard_assistant`, a dashboard id (both scope conversation history
2565
2616
  * per dashboard). Requires `source`; sent alone it is a 422.
@@ -2675,4 +2726,4 @@ export {
2675
2726
  CustomContextItemsResource,
2676
2727
  ScopeConversationsResource
2677
2728
  };
2678
- //# sourceMappingURL=chunk-JVTQBBMZ.js.map
2729
+ //# sourceMappingURL=chunk-3CKUUDEJ.js.map