@reopt-ai/workspace-sdk 0.0.0-stage → 0.1.0-rc.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 +27 -0
- package/LICENSE +21 -0
- package/README.md +43 -2
- package/dist/client-BUatgjlv.js +790 -0
- package/dist/client-C5qUNFSq.d.ts +708 -0
- package/dist/client-DlgVNj3w.d.ts +72 -0
- package/dist/client-XAvKlbbn.js +191 -0
- package/dist/index.d.ts +350 -0
- package/dist/index.js +306 -0
- package/dist/installation/index.d.ts +438 -0
- package/dist/installation/index.js +873 -0
- package/dist/keys-6gwtNd0g.js +102 -0
- package/dist/keys-B2pA8EkU.d.ts +44 -0
- package/dist/machine/index.d.ts +3 -0
- package/dist/machine/index.js +4 -0
- package/dist/machine/keygen-cli.d.ts +7 -0
- package/dist/machine/keygen-cli.js +57 -0
- package/dist/resource/index.d.ts +176 -0
- package/dist/resource/index.js +345 -0
- package/dist/social/index.d.ts +284 -0
- package/dist/social/index.js +306 -0
- package/dist/urls.d.ts +26 -0
- package/dist/urls.js +50 -0
- package/docs/installation.md +128 -0
- package/docs/machine.md +109 -0
- package/docs/resource.md +75 -0
- package/docs/social.md +92 -0
- package/docs/workspace.md +199 -0
- package/package.json +103 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@reopt-ai/workspace-sdk` are documented here.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
This project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0-rc.0] — 2026-11-20
|
|
11
|
+
|
|
12
|
+
Pre-release (`npm i @reopt-ai/workspace-sdk@next`). First release — split out of `@reopt-ai/brandapp-sdk`
|
|
13
|
+
(RFC-0043: the workspace layer sits below the brandapp layer). The code is the same as brandapp-sdk 4.7.0-rc.16's
|
|
14
|
+
`/workspace`, `/social`, `/machine`, `/installation` and `/resource`, which now re-export this package.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `.` — `createPlatformClient` (platform API, machine credential) and `createConnectClient` (delegated `/v1/connect/*`:
|
|
19
|
+
`me` with permission keys, members, Works, posts, folders and files, forms, inquiries).
|
|
20
|
+
- `platform.posts.list/get` — published posts for a workspace app's public site (scope `posts:read`).
|
|
21
|
+
- `/machine`, `/installation` (manifest `kind: "workspace"`), `/resource`, `/social`.
|
|
22
|
+
- `/urls` — id host resolution (`resolveIdBaseUrl`, `deriveIdFromBaseUrl`, `REOPT_ID_BASE_URLS`), dependency-free.
|
|
23
|
+
- bin `reopt-keygen`.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- `platform.me()` parses for workspace apps (`brandappId` and `defaultBrandId` are `null`).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Reopt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @reopt-ai/workspace-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Connect a **workspace app** to Reopt — an app that works on a whole workspace (an internal admin,
|
|
4
|
+
a company site, a service that files work into Studio) rather than being one brand's customer app.
|
|
5
|
+
|
|
6
|
+
- **Platform API** (`createPlatformClient`) — your server's machine credential: Works tasks,
|
|
7
|
+
published posts for a public site, declarative workspace resources, webhooks.
|
|
8
|
+
- **Delegated access** (`createConnectClient`) — a staff member signs in with Reopt and your app
|
|
9
|
+
acts as **them**: Works, posts, files, forms and inquiries, limited by their workspace role.
|
|
10
|
+
- **Machine credentials** (`/machine`) — `private_key_jwt` + DPoP, key generation (`reopt-keygen`), JWKS.
|
|
11
|
+
- **Installations** (`/installation`) — declare, sign and request your app's connection.
|
|
12
|
+
- **Resource verifier** (`/resource`), **social operations** (`/social`), **id host resolution** (`/urls`).
|
|
13
|
+
|
|
14
|
+
Server-only (it holds private keys and tokens). Requires `zod` for `.`, `/social` and `/installation`.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm i @reopt-ai/workspace-sdk zod
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import {
|
|
22
|
+
createConnectClient,
|
|
23
|
+
createPlatformClient,
|
|
24
|
+
} from "@reopt-ai/workspace-sdk";
|
|
25
|
+
|
|
26
|
+
// public site — the app's own machine credential (REOPT_CLIENT_PRIVATE_KEY_JWK)
|
|
27
|
+
const platform = createPlatformClient({
|
|
28
|
+
clientId: process.env.REOPT_MACHINE_CLIENT_ID!,
|
|
29
|
+
scopes: ["posts:read"],
|
|
30
|
+
});
|
|
31
|
+
const { posts } = await platform.posts.list({ limit: 10 });
|
|
32
|
+
|
|
33
|
+
// admin — the signed-in member's token from your `connect` OAuth client
|
|
34
|
+
const reopt = createConnectClient({
|
|
35
|
+
accessToken: () => getAccessTokenForUser(),
|
|
36
|
+
});
|
|
37
|
+
const me = await reopt.me(); // me.permissions decides which buttons to show
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Docs: `docs/workspace.md` (platform API and delegated access), `docs/machine.md`,
|
|
41
|
+
`docs/installation.md`, `docs/resource.md`, `docs/social.md`.
|
|
42
|
+
|
|
43
|
+
`@reopt-ai/brandapp-sdk` builds on this package; its `/workspace`, `/machine`, `/installation`,
|
|
44
|
+
`/social` and `/resource` subpaths re-export it.
|