@molecule/api-resource-meeting 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +115 -0
- package/dist/browser-guard.d.ts +2 -0
- package/dist/browser-guard.d.ts.map +1 -0
- package/dist/browser-guard.js +18 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/routes.d.ts +4 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +125 -0
- package/dist/service.d.ts +46 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +121 -0
- package/dist/types.d.ts +36 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/validation.d.ts +50 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +38 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work.
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the
|
|
45
|
+
original version of the Work and any modifications or additions
|
|
46
|
+
to that Work, that is intentionally submitted to the Licensor for
|
|
47
|
+
inclusion in the Work by the copyright owner or by an individual or
|
|
48
|
+
Legal Entity authorized to submit on behalf of the copyright owner.
|
|
49
|
+
|
|
50
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
51
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
52
|
+
subsequently incorporated within the Work.
|
|
53
|
+
|
|
54
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
55
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
56
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
57
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
58
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
59
|
+
Work and such Derivative Works in Source or Object form.
|
|
60
|
+
|
|
61
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
62
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
63
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
64
|
+
patent license to make, have made, use, offer to sell, sell, import,
|
|
65
|
+
and otherwise transfer the Work.
|
|
66
|
+
|
|
67
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
68
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
69
|
+
modifications, and in Source or Object form, provided that You
|
|
70
|
+
meet the following conditions:
|
|
71
|
+
|
|
72
|
+
(a) You must give any other recipients of the Work or
|
|
73
|
+
Derivative Works a copy of this License; and
|
|
74
|
+
|
|
75
|
+
(b) You must cause any modified files to carry prominent notices
|
|
76
|
+
stating that You changed the files; and
|
|
77
|
+
|
|
78
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
79
|
+
that You distribute, all copyright, patent, trademark, and
|
|
80
|
+
attribution notices from the Source form of the Work,
|
|
81
|
+
excluding those notices that do not pertain to any part of
|
|
82
|
+
the Derivative Works; and
|
|
83
|
+
|
|
84
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
85
|
+
distribution, then any Derivative Works that You distribute must
|
|
86
|
+
include a readable copy of the attribution notices contained
|
|
87
|
+
within such NOTICE file.
|
|
88
|
+
|
|
89
|
+
5. Submission of Contributions.
|
|
90
|
+
|
|
91
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
92
|
+
names, trademarks, service marks, or product names of the Licensor.
|
|
93
|
+
|
|
94
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
95
|
+
agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
|
|
96
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
|
|
97
|
+
|
|
98
|
+
8. Limitation of Liability. In no event and under no legal theory shall
|
|
99
|
+
any Contributor be liable to You for damages.
|
|
100
|
+
|
|
101
|
+
9. Accepting Warranty or Additional Liability.
|
|
102
|
+
|
|
103
|
+
Copyright 2026 Molecule Dev, Inc.
|
|
104
|
+
|
|
105
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
106
|
+
you may not use this file except in compliance with the License.
|
|
107
|
+
You may obtain a copy of the License at
|
|
108
|
+
|
|
109
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
110
|
+
|
|
111
|
+
Unless required by applicable law or agreed to in writing, software
|
|
112
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
113
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
114
|
+
See the License for the specific language governing permissions and
|
|
115
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-guard.d.ts","sourceRoot":"","sources":["../src/browser-guard.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser guard — `@molecule/api-resource-meeting` is SERVER-ONLY.
|
|
3
|
+
*
|
|
4
|
+
* Generated by scripts/gen-browser-guards.mjs (workspace root) — edit THAT, not this.
|
|
5
|
+
* Evaluating a server package in a browser bundle is always an import-graph mistake
|
|
6
|
+
* (node APIs, secrets); without this guard it surfaces as a cryptic downstream crash
|
|
7
|
+
* ("Buffer is not defined") far from the culprit. Throwing here names the package and
|
|
8
|
+
* the fix at the exact moment the client bundle evaluates it. jsdom tests and SSR are
|
|
9
|
+
* unaffected: the throw requires browser globals AND the absence of a node runtime.
|
|
10
|
+
*/
|
|
11
|
+
const g = globalThis;
|
|
12
|
+
if (g.window !== undefined && g.document !== undefined && !g.process?.versions?.node) {
|
|
13
|
+
throw new Error('@molecule/api-resource-meeting is SERVER-ONLY: it was bundled into browser/client code. Import it only ' +
|
|
14
|
+
'from server code (a server route/function or your API), or dynamic-import it inside ' +
|
|
15
|
+
'the server handler — never from components or shared client modules, and never ' +
|
|
16
|
+
'polyfill Buffer/process to silence this.');
|
|
17
|
+
}
|
|
18
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@molecule/api-resource-meeting` — meeting CRUD + action items.
|
|
3
|
+
*
|
|
4
|
+
* Tracks scheduled/in_progress/completed/cancelled meetings with
|
|
5
|
+
* attendees, optional recording URL, transcript, and AI-friendly
|
|
6
|
+
* summary slot. Action items nest under meetings and track
|
|
7
|
+
* completion + assignee + due date + source excerpt.
|
|
8
|
+
*
|
|
9
|
+
* Extracted from the ai-meeting-notes flagship.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { createMeetingRouter } from '@molecule/api-resource-meeting'
|
|
14
|
+
* app.use('/meetings', createMeetingRouter())
|
|
15
|
+
* // GET|POST / · GET|PUT|DELETE /:id
|
|
16
|
+
* // GET|POST /:id/action-items · PUT|DELETE /:id/action-items/:itemId
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { createActionItem, createMeetingForOwner } from '@molecule/api-resource-meeting'
|
|
22
|
+
*
|
|
23
|
+
* const meeting = await createMeetingForOwner(userId, {
|
|
24
|
+
* title: 'Sprint planning',
|
|
25
|
+
* scheduled_at: '2026-08-01T10:00:00Z',
|
|
26
|
+
* })
|
|
27
|
+
* await createActionItem(meeting.id, userId, { description: 'Send recap' })
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Tables: `src/__setup__/meetings.sql` creates `meetings` +
|
|
32
|
+
* `meeting_action_items`. An mlcl-scaffolded API replays `__setup__/*.sql`
|
|
33
|
+
* automatically on migrate; anywhere else run it once — nothing at runtime
|
|
34
|
+
* creates them.
|
|
35
|
+
*
|
|
36
|
+
* The router does not authenticate — it reads the caller from
|
|
37
|
+
* `res.locals.session` (populated by your global auth middleware) and 401s
|
|
38
|
+
* without a session. All service functions are owner-scoped
|
|
39
|
+
* (`…ForOwner(…, ownerId)` / `(meetingId, ownerId, …)`) and return `null`
|
|
40
|
+
* for rows the caller doesn't own — always pass the AUTHENTICATED user's id.
|
|
41
|
+
*
|
|
42
|
+
* @module
|
|
43
|
+
*/
|
|
44
|
+
export * from './browser-guard.js';
|
|
45
|
+
export * from './routes.js';
|
|
46
|
+
export * from './service.js';
|
|
47
|
+
export * from './types.js';
|
|
48
|
+
export * from './validation.js';
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@molecule/api-resource-meeting` — meeting CRUD + action items.
|
|
3
|
+
*
|
|
4
|
+
* Tracks scheduled/in_progress/completed/cancelled meetings with
|
|
5
|
+
* attendees, optional recording URL, transcript, and AI-friendly
|
|
6
|
+
* summary slot. Action items nest under meetings and track
|
|
7
|
+
* completion + assignee + due date + source excerpt.
|
|
8
|
+
*
|
|
9
|
+
* Extracted from the ai-meeting-notes flagship.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { createMeetingRouter } from '@molecule/api-resource-meeting'
|
|
14
|
+
* app.use('/meetings', createMeetingRouter())
|
|
15
|
+
* // GET|POST / · GET|PUT|DELETE /:id
|
|
16
|
+
* // GET|POST /:id/action-items · PUT|DELETE /:id/action-items/:itemId
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { createActionItem, createMeetingForOwner } from '@molecule/api-resource-meeting'
|
|
22
|
+
*
|
|
23
|
+
* const meeting = await createMeetingForOwner(userId, {
|
|
24
|
+
* title: 'Sprint planning',
|
|
25
|
+
* scheduled_at: '2026-08-01T10:00:00Z',
|
|
26
|
+
* })
|
|
27
|
+
* await createActionItem(meeting.id, userId, { description: 'Send recap' })
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Tables: `src/__setup__/meetings.sql` creates `meetings` +
|
|
32
|
+
* `meeting_action_items`. An mlcl-scaffolded API replays `__setup__/*.sql`
|
|
33
|
+
* automatically on migrate; anywhere else run it once — nothing at runtime
|
|
34
|
+
* creates them.
|
|
35
|
+
*
|
|
36
|
+
* The router does not authenticate — it reads the caller from
|
|
37
|
+
* `res.locals.session` (populated by your global auth middleware) and 401s
|
|
38
|
+
* without a session. All service functions are owner-scoped
|
|
39
|
+
* (`…ForOwner(…, ownerId)` / `(meetingId, ownerId, …)`) and return `null`
|
|
40
|
+
* for rows the caller doesn't own — always pass the AUTHENTICATED user's id.
|
|
41
|
+
*
|
|
42
|
+
* @module
|
|
43
|
+
*/
|
|
44
|
+
export * from './browser-guard.js';
|
|
45
|
+
export * from './routes.js';
|
|
46
|
+
export * from './service.js';
|
|
47
|
+
export * from './types.js';
|
|
48
|
+
export * from './validation.js';
|
package/dist/routes.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,MAAM,EAAE,MAAM,SAAS,CAAA;AA2BlF,0FAA0F;AAC1F,wBAAgB,mBAAmB,IAAI,MAAM,CA8I5C"}
|
package/dist/routes.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Router } from 'express';
|
|
2
|
+
import { getParamId, requireUser } from '@molecule/api-bonds-default-express';
|
|
3
|
+
import { t } from '@molecule/api-i18n';
|
|
4
|
+
import { validateBody as validateBodyRaw } from '@molecule/api-middleware-validation';
|
|
5
|
+
import { createActionItem, createMeetingForOwner, deleteActionItem, deleteMeetingForOwner, getMeetingForOwner, listActionItems, listMeetingsForOwner, updateActionItem, updateMeetingForOwner, } from './service.js';
|
|
6
|
+
import { actionItemCreateSchema, actionItemUpdateSchema, meetingCreateSchema, meetingUpdateSchema, } from './validation.js';
|
|
7
|
+
const validateBody = validateBodyRaw;
|
|
8
|
+
/** Creates and returns an Express Router with all meeting and action-item CRUD routes. */
|
|
9
|
+
export function createMeetingRouter() {
|
|
10
|
+
const router = Router();
|
|
11
|
+
router.get('/', async (req, res) => {
|
|
12
|
+
const userId = requireUser(res);
|
|
13
|
+
if (!userId)
|
|
14
|
+
return;
|
|
15
|
+
const q = req.query;
|
|
16
|
+
res.json(await listMeetingsForOwner(userId, {
|
|
17
|
+
status: typeof q.status === 'string'
|
|
18
|
+
? q.status
|
|
19
|
+
: undefined,
|
|
20
|
+
page: typeof q.page === 'string' ? Number(q.page) : undefined,
|
|
21
|
+
limit: typeof q.limit === 'string' ? Number(q.limit) : undefined,
|
|
22
|
+
}));
|
|
23
|
+
});
|
|
24
|
+
router.post('/', validateBody(meetingCreateSchema), async (req, res) => {
|
|
25
|
+
const userId = requireUser(res);
|
|
26
|
+
if (!userId)
|
|
27
|
+
return;
|
|
28
|
+
res
|
|
29
|
+
.status(201)
|
|
30
|
+
.json(await createMeetingForOwner(userId, req.body));
|
|
31
|
+
});
|
|
32
|
+
router.get('/:id', async (req, res) => {
|
|
33
|
+
const userId = requireUser(res);
|
|
34
|
+
if (!userId)
|
|
35
|
+
return;
|
|
36
|
+
const m = await getMeetingForOwner(getParamId(req), userId);
|
|
37
|
+
if (!m) {
|
|
38
|
+
res
|
|
39
|
+
.status(404)
|
|
40
|
+
.json({ error: t('meeting.notFound', undefined, { defaultValue: 'Meeting not found' }) });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
res.json(m);
|
|
44
|
+
});
|
|
45
|
+
router.put('/:id', validateBody(meetingUpdateSchema), async (req, res) => {
|
|
46
|
+
const userId = requireUser(res);
|
|
47
|
+
if (!userId)
|
|
48
|
+
return;
|
|
49
|
+
const m = await updateMeetingForOwner(getParamId(req), userId, req.body);
|
|
50
|
+
if (!m) {
|
|
51
|
+
res
|
|
52
|
+
.status(404)
|
|
53
|
+
.json({ error: t('meeting.notFound', undefined, { defaultValue: 'Meeting not found' }) });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
res.json(m);
|
|
57
|
+
});
|
|
58
|
+
router.delete('/:id', async (req, res) => {
|
|
59
|
+
const userId = requireUser(res);
|
|
60
|
+
if (!userId)
|
|
61
|
+
return;
|
|
62
|
+
const ok = await deleteMeetingForOwner(getParamId(req), userId);
|
|
63
|
+
if (!ok) {
|
|
64
|
+
res
|
|
65
|
+
.status(404)
|
|
66
|
+
.json({ error: t('meeting.notFound', undefined, { defaultValue: 'Meeting not found' }) });
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
res.status(204).end();
|
|
70
|
+
});
|
|
71
|
+
// Action items
|
|
72
|
+
router.get('/:id/action-items', async (req, res) => {
|
|
73
|
+
const userId = requireUser(res);
|
|
74
|
+
if (!userId)
|
|
75
|
+
return;
|
|
76
|
+
const items = await listActionItems(getParamId(req), userId);
|
|
77
|
+
if (items === null) {
|
|
78
|
+
res
|
|
79
|
+
.status(404)
|
|
80
|
+
.json({ error: t('meeting.notFound', undefined, { defaultValue: 'Meeting not found' }) });
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
res.json(items);
|
|
84
|
+
});
|
|
85
|
+
router.post('/:id/action-items', validateBody(actionItemCreateSchema), async (req, res) => {
|
|
86
|
+
const userId = requireUser(res);
|
|
87
|
+
if (!userId)
|
|
88
|
+
return;
|
|
89
|
+
const item = await createActionItem(getParamId(req), userId, req.body);
|
|
90
|
+
if (!item) {
|
|
91
|
+
res
|
|
92
|
+
.status(404)
|
|
93
|
+
.json({ error: t('meeting.notFound', undefined, { defaultValue: 'Meeting not found' }) });
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
res.status(201).json(item);
|
|
97
|
+
});
|
|
98
|
+
router.put('/:id/action-items/:itemId', validateBody(actionItemUpdateSchema), async (req, res) => {
|
|
99
|
+
const userId = requireUser(res);
|
|
100
|
+
if (!userId)
|
|
101
|
+
return;
|
|
102
|
+
const item = await updateActionItem(getParamId(req, 'itemId'), getParamId(req), userId, req.body);
|
|
103
|
+
if (!item) {
|
|
104
|
+
res.status(404).json({
|
|
105
|
+
error: t('actionItem.notFound', undefined, { defaultValue: 'Action item not found' }),
|
|
106
|
+
});
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
res.json(item);
|
|
110
|
+
});
|
|
111
|
+
router.delete('/:id/action-items/:itemId', async (req, res) => {
|
|
112
|
+
const userId = requireUser(res);
|
|
113
|
+
if (!userId)
|
|
114
|
+
return;
|
|
115
|
+
const ok = await deleteActionItem(getParamId(req, 'itemId'), getParamId(req), userId);
|
|
116
|
+
if (!ok) {
|
|
117
|
+
res.status(404).json({
|
|
118
|
+
error: t('actionItem.notFound', undefined, { defaultValue: 'Action item not found' }),
|
|
119
|
+
});
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
res.status(204).end();
|
|
123
|
+
});
|
|
124
|
+
return router;
|
|
125
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meeting service — meetings + action items, with optional AI-assisted
|
|
3
|
+
* summarization/extraction.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import type { ActionItemRow, MeetingRow, MeetingStatus } from './types.js';
|
|
8
|
+
/** Returns a paginated list of meetings belonging to the given owner, optionally filtered by status. */
|
|
9
|
+
export declare function listMeetingsForOwner(ownerId: string, opts?: {
|
|
10
|
+
status?: MeetingStatus;
|
|
11
|
+
page?: number;
|
|
12
|
+
limit?: number;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
data: MeetingRow[];
|
|
15
|
+
total: number;
|
|
16
|
+
}>;
|
|
17
|
+
/** Fetches a single meeting by ID, returning null if it does not exist or does not belong to the owner. */
|
|
18
|
+
export declare function getMeetingForOwner(meetingId: string, ownerId: string): Promise<MeetingRow | null>;
|
|
19
|
+
/** Creates a new meeting record owned by the given owner and returns the inserted row. */
|
|
20
|
+
export declare function createMeetingForOwner(ownerId: string, data: {
|
|
21
|
+
title: string;
|
|
22
|
+
description?: string | null;
|
|
23
|
+
scheduled_at?: string | null;
|
|
24
|
+
attendees?: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
email?: string;
|
|
27
|
+
}>;
|
|
28
|
+
}): Promise<MeetingRow>;
|
|
29
|
+
/** Applies a partial patch to a meeting, recomputing duration_seconds when both timestamps are present, and returns the updated row or null if not found/owned. */
|
|
30
|
+
export declare function updateMeetingForOwner(meetingId: string, ownerId: string, patch: Partial<MeetingRow>): Promise<MeetingRow | null>;
|
|
31
|
+
/** Deletes a meeting by ID if it belongs to the given owner; returns true on success, false if not found or not owned. */
|
|
32
|
+
export declare function deleteMeetingForOwner(meetingId: string, ownerId: string): Promise<boolean>;
|
|
33
|
+
/** Returns all action items for a meeting in creation order, or null if the meeting is not found/owned. */
|
|
34
|
+
export declare function listActionItems(meetingId: string, ownerId: string): Promise<ActionItemRow[] | null>;
|
|
35
|
+
/** Creates a new action item under a meeting owned by the given owner; returns the inserted row or null if the meeting is not found/owned. */
|
|
36
|
+
export declare function createActionItem(meetingId: string, ownerId: string, data: {
|
|
37
|
+
description: string;
|
|
38
|
+
assignee?: string | null;
|
|
39
|
+
due_date?: string | null;
|
|
40
|
+
source_excerpt?: string | null;
|
|
41
|
+
}): Promise<ActionItemRow | null>;
|
|
42
|
+
/** Applies a partial patch to an action item; returns the updated row or null if the meeting or item is not found/owned. */
|
|
43
|
+
export declare function updateActionItem(itemId: string, meetingId: string, ownerId: string, patch: Partial<ActionItemRow>): Promise<ActionItemRow | null>;
|
|
44
|
+
/** Deletes an action item by ID if its parent meeting belongs to the given owner; returns true on success, false if not found or not owned. */
|
|
45
|
+
export declare function deleteActionItem(itemId: string, meetingId: string, ownerId: string): Promise<boolean>;
|
|
46
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAK1E,wGAAwG;AACxG,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE;IACJ,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACV,GACL,OAAO,CAAC;IAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAYhD;AAED,2GAA2G;AAC3G,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAI5B;AAED,0FAA0F;AAC1F,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;IACJ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACpD,GACA,OAAO,CAAC,UAAU,CAAC,CAgBrB;AAED,mKAAmK;AACnK,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,GACzB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAc5B;AAED,0HAA0H;AAC1H,wBAAsB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKhG;AAED,2GAA2G;AAC3G,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,CAOjC;AAED,8IAA8I;AAC9I,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;IACJ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,GACA,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAY/B;AAED,4HAA4H;AAC5H,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAO/B;AAED,+IAA+I;AAC/I,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAOlB"}
|
package/dist/service.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meeting service — meetings + action items, with optional AI-assisted
|
|
3
|
+
* summarization/extraction.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { count, create, deleteById, findById, findMany, updateById, } from '@molecule/api-database';
|
|
8
|
+
const MEETINGS_TABLE = 'meetings';
|
|
9
|
+
const ACTION_ITEMS_TABLE = 'meeting_action_items';
|
|
10
|
+
/** Returns a paginated list of meetings belonging to the given owner, optionally filtered by status. */
|
|
11
|
+
export async function listMeetingsForOwner(ownerId, opts = {}) {
|
|
12
|
+
const page = opts.page ?? 1;
|
|
13
|
+
const limit = opts.limit ?? 50;
|
|
14
|
+
const where = [{ field: 'owner_id', operator: '=', value: ownerId }];
|
|
15
|
+
if (opts.status)
|
|
16
|
+
where.push({ field: 'status', operator: '=', value: opts.status });
|
|
17
|
+
const orderBy = [{ field: 'scheduled_at', direction: 'desc' }];
|
|
18
|
+
const offset = (page - 1) * limit;
|
|
19
|
+
const [data, total] = await Promise.all([
|
|
20
|
+
findMany(MEETINGS_TABLE, { where, orderBy, limit, offset }),
|
|
21
|
+
count(MEETINGS_TABLE, where),
|
|
22
|
+
]);
|
|
23
|
+
return { data, total };
|
|
24
|
+
}
|
|
25
|
+
/** Fetches a single meeting by ID, returning null if it does not exist or does not belong to the owner. */
|
|
26
|
+
export async function getMeetingForOwner(meetingId, ownerId) {
|
|
27
|
+
const row = await findById(MEETINGS_TABLE, meetingId);
|
|
28
|
+
if (!row || row.owner_id !== ownerId)
|
|
29
|
+
return null;
|
|
30
|
+
return row;
|
|
31
|
+
}
|
|
32
|
+
/** Creates a new meeting record owned by the given owner and returns the inserted row. */
|
|
33
|
+
export async function createMeetingForOwner(ownerId, data) {
|
|
34
|
+
const result = await create(MEETINGS_TABLE, {
|
|
35
|
+
owner_id: ownerId,
|
|
36
|
+
title: data.title,
|
|
37
|
+
description: data.description ?? null,
|
|
38
|
+
status: data.scheduled_at ? 'scheduled' : 'completed',
|
|
39
|
+
scheduled_at: data.scheduled_at ?? null,
|
|
40
|
+
started_at: null,
|
|
41
|
+
ended_at: null,
|
|
42
|
+
duration_seconds: 0,
|
|
43
|
+
recording_url: null,
|
|
44
|
+
transcript: null,
|
|
45
|
+
summary: null,
|
|
46
|
+
attendees: data.attendees ?? [],
|
|
47
|
+
});
|
|
48
|
+
return result.data;
|
|
49
|
+
}
|
|
50
|
+
/** Applies a partial patch to a meeting, recomputing duration_seconds when both timestamps are present, and returns the updated row or null if not found/owned. */
|
|
51
|
+
export async function updateMeetingForOwner(meetingId, ownerId, patch) {
|
|
52
|
+
const existing = await findById(MEETINGS_TABLE, meetingId);
|
|
53
|
+
if (!existing || existing.owner_id !== ownerId)
|
|
54
|
+
return null;
|
|
55
|
+
const updates = { ...patch };
|
|
56
|
+
// Compute duration if both timestamps now set
|
|
57
|
+
if ((patch.started_at || existing.started_at) && (patch.ended_at || existing.ended_at)) {
|
|
58
|
+
const startedAt = new Date(String(patch.started_at ?? existing.started_at)).getTime();
|
|
59
|
+
const endedAt = new Date(String(patch.ended_at ?? existing.ended_at)).getTime();
|
|
60
|
+
if (Number.isFinite(startedAt) && Number.isFinite(endedAt) && endedAt > startedAt) {
|
|
61
|
+
updates.duration_seconds = Math.round((endedAt - startedAt) / 1000);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
await updateById(MEETINGS_TABLE, meetingId, updates);
|
|
65
|
+
return findById(MEETINGS_TABLE, meetingId);
|
|
66
|
+
}
|
|
67
|
+
/** Deletes a meeting by ID if it belongs to the given owner; returns true on success, false if not found or not owned. */
|
|
68
|
+
export async function deleteMeetingForOwner(meetingId, ownerId) {
|
|
69
|
+
const row = await findById(MEETINGS_TABLE, meetingId);
|
|
70
|
+
if (!row || row.owner_id !== ownerId)
|
|
71
|
+
return false;
|
|
72
|
+
await deleteById(MEETINGS_TABLE, meetingId);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
/** Returns all action items for a meeting in creation order, or null if the meeting is not found/owned. */
|
|
76
|
+
export async function listActionItems(meetingId, ownerId) {
|
|
77
|
+
const meeting = await getMeetingForOwner(meetingId, ownerId);
|
|
78
|
+
if (!meeting)
|
|
79
|
+
return null;
|
|
80
|
+
return findMany(ACTION_ITEMS_TABLE, {
|
|
81
|
+
where: [{ field: 'meeting_id', operator: '=', value: meetingId }],
|
|
82
|
+
orderBy: [{ field: 'created_at', direction: 'asc' }],
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/** Creates a new action item under a meeting owned by the given owner; returns the inserted row or null if the meeting is not found/owned. */
|
|
86
|
+
export async function createActionItem(meetingId, ownerId, data) {
|
|
87
|
+
const meeting = await getMeetingForOwner(meetingId, ownerId);
|
|
88
|
+
if (!meeting)
|
|
89
|
+
return null;
|
|
90
|
+
const result = await create(ACTION_ITEMS_TABLE, {
|
|
91
|
+
meeting_id: meetingId,
|
|
92
|
+
description: data.description,
|
|
93
|
+
assignee: data.assignee ?? null,
|
|
94
|
+
due_date: data.due_date ?? null,
|
|
95
|
+
is_completed: false,
|
|
96
|
+
source_excerpt: data.source_excerpt ?? null,
|
|
97
|
+
});
|
|
98
|
+
return result.data;
|
|
99
|
+
}
|
|
100
|
+
/** Applies a partial patch to an action item; returns the updated row or null if the meeting or item is not found/owned. */
|
|
101
|
+
export async function updateActionItem(itemId, meetingId, ownerId, patch) {
|
|
102
|
+
const meeting = await getMeetingForOwner(meetingId, ownerId);
|
|
103
|
+
if (!meeting)
|
|
104
|
+
return null;
|
|
105
|
+
const existing = await findById(ACTION_ITEMS_TABLE, itemId);
|
|
106
|
+
if (!existing || existing.meeting_id !== meetingId)
|
|
107
|
+
return null;
|
|
108
|
+
await updateById(ACTION_ITEMS_TABLE, itemId, patch);
|
|
109
|
+
return findById(ACTION_ITEMS_TABLE, itemId);
|
|
110
|
+
}
|
|
111
|
+
/** Deletes an action item by ID if its parent meeting belongs to the given owner; returns true on success, false if not found or not owned. */
|
|
112
|
+
export async function deleteActionItem(itemId, meetingId, ownerId) {
|
|
113
|
+
const meeting = await getMeetingForOwner(meetingId, ownerId);
|
|
114
|
+
if (!meeting)
|
|
115
|
+
return false;
|
|
116
|
+
const item = await findById(ACTION_ITEMS_TABLE, itemId);
|
|
117
|
+
if (!item || item.meeting_id !== meetingId)
|
|
118
|
+
return false;
|
|
119
|
+
await deleteById(ACTION_ITEMS_TABLE, itemId);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Lifecycle states a meeting can occupy from creation through completion. */
|
|
2
|
+
export type MeetingStatus = 'scheduled' | 'in_progress' | 'completed' | 'cancelled';
|
|
3
|
+
/** Raw database row shape for a meeting record. */
|
|
4
|
+
export interface MeetingRow {
|
|
5
|
+
id: string;
|
|
6
|
+
owner_id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
status: MeetingStatus;
|
|
10
|
+
scheduled_at: string | Date | null;
|
|
11
|
+
started_at: string | Date | null;
|
|
12
|
+
ended_at: string | Date | null;
|
|
13
|
+
duration_seconds: number;
|
|
14
|
+
recording_url: string | null;
|
|
15
|
+
transcript: string | null;
|
|
16
|
+
summary: string | null;
|
|
17
|
+
attendees: Array<{
|
|
18
|
+
name: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
}>;
|
|
21
|
+
created_at: string | Date;
|
|
22
|
+
updated_at: string | Date;
|
|
23
|
+
}
|
|
24
|
+
/** Raw database row shape for an action item linked to a meeting. */
|
|
25
|
+
export interface ActionItemRow {
|
|
26
|
+
id: string;
|
|
27
|
+
meeting_id: string;
|
|
28
|
+
description: string;
|
|
29
|
+
assignee: string | null;
|
|
30
|
+
due_date: string | Date | null;
|
|
31
|
+
is_completed: boolean;
|
|
32
|
+
source_excerpt: string | null;
|
|
33
|
+
created_at: string | Date;
|
|
34
|
+
updated_at: string | Date;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,CAAA;AAEnF,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAClC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC9B,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAClD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,qEAAqE;AACrE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC9B,YAAY,EAAE,OAAO,CAAA;IACrB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** All valid status values a meeting can be in. */
|
|
3
|
+
export declare const MEETING_STATUSES: readonly ["scheduled", "in_progress", "completed", "cancelled"];
|
|
4
|
+
/** Zod schema for validating meeting creation payloads. */
|
|
5
|
+
export declare const meetingCreateSchema: z.ZodObject<{
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
scheduled_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
email: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
/** Zod schema for validating meeting update payloads. */
|
|
15
|
+
export declare const meetingUpdateSchema: z.ZodObject<{
|
|
16
|
+
title: z.ZodOptional<z.ZodString>;
|
|
17
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
scheduled: "scheduled";
|
|
20
|
+
in_progress: "in_progress";
|
|
21
|
+
completed: "completed";
|
|
22
|
+
cancelled: "cancelled";
|
|
23
|
+
}>>;
|
|
24
|
+
scheduled_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
ended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
recording_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
transcript: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
email: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/** Zod schema for validating action item creation payloads. */
|
|
36
|
+
export declare const actionItemCreateSchema: z.ZodObject<{
|
|
37
|
+
description: z.ZodString;
|
|
38
|
+
assignee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
due_date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
+
source_excerpt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
/** Zod schema for validating action item update payloads. */
|
|
43
|
+
export declare const actionItemUpdateSchema: z.ZodObject<{
|
|
44
|
+
description: z.ZodOptional<z.ZodString>;
|
|
45
|
+
assignee: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
46
|
+
due_date: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
47
|
+
source_excerpt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
48
|
+
is_completed: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,mDAAmD;AACnD,eAAO,MAAM,gBAAgB,iEAAkE,CAAA;AAE/F,2DAA2D;AAC3D,eAAO,MAAM,mBAAmB;;;;;;;;iBAO9B,CAAA;AAEF,yDAAyD;AACzD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;iBAa9B,CAAA;AAEF,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAA;AAEF,6DAA6D;AAC7D,eAAO,MAAM,sBAAsB;;;;;;iBAEjC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** All valid status values a meeting can be in. */
|
|
3
|
+
export const MEETING_STATUSES = ['scheduled', 'in_progress', 'completed', 'cancelled'];
|
|
4
|
+
/** Zod schema for validating meeting creation payloads. */
|
|
5
|
+
export const meetingCreateSchema = z.object({
|
|
6
|
+
title: z.string().min(1).max(255),
|
|
7
|
+
description: z.string().max(2000).nullable().optional(),
|
|
8
|
+
scheduled_at: z.string().nullable().optional(),
|
|
9
|
+
attendees: z
|
|
10
|
+
.array(z.object({ name: z.string().min(1), email: z.string().email().optional() }))
|
|
11
|
+
.optional(),
|
|
12
|
+
});
|
|
13
|
+
/** Zod schema for validating meeting update payloads. */
|
|
14
|
+
export const meetingUpdateSchema = z.object({
|
|
15
|
+
title: z.string().min(1).max(255).optional(),
|
|
16
|
+
description: z.string().max(2000).nullable().optional(),
|
|
17
|
+
status: z.enum(MEETING_STATUSES).optional(),
|
|
18
|
+
scheduled_at: z.string().nullable().optional(),
|
|
19
|
+
started_at: z.string().nullable().optional(),
|
|
20
|
+
ended_at: z.string().nullable().optional(),
|
|
21
|
+
recording_url: z.string().url().nullable().optional(),
|
|
22
|
+
transcript: z.string().nullable().optional(),
|
|
23
|
+
summary: z.string().nullable().optional(),
|
|
24
|
+
attendees: z
|
|
25
|
+
.array(z.object({ name: z.string().min(1), email: z.string().email().optional() }))
|
|
26
|
+
.optional(),
|
|
27
|
+
});
|
|
28
|
+
/** Zod schema for validating action item creation payloads. */
|
|
29
|
+
export const actionItemCreateSchema = z.object({
|
|
30
|
+
description: z.string().min(1).max(2000),
|
|
31
|
+
assignee: z.string().nullable().optional(),
|
|
32
|
+
due_date: z.string().nullable().optional(),
|
|
33
|
+
source_excerpt: z.string().nullable().optional(),
|
|
34
|
+
});
|
|
35
|
+
/** Zod schema for validating action item update payloads. */
|
|
36
|
+
export const actionItemUpdateSchema = actionItemCreateSchema.partial().extend({
|
|
37
|
+
is_completed: z.boolean().optional(),
|
|
38
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@molecule/api-resource-meeting",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Meeting capture + transcription + action-item extraction",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"test": "vitest run",
|
|
11
|
+
"test:watch": "vitest"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"molecule",
|
|
24
|
+
"meeting",
|
|
25
|
+
"transcription",
|
|
26
|
+
"notes",
|
|
27
|
+
"resource"
|
|
28
|
+
],
|
|
29
|
+
"license": "Apache-2.0",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/express": "5.0.6",
|
|
32
|
+
"@types/node": "26.1.2",
|
|
33
|
+
"express": "5.2.1",
|
|
34
|
+
"typescript": "6.0.3",
|
|
35
|
+
"vitest": "4.1.10",
|
|
36
|
+
"zod": "4.4.3"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@molecule/api-bonds-default-express": "^1.0.0",
|
|
40
|
+
"@molecule/api-database": "^1.0.0",
|
|
41
|
+
"@molecule/api-i18n": "^1.0.0",
|
|
42
|
+
"@molecule/api-middleware-validation": "^1.0.0",
|
|
43
|
+
"express": "^5.0.0",
|
|
44
|
+
"zod": "^4.0.0"
|
|
45
|
+
}
|
|
46
|
+
}
|