@estiva-app/interop 0.93.0 → 0.94.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/CHANGELOG.md +30 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/topicArrangement.d.ts +164 -0
- package/dist/topicArrangement.d.ts.map +1 -0
- package/dist/topicArrangement.js +314 -0
- package/dist/topicArrangement.js.map +1 -0
- package/dist/topics.d.ts +21 -12
- package/dist/topics.d.ts.map +1 -1
- package/dist/topics.js +67 -7
- package/dist/topics.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +24 -0
- package/src/topicArrangement.ts +396 -0
- package/src/topics.ts +85 -13
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,36 @@ how a declaration is read, is a MAJOR — in `0.x`, a MINOR — even when no
|
|
|
6
6
|
TypeScript signature moved. A consumer upgrading must be able to tell whether
|
|
7
7
|
manifests already published still mean what they meant.
|
|
8
8
|
|
|
9
|
+
## 0.94.0 — 2026-11-10
|
|
10
|
+
|
|
11
|
+
**Manifest: nothing new. Wire: two new fields on a topic, `order:<d>` and `look:<d>`, written only by the new planners; a topic's list is read by the list read where the relay offers it** (TOPI-5; record each-file-on-a-topic-keeps-its-own-place-and-look).
|
|
12
|
+
|
|
13
|
+
- `ListedFile` now carries the file's arrangement (SPEC §6.14): `order`
|
|
14
|
+
(its place, a key; absent when it has none that counts), `look` (`row` or
|
|
15
|
+
`card`; absent: draw the manifest's widget), and `prev` / `prevAt`, what
|
|
16
|
+
its next `order:` or `look:` change follows. `topicList`, `topicLists` and
|
|
17
|
+
`readTopics` return each topic's files **in the topic's order**: placed by
|
|
18
|
+
key, byte-wise, equal keys by the lower id, then the rest oldest listed
|
|
19
|
+
first. A place older than the file's newest listing is ignored.
|
|
20
|
+
- `keyBetween`, `isPlaceKey`, `sortArranged`: the key a place is kept in,
|
|
21
|
+
`0-9A-Za-z`, never ending in `0`.
|
|
22
|
+
- `planMoveInTopic` (to just after a file, or first), `planLookInTopic` and
|
|
23
|
+
`planPutBackInTopic` (Undo of Remove: back on the list, then back in its
|
|
24
|
+
place, its look kept). A drop among files nobody placed places those above
|
|
25
|
+
it too, in one change of several fields, taken whole or refused whole.
|
|
26
|
+
Every `order:` change names its `prev`: the field's newest change on the
|
|
27
|
+
relay, one a reader skips included.
|
|
28
|
+
- `writeArrangement`: sends one, and on `conflict:` reads the topic again
|
|
29
|
+
and plans again; it never re-sends a place it added for someone else's file.
|
|
30
|
+
- `ListReadOptions.listRead` (and `readTopics` when `parentsListRead` is
|
|
31
|
+
set): read a topic's list by `{"fields":"newest","kinds":[30840],"#d":[…]}`,
|
|
32
|
+
at most three changes per file however often its files move, with one more
|
|
33
|
+
read for a file whose newest change a reader skips. Without it, the `#O`
|
|
34
|
+
read as before, which grows with each move.
|
|
35
|
+
- `topicsOfFile` pages its `#o` read: it also returns each move of the file.
|
|
36
|
+
- Upgrading: a `ListedFile` an app builds itself needs `prev` and `prevAt`.
|
|
37
|
+
An app that sorted a topic's files itself should keep the order it is given.
|
|
38
|
+
|
|
9
39
|
## 0.93.0 — 2026-11-09
|
|
10
40
|
|
|
11
41
|
**Manifest: nothing new. Wire: nothing new; no request added, nothing written** (TOPI-3).
|
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,14 @@ export { planCreateFolder, planRenameFolder, planDeleteFolder, planPlaceFile, pl
|
|
|
48
48
|
* per file by its id. Plan an entry, read a topic's list, and ask which topics
|
|
49
49
|
* list a file (`#o`); a file's own changes (`#O`) never hold an entry.
|
|
50
50
|
*/
|
|
51
|
-
export { planListInTopic, planRemoveFromTopic, topicsOfFile, topicList, topicLists, readTopics, addableTopics, topicConversations, type ReadTopic, type TopicsRead, type TopicConversation, topicsOfFileFilter, topicListFilter, listEntries, listsField, LISTED_FILE_KINDS, type ListHolder, type ListEntry, type FileTopic, type ListedFile, } from './topics.js';
|
|
51
|
+
export { planListInTopic, planRemoveFromTopic, topicsOfFile, topicList, topicLists, readTopics, addableTopics, topicConversations, type ReadTopic, type TopicsRead, type TopicConversation, topicsOfFileFilter, topicListFilter, listEntries, listsField, LISTED_FILE_KINDS, type ListHolder, type ListEntry, type FileTopic, type ListedFile, type ListReadOptions, } from './topics.js';
|
|
52
|
+
/**
|
|
53
|
+
* SPEC §6.14: a topic's files in the order and look someone gave them. Each
|
|
54
|
+
* file's place (`order:<d>`) and look (`look:<d>`) are fields of their own on
|
|
55
|
+
* the topic, so two people arranging at once both keep their change; plan a
|
|
56
|
+
* move, a look or an Undo of Remove, and send it with `writeArrangement`.
|
|
57
|
+
*/
|
|
58
|
+
export { keyBetween, isPlaceKey, orderField, lookField, sortArranged, planMoveInTopic, planLookInTopic, planPutBackInTopic, writeArrangement, type FileLook, type FileArrangement, type ArrangedFile, type ArrangeHolder, type WriteArrangementArgs, } from './topicArrangement.js';
|
|
52
59
|
/**
|
|
53
60
|
* Your topics, newest activity first: the one rule every app orders topics by
|
|
54
61
|
* (TOPI-10), read once for any set of topics and kept current live.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY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EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,cAAc,CAAA;AAErB;;;;GAIG;AACH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,OAAO,EACP,KAAK,MAAM,EACX,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,KAAK,mBAAmB,EACxB,SAAS,EACT,KAAK,OAAO,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,eAAe,E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ACjB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAA;AAEpB;;;;GAIG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EACP,eAAe,EACf,MAAM,EACN,eAAe,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,QAAQ,GACd,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,KAAK,WAAW,GACjB,MAAM,eAAe,CAAA;AAEtB;;;;;;;GAOG;AACH,OAAO,EACL,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,UAAU,EACV,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -49,6 +49,13 @@ export { planCreateFolder, planRenameFolder, planDeleteFolder, planPlaceFile, pl
|
|
|
49
49
|
* list a file (`#o`); a file's own changes (`#O`) never hold an entry.
|
|
50
50
|
*/
|
|
51
51
|
export { planListInTopic, planRemoveFromTopic, topicsOfFile, topicList, topicLists, readTopics, addableTopics, topicConversations, topicsOfFileFilter, topicListFilter, listEntries, listsField, LISTED_FILE_KINDS, } from './topics.js';
|
|
52
|
+
/**
|
|
53
|
+
* SPEC §6.14: a topic's files in the order and look someone gave them. Each
|
|
54
|
+
* file's place (`order:<d>`) and look (`look:<d>`) are fields of their own on
|
|
55
|
+
* the topic, so two people arranging at once both keep their change; plan a
|
|
56
|
+
* move, a look or an Undo of Remove, and send it with `writeArrangement`.
|
|
57
|
+
*/
|
|
58
|
+
export { keyBetween, isPlaceKey, orderField, lookField, sortArranged, planMoveInTopic, planLookInTopic, planPutBackInTopic, writeArrangement, } from './topicArrangement.js';
|
|
52
59
|
/**
|
|
53
60
|
* Your topics, newest activity first: the one rule every app orders topics by
|
|
54
61
|
* (TOPI-10), read once for any set of topics and kept current live.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,aAAa,EAIb,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,OAAO,EAEP,cAAc,EACd,oBAAoB,EACpB,eAAe,EAEf,SAAS,EAET,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAEjB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EAErB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EAmBnB,cAAc,GAEf,MAAM,iBAAiB,CAAA;AAExB;;;GAGG;AACH,OAAO,EAAE,SAAS,EAA+B,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,eAAe,EAAyB,MAAM,gBAAgB,CAAA;AAEvE;;;GAGG;AACH,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,oBAAoB,GAGrB,MAAM,iBAAiB,CAAA;AAExB;;;;;GAKG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,aAAa,GAMd,MAAM,cAAc,CAAA;AAErB;;;;GAIG;AACH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EACV,aAAa,EACb,kBAAkB,EAIlB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,UAAU,EACV,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,aAAa,EAIb,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,OAAO,EAEP,cAAc,EACd,oBAAoB,EACpB,eAAe,EAEf,SAAS,EAET,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAEjB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EAErB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EAmBnB,cAAc,GAEf,MAAM,iBAAiB,CAAA;AAExB;;;GAGG;AACH,OAAO,EA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EAChB,cAAc,EACd,WAAW,EACX,YAAY,GAQb,MAAM,aAAa,CAAA;AAEpB;;;;GAIG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EACP,eAAe,EACf,MAAM,EACN,eAAe,GAKhB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,4BAA4B,GAE7B,MAAM,eAAe,CAAA;AAEtB;;;;;;;GAOG;AACH,OAAO,EACL,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,UAAU,GAGX,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A topic's files in the order and look someone gave them (SPEC §6.14).
|
|
3
|
+
*
|
|
4
|
+
* The topic keeps, per listed file, two fields beside the entry that lists it:
|
|
5
|
+
* `order:<d>`, a sort key that places the file between its neighbours, and
|
|
6
|
+
* `look:<d>`, `row` or `card`. Each is a `kind:1851` on the topic with §6.14's
|
|
7
|
+
* tags and skip rules, `["o", <d>]` included, so two people arranging at once
|
|
8
|
+
* both keep their change.
|
|
9
|
+
*
|
|
10
|
+
* - Files with a place come first, by key compared byte-wise, equal keys by
|
|
11
|
+
* the lower id; files with none follow, oldest listed first (§6.3).
|
|
12
|
+
* - A place older than the file's newest `lists:<d>` = `true` is ignored: a
|
|
13
|
+
* file taken off and put back comes back unplaced, unless the put-back
|
|
14
|
+
* places it again ({@link planPutBackInTopic}).
|
|
15
|
+
* - A missing or unknown look draws the manifest's widget: the look is a hint.
|
|
16
|
+
* - Every `order:` change names the change it follows (`prev`), so a tab that
|
|
17
|
+
* read the topic before someone else moved the file is refused, and plans
|
|
18
|
+
* the move again on what is there now ({@link writeArrangement}).
|
|
19
|
+
*
|
|
20
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/each-file-on-a-topic-keeps-its-own-place-and-look.md
|
|
21
|
+
*/
|
|
22
|
+
import type { SignedEvent, UnsignedEvent } from '@estiva-app/protocol';
|
|
23
|
+
export type FileLook = 'row' | 'card';
|
|
24
|
+
/** The field a file's place on a topic is kept in: `order:<d>`. */
|
|
25
|
+
export declare const orderField: (file: string) => string;
|
|
26
|
+
/** The field a file's look on a topic is kept in: `look:<d>`. */
|
|
27
|
+
export declare const lookField: (file: string) => string;
|
|
28
|
+
/** The longest key a reader takes (§6.14); a planner whose key would pass it places every file afresh. */
|
|
29
|
+
export declare const MAX_PLACE_KEY = 64;
|
|
30
|
+
/** A place §6.14 reads: 1 to 64 of `0-9A-Za-z`, not ending in `0`. Anything else is no place. */
|
|
31
|
+
export declare const isPlaceKey: (key: string | undefined) => key is string;
|
|
32
|
+
/**
|
|
33
|
+
* A key that sorts strictly between `before` and `after`, either left out for
|
|
34
|
+
* an open end. Each must be a valid key and `before` sort before `after`.
|
|
35
|
+
* Pure, so two people dropping files between the same neighbours get the same
|
|
36
|
+
* key; the file's id breaks that tie.
|
|
37
|
+
*/
|
|
38
|
+
export declare function keyBetween(before?: string, after?: string): string;
|
|
39
|
+
/** What a reader knows of one listed file's place and look, beside its list entry. */
|
|
40
|
+
export interface FileArrangement {
|
|
41
|
+
/** Its place, when it has one that counts: a valid key no older than its newest listing. */
|
|
42
|
+
order?: string;
|
|
43
|
+
/** Its look, when set to one a reader knows; otherwise draw the manifest's widget. */
|
|
44
|
+
look?: FileLook;
|
|
45
|
+
/**
|
|
46
|
+
* What the next change of each field follows: the field's newest change
|
|
47
|
+
* on the relay, one a reader skips included (the relay chains them all),
|
|
48
|
+
* or the topic's first record when the field never changed.
|
|
49
|
+
*/
|
|
50
|
+
prev: {
|
|
51
|
+
order: string;
|
|
52
|
+
look: string;
|
|
53
|
+
};
|
|
54
|
+
/** The latest time (ms) among those, so a change is stamped after it. */
|
|
55
|
+
prevAt: number;
|
|
56
|
+
}
|
|
57
|
+
/** A file in the order it is drawn, as the planners are handed it. */
|
|
58
|
+
export interface ArrangedFile extends FileArrangement {
|
|
59
|
+
/** The listed file's id. */
|
|
60
|
+
file: string;
|
|
61
|
+
}
|
|
62
|
+
interface Heads {
|
|
63
|
+
/** Newest good change per field, by field name. */
|
|
64
|
+
good: Map<string, SignedEvent>;
|
|
65
|
+
/** Newest change per field, any, by field name: the next `prev`. */
|
|
66
|
+
any: Map<string, SignedEvent>;
|
|
67
|
+
}
|
|
68
|
+
/** The listed file a per-file field of a list names — `lists:`, `order:` or `look:` — or `null` for any other field. */
|
|
69
|
+
export declare const fileOfListField: (field: string) => string | null;
|
|
70
|
+
/**
|
|
71
|
+
* Whether a change setting `field` on `list` is one a reader folds (§6.14's
|
|
72
|
+
* skip rules, for `lists:`, `order:` and `look:` alike): one of its `o` tags
|
|
73
|
+
* is the field's `<d>`, its `a` is the list, its `O` the list's id, the `<d>`
|
|
74
|
+
* is not the list itself, and its `h` is the list's team.
|
|
75
|
+
*/
|
|
76
|
+
export declare function readsAs(event: SignedEvent, field: string, list: string, team: string | null | undefined): boolean;
|
|
77
|
+
/** The `order:` and `look:` changes per list, newest good and newest of any. */
|
|
78
|
+
export declare function arrangementHeads(events: readonly SignedEvent[], teamOfList: (list: string) => string | null | undefined): Map<string, Heads>;
|
|
79
|
+
/**
|
|
80
|
+
* One file's arrangement on a list, from {@link arrangementHeads}: `listed`
|
|
81
|
+
* is the file's newest `lists:<d>` = `true` entry, `root` the list's first
|
|
82
|
+
* record (the first `prev`).
|
|
83
|
+
*/
|
|
84
|
+
export declare function arrangementOf(heads: Heads | undefined, file: string, listed: SignedEvent, root: SignedEvent): FileArrangement;
|
|
85
|
+
/**
|
|
86
|
+
* §6.14's order, stable: placed files by key (equal keys by the lower id),
|
|
87
|
+
* then the rest in the order given, which is oldest listed first.
|
|
88
|
+
*/
|
|
89
|
+
export declare function sortArranged<T extends {
|
|
90
|
+
file: string;
|
|
91
|
+
order?: string;
|
|
92
|
+
}>(files: readonly T[]): T[];
|
|
93
|
+
/** The topic the change goes on: its address and its team, read from its root (§6.2). */
|
|
94
|
+
export interface ArrangeHolder {
|
|
95
|
+
address: string;
|
|
96
|
+
folder: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Move `file` to just after `after` (`null`: first) in `files`, which is the
|
|
100
|
+
* topic's files in the order drawn. One change: the moved file's place, and
|
|
101
|
+
* where it lands among files with no place, the places of those above it too,
|
|
102
|
+
* since unplaced files follow placed ones; files tied on one key with the one
|
|
103
|
+
* it lands before are placed again after it. Several places go in one change,
|
|
104
|
+
* taken whole or refused whole. `null` when the file is already there.
|
|
105
|
+
*/
|
|
106
|
+
export declare function planMoveInTopic(pubkey: string, createdAtMs: number, args: {
|
|
107
|
+
topic: ArrangeHolder;
|
|
108
|
+
files: readonly ArrangedFile[];
|
|
109
|
+
file: string;
|
|
110
|
+
after: string | null;
|
|
111
|
+
}): UnsignedEvent | null;
|
|
112
|
+
/** Show `file` as a row or a card: one `look:<d>` change. */
|
|
113
|
+
export declare function planLookInTopic(pubkey: string, createdAtMs: number, args: {
|
|
114
|
+
topic: ArrangeHolder;
|
|
115
|
+
file: ArrangedFile;
|
|
116
|
+
look: FileLook;
|
|
117
|
+
}): UnsignedEvent;
|
|
118
|
+
/**
|
|
119
|
+
* Undo of Remove: put `file` back on the list, then back in the place it had
|
|
120
|
+
* — just after `after` (`null`: first). Its look stays: a listing never
|
|
121
|
+
* resets it. Publish `relist`, then send `move` with {@link writeArrangement}
|
|
122
|
+
* over the list read again, so a refusal plans the move again rather than
|
|
123
|
+
* leaving the file back but last. The move is stamped after the listing, so
|
|
124
|
+
* its place is not older than it.
|
|
125
|
+
*/
|
|
126
|
+
export declare function planPutBackInTopic(pubkey: string, createdAtMs: number, args: {
|
|
127
|
+
topic: ArrangeHolder;
|
|
128
|
+
file: ArrangedFile;
|
|
129
|
+
after: string | null;
|
|
130
|
+
}): {
|
|
131
|
+
relist: UnsignedEvent;
|
|
132
|
+
move: (files: readonly ArrangedFile[], createdAtMs: number) => UnsignedEvent | null;
|
|
133
|
+
};
|
|
134
|
+
/** What {@link writeArrangement} is handed. */
|
|
135
|
+
export interface WriteArrangementArgs {
|
|
136
|
+
/** The topic's files as drawn now, from {@link topicList}; read again after a refusal. */
|
|
137
|
+
files: readonly ArrangedFile[];
|
|
138
|
+
read: () => Promise<readonly ArrangedFile[]>;
|
|
139
|
+
/** The change for these files, or `null` when there is nothing left to do. */
|
|
140
|
+
plan: (files: readonly ArrangedFile[], createdAtMs: number) => UnsignedEvent | null;
|
|
141
|
+
sign: (event: UnsignedEvent) => Promise<SignedEvent>;
|
|
142
|
+
publish: (event: SignedEvent) => Promise<{
|
|
143
|
+
ok: boolean;
|
|
144
|
+
reason?: string;
|
|
145
|
+
}>;
|
|
146
|
+
now?: () => number;
|
|
147
|
+
tries?: number;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Send an arrangement change, and answer a `conflict:` by reading the topic
|
|
151
|
+
* again and planning the change again on what is there now — never by sending
|
|
152
|
+
* the same places again. A place the planner added for a file nobody had
|
|
153
|
+
* placed would otherwise write over a move someone made since; a look or a
|
|
154
|
+
* single move planned again is §6.2's "set it again after the current one".
|
|
155
|
+
*/
|
|
156
|
+
export declare function writeArrangement(args: WriteArrangementArgs): Promise<{
|
|
157
|
+
ok: true;
|
|
158
|
+
event?: SignedEvent;
|
|
159
|
+
} | {
|
|
160
|
+
ok: false;
|
|
161
|
+
refused: string;
|
|
162
|
+
}>;
|
|
163
|
+
export {};
|
|
164
|
+
//# sourceMappingURL=topicArrangement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topicArrangement.d.ts","sourceRoot":"","sources":["../src/topicArrangement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAOtE,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAA;AAIrC,mEAAm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combineChanges, conflictOf, fieldsSetBy } from './fields.js';
|
|
3
|
+
const KIND_CHANGE = 1851;
|
|
4
|
+
const ADDRESS = /^(\d+):([0-9a-f]{64}):(.+)$/;
|
|
5
|
+
const ORDER = 'order:';
|
|
6
|
+
const LOOK = 'look:';
|
|
7
|
+
/** The field a file's place on a topic is kept in: `order:<d>`. */
|
|
8
|
+
export const orderField = (file) => `${ORDER}${file}`;
|
|
9
|
+
/** The field a file's look on a topic is kept in: `look:<d>`. */
|
|
10
|
+
export const lookField = (file) => `${LOOK}${file}`;
|
|
11
|
+
/** Digits in byte order: `0`–`9`, `A`–`Z`, `a`–`z`. */
|
|
12
|
+
const DIGITS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
13
|
+
const KEY = /^[0-9A-Za-z]*[1-9A-Za-z]$/;
|
|
14
|
+
/** The longest key a reader takes (§6.14); a planner whose key would pass it places every file afresh. */
|
|
15
|
+
export const MAX_PLACE_KEY = 64;
|
|
16
|
+
/** A place §6.14 reads: 1 to 64 of `0-9A-Za-z`, not ending in `0`. Anything else is no place. */
|
|
17
|
+
export const isPlaceKey = (key) => typeof key === 'string' && key.length <= MAX_PLACE_KEY && KEY.test(key);
|
|
18
|
+
/** `n` keys, evenly spread and as short as `n` allows, in order: every file placed afresh. */
|
|
19
|
+
function evenKeys(n) {
|
|
20
|
+
let width = 1;
|
|
21
|
+
while (DIGITS.length ** width < (n + 1) * 2)
|
|
22
|
+
width++;
|
|
23
|
+
const span = DIGITS.length ** width;
|
|
24
|
+
return Array.from({ length: n }, (_, i) => {
|
|
25
|
+
let value = Math.floor(((i + 1) * span) / (n + 1));
|
|
26
|
+
let key = '';
|
|
27
|
+
for (let w = 0; w < width; w++) {
|
|
28
|
+
key = DIGITS[value % DIGITS.length] + key;
|
|
29
|
+
value = Math.floor(value / DIGITS.length);
|
|
30
|
+
}
|
|
31
|
+
// Never ending in `0`: a trailing `1` still sorts after this key and before the next.
|
|
32
|
+
return key.endsWith('0') ? `${key}1` : key;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** Byte-wise, as §6.14 compares keys (never `localeCompare`). */
|
|
36
|
+
const compareKeys = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
37
|
+
/**
|
|
38
|
+
* A key that sorts strictly between `before` and `after`, either left out for
|
|
39
|
+
* an open end. Each must be a valid key and `before` sort before `after`.
|
|
40
|
+
* Pure, so two people dropping files between the same neighbours get the same
|
|
41
|
+
* key; the file's id breaks that tie.
|
|
42
|
+
*/
|
|
43
|
+
export function keyBetween(before, after) {
|
|
44
|
+
if (before !== undefined && !isPlaceKey(before))
|
|
45
|
+
throw new Error(`not a place key: ${JSON.stringify(before)}`);
|
|
46
|
+
if (after !== undefined && !isPlaceKey(after))
|
|
47
|
+
throw new Error(`not a place key: ${JSON.stringify(after)}`);
|
|
48
|
+
if (before !== undefined && after !== undefined && compareKeys(before, after) >= 0) {
|
|
49
|
+
throw new Error(`${JSON.stringify(before)} does not sort before ${JSON.stringify(after)}`);
|
|
50
|
+
}
|
|
51
|
+
return midpoint(before ?? '', after);
|
|
52
|
+
}
|
|
53
|
+
/** Between `a` (possibly empty) and `b` (absent: no upper end), neither ending in `0`. */
|
|
54
|
+
function midpoint(a, b) {
|
|
55
|
+
if (b !== undefined) {
|
|
56
|
+
// A shared start stays; the rest is placed between what follows it.
|
|
57
|
+
let n = 0;
|
|
58
|
+
while ((a[n] ?? '0') === b[n])
|
|
59
|
+
n++;
|
|
60
|
+
if (n > 0)
|
|
61
|
+
return b.slice(0, n) + midpoint(a.slice(n), b.slice(n));
|
|
62
|
+
}
|
|
63
|
+
const low = a ? DIGITS.indexOf(a[0]) : 0;
|
|
64
|
+
const high = b !== undefined ? DIGITS.indexOf(b[0]) : DIGITS.length;
|
|
65
|
+
if (high - low > 1)
|
|
66
|
+
return DIGITS[Math.round((low + high) / 2)];
|
|
67
|
+
// Adjacent digits: a longer `b` has room under its first digit; otherwise go one digit deeper after `a`'s.
|
|
68
|
+
if (b !== undefined && b.length > 1)
|
|
69
|
+
return b.slice(0, 1);
|
|
70
|
+
return DIGITS[low] + midpoint(a.slice(1), undefined);
|
|
71
|
+
}
|
|
72
|
+
const tagOf = (event, name) => event.tags.find((t) => t[0] === name && t[1])?.[1];
|
|
73
|
+
const isArrangeField = (field) => field.startsWith(ORDER) || field.startsWith(LOOK);
|
|
74
|
+
/** The listed file a per-file field of a list names — `lists:`, `order:` or `look:` — or `null` for any other field. */
|
|
75
|
+
export const fileOfListField = (field) => /^(lists|order|look):./.test(field) ? field.slice(field.indexOf(':') + 1) : null;
|
|
76
|
+
const fileOfField = (field) => fileOfListField(field) ?? '';
|
|
77
|
+
/**
|
|
78
|
+
* Whether a change setting `field` on `list` is one a reader folds (§6.14's
|
|
79
|
+
* skip rules, for `lists:`, `order:` and `look:` alike): one of its `o` tags
|
|
80
|
+
* is the field's `<d>`, its `a` is the list, its `O` the list's id, the `<d>`
|
|
81
|
+
* is not the list itself, and its `h` is the list's team.
|
|
82
|
+
*/
|
|
83
|
+
export function readsAs(event, field, list, team) {
|
|
84
|
+
const holder = ADDRESS.exec(list);
|
|
85
|
+
const file = fileOfField(field);
|
|
86
|
+
return (!!holder &&
|
|
87
|
+
!!file &&
|
|
88
|
+
event.tags.some((t) => t[0] === 'o' && t[1] === file) &&
|
|
89
|
+
tagOf(event, 'a') === list &&
|
|
90
|
+
tagOf(event, 'O') === holder[3] &&
|
|
91
|
+
file !== holder[3] &&
|
|
92
|
+
!!team &&
|
|
93
|
+
tagOf(event, 'h') === team);
|
|
94
|
+
}
|
|
95
|
+
/** The `order:` and `look:` changes per list, newest good and newest of any. */
|
|
96
|
+
export function arrangementHeads(events, teamOfList) {
|
|
97
|
+
const out = new Map();
|
|
98
|
+
for (const event of events) {
|
|
99
|
+
if (event.kind !== KIND_CHANGE)
|
|
100
|
+
continue;
|
|
101
|
+
const list = tagOf(event, 'a');
|
|
102
|
+
if (!list)
|
|
103
|
+
continue;
|
|
104
|
+
for (const { field } of fieldsSetBy(event)) {
|
|
105
|
+
if (!isArrangeField(field))
|
|
106
|
+
continue;
|
|
107
|
+
const heads = out.get(list) ?? { good: new Map(), any: new Map() };
|
|
108
|
+
out.set(list, heads);
|
|
109
|
+
const held = heads.any.get(field);
|
|
110
|
+
if (!held || byOrder(held, event) < 0)
|
|
111
|
+
heads.any.set(field, event);
|
|
112
|
+
if (!readsAs(event, field, list, teamOfList(list)))
|
|
113
|
+
continue;
|
|
114
|
+
const good = heads.good.get(field);
|
|
115
|
+
if (!good || byOrder(good, event) < 0)
|
|
116
|
+
heads.good.set(field, event);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return out;
|
|
120
|
+
}
|
|
121
|
+
const valueIn = (event, field) => fieldsSetBy(event).find((f) => f.field === field)?.value;
|
|
122
|
+
/**
|
|
123
|
+
* One file's arrangement on a list, from {@link arrangementHeads}: `listed`
|
|
124
|
+
* is the file's newest `lists:<d>` = `true` entry, `root` the list's first
|
|
125
|
+
* record (the first `prev`).
|
|
126
|
+
*/
|
|
127
|
+
export function arrangementOf(heads, file, listed, root) {
|
|
128
|
+
const placed = heads?.good.get(orderField(file));
|
|
129
|
+
const key = placed && byOrder(placed, listed) >= 0 ? valueIn(placed, orderField(file)) : undefined;
|
|
130
|
+
const looked = heads?.good.get(lookField(file));
|
|
131
|
+
const look = looked ? valueIn(looked, lookField(file)) : undefined;
|
|
132
|
+
const orderHead = heads?.any.get(orderField(file));
|
|
133
|
+
const lookHead = heads?.any.get(lookField(file));
|
|
134
|
+
return {
|
|
135
|
+
...(isPlaceKey(key) ? { order: key } : {}),
|
|
136
|
+
...(look === 'row' || look === 'card' ? { look } : {}),
|
|
137
|
+
prev: { order: orderHead?.id ?? root.id, look: lookHead?.id ?? root.id },
|
|
138
|
+
prevAt: Math.max(changedAt(root), orderHead ? changedAt(orderHead) : 0, lookHead ? changedAt(lookHead) : 0),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* §6.14's order, stable: placed files by key (equal keys by the lower id),
|
|
143
|
+
* then the rest in the order given, which is oldest listed first.
|
|
144
|
+
*/
|
|
145
|
+
export function sortArranged(files) {
|
|
146
|
+
const placed = files.filter((f) => f.order !== undefined);
|
|
147
|
+
const rest = files.filter((f) => f.order === undefined);
|
|
148
|
+
placed.sort((a, b) => compareKeys(a.order, b.order) || compareKeys(a.file, b.file));
|
|
149
|
+
return [...placed, ...rest];
|
|
150
|
+
}
|
|
151
|
+
/** One field's change on the topic: §6.2's one-field tag order, then `o`. */
|
|
152
|
+
function fieldChange(pubkey, createdAtMs, topic, field, value, prev) {
|
|
153
|
+
const holder = ADDRESS.exec(topic.address);
|
|
154
|
+
if (!holder)
|
|
155
|
+
throw new Error(`not a file address: ${JSON.stringify(topic.address)}`);
|
|
156
|
+
if (!topic.folder)
|
|
157
|
+
throw new Error("a change names the team of the file it is on");
|
|
158
|
+
const file = fileOfField(field);
|
|
159
|
+
if (file === holder[3])
|
|
160
|
+
throw new Error('a file is not on its own list');
|
|
161
|
+
return {
|
|
162
|
+
pubkey,
|
|
163
|
+
created_at: Math.floor(createdAtMs / 1000),
|
|
164
|
+
kind: KIND_CHANGE,
|
|
165
|
+
tags: [
|
|
166
|
+
['a', topic.address],
|
|
167
|
+
['O', holder[3]],
|
|
168
|
+
['field', field],
|
|
169
|
+
['value', value],
|
|
170
|
+
['h', topic.folder],
|
|
171
|
+
['ts', String(createdAtMs)],
|
|
172
|
+
['prev', prev],
|
|
173
|
+
['o', file],
|
|
174
|
+
],
|
|
175
|
+
content: '',
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/** Stamped after every change it follows, so a clock that is behind is not refused. */
|
|
179
|
+
const stamp = (createdAtMs, files) => Math.max(createdAtMs, ...files.map((f) => f.prevAt + 1));
|
|
180
|
+
/**
|
|
181
|
+
* Move `file` to just after `after` (`null`: first) in `files`, which is the
|
|
182
|
+
* topic's files in the order drawn. One change: the moved file's place, and
|
|
183
|
+
* where it lands among files with no place, the places of those above it too,
|
|
184
|
+
* since unplaced files follow placed ones; files tied on one key with the one
|
|
185
|
+
* it lands before are placed again after it. Several places go in one change,
|
|
186
|
+
* taken whole or refused whole. `null` when the file is already there.
|
|
187
|
+
*/
|
|
188
|
+
export function planMoveInTopic(pubkey, createdAtMs, args) {
|
|
189
|
+
// In the topic's own order, whatever order the app draws them in (Ship groups by kind).
|
|
190
|
+
const files = sortArranged(args.files);
|
|
191
|
+
const moved = files.find((f) => f.file === args.file);
|
|
192
|
+
if (!moved)
|
|
193
|
+
throw new Error(`${args.file} is not on the topic's list`);
|
|
194
|
+
const rest = files.filter((f) => f.file !== args.file);
|
|
195
|
+
const to = args.after === null ? 0 : rest.findIndex((f) => f.file === args.after) + 1;
|
|
196
|
+
if (args.after !== null && to === 0)
|
|
197
|
+
throw new Error(`${args.after} is not on the topic's list`);
|
|
198
|
+
// Already there: nothing to write.
|
|
199
|
+
if (files.indexOf(moved) === to)
|
|
200
|
+
return null;
|
|
201
|
+
const before = rest.slice(0, to);
|
|
202
|
+
const after = rest.slice(to);
|
|
203
|
+
const writes = [];
|
|
204
|
+
const unplaced = before.findIndex((f) => f.order === undefined);
|
|
205
|
+
let low = (unplaced < 0 ? before.at(-1) : before[unplaced - 1])?.order;
|
|
206
|
+
const place = (file, high) => {
|
|
207
|
+
const key = keyBetween(low, high);
|
|
208
|
+
writes.push({ file, key });
|
|
209
|
+
low = key;
|
|
210
|
+
};
|
|
211
|
+
if (unplaced >= 0) {
|
|
212
|
+
// Everything after an unplaced file is unplaced too: nothing bounds the keys above.
|
|
213
|
+
for (const f of before.slice(unplaced))
|
|
214
|
+
place(f);
|
|
215
|
+
place(moved);
|
|
216
|
+
}
|
|
217
|
+
else if (after[0]?.order !== undefined && after[0].order === low) {
|
|
218
|
+
// It lands between two files sharing one key: place it, and the tied ones after it, below the next key.
|
|
219
|
+
let j = 0;
|
|
220
|
+
while (after[j]?.order === low)
|
|
221
|
+
j++;
|
|
222
|
+
const high = after[j]?.order;
|
|
223
|
+
place(moved, high);
|
|
224
|
+
for (const f of after.slice(0, j))
|
|
225
|
+
place(f, high);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
place(moved, after[0]?.order);
|
|
229
|
+
}
|
|
230
|
+
if (writes.some((w) => w.key.length > MAX_PLACE_KEY)) {
|
|
231
|
+
// Keys grew too long (many moves to one spot): place every placed file, and the moved one, afresh.
|
|
232
|
+
const placed = [...before, moved, ...after].filter((f) => f === moved || f.order !== undefined || before.includes(f));
|
|
233
|
+
const keys = evenKeys(placed.length);
|
|
234
|
+
writes.splice(0, writes.length, ...placed.map((file, i) => ({ file, key: keys[i] })));
|
|
235
|
+
}
|
|
236
|
+
const at = stamp(createdAtMs, writes.map((w) => w.file));
|
|
237
|
+
const changes = writes.map((w) => fieldChange(pubkey, at, args.topic, orderField(w.file.file), w.key, w.file.prev.order));
|
|
238
|
+
if (changes.length === 1)
|
|
239
|
+
return changes[0];
|
|
240
|
+
const combined = combineChanges(changes);
|
|
241
|
+
if (typeof combined === 'string')
|
|
242
|
+
throw new Error(combined);
|
|
243
|
+
return combined;
|
|
244
|
+
}
|
|
245
|
+
/** Show `file` as a row or a card: one `look:<d>` change. */
|
|
246
|
+
export function planLookInTopic(pubkey, createdAtMs, args) {
|
|
247
|
+
return fieldChange(pubkey, stamp(createdAtMs, [args.file]), args.topic, lookField(args.file.file), args.look, args.file.prev.look);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Undo of Remove: put `file` back on the list, then back in the place it had
|
|
251
|
+
* — just after `after` (`null`: first). Its look stays: a listing never
|
|
252
|
+
* resets it. Publish `relist`, then send `move` with {@link writeArrangement}
|
|
253
|
+
* over the list read again, so a refusal plans the move again rather than
|
|
254
|
+
* leaving the file back but last. The move is stamped after the listing, so
|
|
255
|
+
* its place is not older than it.
|
|
256
|
+
*/
|
|
257
|
+
export function planPutBackInTopic(pubkey, createdAtMs, args) {
|
|
258
|
+
const listedAt = stamp(createdAtMs, [args.file]);
|
|
259
|
+
const holder = ADDRESS.exec(args.topic.address);
|
|
260
|
+
if (!holder)
|
|
261
|
+
throw new Error(`not a file address: ${JSON.stringify(args.topic.address)}`);
|
|
262
|
+
const relist = {
|
|
263
|
+
pubkey,
|
|
264
|
+
created_at: Math.floor(listedAt / 1000),
|
|
265
|
+
kind: KIND_CHANGE,
|
|
266
|
+
tags: [
|
|
267
|
+
['a', args.topic.address],
|
|
268
|
+
['O', holder[3]],
|
|
269
|
+
['field', `lists:${args.file.file}`],
|
|
270
|
+
['value', 'true'],
|
|
271
|
+
['h', args.topic.folder],
|
|
272
|
+
['ts', String(listedAt)],
|
|
273
|
+
['o', args.file.file],
|
|
274
|
+
],
|
|
275
|
+
content: '',
|
|
276
|
+
};
|
|
277
|
+
const move = (files, ms) => {
|
|
278
|
+
// Back on the list it has no place yet; a list read before the listing landed does not hold it.
|
|
279
|
+
const held = files.find((f) => f.file === args.file.file);
|
|
280
|
+
const back = { ...(held ?? args.file), order: undefined, prevAt: Math.max((held ?? args.file).prevAt, listedAt) };
|
|
281
|
+
const rest = files.filter((f) => f.file !== back.file);
|
|
282
|
+
return planMoveInTopic(pubkey, Math.max(ms, listedAt + 1), { topic: args.topic, files: [...rest, back], file: back.file, after: args.after });
|
|
283
|
+
};
|
|
284
|
+
return { relist, move };
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Send an arrangement change, and answer a `conflict:` by reading the topic
|
|
288
|
+
* again and planning the change again on what is there now — never by sending
|
|
289
|
+
* the same places again. A place the planner added for a file nobody had
|
|
290
|
+
* placed would otherwise write over a move someone made since; a look or a
|
|
291
|
+
* single move planned again is §6.2's "set it again after the current one".
|
|
292
|
+
*/
|
|
293
|
+
export async function writeArrangement(args) {
|
|
294
|
+
const now = args.now ?? Date.now;
|
|
295
|
+
const tries = args.tries ?? 3;
|
|
296
|
+
let files = args.files;
|
|
297
|
+
let last = '';
|
|
298
|
+
for (let attempt = 0; attempt < tries; attempt++) {
|
|
299
|
+
const change = args.plan(files, now());
|
|
300
|
+
if (!change)
|
|
301
|
+
return { ok: true };
|
|
302
|
+
const signed = await args.sign(change);
|
|
303
|
+
const answer = await args.publish(signed);
|
|
304
|
+
if (answer.ok)
|
|
305
|
+
return { ok: true, event: signed };
|
|
306
|
+
last = answer.reason ?? 'refused with no reason';
|
|
307
|
+
const conflict = conflictOf(last);
|
|
308
|
+
if (!conflict || conflict.kind === 'other')
|
|
309
|
+
return { ok: false, refused: last };
|
|
310
|
+
files = await args.read();
|
|
311
|
+
}
|
|
312
|
+
return { ok: false, refused: `still refused after ${tries} tries: ${last}` };
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=topicArrangement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topicArrangement.js","sourceRoot":"","sources":["../src/topicArrangement.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEhF,MAAM,WAAW,GAAG,IAAI,CAAA;AACxB,MAAM,OAAO,GAAG,6BAA6B,CAAA;AAI7C,MAAM,KAAK,GAAG,QAAQ,CAAA;AACtB,MAAM,IAAI,GAAG,OAAO,CAAA;AACpB,mEAAmE;AACnE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,CAAA;AACrE,iEAAiE;AACjE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,CAAA;AAEnE,uDAAuD;AACvD,MAAM,MAAM,GAAG,gEAAgE,CAAA;AAC/E,MAAM,GAAG,GAAG,2BAA2B,CAAA;AACvC,0GAA0G;AAC1G,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAA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