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