@oddington/sdk 0.1.74 → 0.1.76
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 +59 -6
- package/dist/browser.js +435 -271
- package/dist/index.js +4 -4
- package/dist/types/packages/sdk/src/public.d.ts +4 -4
- package/dist/types/shared/data-contract.d.ts +10 -1
- package/dist/types/shared/data-validation-message.d.ts +3 -2
- package/dist/types/shared/inbox-contract.d.ts +63 -5
- package/dist/types/shared/inbox-member-contract.d.ts +6 -5
- package/dist/types/shared/inbox-member-types.d.ts +5 -6
- package/dist/types/shared/inbox-records.d.ts +13 -4
- package/dist/types/shared/record-display.d.ts +11 -0
- package/dist/types/shared/record-selection.d.ts +11 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,8 +69,12 @@ Questions after authentication. The SDK validates and privately snapshots the
|
|
|
69
69
|
filter across pagination. Local apps supply the same explicit filter; their
|
|
70
70
|
trusted host rejects undeclared IDs. Each Question names its `assignee`,
|
|
71
71
|
explicit `canAnswer` permission and server-calculated `status`. Focused
|
|
72
|
-
Question requests carry the `question-work-
|
|
73
|
-
|
|
72
|
+
Question requests carry the fixed `question-work-v2` contract marker. New Questions
|
|
73
|
+
expose numbered `response.options`; submit `{ option, value, note? }` and pass
|
|
74
|
+
`option` to `listRecordOptions` for the chosen picker. V2 also reads legacy
|
|
75
|
+
source-shaped Questions and submits their `{ selection, note? }` answers. Deployed
|
|
76
|
+
V1 clients retain that legacy contract and receive `client_update_required` when
|
|
77
|
+
an operation reaches a new ordered-options Question.
|
|
74
78
|
Accepted Actions stay visible while waiting, working, unable to start or needing
|
|
75
79
|
review; completed Actions and accepted handlerless Questions leave the list.
|
|
76
80
|
Both use the same answer and Record-search methods, without a filter or prior list.
|
|
@@ -539,7 +543,11 @@ After a lost transact/discard response, `DataOperationError.effect` is
|
|
|
539
543
|
initialize again to inspect authoritative work; do not replay the transaction.
|
|
540
544
|
A lost publication response may be retried on the same handle with the same
|
|
541
545
|
selection and summary; the SDK retains its canonical operation identity. If the
|
|
542
|
-
|
|
546
|
+
server refuses an encompassing publication because earlier work remains fenced,
|
|
547
|
+
it reports `apply_pending`, `retryable: false`, `effect: uncertain`. That outcome
|
|
548
|
+
preserves the earlier admissions and starts no new Git work. The SDK preserves
|
|
549
|
+
those facts and sends no automatic publication request. If the host accepted
|
|
550
|
+
work but local persistence fails, the error reports `applied` and
|
|
543
551
|
invalidates the handle. Initialize again to recover coherent local state.
|
|
544
552
|
|
|
545
553
|
First-party Auth uses the handle without initializing workspace context. Its
|
|
@@ -879,6 +887,10 @@ if (next) await general.records.query({
|
|
|
879
887
|
});
|
|
880
888
|
```
|
|
881
889
|
|
|
890
|
+
`collections.schema(name)` includes an optional `display.title` list of one or
|
|
891
|
+
two ordered scalar field names when the collection declares a short Record
|
|
892
|
+
title. It is presentation metadata; `$ref` remains the Record identity.
|
|
893
|
+
|
|
882
894
|
Binding is inert. Each operation resolves current workspace, endpoint and
|
|
883
895
|
short-lived authority from the trusted app host or managed routine context.
|
|
884
896
|
Customer calls cannot configure those values. Missing or expired context
|
|
@@ -1176,9 +1188,11 @@ try {
|
|
|
1176
1188
|
When the routine cannot continue, rethrow the original error to preserve its
|
|
1177
1189
|
type and guidance. A new generic `Error` loses the SDK's bounded failure facts.
|
|
1178
1190
|
|
|
1179
|
-
`apply_pending` is retryable and may report `uncertain` or `applied`;
|
|
1180
|
-
retry the same change set to reconcile its retained identity. A
|
|
1181
|
-
|
|
1191
|
+
`apply_pending` is normally retryable and may report `uncertain` or `applied`;
|
|
1192
|
+
retry the same change set to reconcile its retained identity. A blocked
|
|
1193
|
+
encompassing shared Change publication instead reports non-retryable uncertainty
|
|
1194
|
+
as described above. A transport failure also keeps that identity.
|
|
1195
|
+
Concurrent `apply()` calls coalesce, confirmed calls
|
|
1182
1196
|
replay the result, and changed intent requires a new change set. Updates are
|
|
1183
1197
|
bounded with creates and deletions to 10,000 total operations, with one operation
|
|
1184
1198
|
per ref. The complete serialized change request is limited to 32 MiB for local
|
|
@@ -1243,6 +1257,45 @@ completed Data writes as ordinary uncommitted files for review, even after later
|
|
|
1243
1257
|
failure. Inbox publication has no Record methods;
|
|
1244
1258
|
managed Response handlers retain their separately injected repository capability.
|
|
1245
1259
|
|
|
1260
|
+
Question selection authoring uses one ordered list of explicit options:
|
|
1261
|
+
|
|
1262
|
+
```ts
|
|
1263
|
+
response: selection({ options: [
|
|
1264
|
+
{ type: 'choice', value: 'approve', label: 'Approve' },
|
|
1265
|
+
{ type: 'choice', value: 'changes', label: 'Request changes',
|
|
1266
|
+
note: { placeholder: 'What should change?' } },
|
|
1267
|
+
{ type: 'record', value: { repository: 'general', ref: 'entities/one' },
|
|
1268
|
+
label: 'Reviewed entity', description: 'Matches the supplier' },
|
|
1269
|
+
{ type: 'record-picker', label: 'Choose another entity', source: {
|
|
1270
|
+
collection: { repository: 'general', name: 'entities' },
|
|
1271
|
+
where: { active: true }, refPrefix: 'entities/',
|
|
1272
|
+
} },
|
|
1273
|
+
] })
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
Supply one to nine options. OS assigns published option IDs `1..N` in authored
|
|
1277
|
+
order. Authors supply each direct Record's value, label, and optional description;
|
|
1278
|
+
OS stores them unchanged without reading Data or checking Record existence or
|
|
1279
|
+
freshness. Authors do not supply IDs. Picker sources inherit the
|
|
1280
|
+
collection schema's title declaration; they accept only `collection`, optional
|
|
1281
|
+
scalar equality `where`, and optional literal `refPrefix`. The picker label is
|
|
1282
|
+
also its heading. A `note` declaration on a choice requires a nonempty answer;
|
|
1283
|
+
validation trims its edges and preserves internal whitespace.
|
|
1284
|
+
|
|
1285
|
+
`SelectionDefinitionInput` describes authoring; `SelectionDefinition` describes
|
|
1286
|
+
immutable numbered publication. New accepted answers are `SelectionResponse`
|
|
1287
|
+
values `{ option, value, note? }`. The value is the authored choice string or a
|
|
1288
|
+
qualified Record reference. A displayed picker label is retained separately as
|
|
1289
|
+
presentation and never enters the handler's answer value. Handlers can narrow
|
|
1290
|
+
`QuestionResponse` with `response.selection !== undefined` for retained legacy answers;
|
|
1291
|
+
otherwise read `response.option` and `response.value`.
|
|
1292
|
+
|
|
1293
|
+
Source-shaped `selection({ source })` authoring is deprecated but supported.
|
|
1294
|
+
`LegacyResponseDefinition` and `LegacyQuestionResponse` retain the original
|
|
1295
|
+
source definitions and `{ selection, note? }` payloads, including legacy search,
|
|
1296
|
+
suggestions and display fields. Stored legacy answers and handler input are not
|
|
1297
|
+
converted to numbered options.
|
|
1298
|
+
|
|
1246
1299
|
Record presentation uses qualified current identities:
|
|
1247
1300
|
|
|
1248
1301
|
```ts
|