@oddington/sdk 0.1.73 → 0.1.75
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 +45 -0
- package/dist/browser.js +343 -233
- package/dist/index.js +4 -4
- package/dist/types/packages/sdk/src/public.d.ts +19 -3
- 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 +4 -0
- package/dist/types/shared/inbox-member-contract.d.ts +1 -1
- package/dist/types/shared/inbox-member-types.d.ts +5 -6
- package/dist/types/shared/record-display.d.ts +11 -0
- package/dist/types/shared/record-selection.d.ts +9 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,47 @@ The importable client for OS apps, routines and response handlers.
|
|
|
4
4
|
Node operations require Node.js 22.12.0 or later. The root import and hosted
|
|
5
5
|
Data and Files APIs work in browsers. Installing the package grants no authority.
|
|
6
6
|
|
|
7
|
+
## Server-side API client
|
|
8
|
+
|
|
9
|
+
Create a named workspace API client:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
os api-client create --name "Airtable Importer" --scope inbox:publish
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Keep the one-time token in your server's secret store and supply it explicitly:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { createClient, richTextBlock } from '@oddington/sdk';
|
|
19
|
+
|
|
20
|
+
const client = createClient({ workspace: 'example', token: process.env.OS_API_TOKEN! });
|
|
21
|
+
const digest = {
|
|
22
|
+
title: 'Import complete',
|
|
23
|
+
description: 'Three projects were added.',
|
|
24
|
+
recipients: ['office@example.com'],
|
|
25
|
+
body: [richTextBlock({ markdown: 'The new projects are ready for review.' })],
|
|
26
|
+
notifyImmediately: true,
|
|
27
|
+
};
|
|
28
|
+
const options = { requestKey: 'airtable-import/commit-123/new-projects' };
|
|
29
|
+
await client.inbox.checkDigest(digest, options); // Validates without publishing.
|
|
30
|
+
const { id } = await client.inbox.publishDigest(digest, options);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use the same request key and unchanged content to recover a lost receipt.
|
|
34
|
+
Changing content under an existing key conflicts. The key belongs to the client
|
|
35
|
+
and workspace, so token rotation preserves replay. Issue an overlapping token
|
|
36
|
+
with `os api-client token issue`, update the program, then revoke the old token
|
|
37
|
+
with `os api-client token revoke`. `os api-client list` shows safe token IDs and
|
|
38
|
+
status; `os api-client disable --client <client-id> --yes` stops all its tokens.
|
|
39
|
+
|
|
40
|
+
This client derives the fixed workspace Inbox origin and exposes only
|
|
41
|
+
`inbox.checkDigest` and `inbox.publishDigest`. It requires no CLI login or Routine
|
|
42
|
+
context. API tokens belong in trusted server-side automation; do not embed them
|
|
43
|
+
in browser code. API clients cannot publish Asks or Files Blocks, read Inbox or
|
|
44
|
+
Records, use Connections, or start Runs.
|
|
45
|
+
|
|
46
|
+
## Apps and routines
|
|
47
|
+
|
|
7
48
|
When developing OS alongside a customer repository, use the repository's
|
|
8
49
|
[`dev:customer` helper](../../README.md) to run Bun tests and TypeScript checks
|
|
9
50
|
against the built local SDK without changing the customer's released pin,
|
|
@@ -838,6 +879,10 @@ if (next) await general.records.query({
|
|
|
838
879
|
});
|
|
839
880
|
```
|
|
840
881
|
|
|
882
|
+
`collections.schema(name)` includes an optional `display.title` list of one or
|
|
883
|
+
two ordered scalar field names when the collection declares a short Record
|
|
884
|
+
title. It is presentation metadata; `$ref` remains the Record identity.
|
|
885
|
+
|
|
841
886
|
Binding is inert. Each operation resolves current workspace, endpoint and
|
|
842
887
|
short-lived authority from the trusted app host or managed routine context.
|
|
843
888
|
Customer calls cannot configure those values. Missing or expired context
|