@wix/auto_sdk_igor_document-search 1.0.0 → 1.0.1

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 (38) hide show
  1. package/build/cjs/index.d.ts +38 -158
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/index.typings.d.ts +201 -1
  4. package/build/cjs/index.typings.js.map +1 -1
  5. package/build/cjs/meta.d.ts +10 -7
  6. package/build/cjs/meta.js.map +1 -1
  7. package/build/cjs/schemas.d.ts +54 -0
  8. package/build/cjs/schemas.js +115 -0
  9. package/build/cjs/schemas.js.map +1 -0
  10. package/build/es/index.d.mts +38 -158
  11. package/build/es/index.mjs.map +1 -1
  12. package/build/es/index.typings.d.mts +201 -1
  13. package/build/es/index.typings.mjs.map +1 -1
  14. package/build/es/meta.d.mts +10 -7
  15. package/build/es/meta.mjs.map +1 -1
  16. package/build/es/schemas.d.mts +54 -0
  17. package/build/es/schemas.mjs +75 -0
  18. package/build/es/schemas.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +7 -10
  20. package/build/internal/cjs/index.js.map +1 -1
  21. package/build/internal/cjs/index.typings.d.ts +25 -20
  22. package/build/internal/cjs/index.typings.js.map +1 -1
  23. package/build/internal/cjs/meta.d.ts +8 -6
  24. package/build/internal/cjs/meta.js.map +1 -1
  25. package/build/internal/cjs/schemas.d.ts +54 -0
  26. package/build/internal/cjs/schemas.js +115 -0
  27. package/build/internal/cjs/schemas.js.map +1 -0
  28. package/build/internal/es/index.d.mts +7 -10
  29. package/build/internal/es/index.mjs.map +1 -1
  30. package/build/internal/es/index.typings.d.mts +25 -20
  31. package/build/internal/es/index.typings.mjs.map +1 -1
  32. package/build/internal/es/meta.d.mts +8 -6
  33. package/build/internal/es/meta.mjs.map +1 -1
  34. package/build/internal/es/schemas.d.mts +54 -0
  35. package/build/internal/es/schemas.mjs +75 -0
  36. package/build/internal/es/schemas.mjs.map +1 -0
  37. package/package.json +9 -3
  38. package/schemas/package.json +3 -0
@@ -1,160 +1,40 @@
1
- /** A Wix documentation entry returned as a search result. */
2
- interface DocumentEntry {
3
- /**
4
- * The unique identifier for this documentation entry.
5
- * @maxLength 500
6
- */
7
- _id?: string;
8
- /** The date the document was last updated. */
9
- _updatedDate?: Date | null;
10
- /**
11
- * The title of the documentation entry.
12
- * @maxLength 1000
13
- */
14
- title?: string;
15
- /**
16
- * The full text content of the documentation entry.
17
- * @maxLength 100000
18
- */
19
- content?: string;
20
- /**
21
- * The direct URL to the documentation page for this entry.
22
- * @maxLength 2000
23
- */
24
- url?: string;
25
- /** The relevance score in the range [0, 1]. Higher means more relevant. */
26
- relevanceScore?: number;
27
- /**
28
- * The knowledge base this entry was retrieved from (e.g. "REST_METHODS_KB_ID").
29
- * @maxLength 100
30
- */
31
- kbName?: string;
32
- }
33
- /** The parameters for a SearchDocuments call. */
34
- interface SearchDocumentsRequest {
35
- /**
36
- * The search term to look up in the documentation.
37
- * @minLength 1
38
- * @maxLength 500
39
- */
40
- searchTerm: string;
41
- /**
42
- * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].
43
- * @min 1
44
- * @max 20
45
- */
46
- maximumResults?: number | null;
47
- /** The type of documentation to search. Defaults to REST if not provided. */
48
- documentType?: DocumentTypeWithLiterals;
49
- /**
50
- * Maximum number of lines to include per result content. When set, method results use
51
- * section-aware truncation; article results are truncated at this line count.
52
- * A "Read more here: <url>" hint is appended when content is truncated.
53
- * @min 1
54
- * @max 200
55
- */
56
- linesInEachResult?: number | null;
57
- }
58
- /** The type of Wix documentation to search. */
59
- declare enum DocumentType {
60
- /** Default value. Must not be used. */
61
- DOCUMENT_TYPE_UNSPECIFIED = "DOCUMENT_TYPE_UNSPECIFIED",
62
- /** Velo JavaScript APIs for Wix sites. */
63
- VELO = "VELO",
64
- /** Wix JavaScript SDK for headless and external applications. */
65
- SDK = "SDK",
66
- /** Wix REST APIs. */
67
- REST = "REST",
68
- /** Wix Design System documentation. */
69
- WDS = "WDS",
70
- /** Documentation for building Wix apps. */
71
- BUILD_APPS = "BUILD_APPS",
72
- /** Wix Headless documentation for external and headless applications. */
73
- WIX_HEADLESS = "WIX_HEADLESS",
74
- /** Wix CLI documentation. */
75
- CLI = "CLI",
76
- /** Wix business solutions and workflow documentation. */
77
- BUSINESS_SOLUTIONS = "BUSINESS_SOLUTIONS"
78
- }
79
- /** @enumType */
80
- type DocumentTypeWithLiterals = DocumentType | 'DOCUMENT_TYPE_UNSPECIFIED' | 'VELO' | 'SDK' | 'REST' | 'WDS' | 'BUILD_APPS' | 'WIX_HEADLESS' | 'CLI' | 'BUSINESS_SOLUTIONS';
81
- /** The result of a SearchDocuments call. */
82
- interface SearchDocumentsResponse {
83
- /**
84
- * The ranked list of matching documentation entries, ordered by relevance score descending.
85
- * @maxSize 100
86
- */
87
- results?: DocumentEntry[];
88
- }
89
- /** The parameters for a SearchDocumentsMarkdown call. */
90
- interface SearchDocumentsMarkdownRequest {
91
- /**
92
- * The search term to look up in the documentation.
93
- * @minLength 1
94
- * @maxLength 500
95
- */
96
- searchTerm: string;
97
- /** The type of documentation to search. Defaults to REST if not provided. */
98
- documentType?: DocumentTypeWithLiterals;
99
- /**
100
- * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].
101
- * @min 1
102
- * @max 20
103
- */
104
- maximumResults?: number | null;
105
- /**
106
- * Maximum number of lines to include per result. When set, method results use
107
- * section-aware truncation; article results are truncated at this line count.
108
- * A "Read more here: <url>" hint is appended when content is truncated.
109
- * @min 1
110
- * @max 200
111
- */
112
- linesInEachResult?: number | null;
113
- }
114
- /** The result of a SearchDocumentsMarkdown call. */
115
- interface SearchDocumentsMarkdownResponse {
116
- /**
117
- * The search results as a single markdown document. Method results are interleaved
118
- * with article results. Results are separated by a line of equal signs.
119
- * @maxLength 500000
120
- */
121
- content?: string;
122
- }
123
- interface SearchDocumentsOptions {
124
- /**
125
- * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].
126
- * @min 1
127
- * @max 20
128
- */
129
- maximumResults?: number | null;
130
- /** The type of documentation to search. Defaults to REST if not provided. */
131
- documentType?: DocumentTypeWithLiterals;
132
- /**
133
- * Maximum number of lines to include per result content. When set, method results use
134
- * section-aware truncation; article results are truncated at this line count.
135
- * A "Read more here: <url>" hint is appended when content is truncated.
136
- * @min 1
137
- * @max 200
138
- */
139
- linesInEachResult?: number | null;
140
- }
141
- interface SearchDocumentsMarkdownOptions {
142
- /** The type of documentation to search. Defaults to REST if not provided. */
143
- documentType?: DocumentTypeWithLiterals;
144
- /**
145
- * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].
146
- * @min 1
147
- * @max 20
148
- */
149
- maximumResults?: number | null;
150
- /**
151
- * Maximum number of lines to include per result. When set, method results use
152
- * section-aware truncation; article results are truncated at this line count.
153
- * A "Read more here: <url>" hint is appended when content is truncated.
154
- * @min 1
155
- * @max 200
156
- */
157
- linesInEachResult?: number | null;
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { SearchDocumentsOptions, SearchDocumentsResponse, SearchDocumentsMarkdownOptions, SearchDocumentsMarkdownResponse } from './index.typings.js';
3
+ export { DocumentEntry, DocumentType, DocumentTypeWithLiterals, SearchDocumentsMarkdownRequest, SearchDocumentsRequest } from './index.typings.js';
4
+
5
+ declare function searchDocuments$1(httpClient: HttpClient): SearchDocumentsSignature;
6
+ interface SearchDocumentsSignature {
7
+ /**
8
+ * Searches Wix documentation entries by a search term and document type.
9
+ *
10
+ * Returns a ranked list of matching documentation entries ordered by relevance
11
+ * score descending. Method results include kb_name to identify the source
12
+ * knowledge base. Each result is truncated to lines_in_each_result lines
13
+ * (defaults to 20) with contextual "read more" hints; pass a larger value
14
+ * for more content per result.
15
+ * @param - The search term to look up in the documentation.
16
+ * @returns The result of a SearchDocuments call.
17
+ */
18
+ (searchTerm: string, options?: SearchDocumentsOptions): Promise<NonNullablePaths<SearchDocumentsResponse, `results` | `results.${number}._id` | `results.${number}.title` | `results.${number}.content` | `results.${number}.url` | `results.${number}.relevanceScore` | `results.${number}.kbName`, 4>>;
19
+ }
20
+ declare function searchDocumentsMarkdown$1(httpClient: HttpClient): SearchDocumentsMarkdownSignature;
21
+ interface SearchDocumentsMarkdownSignature {
22
+ /**
23
+ * Searches Wix documentation and returns results as a single markdown string
24
+ * ready to be passed directly to an LLM.
25
+ *
26
+ * Method results are interleaved 2-by-2 with article results so both types
27
+ * always appear. Each result is truncated to lines_in_each_result lines
28
+ * (defaults to 20) with a contextual hint (method results get a schema read
29
+ * hint; article results get a "read the full article" hint). Results are
30
+ * separated by a line of equal signs.
31
+ * @param - The search term to look up in the documentation.
32
+ * @returns The result of a SearchDocumentsMarkdown call.
33
+ */
34
+ (searchTerm: string, options?: SearchDocumentsMarkdownOptions): Promise<NonNullablePaths<SearchDocumentsMarkdownResponse, `content`, 2>>;
158
35
  }
159
36
 
160
- export { type DocumentEntry, DocumentType, type DocumentTypeWithLiterals, type SearchDocumentsMarkdownOptions, type SearchDocumentsMarkdownRequest, type SearchDocumentsMarkdownResponse, type SearchDocumentsOptions, type SearchDocumentsRequest, type SearchDocumentsResponse };
37
+ declare const searchDocuments: MaybeContext<BuildRESTFunction<typeof searchDocuments$1> & typeof searchDocuments$1>;
38
+ declare const searchDocumentsMarkdown: MaybeContext<BuildRESTFunction<typeof searchDocumentsMarkdown$1> & typeof searchDocumentsMarkdown$1>;
39
+
40
+ export { SearchDocumentsMarkdownOptions, SearchDocumentsMarkdownResponse, SearchDocumentsOptions, SearchDocumentsResponse, searchDocuments, searchDocumentsMarkdown };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/igor-v1-document-entry-document-search.universal.ts","../../src/igor-v1-document-entry-document-search.http.ts","../../src/igor-v1-document-entry-document-search.public.ts","../../src/igor-v1-document-entry-document-search.context.ts"],"sourcesContent":["export * from './src/igor-v1-document-entry-document-search.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixIgorV1DocumentEntry from './igor-v1-document-entry-document-search.http.js';\n\n/** A Wix documentation entry returned as a search result. */\nexport interface DocumentEntry {\n /**\n * The unique identifier for this documentation entry.\n * @maxLength 500\n */\n _id?: string;\n /** The date the document was last updated. */\n _updatedDate?: Date | null;\n /**\n * The title of the documentation entry.\n * @maxLength 1000\n */\n title?: string;\n /**\n * The full text content of the documentation entry.\n * @maxLength 100000\n */\n content?: string;\n /**\n * The direct URL to the documentation page for this entry.\n * @maxLength 2000\n */\n url?: string;\n /** The relevance score in the range [0, 1]. Higher means more relevant. */\n relevanceScore?: number;\n /**\n * The knowledge base this entry was retrieved from (e.g. \"REST_METHODS_KB_ID\").\n * @maxLength 100\n */\n kbName?: string;\n}\n\n/** The parameters for a SearchDocuments call. */\nexport interface SearchDocumentsRequest {\n /**\n * The search term to look up in the documentation.\n * @minLength 1\n * @maxLength 500\n */\n searchTerm: string;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * Maximum number of lines to include per result content. When set, method results use\n * section-aware truncation; article results are truncated at this line count.\n * A \"Read more here: <url>\" hint is appended when content is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/** The type of Wix documentation to search. */\nexport enum DocumentType {\n /** Default value. Must not be used. */\n DOCUMENT_TYPE_UNSPECIFIED = 'DOCUMENT_TYPE_UNSPECIFIED',\n /** Velo JavaScript APIs for Wix sites. */\n VELO = 'VELO',\n /** Wix JavaScript SDK for headless and external applications. */\n SDK = 'SDK',\n /** Wix REST APIs. */\n REST = 'REST',\n /** Wix Design System documentation. */\n WDS = 'WDS',\n /** Documentation for building Wix apps. */\n BUILD_APPS = 'BUILD_APPS',\n /** Wix Headless documentation for external and headless applications. */\n WIX_HEADLESS = 'WIX_HEADLESS',\n /** Wix CLI documentation. */\n CLI = 'CLI',\n /** Wix business solutions and workflow documentation. */\n BUSINESS_SOLUTIONS = 'BUSINESS_SOLUTIONS',\n}\n\n/** @enumType */\nexport type DocumentTypeWithLiterals =\n | DocumentType\n | 'DOCUMENT_TYPE_UNSPECIFIED'\n | 'VELO'\n | 'SDK'\n | 'REST'\n | 'WDS'\n | 'BUILD_APPS'\n | 'WIX_HEADLESS'\n | 'CLI'\n | 'BUSINESS_SOLUTIONS';\n\n/** The result of a SearchDocuments call. */\nexport interface SearchDocumentsResponse {\n /**\n * The ranked list of matching documentation entries, ordered by relevance score descending.\n * @maxSize 100\n */\n results?: DocumentEntry[];\n}\n\n/** The parameters for a SearchDocumentsMarkdown call. */\nexport interface SearchDocumentsMarkdownRequest {\n /**\n * The search term to look up in the documentation.\n * @minLength 1\n * @maxLength 500\n */\n searchTerm: string;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /**\n * Maximum number of lines to include per result. When set, method results use\n * section-aware truncation; article results are truncated at this line count.\n * A \"Read more here: <url>\" hint is appended when content is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/** The result of a SearchDocumentsMarkdown call. */\nexport interface SearchDocumentsMarkdownResponse {\n /**\n * The search results as a single markdown document. Method results are interleaved\n * with article results. Results are separated by a line of equal signs.\n * @maxLength 500000\n */\n content?: string;\n}\n\n/**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Use lines_in_each_result to get truncated snippets with\n * contextual \"read more\" hints instead of full content.\n * @param searchTerm - The search term to look up in the documentation.\n * @internal\n * @documentationMaturity preview\n * @requiredField searchTerm\n * @permissionId igor:v1:document_entry:search_documents\n * @returns The result of a SearchDocuments call.\n * @fqn wix.igor.v1.DocumentSearchService.SearchDocuments\n */\nexport async function searchDocuments(\n searchTerm: string,\n options?: SearchDocumentsOptions\n): Promise<\n NonNullablePaths<\n SearchDocumentsResponse,\n | `results`\n | `results.${number}._id`\n | `results.${number}.title`\n | `results.${number}.content`\n | `results.${number}.url`\n | `results.${number}.relevanceScore`\n | `results.${number}.kbName`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n searchTerm: searchTerm,\n maximumResults: options?.maximumResults,\n documentType: options?.documentType,\n linesInEachResult: options?.linesInEachResult,\n });\n\n const reqOpts = ambassadorWixIgorV1DocumentEntry.searchDocuments(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n searchTerm: '$[0]',\n maximumResults: '$[1].maximumResults',\n documentType: '$[1].documentType',\n linesInEachResult: '$[1].linesInEachResult',\n },\n singleArgumentUnchanged: false,\n },\n ['searchTerm', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchDocumentsOptions {\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * Maximum number of lines to include per result content. When set, method results use\n * section-aware truncation; article results are truncated at this line count.\n * A \"Read more here: <url>\" hint is appended when content is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. When lines_in_each_result is set, each result is truncated\n * with a contextual hint (method results get a schema read hint; article\n * results get a \"read the full article\" hint). Results are separated by a\n * line of equal signs.\n * @param searchTerm - The search term to look up in the documentation.\n * @internal\n * @documentationMaturity preview\n * @requiredField searchTerm\n * @permissionId igor:v1:document_entry:search_documents_markdown\n * @returns The result of a SearchDocumentsMarkdown call.\n * @fqn wix.igor.v1.DocumentSearchService.SearchDocumentsMarkdown\n */\nexport async function searchDocumentsMarkdown(\n searchTerm: string,\n options?: SearchDocumentsMarkdownOptions\n): Promise<NonNullablePaths<SearchDocumentsMarkdownResponse, `content`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n searchTerm: searchTerm,\n documentType: options?.documentType,\n maximumResults: options?.maximumResults,\n linesInEachResult: options?.linesInEachResult,\n });\n\n const reqOpts =\n ambassadorWixIgorV1DocumentEntry.searchDocumentsMarkdown(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n searchTerm: '$[0]',\n documentType: '$[1].documentType',\n maximumResults: '$[1].maximumResults',\n linesInEachResult: '$[1].linesInEachResult',\n },\n singleArgumentUnchanged: false,\n },\n ['searchTerm', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchDocumentsMarkdownOptions {\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /**\n * Maximum number of lines to include per result. When set, method results use\n * section-aware truncation; article results are truncated at this line count.\n * A \"Read more here: <url>\" hint is appended when content is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n","import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixIgorV1DocumentSearchServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_igor_document-search';\n\n/**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Use lines_in_each_result to get truncated snippets with\n * contextual \"read more\" hints instead of full content.\n */\nexport function searchDocuments(payload: object): RequestOptionsFactory<any> {\n function __searchDocuments({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.igor.v1.document_entry',\n method: 'POST' as any,\n methodFqn: 'wix.igor.v1.DocumentSearchService.SearchDocuments',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixIgorV1DocumentSearchServiceUrl({\n protoPath: '/v1/docs/search',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'results.updatedDate' }],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [{ path: 'results.relevanceScore' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __searchDocuments;\n}\n\n/**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. When lines_in_each_result is set, each result is truncated\n * with a contextual hint (method results get a schema read hint; article\n * results get a \"read the full article\" hint). Results are separated by a\n * line of equal signs.\n */\nexport function searchDocumentsMarkdown(\n payload: object\n): RequestOptionsFactory<any> {\n function __searchDocumentsMarkdown({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.igor.v1.document_entry',\n method: 'POST' as any,\n methodFqn: 'wix.igor.v1.DocumentSearchService.SearchDocumentsMarkdown',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixIgorV1DocumentSearchServiceUrl({\n protoPath: '/v1/docs/search/markdown',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __searchDocumentsMarkdown;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n SearchDocumentsMarkdownOptions,\n SearchDocumentsMarkdownResponse,\n SearchDocumentsOptions,\n SearchDocumentsResponse,\n searchDocuments as universalSearchDocuments,\n searchDocumentsMarkdown as universalSearchDocumentsMarkdown,\n} from './igor-v1-document-entry-document-search.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/igor' };\n\n/** @internal */\nexport function searchDocuments(\n httpClient: HttpClient\n): SearchDocumentsSignature {\n return (searchTerm: string, options?: SearchDocumentsOptions) =>\n universalSearchDocuments(\n searchTerm,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SearchDocumentsSignature {\n /**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Use lines_in_each_result to get truncated snippets with\n * contextual \"read more\" hints instead of full content.\n * @param - The search term to look up in the documentation.\n * @returns The result of a SearchDocuments call.\n */\n (searchTerm: string, options?: SearchDocumentsOptions): Promise<\n NonNullablePaths<\n SearchDocumentsResponse,\n | `results`\n | `results.${number}._id`\n | `results.${number}.title`\n | `results.${number}.content`\n | `results.${number}.url`\n | `results.${number}.relevanceScore`\n | `results.${number}.kbName`,\n 4\n >\n >;\n}\n\n/** @internal */\nexport function searchDocumentsMarkdown(\n httpClient: HttpClient\n): SearchDocumentsMarkdownSignature {\n return (searchTerm: string, options?: SearchDocumentsMarkdownOptions) =>\n universalSearchDocumentsMarkdown(\n searchTerm,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SearchDocumentsMarkdownSignature {\n /**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. When lines_in_each_result is set, each result is truncated\n * with a contextual hint (method results get a schema read hint; article\n * results get a \"read the full article\" hint). Results are separated by a\n * line of equal signs.\n * @param - The search term to look up in the documentation.\n * @returns The result of a SearchDocumentsMarkdown call.\n */\n (searchTerm: string, options?: SearchDocumentsMarkdownOptions): Promise<\n NonNullablePaths<SearchDocumentsMarkdownResponse, `content`, 2>\n >;\n}\n\nexport {\n DocumentEntry,\n DocumentType,\n SearchDocumentsMarkdownOptions,\n SearchDocumentsMarkdownRequest,\n SearchDocumentsMarkdownResponse,\n SearchDocumentsOptions,\n SearchDocumentsRequest,\n SearchDocumentsResponse,\n} from './igor-v1-document-entry-document-search.universal.js';\n","import {\n searchDocuments as publicSearchDocuments,\n searchDocumentsMarkdown as publicSearchDocumentsMarkdown,\n} from './igor-v1-document-entry-document-search.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\n/** @internal */\nexport const searchDocuments: MaybeContext<\n BuildRESTFunction<typeof publicSearchDocuments> & typeof publicSearchDocuments\n> = /*#__PURE__*/ createRESTModule(publicSearchDocuments);\n/** @internal */\nexport const searchDocumentsMarkdown: MaybeContext<\n BuildRESTFunction<typeof publicSearchDocumentsMarkdown> &\n typeof publicSearchDocumentsMarkdown\n> = /*#__PURE__*/ createRESTModule(publicSearchDocumentsMarkdown);\n\nexport { DocumentType } from './igor-v1-document-entry-document-search.universal.js';\nexport {\n DocumentEntry,\n SearchDocumentsRequest,\n SearchDocumentsResponse,\n SearchDocumentsMarkdownRequest,\n SearchDocumentsMarkdownResponse,\n SearchDocumentsOptions,\n SearchDocumentsMarkdownOptions,\n} from './igor-v1-document-entry-document-search.universal.js';\nexport { DocumentTypeWithLiterals } from './igor-v1-document-entry-document-search.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,yCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAUd,SAAS,gBAAgB,SAA6C;AAC3E,WAAS,kBAAkB,EAAE,KAAK,GAAQ;AACxC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,yCAAyC;AAAA,QAC5C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,MACN,mBAAmB,CAACC,iBAClB,uCAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO,CAAC,EAAE,MAAM,sBA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YAAoB,YAC1BA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC1DA,IAAAC,uBAAiC;AAI1B,IAAMC,mBAEK,2DAAiBA,gBAAqB;AAEjD,IAAMC,2BAGK,2DAAiBA,wBAA6B;","names":["searchDocuments","searchDocumentsMarkdown","payload","DocumentType","searchDocuments","sdkTransformError","searchDocumentsMarkdown","searchDocuments","searchDocumentsMarkdown","import_rest_modules","searchDocuments","searchDocumentsMarkdown"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/igor-v1-document-entry-document-search.universal.ts","../../src/igor-v1-document-entry-document-search.http.ts","../../src/igor-v1-document-entry-document-search.public.ts","../../src/igor-v1-document-entry-document-search.context.ts"],"sourcesContent":["export * from './src/igor-v1-document-entry-document-search.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixIgorV1DocumentEntry from './igor-v1-document-entry-document-search.http.js';\n\n/** A Wix documentation entry returned as a search result. */\nexport interface DocumentEntry {\n /**\n * The unique identifier for this documentation entry.\n * @maxLength 500\n */\n _id?: string;\n /** The date the document was last updated. */\n _updatedDate?: Date | null;\n /**\n * The title of the documentation entry.\n * @maxLength 1000\n */\n title?: string;\n /**\n * The full text content of the documentation entry.\n * @maxLength 100000\n */\n content?: string;\n /**\n * The direct URL to the documentation page for this entry.\n * @maxLength 2000\n */\n url?: string;\n /** The relevance score in the range [0, 1]. Higher means more relevant. */\n relevanceScore?: number;\n /**\n * The knowledge base this entry was retrieved from (e.g. \"REST_METHODS_KB_ID\").\n * @maxLength 100\n */\n kbName?: string;\n}\n\n/** The parameters for a SearchDocuments call. */\nexport interface SearchDocumentsRequest {\n /**\n * The search term to look up in the documentation.\n * @minLength 1\n * @maxLength 500\n */\n searchTerm: string;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * Maximum number of lines to include per result content. Defaults to 20.\n * Method results use section-aware truncation; article results are truncated\n * at this line count. A \"Read more here: <url>\" hint is appended when content\n * is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/** The type of Wix documentation to search. */\nexport enum DocumentType {\n /** Default value. Must not be used. */\n DOCUMENT_TYPE_UNSPECIFIED = 'DOCUMENT_TYPE_UNSPECIFIED',\n /** Velo JavaScript APIs for Wix sites. */\n VELO = 'VELO',\n /** Wix JavaScript SDK for headless and external applications. */\n SDK = 'SDK',\n /** Wix REST APIs. */\n REST = 'REST',\n /** Wix Design System documentation. */\n WDS = 'WDS',\n /** Documentation for building Wix apps. */\n BUILD_APPS = 'BUILD_APPS',\n /** Wix Headless documentation for external and headless applications. */\n WIX_HEADLESS = 'WIX_HEADLESS',\n /** Wix CLI documentation. */\n CLI = 'CLI',\n /** Wix business solutions and workflow documentation. */\n BUSINESS_SOLUTIONS = 'BUSINESS_SOLUTIONS',\n}\n\n/** @enumType */\nexport type DocumentTypeWithLiterals =\n | DocumentType\n | 'DOCUMENT_TYPE_UNSPECIFIED'\n | 'VELO'\n | 'SDK'\n | 'REST'\n | 'WDS'\n | 'BUILD_APPS'\n | 'WIX_HEADLESS'\n | 'CLI'\n | 'BUSINESS_SOLUTIONS';\n\n/** The result of a SearchDocuments call. */\nexport interface SearchDocumentsResponse {\n /**\n * The ranked list of matching documentation entries, ordered by relevance score descending.\n * @maxSize 100\n */\n results?: DocumentEntry[];\n}\n\n/** The parameters for a SearchDocumentsMarkdown call. */\nexport interface SearchDocumentsMarkdownRequest {\n /**\n * The search term to look up in the documentation.\n * @minLength 1\n * @maxLength 500\n */\n searchTerm: string;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /**\n * Maximum number of lines to include per result. Defaults to 20. Method\n * results use section-aware truncation; article results are truncated at this\n * line count. A \"Read more here: <url>\" hint is appended when content is\n * truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/** The result of a SearchDocumentsMarkdown call. */\nexport interface SearchDocumentsMarkdownResponse {\n /**\n * The search results as a single markdown document. Method results are interleaved\n * with article results. Results are separated by a line of equal signs.\n * @maxLength 500000\n */\n content?: string;\n}\n\n/**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with contextual \"read more\" hints; pass a larger value\n * for more content per result.\n * @param searchTerm - The search term to look up in the documentation.\n * @public\n * @documentationMaturity preview\n * @requiredField searchTerm\n * @permissionId igor:v1:document_entry:search_documents\n * @returns The result of a SearchDocuments call.\n * @fqn wix.igor.v1.DocumentSearchService.SearchDocuments\n */\nexport async function searchDocuments(\n searchTerm: string,\n options?: SearchDocumentsOptions\n): Promise<\n NonNullablePaths<\n SearchDocumentsResponse,\n | `results`\n | `results.${number}._id`\n | `results.${number}.title`\n | `results.${number}.content`\n | `results.${number}.url`\n | `results.${number}.relevanceScore`\n | `results.${number}.kbName`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n searchTerm: searchTerm,\n maximumResults: options?.maximumResults,\n documentType: options?.documentType,\n linesInEachResult: options?.linesInEachResult,\n });\n\n const reqOpts = ambassadorWixIgorV1DocumentEntry.searchDocuments(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n searchTerm: '$[0]',\n maximumResults: '$[1].maximumResults',\n documentType: '$[1].documentType',\n linesInEachResult: '$[1].linesInEachResult',\n },\n singleArgumentUnchanged: false,\n },\n ['searchTerm', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchDocumentsOptions {\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * Maximum number of lines to include per result content. Defaults to 20.\n * Method results use section-aware truncation; article results are truncated\n * at this line count. A \"Read more here: <url>\" hint is appended when content\n * is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with a contextual hint (method results get a schema read\n * hint; article results get a \"read the full article\" hint). Results are\n * separated by a line of equal signs.\n * @param searchTerm - The search term to look up in the documentation.\n * @public\n * @documentationMaturity preview\n * @requiredField searchTerm\n * @permissionId igor:v1:document_entry:search_documents_markdown\n * @returns The result of a SearchDocumentsMarkdown call.\n * @fqn wix.igor.v1.DocumentSearchService.SearchDocumentsMarkdown\n */\nexport async function searchDocumentsMarkdown(\n searchTerm: string,\n options?: SearchDocumentsMarkdownOptions\n): Promise<NonNullablePaths<SearchDocumentsMarkdownResponse, `content`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n searchTerm: searchTerm,\n documentType: options?.documentType,\n maximumResults: options?.maximumResults,\n linesInEachResult: options?.linesInEachResult,\n });\n\n const reqOpts =\n ambassadorWixIgorV1DocumentEntry.searchDocumentsMarkdown(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n searchTerm: '$[0]',\n documentType: '$[1].documentType',\n maximumResults: '$[1].maximumResults',\n linesInEachResult: '$[1].linesInEachResult',\n },\n singleArgumentUnchanged: false,\n },\n ['searchTerm', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchDocumentsMarkdownOptions {\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /**\n * Maximum number of lines to include per result. Defaults to 20. Method\n * results use section-aware truncation; article results are truncated at this\n * line count. A \"Read more here: <url>\" hint is appended when content is\n * truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n","import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixIgorV1DocumentSearchServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_igor_document-search';\n\n/**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with contextual \"read more\" hints; pass a larger value\n * for more content per result.\n */\nexport function searchDocuments(payload: object): RequestOptionsFactory<any> {\n function __searchDocuments({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.igor.v1.document_entry',\n method: 'POST' as any,\n methodFqn: 'wix.igor.v1.DocumentSearchService.SearchDocuments',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixIgorV1DocumentSearchServiceUrl({\n protoPath: '/v1/docs/search',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'results.updatedDate' }],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [{ path: 'results.relevanceScore' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __searchDocuments;\n}\n\n/**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with a contextual hint (method results get a schema read\n * hint; article results get a \"read the full article\" hint). Results are\n * separated by a line of equal signs.\n */\nexport function searchDocumentsMarkdown(\n payload: object\n): RequestOptionsFactory<any> {\n function __searchDocumentsMarkdown({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.igor.v1.document_entry',\n method: 'POST' as any,\n methodFqn: 'wix.igor.v1.DocumentSearchService.SearchDocumentsMarkdown',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixIgorV1DocumentSearchServiceUrl({\n protoPath: '/v1/docs/search/markdown',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __searchDocumentsMarkdown;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n SearchDocumentsMarkdownOptions,\n SearchDocumentsMarkdownResponse,\n SearchDocumentsOptions,\n SearchDocumentsResponse,\n searchDocuments as universalSearchDocuments,\n searchDocumentsMarkdown as universalSearchDocumentsMarkdown,\n} from './igor-v1-document-entry-document-search.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/igor' };\n\nexport function searchDocuments(\n httpClient: HttpClient\n): SearchDocumentsSignature {\n return (searchTerm: string, options?: SearchDocumentsOptions) =>\n universalSearchDocuments(\n searchTerm,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SearchDocumentsSignature {\n /**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with contextual \"read more\" hints; pass a larger value\n * for more content per result.\n * @param - The search term to look up in the documentation.\n * @returns The result of a SearchDocuments call.\n */\n (searchTerm: string, options?: SearchDocumentsOptions): Promise<\n NonNullablePaths<\n SearchDocumentsResponse,\n | `results`\n | `results.${number}._id`\n | `results.${number}.title`\n | `results.${number}.content`\n | `results.${number}.url`\n | `results.${number}.relevanceScore`\n | `results.${number}.kbName`,\n 4\n >\n >;\n}\n\nexport function searchDocumentsMarkdown(\n httpClient: HttpClient\n): SearchDocumentsMarkdownSignature {\n return (searchTerm: string, options?: SearchDocumentsMarkdownOptions) =>\n universalSearchDocumentsMarkdown(\n searchTerm,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SearchDocumentsMarkdownSignature {\n /**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with a contextual hint (method results get a schema read\n * hint; article results get a \"read the full article\" hint). Results are\n * separated by a line of equal signs.\n * @param - The search term to look up in the documentation.\n * @returns The result of a SearchDocumentsMarkdown call.\n */\n (searchTerm: string, options?: SearchDocumentsMarkdownOptions): Promise<\n NonNullablePaths<SearchDocumentsMarkdownResponse, `content`, 2>\n >;\n}\n\nexport {\n DocumentEntry,\n DocumentType,\n SearchDocumentsMarkdownOptions,\n SearchDocumentsMarkdownRequest,\n SearchDocumentsMarkdownResponse,\n SearchDocumentsOptions,\n SearchDocumentsRequest,\n SearchDocumentsResponse,\n} from './igor-v1-document-entry-document-search.universal.js';\n","import {\n searchDocuments as publicSearchDocuments,\n searchDocumentsMarkdown as publicSearchDocumentsMarkdown,\n} from './igor-v1-document-entry-document-search.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const searchDocuments: MaybeContext<\n BuildRESTFunction<typeof publicSearchDocuments> & typeof publicSearchDocuments\n> = /*#__PURE__*/ createRESTModule(publicSearchDocuments);\nexport const searchDocumentsMarkdown: MaybeContext<\n BuildRESTFunction<typeof publicSearchDocumentsMarkdown> &\n typeof publicSearchDocumentsMarkdown\n> = /*#__PURE__*/ createRESTModule(publicSearchDocumentsMarkdown);\n\nexport { DocumentType } from './igor-v1-document-entry-document-search.universal.js';\nexport {\n DocumentEntry,\n SearchDocumentsRequest,\n SearchDocumentsResponse,\n SearchDocumentsMarkdownRequest,\n SearchDocumentsMarkdownResponse,\n SearchDocumentsOptions,\n SearchDocumentsMarkdownOptions,\n} from './igor-v1-document-entry-document-search.universal.js';\nexport { DocumentTypeWithLiterals } from './igor-v1-document-entry-document-search.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,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,UAC6B,wBAAwB,OAAO;AAElE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,YAAY;AAAA,UACZ,cAAc;AAAA,UACd,gBAAgB;AAAA,UAChB,mBAAmB;AAAA,QACrB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,cAAc,SAAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASE,iBACd,YAC0B;AAC1B,SAAO,CAAC,YAAoB,YAC1BA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AA6BO,SAASC,yBACd,YACkC;AAClC,SAAO,CAAC,YAAoB,YAC1BA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACzDA,IAAAC,uBAAiC;AAG1B,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,2BAGK,2DAAiBA,wBAA6B;","names":["searchDocuments","searchDocumentsMarkdown","payload","DocumentType","searchDocuments","sdkTransformError","searchDocumentsMarkdown","searchDocuments","searchDocumentsMarkdown","import_rest_modules","searchDocuments","searchDocumentsMarkdown"]}
@@ -1 +1,201 @@
1
- export { DocumentEntry, DocumentType, DocumentTypeWithLiterals, SearchDocumentsMarkdownOptions, SearchDocumentsMarkdownRequest, SearchDocumentsMarkdownResponse, SearchDocumentsOptions, SearchDocumentsRequest, SearchDocumentsResponse } from './index.js';
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ /** A Wix documentation entry returned as a search result. */
4
+ interface DocumentEntry {
5
+ /**
6
+ * The unique identifier for this documentation entry.
7
+ * @maxLength 500
8
+ */
9
+ _id?: string;
10
+ /** The date the document was last updated. */
11
+ _updatedDate?: Date | null;
12
+ /**
13
+ * The title of the documentation entry.
14
+ * @maxLength 1000
15
+ */
16
+ title?: string;
17
+ /**
18
+ * The full text content of the documentation entry.
19
+ * @maxLength 100000
20
+ */
21
+ content?: string;
22
+ /**
23
+ * The direct URL to the documentation page for this entry.
24
+ * @maxLength 2000
25
+ */
26
+ url?: string;
27
+ /** The relevance score in the range [0, 1]. Higher means more relevant. */
28
+ relevanceScore?: number;
29
+ /**
30
+ * The knowledge base this entry was retrieved from (e.g. "REST_METHODS_KB_ID").
31
+ * @maxLength 100
32
+ */
33
+ kbName?: string;
34
+ }
35
+ /** The parameters for a SearchDocuments call. */
36
+ interface SearchDocumentsRequest {
37
+ /**
38
+ * The search term to look up in the documentation.
39
+ * @minLength 1
40
+ * @maxLength 500
41
+ */
42
+ searchTerm: string;
43
+ /**
44
+ * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].
45
+ * @min 1
46
+ * @max 20
47
+ */
48
+ maximumResults?: number | null;
49
+ /** The type of documentation to search. Defaults to REST if not provided. */
50
+ documentType?: DocumentTypeWithLiterals;
51
+ /**
52
+ * Maximum number of lines to include per result content. Defaults to 20.
53
+ * Method results use section-aware truncation; article results are truncated
54
+ * at this line count. A "Read more here: <url>" hint is appended when content
55
+ * is truncated.
56
+ * @min 1
57
+ * @max 200
58
+ */
59
+ linesInEachResult?: number | null;
60
+ }
61
+ /** The type of Wix documentation to search. */
62
+ declare enum DocumentType {
63
+ /** Default value. Must not be used. */
64
+ DOCUMENT_TYPE_UNSPECIFIED = "DOCUMENT_TYPE_UNSPECIFIED",
65
+ /** Velo JavaScript APIs for Wix sites. */
66
+ VELO = "VELO",
67
+ /** Wix JavaScript SDK for headless and external applications. */
68
+ SDK = "SDK",
69
+ /** Wix REST APIs. */
70
+ REST = "REST",
71
+ /** Wix Design System documentation. */
72
+ WDS = "WDS",
73
+ /** Documentation for building Wix apps. */
74
+ BUILD_APPS = "BUILD_APPS",
75
+ /** Wix Headless documentation for external and headless applications. */
76
+ WIX_HEADLESS = "WIX_HEADLESS",
77
+ /** Wix CLI documentation. */
78
+ CLI = "CLI",
79
+ /** Wix business solutions and workflow documentation. */
80
+ BUSINESS_SOLUTIONS = "BUSINESS_SOLUTIONS"
81
+ }
82
+ /** @enumType */
83
+ type DocumentTypeWithLiterals = DocumentType | 'DOCUMENT_TYPE_UNSPECIFIED' | 'VELO' | 'SDK' | 'REST' | 'WDS' | 'BUILD_APPS' | 'WIX_HEADLESS' | 'CLI' | 'BUSINESS_SOLUTIONS';
84
+ /** The result of a SearchDocuments call. */
85
+ interface SearchDocumentsResponse {
86
+ /**
87
+ * The ranked list of matching documentation entries, ordered by relevance score descending.
88
+ * @maxSize 100
89
+ */
90
+ results?: DocumentEntry[];
91
+ }
92
+ /** The parameters for a SearchDocumentsMarkdown call. */
93
+ interface SearchDocumentsMarkdownRequest {
94
+ /**
95
+ * The search term to look up in the documentation.
96
+ * @minLength 1
97
+ * @maxLength 500
98
+ */
99
+ searchTerm: string;
100
+ /** The type of documentation to search. Defaults to REST if not provided. */
101
+ documentType?: DocumentTypeWithLiterals;
102
+ /**
103
+ * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].
104
+ * @min 1
105
+ * @max 20
106
+ */
107
+ maximumResults?: number | null;
108
+ /**
109
+ * Maximum number of lines to include per result. Defaults to 20. Method
110
+ * results use section-aware truncation; article results are truncated at this
111
+ * line count. A "Read more here: <url>" hint is appended when content is
112
+ * truncated.
113
+ * @min 1
114
+ * @max 200
115
+ */
116
+ linesInEachResult?: number | null;
117
+ }
118
+ /** The result of a SearchDocumentsMarkdown call. */
119
+ interface SearchDocumentsMarkdownResponse {
120
+ /**
121
+ * The search results as a single markdown document. Method results are interleaved
122
+ * with article results. Results are separated by a line of equal signs.
123
+ * @maxLength 500000
124
+ */
125
+ content?: string;
126
+ }
127
+ /**
128
+ * Searches Wix documentation entries by a search term and document type.
129
+ *
130
+ * Returns a ranked list of matching documentation entries ordered by relevance
131
+ * score descending. Method results include kb_name to identify the source
132
+ * knowledge base. Each result is truncated to lines_in_each_result lines
133
+ * (defaults to 20) with contextual "read more" hints; pass a larger value
134
+ * for more content per result.
135
+ * @param searchTerm - The search term to look up in the documentation.
136
+ * @public
137
+ * @documentationMaturity preview
138
+ * @requiredField searchTerm
139
+ * @permissionId igor:v1:document_entry:search_documents
140
+ * @returns The result of a SearchDocuments call.
141
+ * @fqn wix.igor.v1.DocumentSearchService.SearchDocuments
142
+ */
143
+ declare function searchDocuments(searchTerm: string, options?: SearchDocumentsOptions): Promise<NonNullablePaths<SearchDocumentsResponse, `results` | `results.${number}._id` | `results.${number}.title` | `results.${number}.content` | `results.${number}.url` | `results.${number}.relevanceScore` | `results.${number}.kbName`, 4>>;
144
+ interface SearchDocumentsOptions {
145
+ /**
146
+ * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].
147
+ * @min 1
148
+ * @max 20
149
+ */
150
+ maximumResults?: number | null;
151
+ /** The type of documentation to search. Defaults to REST if not provided. */
152
+ documentType?: DocumentTypeWithLiterals;
153
+ /**
154
+ * Maximum number of lines to include per result content. Defaults to 20.
155
+ * Method results use section-aware truncation; article results are truncated
156
+ * at this line count. A "Read more here: <url>" hint is appended when content
157
+ * is truncated.
158
+ * @min 1
159
+ * @max 200
160
+ */
161
+ linesInEachResult?: number | null;
162
+ }
163
+ /**
164
+ * Searches Wix documentation and returns results as a single markdown string
165
+ * ready to be passed directly to an LLM.
166
+ *
167
+ * Method results are interleaved 2-by-2 with article results so both types
168
+ * always appear. Each result is truncated to lines_in_each_result lines
169
+ * (defaults to 20) with a contextual hint (method results get a schema read
170
+ * hint; article results get a "read the full article" hint). Results are
171
+ * separated by a line of equal signs.
172
+ * @param searchTerm - The search term to look up in the documentation.
173
+ * @public
174
+ * @documentationMaturity preview
175
+ * @requiredField searchTerm
176
+ * @permissionId igor:v1:document_entry:search_documents_markdown
177
+ * @returns The result of a SearchDocumentsMarkdown call.
178
+ * @fqn wix.igor.v1.DocumentSearchService.SearchDocumentsMarkdown
179
+ */
180
+ declare function searchDocumentsMarkdown(searchTerm: string, options?: SearchDocumentsMarkdownOptions): Promise<NonNullablePaths<SearchDocumentsMarkdownResponse, `content`, 2>>;
181
+ interface SearchDocumentsMarkdownOptions {
182
+ /** The type of documentation to search. Defaults to REST if not provided. */
183
+ documentType?: DocumentTypeWithLiterals;
184
+ /**
185
+ * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].
186
+ * @min 1
187
+ * @max 20
188
+ */
189
+ maximumResults?: number | null;
190
+ /**
191
+ * Maximum number of lines to include per result. Defaults to 20. Method
192
+ * results use section-aware truncation; article results are truncated at this
193
+ * line count. A "Read more here: <url>" hint is appended when content is
194
+ * truncated.
195
+ * @min 1
196
+ * @max 200
197
+ */
198
+ linesInEachResult?: number | null;
199
+ }
200
+
201
+ export { type DocumentEntry, DocumentType, type DocumentTypeWithLiterals, type SearchDocumentsMarkdownOptions, type SearchDocumentsMarkdownRequest, type SearchDocumentsMarkdownResponse, type SearchDocumentsOptions, type SearchDocumentsRequest, type SearchDocumentsResponse, searchDocuments, searchDocumentsMarkdown };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/igor-v1-document-entry-document-search.universal.ts","../../src/igor-v1-document-entry-document-search.http.ts"],"sourcesContent":["export * from './src/igor-v1-document-entry-document-search.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixIgorV1DocumentEntry from './igor-v1-document-entry-document-search.http.js';\n\n/** A Wix documentation entry returned as a search result. */\nexport interface DocumentEntry {\n /**\n * The unique identifier for this documentation entry.\n * @maxLength 500\n */\n _id?: string;\n /** The date the document was last updated. */\n _updatedDate?: Date | null;\n /**\n * The title of the documentation entry.\n * @maxLength 1000\n */\n title?: string;\n /**\n * The full text content of the documentation entry.\n * @maxLength 100000\n */\n content?: string;\n /**\n * The direct URL to the documentation page for this entry.\n * @maxLength 2000\n */\n url?: string;\n /** The relevance score in the range [0, 1]. Higher means more relevant. */\n relevanceScore?: number;\n /**\n * The knowledge base this entry was retrieved from (e.g. \"REST_METHODS_KB_ID\").\n * @maxLength 100\n */\n kbName?: string;\n}\n\n/** The parameters for a SearchDocuments call. */\nexport interface SearchDocumentsRequest {\n /**\n * The search term to look up in the documentation.\n * @minLength 1\n * @maxLength 500\n */\n searchTerm: string;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * Maximum number of lines to include per result content. When set, method results use\n * section-aware truncation; article results are truncated at this line count.\n * A \"Read more here: <url>\" hint is appended when content is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/** The type of Wix documentation to search. */\nexport enum DocumentType {\n /** Default value. Must not be used. */\n DOCUMENT_TYPE_UNSPECIFIED = 'DOCUMENT_TYPE_UNSPECIFIED',\n /** Velo JavaScript APIs for Wix sites. */\n VELO = 'VELO',\n /** Wix JavaScript SDK for headless and external applications. */\n SDK = 'SDK',\n /** Wix REST APIs. */\n REST = 'REST',\n /** Wix Design System documentation. */\n WDS = 'WDS',\n /** Documentation for building Wix apps. */\n BUILD_APPS = 'BUILD_APPS',\n /** Wix Headless documentation for external and headless applications. */\n WIX_HEADLESS = 'WIX_HEADLESS',\n /** Wix CLI documentation. */\n CLI = 'CLI',\n /** Wix business solutions and workflow documentation. */\n BUSINESS_SOLUTIONS = 'BUSINESS_SOLUTIONS',\n}\n\n/** @enumType */\nexport type DocumentTypeWithLiterals =\n | DocumentType\n | 'DOCUMENT_TYPE_UNSPECIFIED'\n | 'VELO'\n | 'SDK'\n | 'REST'\n | 'WDS'\n | 'BUILD_APPS'\n | 'WIX_HEADLESS'\n | 'CLI'\n | 'BUSINESS_SOLUTIONS';\n\n/** The result of a SearchDocuments call. */\nexport interface SearchDocumentsResponse {\n /**\n * The ranked list of matching documentation entries, ordered by relevance score descending.\n * @maxSize 100\n */\n results?: DocumentEntry[];\n}\n\n/** The parameters for a SearchDocumentsMarkdown call. */\nexport interface SearchDocumentsMarkdownRequest {\n /**\n * The search term to look up in the documentation.\n * @minLength 1\n * @maxLength 500\n */\n searchTerm: string;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /**\n * Maximum number of lines to include per result. When set, method results use\n * section-aware truncation; article results are truncated at this line count.\n * A \"Read more here: <url>\" hint is appended when content is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/** The result of a SearchDocumentsMarkdown call. */\nexport interface SearchDocumentsMarkdownResponse {\n /**\n * The search results as a single markdown document. Method results are interleaved\n * with article results. Results are separated by a line of equal signs.\n * @maxLength 500000\n */\n content?: string;\n}\n\n/**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Use lines_in_each_result to get truncated snippets with\n * contextual \"read more\" hints instead of full content.\n * @param searchTerm - The search term to look up in the documentation.\n * @internal\n * @documentationMaturity preview\n * @requiredField searchTerm\n * @permissionId igor:v1:document_entry:search_documents\n * @returns The result of a SearchDocuments call.\n * @fqn wix.igor.v1.DocumentSearchService.SearchDocuments\n */\nexport async function searchDocuments(\n searchTerm: string,\n options?: SearchDocumentsOptions\n): Promise<\n NonNullablePaths<\n SearchDocumentsResponse,\n | `results`\n | `results.${number}._id`\n | `results.${number}.title`\n | `results.${number}.content`\n | `results.${number}.url`\n | `results.${number}.relevanceScore`\n | `results.${number}.kbName`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n searchTerm: searchTerm,\n maximumResults: options?.maximumResults,\n documentType: options?.documentType,\n linesInEachResult: options?.linesInEachResult,\n });\n\n const reqOpts = ambassadorWixIgorV1DocumentEntry.searchDocuments(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n searchTerm: '$[0]',\n maximumResults: '$[1].maximumResults',\n documentType: '$[1].documentType',\n linesInEachResult: '$[1].linesInEachResult',\n },\n singleArgumentUnchanged: false,\n },\n ['searchTerm', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchDocumentsOptions {\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * Maximum number of lines to include per result content. When set, method results use\n * section-aware truncation; article results are truncated at this line count.\n * A \"Read more here: <url>\" hint is appended when content is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. When lines_in_each_result is set, each result is truncated\n * with a contextual hint (method results get a schema read hint; article\n * results get a \"read the full article\" hint). Results are separated by a\n * line of equal signs.\n * @param searchTerm - The search term to look up in the documentation.\n * @internal\n * @documentationMaturity preview\n * @requiredField searchTerm\n * @permissionId igor:v1:document_entry:search_documents_markdown\n * @returns The result of a SearchDocumentsMarkdown call.\n * @fqn wix.igor.v1.DocumentSearchService.SearchDocumentsMarkdown\n */\nexport async function searchDocumentsMarkdown(\n searchTerm: string,\n options?: SearchDocumentsMarkdownOptions\n): Promise<NonNullablePaths<SearchDocumentsMarkdownResponse, `content`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n searchTerm: searchTerm,\n documentType: options?.documentType,\n maximumResults: options?.maximumResults,\n linesInEachResult: options?.linesInEachResult,\n });\n\n const reqOpts =\n ambassadorWixIgorV1DocumentEntry.searchDocumentsMarkdown(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n searchTerm: '$[0]',\n documentType: '$[1].documentType',\n maximumResults: '$[1].maximumResults',\n linesInEachResult: '$[1].linesInEachResult',\n },\n singleArgumentUnchanged: false,\n },\n ['searchTerm', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchDocumentsMarkdownOptions {\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /**\n * Maximum number of lines to include per result. When set, method results use\n * section-aware truncation; article results are truncated at this line count.\n * A \"Read more here: <url>\" hint is appended when content is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n","import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixIgorV1DocumentSearchServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_igor_document-search';\n\n/**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Use lines_in_each_result to get truncated snippets with\n * contextual \"read more\" hints instead of full content.\n */\nexport function searchDocuments(payload: object): RequestOptionsFactory<any> {\n function __searchDocuments({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.igor.v1.document_entry',\n method: 'POST' as any,\n methodFqn: 'wix.igor.v1.DocumentSearchService.SearchDocuments',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixIgorV1DocumentSearchServiceUrl({\n protoPath: '/v1/docs/search',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'results.updatedDate' }],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [{ path: 'results.relevanceScore' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __searchDocuments;\n}\n\n/**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. When lines_in_each_result is set, each result is truncated\n * with a contextual hint (method results get a schema read hint; article\n * results get a \"read the full article\" hint). Results are separated by a\n * line of equal signs.\n */\nexport function searchDocumentsMarkdown(\n payload: object\n): RequestOptionsFactory<any> {\n function __searchDocumentsMarkdown({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.igor.v1.document_entry',\n method: 'POST' as any,\n methodFqn: 'wix.igor.v1.DocumentSearchService.SearchDocumentsMarkdown',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixIgorV1DocumentSearchServiceUrl({\n protoPath: '/v1/docs/search/markdown',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __searchDocumentsMarkdown;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,yCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAUd,SAAS,gBAAgB,SAA6C;AAC3E,WAAS,kBAAkB,EAAE,KAAK,GAAQ;AACxC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,yCAAyC;AAAA,QAC5C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,MACN,mBAAmB,CAACC,iBAClB,uCAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO,CAAC,EAAE,MAAM,sBAA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EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,YAAY;AAAA,UACZ,gBAAgB;AAAA,UAChB,cAAc;AAAA,UACd,mBAAmB;AAAA,QACrB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,cAAc,SAAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAsCA,eAAsBC,yBACpB,YACA,SAC0E;AAE1E,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,cAAc,SAAS;AAAA,IACvB,gBAAgB,SAAS;AAAA,IACzB,mBAAmB,SAAS;AAAA,EAC9B,CAAC;AAED,QAAM,UAC6B,wBAAwB,OAAO;AAElE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,YAAY;AAAA,UACZ,cAAc;AAAA,UACd,gBAAgB;AAAA,UAChB,mBAAmB;AAAA,QACrB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,cAAc,SAAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["searchDocuments","searchDocumentsMarkdown","payload","DocumentType","searchDocuments","sdkTransformError","searchDocumentsMarkdown"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/igor-v1-document-entry-document-search.universal.ts","../../src/igor-v1-document-entry-document-search.http.ts"],"sourcesContent":["export * from './src/igor-v1-document-entry-document-search.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixIgorV1DocumentEntry from './igor-v1-document-entry-document-search.http.js';\n\n/** A Wix documentation entry returned as a search result. */\nexport interface DocumentEntry {\n /**\n * The unique identifier for this documentation entry.\n * @maxLength 500\n */\n _id?: string;\n /** The date the document was last updated. */\n _updatedDate?: Date | null;\n /**\n * The title of the documentation entry.\n * @maxLength 1000\n */\n title?: string;\n /**\n * The full text content of the documentation entry.\n * @maxLength 100000\n */\n content?: string;\n /**\n * The direct URL to the documentation page for this entry.\n * @maxLength 2000\n */\n url?: string;\n /** The relevance score in the range [0, 1]. Higher means more relevant. */\n relevanceScore?: number;\n /**\n * The knowledge base this entry was retrieved from (e.g. \"REST_METHODS_KB_ID\").\n * @maxLength 100\n */\n kbName?: string;\n}\n\n/** The parameters for a SearchDocuments call. */\nexport interface SearchDocumentsRequest {\n /**\n * The search term to look up in the documentation.\n * @minLength 1\n * @maxLength 500\n */\n searchTerm: string;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * Maximum number of lines to include per result content. Defaults to 20.\n * Method results use section-aware truncation; article results are truncated\n * at this line count. A \"Read more here: <url>\" hint is appended when content\n * is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/** The type of Wix documentation to search. */\nexport enum DocumentType {\n /** Default value. Must not be used. */\n DOCUMENT_TYPE_UNSPECIFIED = 'DOCUMENT_TYPE_UNSPECIFIED',\n /** Velo JavaScript APIs for Wix sites. */\n VELO = 'VELO',\n /** Wix JavaScript SDK for headless and external applications. */\n SDK = 'SDK',\n /** Wix REST APIs. */\n REST = 'REST',\n /** Wix Design System documentation. */\n WDS = 'WDS',\n /** Documentation for building Wix apps. */\n BUILD_APPS = 'BUILD_APPS',\n /** Wix Headless documentation for external and headless applications. */\n WIX_HEADLESS = 'WIX_HEADLESS',\n /** Wix CLI documentation. */\n CLI = 'CLI',\n /** Wix business solutions and workflow documentation. */\n BUSINESS_SOLUTIONS = 'BUSINESS_SOLUTIONS',\n}\n\n/** @enumType */\nexport type DocumentTypeWithLiterals =\n | DocumentType\n | 'DOCUMENT_TYPE_UNSPECIFIED'\n | 'VELO'\n | 'SDK'\n | 'REST'\n | 'WDS'\n | 'BUILD_APPS'\n | 'WIX_HEADLESS'\n | 'CLI'\n | 'BUSINESS_SOLUTIONS';\n\n/** The result of a SearchDocuments call. */\nexport interface SearchDocumentsResponse {\n /**\n * The ranked list of matching documentation entries, ordered by relevance score descending.\n * @maxSize 100\n */\n results?: DocumentEntry[];\n}\n\n/** The parameters for a SearchDocumentsMarkdown call. */\nexport interface SearchDocumentsMarkdownRequest {\n /**\n * The search term to look up in the documentation.\n * @minLength 1\n * @maxLength 500\n */\n searchTerm: string;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /**\n * Maximum number of lines to include per result. Defaults to 20. Method\n * results use section-aware truncation; article results are truncated at this\n * line count. A \"Read more here: <url>\" hint is appended when content is\n * truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/** The result of a SearchDocumentsMarkdown call. */\nexport interface SearchDocumentsMarkdownResponse {\n /**\n * The search results as a single markdown document. Method results are interleaved\n * with article results. Results are separated by a line of equal signs.\n * @maxLength 500000\n */\n content?: string;\n}\n\n/**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with contextual \"read more\" hints; pass a larger value\n * for more content per result.\n * @param searchTerm - The search term to look up in the documentation.\n * @public\n * @documentationMaturity preview\n * @requiredField searchTerm\n * @permissionId igor:v1:document_entry:search_documents\n * @returns The result of a SearchDocuments call.\n * @fqn wix.igor.v1.DocumentSearchService.SearchDocuments\n */\nexport async function searchDocuments(\n searchTerm: string,\n options?: SearchDocumentsOptions\n): Promise<\n NonNullablePaths<\n SearchDocumentsResponse,\n | `results`\n | `results.${number}._id`\n | `results.${number}.title`\n | `results.${number}.content`\n | `results.${number}.url`\n | `results.${number}.relevanceScore`\n | `results.${number}.kbName`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n searchTerm: searchTerm,\n maximumResults: options?.maximumResults,\n documentType: options?.documentType,\n linesInEachResult: options?.linesInEachResult,\n });\n\n const reqOpts = ambassadorWixIgorV1DocumentEntry.searchDocuments(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n searchTerm: '$[0]',\n maximumResults: '$[1].maximumResults',\n documentType: '$[1].documentType',\n linesInEachResult: '$[1].linesInEachResult',\n },\n singleArgumentUnchanged: false,\n },\n ['searchTerm', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchDocumentsOptions {\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * Maximum number of lines to include per result content. Defaults to 20.\n * Method results use section-aware truncation; article results are truncated\n * at this line count. A \"Read more here: <url>\" hint is appended when content\n * is truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n\n/**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with a contextual hint (method results get a schema read\n * hint; article results get a \"read the full article\" hint). Results are\n * separated by a line of equal signs.\n * @param searchTerm - The search term to look up in the documentation.\n * @public\n * @documentationMaturity preview\n * @requiredField searchTerm\n * @permissionId igor:v1:document_entry:search_documents_markdown\n * @returns The result of a SearchDocumentsMarkdown call.\n * @fqn wix.igor.v1.DocumentSearchService.SearchDocumentsMarkdown\n */\nexport async function searchDocumentsMarkdown(\n searchTerm: string,\n options?: SearchDocumentsMarkdownOptions\n): Promise<NonNullablePaths<SearchDocumentsMarkdownResponse, `content`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n searchTerm: searchTerm,\n documentType: options?.documentType,\n maximumResults: options?.maximumResults,\n linesInEachResult: options?.linesInEachResult,\n });\n\n const reqOpts =\n ambassadorWixIgorV1DocumentEntry.searchDocumentsMarkdown(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n searchTerm: '$[0]',\n documentType: '$[1].documentType',\n maximumResults: '$[1].maximumResults',\n linesInEachResult: '$[1].linesInEachResult',\n },\n singleArgumentUnchanged: false,\n },\n ['searchTerm', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchDocumentsMarkdownOptions {\n /** The type of documentation to search. Defaults to REST if not provided. */\n documentType?: DocumentTypeWithLiterals;\n /**\n * The maximum number of results to return. Defaults to 15. Valid range: [1, 20].\n * @min 1\n * @max 20\n */\n maximumResults?: number | null;\n /**\n * Maximum number of lines to include per result. Defaults to 20. Method\n * results use section-aware truncation; article results are truncated at this\n * line count. A \"Read more here: <url>\" hint is appended when content is\n * truncated.\n * @min 1\n * @max 200\n */\n linesInEachResult?: number | null;\n}\n","import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixIgorV1DocumentSearchServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_igor_document-search';\n\n/**\n * Searches Wix documentation entries by a search term and document type.\n *\n * Returns a ranked list of matching documentation entries ordered by relevance\n * score descending. Method results include kb_name to identify the source\n * knowledge base. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with contextual \"read more\" hints; pass a larger value\n * for more content per result.\n */\nexport function searchDocuments(payload: object): RequestOptionsFactory<any> {\n function __searchDocuments({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.igor.v1.document_entry',\n method: 'POST' as any,\n methodFqn: 'wix.igor.v1.DocumentSearchService.SearchDocuments',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixIgorV1DocumentSearchServiceUrl({\n protoPath: '/v1/docs/search',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'results.updatedDate' }],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [{ path: 'results.relevanceScore' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __searchDocuments;\n}\n\n/**\n * Searches Wix documentation and returns results as a single markdown string\n * ready to be passed directly to an LLM.\n *\n * Method results are interleaved 2-by-2 with article results so both types\n * always appear. Each result is truncated to lines_in_each_result lines\n * (defaults to 20) with a contextual hint (method results get a schema read\n * hint; article results get a \"read the full article\" hint). Results are\n * separated by a line of equal signs.\n */\nexport function searchDocumentsMarkdown(\n payload: object\n): RequestOptionsFactory<any> {\n function __searchDocumentsMarkdown({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.igor.v1.document_entry',\n method: 'POST' as any,\n methodFqn: 'wix.igor.v1.DocumentSearchService.SearchDocumentsMarkdown',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixIgorV1DocumentSearchServiceUrl({\n protoPath: '/v1/docs/search/markdown',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __searchDocumentsMarkdown;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,yCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM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AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,YAAY;AAAA,UACZ,cAAc;AAAA,UACd,gBAAgB;AAAA,UAChB,mBAAmB;AAAA,QACrB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,cAAc,SAAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["searchDocuments","searchDocumentsMarkdown","payload","DocumentType","searchDocuments","sdkTransformError","searchDocumentsMarkdown"]}
@@ -1,4 +1,5 @@
1
- import { SearchDocumentsRequest as SearchDocumentsRequest$1, SearchDocumentsResponse as SearchDocumentsResponse$1, SearchDocumentsMarkdownRequest as SearchDocumentsMarkdownRequest$1, SearchDocumentsMarkdownResponse as SearchDocumentsMarkdownResponse$1 } from './index.js';
1
+ import { SearchDocumentsRequest as SearchDocumentsRequest$1, SearchDocumentsResponse as SearchDocumentsResponse$1, SearchDocumentsMarkdownRequest as SearchDocumentsMarkdownRequest$1, SearchDocumentsMarkdownResponse as SearchDocumentsMarkdownResponse$1 } from './index.typings.js';
2
+ import '@wix/sdk-types';
2
3
 
3
4
  /** A Wix documentation entry returned as a search result. */
4
5
  interface DocumentEntry {
@@ -49,9 +50,10 @@ interface SearchDocumentsRequest {
49
50
  /** The type of documentation to search. Defaults to REST if not provided. */
50
51
  documentType?: DocumentTypeWithLiterals;
51
52
  /**
52
- * Maximum number of lines to include per result content. When set, method results use
53
- * section-aware truncation; article results are truncated at this line count.
54
- * A "Read more here: <url>" hint is appended when content is truncated.
53
+ * Maximum number of lines to include per result content. Defaults to 20.
54
+ * Method results use section-aware truncation; article results are truncated
55
+ * at this line count. A "Read more here: <url>" hint is appended when content
56
+ * is truncated.
55
57
  * @min 1
56
58
  * @max 200
57
59
  */
@@ -105,9 +107,10 @@ interface SearchDocumentsMarkdownRequest {
105
107
  */
106
108
  maximumResults?: number | null;
107
109
  /**
108
- * Maximum number of lines to include per result. When set, method results use
109
- * section-aware truncation; article results are truncated at this line count.
110
- * A "Read more here: <url>" hint is appended when content is truncated.
110
+ * Maximum number of lines to include per result. Defaults to 20. Method
111
+ * results use section-aware truncation; article results are truncated at this
112
+ * line count. A "Read more here: <url>" hint is appended when content is
113
+ * truncated.
111
114
  * @min 1
112
115
  * @max 200
113
116
  */