@oddington/sdk 0.1.75 → 0.1.77
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/README.md +64 -6
- package/dist/browser.js +553 -153
- package/dist/index.js +3 -3
- package/dist/types/packages/sdk/src/public.d.ts +2 -2
- package/dist/types/shared/inbox-contract.d.ts +63 -5
- package/dist/types/shared/inbox-live.d.ts +11 -0
- package/dist/types/shared/inbox-member-contract.d.ts +8 -6
- package/dist/types/shared/inbox-member-types.d.ts +15 -0
- package/dist/types/shared/inbox-records.d.ts +17 -6
- package/dist/types/shared/record-selection.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,6 +60,15 @@ Inbox File previews and downloads use package-root `files.read(fileId)` with
|
|
|
60
60
|
current workspace access. Item visibility does not grant File access. The SDK
|
|
61
61
|
exposes no raw-credential API.
|
|
62
62
|
|
|
63
|
+
The first-party hosted Inbox uses `inbox.bootstrap()` for all visible items and
|
|
64
|
+
revision-associated authored Record hydration. `inbox.subscribe(onDirty,
|
|
65
|
+
onState)` returns an idempotent cleanup function. Dirty callbacks have no
|
|
66
|
+
arguments; state callbacks report `connected` (including reconnects),
|
|
67
|
+
`unavailable` (retryable), or `denied` (terminal). Treat hints as reasons for a
|
|
68
|
+
coalesced authoritative bootstrap read. Provider transport, scoped credentials,
|
|
69
|
+
renewal and reconnect remain inside the SDK. Focused and local apps cannot use
|
|
70
|
+
this complete-Inbox subscription.
|
|
71
|
+
|
|
63
72
|
Apps use `inbox.questions.list({ routines })` for `QuestionWork[]`.
|
|
64
73
|
Derive `routines` from `(await app.listRoutines()).map(({ id }) => id)`.
|
|
65
74
|
These canonical names narrow relevance only; they grant no answer or
|
|
@@ -69,8 +78,12 @@ Questions after authentication. The SDK validates and privately snapshots the
|
|
|
69
78
|
filter across pagination. Local apps supply the same explicit filter; their
|
|
70
79
|
trusted host rejects undeclared IDs. Each Question names its `assignee`,
|
|
71
80
|
explicit `canAnswer` permission and server-calculated `status`. Focused
|
|
72
|
-
Question requests carry the `question-work-
|
|
73
|
-
|
|
81
|
+
Question requests carry the fixed `question-work-v2` contract marker. New Questions
|
|
82
|
+
expose numbered `response.options`; submit `{ option, value, note? }` and pass
|
|
83
|
+
`option` to `listRecordOptions` for the chosen picker. V2 also reads legacy
|
|
84
|
+
source-shaped Questions and submits their `{ selection, note? }` answers. Deployed
|
|
85
|
+
V1 clients retain that legacy contract and receive `client_update_required` when
|
|
86
|
+
an operation reaches a new ordered-options Question.
|
|
74
87
|
Accepted Actions stay visible while waiting, working, unable to start or needing
|
|
75
88
|
review; completed Actions and accepted handlerless Questions leave the list.
|
|
76
89
|
Both use the same answer and Record-search methods, without a filter or prior list.
|
|
@@ -539,7 +552,11 @@ After a lost transact/discard response, `DataOperationError.effect` is
|
|
|
539
552
|
initialize again to inspect authoritative work; do not replay the transaction.
|
|
540
553
|
A lost publication response may be retried on the same handle with the same
|
|
541
554
|
selection and summary; the SDK retains its canonical operation identity. If the
|
|
542
|
-
|
|
555
|
+
server refuses an encompassing publication because earlier work remains fenced,
|
|
556
|
+
it reports `apply_pending`, `retryable: false`, `effect: uncertain`. That outcome
|
|
557
|
+
preserves the earlier admissions and starts no new Git work. The SDK preserves
|
|
558
|
+
those facts and sends no automatic publication request. If the host accepted
|
|
559
|
+
work but local persistence fails, the error reports `applied` and
|
|
543
560
|
invalidates the handle. Initialize again to recover coherent local state.
|
|
544
561
|
|
|
545
562
|
First-party Auth uses the handle without initializing workspace context. Its
|
|
@@ -1180,9 +1197,11 @@ try {
|
|
|
1180
1197
|
When the routine cannot continue, rethrow the original error to preserve its
|
|
1181
1198
|
type and guidance. A new generic `Error` loses the SDK's bounded failure facts.
|
|
1182
1199
|
|
|
1183
|
-
`apply_pending` is retryable and may report `uncertain` or `applied`;
|
|
1184
|
-
retry the same change set to reconcile its retained identity. A
|
|
1185
|
-
|
|
1200
|
+
`apply_pending` is normally retryable and may report `uncertain` or `applied`;
|
|
1201
|
+
retry the same change set to reconcile its retained identity. A blocked
|
|
1202
|
+
encompassing shared Change publication instead reports non-retryable uncertainty
|
|
1203
|
+
as described above. A transport failure also keeps that identity.
|
|
1204
|
+
Concurrent `apply()` calls coalesce, confirmed calls
|
|
1186
1205
|
replay the result, and changed intent requires a new change set. Updates are
|
|
1187
1206
|
bounded with creates and deletions to 10,000 total operations, with one operation
|
|
1188
1207
|
per ref. The complete serialized change request is limited to 32 MiB for local
|
|
@@ -1247,6 +1266,45 @@ completed Data writes as ordinary uncommitted files for review, even after later
|
|
|
1247
1266
|
failure. Inbox publication has no Record methods;
|
|
1248
1267
|
managed Response handlers retain their separately injected repository capability.
|
|
1249
1268
|
|
|
1269
|
+
Question selection authoring uses one ordered list of explicit options:
|
|
1270
|
+
|
|
1271
|
+
```ts
|
|
1272
|
+
response: selection({ options: [
|
|
1273
|
+
{ type: 'choice', value: 'approve', label: 'Approve' },
|
|
1274
|
+
{ type: 'choice', value: 'changes', label: 'Request changes',
|
|
1275
|
+
note: { placeholder: 'What should change?' } },
|
|
1276
|
+
{ type: 'record', value: { repository: 'general', ref: 'entities/one' },
|
|
1277
|
+
label: 'Reviewed entity', description: 'Matches the supplier' },
|
|
1278
|
+
{ type: 'record-picker', label: 'Choose another entity', source: {
|
|
1279
|
+
collection: { repository: 'general', name: 'entities' },
|
|
1280
|
+
where: { active: true }, refPrefix: 'entities/',
|
|
1281
|
+
} },
|
|
1282
|
+
] })
|
|
1283
|
+
```
|
|
1284
|
+
|
|
1285
|
+
Supply one to nine options. OS assigns published option IDs `1..N` in authored
|
|
1286
|
+
order. Authors supply each direct Record's value, label, and optional description;
|
|
1287
|
+
OS stores them unchanged without reading Data or checking Record existence or
|
|
1288
|
+
freshness. Authors do not supply IDs. Picker sources inherit the
|
|
1289
|
+
collection schema's title declaration; they accept only `collection`, optional
|
|
1290
|
+
scalar equality `where`, and optional literal `refPrefix`. The picker label is
|
|
1291
|
+
also its heading. A `note` declaration on a choice requires a nonempty answer;
|
|
1292
|
+
validation trims its edges and preserves internal whitespace.
|
|
1293
|
+
|
|
1294
|
+
`SelectionDefinitionInput` describes authoring; `SelectionDefinition` describes
|
|
1295
|
+
immutable numbered publication. New accepted answers are `SelectionResponse`
|
|
1296
|
+
values `{ option, value, note? }`. The value is the authored choice string or a
|
|
1297
|
+
qualified Record reference. A displayed picker label is retained separately as
|
|
1298
|
+
presentation and never enters the handler's answer value. Handlers can narrow
|
|
1299
|
+
`QuestionResponse` with `response.selection !== undefined` for retained legacy answers;
|
|
1300
|
+
otherwise read `response.option` and `response.value`.
|
|
1301
|
+
|
|
1302
|
+
Source-shaped `selection({ source })` authoring is deprecated but supported.
|
|
1303
|
+
`LegacyResponseDefinition` and `LegacyQuestionResponse` retain the original
|
|
1304
|
+
source definitions and `{ selection, note? }` payloads, including legacy search,
|
|
1305
|
+
suggestions and display fields. Stored legacy answers and handler input are not
|
|
1306
|
+
converted to numbered options.
|
|
1307
|
+
|
|
1250
1308
|
Record presentation uses qualified current identities:
|
|
1251
1309
|
|
|
1252
1310
|
```ts
|