@keystrokehq/notion 0.0.1

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.
@@ -0,0 +1,117 @@
1
+ import { createNotionClient, withRateLimitRetry } from "./client.mjs";
2
+ import { normalizeDataSource, normalizeListMeta, normalizePage, notionDataSourceSchema, notionListResponseSchema, notionPageSchema } from "./schemas.mjs";
3
+ import { t as notionOperation } from "./factory-BttZ5eEq.mjs";
4
+ import { r as buildPaginationInput } from "./shared-C6A6JPl3.mjs";
5
+ import { z } from "zod";
6
+
7
+ //#region src/data-sources.ts
8
+ const databaseDiscoverySchema = z.object({
9
+ databaseId: z.string(),
10
+ dataSources: z.array(z.object({
11
+ id: z.string(),
12
+ name: z.string()
13
+ }))
14
+ });
15
+ const discoverDatabaseDataSources = notionOperation({
16
+ id: "discover_notion_database_data_sources",
17
+ name: "Discover Notion Database Data Sources",
18
+ description: "Retrieve the data-source references that belong to a Notion database",
19
+ input: z.object({ databaseId: z.string().min(1) }),
20
+ output: databaseDiscoverySchema,
21
+ run: async (input, credentials) => {
22
+ const client = createNotionClient(credentials);
23
+ const response = await withRateLimitRetry(() => client.databases.retrieve({ database_id: input.databaseId }));
24
+ return databaseDiscoverySchema.parse({
25
+ databaseId: input.databaseId,
26
+ dataSources: "data_sources" in response ? response.data_sources.map((dataSource) => ({
27
+ id: dataSource.id,
28
+ name: dataSource.name
29
+ })) : []
30
+ });
31
+ }
32
+ });
33
+ const getDataSource = notionOperation({
34
+ id: "get_notion_data_source",
35
+ name: "Get Notion Data Source",
36
+ description: "Retrieve a Notion data source by ID",
37
+ input: z.object({ dataSourceId: z.string().min(1) }),
38
+ output: notionDataSourceSchema,
39
+ run: async (input, credentials) => {
40
+ const client = createNotionClient(credentials);
41
+ return normalizeDataSource(await withRateLimitRetry(() => client.dataSources.retrieve({ data_source_id: input.dataSourceId })));
42
+ }
43
+ });
44
+ const queryDataSource = notionOperation({
45
+ id: "query_notion_data_source",
46
+ name: "Query Notion Data Source",
47
+ description: "Query pages in a Notion data source with filters, sorts, and pagination",
48
+ input: z.object({
49
+ dataSourceId: z.string().min(1),
50
+ filter: z.record(z.string(), z.unknown()).optional(),
51
+ sorts: z.array(z.record(z.string(), z.unknown())).optional(),
52
+ startCursor: z.string().optional(),
53
+ pageSize: z.number().int().positive().max(100).optional()
54
+ }),
55
+ output: notionListResponseSchema(notionPageSchema),
56
+ run: async (input, credentials) => {
57
+ const client = createNotionClient(credentials);
58
+ const response = await withRateLimitRetry(() => client.dataSources.query({
59
+ data_source_id: input.dataSourceId,
60
+ ...input.filter ? { filter: input.filter } : {},
61
+ ...input.sorts ? { sorts: input.sorts } : {},
62
+ ...buildPaginationInput(input.pageSize, input.startCursor)
63
+ }));
64
+ const meta = normalizeListMeta(response);
65
+ return {
66
+ results: response.results.map(normalizePage),
67
+ hasMore: meta.hasMore,
68
+ nextCursor: meta.nextCursor
69
+ };
70
+ }
71
+ });
72
+ const createDataSourceEntry = notionOperation({
73
+ id: "create_notion_data_source_entry",
74
+ name: "Create Notion Data Source Entry",
75
+ description: "Create a new page inside a Notion data source",
76
+ input: z.object({
77
+ dataSourceId: z.string().min(1),
78
+ properties: z.record(z.string(), z.unknown()),
79
+ children: z.array(z.record(z.string(), z.unknown())).max(100).optional()
80
+ }),
81
+ output: notionPageSchema,
82
+ needsApproval: true,
83
+ run: async (input, credentials) => {
84
+ const client = createNotionClient(credentials);
85
+ return normalizePage(await withRateLimitRetry(() => client.pages.create({
86
+ parent: {
87
+ type: "data_source_id",
88
+ data_source_id: input.dataSourceId
89
+ },
90
+ properties: input.properties,
91
+ ...input.children ? { children: input.children } : {}
92
+ })));
93
+ }
94
+ });
95
+ const updateDataSourceEntry = notionOperation({
96
+ id: "update_notion_data_source_entry",
97
+ name: "Update Notion Data Source Entry",
98
+ description: "Update the properties for a page that belongs to a Notion data source",
99
+ input: z.object({
100
+ pageId: z.string().min(1),
101
+ properties: z.record(z.string(), z.unknown()).optional(),
102
+ inTrash: z.boolean().optional()
103
+ }),
104
+ output: notionPageSchema,
105
+ needsApproval: true,
106
+ run: async (input, credentials) => {
107
+ const client = createNotionClient(credentials);
108
+ return normalizePage(await withRateLimitRetry(() => client.pages.update({
109
+ page_id: input.pageId,
110
+ ...input.properties ? { properties: input.properties } : {},
111
+ ...input.inTrash !== void 0 ? { in_trash: input.inTrash } : {}
112
+ })));
113
+ }
114
+ });
115
+
116
+ //#endregion
117
+ export { createDataSourceEntry, discoverDatabaseDataSources, getDataSource, queryDataSource, updateDataSourceEntry };
@@ -0,0 +1,80 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/events.d.ts
4
+ declare const notionPageWebhookEventTypes: readonly ["page.created", "page.content_updated", "page.properties_updated", "page.moved", "page.deleted", "page.undeleted", "page.locked", "page.unlocked"];
5
+ declare const notionCommentWebhookEventTypes: readonly ["comment.created", "comment.updated", "comment.deleted"];
6
+ declare const notionDataSourceWebhookEventTypes: readonly ["data_source.created", "data_source.content_updated", "data_source.schema_updated", "data_source.moved", "data_source.deleted", "data_source.undeleted"];
7
+ declare const notionWebhookEventTypes: readonly ["page.created", "page.content_updated", "page.properties_updated", "page.moved", "page.deleted", "page.undeleted", "page.locked", "page.unlocked", "comment.created", "comment.updated", "comment.deleted", "data_source.created", "data_source.content_updated", "data_source.schema_updated", "data_source.moved", "data_source.deleted", "data_source.undeleted"];
8
+ declare const notionWebhookActorSchema: z.ZodObject<{
9
+ id: z.ZodString;
10
+ type: z.ZodString;
11
+ }, z.core.$strip>;
12
+ declare const notionWebhookEntitySchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ type: z.ZodString;
15
+ }, z.core.$strip>;
16
+ declare const notionWebhookPayloadSchema: z.ZodObject<{
17
+ id: z.ZodString;
18
+ timestamp: z.ZodString;
19
+ workspace_id: z.ZodOptional<z.ZodString>;
20
+ subscription_id: z.ZodOptional<z.ZodString>;
21
+ integration_id: z.ZodOptional<z.ZodString>;
22
+ type: z.ZodString;
23
+ authors: z.ZodDefault<z.ZodArray<z.ZodObject<{
24
+ id: z.ZodString;
25
+ type: z.ZodString;
26
+ }, z.core.$strip>>>;
27
+ accessible_by: z.ZodDefault<z.ZodArray<z.ZodObject<{
28
+ id: z.ZodString;
29
+ type: z.ZodString;
30
+ }, z.core.$strip>>>;
31
+ attempt_number: z.ZodOptional<z.ZodNumber>;
32
+ entity: z.ZodObject<{
33
+ id: z.ZodString;
34
+ type: z.ZodString;
35
+ }, z.core.$strip>;
36
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
37
+ }, z.core.$strip>;
38
+ type NotionWebhookPayload = z.infer<typeof notionWebhookPayloadSchema>;
39
+ type NotionWebhookEventType = NotionWebhookPayload['type'];
40
+ declare const notionWebhookEventSchema: z.ZodObject<{
41
+ eventId: z.ZodString;
42
+ eventType: z.ZodString;
43
+ occurredAt: z.ZodString;
44
+ workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ subscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
+ integrationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
+ entityId: z.ZodString;
48
+ entityType: z.ZodString;
49
+ authors: z.ZodArray<z.ZodObject<{
50
+ id: z.ZodString;
51
+ type: z.ZodString;
52
+ }, z.core.$strip>>;
53
+ accessibleBy: z.ZodArray<z.ZodObject<{
54
+ id: z.ZodString;
55
+ type: z.ZodString;
56
+ }, z.core.$strip>>;
57
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
58
+ }, z.core.$strip>;
59
+ type NotionWebhookEvent = z.infer<typeof notionWebhookEventSchema>;
60
+ declare function normalizeWebhookEvent(payload: NotionWebhookPayload): NotionWebhookEvent;
61
+ declare const notionPollingEventSchema: z.ZodObject<{
62
+ eventId: z.ZodString;
63
+ eventType: z.ZodString;
64
+ occurredAt: z.ZodString;
65
+ entityId: z.ZodString;
66
+ entityType: z.ZodString;
67
+ source: z.ZodLiteral<"polling">;
68
+ data: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
69
+ }, z.core.$strip>;
70
+ type NotionPollingEvent = z.infer<typeof notionPollingEventSchema>;
71
+ declare function createPollingEvent(input: {
72
+ eventId: string;
73
+ eventType: string;
74
+ occurredAt: string;
75
+ entityId: string;
76
+ entityType: string;
77
+ data?: Record<string, unknown>;
78
+ }): NotionPollingEvent;
79
+ //#endregion
80
+ export { NotionPollingEvent, NotionWebhookEvent, NotionWebhookEventType, NotionWebhookPayload, createPollingEvent, normalizeWebhookEvent, notionCommentWebhookEventTypes, notionDataSourceWebhookEventTypes, notionPageWebhookEventTypes, notionPollingEventSchema, notionWebhookActorSchema, notionWebhookEntitySchema, notionWebhookEventSchema, notionWebhookEventTypes, notionWebhookPayloadSchema };
@@ -0,0 +1,99 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/events.ts
4
+ const notionPageWebhookEventTypes = [
5
+ "page.created",
6
+ "page.content_updated",
7
+ "page.properties_updated",
8
+ "page.moved",
9
+ "page.deleted",
10
+ "page.undeleted",
11
+ "page.locked",
12
+ "page.unlocked"
13
+ ];
14
+ const notionCommentWebhookEventTypes = [
15
+ "comment.created",
16
+ "comment.updated",
17
+ "comment.deleted"
18
+ ];
19
+ const notionDataSourceWebhookEventTypes = [
20
+ "data_source.created",
21
+ "data_source.content_updated",
22
+ "data_source.schema_updated",
23
+ "data_source.moved",
24
+ "data_source.deleted",
25
+ "data_source.undeleted"
26
+ ];
27
+ const notionWebhookEventTypes = [
28
+ ...notionPageWebhookEventTypes,
29
+ ...notionCommentWebhookEventTypes,
30
+ ...notionDataSourceWebhookEventTypes
31
+ ];
32
+ const notionWebhookActorSchema = z.object({
33
+ id: z.string(),
34
+ type: z.string()
35
+ });
36
+ const notionWebhookEntitySchema = z.object({
37
+ id: z.string(),
38
+ type: z.string()
39
+ });
40
+ const notionWebhookPayloadSchema = z.object({
41
+ id: z.string(),
42
+ timestamp: z.string(),
43
+ workspace_id: z.string().optional(),
44
+ subscription_id: z.string().optional(),
45
+ integration_id: z.string().optional(),
46
+ type: z.string(),
47
+ authors: z.array(notionWebhookActorSchema).default([]),
48
+ accessible_by: z.array(notionWebhookActorSchema).default([]),
49
+ attempt_number: z.number().int().positive().optional(),
50
+ entity: notionWebhookEntitySchema,
51
+ data: z.record(z.string(), z.unknown()).optional()
52
+ });
53
+ const notionWebhookEventSchema = z.object({
54
+ eventId: z.string(),
55
+ eventType: z.string(),
56
+ occurredAt: z.string(),
57
+ workspaceId: z.string().nullish(),
58
+ subscriptionId: z.string().nullish(),
59
+ integrationId: z.string().nullish(),
60
+ entityId: z.string(),
61
+ entityType: z.string(),
62
+ authors: z.array(notionWebhookActorSchema),
63
+ accessibleBy: z.array(notionWebhookActorSchema),
64
+ data: z.record(z.string(), z.unknown())
65
+ });
66
+ function normalizeWebhookEvent(payload) {
67
+ return notionWebhookEventSchema.parse({
68
+ eventId: payload.id,
69
+ eventType: payload.type,
70
+ occurredAt: payload.timestamp,
71
+ workspaceId: payload.workspace_id ?? null,
72
+ subscriptionId: payload.subscription_id ?? null,
73
+ integrationId: payload.integration_id ?? null,
74
+ entityId: payload.entity.id,
75
+ entityType: payload.entity.type,
76
+ authors: payload.authors,
77
+ accessibleBy: payload.accessible_by,
78
+ data: payload.data ?? {}
79
+ });
80
+ }
81
+ const notionPollingEventSchema = z.object({
82
+ eventId: z.string(),
83
+ eventType: z.string(),
84
+ occurredAt: z.string(),
85
+ entityId: z.string(),
86
+ entityType: z.string(),
87
+ source: z.literal("polling"),
88
+ data: z.record(z.string(), z.unknown()).default({})
89
+ });
90
+ function createPollingEvent(input) {
91
+ return notionPollingEventSchema.parse({
92
+ ...input,
93
+ source: "polling",
94
+ data: input.data ?? {}
95
+ });
96
+ }
97
+
98
+ //#endregion
99
+ export { createPollingEvent, normalizeWebhookEvent, notionCommentWebhookEventTypes, notionDataSourceWebhookEventTypes, notionPageWebhookEventTypes, notionPollingEventSchema, notionWebhookActorSchema, notionWebhookEntitySchema, notionWebhookEventSchema, notionWebhookEventTypes, notionWebhookPayloadSchema };
@@ -0,0 +1,8 @@
1
+ import { t as notion } from "./integration-Hfdp-q_v.mjs";
2
+ import { createOfficialOperationFactory } from "@keystrokehq/integration-authoring/official";
3
+
4
+ //#region src/factory.ts
5
+ const notionOperation = createOfficialOperationFactory(notion);
6
+
7
+ //#endregion
8
+ export { notionOperation as t };
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,56 @@
1
+ import * as _keystrokehq_integration_authoring_official0 from "@keystrokehq/integration-authoring/official";
2
+ import { z } from "zod";
3
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
4
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
5
+ import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
6
+
7
+ //#region src/integration.d.ts
8
+ declare const notionOfficialIntegration: {
9
+ id: "notion";
10
+ name: string;
11
+ description: string;
12
+ auth: z.ZodObject<{
13
+ NOTION_ACCESS_TOKEN: z.ZodString;
14
+ }, z.core.$strip>;
15
+ connections: ({
16
+ kind: "oauth";
17
+ tokenType: "refreshable";
18
+ authUrl: "https://api.notion.com/v1/oauth/authorize";
19
+ tokenUrl: "https://api.notion.com/v1/oauth/token";
20
+ revokeUrl: "https://api.notion.com/v1/oauth/revoke";
21
+ scopes: readonly ["content:read", "content:write", "comments:read", "comments:write", "users:read"];
22
+ vault: {
23
+ readonly accessToken: "NOTION_ACCESS_TOKEN";
24
+ };
25
+ oauth: {
26
+ readonly id: "official.notion.oauth";
27
+ };
28
+ buildAuthUrl: _keystrokehq_core_credential_set0.BuildAuthUrlHook;
29
+ exchangeCode: _keystrokehq_core_credential_set0.ExchangeCodeHook;
30
+ refreshToken: _keystrokehq_core_credential_set0.RefreshTokenHook;
31
+ id: string;
32
+ label: string;
33
+ recommended: true;
34
+ advanced?: undefined;
35
+ input?: undefined;
36
+ } | {
37
+ id: string;
38
+ kind: "manual";
39
+ label: string;
40
+ advanced: true;
41
+ input: z.ZodObject<{
42
+ NOTION_ACCESS_TOKEN: z.ZodString;
43
+ }, z.core.$strip>;
44
+ })[];
45
+ };
46
+ declare const notionBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"notion", z.ZodObject<{
47
+ NOTION_ACCESS_TOKEN: z.ZodString;
48
+ }, z.core.$strip>>;
49
+ declare const notion: _keystrokehq_core0.CredentialSet<"notion", z.ZodObject<{
50
+ NOTION_ACCESS_TOKEN: z.ZodString;
51
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
52
+ NOTION_ACCESS_TOKEN: z.ZodString;
53
+ }, z.core.$strip>>[] | undefined>;
54
+ type NotionCredentials = InferCredentialSetAuth<typeof notion>;
55
+ //#endregion
56
+ export { notionOfficialIntegration as i, notion as n, notionBundle as r, NotionCredentials as t };
@@ -0,0 +1,93 @@
1
+ import { defineOfficialIntegration } from "@keystrokehq/integration-authoring/official";
2
+ import { z } from "zod";
3
+ import { CredentialSet } from "@keystrokehq/core";
4
+ import { oauthDefaults, oauthPresets, pipe } from "@keystrokehq/credential-connection";
5
+
6
+ //#region src/_official/provider-app.ts
7
+ const notionAppCredentialSet = new CredentialSet({
8
+ id: "notion-app",
9
+ exposure: "platform-only",
10
+ name: "Notion App",
11
+ auth: z.object({
12
+ clientId: z.string().min(1),
13
+ clientSecret: z.string().min(1)
14
+ })
15
+ });
16
+ const notionPlatformProviderSeed = {
17
+ provider: "notion",
18
+ appRef: "notion-platform",
19
+ displayName: "Notion Platform",
20
+ credentialSetName: "Keystroke Notion Platform App",
21
+ envShape: {
22
+ KEYSTROKE_PLATFORM_NOTION_CLIENT_ID: z.string().optional(),
23
+ KEYSTROKE_PLATFORM_NOTION_CLIENT_SECRET: z.string().optional()
24
+ },
25
+ requiredEnvKeys: ["KEYSTROKE_PLATFORM_NOTION_CLIENT_ID", "KEYSTROKE_PLATFORM_NOTION_CLIENT_SECRET"],
26
+ externalAppIdEnvKey: "KEYSTROKE_PLATFORM_NOTION_CLIENT_ID",
27
+ buildCredentials: (env) => ({
28
+ clientId: env.KEYSTROKE_PLATFORM_NOTION_CLIENT_ID,
29
+ clientSecret: env.KEYSTROKE_PLATFORM_NOTION_CLIENT_SECRET
30
+ })
31
+ };
32
+ const notionWebhookCredentialSet = new CredentialSet({
33
+ id: "notion-webhook",
34
+ exposure: "platform-only",
35
+ name: "Notion Webhook",
36
+ auth: z.object({ verificationToken: z.string().min(1) })
37
+ });
38
+
39
+ //#endregion
40
+ //#region src/oauth-connection.ts
41
+ const notionTokenExchange = oauthPresets.basicAuthJsonBody();
42
+ const notionOAuthConnection = {
43
+ kind: "oauth",
44
+ tokenType: "refreshable",
45
+ authUrl: "https://api.notion.com/v1/oauth/authorize",
46
+ tokenUrl: "https://api.notion.com/v1/oauth/token",
47
+ revokeUrl: "https://api.notion.com/v1/oauth/revoke",
48
+ scopes: [
49
+ "content:read",
50
+ "content:write",
51
+ "comments:read",
52
+ "comments:write",
53
+ "users:read"
54
+ ],
55
+ vault: { accessToken: "NOTION_ACCESS_TOKEN" },
56
+ oauth: { id: "official.notion.oauth" },
57
+ buildAuthUrl: pipe(oauthDefaults.buildAuthUrl, oauthPresets.noScopeParam, oauthPresets.extraAuthParams({ owner: "user" })),
58
+ exchangeCode: pipe(oauthDefaults.exchangeCode, notionTokenExchange.exchangeCode),
59
+ refreshToken: pipe(oauthDefaults.refreshToken, notionTokenExchange.refreshToken)
60
+ };
61
+
62
+ //#endregion
63
+ //#region src/integration.ts
64
+ const notionAuthSchema = z.object({ NOTION_ACCESS_TOKEN: z.string().min(1) });
65
+ const notionOfficialIntegration = {
66
+ id: "notion",
67
+ name: "Notion",
68
+ description: "Notion pages, blocks, data sources, comments, users, search, and triggers",
69
+ auth: notionAuthSchema,
70
+ connections: [{
71
+ id: "oauth",
72
+ label: "Connect Notion workspace",
73
+ recommended: true,
74
+ ...notionOAuthConnection
75
+ }, {
76
+ id: "integration-token",
77
+ kind: "manual",
78
+ label: "Use internal integration token",
79
+ advanced: true,
80
+ input: notionAuthSchema
81
+ }]
82
+ };
83
+ const notionBundle = defineOfficialIntegration({
84
+ ...notionOfficialIntegration,
85
+ internal: {
86
+ providerApp: notionAppCredentialSet,
87
+ webhookVerification: notionWebhookCredentialSet
88
+ }
89
+ });
90
+ const notion = notionBundle.credentialSet;
91
+
92
+ //#endregion
93
+ export { notionPlatformProviderSeed as a, notionAppCredentialSet as i, notionBundle as n, notionWebhookCredentialSet as o, notionOfficialIntegration as r, notion as t };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,171 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
3
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
+
5
+ //#region src/pages.d.ts
6
+ declare const getPage: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ pageId: z.ZodString;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ id: z.ZodString;
10
+ object: z.ZodLiteral<"page">;
11
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ createdTime: z.ZodString;
14
+ lastEditedTime: z.ZodString;
15
+ archived: z.ZodOptional<z.ZodBoolean>;
16
+ inTrash: z.ZodOptional<z.ZodBoolean>;
17
+ parent: z.ZodOptional<z.ZodObject<{
18
+ type: z.ZodString;
19
+ pageId: z.ZodOptional<z.ZodString>;
20
+ blockId: z.ZodOptional<z.ZodString>;
21
+ dataSourceId: z.ZodOptional<z.ZodString>;
22
+ databaseId: z.ZodOptional<z.ZodString>;
23
+ workspace: z.ZodOptional<z.ZodBoolean>;
24
+ }, z.core.$strip>>;
25
+ properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
26
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"notion", z.ZodObject<{
27
+ NOTION_ACCESS_TOKEN: z.ZodString;
28
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
29
+ NOTION_ACCESS_TOKEN: z.ZodString;
30
+ }, z.core.$strip>>[] | undefined>], undefined>;
31
+ declare const createPage: _keystrokehq_core0.Operation<z.ZodObject<{
32
+ parent: z.ZodObject<{
33
+ pageId: z.ZodOptional<z.ZodString>;
34
+ databaseId: z.ZodOptional<z.ZodString>;
35
+ dataSourceId: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ title: z.ZodOptional<z.ZodString>;
38
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
39
+ children: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
40
+ }, z.core.$strip>, z.ZodObject<{
41
+ id: z.ZodString;
42
+ object: z.ZodLiteral<"page">;
43
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ createdTime: z.ZodString;
46
+ lastEditedTime: z.ZodString;
47
+ archived: z.ZodOptional<z.ZodBoolean>;
48
+ inTrash: z.ZodOptional<z.ZodBoolean>;
49
+ parent: z.ZodOptional<z.ZodObject<{
50
+ type: z.ZodString;
51
+ pageId: z.ZodOptional<z.ZodString>;
52
+ blockId: z.ZodOptional<z.ZodString>;
53
+ dataSourceId: z.ZodOptional<z.ZodString>;
54
+ databaseId: z.ZodOptional<z.ZodString>;
55
+ workspace: z.ZodOptional<z.ZodBoolean>;
56
+ }, z.core.$strip>>;
57
+ properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
58
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"notion", z.ZodObject<{
59
+ NOTION_ACCESS_TOKEN: z.ZodString;
60
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
61
+ NOTION_ACCESS_TOKEN: z.ZodString;
62
+ }, z.core.$strip>>[] | undefined>], undefined>;
63
+ declare const updatePage: _keystrokehq_core0.Operation<z.ZodObject<{
64
+ pageId: z.ZodString;
65
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
66
+ icon: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
67
+ cover: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
68
+ isLocked: z.ZodOptional<z.ZodBoolean>;
69
+ inTrash: z.ZodOptional<z.ZodBoolean>;
70
+ }, z.core.$strip>, z.ZodObject<{
71
+ id: z.ZodString;
72
+ object: z.ZodLiteral<"page">;
73
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
+ createdTime: z.ZodString;
76
+ lastEditedTime: z.ZodString;
77
+ archived: z.ZodOptional<z.ZodBoolean>;
78
+ inTrash: z.ZodOptional<z.ZodBoolean>;
79
+ parent: z.ZodOptional<z.ZodObject<{
80
+ type: z.ZodString;
81
+ pageId: z.ZodOptional<z.ZodString>;
82
+ blockId: z.ZodOptional<z.ZodString>;
83
+ dataSourceId: z.ZodOptional<z.ZodString>;
84
+ databaseId: z.ZodOptional<z.ZodString>;
85
+ workspace: z.ZodOptional<z.ZodBoolean>;
86
+ }, z.core.$strip>>;
87
+ properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
88
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"notion", z.ZodObject<{
89
+ NOTION_ACCESS_TOKEN: z.ZodString;
90
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
91
+ NOTION_ACCESS_TOKEN: z.ZodString;
92
+ }, z.core.$strip>>[] | undefined>], undefined>;
93
+ declare const copyPageContent: _keystrokehq_core0.Operation<z.ZodObject<{
94
+ sourcePageId: z.ZodString;
95
+ targetPageId: z.ZodString;
96
+ }, z.core.$strip>, z.ZodObject<{
97
+ success: z.ZodLiteral<true>;
98
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"notion", z.ZodObject<{
99
+ NOTION_ACCESS_TOKEN: z.ZodString;
100
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
101
+ NOTION_ACCESS_TOKEN: z.ZodString;
102
+ }, z.core.$strip>>[] | undefined>], undefined>;
103
+ declare const trashPage: _keystrokehq_core0.Operation<z.ZodObject<{
104
+ pageId: z.ZodString;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ id: z.ZodString;
107
+ object: z.ZodLiteral<"page">;
108
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
109
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
+ createdTime: z.ZodString;
111
+ lastEditedTime: z.ZodString;
112
+ archived: z.ZodOptional<z.ZodBoolean>;
113
+ inTrash: z.ZodOptional<z.ZodBoolean>;
114
+ parent: z.ZodOptional<z.ZodObject<{
115
+ type: z.ZodString;
116
+ pageId: z.ZodOptional<z.ZodString>;
117
+ blockId: z.ZodOptional<z.ZodString>;
118
+ dataSourceId: z.ZodOptional<z.ZodString>;
119
+ databaseId: z.ZodOptional<z.ZodString>;
120
+ workspace: z.ZodOptional<z.ZodBoolean>;
121
+ }, z.core.$strip>>;
122
+ properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
123
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"notion", z.ZodObject<{
124
+ NOTION_ACCESS_TOKEN: z.ZodString;
125
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
126
+ NOTION_ACCESS_TOKEN: z.ZodString;
127
+ }, z.core.$strip>>[] | undefined>], undefined>;
128
+ declare const getPageProperty: _keystrokehq_core0.Operation<z.ZodObject<{
129
+ pageId: z.ZodString;
130
+ propertyId: z.ZodString;
131
+ limit: z.ZodOptional<z.ZodNumber>;
132
+ startCursor: z.ZodOptional<z.ZodString>;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ object: z.ZodString;
135
+ id: z.ZodOptional<z.ZodString>;
136
+ type: z.ZodOptional<z.ZodString>;
137
+ value: z.ZodUnknown;
138
+ nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
+ hasMore: z.ZodOptional<z.ZodBoolean>;
140
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"notion", z.ZodObject<{
141
+ NOTION_ACCESS_TOKEN: z.ZodString;
142
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
143
+ NOTION_ACCESS_TOKEN: z.ZodString;
144
+ }, z.core.$strip>>[] | undefined>], undefined>;
145
+ declare const restorePage: _keystrokehq_core0.Operation<z.ZodObject<{
146
+ pageId: z.ZodString;
147
+ }, z.core.$strip>, z.ZodObject<{
148
+ id: z.ZodString;
149
+ object: z.ZodLiteral<"page">;
150
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
151
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
152
+ createdTime: z.ZodString;
153
+ lastEditedTime: z.ZodString;
154
+ archived: z.ZodOptional<z.ZodBoolean>;
155
+ inTrash: z.ZodOptional<z.ZodBoolean>;
156
+ parent: z.ZodOptional<z.ZodObject<{
157
+ type: z.ZodString;
158
+ pageId: z.ZodOptional<z.ZodString>;
159
+ blockId: z.ZodOptional<z.ZodString>;
160
+ dataSourceId: z.ZodOptional<z.ZodString>;
161
+ databaseId: z.ZodOptional<z.ZodString>;
162
+ workspace: z.ZodOptional<z.ZodBoolean>;
163
+ }, z.core.$strip>>;
164
+ properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
165
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"notion", z.ZodObject<{
166
+ NOTION_ACCESS_TOKEN: z.ZodString;
167
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
168
+ NOTION_ACCESS_TOKEN: z.ZodString;
169
+ }, z.core.$strip>>[] | undefined>], undefined>;
170
+ //#endregion
171
+ export { copyPageContent, createPage, getPage, getPageProperty, restorePage, trashPage, updatePage };