@getmodus/sdk 0.10.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.
@@ -231,6 +231,17 @@ var OPERATIONS = {
231
231
  responseSchema: null,
232
232
  idempotent: false
233
233
  },
234
+ "ContextItemsQueryController_query": {
235
+ method: "POST",
236
+ path: "/api/v1/context/items/query",
237
+ service: "modus-api",
238
+ serverUrl: "https://api.getmodus.com",
239
+ pathParams: [],
240
+ queryParams: [],
241
+ requestSchema: "QueryContextItemsRequestDto",
242
+ responseSchema: "QueryContextItemsResponseDto",
243
+ idempotent: true
244
+ },
234
245
  "CustomContextItemsController_batchCreate": {
235
246
  method: "POST",
236
247
  path: "/api/v1/context/custom-items/batch",
@@ -242,6 +253,17 @@ var OPERATIONS = {
242
253
  responseSchema: "BatchCreateCustomContextItemsResponseDto",
243
254
  idempotent: false
244
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
+ },
245
267
  "CustomContextItemsController_create": {
246
268
  method: "POST",
247
269
  path: "/api/v1/context/custom-items",
@@ -292,7 +314,7 @@ var OPERATIONS = {
292
314
  service: "modus-api",
293
315
  serverUrl: "https://api.getmodus.com",
294
316
  pathParams: [],
295
- queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
317
+ queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics", "sourceId", "collectionId", "externalId"],
296
318
  requestSchema: null,
297
319
  responseSchema: "ListCustomContextItemsResponseDto",
298
320
  idempotent: false
@@ -1763,7 +1785,7 @@ function headerValue(headers, name) {
1763
1785
  }
1764
1786
 
1765
1787
  // src/_http.ts
1766
- var USER_AGENT = `modus-typescript/${"0.10.0"} (node/${process.version}; ${process.platform})`;
1788
+ var USER_AGENT = `modus-typescript/${"0.12.0"} (node/${process.version}; ${process.platform})`;
1767
1789
  function buildUrl(baseUrl, path, params) {
1768
1790
  const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
1769
1791
  if (params) {
@@ -2088,9 +2110,11 @@ var WRITE_BODY_ALLOWED_KEYS = {
2088
2110
  ContextFilesController_uploadUrls: ["files"],
2089
2111
  ContextItemAccessController_updateAccess: ["visibility", "groupPermissions", "sharedWith"],
2090
2112
  ContextItemsController_lookup: ["contextType", "dataPath", "contentProjection"],
2091
- ContextItemsController_move: ["destinationFolderUid"],
2113
+ ContextItemsController_move: ["destinationFolderUid", "destinationFolderPath"],
2092
2114
  ContextItemsController_update: ["contextType", "content", "description", "userFeedback", "topics"],
2115
+ ContextItemsQueryController_query: ["sql", "maxRows"],
2093
2116
  CustomContextItemsController_batchCreate: ["items"],
2117
+ CustomContextItemsController_batchDelete: ["sourceId", "collectionId", "externalId", "kind", "cascade", "cursor"],
2094
2118
  CustomContextItemsController_create: ["kind", "sourceId", "sourceName", "collectionId", "collectionName", "externalId", "fieldName", "name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics", "idempotencyKey", "access"],
2095
2119
  CustomContextItemsController_createRelations: ["relations"],
2096
2120
  CustomContextItemsController_update: ["name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics"],
@@ -2122,7 +2146,7 @@ var WRITE_BODY_ALLOWED_KEYS = {
2122
2146
  ScopesController_acceptOwnershipTransfer: [],
2123
2147
  ScopesController_addEvaluationCase: ["id", "task", "expectedOutput"],
2124
2148
  ScopesController_applySelectionOps: ["ops", "toolset", "validateOnly"],
2125
- 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"],
2126
2150
  ScopesController_deploy: [],
2127
2151
  ScopesController_mcpExposureCatalog: ["toolset", "connectionSet", "mcpToolExposure"],
2128
2152
  ScopesController_patchMcpConfig: ["config"],
@@ -2202,7 +2226,7 @@ var CHAT_MODELS = [
2202
2226
  ];
2203
2227
  var ALLOWED_CHAT_MODELS = new Set(CHAT_MODELS);
2204
2228
  function validateChatModel(model) {
2205
- if (!ALLOWED_CHAT_MODELS.has(model)) {
2229
+ if (model === void 0 || !ALLOWED_CHAT_MODELS.has(model)) {
2206
2230
  const supported = [...ALLOWED_CHAT_MODELS].sort().join(", ");
2207
2231
  throw new ValidationError(`Unsupported model ${JSON.stringify(model)}. Choose one of: ${supported}.`);
2208
2232
  }
@@ -2340,11 +2364,14 @@ var CustomContextItemsResource = class {
2340
2364
  * @param options.pageToken - Opaque token from a previous page.
2341
2365
  * @param options.searchQuery - Word search: returns rows that contain every word of the query, case-insensitive.
2342
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`.
2343
2370
  * @returns A page of custom context items.
2344
2371
  * @example
2345
2372
  * ```ts
2346
2373
  * const client = new Modus()
2347
- * const page = await client.context.customItems.list({ pageSize: 25 })
2374
+ * const page = await client.context.customItems.list({ sourceId: 'billing-db' })
2348
2375
  * for (const item of page.items) console.log(item.uid, item.contextType)
2349
2376
  * ```
2350
2377
  */
@@ -2358,7 +2385,10 @@ var CustomContextItemsResource = class {
2358
2385
  await invokeWithRetry(this.config, this.http, "CustomContextItemsController_list", {
2359
2386
  query: aipListParams(pageSize, pageToken, {
2360
2387
  searchQuery: options.searchQuery,
2361
- topics: options.topics
2388
+ topics: options.topics,
2389
+ sourceId: options.sourceId,
2390
+ collectionId: options.collectionId,
2391
+ externalId: options.externalId
2362
2392
  })
2363
2393
  })
2364
2394
  );
@@ -2462,7 +2492,7 @@ var CustomContextItemsResource = class {
2462
2492
  /**
2463
2493
  * Create or update typed relations between context items.
2464
2494
  *
2465
- * @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 `{}`.
2466
2496
  * @returns Number of relations created or updated.
2467
2497
  * @example
2468
2498
  * ```ts
@@ -2471,6 +2501,7 @@ var CustomContextItemsResource = class {
2471
2501
  * fromUid: 'SOURCE_UID',
2472
2502
  * toUid: 'TARGET_UID',
2473
2503
  * relationType: 'depends_on',
2504
+ * edgeProperties: { source_file: 'go.mod' },
2474
2505
  * }])
2475
2506
  * ```
2476
2507
  */
@@ -2525,6 +2556,37 @@ var CustomContextItemsResource = class {
2525
2556
  })
2526
2557
  );
2527
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
+ }
2528
2590
  };
2529
2591
 
2530
2592
  // src/_generated/resources/consumption/scopes/conversations.ts
@@ -2539,15 +2601,16 @@ var ScopesConversationsResourceBase = class {
2539
2601
  * List scope conversations.
2540
2602
  *
2541
2603
  * Returns a page of conversation summaries (most recently updated first) for a scope. Use `id=0`
2542
- * for your cross-scope recent history. Pass `nextPageToken` as `pageToken` to fetch the next
2543
- * 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.
2544
2606
  *
2545
2607
  * **Requires:** `scopes:read`
2546
2608
  *
2547
2609
  * @param options.pageSize - Items per page. Defaults to 25.
2548
2610
  * @param options.pageToken - Opaque page token from a previous response's `nextPageToken`. Omit
2549
2611
  * for the first page.
2550
- * @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.
2551
2614
  * @param options.sourceRef - Narrow `source` to one instance of that surface — for
2552
2615
  * `dashboard_copilot` or `dashboard_assistant`, a dashboard id (both scope conversation history
2553
2616
  * per dashboard). Requires `source`; sent alone it is a 422.
@@ -2663,4 +2726,4 @@ export {
2663
2726
  CustomContextItemsResource,
2664
2727
  ScopeConversationsResource
2665
2728
  };
2666
- //# sourceMappingURL=chunk-BMYCORZF.js.map
2729
+ //# sourceMappingURL=chunk-3CKUUDEJ.js.map