@knowledge-stack/ksapi 2.12.0 → 2.13.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.
Files changed (43) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/README.md +3 -2
  3. package/dist/apis/FoldersApi.d.ts +10 -10
  4. package/dist/apis/FoldersApi.js +4 -4
  5. package/dist/esm/apis/FoldersApi.d.ts +10 -10
  6. package/dist/esm/apis/FoldersApi.js +5 -5
  7. package/dist/esm/models/ResolvedReferenceInput.d.ts +7 -0
  8. package/dist/esm/models/ResolvedReferenceInput.js +3 -0
  9. package/dist/esm/models/ResolvedReferenceOutput.d.ts +7 -0
  10. package/dist/esm/models/ResolvedReferenceOutput.js +3 -0
  11. package/dist/esm/models/SearchItemsResponse.d.ts +77 -0
  12. package/dist/esm/models/SearchItemsResponse.js +72 -0
  13. package/dist/esm/models/SearchSortOrder.d.ts +6 -1
  14. package/dist/esm/models/SearchSortOrder.js +6 -1
  15. package/dist/esm/models/SearchablePartType.d.ts +1 -0
  16. package/dist/esm/models/SearchablePartType.js +2 -1
  17. package/dist/esm/models/index.d.ts +1 -0
  18. package/dist/esm/models/index.js +1 -0
  19. package/dist/models/ResolvedReferenceInput.d.ts +7 -0
  20. package/dist/models/ResolvedReferenceInput.js +3 -0
  21. package/dist/models/ResolvedReferenceOutput.d.ts +7 -0
  22. package/dist/models/ResolvedReferenceOutput.js +3 -0
  23. package/dist/models/SearchItemsResponse.d.ts +77 -0
  24. package/dist/models/SearchItemsResponse.js +80 -0
  25. package/dist/models/SearchSortOrder.d.ts +6 -1
  26. package/dist/models/SearchSortOrder.js +6 -1
  27. package/dist/models/SearchablePartType.d.ts +1 -0
  28. package/dist/models/SearchablePartType.js +2 -1
  29. package/dist/models/index.d.ts +1 -0
  30. package/dist/models/index.js +1 -0
  31. package/docs/FoldersApi.md +7 -7
  32. package/docs/ResolvedReferenceInput.md +2 -0
  33. package/docs/ResolvedReferenceOutput.md +2 -0
  34. package/docs/SearchItemsResponse.md +43 -0
  35. package/docs/SearchSortOrder.md +1 -1
  36. package/package.json +1 -1
  37. package/src/apis/FoldersApi.ts +17 -14
  38. package/src/models/ResolvedReferenceInput.ts +15 -0
  39. package/src/models/ResolvedReferenceOutput.ts +18 -0
  40. package/src/models/SearchItemsResponse.ts +141 -0
  41. package/src/models/SearchSortOrder.ts +6 -1
  42. package/src/models/SearchablePartType.ts +2 -1
  43. package/src/models/index.ts +1 -0
@@ -19,6 +19,7 @@ exports.ResolvedReferenceOutputFromJSON = ResolvedReferenceOutputFromJSON;
19
19
  exports.ResolvedReferenceOutputFromJSONTyped = ResolvedReferenceOutputFromJSONTyped;
20
20
  exports.ResolvedReferenceOutputToJSON = ResolvedReferenceOutputToJSON;
21
21
  exports.ResolvedReferenceOutputToJSONTyped = ResolvedReferenceOutputToJSONTyped;
22
+ const DocumentType_1 = require("./DocumentType");
22
23
  exports.ResolvedReferenceOutputPropertyValidationAttributesMap = {};
23
24
  /**
24
25
  * Check if a given object implements the ResolvedReferenceOutput interface.
@@ -44,6 +45,7 @@ function ResolvedReferenceOutputFromJSONTyped(json, ignoreDiscriminator) {
44
45
  'entityId': json['entity_id'],
45
46
  'displayName': json['display_name'],
46
47
  'materializedPath': json['materialized_path'] == null ? undefined : json['materialized_path'],
48
+ 'documentType': json['document_type'] == null ? undefined : (0, DocumentType_1.DocumentTypeFromJSON)(json['document_type']),
47
49
  };
48
50
  }
49
51
  function ResolvedReferenceOutputToJSON(json) {
@@ -58,5 +60,6 @@ function ResolvedReferenceOutputToJSONTyped(value, ignoreDiscriminator = false)
58
60
  'entity_id': value['entityId'],
59
61
  'display_name': value['displayName'],
60
62
  'materialized_path': value['materializedPath'],
63
+ 'document_type': (0, DocumentType_1.DocumentTypeToJSON)(value['documentType']),
61
64
  };
62
65
  }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR } from './FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR';
13
+ /**
14
+ * A search page plus how many items of each type the query matched.
15
+ *
16
+ * ``counts_by_type`` ignores any ``part_type`` filter so the filter chips can
17
+ * keep showing every type's count while one of them is selected.
18
+ * @export
19
+ * @interface SearchItemsResponse
20
+ */
21
+ export interface SearchItemsResponse {
22
+ /**
23
+ * List of items
24
+ * @type {Array<FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR>}
25
+ * @memberof SearchItemsResponse
26
+ */
27
+ items: Array<FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR>;
28
+ /**
29
+ * Total number of items
30
+ * @type {number}
31
+ * @memberof SearchItemsResponse
32
+ */
33
+ total: number;
34
+ /**
35
+ * Number of items per page
36
+ * @type {number}
37
+ * @memberof SearchItemsResponse
38
+ */
39
+ limit: number;
40
+ /**
41
+ * Number of items to skip
42
+ * @type {number}
43
+ * @memberof SearchItemsResponse
44
+ */
45
+ offset: number;
46
+ /**
47
+ * Matches per item type, keyed by SearchablePartType and unaffected by the part_type filter
48
+ * @type {{ [key: string]: number; }}
49
+ * @memberof SearchItemsResponse
50
+ */
51
+ countsByType?: {
52
+ [key: string]: number;
53
+ };
54
+ }
55
+ export declare const SearchItemsResponsePropertyValidationAttributesMap: {
56
+ [property: string]: {
57
+ maxLength?: number;
58
+ minLength?: number;
59
+ pattern?: string;
60
+ maximum?: number;
61
+ exclusiveMaximum?: boolean;
62
+ minimum?: number;
63
+ exclusiveMinimum?: boolean;
64
+ multipleOf?: number;
65
+ maxItems?: number;
66
+ minItems?: number;
67
+ uniqueItems?: boolean;
68
+ };
69
+ };
70
+ /**
71
+ * Check if a given object implements the SearchItemsResponse interface.
72
+ */
73
+ export declare function instanceOfSearchItemsResponse(value: object): value is SearchItemsResponse;
74
+ export declare function SearchItemsResponseFromJSON(json: any): SearchItemsResponse;
75
+ export declare function SearchItemsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchItemsResponse;
76
+ export declare function SearchItemsResponseToJSON(json: any): SearchItemsResponse;
77
+ export declare function SearchItemsResponseToJSONTyped(value?: SearchItemsResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.SearchItemsResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfSearchItemsResponse = instanceOfSearchItemsResponse;
18
+ exports.SearchItemsResponseFromJSON = SearchItemsResponseFromJSON;
19
+ exports.SearchItemsResponseFromJSONTyped = SearchItemsResponseFromJSONTyped;
20
+ exports.SearchItemsResponseToJSON = SearchItemsResponseToJSON;
21
+ exports.SearchItemsResponseToJSONTyped = SearchItemsResponseToJSONTyped;
22
+ const FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR_1 = require("./FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR");
23
+ exports.SearchItemsResponsePropertyValidationAttributesMap = {
24
+ total: {
25
+ minimum: 0,
26
+ exclusiveMinimum: false,
27
+ },
28
+ limit: {
29
+ minimum: 1,
30
+ exclusiveMinimum: false,
31
+ },
32
+ offset: {
33
+ minimum: 0,
34
+ exclusiveMinimum: false,
35
+ },
36
+ };
37
+ /**
38
+ * Check if a given object implements the SearchItemsResponse interface.
39
+ */
40
+ function instanceOfSearchItemsResponse(value) {
41
+ if (!('items' in value) || value['items'] === undefined)
42
+ return false;
43
+ if (!('total' in value) || value['total'] === undefined)
44
+ return false;
45
+ if (!('limit' in value) || value['limit'] === undefined)
46
+ return false;
47
+ if (!('offset' in value) || value['offset'] === undefined)
48
+ return false;
49
+ return true;
50
+ }
51
+ function SearchItemsResponseFromJSON(json) {
52
+ return SearchItemsResponseFromJSONTyped(json, false);
53
+ }
54
+ function SearchItemsResponseFromJSONTyped(json, ignoreDiscriminator) {
55
+ if (json == null) {
56
+ return json;
57
+ }
58
+ return {
59
+ 'items': (json['items'].map(FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR_1.FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaRFromJSON)),
60
+ 'total': json['total'],
61
+ 'limit': json['limit'],
62
+ 'offset': json['offset'],
63
+ 'countsByType': json['counts_by_type'] == null ? undefined : json['counts_by_type'],
64
+ };
65
+ }
66
+ function SearchItemsResponseToJSON(json) {
67
+ return SearchItemsResponseToJSONTyped(json, false);
68
+ }
69
+ function SearchItemsResponseToJSONTyped(value, ignoreDiscriminator = false) {
70
+ if (value == null) {
71
+ return value;
72
+ }
73
+ return {
74
+ 'items': (value['items'].map(FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR_1.FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaRToJSON)),
75
+ 'total': value['total'],
76
+ 'limit': value['limit'],
77
+ 'offset': value['offset'],
78
+ 'counts_by_type': value['countsByType'],
79
+ };
80
+ }
@@ -10,10 +10,15 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Sort order options for search results.
13
+ * Ordering for flat name search.
14
+ *
15
+ * RELEVANCE ranks an exact name match first, then names starting with the
16
+ * query, then by how closely the name matches, then shorter names, then
17
+ * alphabetically.
14
18
  * @export
15
19
  */
16
20
  export declare const SearchSortOrder: {
21
+ readonly Relevance: 'RELEVANCE';
17
22
  readonly Name: 'NAME';
18
23
  readonly UpdatedAt: 'UPDATED_AT';
19
24
  readonly CreatedAt: 'CREATED_AT';
@@ -20,10 +20,15 @@ exports.SearchSortOrderFromJSONTyped = SearchSortOrderFromJSONTyped;
20
20
  exports.SearchSortOrderToJSON = SearchSortOrderToJSON;
21
21
  exports.SearchSortOrderToJSONTyped = SearchSortOrderToJSONTyped;
22
22
  /**
23
- * Sort order options for search results.
23
+ * Ordering for flat name search.
24
+ *
25
+ * RELEVANCE ranks an exact name match first, then names starting with the
26
+ * query, then by how closely the name matches, then shorter names, then
27
+ * alphabetically.
24
28
  * @export
25
29
  */
26
30
  exports.SearchSortOrder = {
31
+ Relevance: 'RELEVANCE',
27
32
  Name: 'NAME',
28
33
  UpdatedAt: 'UPDATED_AT',
29
34
  CreatedAt: 'CREATED_AT'
@@ -22,6 +22,7 @@ export declare const SearchablePartType: {
22
22
  readonly DataSourceSchema: 'DATA_SOURCE_SCHEMA';
23
23
  readonly DataSourceTable: 'DATA_SOURCE_TABLE';
24
24
  readonly ApiConnection: 'API_CONNECTION';
25
+ readonly Skill: 'SKILL';
25
26
  };
26
27
  export type SearchablePartType = typeof SearchablePartType[keyof typeof SearchablePartType];
27
28
  export declare function instanceOfSearchablePartType(value: any): boolean;
@@ -31,7 +31,8 @@ exports.SearchablePartType = {
31
31
  DataSource: 'DATA_SOURCE',
32
32
  DataSourceSchema: 'DATA_SOURCE_SCHEMA',
33
33
  DataSourceTable: 'DATA_SOURCE_TABLE',
34
- ApiConnection: 'API_CONNECTION'
34
+ ApiConnection: 'API_CONNECTION',
35
+ Skill: 'SKILL'
35
36
  };
36
37
  function instanceOfSearchablePartType(value) {
37
38
  for (const key in exports.SearchablePartType) {
@@ -263,6 +263,7 @@ export * from './RunTimeseriesResponse';
263
263
  export * from './SSOInitiateResponse';
264
264
  export * from './ScheduleCadence';
265
265
  export * from './ScoredChunkResponse';
266
+ export * from './SearchItemsResponse';
266
267
  export * from './SearchSkillsRequest';
267
268
  export * from './SearchSkillsResponse';
268
269
  export * from './SearchSortOrder';
@@ -281,6 +281,7 @@ __exportStar(require("./RunTimeseriesResponse"), exports);
281
281
  __exportStar(require("./SSOInitiateResponse"), exports);
282
282
  __exportStar(require("./ScheduleCadence"), exports);
283
283
  __exportStar(require("./ScoredChunkResponse"), exports);
284
+ __exportStar(require("./SearchItemsResponse"), exports);
284
285
  __exportStar(require("./SearchSkillsRequest"), exports);
285
286
  __exportStar(require("./SearchSkillsResponse"), exports);
286
287
  __exportStar(require("./SearchSortOrder"), exports);
@@ -546,7 +546,7 @@ example().catch(console.error);
546
546
 
547
547
  ## searchItems
548
548
 
549
- > PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat searchItems(nameLike, sortOrder, partType, withTags, parentPathPartId, limit, offset)
549
+ > SearchItemsResponse searchItems(nameLike, partType, sortOrder, withTags, parentPathPartId, limit, offset)
550
550
 
551
551
  Search Items Handler
552
552
 
@@ -574,10 +574,10 @@ async function example() {
574
574
  const body = {
575
575
  // string | Case-insensitive partial name search
576
576
  nameLike: nameLike_example,
577
- // SearchSortOrder | Sort order for results (default: NAME) (optional)
578
- sortOrder: ...,
579
- // SearchablePartType | Filter by item type (default: all searchable types) (optional)
577
+ // Array<SearchablePartType> | Filter by item type; repeat the parameter to select several (default: all searchable types) (optional)
580
578
  partType: ...,
579
+ // SearchSortOrder | Sort order for results (default: RELEVANCE) (optional)
580
+ sortOrder: ...,
581
581
  // boolean | Include tags in the response (default: false) (optional)
582
582
  withTags: true,
583
583
  // string | Scope search to descendants of this folder\'s path part (optional)
@@ -606,8 +606,8 @@ example().catch(console.error);
606
606
  | Name | Type | Description | Notes |
607
607
  |------------- | ------------- | ------------- | -------------|
608
608
  | **nameLike** | `string` | Case-insensitive partial name search | [Defaults to `undefined`] |
609
- | **sortOrder** | `SearchSortOrder` | Sort order for results (default: NAME) | [Optional] [Defaults to `undefined`] [Enum: NAME, UPDATED_AT, CREATED_AT] |
610
- | **partType** | `SearchablePartType` | Filter by item type (default: all searchable types) | [Optional] [Defaults to `undefined`] [Enum: FOLDER, DOCUMENT, WORKFLOW_DEFINITION, WORKFLOW_RUN, DATA_SOURCE, DATA_SOURCE_SCHEMA, DATA_SOURCE_TABLE, API_CONNECTION] |
609
+ | **partType** | `Array<SearchablePartType>` | Filter by item type; repeat the parameter to select several (default: all searchable types) | [Optional] |
610
+ | **sortOrder** | `SearchSortOrder` | Sort order for results (default: RELEVANCE) | [Optional] [Defaults to `undefined`] [Enum: RELEVANCE, NAME, UPDATED_AT, CREATED_AT] |
611
611
  | **withTags** | `boolean` | Include tags in the response (default: false) | [Optional] [Defaults to `false`] |
612
612
  | **parentPathPartId** | `string` | Scope search to descendants of this folder\&#39;s path part | [Optional] [Defaults to `undefined`] |
613
613
  | **limit** | `number` | Number of items per page | [Optional] [Defaults to `20`] |
@@ -615,7 +615,7 @@ example().catch(console.error);
615
615
 
616
616
  ### Return type
617
617
 
618
- [**PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat**](PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.md)
618
+ [**SearchItemsResponse**](SearchItemsResponse.md)
619
619
 
620
620
  ### Authorization
621
621
 
@@ -11,6 +11,7 @@ Name | Type
11
11
  `entityId` | string
12
12
  `displayName` | string
13
13
  `materializedPath` | string
14
+ `documentType` | [DocumentType](DocumentType.md)
14
15
 
15
16
  ## Example
16
17
 
@@ -23,6 +24,7 @@ const example = {
23
24
  "entityId": null,
24
25
  "displayName": null,
25
26
  "materializedPath": null,
27
+ "documentType": null,
26
28
  } satisfies ResolvedReferenceInput
27
29
 
28
30
  console.log(example)
@@ -11,6 +11,7 @@ Name | Type
11
11
  `entityId` | string
12
12
  `displayName` | string
13
13
  `materializedPath` | string
14
+ `documentType` | [DocumentType](DocumentType.md)
14
15
 
15
16
  ## Example
16
17
 
@@ -23,6 +24,7 @@ const example = {
23
24
  "entityId": null,
24
25
  "displayName": null,
25
26
  "materializedPath": null,
27
+ "documentType": null,
26
28
  } satisfies ResolvedReferenceOutput
27
29
 
28
30
  console.log(example)
@@ -0,0 +1,43 @@
1
+
2
+ # SearchItemsResponse
3
+
4
+ A search page plus how many items of each type the query matched. ``counts_by_type`` ignores any ``part_type`` filter so the filter chips can keep showing every type\'s count while one of them is selected.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `items` | [Array&lt;FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR&gt;](FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md)
11
+ `total` | number
12
+ `limit` | number
13
+ `offset` | number
14
+ `countsByType` | { [key: string]: number; }
15
+
16
+ ## Example
17
+
18
+ ```typescript
19
+ import type { SearchItemsResponse } from '@knowledge-stack/ksapi'
20
+
21
+ // TODO: Update the object below with actual values
22
+ const example = {
23
+ "items": null,
24
+ "total": null,
25
+ "limit": null,
26
+ "offset": null,
27
+ "countsByType": null,
28
+ } satisfies SearchItemsResponse
29
+
30
+ console.log(example)
31
+
32
+ // Convert the instance to a JSON string
33
+ const exampleJSON: string = JSON.stringify(example)
34
+ console.log(exampleJSON)
35
+
36
+ // Parse the JSON string back to an object
37
+ const exampleParsed = JSON.parse(exampleJSON) as SearchItemsResponse
38
+ console.log(exampleParsed)
39
+ ```
40
+
41
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
42
+
43
+
@@ -1,7 +1,7 @@
1
1
 
2
2
  # SearchSortOrder
3
3
 
4
- Sort order options for search results.
4
+ Ordering for flat name search. RELEVANCE ranks an exact name match first, then names starting with the query, then by how closely the name matches, then shorter names, then alphabetically.
5
5
 
6
6
  ## Properties
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -26,6 +26,7 @@ import type {
26
26
  PaginatedResponseFolderResponse,
27
27
  PathOrder,
28
28
  PathPartApprovalState,
29
+ SearchItemsResponse,
29
30
  SearchSortOrder,
30
31
  SearchablePartType,
31
32
  SortDirection,
@@ -54,6 +55,8 @@ import {
54
55
  PathOrderToJSON,
55
56
  PathPartApprovalStateFromJSON,
56
57
  PathPartApprovalStateToJSON,
58
+ SearchItemsResponseFromJSON,
59
+ SearchItemsResponseToJSON,
57
60
  SearchSortOrderFromJSON,
58
61
  SearchSortOrderToJSON,
59
62
  SearchablePartTypeFromJSON,
@@ -117,8 +120,8 @@ export interface ListFoldersRequest {
117
120
 
118
121
  export interface SearchItemsRequest {
119
122
  nameLike: string;
123
+ partType?: Array<SearchablePartType>;
120
124
  sortOrder?: SearchSortOrder;
121
- partType?: SearchablePartType;
122
125
  withTags?: boolean;
123
126
  parentPathPartId?: string | null;
124
127
  limit?: number;
@@ -337,8 +340,8 @@ export interface FoldersApiInterface {
337
340
  /**
338
341
  * Creates request options for searchItems without sending the request
339
342
  * @param {string} nameLike Case-insensitive partial name search
340
- * @param {SearchSortOrder} [sortOrder] Sort order for results (default: NAME)
341
- * @param {SearchablePartType} [partType] Filter by item type (default: all searchable types)
343
+ * @param {Array<SearchablePartType>} [partType] Filter by item type; repeat the parameter to select several (default: all searchable types)
344
+ * @param {SearchSortOrder} [sortOrder] Sort order for results (default: RELEVANCE)
342
345
  * @param {boolean} [withTags] Include tags in the response (default: false)
343
346
  * @param {string} [parentPathPartId] Scope search to descendants of this folder\&#39;s path part
344
347
  * @param {number} [limit] Number of items per page
@@ -352,8 +355,8 @@ export interface FoldersApiInterface {
352
355
  * Search for folders, documents, and connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
353
356
  * @summary Search Items Handler
354
357
  * @param {string} nameLike Case-insensitive partial name search
355
- * @param {SearchSortOrder} [sortOrder] Sort order for results (default: NAME)
356
- * @param {SearchablePartType} [partType] Filter by item type (default: all searchable types)
358
+ * @param {Array<SearchablePartType>} [partType] Filter by item type; repeat the parameter to select several (default: all searchable types)
359
+ * @param {SearchSortOrder} [sortOrder] Sort order for results (default: RELEVANCE)
357
360
  * @param {boolean} [withTags] Include tags in the response (default: false)
358
361
  * @param {string} [parentPathPartId] Scope search to descendants of this folder\&#39;s path part
359
362
  * @param {number} [limit] Number of items per page
@@ -362,13 +365,13 @@ export interface FoldersApiInterface {
362
365
  * @throws {RequiredError}
363
366
  * @memberof FoldersApiInterface
364
367
  */
365
- searchItemsRaw(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat>>;
368
+ searchItemsRaw(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchItemsResponse>>;
366
369
 
367
370
  /**
368
371
  * Search for folders, documents, and connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
369
372
  * Search Items Handler
370
373
  */
371
- searchItems(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat>;
374
+ searchItems(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchItemsResponse>;
372
375
 
373
376
  /**
374
377
  * Creates request options for updateFolder without sending the request
@@ -860,14 +863,14 @@ export class FoldersApi extends runtime.BaseAPI implements FoldersApiInterface {
860
863
  queryParameters['name_like'] = requestParameters['nameLike'];
861
864
  }
862
865
 
863
- if (requestParameters['sortOrder'] != null) {
864
- queryParameters['sort_order'] = requestParameters['sortOrder'];
865
- }
866
-
867
866
  if (requestParameters['partType'] != null) {
868
867
  queryParameters['part_type'] = requestParameters['partType'];
869
868
  }
870
869
 
870
+ if (requestParameters['sortOrder'] != null) {
871
+ queryParameters['sort_order'] = requestParameters['sortOrder'];
872
+ }
873
+
871
874
  if (requestParameters['withTags'] != null) {
872
875
  queryParameters['with_tags'] = requestParameters['withTags'];
873
876
  }
@@ -909,18 +912,18 @@ export class FoldersApi extends runtime.BaseAPI implements FoldersApiInterface {
909
912
  * Search for folders, documents, and connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
910
913
  * Search Items Handler
911
914
  */
912
- async searchItemsRaw(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat>> {
915
+ async searchItemsRaw(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchItemsResponse>> {
913
916
  const requestOptions = await this.searchItemsRequestOpts(requestParameters);
914
917
  const response = await this.request(requestOptions, initOverrides);
915
918
 
916
- return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDatFromJSON(jsonValue));
919
+ return new runtime.JSONApiResponse(response, (jsonValue) => SearchItemsResponseFromJSON(jsonValue));
917
920
  }
918
921
 
919
922
  /**
920
923
  * Search for folders, documents, and connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
921
924
  * Search Items Handler
922
925
  */
923
- async searchItems(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat> {
926
+ async searchItems(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchItemsResponse> {
924
927
  const response = await this.searchItemsRaw(requestParameters, initOverrides);
925
928
  return await response.value();
926
929
  }
@@ -13,6 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { DocumentType } from './DocumentType';
17
+ import {
18
+ DocumentTypeFromJSON,
19
+ DocumentTypeFromJSONTyped,
20
+ DocumentTypeToJSON,
21
+ DocumentTypeToJSONTyped,
22
+ } from './DocumentType';
16
23
  import type { ReferenceType } from './ReferenceType';
17
24
  import {
18
25
  ReferenceTypeFromJSON,
@@ -55,6 +62,12 @@ export interface ResolvedReferenceInput {
55
62
  * @memberof ResolvedReferenceInput
56
63
  */
57
64
  materializedPath?: string | null;
65
+ /**
66
+ *
67
+ * @type {DocumentType}
68
+ * @memberof ResolvedReferenceInput
69
+ */
70
+ documentType?: DocumentType;
58
71
  }
59
72
 
60
73
 
@@ -100,6 +113,7 @@ export function ResolvedReferenceInputFromJSONTyped(json: any, ignoreDiscriminat
100
113
  'entityId': json['entity_id'],
101
114
  'displayName': json['display_name'],
102
115
  'materializedPath': json['materialized_path'] == null ? undefined : json['materialized_path'],
116
+ 'documentType': json['document_type'] == null ? undefined : DocumentTypeFromJSON(json['document_type']),
103
117
  };
104
118
  }
105
119
 
@@ -118,6 +132,7 @@ export function ResolvedReferenceInputToJSONTyped(value?: ResolvedReferenceInput
118
132
  'entity_id': value['entityId'],
119
133
  'display_name': value['displayName'],
120
134
  'materialized_path': value['materializedPath'],
135
+ 'document_type': DocumentTypeToJSON(value['documentType']),
121
136
  };
122
137
  }
123
138
 
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { DocumentType } from './DocumentType';
17
+ import {
18
+ DocumentTypeFromJSON,
19
+ DocumentTypeFromJSONTyped,
20
+ DocumentTypeToJSON,
21
+ DocumentTypeToJSONTyped,
22
+ } from './DocumentType';
23
+
16
24
  /**
17
25
  * A parsed reference enriched with display name and path from the database.
18
26
  *
@@ -47,7 +55,15 @@ export interface ResolvedReferenceOutput {
47
55
  * @memberof ResolvedReferenceOutput
48
56
  */
49
57
  materializedPath?: string | null;
58
+ /**
59
+ *
60
+ * @type {DocumentType}
61
+ * @memberof ResolvedReferenceOutput
62
+ */
63
+ documentType?: DocumentType;
50
64
  }
65
+
66
+
51
67
  export const ResolvedReferenceOutputPropertyValidationAttributesMap: {
52
68
  [property: string]: {
53
69
  maxLength?: number,
@@ -90,6 +106,7 @@ export function ResolvedReferenceOutputFromJSONTyped(json: any, ignoreDiscrimina
90
106
  'entityId': json['entity_id'],
91
107
  'displayName': json['display_name'],
92
108
  'materializedPath': json['materialized_path'] == null ? undefined : json['materialized_path'],
109
+ 'documentType': json['document_type'] == null ? undefined : DocumentTypeFromJSON(json['document_type']),
93
110
  };
94
111
  }
95
112
 
@@ -108,6 +125,7 @@ export function ResolvedReferenceOutputToJSONTyped(value?: ResolvedReferenceOutp
108
125
  'entity_id': value['entityId'],
109
126
  'display_name': value['displayName'],
110
127
  'materialized_path': value['materializedPath'],
128
+ 'document_type': DocumentTypeToJSON(value['documentType']),
111
129
  };
112
130
  }
113
131