@superdurable/connector-elasticsearch 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Super Durable
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
- # Temporary Holding Version
1
+ # Elasticsearch TypeScript connector
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ This package indexes, deletes, and searches documents in one Elasticsearch index. Indexing fully replaces a document under a stable ID; deletion ensures that ID is absent. These writes are safe to retry. Search source JSON is untrusted provider data.
4
+
5
+ Configure the static `elasticsearch` Dex Web connection with the HTTPS cluster REST endpoint and an internal user's Basic credentials. Grant only the required index permissions. The package replays Go-recorded provider scenarios and includes runnable Flows under `examples/provider-operations/`. Live provider authorization remains unverified without a user-controlled connection.
@@ -0,0 +1,185 @@
1
+ {
2
+ "connectorId": "elasticsearch",
3
+ "releaseTag": "connectors/elastic/elasticsearch/go/v0.1.0",
4
+ "package": {
5
+ "ecosystem": "npm",
6
+ "name": "@superdurable/connector-elasticsearch",
7
+ "version": "0.1.0"
8
+ },
9
+ "factories": [
10
+ {
11
+ "name": "newIndexDocumentStep",
12
+ "kind": "mutation",
13
+ "operationId": "indexDocument",
14
+ "inputType": "IndexDocumentInput",
15
+ "description": "Create or fully replace one document in an existing index under a stable ID. Use an index without nonrepeatable ingest pipeline effects so retries preserve the intended source.",
16
+ "fields": {
17
+ "stepType": "stepType",
18
+ "annotations": "annotations",
19
+ "connectionName": "connectionName",
20
+ "resultAttribute": "resultAttribute"
21
+ },
22
+ "branches": [
23
+ {
24
+ "id": "indexed",
25
+ "field": "indexed",
26
+ "optional": false
27
+ },
28
+ {
29
+ "id": "providerRejected",
30
+ "field": "providerRejected",
31
+ "optional": true
32
+ },
33
+ {
34
+ "id": "defect",
35
+ "field": "defect",
36
+ "optional": true
37
+ }
38
+ ],
39
+ "inputSchema": {
40
+ "additionalProperties": false,
41
+ "description": "IndexDocumentInput fully replaces one document under a stable caller-selected ID.",
42
+ "properties": {
43
+ "documentId": {
44
+ "description": "DocumentID is the stable ID used for every retry.",
45
+ "type": "string"
46
+ },
47
+ "index": {
48
+ "description": "Index is one concrete lowercase Elasticsearch index name.",
49
+ "type": "string"
50
+ },
51
+ "source": {
52
+ "description": "Source is a complete JSON object replacing the current document."
53
+ }
54
+ },
55
+ "required": [
56
+ "documentId",
57
+ "index",
58
+ "source"
59
+ ],
60
+ "type": "object"
61
+ }
62
+ },
63
+ {
64
+ "name": "newDeleteDocumentStep",
65
+ "kind": "mutation",
66
+ "operationId": "deleteDocument",
67
+ "inputType": "DeleteDocumentInput",
68
+ "description": "Ensure one document is absent by deleting its stable ID; repeating the request is safe.",
69
+ "fields": {
70
+ "stepType": "stepType",
71
+ "annotations": "annotations",
72
+ "connectionName": "connectionName",
73
+ "resultAttribute": "resultAttribute"
74
+ },
75
+ "branches": [
76
+ {
77
+ "id": "absent",
78
+ "field": "absent",
79
+ "optional": false
80
+ },
81
+ {
82
+ "id": "indexNotFound",
83
+ "field": "indexNotFound",
84
+ "optional": true
85
+ },
86
+ {
87
+ "id": "providerRejected",
88
+ "field": "providerRejected",
89
+ "optional": true
90
+ },
91
+ {
92
+ "id": "defect",
93
+ "field": "defect",
94
+ "optional": true
95
+ }
96
+ ],
97
+ "inputSchema": {
98
+ "additionalProperties": false,
99
+ "description": "DeleteDocumentInput identifies one document to remove.",
100
+ "properties": {
101
+ "documentId": {
102
+ "description": "DocumentID is the stable ID to remove.",
103
+ "type": "string"
104
+ },
105
+ "index": {
106
+ "description": "Index is one concrete lowercase Elasticsearch index name.",
107
+ "type": "string"
108
+ }
109
+ },
110
+ "required": [
111
+ "documentId",
112
+ "index"
113
+ ],
114
+ "type": "object"
115
+ }
116
+ },
117
+ {
118
+ "name": "newSearchDocumentsStep",
119
+ "kind": "query",
120
+ "operationId": "searchDocuments",
121
+ "inputType": "SearchDocumentsInput",
122
+ "description": "Search one Elasticsearch index with a Lucene query string and bounded offset page.",
123
+ "fields": {
124
+ "stepType": "stepType",
125
+ "annotations": "annotations",
126
+ "connectionName": "connectionName",
127
+ "resultAttribute": "resultAttribute"
128
+ },
129
+ "branches": [
130
+ {
131
+ "id": "found",
132
+ "field": "found",
133
+ "optional": false
134
+ },
135
+ {
136
+ "id": "indexNotFound",
137
+ "field": "indexNotFound",
138
+ "optional": true
139
+ },
140
+ {
141
+ "id": "providerRejected",
142
+ "field": "providerRejected",
143
+ "optional": true
144
+ },
145
+ {
146
+ "id": "invalidResponse",
147
+ "field": "invalidResponse",
148
+ "optional": true
149
+ },
150
+ {
151
+ "id": "defect",
152
+ "field": "defect",
153
+ "optional": true
154
+ }
155
+ ],
156
+ "inputSchema": {
157
+ "additionalProperties": false,
158
+ "description": "SearchDocumentsInput selects an index, Lucene query, and bounded offset page.",
159
+ "properties": {
160
+ "from": {
161
+ "description": "From is a zero-based offset; from plus size may not exceed 10000.",
162
+ "type": "integer"
163
+ },
164
+ "index": {
165
+ "description": "Index is one concrete lowercase Elasticsearch index name.",
166
+ "type": "string"
167
+ },
168
+ "query": {
169
+ "description": "Query is a Lucene query string, such as title:Meridian.",
170
+ "type": "string"
171
+ },
172
+ "size": {
173
+ "description": "Size is 1 through 100; zero uses ten results.",
174
+ "type": "integer"
175
+ }
176
+ },
177
+ "required": [
178
+ "index",
179
+ "query"
180
+ ],
181
+ "type": "object"
182
+ }
183
+ }
184
+ ]
185
+ }
@@ -0,0 +1,194 @@
1
+ // src/generated/models.ts
2
+ import { z } from "zod";
3
+ import { SecretString } from "@superdurable/connectors-sdk";
4
+ var ConfigSchema = z.object({
5
+ "clusterUrl": z.string(),
6
+ "timeoutMs": z.number().int().optional(),
7
+ "maxResponseBytes": z.number().int().optional(),
8
+ "maxDocumentBytes": z.number().int().optional()
9
+ });
10
+ function decodeCredentials(value) {
11
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
12
+ const fields = value;
13
+ const allowed = /* @__PURE__ */ new Set(["password", "username"]);
14
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
15
+ if (fields["password"] != null && !(typeof fields["password"] === "string")) throw new TypeError("credential password has an invalid type");
16
+ if (fields["username"] != null && !(typeof fields["username"] === "string")) throw new TypeError("credential username has an invalid type");
17
+ const credentials = {};
18
+ if (!fields["username"]) throw new TypeError("credential username is required");
19
+ credentials.username = fields["username"] ?? "";
20
+ if (!fields["password"]) throw new TypeError("credential password is required");
21
+ credentials.password = new SecretString(fields["password"] ?? "");
22
+ return credentials;
23
+ }
24
+ var IndexDocumentInputSchema = z.strictObject({
25
+ "index": z.string(),
26
+ "documentId": z.string(),
27
+ "source": z.unknown().nullable()
28
+ });
29
+ var IndexedDocumentSchema = z.strictObject({
30
+ "index": z.string(),
31
+ "id": z.string()
32
+ });
33
+ var DeleteDocumentInputSchema = z.strictObject({
34
+ "index": z.string(),
35
+ "documentId": z.string()
36
+ });
37
+ var DeletedDocumentSchema = z.strictObject({
38
+ "index": z.string(),
39
+ "id": z.string(),
40
+ "wasDeleted": z.boolean()
41
+ });
42
+ var SearchDocumentsInputSchema = z.strictObject({
43
+ "index": z.string(),
44
+ "query": z.string(),
45
+ "size": z.number().int().optional(),
46
+ "from": z.number().int().optional()
47
+ });
48
+ var SearchHitSchema = z.strictObject({
49
+ "index": z.string(),
50
+ "id": z.string(),
51
+ "score": z.number().optional(),
52
+ "source": z.unknown().nullable()
53
+ });
54
+ var SearchPageSchema = z.strictObject({
55
+ "total": z.number().int(),
56
+ "relation": z.string(),
57
+ "hits": z.array(SearchHitSchema).nullable()
58
+ });
59
+
60
+ // src/generated/definitions.ts
61
+ var ConnectorID = "elasticsearch";
62
+ var ProviderID = "elasticsearch";
63
+ var IndexDocumentBranch = {
64
+ Indexed: "indexed",
65
+ ProviderRejected: "providerRejected",
66
+ Defect: "defect"
67
+ };
68
+ var IndexDocumentBranchIndexed = IndexDocumentBranch.Indexed;
69
+ var IndexDocumentBranchProviderRejected = IndexDocumentBranch.ProviderRejected;
70
+ var IndexDocumentBranchDefect = IndexDocumentBranch.Defect;
71
+ var IndexDocumentDefinition = {
72
+ operation: { connectorId: ConnectorID, operationId: "indexDocument" },
73
+ branches: [
74
+ { id: "indexed", description: "Elasticsearch stored the requested document at the stable ID." },
75
+ { id: "providerRejected", description: "Elasticsearch conclusively rejected the document replacement.", optional: true },
76
+ { id: "defect", description: "Local document input or credentials are invalid.", optional: true }
77
+ ],
78
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
79
+ };
80
+ var IndexDocumentMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
81
+ var DeleteDocumentBranch = {
82
+ Absent: "absent",
83
+ IndexNotFound: "indexNotFound",
84
+ ProviderRejected: "providerRejected",
85
+ Defect: "defect"
86
+ };
87
+ var DeleteDocumentBranchAbsent = DeleteDocumentBranch.Absent;
88
+ var DeleteDocumentBranchIndexNotFound = DeleteDocumentBranch.IndexNotFound;
89
+ var DeleteDocumentBranchProviderRejected = DeleteDocumentBranch.ProviderRejected;
90
+ var DeleteDocumentBranchDefect = DeleteDocumentBranch.Defect;
91
+ var DeleteDocumentDefinition = {
92
+ operation: { connectorId: ConnectorID, operationId: "deleteDocument" },
93
+ branches: [
94
+ { id: "absent", description: "The document is absent, whether deleted now or already missing." },
95
+ { id: "indexNotFound", description: "The requested index does not exist.", optional: true },
96
+ { id: "providerRejected", description: "Elasticsearch conclusively rejected the deletion.", optional: true },
97
+ { id: "defect", description: "Local document ID or credentials are invalid.", optional: true }
98
+ ],
99
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
100
+ };
101
+ var DeleteDocumentMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
102
+ var SearchDocumentsBranch = {
103
+ Found: "found",
104
+ IndexNotFound: "indexNotFound",
105
+ ProviderRejected: "providerRejected",
106
+ InvalidResponse: "invalidResponse",
107
+ Defect: "defect"
108
+ };
109
+ var SearchDocumentsBranchFound = SearchDocumentsBranch.Found;
110
+ var SearchDocumentsBranchIndexNotFound = SearchDocumentsBranch.IndexNotFound;
111
+ var SearchDocumentsBranchProviderRejected = SearchDocumentsBranch.ProviderRejected;
112
+ var SearchDocumentsBranchInvalidResponse = SearchDocumentsBranch.InvalidResponse;
113
+ var SearchDocumentsBranchDefect = SearchDocumentsBranch.Defect;
114
+ var SearchDocumentsDefinition = {
115
+ operation: { connectorId: ConnectorID, operationId: "searchDocuments" },
116
+ branches: [
117
+ { id: "found", description: "Elasticsearch returned a search page, possibly empty." },
118
+ { id: "indexNotFound", description: "The requested index does not exist.", optional: true },
119
+ { id: "providerRejected", description: "Elasticsearch conclusively rejected the search.", optional: true },
120
+ { id: "invalidResponse", description: "Elasticsearch returned malformed or oversized search data.", optional: true },
121
+ { id: "defect", description: "Local input or credentials are invalid.", optional: true }
122
+ ],
123
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
124
+ };
125
+ var SearchDocumentsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
126
+
127
+ // src/generated/connection.ts
128
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
129
+ var Connection = class {
130
+ /** Stable provider and connection name. */
131
+ reference;
132
+ /** Bound provider operations. */
133
+ operations;
134
+ /** Validate a reference and bind operations. */
135
+ constructor(reference, operations) {
136
+ this.reference = ConnectionRefSchema.parse(reference);
137
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
138
+ if (!operations) throw new TypeError("connector operations are required");
139
+ this.operations = operations;
140
+ }
141
+ };
142
+ function newConnection(client, reference) {
143
+ if (!client) throw new TypeError("connector client is required");
144
+ return new Connection(reference, client);
145
+ }
146
+ function newConnectionWithOperations(operations, reference) {
147
+ return new Connection(reference, operations);
148
+ }
149
+ function newProjectConnection(project, connectionName, createClient) {
150
+ if (!project) throw new TypeError("loaded project is required");
151
+ const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
152
+ const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
153
+ if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
154
+ return newConnection(createClient(project, connectionName), reference);
155
+ }
156
+
157
+ export {
158
+ ConfigSchema,
159
+ decodeCredentials,
160
+ IndexDocumentInputSchema,
161
+ IndexedDocumentSchema,
162
+ DeleteDocumentInputSchema,
163
+ DeletedDocumentSchema,
164
+ SearchDocumentsInputSchema,
165
+ SearchHitSchema,
166
+ SearchPageSchema,
167
+ ConnectorID,
168
+ ProviderID,
169
+ IndexDocumentBranch,
170
+ IndexDocumentBranchIndexed,
171
+ IndexDocumentBranchProviderRejected,
172
+ IndexDocumentBranchDefect,
173
+ IndexDocumentDefinition,
174
+ IndexDocumentMetadata,
175
+ DeleteDocumentBranch,
176
+ DeleteDocumentBranchAbsent,
177
+ DeleteDocumentBranchIndexNotFound,
178
+ DeleteDocumentBranchProviderRejected,
179
+ DeleteDocumentBranchDefect,
180
+ DeleteDocumentDefinition,
181
+ DeleteDocumentMetadata,
182
+ SearchDocumentsBranch,
183
+ SearchDocumentsBranchFound,
184
+ SearchDocumentsBranchIndexNotFound,
185
+ SearchDocumentsBranchProviderRejected,
186
+ SearchDocumentsBranchInvalidResponse,
187
+ SearchDocumentsBranchDefect,
188
+ SearchDocumentsDefinition,
189
+ SearchDocumentsMetadata,
190
+ Connection,
191
+ newConnection,
192
+ newConnectionWithOperations,
193
+ newProjectConnection
194
+ };
@@ -0,0 +1,167 @@
1
+ import { CredentialProvider, SecretString, Mutation, Query, ConnectionRef } from '@superdurable/connectors-sdk';
2
+ import { z } from 'zod';
3
+
4
+ /** Connector configuration; omitted fields use manifest defaults. */
5
+ interface Config {
6
+ /** Non-secret absolute HTTPS Elasticsearch endpoint from https://cloud.elastic.co/ > deployment > Manage > Application endpoints > Elasticsearch > Direct endpoint, or your self-managed cluster HTTP settings. Do not append an index, query, or fragment. Blank prevents connection creation. */
7
+ clusterUrl: string;
8
+ /** Maximum duration of one Elasticsearch HTTP request as a positive Go duration such as 15s or 1m. Blank uses the displayed default; raise only for slow searches. Runtime value in milliseconds. */
9
+ timeoutMs?: number;
10
+ /** Maximum complete search response in bytes as a positive integer. Blank uses the displayed default; raise only for larger result pages. Oversized responses select invalidResponse. */
11
+ maxResponseBytes?: number;
12
+ /** Maximum complete document JSON request in bytes as a positive integer. Blank uses the displayed default; raise only when indexing a larger document. */
13
+ maxDocumentBytes?: number;
14
+ }
15
+ /** Runtime schema for manifest configuration. */
16
+ declare const ConfigSchema: z.ZodObject<{
17
+ clusterUrl: z.ZodString;
18
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
19
+ maxResponseBytes: z.ZodOptional<z.ZodNumber>;
20
+ maxDocumentBytes: z.ZodOptional<z.ZodNumber>;
21
+ }, z.core.$strip>;
22
+ /** Private connector credentials resolved by the host. */
23
+ interface Credentials {
24
+ /** Secret password set at https://cloud.elastic.co/ > deployment > Open Kibana > Stack Management > Security > Users > Create user, or in self-managed Kibana. Copy the exact password into Dex credentials; blank prevents calls. Rotate it from the same Users page. */
25
+ password: SecretString;
26
+ /** Non-secret native username from https://cloud.elastic.co/ > deployment > Open Kibana > Stack Management > Security > Users > Create user, or the same page in self-managed Kibana. Enter the exact username with index read, index, or delete privileges. Blank prevents calls. */
27
+ username: string;
28
+ }
29
+ /** Decode private credential fields for the connector. */
30
+ declare function decodeCredentials(value: unknown): Credentials;
31
+ /** Host-owned source of private connector credentials. */
32
+ type CredentialSource = CredentialProvider<Credentials>;
33
+ /** IndexDocumentInput fully replaces one document under a stable caller-selected ID. */
34
+ interface IndexDocumentInput {
35
+ /** Index is one concrete lowercase Elasticsearch index name. */
36
+ "index": string;
37
+ /** DocumentID is the stable ID used for every retry. */
38
+ "documentId": string;
39
+ /** Source is a complete JSON object replacing the current document. */
40
+ "source": unknown | null;
41
+ }
42
+ /** IndexedDocument identifies the document stored by indexDocument. */
43
+ interface IndexedDocument {
44
+ /** Index is the index that contains the document. */
45
+ "index": string;
46
+ /** ID is the stable document ID. */
47
+ "id": string;
48
+ }
49
+ /** DeleteDocumentInput identifies one document to remove. */
50
+ interface DeleteDocumentInput {
51
+ /** Index is one concrete lowercase Elasticsearch index name. */
52
+ "index": string;
53
+ /** DocumentID is the stable ID to remove. */
54
+ "documentId": string;
55
+ }
56
+ /** DeletedDocument reports that the target document is absent. */
57
+ interface DeletedDocument {
58
+ /** Index is the index containing the target ID. */
59
+ "index": string;
60
+ /** ID is the stable target document ID. */
61
+ "id": string;
62
+ /** WasDeleted reports whether this attempt removed an existing document. */
63
+ "wasDeleted": boolean;
64
+ }
65
+ /** SearchDocumentsInput selects an index, Lucene query, and bounded offset page. */
66
+ interface SearchDocumentsInput {
67
+ /** Index is one concrete lowercase Elasticsearch index name. */
68
+ "index": string;
69
+ /** Query is a Lucene query string, such as title:Meridian. */
70
+ "query": string;
71
+ /** Size is 1 through 100; zero uses ten results. */
72
+ "size"?: number | undefined;
73
+ /** From is a zero-based offset; from plus size may not exceed 10000. */
74
+ "from"?: number | undefined;
75
+ }
76
+ /** SearchHit identifies one matching document and its untrusted source JSON. */
77
+ interface SearchHit {
78
+ /** Index is the index that produced this hit. */
79
+ "index": string;
80
+ /** ID is the provider document ID. */
81
+ "id": string;
82
+ /** Score is Elasticsearch's relevance score, if available. */
83
+ "score"?: number | undefined;
84
+ /** Source is provider-owned document JSON and may contain sensitive user data. */
85
+ "source": unknown | null;
86
+ }
87
+ /** SearchPage is one bounded search result page. */
88
+ interface SearchPage {
89
+ /** Total is the provider's matching hit count or lower bound. */
90
+ "total": number;
91
+ /** Relation is eq for an exact count or gte for a lower bound. */
92
+ "relation": string;
93
+ /** Hits contains this page's matching documents. */
94
+ "hits": Array<SearchHit> | null;
95
+ }
96
+ /** Runtime validator for IndexDocumentInput. */
97
+ declare const IndexDocumentInputSchema: z.ZodObject<{
98
+ index: z.ZodString;
99
+ documentId: z.ZodString;
100
+ source: z.ZodNullable<z.ZodUnknown>;
101
+ }, z.core.$strict>;
102
+ /** Runtime validator for IndexedDocument. */
103
+ declare const IndexedDocumentSchema: z.ZodObject<{
104
+ index: z.ZodString;
105
+ id: z.ZodString;
106
+ }, z.core.$strict>;
107
+ /** Runtime validator for DeleteDocumentInput. */
108
+ declare const DeleteDocumentInputSchema: z.ZodObject<{
109
+ index: z.ZodString;
110
+ documentId: z.ZodString;
111
+ }, z.core.$strict>;
112
+ /** Runtime validator for DeletedDocument. */
113
+ declare const DeletedDocumentSchema: z.ZodObject<{
114
+ index: z.ZodString;
115
+ id: z.ZodString;
116
+ wasDeleted: z.ZodBoolean;
117
+ }, z.core.$strict>;
118
+ /** Runtime validator for SearchDocumentsInput. */
119
+ declare const SearchDocumentsInputSchema: z.ZodObject<{
120
+ index: z.ZodString;
121
+ query: z.ZodString;
122
+ size: z.ZodOptional<z.ZodNumber>;
123
+ from: z.ZodOptional<z.ZodNumber>;
124
+ }, z.core.$strict>;
125
+ /** Runtime validator for SearchHit. */
126
+ declare const SearchHitSchema: z.ZodObject<{
127
+ index: z.ZodString;
128
+ id: z.ZodString;
129
+ score: z.ZodOptional<z.ZodNumber>;
130
+ source: z.ZodNullable<z.ZodUnknown>;
131
+ }, z.core.$strict>;
132
+ /** Runtime validator for SearchPage. */
133
+ declare const SearchPageSchema: z.ZodObject<{
134
+ total: z.ZodNumber;
135
+ relation: z.ZodString;
136
+ hits: z.ZodNullable<z.ZodArray<z.ZodObject<{
137
+ index: z.ZodString;
138
+ id: z.ZodString;
139
+ score: z.ZodOptional<z.ZodNumber>;
140
+ source: z.ZodNullable<z.ZodUnknown>;
141
+ }, z.core.$strict>>>;
142
+ }, z.core.$strict>;
143
+
144
+ /** Typed operations supplied by a client or mock. */
145
+ interface Operations {
146
+ /** Invoke indexDocument through this connection. */
147
+ indexDocument(): Mutation<IndexDocumentInput, IndexedDocument>;
148
+ /** Invoke deleteDocument through this connection. */
149
+ deleteDocument(): Mutation<DeleteDocumentInput, DeletedDocument>;
150
+ /** Invoke searchDocuments through this connection. */
151
+ searchDocuments(): Query<SearchDocumentsInput, SearchPage>;
152
+ }
153
+ /** Named connector connection kept outside Flow state. */
154
+ declare class Connection<BoundOperations = Operations> {
155
+ /** Stable provider and connection name. */
156
+ readonly reference: ConnectionRef;
157
+ /** Bound provider operations. */
158
+ readonly operations: BoundOperations;
159
+ /** Validate a reference and bind operations. */
160
+ constructor(reference: ConnectionRef, operations: BoundOperations);
161
+ }
162
+ /** Bind a client to a named connection. */
163
+ declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
164
+ /** Bind scripted operations to a named connection. */
165
+ declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
166
+
167
+ export { Connection as C, type DeleteDocumentInput as D, type IndexDocumentInput as I, type Operations as O, type SearchDocumentsInput as S, type DeletedDocument as a, type IndexedDocument as b, type SearchPage as c, type Config as d, type Credentials as e, ConfigSchema as f, type CredentialSource as g, DeleteDocumentInputSchema as h, DeletedDocumentSchema as i, IndexDocumentInputSchema as j, IndexedDocumentSchema as k, SearchDocumentsInputSchema as l, type SearchHit as m, SearchHitSchema as n, SearchPageSchema as o, decodeCredentials as p, newConnection as q, newConnectionWithOperations as r };