@owlmeans/client-planning 0.1.18-rc.21 → 0.1.18-rc.22

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 (87) hide show
  1. package/README.md +13 -8
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/client-planning/SKILL.md +24 -23
  4. package/build/client.js +2 -2
  5. package/build/client.js.map +1 -1
  6. package/build/commits.js +4 -4
  7. package/build/commits.js.map +1 -1
  8. package/build/consts.d.ts +12 -0
  9. package/build/consts.d.ts.map +1 -1
  10. package/build/consts.js +15 -0
  11. package/build/consts.js.map +1 -1
  12. package/build/definitions.js +2 -2
  13. package/build/definitions.js.map +1 -1
  14. package/build/events/types.d.ts +29 -0
  15. package/build/events/types.d.ts.map +1 -0
  16. package/build/events/types.js.map +1 -0
  17. package/build/events.d.ts +9 -20
  18. package/build/events.d.ts.map +1 -1
  19. package/build/events.js +97 -103
  20. package/build/events.js.map +1 -1
  21. package/build/facade.d.ts.map +1 -1
  22. package/build/facade.js +10 -10
  23. package/build/facade.js.map +1 -1
  24. package/build/feed.d.ts +4 -4
  25. package/build/feed.d.ts.map +1 -1
  26. package/build/feed.js +17 -15
  27. package/build/feed.js.map +1 -1
  28. package/build/helper/types.d.ts +15 -0
  29. package/build/helper/types.d.ts.map +1 -0
  30. package/build/helper/types.js +2 -0
  31. package/build/helper/types.js.map +1 -0
  32. package/build/helper.d.ts +7 -7
  33. package/build/helper.d.ts.map +1 -1
  34. package/build/helper.js +16 -8
  35. package/build/helper.js.map +1 -1
  36. package/build/index.d.ts +4 -1
  37. package/build/index.d.ts.map +1 -1
  38. package/build/index.js +1 -1
  39. package/build/index.js.map +1 -1
  40. package/build/stores.d.ts +3 -10
  41. package/build/stores.d.ts.map +1 -1
  42. package/build/stores.js +9 -36
  43. package/build/stores.js.map +1 -1
  44. package/build/sync/types.d.ts +18 -0
  45. package/build/sync/types.d.ts.map +1 -0
  46. package/build/sync/types.js +2 -0
  47. package/build/{utils → sync}/types.js.map +1 -1
  48. package/build/sync.d.ts +4 -0
  49. package/build/sync.d.ts.map +1 -0
  50. package/build/sync.js +26 -0
  51. package/build/sync.js.map +1 -0
  52. package/build/utils/record/types.d.ts +28 -0
  53. package/build/utils/record/types.d.ts.map +1 -0
  54. package/build/utils/record/types.js +2 -0
  55. package/build/utils/record/types.js.map +1 -0
  56. package/build/utils/record.d.ts +3 -43
  57. package/build/utils/record.d.ts.map +1 -1
  58. package/build/utils/record.js +64 -72
  59. package/build/utils/record.js.map +1 -1
  60. package/package.json +15 -15
  61. package/src/client.ts +2 -2
  62. package/src/commits.ts +4 -4
  63. package/src/consts.ts +23 -0
  64. package/src/definitions.ts +2 -2
  65. package/src/events/types.ts +29 -0
  66. package/src/events.ts +105 -103
  67. package/src/facade.ts +11 -12
  68. package/src/feed.ts +17 -15
  69. package/src/helper/types.ts +15 -0
  70. package/src/helper.ts +27 -10
  71. package/src/index.ts +4 -1
  72. package/src/stores.ts +9 -39
  73. package/src/sync/types.ts +18 -0
  74. package/src/sync.ts +40 -0
  75. package/src/utils/record/types.ts +27 -0
  76. package/src/utils/record.ts +68 -75
  77. package/tests/events.spec.ts +12 -8
  78. package/tests/stores.spec.ts +13 -11
  79. package/build/utils/types.d.ts +0 -3
  80. package/build/utils/types.d.ts.map +0 -1
  81. package/build/utils.d.ts +0 -13
  82. package/build/utils.d.ts.map +0 -1
  83. package/build/utils.js +0 -15
  84. package/build/utils.js.map +0 -1
  85. package/src/utils/types.ts +0 -3
  86. package/src/utils.ts +0 -20
  87. /package/build/{utils → events}/types.js +0 -0
@@ -2,94 +2,87 @@ import type { PlanningCommitRecord, PlanningStores } from '../types.js'
2
2
  import type { CommitState, Relationship, Workcard } from '@owlmeans/planning'
3
3
  import type { ResourceRecord } from '@owlmeans/resource'
4
4
  import type { StateResource } from '@owlmeans/state'
5
+ import type { RecordUtils } from './record/types.js'
5
6
 
6
- const stable = (value: unknown): unknown => {
7
- if (Array.isArray(value)) {
8
- return value.map(stable)
9
- }
10
- if (value != null && typeof value === 'object') {
11
- return Object.fromEntries(Object.entries(value as Record<string, unknown>)
12
- .filter(([, entry]) => entry !== undefined)
13
- .sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0)
14
- .map(([key, entry]) => [key, stable(entry)]))
7
+ export const createRecordUtils = (): RecordUtils => {
8
+ const stable = (value: unknown): unknown => {
9
+ if (Array.isArray(value)) {
10
+ return value.map(stable)
11
+ }
12
+ if (value != null && typeof value === 'object') {
13
+ return Object.fromEntries(Object.entries(value as Record<string, unknown>)
14
+ .filter(([, entry]) => entry !== undefined)
15
+ .sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0)
16
+ .map(([key, entry]) => [key, stable(entry)]))
17
+ }
18
+
19
+ return value
15
20
  }
16
21
 
17
- return value
18
- }
22
+ const sameRecord = (left: unknown, right: unknown): boolean =>
23
+ JSON.stringify(stable(left)) === JSON.stringify(stable(right))
19
24
 
20
- /** Same content, whatever order the keys arrived in. */
21
- const sameRecord = (left: unknown, right: unknown): boolean =>
22
- JSON.stringify(stable(left)) === JSON.stringify(stable(right))
25
+ const putCard = async (store: StateResource<Workcard>, card: Workcard): Promise<Workcard> => {
26
+ if (card.id == null) {
27
+ return card
28
+ }
29
+ const known = await store.load(card.id)
30
+ if (known != null && (known.seq ?? 0) > (card.seq ?? 0)) {
31
+ return known
32
+ }
33
+ const head = Math.max(card.head ?? card.seq ?? 0, known?.head ?? 0)
34
+ const next = head > (card.head ?? card.seq ?? 0) ? { ...card, head } : card
35
+ if (known != null && sameRecord(known, next)) {
36
+ return known
37
+ }
38
+ await store.save(next)
23
39
 
24
- /**
25
- * Write one card unless the store already holds a NEWER fold of it.
26
- *
27
- * `seq` is the last folded transition, so a lower one is an older picture — a list fetched before a
28
- * commit landed must not undo that commit. The head only ever grows: a head this client allocated
29
- * (`applyReceipt`) stays until a fold catches up with it.
30
- */
31
- const putCard = async (store: StateResource<Workcard>, card: Workcard): Promise<Workcard> => {
32
- if (card.id == null) {
33
- return card
34
- }
35
- const known = await store.load(card.id)
36
- if (known != null && (known.seq ?? 0) > (card.seq ?? 0)) {
37
- return known
40
+ return next
38
41
  }
39
- const head = Math.max(card.head ?? card.seq ?? 0, known?.head ?? 0)
40
- const next = head > (card.head ?? card.seq ?? 0) ? { ...card, head } : card
41
- if (known != null && sameRecord(known, next)) {
42
- return known
43
- }
44
- await store.save(next)
45
-
46
- return next
47
- }
48
42
 
49
- const putLink = async (store: StateResource<Relationship>, link: Relationship): Promise<void> => {
50
- if (link.id == null) {
51
- return
52
- }
53
- const known = await store.load(link.id)
54
- if (known != null && sameRecord(known, link)) {
55
- return
43
+ const putLink = async (store: StateResource<Relationship>, link: Relationship): Promise<void> => {
44
+ if (link.id == null) {
45
+ return
46
+ }
47
+ const known = await store.load(link.id)
48
+ if (known != null && sameRecord(known, link)) {
49
+ return
50
+ }
51
+ await store.save(link)
56
52
  }
57
- await store.save(link)
58
- }
59
53
 
60
- /** Drop a card, whatever lives under it when it is a project, and every link touching any of them. */
61
- const dropCard = async (stores: PlanningStores, id: string, project: boolean): Promise<void> => {
62
- const ids = [id]
63
- if (project) {
64
- const children = await stores.cards.list({ parents: { $contains: [id] } })
65
- ids.push(...children.items.map(child => child.id).filter((child): child is string => child != null))
66
- }
67
- await stores.cards.purge({ id: { $in: ids } })
68
- if (await stores.links.count({ $or: [{ from: { $in: ids } }, { to: { $in: ids } }] }) > 0) {
69
- await stores.links.purge({ $or: [{ from: { $in: ids } }, { to: { $in: ids } }] })
54
+ const dropCard = async (stores: PlanningStores, id: string, project: boolean): Promise<void> => {
55
+ const ids = [id]
56
+ if (project) {
57
+ const children = await stores.cards.list({ parents: { $contains: [id] } })
58
+ ids.push(...children.items.map(child => child.id).filter((child): child is string => child != null))
59
+ }
60
+ await stores.cards.purge({ id: { $in: ids } })
61
+ if (await stores.links.count({ $or: [{ from: { $in: ids } }, { to: { $in: ids } }] }) > 0) {
62
+ await stores.links.purge({ $or: [{ from: { $in: ids } }, { to: { $in: ids } }] })
63
+ }
70
64
  }
71
- }
72
65
 
73
- /** Record what is known about a transition, merged over what was known before. */
74
- const putCommit = async (
75
- store: StateResource<PlanningCommitRecord>, record: Partial<PlanningCommitRecord> & { id: string, state: CommitState }
76
- ): Promise<PlanningCommitRecord> => {
77
- const known = await store.load(record.id)
78
- const next = { ...known, ...clean(record) } as PlanningCommitRecord
79
- if (known != null && sameRecord(known, next)) {
80
- return known
81
- }
82
- await store.save(next)
66
+ const putCommit = async (
67
+ store: StateResource<PlanningCommitRecord>, record: Partial<PlanningCommitRecord> & { id: string, state: CommitState }
68
+ ): Promise<PlanningCommitRecord> => {
69
+ const known = await store.load(record.id)
70
+ const next = { ...known, ...clean(record) } as PlanningCommitRecord
71
+ if (known != null && sameRecord(known, next)) {
72
+ return known
73
+ }
74
+ await store.save(next)
83
75
 
84
- return next
85
- }
76
+ return next
77
+ }
86
78
 
87
- const clean = <T extends object>(record: T): T =>
88
- Object.fromEntries(Object.entries(record).filter(([, value]) => value !== undefined)) as T
79
+ const clean = <T extends object>(record: T): T =>
80
+ Object.fromEntries(Object.entries(record).filter(([, value]) => value !== undefined)) as T
89
81
 
90
- const idsOf = <T extends ResourceRecord>(records: T[]): string[] =>
91
- records.map(record => record.id).filter((id): id is string => id != null)
82
+ const idsOf = <T extends ResourceRecord>(records: T[]): string[] =>
83
+ records.map(record => record.id).filter((id): id is string => id != null)
92
84
 
93
- export const createRecordHelper = () => ({ sameRecord, putCard, putLink, dropCard, putCommit, clean, idsOf })
85
+ return { sameRecord, putCard, putLink, dropCard, putCommit, clean, idsOf }
86
+ }
94
87
 
95
- export const recordHelper = createRecordHelper()
88
+ export const recordUtils = createRecordUtils()
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from 'bun:test'
2
2
  import { CommitState, TransitionAction, WorkcardKind } from '@owlmeans/planning'
3
3
  import type { CommitEvent, Transition, Workcard } from '@owlmeans/planning'
4
- import { applyCards, applyCommitEvent, syncLinks } from '../src/index.js'
4
+ import { planningMirrorOf, syncHelper } from '../src/index.js'
5
5
  import { STORY, makeSuite } from './context.js'
6
6
 
7
7
  /** The frame a bus publishes for a transition — ids only unless a record is given. */
@@ -23,13 +23,14 @@ describe('@owlmeans/client-planning — commit folds', () => {
23
23
  test('a committed frame without a record writes the card re-read through the facade', async () => {
24
24
  const suite = await makeSuite()
25
25
  const stores = suite.client.planningStores!()
26
+ const mirror = planningMirrorOf(stores)
26
27
  const project = await suite.project()
27
28
  const receipt = await suite.local.execute({
28
29
  card: { kind: WorkcardKind.Card, type: STORY, parent: project.id, title: 'Folded' },
29
30
  action: TransitionAction.Create,
30
31
  }, { wait: true })
31
32
 
32
- await applyCommitEvent(stores, frameOf(receipt.transition), suite.planning)
33
+ await mirror.applyCommitEvent(frameOf(receipt.transition), suite.planning)
33
34
 
34
35
  expect(await stores.cards.get(receipt.transition.card)).toEqual(receipt.card!)
35
36
  expect((await stores.commits.get(receipt.transition.id!)).state).toBe(CommitState.Committed)
@@ -38,6 +39,7 @@ describe('@owlmeans/client-planning — commit folds', () => {
38
39
  test('a committed delete removes the row and every link touching it', async () => {
39
40
  const suite = await makeSuite()
40
41
  const stores = suite.client.planningStores!()
42
+ const mirror = planningMirrorOf(stores)
41
43
  const project = await suite.project()
42
44
  const first = await suite.story(project.id!, 'First')
43
45
  const second = (await suite.local.execute({
@@ -45,13 +47,13 @@ describe('@owlmeans/client-planning — commit folds', () => {
45
47
  action: TransitionAction.Create,
46
48
  links: [{ type: 'follows', to: first.id! }],
47
49
  }, { wait: true })).card!
48
- await applyCards(stores, [first, second])
50
+ await mirror.applyCards([first, second])
49
51
  const links = await suite.planning.relationships.list({ from: second.id })
50
- await syncLinks(stores.links, links.items)
52
+ await syncHelper.syncLinks(stores.links, links.items)
51
53
  expect(await stores.links.count()).toBe(1)
52
54
 
53
55
  const removal = await suite.local.execute({ card: first.id!, action: TransitionAction.Delete }, { wait: true })
54
- await applyCommitEvent(stores, frameOf(removal.transition, null), suite.planning)
56
+ await mirror.applyCommitEvent(frameOf(removal.transition, null), suite.planning)
55
57
 
56
58
  expect(await stores.cards.load(first.id!)).toBeNull()
57
59
  expect(await stores.cards.load(second.id!)).not.toBeNull()
@@ -61,6 +63,7 @@ describe('@owlmeans/client-planning — commit folds', () => {
61
63
  test('a frame for an id the store never saw still writes a row', async () => {
62
64
  const suite = await makeSuite()
63
65
  const stores = suite.client.planningStores!()
66
+ const mirror = planningMirrorOf(stores)
64
67
  const project = await suite.project()
65
68
  const receipt = await suite.local.execute({
66
69
  card: { kind: WorkcardKind.Card, type: STORY, parent: project.id, title: 'From another tab' },
@@ -68,7 +71,7 @@ describe('@owlmeans/client-planning — commit folds', () => {
68
71
  }, { wait: true })
69
72
  expect(await stores.cards.count()).toBe(0)
70
73
 
71
- await applyCommitEvent(stores, frameOf(receipt.transition, receipt.card))
74
+ await mirror.applyCommitEvent(frameOf(receipt.transition, receipt.card))
72
75
 
73
76
  expect((await stores.cards.get(receipt.transition.card)).title).toBe('From another tab')
74
77
  })
@@ -76,6 +79,7 @@ describe('@owlmeans/client-planning — commit folds', () => {
76
79
  test('an older seq never overwrites a newer record', async () => {
77
80
  const suite = await makeSuite()
78
81
  const stores = suite.client.planningStores!()
82
+ const mirror = planningMirrorOf(stores)
79
83
  const project = await suite.project()
80
84
  const created = await suite.local.execute({
81
85
  card: { kind: WorkcardKind.Card, type: STORY, parent: project.id, title: 'Racing' },
@@ -84,9 +88,9 @@ describe('@owlmeans/client-planning — commit folds', () => {
84
88
  const started = await suite.local.execute({
85
89
  card: created.transition.card, action: TransitionAction.Transit, transition: 'start',
86
90
  }, { wait: true })
87
- await applyCards(stores, [started.card!])
91
+ await mirror.applyCards([started.card!])
88
92
 
89
- await applyCommitEvent(stores, frameOf(created.transition, created.card))
93
+ await mirror.applyCommitEvent(frameOf(created.transition, created.card))
90
94
 
91
95
  const stored = await stores.cards.get(created.transition.card)
92
96
  expect(stored.seq).toBe(2)
@@ -1,20 +1,21 @@
1
1
  import { describe, expect, test } from 'bun:test'
2
- import { isPending, modelOf, TransitionAction, WorkcardKind } from '@owlmeans/planning'
3
- import { applyCards, syncCards } from '../src/index.js'
2
+ import { cardHelper, modelOf, TransitionAction, WorkcardKind } from '@owlmeans/planning'
3
+ import { planningMirrorOf, syncHelper } from '../src/index.js'
4
4
  import { makeSuite } from './context.js'
5
5
 
6
6
  describe('@owlmeans/client-planning — the state mirror', () => {
7
7
  test('syncCards drops only what matches `where` and the list does not name', async () => {
8
8
  const suite = await makeSuite()
9
9
  const stores = suite.client.planningStores!()
10
+ const mirror = planningMirrorOf(stores)
10
11
  const one = await suite.project('One')
11
12
  const two = await suite.project('Two')
12
13
  const kept = await suite.story(one.id!, 'Kept')
13
14
  const deleted = await suite.story(one.id!, 'Deleted elsewhere')
14
15
  const elsewhere = await suite.story(two.id!, 'Another project')
15
- await applyCards(stores, [one, two, kept, deleted, elsewhere])
16
+ await mirror.applyCards([one, two, kept, deleted, elsewhere])
16
17
 
17
- await syncCards(stores.cards, [kept], { parent: one.id })
18
+ await syncHelper.syncCards(stores.cards, [kept], { parent: one.id })
18
19
 
19
20
  const ids = (await stores.cards.list()).items.map(card => card.id).sort()
20
21
  expect(ids).toEqual([one.id, two.id, kept.id, elsewhere.id].sort())
@@ -32,11 +33,11 @@ describe('@owlmeans/client-planning — the state mirror', () => {
32
33
  suite.planning.specifications.list(project.id!),
33
34
  suite.planning.cards.list({ kind: WorkcardKind.Card, parent: project.id }),
34
35
  ])
35
- await syncCards(stores.cards, projects.items, { kind: WorkcardKind.Project })
36
- await syncCards(stores.cards, specs.items, { kind: WorkcardKind.Specification, parent: project.id })
36
+ await syncHelper.syncCards(stores.cards, projects.items, { kind: WorkcardKind.Project })
37
+ await syncHelper.syncCards(stores.cards, specs.items, { kind: WorkcardKind.Specification, parent: project.id })
37
38
  // A card list reloading with nothing in it must not take the project or its brief with it.
38
- await syncCards(stores.cards, [], { kind: WorkcardKind.Card, parent: project.id })
39
- await syncCards(stores.cards, cards.items, { kind: WorkcardKind.Card, parent: project.id })
39
+ await syncHelper.syncCards(stores.cards, [], { kind: WorkcardKind.Card, parent: project.id })
40
+ await syncHelper.syncCards(stores.cards, cards.items, { kind: WorkcardKind.Card, parent: project.id })
40
41
 
41
42
  const kinds = (await stores.cards.list()).items.map(card => card.kind).sort()
42
43
  expect(kinds).toEqual([WorkcardKind.Card, WorkcardKind.Project, WorkcardKind.Specification])
@@ -45,23 +46,24 @@ describe('@owlmeans/client-planning — the state mirror', () => {
45
46
  test('a receipt marks the card pending (head > seq) and its commit clears the mark', async () => {
46
47
  const suite = await makeSuite({ sync: false })
47
48
  const stores = suite.client.planningStores!()
49
+ const mirror = planningMirrorOf(stores)
48
50
  const project = await suite.project()
49
51
  const story = await suite.story(project.id!)
50
- await applyCards(stores, [story])
52
+ await mirror.applyCards([story])
51
53
 
52
54
  const receipt = await suite.planning.execute({
53
55
  card: story.id!, action: TransitionAction.Transit, transition: 'start', expectSeq: story.seq,
54
56
  })
55
57
 
56
58
  const marked = await stores.cards.get(story.id!)
57
- expect(isPending(marked)).toBe(true)
59
+ expect(cardHelper.isPending(marked)).toBe(true)
58
60
  expect(modelOf(marked, suite.planning).pending()).toBe(true)
59
61
 
60
62
  await suite.store.flush()
61
63
  await receipt.committed({ timeout: 5_000 })
62
64
 
63
65
  const folded = await stores.cards.get(story.id!)
64
- expect(isPending(folded)).toBe(false)
66
+ expect(cardHelper.isPending(folded)).toBe(false)
65
67
  expect(folded.status).toBe('doing')
66
68
  })
67
69
  })
@@ -1,3 +0,0 @@
1
- import type { createRecordHelper } from './record.js';
2
- export type RecordHelper = ReturnType<typeof createRecordHelper>;
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
package/build/utils.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import { type StateAlias } from '@owlmeans/state';
2
- import type { Relationship, Workcard } from '@owlmeans/planning';
3
- import type { PlanningCommitRecord, PlanningStoreAliases } from './types.js';
4
- /**
5
- * The ONE card store. Projects, cards and specifications share an id space on the server, so they
6
- * share it here too — a store per kind would let a list reload of one kind drop another's rows.
7
- */
8
- export declare const CARDS: StateAlias<Workcard>;
9
- export declare const LINKS: StateAlias<Relationship>;
10
- /** What the client has learned about each transition it wrote or saw, keyed by transition id. */
11
- export declare const COMMITS: StateAlias<PlanningCommitRecord>;
12
- export declare const DEFAULT_STORE_ALIASES: Readonly<PlanningStoreAliases>;
13
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,iBAAiB,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAE5E;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,UAAU,CAAC,QAAQ,CAA+C,CAAA;AAEtF,eAAO,MAAM,KAAK,EAAE,UAAU,CAAC,YAAY,CAAmD,CAAA;AAE9F,iGAAiG;AACjG,eAAO,MAAM,OAAO,EAAE,UAAU,CAAC,oBAAoB,CAA6D,CAAA;AAElH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,oBAAoB,CAI/D,CAAA"}
package/build/utils.js DELETED
@@ -1,15 +0,0 @@
1
- import { stateAlias } from '@owlmeans/state';
2
- /**
3
- * The ONE card store. Projects, cards and specifications share an id space on the server, so they
4
- * share it here too — a store per kind would let a list reload of one kind drop another's rows.
5
- */
6
- export const CARDS = stateAlias('planning-card-state');
7
- export const LINKS = stateAlias('planning-link-state');
8
- /** What the client has learned about each transition it wrote or saw, keyed by transition id. */
9
- export const COMMITS = stateAlias('planning-commit-state');
10
- export const DEFAULT_STORE_ALIASES = Object.freeze({
11
- cards: CARDS,
12
- links: LINKS,
13
- commits: COMMITS,
14
- });
15
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAI7D;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAyB,UAAU,CAAW,qBAAqB,CAAC,CAAA;AAEtF,MAAM,CAAC,MAAM,KAAK,GAA6B,UAAU,CAAe,qBAAqB,CAAC,CAAA;AAE9F,iGAAiG;AACjG,MAAM,CAAC,MAAM,OAAO,GAAqC,UAAU,CAAuB,uBAAuB,CAAC,CAAA;AAElH,MAAM,CAAC,MAAM,qBAAqB,GAAmC,MAAM,CAAC,MAAM,CAAC;IACjF,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,OAAO;CACjB,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { createRecordHelper } from './record.js'
2
-
3
- export type RecordHelper = ReturnType<typeof createRecordHelper>
package/src/utils.ts DELETED
@@ -1,20 +0,0 @@
1
- import { type StateAlias, stateAlias } from '@owlmeans/state'
2
- import type { Relationship, Workcard } from '@owlmeans/planning'
3
- import type { PlanningCommitRecord, PlanningStoreAliases } from './types.js'
4
-
5
- /**
6
- * The ONE card store. Projects, cards and specifications share an id space on the server, so they
7
- * share it here too — a store per kind would let a list reload of one kind drop another's rows.
8
- */
9
- export const CARDS: StateAlias<Workcard> = stateAlias<Workcard>('planning-card-state')
10
-
11
- export const LINKS: StateAlias<Relationship> = stateAlias<Relationship>('planning-link-state')
12
-
13
- /** What the client has learned about each transition it wrote or saw, keyed by transition id. */
14
- export const COMMITS: StateAlias<PlanningCommitRecord> = stateAlias<PlanningCommitRecord>('planning-commit-state')
15
-
16
- export const DEFAULT_STORE_ALIASES: Readonly<PlanningStoreAliases> = Object.freeze({
17
- cards: CARDS,
18
- links: LINKS,
19
- commits: COMMITS,
20
- })
File without changes