@superdurable/connector-notion 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,19 @@
1
- # Temporary Holding Version
1
+ # Notion 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
+ `@superdurable/connector-notion@0.1.0` implements Notion's `search`, `queryDatabase`, and `getPage` Queries and `createPage` and `updatePageProperties` Mutations. The manifest generates operation models, Step factories, connection bindings, mock cases, and `dex-connector.json`. Import scripted mocks from `@superdurable/connector-notion/mock`.
4
+
5
+ ## Configure a connection
6
+
7
+ Create a Notion internal connection at [Notion's developer portal](https://app.notion.com/developers/connections) under **Build → Internal connections**. Enable **Read content**, **Update content**, and **Insert content**, then share each database or page with the connection. Save its API token in the secret `api_token` field in Dex Web **Connections**. Keep the token out of Flow inputs, Attributes, and logs. `endpoint` and `maxResponseBytes` may be left blank for the manifest defaults.
8
+
9
+ A database contains one or more data sources. `queryDatabase` and `createPage` accept either a data source ID or a database ID; a database ID triggers one lookup and requires exactly one data source. A page ID accepts dashed or compact hex and a Notion page URL. Search is title-only and may lag recently created pages.
10
+
11
+ ## Run the example
12
+
13
+ The [search-pages example](examples/search-pages/README.md) loads the static `notion` connection and runs the generated `newSearchStep` through a Dex Worker. It persists the request and result as Attributes. The optional `noMatch` and rejection branches remain unwired, so selecting one fails the Flow. The API token stays in the connection credential source.
14
+
15
+ ## Failure behavior and verification
16
+
17
+ Reads retry transient transport, 408, 409, 429, 529, and server errors. `updatePageProperties` repeats absolute values safely and retries transient failures. `createPage` uses the Connector SDK single-dispatch fence; an ambiguous write without a confirmable page ID selects `uncertain`, while a known accepted ID can be read back. Conclusive provider rejections select operation branches. Notion error message text is not exposed.
18
+
19
+ Run `npm ci && npm run check`. With a local `dexcli dev` service, set `DEX_FLOW_SERVICE_ADDRESS` and run `npm run test:integration`. The conformance suite replays Go-recorded provider requests and results. Live Notion authorization and response behavior remain unverified.
@@ -0,0 +1,206 @@
1
+ {
2
+ "connectorId": "notion",
3
+ "releaseTag": "connectors/notion/go/v0.24.0",
4
+ "package": {
5
+ "ecosystem": "npm",
6
+ "name": "@superdurable/connector-notion",
7
+ "version": "0.1.0"
8
+ },
9
+ "factories": [
10
+ {
11
+ "name": "newSearchStep",
12
+ "kind": "query",
13
+ "operationId": "search",
14
+ "fields": {
15
+ "stepType": "stepType",
16
+ "annotations": "annotations",
17
+ "connectionName": "connectionName",
18
+ "resultAttribute": "resultAttribute"
19
+ },
20
+ "branches": [
21
+ {
22
+ "id": "searched",
23
+ "field": "searched",
24
+ "optional": false
25
+ },
26
+ {
27
+ "id": "noMatch",
28
+ "field": "noMatch",
29
+ "optional": true
30
+ },
31
+ {
32
+ "id": "providerRejected",
33
+ "field": "providerRejected",
34
+ "optional": true
35
+ },
36
+ {
37
+ "id": "invalidResponse",
38
+ "field": "invalidResponse",
39
+ "optional": true
40
+ },
41
+ {
42
+ "id": "defect",
43
+ "field": "defect",
44
+ "optional": true
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "name": "newQueryDatabaseStep",
50
+ "kind": "query",
51
+ "operationId": "queryDatabase",
52
+ "fields": {
53
+ "stepType": "stepType",
54
+ "annotations": "annotations",
55
+ "connectionName": "connectionName",
56
+ "resultAttribute": "resultAttribute"
57
+ },
58
+ "branches": [
59
+ {
60
+ "id": "queried",
61
+ "field": "queried",
62
+ "optional": false
63
+ },
64
+ {
65
+ "id": "notFound",
66
+ "field": "notFound",
67
+ "optional": true
68
+ },
69
+ {
70
+ "id": "providerRejected",
71
+ "field": "providerRejected",
72
+ "optional": true
73
+ },
74
+ {
75
+ "id": "invalidResponse",
76
+ "field": "invalidResponse",
77
+ "optional": true
78
+ },
79
+ {
80
+ "id": "defect",
81
+ "field": "defect",
82
+ "optional": true
83
+ }
84
+ ]
85
+ },
86
+ {
87
+ "name": "newGetPageStep",
88
+ "kind": "query",
89
+ "operationId": "getPage",
90
+ "fields": {
91
+ "stepType": "stepType",
92
+ "annotations": "annotations",
93
+ "connectionName": "connectionName",
94
+ "resultAttribute": "resultAttribute"
95
+ },
96
+ "branches": [
97
+ {
98
+ "id": "found",
99
+ "field": "found",
100
+ "optional": false
101
+ },
102
+ {
103
+ "id": "notFound",
104
+ "field": "notFound",
105
+ "optional": true
106
+ },
107
+ {
108
+ "id": "providerRejected",
109
+ "field": "providerRejected",
110
+ "optional": true
111
+ },
112
+ {
113
+ "id": "invalidResponse",
114
+ "field": "invalidResponse",
115
+ "optional": true
116
+ },
117
+ {
118
+ "id": "defect",
119
+ "field": "defect",
120
+ "optional": true
121
+ }
122
+ ]
123
+ },
124
+ {
125
+ "name": "newCreatePageStep",
126
+ "kind": "mutation",
127
+ "operationId": "createPage",
128
+ "fields": {
129
+ "stepType": "stepType",
130
+ "annotations": "annotations",
131
+ "connectionName": "connectionName",
132
+ "resultAttribute": "resultAttribute"
133
+ },
134
+ "branches": [
135
+ {
136
+ "id": "created",
137
+ "field": "created",
138
+ "optional": false
139
+ },
140
+ {
141
+ "id": "notFound",
142
+ "field": "notFound",
143
+ "optional": true
144
+ },
145
+ {
146
+ "id": "providerRejected",
147
+ "field": "providerRejected",
148
+ "optional": true
149
+ },
150
+ {
151
+ "id": "uncertain",
152
+ "field": "uncertain",
153
+ "optional": true
154
+ },
155
+ {
156
+ "id": "invalidResponse",
157
+ "field": "invalidResponse",
158
+ "optional": true
159
+ },
160
+ {
161
+ "id": "defect",
162
+ "field": "defect",
163
+ "optional": true
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "name": "newUpdatePagePropertiesStep",
169
+ "kind": "mutation",
170
+ "operationId": "updatePageProperties",
171
+ "fields": {
172
+ "stepType": "stepType",
173
+ "annotations": "annotations",
174
+ "connectionName": "connectionName",
175
+ "resultAttribute": "resultAttribute"
176
+ },
177
+ "branches": [
178
+ {
179
+ "id": "updated",
180
+ "field": "updated",
181
+ "optional": false
182
+ },
183
+ {
184
+ "id": "notFound",
185
+ "field": "notFound",
186
+ "optional": true
187
+ },
188
+ {
189
+ "id": "providerRejected",
190
+ "field": "providerRejected",
191
+ "optional": true
192
+ },
193
+ {
194
+ "id": "invalidResponse",
195
+ "field": "invalidResponse",
196
+ "optional": true
197
+ },
198
+ {
199
+ "id": "defect",
200
+ "field": "defect",
201
+ "optional": true
202
+ }
203
+ ]
204
+ }
205
+ ]
206
+ }
@@ -0,0 +1,390 @@
1
+ // src/generated/models.ts
2
+ import { z } from "zod";
3
+ import { SecretString } from "@superdurable/connectors-sdk";
4
+ var ConfigSchema = z.object({
5
+ "endpoint": z.string().optional(),
6
+ "maxResponseBytes": z.number().int().optional()
7
+ });
8
+ function decodeCredentials(value) {
9
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
10
+ const fields = value;
11
+ const allowed = /* @__PURE__ */ new Set(["api_token"]);
12
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
13
+ if (fields["api_token"] != null && !(typeof fields["api_token"] === "string")) throw new TypeError("credential api_token has an invalid type");
14
+ const credentials = {};
15
+ if (!fields["api_token"]) throw new TypeError("credential api_token is required");
16
+ credentials.apiToken = new SecretString(fields["api_token"] ?? "");
17
+ return credentials;
18
+ }
19
+ var SearchInputSchema = z.strictObject({
20
+ "query": z.string().optional(),
21
+ "objectType": z.string().optional(),
22
+ "sortDirection": z.string().optional(),
23
+ "pageSize": z.number().int().optional(),
24
+ "startCursor": z.string().optional()
25
+ });
26
+ var ParentSchema = z.strictObject({
27
+ "type": z.string(),
28
+ "id": z.string().optional(),
29
+ "databaseId": z.string().optional()
30
+ });
31
+ var SearchMatchSchema = z.strictObject({
32
+ "objectType": z.string(),
33
+ "id": z.string(),
34
+ "title": z.string(),
35
+ "url": z.string().optional(),
36
+ "parent": ParentSchema,
37
+ "lastEditedTime": z.string().optional(),
38
+ "inTrash": z.boolean()
39
+ });
40
+ var SearchOutputSchema = z.strictObject({
41
+ "matches": z.array(SearchMatchSchema).nullable(),
42
+ "nextCursor": z.string().optional(),
43
+ "hasMore": z.boolean()
44
+ });
45
+ var QueryFilterSchema = z.lazy(() => z.strictObject({
46
+ "property": z.string().optional(),
47
+ "type": z.string().optional(),
48
+ "timestamp": z.string().optional(),
49
+ "condition": z.string().optional(),
50
+ "text": z.string().optional(),
51
+ "number": z.number().optional(),
52
+ "checkbox": z.boolean().optional(),
53
+ "date": z.string().optional(),
54
+ "id": z.string().optional(),
55
+ "and": z.array(QueryFilterSchema).optional(),
56
+ "or": z.array(QueryFilterSchema).optional()
57
+ }));
58
+ var QuerySortSchema = z.strictObject({
59
+ "property": z.string().optional(),
60
+ "timestamp": z.string().optional(),
61
+ "direction": z.string().optional()
62
+ });
63
+ var QueryDatabaseInputSchema = z.strictObject({
64
+ "dataSourceId": z.string().optional(),
65
+ "databaseId": z.string().optional(),
66
+ "filter": QueryFilterSchema.optional(),
67
+ "sorts": z.array(QuerySortSchema).optional(),
68
+ "properties": z.array(z.string()).optional(),
69
+ "pageSize": z.number().int().optional(),
70
+ "startCursor": z.string().optional()
71
+ });
72
+ var DateRangeSchema = z.strictObject({
73
+ "start": z.string(),
74
+ "end": z.string().optional(),
75
+ "timeZone": z.string().optional()
76
+ });
77
+ var PagePropertySchema = z.strictObject({
78
+ "id": z.string(),
79
+ "type": z.string(),
80
+ "text": z.string().optional(),
81
+ "number": z.number().optional(),
82
+ "checkbox": z.boolean().optional(),
83
+ "option": z.string().optional(),
84
+ "options": z.array(z.string()).optional(),
85
+ "date": DateRangeSchema.optional(),
86
+ "url": z.string().optional(),
87
+ "email": z.string().optional(),
88
+ "phoneNumber": z.string().optional(),
89
+ "userIds": z.array(z.string()).optional(),
90
+ "pageIds": z.array(z.string()).optional(),
91
+ "plainText": z.string(),
92
+ "truncated": z.boolean().optional()
93
+ });
94
+ var PageSchema = z.strictObject({
95
+ "id": z.string(),
96
+ "url": z.string().optional(),
97
+ "title": z.string(),
98
+ "parent": ParentSchema,
99
+ "createdTime": z.string().optional(),
100
+ "lastEditedTime": z.string().optional(),
101
+ "inTrash": z.boolean(),
102
+ "archived": z.boolean(),
103
+ "properties": z.record(z.string(), PagePropertySchema).nullable()
104
+ });
105
+ var QueryDatabaseOutputSchema = z.strictObject({
106
+ "dataSourceId": z.string(),
107
+ "pages": z.array(PageSchema).nullable(),
108
+ "nextCursor": z.string().optional(),
109
+ "hasMore": z.boolean(),
110
+ "resultLimitReached": z.boolean()
111
+ });
112
+ var GetPageInputSchema = z.strictObject({
113
+ "pageId": z.string(),
114
+ "skipContent": z.boolean().optional(),
115
+ "maxBlocks": z.number().int().optional(),
116
+ "maxTextCharacters": z.number().int().optional()
117
+ });
118
+ var PageContentSchema = z.strictObject({
119
+ "text": z.string(),
120
+ "blockCount": z.number().int(),
121
+ "hasMoreBlocks": z.boolean(),
122
+ "textTruncated": z.boolean(),
123
+ "nestedBlockCount": z.number().int(),
124
+ "skippedBlockCount": z.number().int()
125
+ });
126
+ var GetPageOutputSchema = z.strictObject({
127
+ "page": PageSchema,
128
+ "content": PageContentSchema
129
+ });
130
+ var PropertyValueSchema = z.strictObject({
131
+ "type": z.string(),
132
+ "text": z.string().optional(),
133
+ "number": z.number().optional(),
134
+ "checkbox": z.boolean().optional(),
135
+ "option": z.string().optional(),
136
+ "options": z.array(z.string()).optional(),
137
+ "date": DateRangeSchema.optional(),
138
+ "url": z.string().optional(),
139
+ "email": z.string().optional(),
140
+ "phoneNumber": z.string().optional(),
141
+ "userIds": z.array(z.string()).optional(),
142
+ "pageIds": z.array(z.string()).optional()
143
+ });
144
+ var CreatePageInputSchema = z.strictObject({
145
+ "dataSourceId": z.string().optional(),
146
+ "databaseId": z.string().optional(),
147
+ "properties": z.record(z.string(), PropertyValueSchema).optional(),
148
+ "bodyText": z.string().optional()
149
+ });
150
+ var CreatePageOutputSchema = z.strictObject({
151
+ "dataSourceId": z.string().optional(),
152
+ "pageId": z.string().optional(),
153
+ "page": PageSchema.optional(),
154
+ "confirmedAfterTimeout": z.boolean().optional()
155
+ });
156
+ var UpdatePagePropertiesInputSchema = z.strictObject({
157
+ "pageId": z.string(),
158
+ "properties": z.record(z.string(), PropertyValueSchema).nullable()
159
+ });
160
+ var UpdatePagePropertiesOutputSchema = z.strictObject({
161
+ "page": PageSchema
162
+ });
163
+
164
+ // src/generated/definitions.ts
165
+ var ConnectorID = "notion";
166
+ var ProviderID = "notion";
167
+ var SearchBranch = {
168
+ Searched: "searched",
169
+ NoMatch: "noMatch",
170
+ ProviderRejected: "providerRejected",
171
+ InvalidResponse: "invalidResponse",
172
+ Defect: "defect"
173
+ };
174
+ var SearchBranchSearched = SearchBranch.Searched;
175
+ var SearchBranchNoMatch = SearchBranch.NoMatch;
176
+ var SearchBranchProviderRejected = SearchBranch.ProviderRejected;
177
+ var SearchBranchInvalidResponse = SearchBranch.InvalidResponse;
178
+ var SearchBranchDefect = SearchBranch.Defect;
179
+ var SearchDefinition = {
180
+ operation: { connectorId: ConnectorID, operationId: "search" },
181
+ branches: [
182
+ { id: "searched", description: "One page of title matches was read; Notion search matches titles only, is not guaranteed to be exhaustive, and indexes new pages with a delay." },
183
+ { id: "noMatch", description: "The first page of results is empty: no shared page or data source title contains the query, or the object was never shared with the connection.", optional: true },
184
+ { id: "providerRejected", description: "Notion conclusively rejected the search, such as an invalid token, a stale cursor, or a blocked connection.", optional: true },
185
+ { id: "invalidResponse", description: "Notion returned an invalid or oversized search page.", optional: true },
186
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
187
+ ],
188
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
189
+ };
190
+ var SearchMetadata = { kind: "query", idempotency: "none", authorization: "required" };
191
+ var QueryDatabaseBranch = {
192
+ Queried: "queried",
193
+ NotFound: "notFound",
194
+ ProviderRejected: "providerRejected",
195
+ InvalidResponse: "invalidResponse",
196
+ Defect: "defect"
197
+ };
198
+ var QueryDatabaseBranchQueried = QueryDatabaseBranch.Queried;
199
+ var QueryDatabaseBranchNotFound = QueryDatabaseBranch.NotFound;
200
+ var QueryDatabaseBranchProviderRejected = QueryDatabaseBranch.ProviderRejected;
201
+ var QueryDatabaseBranchInvalidResponse = QueryDatabaseBranch.InvalidResponse;
202
+ var QueryDatabaseBranchDefect = QueryDatabaseBranch.Defect;
203
+ var QueryDatabaseDefinition = {
204
+ operation: { connectorId: ConnectorID, operationId: "queryDatabase" },
205
+ branches: [
206
+ { id: "queried", description: "One page of matching rows was read; it can be empty." },
207
+ { id: "notFound", description: "The database or data source does not exist or is not shared with the connection.", optional: true },
208
+ { id: "providerRejected", description: "Notion conclusively rejected the query, such as a filter on a missing property or a type mismatch.", optional: true },
209
+ { id: "invalidResponse", description: "Notion returned an invalid or oversized query page.", optional: true },
210
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid, including a database ID whose database holds several data sources.", optional: true }
211
+ ],
212
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
213
+ };
214
+ var QueryDatabaseMetadata = { kind: "query", idempotency: "none", authorization: "required" };
215
+ var GetPageBranch = {
216
+ Found: "found",
217
+ NotFound: "notFound",
218
+ ProviderRejected: "providerRejected",
219
+ InvalidResponse: "invalidResponse",
220
+ Defect: "defect"
221
+ };
222
+ var GetPageBranchFound = GetPageBranch.Found;
223
+ var GetPageBranchNotFound = GetPageBranch.NotFound;
224
+ var GetPageBranchProviderRejected = GetPageBranch.ProviderRejected;
225
+ var GetPageBranchInvalidResponse = GetPageBranch.InvalidResponse;
226
+ var GetPageBranchDefect = GetPageBranch.Defect;
227
+ var GetPageDefinition = {
228
+ operation: { connectorId: ConnectorID, operationId: "getPage" },
229
+ branches: [
230
+ { id: "found", description: "The page and its bounded content were read." },
231
+ { id: "notFound", description: "The page does not exist or is not shared with the connection.", optional: true },
232
+ { id: "providerRejected", description: "Notion conclusively rejected the page read.", optional: true },
233
+ { id: "invalidResponse", description: "Notion returned an invalid or oversized page or block list.", optional: true },
234
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
235
+ ],
236
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
237
+ };
238
+ var GetPageMetadata = { kind: "query", idempotency: "none", authorization: "required" };
239
+ var CreatePageBranch = {
240
+ Created: "created",
241
+ NotFound: "notFound",
242
+ ProviderRejected: "providerRejected",
243
+ Uncertain: "uncertain",
244
+ InvalidResponse: "invalidResponse",
245
+ Defect: "defect"
246
+ };
247
+ var CreatePageBranchCreated = CreatePageBranch.Created;
248
+ var CreatePageBranchNotFound = CreatePageBranch.NotFound;
249
+ var CreatePageBranchProviderRejected = CreatePageBranch.ProviderRejected;
250
+ var CreatePageBranchUncertain = CreatePageBranch.Uncertain;
251
+ var CreatePageBranchInvalidResponse = CreatePageBranch.InvalidResponse;
252
+ var CreatePageBranchDefect = CreatePageBranch.Defect;
253
+ var CreatePageDefinition = {
254
+ operation: { connectorId: ConnectorID, operationId: "createPage" },
255
+ branches: [
256
+ { id: "created", description: "Notion created the page and returned or confirmed its ID." },
257
+ { id: "notFound", description: "The database or data source does not exist or is not shared with the connection; nothing was created.", optional: true },
258
+ { id: "providerRejected", description: "Notion conclusively rejected the page, such as a missing property, a value of the wrong type, missing Insert content capability, or a workspace limit; nothing was created.", optional: true },
259
+ { id: "uncertain", description: "The request was dispatched but its outcome cannot be confirmed; Notion has no idempotency key, so the page may exist and must not be created again automatically.", optional: true },
260
+ { id: "invalidResponse", description: "Notion returned an invalid or oversized database while the connector resolved its data source; nothing was created.", optional: true },
261
+ { id: "defect", description: "Local input, credential authorization, or connector definition is invalid, including a database ID whose database holds several data sources.", optional: true }
262
+ ],
263
+ stepDefaults: { executeMethodTimeoutMs: 12e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 6e4, maximumAttempts: 6, totalDurationMs: 3e5 } }
264
+ };
265
+ var CreatePageMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
266
+ var UpdatePagePropertiesBranch = {
267
+ Updated: "updated",
268
+ NotFound: "notFound",
269
+ ProviderRejected: "providerRejected",
270
+ InvalidResponse: "invalidResponse",
271
+ Defect: "defect"
272
+ };
273
+ var UpdatePagePropertiesBranchUpdated = UpdatePagePropertiesBranch.Updated;
274
+ var UpdatePagePropertiesBranchNotFound = UpdatePagePropertiesBranch.NotFound;
275
+ var UpdatePagePropertiesBranchProviderRejected = UpdatePagePropertiesBranch.ProviderRejected;
276
+ var UpdatePagePropertiesBranchInvalidResponse = UpdatePagePropertiesBranch.InvalidResponse;
277
+ var UpdatePagePropertiesBranchDefect = UpdatePagePropertiesBranch.Defect;
278
+ var UpdatePagePropertiesDefinition = {
279
+ operation: { connectorId: ConnectorID, operationId: "updatePageProperties" },
280
+ branches: [
281
+ { id: "updated", description: "Notion applied the property values and returned the page." },
282
+ { id: "notFound", description: "The page does not exist or is not shared with the connection; nothing was changed.", optional: true },
283
+ { id: "providerRejected", description: "Notion conclusively rejected the update, such as a missing property, a value of the wrong type, a locked or archived page, or missing Update content capability.", optional: true },
284
+ { id: "invalidResponse", description: "Notion applied the update but returned an invalid or oversized page.", optional: true },
285
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
286
+ ],
287
+ stepDefaults: { executeMethodTimeoutMs: 9e4, executeDurability: "async" }
288
+ };
289
+ var UpdatePagePropertiesMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
290
+
291
+ // src/generated/connection.ts
292
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
293
+ var Connection = class {
294
+ /** Stable provider and connection name. */
295
+ reference;
296
+ /** Bound provider operations. */
297
+ operations;
298
+ /** Validate a reference and bind operations. */
299
+ constructor(reference, operations) {
300
+ this.reference = ConnectionRefSchema.parse(reference);
301
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
302
+ if (!operations) throw new TypeError("connector operations are required");
303
+ this.operations = operations;
304
+ }
305
+ };
306
+ function newConnection(client, reference) {
307
+ if (!client) throw new TypeError("connector client is required");
308
+ return new Connection(reference, client);
309
+ }
310
+ function newConnectionWithOperations(operations, reference) {
311
+ return new Connection(reference, operations);
312
+ }
313
+ function newProjectConnection(project, connectionName, createClient) {
314
+ if (!project) throw new TypeError("loaded project is required");
315
+ const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
316
+ const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
317
+ if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
318
+ return newConnection(createClient(project, connectionName), reference);
319
+ }
320
+
321
+ export {
322
+ ConfigSchema,
323
+ decodeCredentials,
324
+ SearchInputSchema,
325
+ ParentSchema,
326
+ SearchMatchSchema,
327
+ SearchOutputSchema,
328
+ QueryFilterSchema,
329
+ QuerySortSchema,
330
+ QueryDatabaseInputSchema,
331
+ DateRangeSchema,
332
+ PagePropertySchema,
333
+ PageSchema,
334
+ QueryDatabaseOutputSchema,
335
+ GetPageInputSchema,
336
+ PageContentSchema,
337
+ GetPageOutputSchema,
338
+ PropertyValueSchema,
339
+ CreatePageInputSchema,
340
+ CreatePageOutputSchema,
341
+ UpdatePagePropertiesInputSchema,
342
+ UpdatePagePropertiesOutputSchema,
343
+ ConnectorID,
344
+ ProviderID,
345
+ SearchBranch,
346
+ SearchBranchSearched,
347
+ SearchBranchNoMatch,
348
+ SearchBranchProviderRejected,
349
+ SearchBranchInvalidResponse,
350
+ SearchBranchDefect,
351
+ SearchDefinition,
352
+ SearchMetadata,
353
+ QueryDatabaseBranch,
354
+ QueryDatabaseBranchQueried,
355
+ QueryDatabaseBranchNotFound,
356
+ QueryDatabaseBranchProviderRejected,
357
+ QueryDatabaseBranchInvalidResponse,
358
+ QueryDatabaseBranchDefect,
359
+ QueryDatabaseDefinition,
360
+ QueryDatabaseMetadata,
361
+ GetPageBranch,
362
+ GetPageBranchFound,
363
+ GetPageBranchNotFound,
364
+ GetPageBranchProviderRejected,
365
+ GetPageBranchInvalidResponse,
366
+ GetPageBranchDefect,
367
+ GetPageDefinition,
368
+ GetPageMetadata,
369
+ CreatePageBranch,
370
+ CreatePageBranchCreated,
371
+ CreatePageBranchNotFound,
372
+ CreatePageBranchProviderRejected,
373
+ CreatePageBranchUncertain,
374
+ CreatePageBranchInvalidResponse,
375
+ CreatePageBranchDefect,
376
+ CreatePageDefinition,
377
+ CreatePageMetadata,
378
+ UpdatePagePropertiesBranch,
379
+ UpdatePagePropertiesBranchUpdated,
380
+ UpdatePagePropertiesBranchNotFound,
381
+ UpdatePagePropertiesBranchProviderRejected,
382
+ UpdatePagePropertiesBranchInvalidResponse,
383
+ UpdatePagePropertiesBranchDefect,
384
+ UpdatePagePropertiesDefinition,
385
+ UpdatePagePropertiesMetadata,
386
+ Connection,
387
+ newConnection,
388
+ newConnectionWithOperations,
389
+ newProjectConnection
390
+ };