@startsimpli/integrations 0.2.62 → 0.2.64

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 StartSimpli
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -202,3 +202,9 @@ The test suite (`src/__tests__/api.test.ts`) ships **10 tests** covering the OAu
202
202
  ## Shared-first
203
203
 
204
204
  Per CLAUDE.md **rule 9**, do **not** copy fetch helpers, types, or React Query hooks for calendar/email into an app's `src/`. The package guards this — `raise-simpli/web-app/src/__tests__/no_app_local_calendar_code.test.ts` exists to fail CI if app-local duplicates reappear. Extend `@startsimpli/integrations` instead.
205
+
206
+ ## Links
207
+
208
+ - Source: https://github.com/qosha1/start-simpli/tree/main/packages/integrations
209
+ - Homepage: https://startsimpli.com
210
+ - License: MIT, see [LICENSE](./LICENSE)
package/package.json CHANGED
@@ -1,7 +1,17 @@
1
1
  {
2
2
  "name": "@startsimpli/integrations",
3
- "version": "0.2.62",
3
+ "version": "0.2.64",
4
4
  "description": "Provider-agnostic types, API clients, hooks, and UI primitives for email + calendar integrations across StartSimpli apps, plus foundry customer email (subpath ./comms).",
5
+ "license": "MIT",
6
+ "homepage": "https://startsimpli.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/qosha1/start-simpli.git",
10
+ "directory": "packages/integrations"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/qosha1/start-simpli/issues"
14
+ },
5
15
  "main": "./src/index.ts",
6
16
  "types": "./src/index.ts",
7
17
  "exports": {
@@ -21,7 +31,8 @@
21
31
  },
22
32
  "files": [
23
33
  "src",
24
- "README.md"
34
+ "README.md",
35
+ "LICENSE"
25
36
  ],
26
37
  "publishConfig": {
27
38
  "access": "public"
@@ -52,12 +52,13 @@ describe('createNativeVoiceApi', () => {
52
52
 
53
53
  it('file replaces the about_focus edge using post + delete', async () => {
54
54
  const f = vi.fn()
55
+ .mockResolvedValueOnce(res({ id: '7', data: {} }))
55
56
  .mockResolvedValueOnce(res({ results: [{ id: 5 }] }))
56
57
  .mockResolvedValue(res({}));
57
58
  const api = createNativeVoiceApi({ baseUrl: 'http://t', authorizedFetch: f });
58
59
  await api.file('7', 'f9');
59
60
  const calls = f.mock.calls.map((c) => `${c[1].method} ${c[0].replace('http://t/', '').split('?')[0]}`);
60
- expect(calls).toEqual(['GET api/v1/relationships', 'DELETE api/v1/relationships/5', 'POST api/v1/relationships']);
61
+ expect(calls).toEqual(['GET api/v1/entities/7', 'GET api/v1/relationships', 'DELETE api/v1/relationships/5', 'POST api/v1/relationships']);
61
62
  });
62
63
 
63
64
  it('submit is not offered (recording uploads go through the upload queue)', async () => {
@@ -35,4 +35,15 @@ describe('noteSections', () => {
35
35
  const out = noteSections({ ...base, sections: [{ label: 'A', kind: 'weird', summary: 's', items: [{ text: 'a' }, { nope: 1 }, ''] }] } as never);
36
36
  expect(out[0]).toMatchObject({ label: 'A', kind: 'other', focusId: null, items: ['a'] });
37
37
  });
38
+
39
+ it('parses a legacy markdown summary into a lead sentence and its bullets', () => {
40
+ const summary = 'Tasks for the day.\n\n## Next Steps\n- **Send mom a text** (Quinn)\n- **Go on two walks**\n';
41
+ const [only] = noteSections({ ...base, summary });
42
+ expect(only.summary).toBe('Tasks for the day.');
43
+ expect(only.items).toEqual(['Send mom a text (Quinn)', 'Go on two walks']);
44
+ });
45
+
46
+ it('keeps plain summaries untouched', () => {
47
+ expect(noteSections({ ...base, summary: 'Just text. No bullets.' })[0]).toMatchObject({ summary: 'Just text. No bullets.', items: [] });
48
+ });
38
49
  });
@@ -45,15 +45,25 @@ function fromRaw(raw: unknown): NoteSection | null {
45
45
  };
46
46
  }
47
47
 
48
+ /** Older notes store one markdown summary: a lead sentence, then `## Next Steps` with `- **Title** (Owner)` bullets. */
49
+ function splitLegacySummary(summary: string): { lead: string; items: string[] } {
50
+ const text = summary ?? '';
51
+ const bullets = [...text.matchAll(/^\s*[-*]\s+\*\*(.+?)\*\*\s*(\([^)]*\))?\s*$/gm)];
52
+ if (!bullets.length) return { lead: text, items: [] };
53
+ const lead = text.split(/^\s*#{1,6}\s/m)[0].trim();
54
+ return { lead, items: bullets.map((m) => (m[1] + (m[2] ? ' ' + m[2] : '')).trim()) };
55
+ }
56
+
48
57
  export function noteSections(note: VoiceNote): NoteSection[] {
49
58
  const raw = (note as VoiceNote & { sections?: unknown }).sections;
50
59
  const sections = Array.isArray(raw) ? raw.map(fromRaw).filter((s): s is NoteSection => s !== null && Boolean(s.label || s.summary || s.items.length)) : [];
51
60
  if (sections.length) return sections;
61
+ const { lead, items } = splitLegacySummary(note.summary);
52
62
  return [{
53
63
  label: '',
54
64
  kind: note.focusId ? 'project' : 'other',
55
65
  focusId: note.focusId,
56
- summary: note.summary,
57
- items: [],
66
+ summary: lead,
67
+ items,
58
68
  }];
59
69
  }