@reopt-ai/workspace-sdk 0.0.0-stage → 0.1.0-rc.1

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 ADDED
@@ -0,0 +1,51 @@
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.1] — 2026-11-20
11
+
12
+ Pre-release (`npm i @reopt-ai/workspace-sdk@next`).
13
+
14
+ ### Added
15
+
16
+ - **워크스페이스 앱 소유 테이블**(RFC-0043 5단계) — `connect.eav.{listEntities,listRecords,createRecord,updateRecord,deleteRecord}`.
17
+ 값은 속성 이름 키, 수정은 `ifVersion` CAS. 테이블 선언은 앱의 기계 자격 `platform.eav.applySchema({ operations })` —
18
+ 워크스페이스 앱 자격은 본문에 `brandapp`을 적지 않으면 자기 설치 네임스페이스에 적용된다. `connectEav{Entity,Record}Schema`.
19
+ - **공개키 등록 요청**(RFC-0043 §8 Q6) — `connection.registerKeys()`, 연결 상태 `primaryAction: "register-keys"`·문구
20
+ "공개키 등록 n/m". `client.refreshJwks(id, { auth })`의 기본 인증이 **설치 단언**이 됐고(등록 전 앱은 기계 토큰을 받을 수
21
+ 없다) 응답에 `registered`가 실린다. 게시한 JWKS가 거절되면 `PlatformApiError` code `JWKS_REJECTED`(422).
22
+ - `PLATFORM_EAV_DATA_TYPES`·`PlatformEavDataType` — EAV 속성 값 타입 목록(리옵트 DB enum과 같은 집합).
23
+
24
+ ### Changed
25
+
26
+ - EAV 속성 연산(`addAttribute.def`·`updateAttribute.changes`)이 `dataType`을 목록으로, `label`을 빈 값 아님으로 검사한다 —
27
+ `addAttribute`는 둘 다 필수. 예전엔 서버까지 가서 500(없는 타입)으로 죽었다. 서버도 이제 400 `VALIDATION_ERROR`로 답한다.
28
+ - 키 회전 마법사 문구 — 각 배포 뒤 `registerKeys()`를 부르면 리옵트 캐시를 기다리지 않는다.
29
+
30
+ ### Fixed
31
+
32
+ - README가 `.`에 필요한 optional peer `@better-auth/core`를 빠뜨렸다(`/machine`·`/resource`만 적혀 있었다).
33
+
34
+ ## [0.1.0-rc.0] — 2026-11-20
35
+
36
+ Pre-release (`npm i @reopt-ai/workspace-sdk@next`). First release — split out of `@reopt-ai/brandapp-sdk`
37
+ (RFC-0043: the workspace layer sits below the brandapp layer). The code is the same as brandapp-sdk 4.7.0-rc.16's
38
+ `/workspace`, `/social`, `/machine`, `/installation` and `/resource`, which now re-export this package.
39
+
40
+ ### Added
41
+
42
+ - `.` — `createPlatformClient` (platform API, machine credential) and `createConnectClient` (delegated `/v1/connect/*`:
43
+ `me` with permission keys, members, Works, posts, folders and files, forms, inquiries).
44
+ - `platform.posts.list/get` — published posts for a workspace app's public site (scope `posts:read`).
45
+ - `/machine`, `/installation` (manifest `kind: "workspace"`), `/resource`, `/social`.
46
+ - `/urls` — id host resolution (`resolveIdBaseUrl`, `deriveIdFromBaseUrl`, `REOPT_ID_BASE_URLS`), dependency-free.
47
+ - bin `reopt-keygen`.
48
+
49
+ ### Fixed
50
+
51
+ - `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,46 @@
1
- # Temporary Holding Version
1
+ # @reopt-ai/workspace-sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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). Optional peers: `zod` for `.`, `/social` and
15
+ `/installation`; `@better-auth/core` for `.`, `/machine` and `/resource` (the platform client signs
16
+ DPoP proofs with it). `/urls` needs neither.
17
+
18
+ ```bash
19
+ npm i @reopt-ai/workspace-sdk zod @better-auth/core
20
+ ```
21
+
22
+ ```ts
23
+ import {
24
+ createConnectClient,
25
+ createPlatformClient,
26
+ } from "@reopt-ai/workspace-sdk";
27
+
28
+ // public site — the app's own machine credential (REOPT_CLIENT_PRIVATE_KEY_JWK)
29
+ const platform = createPlatformClient({
30
+ clientId: process.env.REOPT_MACHINE_CLIENT_ID!,
31
+ scopes: ["posts:read"],
32
+ });
33
+ const { posts } = await platform.posts.list({ limit: 10 });
34
+
35
+ // admin — the signed-in member's token from your `connect` OAuth client
36
+ const reopt = createConnectClient({
37
+ accessToken: () => getAccessTokenForUser(),
38
+ });
39
+ const me = await reopt.me(); // me.permissions decides which buttons to show
40
+ ```
41
+
42
+ Docs: `docs/workspace.md` (platform API and delegated access), `docs/machine.md`,
43
+ `docs/installation.md`, `docs/resource.md`, `docs/social.md`.
44
+
45
+ `@reopt-ai/brandapp-sdk` builds on this package; its `/workspace`, `/machine`, `/installation`,
46
+ `/social` and `/resource` subpaths re-export it.