@notionhq/apps 0.0.16 → 0.0.17

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.
Files changed (56) hide show
  1. package/README.md +27 -2
  2. package/dist/connections.d.ts +39 -11
  3. package/dist/connections.d.ts.map +1 -1
  4. package/dist/connections.js +85 -21
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +2 -0
  8. package/dist/notion-as-code/database.d.ts +3 -2
  9. package/dist/notion-as-code/database.d.ts.map +1 -1
  10. package/dist/notion-as-code/handles.d.ts +2 -0
  11. package/dist/notion-as-code/handles.d.ts.map +1 -1
  12. package/dist/notion-as-code/handles.js +2 -0
  13. package/dist/notion-as-code/index.d.ts +3 -0
  14. package/dist/notion-as-code/index.d.ts.map +1 -1
  15. package/dist/notion-as-code/intents.d.ts +2 -1
  16. package/dist/notion-as-code/intents.d.ts.map +1 -1
  17. package/dist/notion-as-code/view.d.ts +12 -0
  18. package/dist/notion-as-code/view.d.ts.map +1 -0
  19. package/dist/notion-as-code/view.js +13 -0
  20. package/dist/notion-as-code/views-types.test.d.ts +2 -0
  21. package/dist/notion-as-code/views-types.test.d.ts.map +1 -0
  22. package/dist/notion-as-code/views.d.ts +469 -0
  23. package/dist/notion-as-code/views.d.ts.map +1 -0
  24. package/dist/notion-as-code/views.js +0 -0
  25. package/dist/oauth.d.ts +11 -0
  26. package/dist/oauth.d.ts.map +1 -0
  27. package/dist/oauth.js +26 -0
  28. package/dist/providers.generated.d.ts +26 -86
  29. package/dist/providers.generated.d.ts.map +1 -1
  30. package/dist/providers.generated.js +54 -66
  31. package/dist/triggers.generated.d.ts +3 -3
  32. package/dist/triggers.generated.d.ts.map +1 -1
  33. package/dist/workflow.d.ts +8 -8
  34. package/dist/workflow.d.ts.map +1 -1
  35. package/dist/workflow.js +12 -6
  36. package/docs/CONNECTIONS.md +70 -22
  37. package/package.json +1 -1
  38. package/skills/connections/SKILL.md +7 -8
  39. package/skills/notion-as-code/SKILL.md +8 -2
  40. package/src/connections.test.ts +205 -41
  41. package/src/connections.ts +144 -38
  42. package/src/index.ts +1 -0
  43. package/src/notion-as-code/database.ts +3 -3
  44. package/src/notion-as-code/handles.ts +2 -0
  45. package/src/notion-as-code/index.ts +55 -0
  46. package/src/notion-as-code/intents.ts +2 -2
  47. package/src/notion-as-code/view.ts +23 -0
  48. package/src/notion-as-code/views-types.test.ts +59 -0
  49. package/src/notion-as-code/views.ts +554 -0
  50. package/src/oauth.ts +40 -0
  51. package/src/providers.generated.ts +68 -163
  52. package/src/triggers.generated.ts +4 -4
  53. package/src/workflow-connections-types.test.ts +16 -10
  54. package/src/workflow-types.test.ts +88 -16
  55. package/src/workflow.test.ts +45 -17
  56. package/src/workflow.ts +31 -17
@@ -24,85 +24,73 @@ const connections = {
24
24
  outlook,
25
25
  salesforce
26
26
  };
27
- function createConnectionProviders(invoker) {
28
- return {
29
- calendar(key = "calendar") {
30
- return new CalendarConnectionClient(invoker("calendar", key));
31
- },
32
- slack(key = "slack") {
33
- return new SlackConnectionClient(invoker("slack", key));
34
- },
35
- googleDriveOauth(key = "googleDriveOauth") {
36
- return new GoogleDriveOauthConnectionClient(
37
- invoker("googleDriveOauth", key)
38
- );
39
- },
40
- discord(key = "discord") {
41
- return new DiscordConnectionClient(invoker("discord", key));
42
- },
43
- cursor(key = "cursor") {
44
- return new CursorConnectionClient(invoker("cursor", key));
45
- },
46
- box(key = "box") {
47
- return new BoxConnectionClient(invoker("box", key));
48
- },
49
- confluence(key = "confluence") {
50
- return new ConfluenceConnectionClient(invoker("confluence", key));
51
- },
52
- gmail(key = "gmail") {
53
- return new GmailConnectionClient(invoker("gmail", key));
54
- },
55
- googleCalendar(key = "googleCalendar") {
56
- return new GoogleCalendarConnectionClient(invoker("googleCalendar", key));
57
- },
58
- googleDrive(key = "googleDrive") {
59
- return new GoogleDriveConnectionClient(invoker("googleDrive", key));
60
- },
61
- outlook(key = "outlook") {
62
- return new OutlookConnectionClient(invoker("outlook", key));
63
- },
64
- salesforce(key = "salesforce") {
65
- return new SalesforceConnectionClient(invoker("salesforce", key));
66
- }
67
- };
27
+ function createConnectionClient(provider, invoker) {
28
+ switch (provider) {
29
+ case "calendar":
30
+ return new CalendarConnectionClient(invoker);
31
+ case "slack":
32
+ return new SlackConnectionClient(invoker);
33
+ case "googleDriveOauth":
34
+ return new GoogleDriveOauthConnectionClient(invoker);
35
+ case "discord":
36
+ return new DiscordConnectionClient(invoker);
37
+ case "cursor":
38
+ return new CursorConnectionClient(invoker);
39
+ case "box":
40
+ return new BoxConnectionClient(invoker);
41
+ case "confluence":
42
+ return new ConfluenceConnectionClient(invoker);
43
+ case "gmail":
44
+ return new GmailConnectionClient(invoker);
45
+ case "googleCalendar":
46
+ return new GoogleCalendarConnectionClient(invoker);
47
+ case "googleDrive":
48
+ return new GoogleDriveConnectionClient(invoker);
49
+ case "outlook":
50
+ return new OutlookConnectionClient(invoker);
51
+ case "salesforce":
52
+ return new SalesforceConnectionClient(invoker);
53
+ default:
54
+ throw new Error("Unsupported connection provider: " + provider);
55
+ }
68
56
  }
69
- function calendar(options = {}) {
70
- return { type: "calendar", ...options };
57
+ function calendar() {
58
+ return { type: "calendar" };
71
59
  }
72
- function slack(options = {}) {
73
- return { type: "slack", ...options };
60
+ function slack() {
61
+ return { type: "slack" };
74
62
  }
75
- function googleDriveOauth(options = {}) {
76
- return { type: "googleDriveOauth", ...options };
63
+ function googleDriveOauth() {
64
+ return { type: "googleDriveOauth" };
77
65
  }
78
- function discord(options = {}) {
79
- return { type: "discord", ...options };
66
+ function discord() {
67
+ return { type: "discord" };
80
68
  }
81
- function cursor(options = {}) {
82
- return { type: "cursor", ...options };
69
+ function cursor() {
70
+ return { type: "cursor" };
83
71
  }
84
- function box(options = {}) {
85
- return { type: "box", ...options };
72
+ function box() {
73
+ return { type: "box" };
86
74
  }
87
- function confluence(options = {}) {
88
- return { type: "confluence", ...options };
75
+ function confluence() {
76
+ return { type: "confluence" };
89
77
  }
90
- function gmail(options = {}) {
91
- return { type: "gmail", ...options };
78
+ function gmail() {
79
+ return { type: "gmail" };
92
80
  }
93
- function googleCalendar(options = {}) {
94
- return { type: "googleCalendar", ...options };
81
+ function googleCalendar() {
82
+ return { type: "googleCalendar" };
95
83
  }
96
- function googleDrive(options = {}) {
97
- return { type: "googleDrive", ...options };
84
+ function googleDrive() {
85
+ return { type: "googleDrive" };
98
86
  }
99
- function outlook(options = {}) {
100
- return { type: "outlook", ...options };
87
+ function outlook() {
88
+ return { type: "outlook" };
101
89
  }
102
- function salesforce(options = {}) {
103
- return { type: "salesforce", ...options };
90
+ function salesforce() {
91
+ return { type: "salesforce" };
104
92
  }
105
93
  export {
106
94
  connections,
107
- createConnectionProviders
95
+ createConnectionClient
108
96
  };
@@ -1,4 +1,4 @@
1
- import type { WorkflowConnection, WorkflowConnectionKeys } from "./connections.js";
1
+ import type { WorkflowConnectionDeclarations, WorkflowConnectionKeys } from "./connections.js";
2
2
  import type { CalendarEventCanceledEvent, CalendarEventCreatedEvent, CalendarEventUpdatedEvent, DiscordInteractionEvent, GoogleDriveOauthFilesChangedEvent, MailEmailReceivedEvent, MailEmailSentEvent, MailLabelAppliedEvent, NotionAgentMentionedEvent, NotionButtonPressedEvent, NotionCommentAddedEvent, NotionDatabaseAgentUpdatedEvent, NotionMeetingNoteSummaryCompletedEvent, NotionPageCreatedEvent, NotionPageDeletedEvent, NotionPageUpdatedEvent, RecurrenceEvent, SlackAppMentionEvent, SlackMessageEvent, SlackReactionAddedEvent, WebhookEvent } from "./triggers.js";
3
3
  export type { Actor, ActorLike, CalendarEventCanceledEvent, CalendarEventCreatedEvent, CalendarEventLike, CalendarEventUpdatedEvent, ChatMessageLike, ChatThreadMessage, DiscordChatThreadMessage, DiscordInteractionEvent, EmailMessageLike, EmailThreadLike, EmailTriggerMessage, GoogleDriveOauthFilesChangedEvent, LinkLike, MailEmailReceivedEvent, MailEmailSentEvent, MailLabelAppliedEvent, MessageLike, NotionAgentMentionedEvent, NotionButtonPressedEvent, NotionCommentAddedEvent, NotionDatabaseAgentUpdatedEvent, NotionMeetingNoteSummaryCompletedEvent, NotionPageCreatedEvent, NotionPageDeletedEvent, NotionPageEdit, NotionPageUpdatedEvent, RecurrenceEvent, RecurrenceFrequency, SlackAppMentionEvent, SlackChatThreadMessage, SlackMessageEvent, SlackReactionAddedEvent, ThreadLike, ThreadMessage, TimestampLike, TriggerEvent, TriggerEventBase, TriggerEventMap, TriggerType, VendorActor, VendorExtensions, WebhookEvent, } from "./triggers.js";
4
4
  /** Triggers immediately after a new message is posted in Slack (includes new threads and replies) */
@@ -247,7 +247,7 @@ export declare const triggers: {
247
247
  readonly scheduled: () => RecurrenceTrigger;
248
248
  };
249
249
  /** Trigger creators restricted to the workflow's declared provider keys. */
250
- export type WorkflowTriggerCreators<TConnections extends readonly WorkflowConnection[]> = {
250
+ export type WorkflowTriggerCreators<TConnections extends WorkflowConnectionDeclarations> = {
251
251
  slackMessage(options?: {
252
252
  connectionKey: WorkflowConnectionKeys<TConnections, "slack">;
253
253
  }): SlackMessageTrigger<WorkflowConnectionKeys<TConnections, "slack">>;
@@ -287,7 +287,7 @@ export type WorkflowTriggerCreators<TConnections extends readonly WorkflowConnec
287
287
  scheduled(): RecurrenceTrigger;
288
288
  };
289
289
  /** Triggers whose connection keys belong to the declared provider. */
290
- export type WorkflowTriggerForConnections<TConnections extends readonly WorkflowConnection[]> = SlackMessageTrigger<WorkflowConnectionKeys<TConnections, "slack">> | SlackReactionAddedTrigger<WorkflowConnectionKeys<TConnections, "slack">> | SlackAppMentionTrigger<WorkflowConnectionKeys<TConnections, "slack">> | DiscordInteractionTrigger<WorkflowConnectionKeys<TConnections, "discord">> | MailEmailReceivedTrigger | MailEmailSentTrigger | MailLabelAppliedTrigger | CalendarEventCreatedTrigger<WorkflowConnectionKeys<TConnections, "calendar">> | CalendarEventUpdatedTrigger<WorkflowConnectionKeys<TConnections, "calendar">> | CalendarEventCanceledTrigger<WorkflowConnectionKeys<TConnections, "calendar">> | NotionPageCreatedTrigger | NotionPageUpdatedTrigger | NotionPageDeletedTrigger | NotionMeetingNoteSummaryCompletedTrigger | NotionCommentAddedTrigger | NotionAgentMentionedTrigger | NotionButtonPressedTrigger | NotionDatabaseAgentUpdatedTrigger | WebhookTrigger | GoogleDriveOauthFilesChangedTrigger<WorkflowConnectionKeys<TConnections, "googleDriveOauth">> | RecurrenceTrigger;
290
+ export type WorkflowTriggerForConnections<TConnections extends WorkflowConnectionDeclarations> = SlackMessageTrigger<WorkflowConnectionKeys<TConnections, "slack">> | SlackReactionAddedTrigger<WorkflowConnectionKeys<TConnections, "slack">> | SlackAppMentionTrigger<WorkflowConnectionKeys<TConnections, "slack">> | DiscordInteractionTrigger<WorkflowConnectionKeys<TConnections, "discord">> | MailEmailReceivedTrigger | MailEmailSentTrigger | MailLabelAppliedTrigger | CalendarEventCreatedTrigger<WorkflowConnectionKeys<TConnections, "calendar">> | CalendarEventUpdatedTrigger<WorkflowConnectionKeys<TConnections, "calendar">> | CalendarEventCanceledTrigger<WorkflowConnectionKeys<TConnections, "calendar">> | NotionPageCreatedTrigger | NotionPageUpdatedTrigger | NotionPageDeletedTrigger | NotionMeetingNoteSummaryCompletedTrigger | NotionCommentAddedTrigger | NotionAgentMentionedTrigger | NotionButtonPressedTrigger | NotionDatabaseAgentUpdatedTrigger | WebhookTrigger | GoogleDriveOauthFilesChangedTrigger<WorkflowConnectionKeys<TConnections, "googleDriveOauth">> | RecurrenceTrigger;
291
291
  /** Event that can trigger a workflow. */
292
292
  export type WorkflowTrigger = SlackMessageTrigger | SlackReactionAddedTrigger | SlackAppMentionTrigger | DiscordInteractionTrigger | MailEmailReceivedTrigger | MailEmailSentTrigger | MailLabelAppliedTrigger | CalendarEventCreatedTrigger | CalendarEventUpdatedTrigger | CalendarEventCanceledTrigger | NotionPageCreatedTrigger | NotionPageUpdatedTrigger | NotionPageDeletedTrigger | NotionMeetingNoteSummaryCompletedTrigger | NotionCommentAddedTrigger | NotionAgentMentionedTrigger | NotionButtonPressedTrigger | NotionDatabaseAgentUpdatedTrigger | WebhookTrigger | GoogleDriveOauthFilesChangedTrigger | RecurrenceTrigger;
293
293
  /** All workflow trigger type strings. */
@@ -1 +1 @@
1
- {"version":3,"file":"triggers.generated.d.ts","sourceRoot":"","sources":["../src/triggers.generated.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAEnF,OAAO,KAAK,EACX,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,sCAAsC,EACtC,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,KAAK,EACL,SAAS,EACT,0BAA0B,EAC1B,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,iCAAiC,EACjC,QAAQ,EACR,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,sCAAsC,EACtC,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,UAAU,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,WAAW,EACX,gBAA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CAAC;IACtD,qBAAqB,EAAE,sBAAsB,CAAC;IAC9C,qBAAqB,EAAE,sBAAsB,CAAC;IAC9C,qBAAqB,EAAE,sBAAsB,CAAC;IAC9C,sCAAsC,EAAE,sCAAsC,CAAC;IAC/E,sCAAsC,EAAE,uBAAuB,CAAC;IAChE,wBAAwB,EAAE,yBAAyB,CAAC;IACpD,uBAAuB,EAAE,wBAAwB,CAAC;IAClD,+BAA+B,EAAE,+BAA+B,CAAC;IACjE,kBAAkB,EAAE,YAAY,CAAC;IACjC,+BAA+B,EAAE,iCAAiC,CAAC;IACnE,UAAU,EAAE,eAAe,CAAC;CAC5B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type WorkflowConnection, type WorkflowConnections } from "./connections.js";
1
+ import { type WorkflowConnectionDeclarations, type WorkflowConnectionRequirement, type WorkflowConnections } from "./connections.js";
2
2
  import type { CapabilityContext } from "./context.js";
3
3
  import { type RunMetadata } from "./runtime-metadata.js";
4
4
  import type { WorkflowEventMap, WorkflowTrigger, WorkflowTriggerCreators, WorkflowTriggerForConnections } from "./triggers.generated.js";
@@ -9,11 +9,11 @@ type HandlerOptions = {
9
9
  export type WorkflowEvent = WorkflowEventMap[keyof WorkflowEventMap];
10
10
  export type WorkflowEventForTrigger<T extends WorkflowTrigger> = WorkflowEventMap[T["type"]];
11
11
  export type WorkflowEventForTriggers<T extends readonly WorkflowTrigger[]> = WorkflowEventForTrigger<T[number]>;
12
- export { connections, type WorkflowConnection, type WorkflowConnections } from "./connections.js";
12
+ export { connections, type WorkflowConnection, type WorkflowConnectionDeclarations, type WorkflowConnectionRequirement, type WorkflowConnections, type OAuthConfiguration, type OAuthConnection, } from "./connections.js";
13
13
  /**
14
14
  * Configuration passed to {@link workflow}.
15
15
  */
16
- export type WorkflowConfiguration<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]], TConnections extends readonly WorkflowConnection[] = readonly WorkflowConnection[]> = {
16
+ export type WorkflowConfiguration<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]], TConnections extends WorkflowConnectionDeclarations = WorkflowConnectionDeclarations> = {
17
17
  /**
18
18
  * A human-readable name for the workflow, shown in the UI when viewing workflows
19
19
  */
@@ -35,7 +35,7 @@ export type WorkflowConfiguration<TTriggers extends readonly [WorkflowTrigger, .
35
35
  handler: (event: WorkflowEventForTriggers<TTriggers>, context: WorkflowContext<TConnections>) => Promise<void> | void;
36
36
  };
37
37
  /** Configuration that checks trigger keys against declared connections. */
38
- export type WorkflowTriggerConfiguration<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]], TConnections extends readonly WorkflowConnection[]> = Omit<WorkflowConfiguration<TTriggers, TConnections>, "triggers"> & {
38
+ export type WorkflowTriggerConfiguration<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]], TConnections extends WorkflowConnectionDeclarations> = Omit<WorkflowConfiguration<TTriggers, TConnections>, "triggers"> & {
39
39
  triggers: (context: {
40
40
  triggers: WorkflowTriggerCreators<NoInfer<TConnections>>;
41
41
  }) => TTriggers;
@@ -55,7 +55,7 @@ export type Workflow<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTri
55
55
  name: string;
56
56
  description: string;
57
57
  triggers: TTriggers;
58
- connections?: readonly WorkflowConnection[];
58
+ connections?: readonly WorkflowConnectionRequirement[];
59
59
  };
60
60
  handler: (event: WorkflowEventForTriggers<TTriggers>, options?: HandlerOptions) => Promise<{
61
61
  status: "success";
@@ -90,8 +90,8 @@ export type Workflow<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTri
90
90
  export declare function workflow<const TTriggers extends readonly [
91
91
  WorkflowTriggerForConnections<NoInfer<TConnections>>,
92
92
  ...WorkflowTriggerForConnections<NoInfer<TConnections>>[]
93
- ], const TConnections extends readonly WorkflowConnection[] = readonly []>(configuration: WorkflowTriggerConfiguration<TTriggers, TConnections>): Workflow<TTriggers>;
94
- export declare function workflow<const TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]], const TConnections extends readonly WorkflowConnection[] = readonly []>(configuration: WorkflowConfiguration<TTriggers, TConnections>): Workflow<TTriggers>;
93
+ ], const TConnections extends WorkflowConnectionDeclarations = Record<never, never>>(configuration: WorkflowTriggerConfiguration<TTriggers, TConnections>): Workflow<TTriggers>;
94
+ export declare function workflow<const TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]], const TConnections extends WorkflowConnectionDeclarations = Record<never, never>>(configuration: WorkflowConfiguration<TTriggers, TConnections>): Workflow<TTriggers>;
95
95
  /** Context passed to a workflow step. */
96
96
  export type StepContext = {
97
97
  /**
@@ -115,7 +115,7 @@ type WorkflowStep = {
115
115
  <T>(name: string, options: WorkflowStepOptions, fn: (context: StepContext) => T | Promise<T>): Promise<WorkflowStepResult<T>>;
116
116
  };
117
117
  /** Context passed to a workflow handler. */
118
- export type WorkflowContext<TConnections extends readonly WorkflowConnection[] = readonly WorkflowConnection[]> = CapabilityContext & {
118
+ export type WorkflowContext<TConnections extends WorkflowConnectionDeclarations = WorkflowConnectionDeclarations> = CapabilityContext & {
119
119
  connections: WorkflowConnections<TConnections>;
120
120
  } & RunMetadata & {
121
121
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAKtD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,KAAK,EACX,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,6BAA6B,EAC7B,MAAM,yBAAyB,CAAC;AAEjC,KAAK,cAAc,GAAG;IACrB,yEAAyE;IACzE,cAAc,CAAC,EAAE,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,gBAA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;;;;;;;;;;;OAmBG;IACH,IAAI,EAAE,YAAY,CAAC;CACnB,CAAC"}
package/dist/workflow.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createWorkflowConnections,
3
- validateConnectionRequirements,
3
+ normalizeConnectionRequirements,
4
4
  validateTriggerConnections
5
5
  } from "./connections.js";
6
6
  import { createHash } from "node:crypto";
@@ -12,18 +12,21 @@ import { writeOutput } from "./output.js";
12
12
  import { resolveRuntimeInput } from "./runtime-input.js";
13
13
  import { readRunMetadata } from "./runtime-metadata.js";
14
14
  import { createWorkflowTriggers } from "./triggers.generated.js";
15
- import { connections } from "./connections.js";
15
+ import {
16
+ connections
17
+ } from "./connections.js";
16
18
  function workflow(configuration) {
19
+ const requirements = normalizeConnectionRequirements(configuration.connections ?? {});
20
+ const connectionDeclarations = configuration.connections === void 0 ? void 0 : structuredClone(configuration.connections);
17
21
  const triggers = typeof configuration.triggers === "function" ? configuration.triggers({ triggers: createWorkflowTriggers() }) : configuration.triggers;
18
- validateConnectionRequirements(configuration.connections ?? []);
19
- validateTriggerConnections(triggers, configuration.connections ?? []);
22
+ validateTriggerConnections(triggers, requirements);
20
23
  return {
21
24
  _tag: "workflow",
22
25
  config: {
23
26
  name: configuration.name,
24
27
  description: configuration.description,
25
28
  triggers,
26
- ...configuration.connections === void 0 ? {} : { connections: configuration.connections }
29
+ ...configuration.connections === void 0 ? {} : { connections: requirements }
27
30
  },
28
31
  async handler(event, options) {
29
32
  try {
@@ -32,7 +35,10 @@ function workflow(configuration) {
32
35
  const baseContext = createCapabilityContext();
33
36
  const capabilityContext = {
34
37
  ...baseContext,
35
- connections: createWorkflowConnections(baseContext.notion),
38
+ connections: createWorkflowConnections(
39
+ baseContext.notion,
40
+ connectionDeclarations
41
+ ),
36
42
  ...runMetadata,
37
43
  step: createStep(runMetadata)
38
44
  };
@@ -11,15 +11,15 @@ export default workflow({
11
11
  name: "List work calendars",
12
12
  description: "List calendars available through the work connection",
13
13
  triggers: [triggers.notionPageCreated()],
14
- connections: [connections.calendar({ key: "work" })],
14
+ connections: { work: connections.calendar() },
15
15
  handler: async (_event, context) => {
16
- const calendars = await context.connections.calendar("work").listCalendars({});
16
+ const calendars = await context.connections.work.listCalendars({});
17
17
  console.log(calendars.accounts);
18
18
  },
19
19
  });
20
20
  ```
21
21
 
22
- An omitted key defaults to the provider type, so `connections.calendar()` is accessed through `context.connections.calendar()`. Keys must be unique, begin with a letter, and contain at most 128 letters, numbers, underscores, or hyphens. A workflow can declare up to 100 requirements.
22
+ The object property name is the connection key. Provider factories do not take a key option. Keys must begin with a letter and contain at most 128 letters, numbers, underscores, or hyphens; `constructor` and `prototype` are reserved. A workflow can declare up to 100 connections.
23
23
 
24
24
  ## Trigger a workflow from a connection
25
25
 
@@ -29,25 +29,25 @@ Use a trigger callback to check connection keys against the workflow’s declare
29
29
  export default workflow({
30
30
  name: "Support messages",
31
31
  description: "Run when a message arrives in the configured support channel",
32
- connections: [connections.slack({ key: "support" })],
32
+ connections: { support: connections.slack() },
33
33
  triggers: ({ triggers }) => [triggers.slackMessage({ connectionKey: "support" })],
34
34
  handler: async (event, context) => {
35
35
  console.log(event);
36
- const user = await context.connections
37
- .slack("support")
38
- .findUserByEmail({ email: "person@example.com" });
36
+ const user = await context.connections.support.findUserByEmail({
37
+ email: "person@example.com",
38
+ });
39
39
  console.log(user);
40
40
  },
41
41
  });
42
42
  ```
43
43
 
44
- The callback’s `triggers.slackMessage` accepts only Slack keys declared in `connections`. In this example, `"typo"` is a type error, and a Calendar connection named `"support"` would not satisfy a Slack trigger. Keys remain literal when you save a declaration in a variable, so the same check works with `const support = connections.slack({ key: "support" })`. Omitting the declaration key defaults to the provider name.
44
+ The callback’s `triggers.slackMessage` accepts only Slack keys declared in `connections`. In this example, `"typo"` is a type error, and a Calendar connection named `"support"` would not satisfy a Slack trigger. Keys come from the object properties, so saving `const slack = connections.slack()` and declaring `{ support: slack }` still restricts the trigger to `"support"`.
45
45
 
46
46
  The callback runs once when `workflow` is called. Its result is serialized as the ordinary trigger array, and the handler’s event type is inferred from those triggers. Returning a keyed trigger from an imported helper is checked too. Existing static trigger arrays remain supported and validate connection keys at runtime; use the callback for compile-time checking. Unbound triggers, including existing calls without `connectionKey`, keep their existing behavior.
47
47
 
48
48
  Deployment creates a disabled trigger attached to that connection. Configure the account, channel or calendar, and enable the trigger through workflow setup before publishing. Redeploying preserves its configuration. The server checks the binding at publication and execution, so a trigger on another connection cannot invoke this declaration.
49
49
 
50
- Calendar, Slack, Google Drive OAuth, and Discord currently have generated connection trigger helpers. Providers without registered public trigger events do not gain helpers merely by supporting actions. Existing helper calls without `connectionKey` keep their existing behavior. To bind a default connection such as `connections.calendar()`, use `triggers.calendarEventCreated({ connectionKey: "calendar" })`.
50
+ Calendar, Slack, Google Drive OAuth, and Discord currently have generated connection trigger helpers. Providers without registered public trigger events do not gain helpers merely by supporting actions. Existing helper calls without `connectionKey` keep their existing behavior. For `connections: { calendar: connections.calendar() }`, use `triggers.calendarEventCreated({ connectionKey: "calendar" })`.
51
51
 
52
52
  Removing a declaration retains the configured trigger, but it can no longer invoke the capability unless another declaration allows it. Renaming a key creates a new connection and disabled trigger. Two keys can declare the same event type independently; repeating the same type and key is rejected.
53
53
 
@@ -56,8 +56,8 @@ Removing a declaration retains the configured trigger, but it can no longer invo
56
56
  Use the typed provider client to invoke a method:
57
57
 
58
58
  ```ts
59
- const calendars = await context.connections.calendar().listCalendars({});
60
- const user = await context.connections.slack("support").findUserByEmail({
59
+ const calendars = await context.connections.work.listCalendars({});
60
+ const user = await context.connections.support.findUserByEmail({
61
61
  email: "person@example.com",
62
62
  });
63
63
  console.log(user?.displayName);
@@ -65,21 +65,32 @@ console.log(user?.displayName);
65
65
 
66
66
  Method inputs and results come from Tool Core's workflow projections. The SDK generates provider clients from those contracts, including any wire input or output transformations. Adding another registered provider generates its client from that provider's Tool Core methods.
67
67
 
68
- The handler context exposes only providers declared in that workflow's
69
- `connections` list. A Calendar-only declaration exposes `context.connections.calendar`
70
- but not `context.connections.slack`; omitting connections exposes no provider
71
- clients. Named keys still select a configured binding at runtime.
68
+ The handler context exposes only the declared keys, each with its provider's client type. With `{ work: connections.calendar(), support: connections.slack() }`, `context.connections.work` is a Calendar client and `context.connections.support` is a Slack client. Missing keys and methods from the wrong provider are type errors. Omitting connections exposes no clients.
72
69
 
73
- For a separate declaration array, let TypeScript infer its type or use
74
- `satisfies readonly WorkflowConnection[]`. An explicit broad
75
- `WorkflowConnection[]` annotation erases provider information and prevents this
76
- narrowing. Reusable helpers can accept `WorkflowContext<typeof requirements>`.
70
+ Two names can use the same provider:
71
+
72
+ ```ts
73
+ connections: {
74
+ support: connections.slack(),
75
+ internal: connections.slack(),
76
+ }
77
+ ```
78
+
79
+ `context.connections.support` and `context.connections.internal` use separately configured workflow bindings. Reusing a declaration across workflows does not share credentials.
80
+
81
+ For a separate declarations object, let TypeScript infer its type or use `satisfies WorkflowConnectionDeclarations`. A broad `WorkflowConnectionDeclarations` annotation loses the exact keys and providers. Reusable helpers can accept `WorkflowContext<typeof declarations>`.
82
+
83
+ ### Migrating from connection arrays
84
+
85
+ Replace `connections: [connections.calendar({ key: "work" })]` with `connections: { work: connections.calendar() }`, then replace `context.connections.calendar("work")` with `context.connections.work`. For an old declaration with no explicit key, use the provider name as the object property to preserve its existing binding. Arrays and factory key options are no longer supported.
86
+
87
+ The SDK serializes the object to the existing manifest array of `{ key, type }` requirements. Keeping the same key and provider preserves the server binding.
77
88
 
78
89
  ## Supported providers and setup
79
90
 
80
91
  The registry currently generates 73 methods across 12 providers: Calendar, Slack, Google Drive OAuth, Discord, Cursor, Box, Confluence, Gmail, Google Calendar, Google Drive, Outlook, and Salesforce. Only eligible Tool Core methods are generated; this does not expose every operation in those services.
81
92
 
82
- Each connection must be authenticated and granted access through the workflow’s setup flow before use. The server handles provider-specific authentication and checks that setup is complete. App code only declares a provider and optional binding key; declaring a connection never grants permissions.
93
+ Each connection must be authenticated and granted access through the workflow’s setup flow before use. The server handles provider-specific authentication and checks that setup is complete. App code declares a provider under a binding key; declaring a connection never grants permissions.
83
94
 
84
95
  Providers outside the supported list are not currently available as workflow connections. Unsupported declarations receive an unavailable-provider error.
85
96
 
@@ -106,7 +117,7 @@ notion tool-core codegen-script-types --connections --path ../apps-sdk/src --che
106
117
  3. It reads the exact Tool Core definition stored on each workflow effect projection, so providers with multiple tool versions use the contract selected by their module.
107
118
  4. The existing script-type emitter renders the method's wire input and result types. It honors input field mappings and declared output projections, so the types describe the workflow endpoint contract.
108
119
  5. It also reads each provider module’s trigger definitions and emits `connection-trigger-definitions.generated.ts`. The SDK trigger generator intersects these with the public `TriggerEventMap` to generate supported `connectionKey` options, descriptions, event types, and provider-scoped trigger creators. Internal events are not exposed.
109
- 6. It writes `<provider>.generated.ts` with types and thin client methods, plus `providers.generated.ts` with the declaration helpers and provider factories. The runtime transport stays in `connections.ts`.
120
+ 6. It writes `<provider>.generated.ts` with types and thin client methods, plus `providers.generated.ts` with keyless declaration helpers, the provider-to-client type map, and the client factory. The runtime transport stays in `connections.ts`.
110
121
 
111
122
  ### Updating the SDK after a Tool Core change
112
123
 
@@ -125,6 +136,43 @@ This does not require app developers to import server code or install Tool Core
125
136
 
126
137
  ## Runtime and rollout
127
138
 
128
- The runtime automatically connects each declared key to the account configured during workflow setup. For example, `context.connections.calendar("work")` uses the connection configured as `work`. App code does not manage connection IDs or credentials.
139
+ The runtime automatically connects each declared key to the account configured during workflow setup. For example, `context.connections.work` uses the connection configured as `work`. App code does not manage connection IDs or credentials.
129
140
 
130
141
  Provider method calls currently require the server's local/development environment and `public_api_runtime_sdk_tools` and `workers_call_function` gates. A personal access token alone does not enable these endpoints. Developer portal connection setup UI wiring is a separate follow-up. Renaming a requirement key creates a new binding; removing a requirement does not revoke or delete the server's existing configured module.
142
+
143
+ ## Generic OAuth
144
+
145
+ Use `connections.oauth()` for an OAuth 2.0 provider without a generated provider client:
146
+
147
+ ```ts
148
+ export default workflow({
149
+ name: "Read GitHub repositories",
150
+ description: "Read repositories using this workflow's GitHub authorization",
151
+ triggers: [triggers.scheduled()],
152
+ connections: {
153
+ github: connections.oauth({
154
+ authorizationEndpoint: "https://github.com/login/oauth/authorize",
155
+ tokenEndpoint: "https://github.com/login/oauth/access_token",
156
+ clientId: "your-oauth-app-client-id",
157
+ clientSecretEnv: "GITHUB_CLIENT_SECRET",
158
+ scope: "repo",
159
+ }),
160
+ },
161
+ handler: async (_event, context) => {
162
+ const token = await context.connections.github.accessToken();
163
+ const response = await fetch("https://api.github.com/user/repos", {
164
+ headers: { Authorization: `Bearer ${token}` },
165
+ });
166
+ if (!response.ok) throw new Error(`GitHub returned ${response.status}`);
167
+ console.log(await response.json());
168
+ },
169
+ });
170
+ ```
171
+
172
+ Store the client secret in the app's Workers secrets under the name supplied by `clientSecretEnv`. The declaration contains the secret's name, not its value. Optional `authorizationParams` supports provider options such as `access_type: "offline"`; it cannot override state, callback, client ID, scope, or PKCE fields. Optional `accessTokenExpireMs` supplies a positive default expiry for providers that omit it.
173
+
174
+ Each workflow instance requires separate authorization, even when instances share the same app and declaration. The SDK reads only the access token bound to the current run and does not fall back to app-level `worker.oauth` tokens. The server refreshes tokens before execution; `accessToken()` does not make a refresh request during a long-running handler.
175
+
176
+ This SDK change requires the matching server OAuth implementation before deployment. In the workflow settings, find the declared connection in **Access**, alongside other provider connections. Choose **Connect** beside the declared key, authorize with the provider, and close the authorization window to refresh status. **Reconnect** replaces authorization for that workflow instance; If the client secret is missing, setup shows the secret name to configure. Setup requires full access to the app and workflow editor access. Store the client secret before connecting, and register the app OAuth callback URL with the provider. The SDK does not configure the provider’s OAuth app for you.
177
+
178
+ Generic OAuth provides authentication for your own API calls. It does not generate provider methods or provider triggers. Unlike the generated Tool Core clients, this helper is maintained directly in the SDK.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notionhq/apps",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "An SDK for building workflow apps for Notion",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -9,15 +9,15 @@ user-invocable: false
9
9
  Import `{ workflow }` from `@notionhq/apps` and
10
10
  `connections` from `@notionhq/apps/workflow`. Connections are not root exports.
11
11
  Declare requirements on the workflow, then use the corresponding typed client
12
- inside an awaited durable step. Access a named connection through its provider
13
- client, such as `context.connections.slack("support")`.
12
+ inside an awaited durable step. Access a named connection directly through its key, such as
13
+ `context.connections.support`.
14
14
 
15
15
  Read the installed provider declarations before choosing methods and inputs.
16
16
  The SDK handles transport, credentials, and runtime bindings. Do not construct
17
17
  raw tools API envelopes or call internal endpoints. Check the installed version
18
18
  supports the typed methods; resolve version mismatches before using them.
19
- Provider clients are inferred from the declared requirements. Keys default to
20
- the provider name; custom keys distinguish multiple connections to one provider.
19
+ Provider clients are inferred from the declared requirements. Object property names supply the keys; factories do not accept a key option.
20
+ Separate keys distinguish multiple connections to one provider.
21
21
  Keep keys unique and ensure connection-trigger keys match a declared provider.
22
22
 
23
23
  A declaration requests setup; it grants no access. Deploy and configure the
@@ -49,7 +49,7 @@ import { connections } from "@notionhq/apps/workflow";
49
49
  export default workflow({
50
50
  name: "Watch support messages",
51
51
  description: "Runs when a message arrives through the support connection.",
52
- connections: [connections.slack({ key: "support" })],
52
+ connections: { support: connections.slack() },
53
53
  triggers: ({ triggers }) => [triggers.slackMessage({ connectionKey: "support" })],
54
54
  handler: async (_event, context) => {
55
55
  await context.step("Record trigger", () => {
@@ -62,8 +62,7 @@ export default workflow({
62
62
  Use the callback's `triggers` argument to get connection-key checking.
63
63
  `connectionKey` refers to a declared key for that trigger's provider, not an
64
64
  external account ID or a durable step key. Here, a typo or a key belonging to
65
- a different provider's connection is a type error. Without a custom key,
66
- `connections.slack()` declares the key `"slack"`.
65
+ a different provider's connection is a type error. For example, `{ slack: connections.slack() }` declares the key `"slack"`.
67
66
 
68
67
  The SDK also validates explicit bindings when constructing the workflow,
69
68
  including array-form triggers: the key must exist and its provider must match.
@@ -73,7 +72,7 @@ manifest. Event types still come from the selected triggers; narrow
73
72
  `event.type` before using provider-specific fields in mixed-trigger workflows.
74
73
 
75
74
  Unkeyed provider triggers remain supported for compatibility. Omitting
76
- `connectionKey` does not explicitly bind a trigger to the provider's default
75
+ `connectionKey` does not explicitly bind a trigger to a declared
77
76
  key; supply it when the workflow should listen through a particular connection.
78
77
  SDK validation does not establish server availability or complete connection
79
78
  setup.
@@ -72,6 +72,10 @@ root exports support:
72
72
  - `customAgent({ resourceId, name, instructions?, sharedResources? })`.
73
73
  Shared resources are declared resource IDs; inspect the installed types
74
74
  before specifying models or triggers.
75
+ - `view({ databaseResourceId, resourceId, type, dataSourceResourceId, ... })`,
76
+ returning a handle with `resourceId`. This is also available as `notion.view`.
77
+ Use property resource IDs in view filters, sorts, and layout options; calendar
78
+ views require `calendarBy`, and timeline views require `timelineBy`.
75
79
 
76
80
  Keep resource IDs stable across builds. They identify declarations, not live
77
81
  Notion UUIDs. Avoid the reserved `__notion_apps_` prefix. Explicit parents
@@ -79,10 +83,12 @@ use `{ type: "resourceId", resourceId: parent.resourceId }`; child helpers set
79
83
  this reference for you. Pages and databases without a parent default to private
80
84
  top-level resources in the Apps workspace.
81
85
 
82
- Several fields, including views, covers, page layouts, and custom-agent
86
+ Several fields, including database covers, page layouts, and custom-agent
83
87
  triggers, still have incomplete types. A field typed as `unknown` is not proof
84
88
  that any payload is supported. Check implementation and examples before using
85
- it; do not assume parity with other Notion as Code packages.
89
+ it; do not assume parity with other Notion as Code packages. Database views are
90
+ typed with `ViewSchema`; standalone declarations accept `ViewArgs`, which adds
91
+ the owning `databaseResourceId`.
86
92
 
87
93
  The Apps SDK exposes a subset of Notion as Code. Data sources are nested inside
88
94
  `database({ dataSources: [...] })`, not declared by a separate