@qontext/n8n-nodes-qontext 1.1.0 → 1.2.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/README.md +72 -13
- package/dist/nodes/Qontext/actions/search/fields.d.ts +11 -0
- package/dist/nodes/Qontext/actions/search/fields.js +107 -0
- package/dist/nodes/Qontext/actions/search/fields.js.map +1 -0
- package/dist/nodes/Qontext/actions/search/search.resource.js +23 -29
- package/dist/nodes/Qontext/actions/search/search.resource.js.map +1 -1
- package/dist/nodes/Qontext/actions/search/searchHybrid.operation.js +7 -67
- package/dist/nodes/Qontext/actions/search/searchHybrid.operation.js.map +1 -1
- package/dist/nodes/Qontext/actions/search/searchKeyword.operation.d.ts +2 -0
- package/dist/nodes/Qontext/actions/search/searchKeyword.operation.js +14 -0
- package/dist/nodes/Qontext/actions/search/searchKeyword.operation.js.map +1 -0
- package/dist/nodes/Qontext/actions/search/searchRegex.operation.js +7 -68
- package/dist/nodes/Qontext/actions/search/searchRegex.operation.js.map +1 -1
- package/dist/nodes/Qontext/actions/search/searchSemantic.operation.d.ts +2 -0
- package/dist/nodes/Qontext/actions/search/searchSemantic.operation.js +14 -0
- package/dist/nodes/Qontext/actions/search/searchSemantic.operation.js.map +1 -0
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,8 @@ inside every tool. Context lives as files in folders, with access control and re
|
|
|
9
9
|
changes, and is reachable over the API, MCP and CLI.
|
|
10
10
|
|
|
11
11
|
This node puts that repository inside n8n. Workflows can create and edit files, organise
|
|
12
|
-
folders, and search the repository by meaning
|
|
12
|
+
folders, and search the repository by meaning, by semantic similarity, by keyword or by
|
|
13
|
+
regular expression — so a workflow
|
|
13
14
|
becomes one of the things keeping your context current, not just a consumer of it. The
|
|
14
15
|
node is also available as an AI Agent tool, so an agent can look something up, read a
|
|
15
16
|
file and write one back as part of its own reasoning.
|
|
@@ -114,8 +115,8 @@ Note the asymmetry with folders: a file moves via **New Folder ID**, a folder vi
|
|
|
114
115
|
|
|
115
116
|
#### Delete
|
|
116
117
|
Deletes a file and outputs `{ "success": true }`. Its change history goes with it, so
|
|
117
|
-
this is **not reversible** through the API. A protected file,
|
|
118
|
-
in review
|
|
118
|
+
this is **not reversible** through the API. A protected file, one in a protected folder, or
|
|
119
|
+
one with changes still in review is refused (`file_protected` / `changes_in_review`) and nothing is
|
|
119
120
|
removed — clear **Protected** first if you mean to delete it.
|
|
120
121
|
|
|
121
122
|
- **File ID** (required)
|
|
@@ -189,6 +190,9 @@ it survives, so IDs held elsewhere stay valid — only the paths below it change
|
|
|
189
190
|
- **Action**: `Rename` (then **Name**) or `Move` (then **New Parent Folder ID**,
|
|
190
191
|
choosing `/ (Root)` to move it to the root)
|
|
191
192
|
|
|
193
|
+
A move that would take a file out from under a protected folder, so it loses its
|
|
194
|
+
protection, is refused (`file_protected`).
|
|
195
|
+
|
|
192
196
|
#### Delete
|
|
193
197
|
Deletes a folder and outputs `{ "success": true }`.
|
|
194
198
|
|
|
@@ -196,30 +200,84 @@ Deletes a folder and outputs `{ "success": true }`.
|
|
|
196
200
|
- **Recursive** (default off): delete everything below it too. Left off, a folder that
|
|
197
201
|
still has contents is refused and nothing is removed.
|
|
198
202
|
|
|
203
|
+
A folder holding a protected file, or a protected folder, is refused (`file_protected`).
|
|
204
|
+
So is a recursive delete over more files and folders than the deletion limit
|
|
205
|
+
(`too_many_edits`); delete smaller groups instead.
|
|
206
|
+
|
|
199
207
|
### Search
|
|
200
208
|
|
|
201
|
-
|
|
209
|
+
Every operation returns one n8n item per result, and a result appears only if your API
|
|
202
210
|
key can read the file. A new or changed file is not searchable straight away, so search
|
|
203
211
|
again in a moment if you do not see it.
|
|
204
212
|
|
|
213
|
+
| Operation | Matches on | Order |
|
|
214
|
+
|---|---|---|
|
|
215
|
+
| By Meaning | Wording and meaning (hybrid) — the best default | Best match first |
|
|
216
|
+
| By Keyword | Wording only — suits names, codes and exact terms | Best match first |
|
|
217
|
+
| By Semantic Similarity | Meaning only, even with no words in common | Best match first |
|
|
218
|
+
| By Regex | An RE2 pattern | Not ranked |
|
|
219
|
+
|
|
220
|
+
#### Return
|
|
221
|
+
Every search has a **Return** field that chooses what each item is:
|
|
222
|
+
|
|
223
|
+
- **Files** (default): one item per matching file, with its whole content in `text`. A
|
|
224
|
+
following node such as **File → Update Content** runs once per file. **Limit** counts
|
|
225
|
+
files. The ranked searches order files by their best-matching passage.
|
|
226
|
+
- **Passages**: one item per matching passage, with the passage in `text`. A file with
|
|
227
|
+
several matching passages appears once for each, and a following node runs once per
|
|
228
|
+
passage. **Limit** counts passages, so a few files can fill it.
|
|
229
|
+
|
|
230
|
+
#### By Keyword
|
|
231
|
+
Finds the files, or the passages, whose wording best matches your query, best match
|
|
232
|
+
first.
|
|
233
|
+
|
|
234
|
+
- **Query** (required): the words to look for
|
|
235
|
+
- **Return** (default `Files`): see [Return](#return)
|
|
236
|
+
- **Limit** (default 50, max 500)
|
|
237
|
+
- **Include Sources** (default on)
|
|
238
|
+
|
|
205
239
|
#### By Meaning
|
|
206
|
-
Finds the files that match your query
|
|
207
|
-
|
|
240
|
+
Finds the files, or the passages, that match your query, best match first. It also
|
|
241
|
+
matches on meaning, so it finds files that answer the query without using the same
|
|
208
242
|
words.
|
|
209
243
|
|
|
210
244
|
- **Query** (required): a few words or a whole question
|
|
211
|
-
- **
|
|
212
|
-
- **
|
|
245
|
+
- **Return** (default `Files`): see [Return](#return)
|
|
246
|
+
- **Limit** (default 50, max 500)
|
|
247
|
+
- **Include Sources** (default on): list the external records each matched file came from
|
|
248
|
+
- **Expand Query** (default on): also search rewrites of the query. Turn it off to search
|
|
249
|
+
only the query as written
|
|
213
250
|
|
|
214
251
|
#### By Regex
|
|
215
|
-
Finds
|
|
216
|
-
|
|
217
|
-
|
|
252
|
+
Finds the files, or the passages, matching a case-sensitive
|
|
253
|
+
[RE2](https://github.com/google/re2/wiki/Syntax) regular expression. The pattern is
|
|
254
|
+
matched against each passage, not each line, and anchors apply to passage boundaries.
|
|
255
|
+
Results are not relevance-ranked.
|
|
218
256
|
|
|
219
257
|
- **Query** (required): the RE2 pattern
|
|
220
|
-
- **
|
|
258
|
+
- **Return** (default `Files`): see [Return](#return)
|
|
259
|
+
- **Limit** (default 50, max 500)
|
|
221
260
|
- **Include Sources** (default on)
|
|
222
261
|
|
|
262
|
+
#### By Semantic Similarity
|
|
263
|
+
Finds the files, or the passages, closest in meaning to your query, best match first. It
|
|
264
|
+
ignores wording, so it finds files that answer the query even when they share none of
|
|
265
|
+
its words.
|
|
266
|
+
|
|
267
|
+
- **Query** (required): a few words or a whole question
|
|
268
|
+
- **Return** (default `Files`): see [Return](#return)
|
|
269
|
+
- **Limit** (default 50, max 500)
|
|
270
|
+
- **Include Sources** (default on)
|
|
271
|
+
|
|
272
|
+
Each result has `kind` and `text`. `"kind": "file"` carries the whole file in `text`;
|
|
273
|
+
`"kind": "passage"` carries the matching passage, following Return.
|
|
274
|
+
|
|
275
|
+
`file` holds the same metadata **File → Get** returns: `object`, `id`, `path`, `name`,
|
|
276
|
+
`parentId`, `parentPath`, `protected`, `lastChangeId`, `createdAt` and `updatedAt`. It is
|
|
277
|
+
there whether or not Include Sources is on. With it on, `sources` lists the external
|
|
278
|
+
records the file came from, each as `integration`, `dataType` and `sourceId` (for example
|
|
279
|
+
`Notion`, `Page`, `policy-page`). A file written by hand has none, so `sources` is `[]`.
|
|
280
|
+
|
|
223
281
|
## Errors
|
|
224
282
|
|
|
225
283
|
The API answers with `application/problem+json` carrying a machine-readable `code`, a
|
|
@@ -237,9 +295,10 @@ code — the precise `detail` is in the node's error output, under `context.data
|
|
|
237
295
|
| `file_not_found` / `folder_not_found` | 404 | No such item readable with this key. An item in another workspace answers the same way, so existence does not leak |
|
|
238
296
|
| `path_already_exists` | 409 | Something is already at that path — Create is never an upsert |
|
|
239
297
|
| `folder_not_empty` | 409 | Delete a folder that still has contents; send Recursive |
|
|
240
|
-
| `file_protected` | 409 | Delete a protected file;
|
|
298
|
+
| `file_protected` | 409 | Delete a protected file, or a folder holding one; or move a folder so a file would lose its protection. A file is protected by its own flag or by a protected folder above it. Clear Protected first |
|
|
241
299
|
| `changes_in_review` | 409 | The file, or a file in the folder, has changes in review |
|
|
242
300
|
| `content_too_large` | 422 | Content is longer than the published limit |
|
|
301
|
+
| `too_many_edits` | 422 | A recursive folder delete covers more files and folders than the deletion limit. Delete smaller groups |
|
|
243
302
|
| `internal_error` | 500 | Unexpected failure, already reported |
|
|
244
303
|
| `service_unavailable` | 503 | Temporarily unreachable — honour `Retry-After` |
|
|
245
304
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export type SearchOperation = 'hybrid' | 'keyword' | 'regex' | 'semantic';
|
|
3
|
+
export declare const searchRouting: (path: SearchOperation) => INodeProperties["routing"];
|
|
4
|
+
export declare const queryField: (operation: SearchOperation, { placeholder, description }: {
|
|
5
|
+
placeholder: string;
|
|
6
|
+
description: string;
|
|
7
|
+
}) => INodeProperties;
|
|
8
|
+
export declare const limitField: (operation: SearchOperation) => INodeProperties;
|
|
9
|
+
export declare const includeSourcesField: (operation: SearchOperation) => INodeProperties;
|
|
10
|
+
export declare const expandQueryField: (operation: SearchOperation) => INodeProperties;
|
|
11
|
+
export declare const returnField: (operation: SearchOperation) => INodeProperties;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.returnField = exports.expandQueryField = exports.includeSourcesField = exports.limitField = exports.queryField = exports.searchRouting = void 0;
|
|
4
|
+
const api_1 = require("../common/api");
|
|
5
|
+
const showFor = (operation) => ({
|
|
6
|
+
show: {
|
|
7
|
+
resource: ['search'],
|
|
8
|
+
operation: [operation],
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const sendAsBody = (property) => ({
|
|
12
|
+
send: {
|
|
13
|
+
type: 'body',
|
|
14
|
+
property,
|
|
15
|
+
value: '={{$value}}',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
const searchRouting = (path) => ({
|
|
19
|
+
request: {
|
|
20
|
+
method: 'POST',
|
|
21
|
+
url: `${api_1.SEARCH_URL}/${path}`,
|
|
22
|
+
},
|
|
23
|
+
output: {
|
|
24
|
+
postReceive: [
|
|
25
|
+
{
|
|
26
|
+
type: 'rootProperty',
|
|
27
|
+
properties: {
|
|
28
|
+
property: 'data',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
exports.searchRouting = searchRouting;
|
|
35
|
+
const queryField = (operation, { placeholder, description }) => ({
|
|
36
|
+
displayName: 'Query',
|
|
37
|
+
name: 'query',
|
|
38
|
+
type: 'string',
|
|
39
|
+
default: '',
|
|
40
|
+
placeholder,
|
|
41
|
+
description,
|
|
42
|
+
required: true,
|
|
43
|
+
typeOptions: {
|
|
44
|
+
rows: 3,
|
|
45
|
+
},
|
|
46
|
+
displayOptions: showFor(operation),
|
|
47
|
+
routing: sendAsBody('query'),
|
|
48
|
+
});
|
|
49
|
+
exports.queryField = queryField;
|
|
50
|
+
const limitField = (operation) => ({
|
|
51
|
+
displayName: 'Limit',
|
|
52
|
+
name: 'limit',
|
|
53
|
+
type: 'number',
|
|
54
|
+
default: 50,
|
|
55
|
+
description: 'Max number of results to return',
|
|
56
|
+
hint: 'Counts files when Return is Files. Counts passages when Return is Passages, so a few files can fill it.',
|
|
57
|
+
typeOptions: {
|
|
58
|
+
minValue: 1,
|
|
59
|
+
maxValue: 500,
|
|
60
|
+
},
|
|
61
|
+
displayOptions: showFor(operation),
|
|
62
|
+
routing: sendAsBody('limit'),
|
|
63
|
+
});
|
|
64
|
+
exports.limitField = limitField;
|
|
65
|
+
const includeSourcesField = (operation) => ({
|
|
66
|
+
displayName: 'Include Sources',
|
|
67
|
+
name: 'includeSources',
|
|
68
|
+
type: 'boolean',
|
|
69
|
+
default: true,
|
|
70
|
+
description: 'Whether to list the external records (such as a Notion page) each matched file came from. The matched file is always returned.',
|
|
71
|
+
displayOptions: showFor(operation),
|
|
72
|
+
routing: sendAsBody('includeSources'),
|
|
73
|
+
});
|
|
74
|
+
exports.includeSourcesField = includeSourcesField;
|
|
75
|
+
const expandQueryField = (operation) => ({
|
|
76
|
+
displayName: 'Expand Query',
|
|
77
|
+
name: 'expandQuery',
|
|
78
|
+
type: 'boolean',
|
|
79
|
+
default: true,
|
|
80
|
+
description: 'Whether to also search rewrites of the query, which finds more files phrased differently. Turn off to search only the query as written. Word and meaning matching both run either way.',
|
|
81
|
+
displayOptions: showFor(operation),
|
|
82
|
+
routing: sendAsBody('expandQuery'),
|
|
83
|
+
});
|
|
84
|
+
exports.expandQueryField = expandQueryField;
|
|
85
|
+
const returnField = (operation) => ({
|
|
86
|
+
displayName: 'Return',
|
|
87
|
+
name: 'mode',
|
|
88
|
+
type: 'options',
|
|
89
|
+
default: 'files',
|
|
90
|
+
description: 'Whether each result is one matching passage or one whole file',
|
|
91
|
+
options: [
|
|
92
|
+
{
|
|
93
|
+
name: 'Files',
|
|
94
|
+
value: 'files',
|
|
95
|
+
description: 'One item per matching file, with its whole content in text. Each file appears once.',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'Passages',
|
|
99
|
+
value: 'passages',
|
|
100
|
+
description: 'One item per matching passage, with the passage in text. A file with several matching passages appears once for each.',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
displayOptions: showFor(operation),
|
|
104
|
+
routing: sendAsBody('mode'),
|
|
105
|
+
});
|
|
106
|
+
exports.returnField = returnField;
|
|
107
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../nodes/Qontext/actions/search/fields.ts"],"names":[],"mappings":";;;AAMA,uCAA2C;AAI3C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,EAAE,UAAU;YACjB,WAAW,EACV,uHAAuH;SACxH;KACD;IACD,cAAc,EAAE,OAAO,CAAC,SAAS,CAAC;IAClC,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC;CAC3B,CAAC,CAAC;AAtBU,QAAA,WAAW,eAsBrB"}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchOperations = void 0;
|
|
4
|
-
const
|
|
4
|
+
const fields_1 = require("./fields");
|
|
5
5
|
const searchHybrid_operation_1 = require("./searchHybrid.operation");
|
|
6
|
+
const searchKeyword_operation_1 = require("./searchKeyword.operation");
|
|
6
7
|
const searchRegex_operation_1 = require("./searchRegex.operation");
|
|
7
|
-
const
|
|
8
|
-
output: {
|
|
9
|
-
postReceive: [
|
|
10
|
-
{
|
|
11
|
-
type: 'rootProperty',
|
|
12
|
-
properties: {
|
|
13
|
-
property: 'data',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
};
|
|
8
|
+
const searchSemantic_operation_1 = require("./searchSemantic.operation");
|
|
19
9
|
exports.searchOperations = [
|
|
20
10
|
{
|
|
21
11
|
displayName: 'Operation',
|
|
@@ -28,36 +18,40 @@ exports.searchOperations = [
|
|
|
28
18
|
},
|
|
29
19
|
},
|
|
30
20
|
options: [
|
|
21
|
+
{
|
|
22
|
+
name: 'By Keyword',
|
|
23
|
+
value: 'keyword',
|
|
24
|
+
action: 'Search files by keyword',
|
|
25
|
+
description: 'Find the files whose wording best matches your query and return their content, best match first. Suits names, codes and exact terms.',
|
|
26
|
+
routing: (0, fields_1.searchRouting)('keyword'),
|
|
27
|
+
},
|
|
31
28
|
{
|
|
32
29
|
name: 'By Meaning',
|
|
33
30
|
value: 'hybrid',
|
|
34
31
|
action: 'Search files by meaning',
|
|
35
32
|
description: 'Find the files that match your query and return their content, best match first. Also matches on meaning, so it finds files that answer the query without using the same words.',
|
|
36
|
-
routing:
|
|
37
|
-
request: {
|
|
38
|
-
method: 'POST',
|
|
39
|
-
url: `${api_1.SEARCH_URL}/hybrid`,
|
|
40
|
-
},
|
|
41
|
-
...splitResults,
|
|
42
|
-
},
|
|
33
|
+
routing: (0, fields_1.searchRouting)('hybrid'),
|
|
43
34
|
},
|
|
44
35
|
{
|
|
45
36
|
name: 'By Regex',
|
|
46
37
|
value: 'regex',
|
|
47
|
-
action: 'Search
|
|
48
|
-
description: 'Find
|
|
49
|
-
routing:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
action: 'Search files with a regular expression',
|
|
39
|
+
description: 'Find passages or files that match an RE2 regular expression. Results are not relevance-ranked.',
|
|
40
|
+
routing: (0, fields_1.searchRouting)('regex'),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'By Semantic Similarity',
|
|
44
|
+
value: 'semantic',
|
|
45
|
+
action: 'Search files by semantic similarity',
|
|
46
|
+
description: 'Find the files closest in meaning to your query and return their content, best match first. Matches on meaning only, not wording.',
|
|
47
|
+
routing: (0, fields_1.searchRouting)('semantic'),
|
|
56
48
|
},
|
|
57
49
|
],
|
|
58
50
|
default: 'hybrid',
|
|
59
51
|
},
|
|
60
52
|
...searchHybrid_operation_1.searchHybridOperation,
|
|
53
|
+
...searchKeyword_operation_1.searchKeywordOperation,
|
|
61
54
|
...searchRegex_operation_1.searchRegexOperation,
|
|
55
|
+
...searchSemantic_operation_1.searchSemanticOperation,
|
|
62
56
|
];
|
|
63
57
|
//# sourceMappingURL=search.resource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.resource.js","sourceRoot":"","sources":["../../../../../nodes/Qontext/actions/search/search.resource.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"search.resource.js","sourceRoot":"","sources":["../../../../../nodes/Qontext/actions/search/search.resource.ts"],"names":[],"mappings":";;;AACA,qCAAyC;AACzC,qEAAiE;AACjE,uEAAmE;AACnE,mEAA+D;AAC/D,yEAAqE;AAExD,QAAA,gBAAgB,GAAsB;IAClD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;aACpB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,yBAAyB;gBACjC,WAAW,EACV,sIAAsI;gBACvI,OAAO,EAAE,IAAA,sBAAa,EAAC,SAAS,CAAC;aACjC;YACD;gBACC,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,yBAAyB;gBACjC,WAAW,EACV,iLAAiL;gBAClL,OAAO,EAAE,IAAA,sBAAa,EAAC,QAAQ,CAAC;aAChC;YACD;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,wCAAwC;gBAChD,WAAW,EACV,gGAAgG;gBACjG,OAAO,EAAE,IAAA,sBAAa,EAAC,OAAO,CAAC;aAC/B;YACD;gBACC,IAAI,EAAE,wBAAwB;gBAC9B,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,qCAAqC;gBAC7C,WAAW,EACV,mIAAmI;gBACpI,OAAO,EAAE,IAAA,sBAAa,EAAC,UAAU,CAAC;aAClC;SACD;QACD,OAAO,EAAE,QAAQ;KACjB;IACD,GAAG,8CAAqB;IACxB,GAAG,gDAAsB;IACzB,GAAG,4CAAoB;IACvB,GAAG,kDAAuB;CAC1B,CAAC"}
|
|
@@ -1,75 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchHybridOperation = void 0;
|
|
4
|
+
const fields_1 = require("./fields");
|
|
4
5
|
exports.searchHybridOperation = [
|
|
5
|
-
{
|
|
6
|
-
displayName: 'Query',
|
|
7
|
-
name: 'query',
|
|
8
|
-
type: 'string',
|
|
9
|
-
default: '',
|
|
6
|
+
(0, fields_1.queryField)('hybrid', {
|
|
10
7
|
placeholder: 'e.g. What is the refund policy?',
|
|
11
8
|
description: 'What you are looking for. A few words or a whole question both work.',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
show: {
|
|
18
|
-
resource: ['search'],
|
|
19
|
-
operation: ['hybrid'],
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
routing: {
|
|
23
|
-
send: {
|
|
24
|
-
type: 'body',
|
|
25
|
-
property: 'query',
|
|
26
|
-
value: '={{$value}}',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
displayName: 'Limit',
|
|
32
|
-
name: 'limit',
|
|
33
|
-
type: 'number',
|
|
34
|
-
default: 50,
|
|
35
|
-
description: 'Max number of results to return',
|
|
36
|
-
typeOptions: {
|
|
37
|
-
minValue: 1,
|
|
38
|
-
maxValue: 500,
|
|
39
|
-
},
|
|
40
|
-
displayOptions: {
|
|
41
|
-
show: {
|
|
42
|
-
resource: ['search'],
|
|
43
|
-
operation: ['hybrid'],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
routing: {
|
|
47
|
-
send: {
|
|
48
|
-
type: 'body',
|
|
49
|
-
property: 'limit',
|
|
50
|
-
value: '={{$value}}',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
displayName: 'Include Sources',
|
|
56
|
-
name: 'includeSources',
|
|
57
|
-
type: 'boolean',
|
|
58
|
-
default: true,
|
|
59
|
-
description: 'Whether to cite the file each result came from',
|
|
60
|
-
displayOptions: {
|
|
61
|
-
show: {
|
|
62
|
-
resource: ['search'],
|
|
63
|
-
operation: ['hybrid'],
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
routing: {
|
|
67
|
-
send: {
|
|
68
|
-
type: 'body',
|
|
69
|
-
property: 'includeSources',
|
|
70
|
-
value: '={{$value}}',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
9
|
+
}),
|
|
10
|
+
(0, fields_1.returnField)('hybrid'),
|
|
11
|
+
(0, fields_1.limitField)('hybrid'),
|
|
12
|
+
(0, fields_1.includeSourcesField)('hybrid'),
|
|
13
|
+
(0, fields_1.expandQueryField)('hybrid'),
|
|
74
14
|
];
|
|
75
15
|
//# sourceMappingURL=searchHybrid.operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchHybrid.operation.js","sourceRoot":"","sources":["../../../../../nodes/Qontext/actions/search/searchHybrid.operation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"searchHybrid.operation.js","sourceRoot":"","sources":["../../../../../nodes/Qontext/actions/search/searchHybrid.operation.ts"],"names":[],"mappings":";;;AAIA,qCAAsG;AAEzF,QAAA,qBAAqB,GAAsB;IACvD,IAAA,mBAAU,EAAC,QAAQ,EAAE;QACpB,WAAW,EAAE,iCAAiC;QAC9C,WAAW,EAAE,sEAAsE;KACnF,CAAC;IACF,IAAA,oBAAW,EAAC,QAAQ,CAAC;IACrB,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACpB,IAAA,4BAAmB,EAAC,QAAQ,CAAC;IAC7B,IAAA,yBAAgB,EAAC,QAAQ,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchKeywordOperation = void 0;
|
|
4
|
+
const fields_1 = require("./fields");
|
|
5
|
+
exports.searchKeywordOperation = [
|
|
6
|
+
(0, fields_1.queryField)('keyword', {
|
|
7
|
+
placeholder: 'e.g. refund policy',
|
|
8
|
+
description: 'The words to look for. Ranks files by how well their wording matches, so it suits names, codes and exact terms.',
|
|
9
|
+
}),
|
|
10
|
+
(0, fields_1.returnField)('keyword'),
|
|
11
|
+
(0, fields_1.limitField)('keyword'),
|
|
12
|
+
(0, fields_1.includeSourcesField)('keyword'),
|
|
13
|
+
];
|
|
14
|
+
//# sourceMappingURL=searchKeyword.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchKeyword.operation.js","sourceRoot":"","sources":["../../../../../nodes/Qontext/actions/search/searchKeyword.operation.ts"],"names":[],"mappings":";;;AAIA,qCAAoF;AAEvE,QAAA,sBAAsB,GAAsB;IACxD,IAAA,mBAAU,EAAC,SAAS,EAAE;QACrB,WAAW,EAAE,oBAAoB;QACjC,WAAW,EACV,iHAAiH;KAClH,CAAC;IACF,IAAA,oBAAW,EAAC,SAAS,CAAC;IACtB,IAAA,mBAAU,EAAC,SAAS,CAAC;IACrB,IAAA,4BAAmB,EAAC,SAAS,CAAC;CAC9B,CAAC"}
|
|
@@ -1,75 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchRegexOperation = void 0;
|
|
4
|
+
const fields_1 = require("./fields");
|
|
4
5
|
exports.searchRegexOperation = [
|
|
5
|
-
{
|
|
6
|
-
displayName: 'Query',
|
|
7
|
-
name: 'query',
|
|
8
|
-
type: 'string',
|
|
9
|
-
default: '',
|
|
6
|
+
(0, fields_1.queryField)('regex', {
|
|
10
7
|
placeholder: 'e.g. refund(s|ed)?\\s+within',
|
|
11
|
-
description: '
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
displayOptions: {
|
|
17
|
-
show: {
|
|
18
|
-
resource: ['search'],
|
|
19
|
-
operation: ['regex'],
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
routing: {
|
|
23
|
-
send: {
|
|
24
|
-
type: 'body',
|
|
25
|
-
property: 'query',
|
|
26
|
-
value: '={{$value}}',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
displayName: 'Limit',
|
|
32
|
-
name: 'limit',
|
|
33
|
-
type: 'number',
|
|
34
|
-
default: 50,
|
|
35
|
-
description: 'Max number of results to return',
|
|
36
|
-
typeOptions: {
|
|
37
|
-
minValue: 1,
|
|
38
|
-
maxValue: 500,
|
|
39
|
-
},
|
|
40
|
-
displayOptions: {
|
|
41
|
-
show: {
|
|
42
|
-
resource: ['search'],
|
|
43
|
-
operation: ['regex'],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
routing: {
|
|
47
|
-
send: {
|
|
48
|
-
type: 'body',
|
|
49
|
-
property: 'limit',
|
|
50
|
-
value: '={{$value}}',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
displayName: 'Include Sources',
|
|
56
|
-
name: 'includeSources',
|
|
57
|
-
type: 'boolean',
|
|
58
|
-
default: true,
|
|
59
|
-
description: 'Whether to cite the file each result came from',
|
|
60
|
-
displayOptions: {
|
|
61
|
-
show: {
|
|
62
|
-
resource: ['search'],
|
|
63
|
-
operation: ['regex'],
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
routing: {
|
|
67
|
-
send: {
|
|
68
|
-
type: 'body',
|
|
69
|
-
property: 'includeSources',
|
|
70
|
-
value: '={{$value}}',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
8
|
+
description: 'A case-sensitive RE2 regular expression matched against passages of each file. Anchors apply to passage boundaries. Results are not relevance-ranked.',
|
|
9
|
+
}),
|
|
10
|
+
(0, fields_1.returnField)('regex'),
|
|
11
|
+
(0, fields_1.limitField)('regex'),
|
|
12
|
+
(0, fields_1.includeSourcesField)('regex'),
|
|
74
13
|
];
|
|
75
14
|
//# sourceMappingURL=searchRegex.operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchRegex.operation.js","sourceRoot":"","sources":["../../../../../nodes/Qontext/actions/search/searchRegex.operation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"searchRegex.operation.js","sourceRoot":"","sources":["../../../../../nodes/Qontext/actions/search/searchRegex.operation.ts"],"names":[],"mappings":";;;AAIA,qCAAoF;AAEvE,QAAA,oBAAoB,GAAsB;IACtD,IAAA,mBAAU,EAAC,OAAO,EAAE;QACnB,WAAW,EAAE,8BAA8B;QAC3C,WAAW,EACV,uJAAuJ;KACxJ,CAAC;IAGF,IAAA,oBAAW,EAAC,OAAO,CAAC;IACpB,IAAA,mBAAU,EAAC,OAAO,CAAC;IACnB,IAAA,4BAAmB,EAAC,OAAO,CAAC;CAC5B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchSemanticOperation = void 0;
|
|
4
|
+
const fields_1 = require("./fields");
|
|
5
|
+
exports.searchSemanticOperation = [
|
|
6
|
+
(0, fields_1.queryField)('semantic', {
|
|
7
|
+
placeholder: 'e.g. What is the refund policy?',
|
|
8
|
+
description: 'What you are looking for. A few words or a whole question both work. Matches on meaning only, so it finds files that answer the query even when they share none of its words.',
|
|
9
|
+
}),
|
|
10
|
+
(0, fields_1.returnField)('semantic'),
|
|
11
|
+
(0, fields_1.limitField)('semantic'),
|
|
12
|
+
(0, fields_1.includeSourcesField)('semantic'),
|
|
13
|
+
];
|
|
14
|
+
//# sourceMappingURL=searchSemantic.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchSemantic.operation.js","sourceRoot":"","sources":["../../../../../nodes/Qontext/actions/search/searchSemantic.operation.ts"],"names":[],"mappings":";;;AAIA,qCAAoF;AAEvE,QAAA,uBAAuB,GAAsB;IACzD,IAAA,mBAAU,EAAC,UAAU,EAAE;QACtB,WAAW,EAAE,iCAAiC;QAC9C,WAAW,EACV,+KAA+K;KAChL,CAAC;IACF,IAAA,oBAAW,EAAC,UAAU,CAAC;IACvB,IAAA,mBAAU,EAAC,UAAU,CAAC;IACtB,IAAA,4BAAmB,EAAC,UAAU,CAAC;CAC/B,CAAC"}
|
package/dist/package.json
CHANGED