@intentsolutions/blueprint 2.5.0 โ 2.6.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/dist/cli.js +203 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/notion/client.d.ts +114 -0
- package/dist/integrations/notion/client.d.ts.map +1 -0
- package/dist/integrations/notion/client.js +413 -0
- package/dist/integrations/notion/client.js.map +1 -0
- package/dist/integrations/notion/exporter.d.ts +56 -0
- package/dist/integrations/notion/exporter.d.ts.map +1 -0
- package/dist/integrations/notion/exporter.js +278 -0
- package/dist/integrations/notion/exporter.js.map +1 -0
- package/dist/integrations/notion/index.d.ts +9 -0
- package/dist/integrations/notion/index.d.ts.map +1 -0
- package/dist/integrations/notion/index.js +8 -0
- package/dist/integrations/notion/index.js.map +1 -0
- package/dist/integrations/notion/types.d.ts +276 -0
- package/dist/integrations/notion/types.d.ts.map +1 -0
- package/dist/integrations/notion/types.js +45 -0
- package/dist/integrations/notion/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notion Exporter
|
|
3
|
+
* High-level export operations for Blueprint documents to Notion
|
|
4
|
+
*/
|
|
5
|
+
import { NotionClient } from './client.js';
|
|
6
|
+
import { CATEGORY_ICONS, CATEGORY_OPTIONS, STATUS_OPTIONS } from './types.js';
|
|
7
|
+
export class NotionExporter {
|
|
8
|
+
client;
|
|
9
|
+
parentPageId;
|
|
10
|
+
databaseId;
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.client = new NotionClient(config);
|
|
13
|
+
this.parentPageId = config.parentPageId;
|
|
14
|
+
this.databaseId = config.databaseId;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Export Blueprint documents to Notion
|
|
18
|
+
*/
|
|
19
|
+
async export(documents, options = {}) {
|
|
20
|
+
const result = {
|
|
21
|
+
pages: [],
|
|
22
|
+
errors: [],
|
|
23
|
+
};
|
|
24
|
+
// Dry run - just preview
|
|
25
|
+
if (options.dryRun) {
|
|
26
|
+
return this.preview(documents, options);
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
// Verify connection
|
|
30
|
+
await this.client.verify();
|
|
31
|
+
let targetDatabaseId = this.databaseId;
|
|
32
|
+
// Create database if requested
|
|
33
|
+
if (options.createDatabase && options.parentPageId) {
|
|
34
|
+
const database = await this.createDocumentsDatabase(options.parentPageId, options.databaseTitle || 'Blueprint Documents', {
|
|
35
|
+
addCategory: options.addCategory !== false,
|
|
36
|
+
addStatus: options.addStatus !== false,
|
|
37
|
+
});
|
|
38
|
+
result.database = database;
|
|
39
|
+
targetDatabaseId = database.id;
|
|
40
|
+
}
|
|
41
|
+
// Create pages for each document
|
|
42
|
+
for (const doc of documents) {
|
|
43
|
+
try {
|
|
44
|
+
const page = await this.createDocumentPage(doc, {
|
|
45
|
+
databaseId: targetDatabaseId,
|
|
46
|
+
parentPageId: options.parentPageId,
|
|
47
|
+
convertContent: options.convertContent !== false,
|
|
48
|
+
addCategory: options.addCategory !== false,
|
|
49
|
+
});
|
|
50
|
+
result.pages.push(page);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
result.errors.push(`Failed to create page "${doc.name}": ${error}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
result.errors.push(error instanceof Error ? error.message : String(error));
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Preview what would be created (dry run)
|
|
64
|
+
*/
|
|
65
|
+
async preview(documents, options = {}) {
|
|
66
|
+
const result = {
|
|
67
|
+
pages: [],
|
|
68
|
+
errors: [],
|
|
69
|
+
};
|
|
70
|
+
// Preview database
|
|
71
|
+
if (options.createDatabase) {
|
|
72
|
+
result.database = {
|
|
73
|
+
id: 'preview-database',
|
|
74
|
+
object: 'database',
|
|
75
|
+
created_time: new Date().toISOString(),
|
|
76
|
+
last_edited_time: new Date().toISOString(),
|
|
77
|
+
title: [{ type: 'text', text: { content: options.databaseTitle || 'Blueprint Documents' } }],
|
|
78
|
+
properties: {
|
|
79
|
+
Name: { id: 'title', name: 'Name', type: 'title' },
|
|
80
|
+
Category: { id: 'category', name: 'Category', type: 'select' },
|
|
81
|
+
Status: { id: 'status', name: 'Status', type: 'status' },
|
|
82
|
+
},
|
|
83
|
+
parent: { type: 'page_id', page_id: options.parentPageId || 'preview-parent' },
|
|
84
|
+
url: '#',
|
|
85
|
+
archived: false,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Preview pages
|
|
89
|
+
for (let i = 0; i < documents.length; i++) {
|
|
90
|
+
const doc = documents[i];
|
|
91
|
+
const category = this.detectCategory(doc.name, doc.content);
|
|
92
|
+
const icon = CATEGORY_ICONS[category] || CATEGORY_ICONS.default;
|
|
93
|
+
result.pages.push({
|
|
94
|
+
id: `preview-page-${i}`,
|
|
95
|
+
object: 'page',
|
|
96
|
+
created_time: new Date().toISOString(),
|
|
97
|
+
last_edited_time: new Date().toISOString(),
|
|
98
|
+
parent: options.createDatabase
|
|
99
|
+
? { type: 'database_id', database_id: 'preview-database' }
|
|
100
|
+
: { type: 'page_id', page_id: options.parentPageId || 'preview-parent' },
|
|
101
|
+
properties: {
|
|
102
|
+
Name: { type: 'title', title: [{ type: 'text', text: { content: doc.name } }] },
|
|
103
|
+
Category: { type: 'select', select: { name: this.formatCategory(category) } },
|
|
104
|
+
Status: { type: 'status', status: { name: 'Draft' } },
|
|
105
|
+
},
|
|
106
|
+
url: '#',
|
|
107
|
+
archived: false,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Create a database for documents
|
|
114
|
+
*/
|
|
115
|
+
async createDocumentsDatabase(parentPageId, title, options) {
|
|
116
|
+
const properties = {
|
|
117
|
+
Name: { name: 'Name', type: 'title' },
|
|
118
|
+
};
|
|
119
|
+
if (options.addCategory) {
|
|
120
|
+
properties.Category = {
|
|
121
|
+
name: 'Category',
|
|
122
|
+
type: 'select',
|
|
123
|
+
select: {
|
|
124
|
+
options: CATEGORY_OPTIONS,
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
if (options.addStatus) {
|
|
129
|
+
properties.Status = {
|
|
130
|
+
name: 'Status',
|
|
131
|
+
type: 'status',
|
|
132
|
+
status: {
|
|
133
|
+
options: STATUS_OPTIONS,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
// Add description property
|
|
138
|
+
properties.Description = {
|
|
139
|
+
name: 'Description',
|
|
140
|
+
type: 'rich_text',
|
|
141
|
+
};
|
|
142
|
+
// Add created date
|
|
143
|
+
properties['Created'] = {
|
|
144
|
+
name: 'Created',
|
|
145
|
+
type: 'created_time',
|
|
146
|
+
};
|
|
147
|
+
// Add last edited date
|
|
148
|
+
properties['Last Edited'] = {
|
|
149
|
+
name: 'Last Edited',
|
|
150
|
+
type: 'last_edited_time',
|
|
151
|
+
};
|
|
152
|
+
return this.client.createDatabase({
|
|
153
|
+
parentPageId,
|
|
154
|
+
title,
|
|
155
|
+
properties,
|
|
156
|
+
icon: { type: 'emoji', emoji: '๐' },
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Create a page for a document
|
|
161
|
+
*/
|
|
162
|
+
async createDocumentPage(doc, options) {
|
|
163
|
+
const category = doc.category || this.detectCategory(doc.name, doc.content);
|
|
164
|
+
const icon = CATEGORY_ICONS[category] || CATEGORY_ICONS.default;
|
|
165
|
+
const description = this.extractDescription(doc.content);
|
|
166
|
+
// Build properties based on whether we're adding to a database or page
|
|
167
|
+
let properties;
|
|
168
|
+
if (options.databaseId) {
|
|
169
|
+
properties = {
|
|
170
|
+
Name: { title: [this.client.createRichText(doc.name)] },
|
|
171
|
+
};
|
|
172
|
+
if (options.addCategory) {
|
|
173
|
+
properties.Category = {
|
|
174
|
+
select: { name: this.formatCategory(category) },
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
// Add description
|
|
178
|
+
if (description) {
|
|
179
|
+
properties.Description = {
|
|
180
|
+
rich_text: [this.client.createRichText(description)],
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
properties = {
|
|
186
|
+
title: { title: [this.client.createRichText(doc.name)] },
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
// Convert content to blocks
|
|
190
|
+
let content = [];
|
|
191
|
+
if (options.convertContent !== false) {
|
|
192
|
+
// Add table of contents at the start
|
|
193
|
+
content.push(this.client.createTableOfContents());
|
|
194
|
+
content.push(this.client.createDivider());
|
|
195
|
+
// Convert markdown content
|
|
196
|
+
const contentBlocks = this.client.markdownToBlocks(doc.content);
|
|
197
|
+
content = content.concat(contentBlocks);
|
|
198
|
+
}
|
|
199
|
+
return this.client.createPage({
|
|
200
|
+
databaseId: options.databaseId,
|
|
201
|
+
parentPageId: options.parentPageId,
|
|
202
|
+
title: doc.name,
|
|
203
|
+
properties: properties,
|
|
204
|
+
content: content.length > 0 ? content : undefined,
|
|
205
|
+
icon: { type: 'emoji', emoji: icon },
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Detect category from document name and content
|
|
210
|
+
*/
|
|
211
|
+
detectCategory(name, content) {
|
|
212
|
+
const lower = (name + ' ' + content.slice(0, 500)).toLowerCase();
|
|
213
|
+
if (lower.includes('prd') || lower.includes('product requirement'))
|
|
214
|
+
return 'prd';
|
|
215
|
+
if (lower.includes('architecture') || lower.includes('system design'))
|
|
216
|
+
return 'architecture';
|
|
217
|
+
if (lower.includes('technical spec') || lower.includes('tech spec'))
|
|
218
|
+
return 'technical-spec';
|
|
219
|
+
if (lower.includes('api') || lower.includes('endpoint'))
|
|
220
|
+
return 'api-design';
|
|
221
|
+
if (lower.includes('security') || lower.includes('authentication'))
|
|
222
|
+
return 'security';
|
|
223
|
+
if (lower.includes('infrastructure') || lower.includes('deployment'))
|
|
224
|
+
return 'infrastructure';
|
|
225
|
+
if (lower.includes('test') || lower.includes('qa'))
|
|
226
|
+
return 'testing';
|
|
227
|
+
if (lower.includes('research') || lower.includes('analysis'))
|
|
228
|
+
return 'research';
|
|
229
|
+
if (lower.includes('design') || lower.includes('ui') || lower.includes('ux'))
|
|
230
|
+
return 'design';
|
|
231
|
+
return 'documentation';
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Format category for display
|
|
235
|
+
*/
|
|
236
|
+
formatCategory(category) {
|
|
237
|
+
const mapping = {
|
|
238
|
+
'prd': 'PRD',
|
|
239
|
+
'architecture': 'Architecture',
|
|
240
|
+
'technical-spec': 'Technical Spec',
|
|
241
|
+
'api-design': 'API Design',
|
|
242
|
+
'security': 'Security',
|
|
243
|
+
'infrastructure': 'Infrastructure',
|
|
244
|
+
'testing': 'Testing',
|
|
245
|
+
'documentation': 'Documentation',
|
|
246
|
+
'research': 'Research',
|
|
247
|
+
'design': 'Design',
|
|
248
|
+
};
|
|
249
|
+
return mapping[category] || 'Documentation';
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Extract description from content
|
|
253
|
+
*/
|
|
254
|
+
extractDescription(content) {
|
|
255
|
+
const lines = content.split('\n');
|
|
256
|
+
// Skip title lines and find first substantial paragraph
|
|
257
|
+
for (const line of lines) {
|
|
258
|
+
const trimmed = line.trim();
|
|
259
|
+
if (trimmed.startsWith('#'))
|
|
260
|
+
continue;
|
|
261
|
+
if (!trimmed)
|
|
262
|
+
continue;
|
|
263
|
+
if (trimmed.length < 20)
|
|
264
|
+
continue;
|
|
265
|
+
// Return first 200 characters of the paragraph
|
|
266
|
+
return trimmed.slice(0, 200) + (trimmed.length > 200 ? '...' : '');
|
|
267
|
+
}
|
|
268
|
+
return '';
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Export documents to Notion (convenience function)
|
|
273
|
+
*/
|
|
274
|
+
export async function exportToNotion(config, documents, options = {}) {
|
|
275
|
+
const exporter = new NotionExporter(config);
|
|
276
|
+
return exporter.export(documents, options);
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=exporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../../src/integrations/notion/exporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAU3C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9E,MAAM,OAAO,cAAc;IACjB,MAAM,CAAe;IACrB,YAAY,CAAU;IACtB,UAAU,CAAU;IAE5B,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,SAAsE,EACtE,UAA+B,EAAE;QAEjC,MAAM,MAAM,GAAuB;YACjC,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX,CAAC;QAEF,yBAAyB;QACzB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC;QAED,IAAI,CAAC;YACH,oBAAoB;YACpB,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAE3B,IAAI,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC;YAEv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O,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS;YACtC,IAAI,CAAC,OAAO;gBAAE,SAAS;YACvB,IAAI,OAAO,CAAC,MAAM,GAAG,EAAE;gBAAE,SAAS;YAElC,+CAA+C;YAC/C,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAoB,EACpB,SAAsE,EACtE,UAA+B,EAAE;IAEjC,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notion Integration
|
|
3
|
+
* Export Blueprint documents to Notion (pages, databases, blocks)
|
|
4
|
+
*/
|
|
5
|
+
export { NotionClient } from './client.js';
|
|
6
|
+
export { NotionExporter, exportToNotion } from './exporter.js';
|
|
7
|
+
export type { NotionConfig, NotionUser, NotionPage, NotionDatabase, NotionParent, NotionRichText, NotionProperty, NotionPropertySchema, NotionBlock, NotionParagraphBlock, NotionHeadingBlock, NotionBulletedListBlock, NotionNumberedListBlock, NotionToDoBlock, NotionToggleBlock, NotionCodeBlock, NotionQuoteBlock, NotionCalloutBlock, NotionDividerBlock, NotionTableOfContentsBlock, CreatePageInput, CreateDatabaseInput, NotionDocumentPage, NotionExportResult, NotionExportOptions, } from './types.js';
|
|
8
|
+
export { CATEGORY_ICONS, STATUS_OPTIONS, CATEGORY_OPTIONS, } from './types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/notion/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/D,YAAY,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notion Integration
|
|
3
|
+
* Export Blueprint documents to Notion (pages, databases, blocks)
|
|
4
|
+
*/
|
|
5
|
+
export { NotionClient } from './client.js';
|
|
6
|
+
export { NotionExporter, exportToNotion } from './exporter.js';
|
|
7
|
+
export { CATEGORY_ICONS, STATUS_OPTIONS, CATEGORY_OPTIONS, } from './types.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/notion/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA4B/D,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notion Integration Types
|
|
3
|
+
* Types for Notion API integration
|
|
4
|
+
*/
|
|
5
|
+
export interface NotionConfig {
|
|
6
|
+
/** Notion integration token (from https://www.notion.so/my-integrations) */
|
|
7
|
+
apiKey: string;
|
|
8
|
+
/** Parent page ID to create content under */
|
|
9
|
+
parentPageId?: string;
|
|
10
|
+
/** Database ID to add pages to */
|
|
11
|
+
databaseId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface NotionUser {
|
|
14
|
+
id: string;
|
|
15
|
+
type: 'person' | 'bot';
|
|
16
|
+
name?: string;
|
|
17
|
+
avatar_url?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface NotionPage {
|
|
20
|
+
id: string;
|
|
21
|
+
object: 'page';
|
|
22
|
+
created_time: string;
|
|
23
|
+
last_edited_time: string;
|
|
24
|
+
parent: NotionParent;
|
|
25
|
+
properties: Record<string, NotionProperty>;
|
|
26
|
+
url: string;
|
|
27
|
+
archived: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface NotionDatabase {
|
|
30
|
+
id: string;
|
|
31
|
+
object: 'database';
|
|
32
|
+
created_time: string;
|
|
33
|
+
last_edited_time: string;
|
|
34
|
+
title: NotionRichText[];
|
|
35
|
+
properties: Record<string, NotionPropertySchema>;
|
|
36
|
+
parent: NotionParent;
|
|
37
|
+
url: string;
|
|
38
|
+
archived: boolean;
|
|
39
|
+
}
|
|
40
|
+
export type NotionParent = {
|
|
41
|
+
type: 'page_id';
|
|
42
|
+
page_id: string;
|
|
43
|
+
} | {
|
|
44
|
+
type: 'database_id';
|
|
45
|
+
database_id: string;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'workspace';
|
|
48
|
+
workspace: true;
|
|
49
|
+
};
|
|
50
|
+
export interface NotionRichText {
|
|
51
|
+
type: 'text';
|
|
52
|
+
text: {
|
|
53
|
+
content: string;
|
|
54
|
+
link?: {
|
|
55
|
+
url: string;
|
|
56
|
+
} | null;
|
|
57
|
+
};
|
|
58
|
+
annotations?: {
|
|
59
|
+
bold?: boolean;
|
|
60
|
+
italic?: boolean;
|
|
61
|
+
strikethrough?: boolean;
|
|
62
|
+
underline?: boolean;
|
|
63
|
+
code?: boolean;
|
|
64
|
+
color?: string;
|
|
65
|
+
};
|
|
66
|
+
plain_text?: string;
|
|
67
|
+
}
|
|
68
|
+
export type NotionProperty = {
|
|
69
|
+
type: 'title';
|
|
70
|
+
title: NotionRichText[];
|
|
71
|
+
} | {
|
|
72
|
+
type: 'rich_text';
|
|
73
|
+
rich_text: NotionRichText[];
|
|
74
|
+
} | {
|
|
75
|
+
type: 'select';
|
|
76
|
+
select: {
|
|
77
|
+
name: string;
|
|
78
|
+
color?: string;
|
|
79
|
+
} | null;
|
|
80
|
+
} | {
|
|
81
|
+
type: 'multi_select';
|
|
82
|
+
multi_select: Array<{
|
|
83
|
+
name: string;
|
|
84
|
+
color?: string;
|
|
85
|
+
}>;
|
|
86
|
+
} | {
|
|
87
|
+
type: 'status';
|
|
88
|
+
status: {
|
|
89
|
+
name: string;
|
|
90
|
+
color?: string;
|
|
91
|
+
} | null;
|
|
92
|
+
} | {
|
|
93
|
+
type: 'date';
|
|
94
|
+
date: {
|
|
95
|
+
start: string;
|
|
96
|
+
end?: string;
|
|
97
|
+
} | null;
|
|
98
|
+
} | {
|
|
99
|
+
type: 'checkbox';
|
|
100
|
+
checkbox: boolean;
|
|
101
|
+
} | {
|
|
102
|
+
type: 'url';
|
|
103
|
+
url: string | null;
|
|
104
|
+
} | {
|
|
105
|
+
type: 'number';
|
|
106
|
+
number: number | null;
|
|
107
|
+
} | {
|
|
108
|
+
type: 'relation';
|
|
109
|
+
relation: Array<{
|
|
110
|
+
id: string;
|
|
111
|
+
}>;
|
|
112
|
+
};
|
|
113
|
+
export interface NotionPropertySchema {
|
|
114
|
+
id: string;
|
|
115
|
+
name: string;
|
|
116
|
+
type: string;
|
|
117
|
+
[key: string]: unknown;
|
|
118
|
+
}
|
|
119
|
+
export type NotionBlock = NotionParagraphBlock | NotionHeadingBlock | NotionBulletedListBlock | NotionNumberedListBlock | NotionToDoBlock | NotionToggleBlock | NotionCodeBlock | NotionQuoteBlock | NotionCalloutBlock | NotionDividerBlock | NotionTableOfContentsBlock;
|
|
120
|
+
export interface NotionParagraphBlock {
|
|
121
|
+
object: 'block';
|
|
122
|
+
type: 'paragraph';
|
|
123
|
+
paragraph: {
|
|
124
|
+
rich_text: NotionRichText[];
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export interface NotionHeadingBlock {
|
|
128
|
+
object: 'block';
|
|
129
|
+
type: 'heading_1' | 'heading_2' | 'heading_3';
|
|
130
|
+
heading_1?: {
|
|
131
|
+
rich_text: NotionRichText[];
|
|
132
|
+
};
|
|
133
|
+
heading_2?: {
|
|
134
|
+
rich_text: NotionRichText[];
|
|
135
|
+
};
|
|
136
|
+
heading_3?: {
|
|
137
|
+
rich_text: NotionRichText[];
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export interface NotionBulletedListBlock {
|
|
141
|
+
object: 'block';
|
|
142
|
+
type: 'bulleted_list_item';
|
|
143
|
+
bulleted_list_item: {
|
|
144
|
+
rich_text: NotionRichText[];
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export interface NotionNumberedListBlock {
|
|
148
|
+
object: 'block';
|
|
149
|
+
type: 'numbered_list_item';
|
|
150
|
+
numbered_list_item: {
|
|
151
|
+
rich_text: NotionRichText[];
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export interface NotionToDoBlock {
|
|
155
|
+
object: 'block';
|
|
156
|
+
type: 'to_do';
|
|
157
|
+
to_do: {
|
|
158
|
+
rich_text: NotionRichText[];
|
|
159
|
+
checked: boolean;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export interface NotionToggleBlock {
|
|
163
|
+
object: 'block';
|
|
164
|
+
type: 'toggle';
|
|
165
|
+
toggle: {
|
|
166
|
+
rich_text: NotionRichText[];
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export interface NotionCodeBlock {
|
|
170
|
+
object: 'block';
|
|
171
|
+
type: 'code';
|
|
172
|
+
code: {
|
|
173
|
+
rich_text: NotionRichText[];
|
|
174
|
+
language: string;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
export interface NotionQuoteBlock {
|
|
178
|
+
object: 'block';
|
|
179
|
+
type: 'quote';
|
|
180
|
+
quote: {
|
|
181
|
+
rich_text: NotionRichText[];
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export interface NotionCalloutBlock {
|
|
185
|
+
object: 'block';
|
|
186
|
+
type: 'callout';
|
|
187
|
+
callout: {
|
|
188
|
+
rich_text: NotionRichText[];
|
|
189
|
+
icon?: {
|
|
190
|
+
type: 'emoji';
|
|
191
|
+
emoji: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export interface NotionDividerBlock {
|
|
196
|
+
object: 'block';
|
|
197
|
+
type: 'divider';
|
|
198
|
+
divider: Record<string, never>;
|
|
199
|
+
}
|
|
200
|
+
export interface NotionTableOfContentsBlock {
|
|
201
|
+
object: 'block';
|
|
202
|
+
type: 'table_of_contents';
|
|
203
|
+
table_of_contents: Record<string, never>;
|
|
204
|
+
}
|
|
205
|
+
export interface CreatePageInput {
|
|
206
|
+
parentPageId?: string;
|
|
207
|
+
databaseId?: string;
|
|
208
|
+
title: string;
|
|
209
|
+
properties?: Record<string, NotionProperty>;
|
|
210
|
+
content?: NotionBlock[];
|
|
211
|
+
icon?: {
|
|
212
|
+
type: 'emoji';
|
|
213
|
+
emoji: string;
|
|
214
|
+
};
|
|
215
|
+
cover?: {
|
|
216
|
+
type: 'external';
|
|
217
|
+
external: {
|
|
218
|
+
url: string;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
export interface CreateDatabaseInput {
|
|
223
|
+
parentPageId: string;
|
|
224
|
+
title: string;
|
|
225
|
+
properties: Record<string, Omit<NotionPropertySchema, 'id'>>;
|
|
226
|
+
icon?: {
|
|
227
|
+
type: 'emoji';
|
|
228
|
+
emoji: string;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
export interface NotionDocumentPage {
|
|
232
|
+
title: string;
|
|
233
|
+
category: string;
|
|
234
|
+
content: string;
|
|
235
|
+
properties?: Record<string, unknown>;
|
|
236
|
+
}
|
|
237
|
+
export interface NotionExportResult {
|
|
238
|
+
database?: NotionDatabase;
|
|
239
|
+
pages: NotionPage[];
|
|
240
|
+
errors: string[];
|
|
241
|
+
}
|
|
242
|
+
export interface NotionExportOptions {
|
|
243
|
+
/** Create a database for documents */
|
|
244
|
+
createDatabase?: boolean;
|
|
245
|
+
/** Database title */
|
|
246
|
+
databaseTitle?: string;
|
|
247
|
+
/** Create pages under a parent page instead of database */
|
|
248
|
+
parentPageId?: string;
|
|
249
|
+
/** Add category property to pages */
|
|
250
|
+
addCategory?: boolean;
|
|
251
|
+
/** Add status property to pages */
|
|
252
|
+
addStatus?: boolean;
|
|
253
|
+
/** Convert markdown content to Notion blocks */
|
|
254
|
+
convertContent?: boolean;
|
|
255
|
+
/** Dry run - preview without creating */
|
|
256
|
+
dryRun?: boolean;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Category to emoji mapping
|
|
260
|
+
*/
|
|
261
|
+
export declare const CATEGORY_ICONS: Record<string, string>;
|
|
262
|
+
/**
|
|
263
|
+
* Status options for documents
|
|
264
|
+
*/
|
|
265
|
+
export declare const STATUS_OPTIONS: {
|
|
266
|
+
name: string;
|
|
267
|
+
color: string;
|
|
268
|
+
}[];
|
|
269
|
+
/**
|
|
270
|
+
* Category options for documents
|
|
271
|
+
*/
|
|
272
|
+
export declare const CATEGORY_OPTIONS: {
|
|
273
|
+
name: string;
|
|
274
|
+
color: string;
|
|
275
|
+
}[];
|
|
276
|
+
//# sourceMappingURL=types.d.ts.map
|
|
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C;CACzC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qBAAqB;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAYjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;;;GAK1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;GAW5B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notion Integration Types
|
|
3
|
+
* Types for Notion API integration
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Category to emoji mapping
|
|
7
|
+
*/
|
|
8
|
+
export const CATEGORY_ICONS = {
|
|
9
|
+
prd: '๐',
|
|
10
|
+
architecture: '๐๏ธ',
|
|
11
|
+
'technical-spec': 'โ๏ธ',
|
|
12
|
+
'api-design': '๐',
|
|
13
|
+
security: '๐',
|
|
14
|
+
infrastructure: 'โ๏ธ',
|
|
15
|
+
testing: '๐งช',
|
|
16
|
+
documentation: '๐',
|
|
17
|
+
research: '๐ฌ',
|
|
18
|
+
design: '๐จ',
|
|
19
|
+
default: '๐',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Status options for documents
|
|
23
|
+
*/
|
|
24
|
+
export const STATUS_OPTIONS = [
|
|
25
|
+
{ name: 'Draft', color: 'gray' },
|
|
26
|
+
{ name: 'In Review', color: 'yellow' },
|
|
27
|
+
{ name: 'Approved', color: 'green' },
|
|
28
|
+
{ name: 'Archived', color: 'red' },
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Category options for documents
|
|
32
|
+
*/
|
|
33
|
+
export const CATEGORY_OPTIONS = [
|
|
34
|
+
{ name: 'PRD', color: 'purple' },
|
|
35
|
+
{ name: 'Architecture', color: 'blue' },
|
|
36
|
+
{ name: 'Technical Spec', color: 'green' },
|
|
37
|
+
{ name: 'API Design', color: 'orange' },
|
|
38
|
+
{ name: 'Security', color: 'red' },
|
|
39
|
+
{ name: 'Infrastructure', color: 'gray' },
|
|
40
|
+
{ name: 'Testing', color: 'yellow' },
|
|
41
|
+
{ name: 'Documentation', color: 'pink' },
|
|
42
|
+
{ name: 'Research', color: 'brown' },
|
|
43
|
+
{ name: 'Design', color: 'default' },
|
|
44
|
+
];
|
|
45
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/integrations/notion/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqOH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,GAAG,EAAE,IAAI;IACT,YAAY,EAAE,KAAK;IACnB,gBAAgB,EAAE,IAAI;IACtB,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,IAAI;IACd,cAAc,EAAE,IAAI;IACpB,OAAO,EAAE,IAAI;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