@wix/auto_sdk_igor_document-search 1.0.2 → 1.0.3

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 (45) hide show
  1. package/build/cjs/index.js +1 -0
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/index.typings.d.ts +4 -2
  4. package/build/cjs/index.typings.js +1 -0
  5. package/build/cjs/index.typings.js.map +1 -1
  6. package/build/cjs/meta.d.ts +4 -2
  7. package/build/cjs/meta.js +1 -0
  8. package/build/cjs/meta.js.map +1 -1
  9. package/build/cjs/schemas.d.ts +2 -0
  10. package/build/cjs/schemas.js +8 -6
  11. package/build/cjs/schemas.js.map +1 -1
  12. package/build/es/index.mjs +1 -0
  13. package/build/es/index.mjs.map +1 -1
  14. package/build/es/index.typings.d.mts +4 -2
  15. package/build/es/index.typings.mjs +1 -0
  16. package/build/es/index.typings.mjs.map +1 -1
  17. package/build/es/meta.d.mts +4 -2
  18. package/build/es/meta.mjs +1 -0
  19. package/build/es/meta.mjs.map +1 -1
  20. package/build/es/schemas.d.mts +2 -0
  21. package/build/es/schemas.mjs +8 -6
  22. package/build/es/schemas.mjs.map +1 -1
  23. package/build/internal/cjs/index.js +1 -0
  24. package/build/internal/cjs/index.js.map +1 -1
  25. package/build/internal/cjs/index.typings.d.ts +4 -2
  26. package/build/internal/cjs/index.typings.js +1 -0
  27. package/build/internal/cjs/index.typings.js.map +1 -1
  28. package/build/internal/cjs/meta.d.ts +4 -2
  29. package/build/internal/cjs/meta.js +1 -0
  30. package/build/internal/cjs/meta.js.map +1 -1
  31. package/build/internal/cjs/schemas.d.ts +2 -0
  32. package/build/internal/cjs/schemas.js +8 -6
  33. package/build/internal/cjs/schemas.js.map +1 -1
  34. package/build/internal/es/index.mjs +1 -0
  35. package/build/internal/es/index.mjs.map +1 -1
  36. package/build/internal/es/index.typings.d.mts +4 -2
  37. package/build/internal/es/index.typings.mjs +1 -0
  38. package/build/internal/es/index.typings.mjs.map +1 -1
  39. package/build/internal/es/meta.d.mts +4 -2
  40. package/build/internal/es/meta.mjs +1 -0
  41. package/build/internal/es/meta.mjs.map +1 -1
  42. package/build/internal/es/schemas.d.mts +2 -0
  43. package/build/internal/es/schemas.mjs +8 -6
  44. package/build/internal/es/schemas.mjs.map +1 -1
  45. package/package.json +3 -3
@@ -129,6 +129,7 @@ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
129
129
  DocumentType2["WIX_HEADLESS"] = "WIX_HEADLESS";
130
130
  DocumentType2["CLI"] = "CLI";
131
131
  DocumentType2["BUSINESS_SOLUTIONS"] = "BUSINESS_SOLUTIONS";
132
+ DocumentType2["OVERVIEW"] = "OVERVIEW";
132
133
  return DocumentType2;
133
134
  })(DocumentType || {});
134
135
  async function searchDocuments2(searchTerm, options) {
@@ -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. 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 'bo._base_domain_': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wix-bo.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,0BAA2B;AAI3B,SAAS,yCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;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;AAWd,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,uCAA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EA,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
+ {"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 /** High-level Wix platform and business overview documentation. */\n OVERVIEW = 'OVERVIEW',\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 | 'OVERVIEW';\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 'bo._base_domain_': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wix-bo.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,0BAA2B;AAI3B,SAAS,yCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;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;AAWd,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,OAA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J;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"]}
@@ -77,10 +77,12 @@ declare enum DocumentType {
77
77
  /** Wix CLI documentation. */
78
78
  CLI = "CLI",
79
79
  /** Wix business solutions and workflow documentation. */
80
- BUSINESS_SOLUTIONS = "BUSINESS_SOLUTIONS"
80
+ BUSINESS_SOLUTIONS = "BUSINESS_SOLUTIONS",
81
+ /** High-level Wix platform and business overview documentation. */
82
+ OVERVIEW = "OVERVIEW"
81
83
  }
82
84
  /** @enumType */
83
- type DocumentTypeWithLiterals = DocumentType | 'DOCUMENT_TYPE_UNSPECIFIED' | 'VELO' | 'SDK' | 'REST' | 'WDS' | 'BUILD_APPS' | 'WIX_HEADLESS' | 'CLI' | 'BUSINESS_SOLUTIONS';
85
+ type DocumentTypeWithLiterals = DocumentType | 'DOCUMENT_TYPE_UNSPECIFIED' | 'VELO' | 'SDK' | 'REST' | 'WDS' | 'BUILD_APPS' | 'WIX_HEADLESS' | 'CLI' | 'BUSINESS_SOLUTIONS' | 'OVERVIEW';
84
86
  /** The result of a SearchDocuments call. */
85
87
  interface SearchDocumentsResponse {
86
88
  /**
@@ -129,6 +129,7 @@ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
129
129
  DocumentType2["WIX_HEADLESS"] = "WIX_HEADLESS";
130
130
  DocumentType2["CLI"] = "CLI";
131
131
  DocumentType2["BUSINESS_SOLUTIONS"] = "BUSINESS_SOLUTIONS";
132
+ DocumentType2["OVERVIEW"] = "OVERVIEW";
132
133
  return DocumentType2;
133
134
  })(DocumentType || {});
134
135
  async function searchDocuments2(searchTerm, options) {
@@ -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. 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 'bo._base_domain_': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wix-bo.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":";;;;;;;;;;;;;;;;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AAgB;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;AAuCA,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 /** High-level Wix platform and business overview documentation. */\n OVERVIEW = 'OVERVIEW',\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 | 'OVERVIEW';\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 'bo._base_domain_': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wix-bo.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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U,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"]}
@@ -78,10 +78,12 @@ declare enum DocumentType {
78
78
  /** Wix CLI documentation. */
79
79
  CLI = "CLI",
80
80
  /** Wix business solutions and workflow documentation. */
81
- BUSINESS_SOLUTIONS = "BUSINESS_SOLUTIONS"
81
+ BUSINESS_SOLUTIONS = "BUSINESS_SOLUTIONS",
82
+ /** High-level Wix platform and business overview documentation. */
83
+ OVERVIEW = "OVERVIEW"
82
84
  }
83
85
  /** @enumType */
84
- type DocumentTypeWithLiterals = DocumentType | 'DOCUMENT_TYPE_UNSPECIFIED' | 'VELO' | 'SDK' | 'REST' | 'WDS' | 'BUILD_APPS' | 'WIX_HEADLESS' | 'CLI' | 'BUSINESS_SOLUTIONS';
86
+ type DocumentTypeWithLiterals = DocumentType | 'DOCUMENT_TYPE_UNSPECIFIED' | 'VELO' | 'SDK' | 'REST' | 'WDS' | 'BUILD_APPS' | 'WIX_HEADLESS' | 'CLI' | 'BUSINESS_SOLUTIONS' | 'OVERVIEW';
85
87
  /** The result of a SearchDocuments call. */
86
88
  interface SearchDocumentsResponse {
87
89
  /**
package/build/cjs/meta.js CHANGED
@@ -125,6 +125,7 @@ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
125
125
  DocumentType2["WIX_HEADLESS"] = "WIX_HEADLESS";
126
126
  DocumentType2["CLI"] = "CLI";
127
127
  DocumentType2["BUSINESS_SOLUTIONS"] = "BUSINESS_SOLUTIONS";
128
+ DocumentType2["OVERVIEW"] = "OVERVIEW";
128
129
  return DocumentType2;
129
130
  })(DocumentType || {});
130
131
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../meta.ts","../../src/igor-v1-document-entry-document-search.http.ts","../../src/igor-v1-document-entry-document-search.types.ts","../../src/igor-v1-document-entry-document-search.meta.ts"],"sourcesContent":["export * from './src/igor-v1-document-entry-document-search.meta.js';\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 'bo._base_domain_': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wix-bo.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","/** 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","import * as ambassadorWixIgorV1DocumentEntry from './igor-v1-document-entry-document-search.http.js';\nimport * as ambassadorWixIgorV1DocumentEntryTypes from './igor-v1-document-entry-document-search.types.js';\nimport * as ambassadorWixIgorV1DocumentEntryUniversalTypes from './igor-v1-document-entry-document-search.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function searchDocuments(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixIgorV1DocumentEntryUniversalTypes.SearchDocumentsRequest,\n ambassadorWixIgorV1DocumentEntryTypes.SearchDocumentsRequest,\n ambassadorWixIgorV1DocumentEntryUniversalTypes.SearchDocumentsResponse,\n ambassadorWixIgorV1DocumentEntryTypes.SearchDocumentsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixIgorV1DocumentEntry.searchDocuments(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/docs/search',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function searchDocumentsMarkdown(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixIgorV1DocumentEntryUniversalTypes.SearchDocumentsMarkdownRequest,\n ambassadorWixIgorV1DocumentEntryTypes.SearchDocumentsMarkdownRequest,\n ambassadorWixIgorV1DocumentEntryUniversalTypes.SearchDocumentsMarkdownResponse,\n ambassadorWixIgorV1DocumentEntryTypes.SearchDocumentsMarkdownResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixIgorV1DocumentEntry.searchDocumentsMarkdown(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/docs/search/markdown',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n DocumentEntry as DocumentEntryOriginal,\n SearchDocumentsRequest as SearchDocumentsRequestOriginal,\n DocumentType as DocumentTypeOriginal,\n DocumentTypeWithLiterals as DocumentTypeWithLiteralsOriginal,\n SearchDocumentsResponse as SearchDocumentsResponseOriginal,\n SearchDocumentsMarkdownRequest as SearchDocumentsMarkdownRequestOriginal,\n SearchDocumentsMarkdownResponse as SearchDocumentsMarkdownResponseOriginal,\n} from './igor-v1-document-entry-document-search.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,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,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;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;AAWd,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;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B;AACF;AAEO,SAASC,2BAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6B,wBAAwB,OAAO;AAElE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["searchDocuments","searchDocumentsMarkdown","payload","DocumentType","searchDocuments","searchDocumentsMarkdown"]}
1
+ {"version":3,"sources":["../../meta.ts","../../src/igor-v1-document-entry-document-search.http.ts","../../src/igor-v1-document-entry-document-search.types.ts","../../src/igor-v1-document-entry-document-search.meta.ts"],"sourcesContent":["export * from './src/igor-v1-document-entry-document-search.meta.js';\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 'bo._base_domain_': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wix-bo.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","/** 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 /** High-level Wix platform and business overview documentation. */\n OVERVIEW = 'OVERVIEW',\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 | 'OVERVIEW';\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","import * as ambassadorWixIgorV1DocumentEntry from './igor-v1-document-entry-document-search.http.js';\nimport * as ambassadorWixIgorV1DocumentEntryTypes from './igor-v1-document-entry-document-search.types.js';\nimport * as ambassadorWixIgorV1DocumentEntryUniversalTypes from './igor-v1-document-entry-document-search.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function searchDocuments(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixIgorV1DocumentEntryUniversalTypes.SearchDocumentsRequest,\n ambassadorWixIgorV1DocumentEntryTypes.SearchDocumentsRequest,\n ambassadorWixIgorV1DocumentEntryUniversalTypes.SearchDocumentsResponse,\n ambassadorWixIgorV1DocumentEntryTypes.SearchDocumentsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixIgorV1DocumentEntry.searchDocuments(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/docs/search',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function searchDocumentsMarkdown(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixIgorV1DocumentEntryUniversalTypes.SearchDocumentsMarkdownRequest,\n ambassadorWixIgorV1DocumentEntryTypes.SearchDocumentsMarkdownRequest,\n ambassadorWixIgorV1DocumentEntryUniversalTypes.SearchDocumentsMarkdownResponse,\n ambassadorWixIgorV1DocumentEntryTypes.SearchDocumentsMarkdownResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixIgorV1DocumentEntry.searchDocumentsMarkdown(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/docs/search/markdown',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n DocumentEntry as DocumentEntryOriginal,\n SearchDocumentsRequest as SearchDocumentsRequestOriginal,\n DocumentType as DocumentTypeOriginal,\n DocumentTypeWithLiterals as DocumentTypeWithLiteralsOriginal,\n SearchDocumentsResponse as SearchDocumentsResponseOriginal,\n SearchDocumentsMarkdownRequest as SearchDocumentsMarkdownRequestOriginal,\n SearchDocumentsMarkdownResponse as SearchDocumentsMarkdownResponseOriginal,\n} from './igor-v1-document-entry-document-search.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,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,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;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;AAWd,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,uCA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ACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,2BAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6B,wBAAwB,OAAO;AAElE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["searchDocuments","searchDocumentsMarkdown","payload","DocumentType","searchDocuments","searchDocumentsMarkdown"]}
@@ -14,6 +14,7 @@ declare const SearchDocumentsRequest: z.ZodObject<{
14
14
  WIX_HEADLESS: "WIX_HEADLESS";
15
15
  CLI: "CLI";
16
16
  BUSINESS_SOLUTIONS: "BUSINESS_SOLUTIONS";
17
+ OVERVIEW: "OVERVIEW";
17
18
  }>>;
18
19
  linesInEachResult: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
19
20
  }, z.core.$strip>>;
@@ -42,6 +43,7 @@ declare const SearchDocumentsMarkdownRequest: z.ZodObject<{
42
43
  WIX_HEADLESS: "WIX_HEADLESS";
43
44
  CLI: "CLI";
44
45
  BUSINESS_SOLUTIONS: "BUSINESS_SOLUTIONS";
46
+ OVERVIEW: "OVERVIEW";
45
47
  }>>;
46
48
  maximumResults: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
47
49
  linesInEachResult: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
@@ -39,7 +39,7 @@ module.exports = __toCommonJS(schemas_exports);
39
39
 
40
40
  // src/igor-v1-document-entry-document-search.schemas.ts
41
41
  var z = __toESM(require("zod"));
42
- var SearchDocumentsRequest = z.object({
42
+ var SearchDocumentsRequest = /* @__PURE__ */ z.object({
43
43
  searchTerm: z.string().describe("The search term to look up in the documentation.").min(1).max(500),
44
44
  options: z.object({
45
45
  maximumResults: z.number().int().describe(
@@ -54,14 +54,15 @@ var SearchDocumentsRequest = z.object({
54
54
  "BUILD_APPS",
55
55
  "WIX_HEADLESS",
56
56
  "CLI",
57
- "BUSINESS_SOLUTIONS"
57
+ "BUSINESS_SOLUTIONS",
58
+ "OVERVIEW"
58
59
  ]).optional(),
59
60
  linesInEachResult: z.number().int().describe(
60
61
  'Maximum number of lines to include per result content. Defaults to 20.\nMethod results use section-aware truncation; article results are truncated\nat this line count. A "Read more here: <url>" hint is appended when content\nis truncated.'
61
62
  ).min(1).max(200).optional().nullable()
62
63
  }).optional()
63
64
  });
64
- var SearchDocumentsResponse = z.object({
65
+ var SearchDocumentsResponse = /* @__PURE__ */ z.object({
65
66
  results: z.array(
66
67
  z.object({
67
68
  _id: z.string().describe("The unique identifier for this documentation entry.").max(500).optional(),
@@ -78,7 +79,7 @@ var SearchDocumentsResponse = z.object({
78
79
  })
79
80
  ).max(100).optional()
80
81
  });
81
- var SearchDocumentsMarkdownRequest = z.object({
82
+ var SearchDocumentsMarkdownRequest = /* @__PURE__ */ z.object({
82
83
  searchTerm: z.string().describe("The search term to look up in the documentation.").min(1).max(500),
83
84
  options: z.object({
84
85
  documentType: z.enum([
@@ -90,7 +91,8 @@ var SearchDocumentsMarkdownRequest = z.object({
90
91
  "BUILD_APPS",
91
92
  "WIX_HEADLESS",
92
93
  "CLI",
93
- "BUSINESS_SOLUTIONS"
94
+ "BUSINESS_SOLUTIONS",
95
+ "OVERVIEW"
94
96
  ]).optional(),
95
97
  maximumResults: z.number().int().describe(
96
98
  "The maximum number of results to return. Defaults to 15. Valid range: [1, 20]."
@@ -100,7 +102,7 @@ var SearchDocumentsMarkdownRequest = z.object({
100
102
  ).min(1).max(200).optional().nullable()
101
103
  }).optional()
102
104
  });
103
- var SearchDocumentsMarkdownResponse = z.object({
105
+ var SearchDocumentsMarkdownResponse = /* @__PURE__ */ z.object({
104
106
  content: z.string().describe(
105
107
  "The search results as a single markdown document. Method results are interleaved\nwith article results. Results are separated by a line of equal signs."
106
108
  ).max(5e5).optional()
@@ -1 +1 @@
1
- {"version":3,"sources":["../../schemas.ts","../../src/igor-v1-document-entry-document-search.schemas.ts"],"sourcesContent":["export * from './src/igor-v1-document-entry-document-search.schemas.js';\n","import * as z from 'zod';\n\nexport const SearchDocumentsRequest = z.object({\n searchTerm: z\n .string()\n .describe('The search term to look up in the documentation.')\n .min(1)\n .max(500),\n options: z\n .object({\n maximumResults: z\n .number()\n .int()\n .describe(\n 'The maximum number of results to return. Defaults to 15. Valid range: [1, 20].'\n )\n .min(1)\n .max(20)\n .optional()\n .nullable(),\n documentType: z\n .enum([\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 .optional(),\n linesInEachResult: z\n .number()\n .int()\n .describe(\n 'Maximum number of lines to include per result content. Defaults to 20.\\nMethod results use section-aware truncation; article results are truncated\\nat this line count. A \"Read more here: <url>\" hint is appended when content\\nis truncated.'\n )\n .min(1)\n .max(200)\n .optional()\n .nullable(),\n })\n .optional(),\n});\nexport const SearchDocumentsResponse = z.object({\n results: z\n .array(\n z.object({\n _id: z\n .string()\n .describe('The unique identifier for this documentation entry.')\n .max(500)\n .optional(),\n _updatedDate: z\n .date()\n .describe('The date the document was last updated.')\n .optional()\n .nullable(),\n title: z\n .string()\n .describe('The title of the documentation entry.')\n .max(1000)\n .optional(),\n content: z\n .string()\n .describe('The full text content of the documentation entry.')\n .max(100000)\n .optional(),\n url: z\n .string()\n .describe('The direct URL to the documentation page for this entry.')\n .max(2000)\n .optional(),\n relevanceScore: z\n .number()\n .describe(\n 'The relevance score in the range [0, 1]. Higher means more relevant.'\n )\n .optional(),\n kbName: z\n .string()\n .describe(\n 'The knowledge base this entry was retrieved from (e.g. \"REST_METHODS_KB_ID\").'\n )\n .max(100)\n .optional(),\n })\n )\n .max(100)\n .optional(),\n});\nexport const SearchDocumentsMarkdownRequest = z.object({\n searchTerm: z\n .string()\n .describe('The search term to look up in the documentation.')\n .min(1)\n .max(500),\n options: z\n .object({\n documentType: z\n .enum([\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 .optional(),\n maximumResults: z\n .number()\n .int()\n .describe(\n 'The maximum number of results to return. Defaults to 15. Valid range: [1, 20].'\n )\n .min(1)\n .max(20)\n .optional()\n .nullable(),\n linesInEachResult: z\n .number()\n .int()\n .describe(\n 'Maximum number of lines to include per result. Defaults to 20. Method\\nresults use section-aware truncation; article results are truncated at this\\nline count. A \"Read more here: <url>\" hint is appended when content is\\ntruncated.'\n )\n .min(1)\n .max(200)\n .optional()\n .nullable(),\n })\n .optional(),\n});\nexport const SearchDocumentsMarkdownResponse = z.object({\n content: z\n .string()\n .describe(\n 'The search results as a single markdown document. Method results are interleaved\\nwith article results. Results are separated by a line of equal signs.'\n )\n .max(500000)\n .optional(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,yBAA2B,SAAO;AAAA,EAC7C,YACG,SAAO,EACP,SAAS,kDAAkD,EAC3D,IAAI,CAAC,EACL,IAAI,GAAG;AAAA,EACV,SACG,SAAO;AAAA,IACN,gBACG,SAAO,EACP,IAAI,EACJ;AAAA,MACC;AAAA,IACF,EACC,IAAI,CAAC,EACL,IAAI,EAAE,EACN,SAAS,EACT,SAAS;AAAA,IACZ,cACG,OAAK;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,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J;AAAA,MACC;AAAA,IACF,EACC,IAAI,CAAC,EACL,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,EACd,CAAC,EACA,SAAS;AACd,CAAC;AACM,IAAM,kCAAoC,SAAO;AAAA,EACtD,SACG,SAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,IAAI,GAAM,EACV,SAAS;AACd,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../schemas.ts","../../src/igor-v1-document-entry-document-search.schemas.ts"],"sourcesContent":["export * from './src/igor-v1-document-entry-document-search.schemas.js';\n","import * as z from 'zod';\n\nexport const SearchDocumentsRequest = /*#__PURE__*/ z.object({\n searchTerm: z\n .string()\n .describe('The search term to look up in the documentation.')\n .min(1)\n .max(500),\n options: z\n .object({\n maximumResults: z\n .number()\n .int()\n .describe(\n 'The maximum number of results to return. Defaults to 15. Valid range: [1, 20].'\n )\n .min(1)\n .max(20)\n .optional()\n .nullable(),\n documentType: z\n .enum([\n 'DOCUMENT_TYPE_UNSPECIFIED',\n 'VELO',\n 'SDK',\n 'REST',\n 'WDS',\n 'BUILD_APPS',\n 'WIX_HEADLESS',\n 'CLI',\n 'BUSINESS_SOLUTIONS',\n 'OVERVIEW',\n ])\n .optional(),\n linesInEachResult: z\n .number()\n .int()\n .describe(\n 'Maximum number of lines to include per result content. Defaults to 20.\\nMethod results use section-aware truncation; article results are truncated\\nat this line count. A \"Read more here: <url>\" hint is appended when content\\nis truncated.'\n )\n .min(1)\n .max(200)\n .optional()\n .nullable(),\n })\n .optional(),\n});\nexport const SearchDocumentsResponse = /*#__PURE__*/ z.object({\n results: z\n .array(\n z.object({\n _id: z\n .string()\n .describe('The unique identifier for this documentation entry.')\n .max(500)\n .optional(),\n _updatedDate: z\n .date()\n .describe('The date the document was last updated.')\n .optional()\n .nullable(),\n title: z\n .string()\n .describe('The title of the documentation entry.')\n .max(1000)\n .optional(),\n content: z\n .string()\n .describe('The full text content of the documentation entry.')\n .max(100000)\n .optional(),\n url: z\n .string()\n .describe('The direct URL to the documentation page for this entry.')\n .max(2000)\n .optional(),\n relevanceScore: z\n .number()\n .describe(\n 'The relevance score in the range [0, 1]. Higher means more relevant.'\n )\n .optional(),\n kbName: z\n .string()\n .describe(\n 'The knowledge base this entry was retrieved from (e.g. \"REST_METHODS_KB_ID\").'\n )\n .max(100)\n .optional(),\n })\n )\n .max(100)\n .optional(),\n});\nexport const SearchDocumentsMarkdownRequest = /*#__PURE__*/ z.object({\n searchTerm: z\n .string()\n .describe('The search term to look up in the documentation.')\n .min(1)\n .max(500),\n options: z\n .object({\n documentType: z\n .enum([\n 'DOCUMENT_TYPE_UNSPECIFIED',\n 'VELO',\n 'SDK',\n 'REST',\n 'WDS',\n 'BUILD_APPS',\n 'WIX_HEADLESS',\n 'CLI',\n 'BUSINESS_SOLUTIONS',\n 'OVERVIEW',\n ])\n .optional(),\n maximumResults: z\n .number()\n .int()\n .describe(\n 'The maximum number of results to return. Defaults to 15. Valid range: [1, 20].'\n )\n .min(1)\n .max(20)\n .optional()\n .nullable(),\n linesInEachResult: z\n .number()\n .int()\n .describe(\n 'Maximum number of lines to include per result. Defaults to 20. Method\\nresults use section-aware truncation; article results are truncated at this\\nline count. A \"Read more here: <url>\" hint is appended when content is\\ntruncated.'\n )\n .min(1)\n .max(200)\n .optional()\n .nullable(),\n })\n .optional(),\n});\nexport const SearchDocumentsMarkdownResponse = /*#__PURE__*/ z.object({\n content: z\n .string()\n .describe(\n 'The search results as a single markdown document. Method results are interleaved\\nwith article results. Results are separated by a line of equal signs.'\n )\n .max(500000)\n .optional(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,yBAAuC,gBAAE,SAAO;AAAA,EAC3D,YACG,SAAO,EACP,SAAS,kDAAkD,EAC3D,IAAI,CAAC,EACL,IAAI,GAAG;AAAA,EACV,SACG,SAAO;AAAA,IACN,gBACG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,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC,EACA,SAAS;AAAA,IACZ,gBACG,SAAO,EACP,IAAI,EACJ;AAAA,MACC;AAAA,IACF,EACC,IAAI,CAAC,EACL,IAAI,EAAE,EACN,SAAS,EACT,SAAS;AAAA,IACZ,mBACG,SAAO,EACP,IAAI,EACJ;AAAA,MACC;AAAA,IACF,EACC,IAAI,CAAC,EACL,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,EACd,CAAC,EACA,SAAS;AACd,CAAC;AACM,IAAM,kCAAgD,gBAAE,SAAO;AAAA,EACpE,SACG,SAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,IAAI,GAAM,EACV,SAAS;AACd,CAAC;","names":[]}
@@ -104,6 +104,7 @@ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
104
104
  DocumentType2["WIX_HEADLESS"] = "WIX_HEADLESS";
105
105
  DocumentType2["CLI"] = "CLI";
106
106
  DocumentType2["BUSINESS_SOLUTIONS"] = "BUSINESS_SOLUTIONS";
107
+ DocumentType2["OVERVIEW"] = "OVERVIEW";
107
108
  return DocumentType2;
108
109
  })(DocumentType || {});
109
110
  async function searchDocuments2(searchTerm, options) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../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":["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 'bo._base_domain_': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wix-bo.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,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,yCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAWd,SAAS,gBAAgB,SAA6C;AAC3E,WAAS,kBAAkB,EAAE,KAAK,GAAQ;AACxC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR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MAC3B;AAAA,MACA,CAAC,cAAc,SAAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASC,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,SAAS,wBAAwB;AAG1B,IAAMC,mBAEK,iCAAiBA,gBAAqB;AACjD,IAAMC,2BAGK,iCAAiBA,wBAA6B;","names":["payload","DocumentType","searchDocuments","searchDocumentsMarkdown","searchDocuments","searchDocumentsMarkdown","searchDocuments","searchDocumentsMarkdown"]}
1
+ {"version":3,"sources":["../../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":["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 /** High-level Wix platform and business overview documentation. */\n OVERVIEW = 'OVERVIEW',\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 | 'OVERVIEW';\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 'bo._base_domain_': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/mcp-docs-search/v1',\n destPath: '',\n },\n ],\n 'wix-bo.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,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,yCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAWd,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;AAA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A;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,SAAS,wBAAwB;AAG1B,IAAMC,mBAEK,iCAAiBA,gBAAqB;AACjD,IAAMC,2BAGK,iCAAiBA,wBAA6B;","names":["payload","DocumentType","searchDocuments","searchDocumentsMarkdown","searchDocuments","searchDocumentsMarkdown","searchDocuments","searchDocumentsMarkdown"]}
@@ -77,10 +77,12 @@ declare enum DocumentType {
77
77
  /** Wix CLI documentation. */
78
78
  CLI = "CLI",
79
79
  /** Wix business solutions and workflow documentation. */
80
- BUSINESS_SOLUTIONS = "BUSINESS_SOLUTIONS"
80
+ BUSINESS_SOLUTIONS = "BUSINESS_SOLUTIONS",
81
+ /** High-level Wix platform and business overview documentation. */
82
+ OVERVIEW = "OVERVIEW"
81
83
  }
82
84
  /** @enumType */
83
- type DocumentTypeWithLiterals = DocumentType | 'DOCUMENT_TYPE_UNSPECIFIED' | 'VELO' | 'SDK' | 'REST' | 'WDS' | 'BUILD_APPS' | 'WIX_HEADLESS' | 'CLI' | 'BUSINESS_SOLUTIONS';
85
+ type DocumentTypeWithLiterals = DocumentType | 'DOCUMENT_TYPE_UNSPECIFIED' | 'VELO' | 'SDK' | 'REST' | 'WDS' | 'BUILD_APPS' | 'WIX_HEADLESS' | 'CLI' | 'BUSINESS_SOLUTIONS' | 'OVERVIEW';
84
86
  /** The result of a SearchDocuments call. */
85
87
  interface SearchDocumentsResponse {
86
88
  /**
@@ -104,6 +104,7 @@ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
104
104
  DocumentType2["WIX_HEADLESS"] = "WIX_HEADLESS";
105
105
  DocumentType2["CLI"] = "CLI";
106
106
  DocumentType2["BUSINESS_SOLUTIONS"] = "BUSINESS_SOLUTIONS";
107
+ DocumentType2["OVERVIEW"] = "OVERVIEW";
107
108
  return DocumentType2;
108
109
  })(DocumentType || {});
109
110
  async function searchDocuments2(searchTerm, options) {