@notionhq/apps 0.0.27 → 0.0.29
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/AGENTS.md +106 -9
- package/dist/calendar.generated.d.ts +1908 -680
- package/dist/calendar.generated.d.ts.map +1 -1
- package/dist/calendar.generated.js +27 -0
- package/dist/connection-trigger-definitions.generated.d.ts +12 -0
- package/dist/connection-trigger-definitions.generated.d.ts.map +1 -1
- package/dist/connection-trigger-definitions.generated.js +15 -0
- package/dist/connections.d.ts +1 -0
- package/dist/connections.d.ts.map +1 -1
- package/dist/mail.generated.d.ts +4590 -0
- package/dist/mail.generated.d.ts.map +1 -0
- package/dist/mail.generated.js +252 -0
- package/dist/providers.generated.d.ts +4 -0
- package/dist/providers.generated.d.ts.map +1 -1
- package/dist/providers.generated.js +7 -0
- package/dist/triggers.generated.d.ts +34 -16
- package/dist/triggers.generated.d.ts.map +1 -1
- package/dist/triggers.generated.js +12 -9
- package/docs/CONNECTIONS.md +38 -3
- package/package.json +1 -1
- package/skills/connections/SKILL.md +3 -0
- package/src/calendar.generated.ts +2033 -737
- package/src/connection-trigger-definitions.generated.ts +18 -0
- package/src/connections.test.ts +35 -0
- package/src/mail.generated.ts +5095 -0
- package/src/providers.generated.ts +8 -0
- package/src/triggers.generated.ts +27 -18
- package/src/workflow-connections-types.test.ts +16 -0
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,105 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Notion Apps project guidance
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
This file is included in projects scaffolded from this template. Read it completely
|
|
4
|
+
before designing, implementing, or troubleshooting an App.
|
|
5
|
+
|
|
6
|
+
## Design the App before implementation
|
|
7
|
+
|
|
8
|
+
After the project has been scaffolded, establish what the complete App should
|
|
9
|
+
do. Clarify the desired outcome, source data, triggers, external services, and
|
|
10
|
+
every Notion resource the App needs. Recommend a workflow for most automations;
|
|
11
|
+
use a sync when the goal is to mirror an external collection into a Notion
|
|
12
|
+
database. An App may contain both.
|
|
13
|
+
|
|
14
|
+
Before proposing the design, read only enough to describe each open decision as a
|
|
15
|
+
concrete option: this file and the top-level description of each relevant capability
|
|
16
|
+
(workflow, sync, connections, and Notion as Code). Do not read generated type
|
|
17
|
+
declarations (`*.generated.d.ts`), full provider API surfaces, or other
|
|
18
|
+
implementation-level detail before the user agrees on a direction. Save that
|
|
19
|
+
verification for the selected option during implementation.
|
|
20
|
+
|
|
21
|
+
Present the proposed design concisely and get the user's agreement before
|
|
22
|
+
implementing. Include:
|
|
23
|
+
|
|
24
|
+
- Always include an App home page that explains what the App does and links to
|
|
25
|
+
all of its Notion resources.
|
|
26
|
+
- Every Notion resource the App will create, such as databases, pages, and custom
|
|
27
|
+
agents, with its purpose and the capabilities that depend on it.
|
|
28
|
+
- Every sync, including its third-party source, destination database, and
|
|
29
|
+
synchronization behavior.
|
|
30
|
+
- Every workflow, including its trigger, major actions, resources it reads or changes,
|
|
31
|
+
and external connections.
|
|
32
|
+
- Unresolved decisions and required access.
|
|
33
|
+
|
|
34
|
+
Adapt the format to the App rather than copying this example mechanically:
|
|
35
|
+
|
|
36
|
+
### Example App design
|
|
37
|
+
|
|
38
|
+
**Outcome:** Bring support tickets into Notion and escalate urgent tickets to the
|
|
39
|
+
support team.
|
|
40
|
+
|
|
41
|
+
**Notion resources**
|
|
42
|
+
|
|
43
|
+
| Kind | Name | Purpose | Used by |
|
|
44
|
+
| ------------ | ----------------- | --------------------------------------------------- | -------------------------------- |
|
|
45
|
+
| Database | Support tickets | Store synchronized tickets and triage status | Ticket sync, escalation workflow |
|
|
46
|
+
| Page | Support dashboard | Give the team an operational home and database view | Team members |
|
|
47
|
+
| Custom agent | Ticket triage | Classify urgency and summarize a ticket | Escalation workflow |
|
|
48
|
+
|
|
49
|
+
**Syncs and workflows**
|
|
50
|
+
|
|
51
|
+
| Kind | Name | Source or trigger | Behavior | Dependencies |
|
|
52
|
+
| -------- | ---------------------- | --------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------- |
|
|
53
|
+
| Sync | Ticket sync | Support-system tickets | Upsert by stable external ID | Support-system connection, Support tickets database |
|
|
54
|
+
| Workflow | Escalate urgent ticket | Support tickets page created or updated | Run triage, update status, and notify support channel | Ticket triage agent, Support tickets database, messaging connection |
|
|
55
|
+
|
|
56
|
+
**Open questions:** Which support system and messaging channel should the App use?
|
|
57
|
+
|
|
58
|
+
Ask the user to confirm or revise the design. Do not begin implementation until they
|
|
59
|
+
agree. If implementation reveals a material resource or capability not covered by the
|
|
60
|
+
agreed design, update the proposal and confirm the change before adding it.
|
|
61
|
+
|
|
62
|
+
## Implement against the generated project
|
|
63
|
+
|
|
64
|
+
Before implementing the agreed design, compare it with everything included by the
|
|
65
|
+
scaffold. Remove template workflows, syncs, custom blocks, Notion resource declarations,
|
|
66
|
+
sample assets, and supporting code that the App does not need. Do not leave example or
|
|
67
|
+
placeholder capabilities in discovered capability directories: if they remain there,
|
|
68
|
+
the build can include and deploy them. Preserve shared configuration and infrastructure
|
|
69
|
+
that the selected capabilities still require.
|
|
70
|
+
|
|
71
|
+
Feature-specific skills are installed at
|
|
72
|
+
`./node_modules/@notionhq/apps/skills`. Inspect that directory and read every relevant
|
|
73
|
+
`SKILL.md` completely before implementing a feature. At minimum, use the `workflow`
|
|
74
|
+
skill for workflows or the `sync` skill for syncs, plus any additional skills they
|
|
75
|
+
route to, such as connections or Notion as Code. Do not rely on remembered SDK APIs
|
|
76
|
+
when the installed declarations or skills can answer the question.
|
|
77
|
+
|
|
78
|
+
Preserve the template's structure and examples unless the user's App requires a
|
|
79
|
+
change. Use the project's documented check and build commands after edits. Deploy
|
|
80
|
+
with `ntn apps deploy` only when deployment is part of the user's request, and report
|
|
81
|
+
local build success separately from deployment success.
|
|
82
|
+
|
|
83
|
+
## Deploy and hand off
|
|
84
|
+
|
|
85
|
+
When deploying, use `ntn apps deploy --json` (plus any other required arguments) so
|
|
86
|
+
the final deployment result includes `worker_url`, `setup_url`, and `is_update`. These
|
|
87
|
+
are JSON-only field names. Human output shows the worker page URL without a
|
|
88
|
+
`worker_url` label, and non-interactive plain output may show only the worker ID
|
|
89
|
+
followed by a `Finish setup:` line. That line is the setup URL, not the worker URL.
|
|
90
|
+
|
|
91
|
+
For a first deployment (`is_update` is false), show only the onboarding/setup URL from
|
|
92
|
+
`setup_url` and tell the user to open it to finish setting up the App.
|
|
93
|
+
|
|
94
|
+
For a redeployment (`is_update` is true), show both `worker_url` and `setup_url`,
|
|
95
|
+
clearly labeled and clickable. Explain that the worker URL opens the deployed App and
|
|
96
|
+
the setup URL lets them revisit onboarding. Use the URLs returned by the CLI rather
|
|
97
|
+
than constructing or guessing them.
|
|
98
|
+
|
|
99
|
+
## Capability-specific guidance
|
|
100
|
+
|
|
101
|
+
Before creating, modifying, or troubleshooting an App capability, read the matching
|
|
102
|
+
skill:
|
|
5
103
|
|
|
6
104
|
- [Workflows](./skills/workflow/SKILL.md)
|
|
7
105
|
- [Connections](./skills/connections/SKILL.md)
|
|
@@ -14,8 +112,8 @@ declarations for current API details.
|
|
|
14
112
|
|
|
15
113
|
## Pull requests for SDK changes
|
|
16
114
|
|
|
17
|
-
For a change to the public SDK, show the user-facing code change in the pull
|
|
18
|
-
|
|
115
|
+
For a change to the public SDK, show the user-facing code change in the pull request
|
|
116
|
+
body. Put a short, complete example near the top:
|
|
19
117
|
|
|
20
118
|
````md
|
|
21
119
|
## User code
|
|
@@ -34,7 +132,6 @@ request body. Put a short, complete example near the top:
|
|
|
34
132
|
````
|
|
35
133
|
|
|
36
134
|
Use the same small example in both sections so reviewers can compare them
|
|
37
|
-
quickly. Include imports and the call that changed when they matter. Show
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
example.
|
|
135
|
+
quickly. Include imports and the call that changed when they matter. Show normal
|
|
136
|
+
app code, not internal types, tests, generated files, or provisioning output. Explain
|
|
137
|
+
any required migration steps in plain language below the example.
|