@reopt-ai/workspace-sdk 0.1.0-rc.11 → 0.1.0-rc.13
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 +52 -0
- package/README.md +7 -2
- package/dist/better-auth/index.d.ts +1 -1
- package/dist/better-auth/index.js +1 -1
- package/dist/{client-XAvKlbbn.js → client-BLaFMBbS.js} +2 -2
- package/dist/{client-WEomQekp.js → client-BX4VHJS6.js} +5 -5
- package/dist/{client-DlgVNj3w.d.ts → client-DVozA5Ep.d.ts} +2 -2
- package/dist/{client-ByIjKnf3.d.ts → client-olMIaJZH.d.ts} +3 -3
- package/dist/{connect-BBf9QfQB.d.ts → connect-CTxppAjD.d.ts} +104 -5
- package/dist/connect.d.ts +6 -5
- package/dist/connect.js +4 -3
- package/dist/{errors-DLJlABJL.d.ts → errors-CLUuzCNG.d.ts} +3 -1
- package/dist/{errors-C5_fhcqb.js → errors-DKMC4kId.js} +2 -2
- package/dist/forms.d.ts +167 -0
- package/dist/forms.js +221 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js +5 -4
- package/dist/installation/index.d.ts +3 -3
- package/dist/installation/index.js +3 -3
- package/dist/{keys-6gwtNd0g.js → keys--ef_VwZ-.js} +6 -5
- package/dist/{keys-B2pA8EkU.d.ts → keys-BXkGh0VM.d.ts} +10 -2
- package/dist/machine/index.d.ts +2 -2
- package/dist/machine/index.js +2 -2
- package/dist/machine/keygen-cli.js +1 -1
- package/dist/mentions-BMI2c7O6.d.ts +26 -0
- package/dist/mentions.d.ts +2 -0
- package/dist/mentions.js +45 -0
- package/dist/{page-79Ab4UGQ.d.ts → page-j1OCu4of.d.ts} +8 -4
- package/dist/{page-SjWh1rqY.js → page-rc95cliL.js} +72 -7
- package/dist/{permissions-COCbNJeQ.d.ts → permissions-DKm_zC_X.d.ts} +2 -2
- package/dist/permissions.d.ts +1 -1
- package/dist/permissions.js +48 -0
- package/dist/social/index.d.ts +2 -2
- package/dist/social/index.js +2 -2
- package/dist/testing/index.d.ts +27 -3
- package/dist/testing/index.js +343 -30
- package/dist/{transport-CN64IoHx.js → transport-BEwY_twi.js} +2 -2
- package/docs/forms.md +100 -0
- package/docs/machine.md +14 -4
- package/docs/testing.md +10 -6
- package/docs/workspace.md +70 -19
- package/package.json +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,58 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.0-rc.13] — 2026-11-22
|
|
11
|
+
|
|
12
|
+
Pre-release (`npm i @reopt-ai/workspace-sdk@next`). 깨지는 변경 없음.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **알림** — `notifications.list({ unseen })`·`unseenCount()`·`markSeen(id)`·`markAllSeen()`. 로그인한 직원이 리옵트에서 받은
|
|
17
|
+
알림 중 이 연결로 읽을 수 있는 종류만 온다(업무 담당 지정·댓글·멘션·단계 이동·마감 임박, 폼 제출, 신규 고객 —
|
|
18
|
+
역할·scope·플랜으로 판정). 결제·보안 알림은 오지 않고 `markAllSeen`도 건드리지 않는다. `entity`(`task`·`form`)로 앱의 화면에
|
|
19
|
+
잇는다. 읽음 상태는 Studio와 같은 값이다. `/testing`은 `seed.notifications`로 채운다.
|
|
20
|
+
- **`@reopt-ai/workspace-sdk/forms`** — 공개 폼(브랜드폼) 클라이언트. 의존이 없고 방문자 브라우저에서 돈다:
|
|
21
|
+
`createPublicFormClient().get(formId)`(게시된 정의 — 필드·선택지·동의 항목)·`submit(formId, { values, consents, meta })`,
|
|
22
|
+
실패는 `PublicFormError`(`code`·칸별 `fieldErrors`·`retryable`), 관리 화면용 `labelAnswers(fields, answers)`.
|
|
23
|
+
지금까지는 앱이 제출 주소와 오류 해석을 손으로 짰다. 문서 `docs/forms.md`.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- `/testing` — 공개 폼 응답이 실제 서버와 달랐다: 칸별 오류를 `fields`로 실었고(실제는 `fieldErrors` — 그 키를 읽는 앱에는
|
|
28
|
+
dev 모드에서 칸별 문구가 보이지 않았다), 필드 타입을 `text`·`tel`·`checkbox`로 냈으며(실제는 `string`·`boolean` +
|
|
29
|
+
`appearance`·`inputPurpose`), 선택지를 문자열로도 냈다(실제는 언제나 `{ value, label }`). 같은 계약 시나리오를
|
|
30
|
+
에뮬레이터와 실제 라우터에 돌려 고정했다.
|
|
31
|
+
|
|
32
|
+
## [0.1.0-rc.12] — 2026-11-22
|
|
33
|
+
|
|
34
|
+
Pre-release (`npm i @reopt-ai/workspace-sdk@next`). 깨지는 변경 없음.
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- **업무 댓글·활동** — `works.listFeed(taskId)`(댓글과 활동이 시간순으로 섞인 타임라인)·`works.addComment`·
|
|
39
|
+
`works.updateComment`·`works.deleteComment`. 코어는 Studio 댓글과 같은 함수라 멘션된 멤버와 담당자에게 리옵트 알림이 간다.
|
|
40
|
+
수정은 작성자 본인만, 삭제는 본인 또는 `works:delete`(아니면 403 `FORBIDDEN`).
|
|
41
|
+
- 고객: `customers.list`가 `CountedPage`(= `Page` + `total: number`)를 돌려준다(`?? items.length`가 필요 없다),
|
|
42
|
+
`ConnectCustomerField.name`(쓰기의 `attributes` 키 — 커스텀 필드 편집 화면), `CONTACT_TAKEN`의 `fields[].relatedId`
|
|
43
|
+
(겹친 고객의 id — "그 고객 열기").
|
|
44
|
+
- `listAll`·`iterate`가 질의를 받지 않는 목록(`customers.listTags`·`listFields`·`members`…)도 받는다.
|
|
45
|
+
- `mentionToken(member)`·`splitMentions(content)` — 댓글의 멘션 토큰(`@[이름](member:<id>)`)을 만들고 나눈다.
|
|
46
|
+
의존 없는 진입점 `@reopt-ai/workspace-sdk/mentions`에서도 나간다(클라이언트 컴포넌트의 입력 미리보기).
|
|
47
|
+
- `/testing` — 위 넷과 `seed.tasks[].comments`. 폼 제출이 이메일(없으면 전화)로 고객 명부에 이어지고(`customerId`),
|
|
48
|
+
고객 타임라인이 실제 서버와 같은 종류(`customer.create`·`customer.update` + `metadata.changes`)로 남는다.
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
- **키 회전: NEXT 키는 게시만 하고 서명은 현재 키로 한다**(`readClientKeyRing().signing`). 예전엔 NEXT를 두는 순간 NEXT로
|
|
53
|
+
서명했다 — 콘솔의 회전 안내("서명은 아직 지금 키로")와 반대였고, 리옵트가 공개키를 등록해 두는 연결 중 자기 도메인의
|
|
54
|
+
앱은 새 키가 등록되기 전까지 토큰을 받지 못할 수 있었다. 회전은 ①NEXT 설정(JWKS에 둘 다) ②콘솔 "공개키 다시 읽기"로
|
|
55
|
+
새 키 등록 확인 ③NEXT를 본 키로 승격의 세 단계다(`docs/machine.md`).
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- 패키지 루트(`.`)가 위임 클라이언트의 새 타입(`ConnectCustomer`·`ConnectInquiryMoveResult` 등)을 내보내지 않던 것 —
|
|
60
|
+
이름을 하나씩 적던 목록을 `export type *`로 바꿨다(`/connect`는 처음부터 전부 내보냈다).
|
|
61
|
+
|
|
10
62
|
## [0.1.0-rc.11] — 2026-11-22
|
|
11
63
|
|
|
12
64
|
Pre-release (`npm i @reopt-ai/workspace-sdk@next`). 깨지는 변경 없음.
|
package/README.md
CHANGED
|
@@ -7,20 +7,25 @@ a company site, a service that files work into Studio) rather than being one bra
|
|
|
7
7
|
published posts for a public site, declarative workspace resources, webhooks.
|
|
8
8
|
- **Delegated access** (`createConnectClient`, also at `/connect`) — a staff member signs in with
|
|
9
9
|
Reopt and your app acts as **them**: Works tasks, posts, files and folders, forms and
|
|
10
|
-
inquiries, brands, members and the app's own tables, limited
|
|
10
|
+
inquiries, customers, their notifications, brands, members and the app's own tables, limited
|
|
11
|
+
by their workspace role.
|
|
11
12
|
Every list is a page (`{ items, nextOffset }`), every write returns the object, every failure
|
|
12
13
|
is a `PlatformApiError` with a typed `code`.
|
|
13
14
|
- **Permissions** (`/permissions`, no dependencies — safe in client components) — the permission
|
|
14
15
|
keys and `can(me, "post:publish")` / `canCall(me, "works.deleteTask")`.
|
|
15
16
|
- **Dev platform** (`/testing`) — an in-memory Reopt for dev mode and E2E: keep the real clients,
|
|
16
17
|
swap their `fetch`. See `docs/testing.md`.
|
|
18
|
+
- **Public forms** (`/forms`, no dependencies — runs in the visitor's browser) — read a published
|
|
19
|
+
form and submit to it directly: `createPublicFormClient()`, typed `PublicFormError` with
|
|
20
|
+
per-field messages, `labelAnswers` for admin screens. See `docs/forms.md`.
|
|
21
|
+
- **Mentions** (`/mentions`, no dependencies) — `mentionToken`, `splitMentions` for task comments.
|
|
17
22
|
- **Webhooks** (`/webhooks`, no dependencies) — receive Reopt's events with the signature and
|
|
18
23
|
replay window checked: `createWebhookHandler({ secret, handlers })`.
|
|
19
24
|
- **Machine credentials** (`/machine`) — `private_key_jwt` + DPoP, key generation (`reopt-keygen`), JWKS.
|
|
20
25
|
- **Installations** (`/installation`) — declare, sign and request your app's connection.
|
|
21
26
|
- **Resource verifier** (`/resource`), **social operations** (`/social`), **id host resolution** (`/urls`).
|
|
22
27
|
|
|
23
|
-
Server-only (it holds private keys and tokens) except `/permissions`, `/operator` and `/urls`
|
|
28
|
+
Server-only (it holds private keys and tokens) except `/forms`, `/mentions`, `/permissions`, `/operator` and `/urls`
|
|
24
29
|
(`/webhooks` runs anywhere Web Crypto does, but holds your webhook secret — keep it on the server).
|
|
25
30
|
Optional peers: `zod` for `.`, `/connect`, `/social` and `/installation`; `@better-auth/core` for
|
|
26
31
|
`.`, `/machine` and `/resource` (the platform client signs DPoP proofs with it). An app that only
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as ClientKeyRing } from "../keys-
|
|
1
|
+
import { r as ClientKeyRing } from "../keys-BXkGh0VM.js";
|
|
2
2
|
import { genericOAuth } from "better-auth/plugins";
|
|
3
3
|
//#region src/better-auth/index.d.ts
|
|
4
4
|
/** Better Auth 제공자 id — `signIn.social({ provider })`와 콜백 경로(`/api/auth/callback/reopt`)의 마지막 조각. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolvePlatformUrls } from "../urls.js";
|
|
2
|
-
import { o as readClientKeyRing } from "../keys
|
|
2
|
+
import { o as readClientKeyRing } from "../keys--ef_VwZ-.js";
|
|
3
3
|
import { createPrivateKeyJwtClientAssertionGetter } from "@better-auth/core/oauth2";
|
|
4
4
|
import { genericOAuth } from "better-auth/plugins";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveIdBaseUrl } from "./urls.js";
|
|
2
|
-
import { o as readClientKeyRing, s as toPublicJwk } from "./keys
|
|
2
|
+
import { o as readClientKeyRing, s as toPublicJwk } from "./keys--ef_VwZ-.js";
|
|
3
3
|
import { createPrivateKeyJwtClientAssertionGetter } from "@better-auth/core/oauth2";
|
|
4
4
|
import * as jose from "jose";
|
|
5
5
|
|
|
@@ -188,4 +188,4 @@ function createMachineClient(config) {
|
|
|
188
188
|
|
|
189
189
|
//#endregion
|
|
190
190
|
export { createDpopProof as n, createMachineClient as r, MachineTokenError as t };
|
|
191
|
-
//# sourceMappingURL=client-
|
|
191
|
+
//# sourceMappingURL=client-BLaFMBbS.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as SDK_VERSION, n as PlatformApiError } from "./errors-
|
|
2
|
-
import { n as readPlatformFailure } from "./transport-
|
|
1
|
+
import { l as SDK_VERSION, n as PlatformApiError } from "./errors-DKMC4kId.js";
|
|
2
|
+
import { n as readPlatformFailure } from "./transport-BEwY_twi.js";
|
|
3
3
|
import { resolvePlatformUrls } from "./urls.js";
|
|
4
|
-
import { o as readClientKeyRing } from "./keys
|
|
5
|
-
import { r as createMachineClient } from "./client-
|
|
4
|
+
import { o as readClientKeyRing } from "./keys--ef_VwZ-.js";
|
|
5
|
+
import { r as createMachineClient } from "./client-BLaFMBbS.js";
|
|
6
6
|
import { B as platformPublishedPostPageSchema, C as platformEavSchemaApplyResultSchema, D as platformLockAcquiredSchema, F as platformPipelineSchema, G as platformResourcesV2Schema, K as platformTaskSchema, O as platformLockReleasedSchema, P as platformPipelineResourceSchema, V as platformPublishedPostSchema, Z as platformWebhookSchema, _ as platformBrandappResourceSchema, et as platformWriteMetaSchema, h as platformBrandResourceSchema, j as platformOAuthClientResourceSchema, k as platformMeSchema } from "./schemas-eWh_FUfh.js";
|
|
7
7
|
|
|
8
8
|
//#region src/workspace/client.ts
|
|
@@ -272,4 +272,4 @@ function createPlatformClient(config) {
|
|
|
272
272
|
|
|
273
273
|
//#endregion
|
|
274
274
|
export { createPlatformClient as n, createPlatformRequester as r, DEFAULT_PLATFORM_SCOPES as t };
|
|
275
|
-
//# sourceMappingURL=client-
|
|
275
|
+
//# sourceMappingURL=client-BX4VHJS6.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ClientPrivateJwk, r as ClientKeyRing } from "./keys-
|
|
1
|
+
import { i as ClientPrivateJwk, r as ClientKeyRing } from "./keys-BXkGh0VM.js";
|
|
2
2
|
//#region src/machine/client.d.ts
|
|
3
3
|
type MachineClientConfig = {
|
|
4
4
|
/** `purpose: machine`(또는 `adapter`) 클라이언트의 client_id */
|
|
@@ -69,4 +69,4 @@ declare function createDpopProof(input: {
|
|
|
69
69
|
declare function createMachineClient(config: MachineClientConfig): MachineClient;
|
|
70
70
|
//#endregion
|
|
71
71
|
export { createDpopProof as a, MachineTokenState as i, MachineClientConfig as n, createMachineClient as o, MachineTokenError as r, MachineClient as t };
|
|
72
|
-
//# sourceMappingURL=client-
|
|
72
|
+
//# sourceMappingURL=client-DVozA5Ep.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as ClientPrivateJwk, r as ClientKeyRing } from "./keys-
|
|
2
|
-
import {
|
|
1
|
+
import { i as ClientPrivateJwk, r as ClientKeyRing } from "./keys-BXkGh0VM.js";
|
|
2
|
+
import { n as Page } from "./page-j1OCu4of.js";
|
|
3
3
|
import { n as PlatformUrls } from "./urls-DiYp_PHg.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/workspace/schemas.d.ts
|
|
@@ -686,4 +686,4 @@ type PlatformClient = {
|
|
|
686
686
|
declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
|
|
687
687
|
//#endregion
|
|
688
688
|
export { PlatformStageColor as $, PlatformEavSchemaApplyResult as A, platformOAuthClientUpsertInputSchema as At, PlatformOAuthClientUpsertInput as B, platformPublishedPostSummarySchema as Bt, PlatformBrandappUpsertInput as C, platformErrorSchema as Ct, PlatformEavDataType as D, platformMeSchema as Dt, PlatformEavBrandappResources as E, platformLockReleasedSchema as Et, PlatformManagedBy as F, platformPipelineUpsertInputSchema as Ft, PlatformPipelineUpsertInput as G, platformTaskStageInputSchema as Gt, PlatformPipelineImportInput as H, platformResourcesSchema as Ht, PlatformMe as I, platformPublishedPostDetailQuerySchema as It, PlatformPublishedPostListOptions as J, platformWebhookResourceSchema as Jt, PlatformPublishedPost as K, platformTaskStageSchema as Kt, PlatformOAuthClientImportInput as L, platformPublishedPostListQuerySchema as Lt, PlatformErrorBody as M, platformPipelineResourceSchema as Mt, PlatformLockAcquired as N, platformPipelineSchema as Nt, PlatformEavEntityResource as O, platformOAuthClientImportInputSchema as Ot, PlatformLockReleased as P, platformPipelineStageInputSchema as Pt, PlatformResourcesV2 as Q, platformWriteMetaSchema as Qt, PlatformOAuthClientPurpose as R, platformPublishedPostPageSchema as Rt, PlatformBrandappResource as S, platformEavSchemaOperationSchema as St, PlatformDomainStatus as T, platformLockAcquiredSchema as Tt, PlatformPipelineResource as U, platformResourcesV2Schema as Ut, PlatformPipeline as V, platformResourceKeySchema as Vt, PlatformPipelineStageInput as W, platformTaskSchema as Wt, PlatformPublishedPostSummary as X, platformWebhookUpsertInputSchema as Xt, PlatformPublishedPostPage as Y, platformWebhookSchema as Yt, PlatformResources as Z, platformWorkTaskStageChangedEventSchema as Zt, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS as _, platformCustomerUpsertInputSchema as _t, createPlatformClient as a, PlatformTaskUpsertInput as at, PlatformBrandResource as b, platformEavSchemaApplyInputSchema as bt, PLATFORM_DOMAIN_STATUSES as c, PlatformWebhookTrigger as ct, PLATFORM_OAUTH_APPLICATION_TYPES as d, PlatformWriteMeta as dt, PlatformTask as et, PLATFORM_OAUTH_CLIENT_PURPOSES as f, platformBrandImportInputSchema as ft, PLATFORM_TASK_PRIORITIES as g, platformBrandappUpsertInputSchema as gt, PLATFORM_TASK_OUTCOMES as h, platformBrandappResourceSchema as ht, PlatformWriteResult as i, PlatformTaskStageInput as it, PlatformEavSchemaOperation as j, platformPipelineImportInputSchema as jt, PlatformEavSchemaApplyInput as k, platformOAuthClientResourceSchema as kt, PLATFORM_EAV_DATA_TYPES as l, PlatformWebhookUpsertInput as lt, PLATFORM_STAGE_COLORS as m, platformBrandUpsertInputSchema as mt, PlatformClient as n, PlatformTaskPriority as nt, PLATFORM_ADMIN_SCOPE as o, PlatformWebhook as ot, PLATFORM_OAUTH_GRANT_TYPES as p, platformBrandResourceSchema as pt, PlatformPublishedPostGetOptions as q, platformTaskUpsertInputSchema as qt, PlatformClientConfig as r, PlatformTaskStage as rt, PLATFORM_BRANDAPP_STATUSES as s, PlatformWebhookResource as st, DEFAULT_PLATFORM_SCOPES as t, PlatformTaskOutcome as tt, PLATFORM_MANAGED_BY_VALUES as u, PlatformWorkTaskStageChangedEvent as ut, PLATFORM_WEBHOOK_TRIGGERS as v, platformEavBrandappResourcesSchema as vt, PlatformCustomerUpsertInput as w, platformExternalIdSchema as wt, PlatformBrandUpsertInput as x, platformEavSchemaApplyResultSchema as xt, PlatformBrandImportInput as y, platformEavEntityResourceSchema as yt, PlatformOAuthClientResource as z, platformPublishedPostSchema as zt };
|
|
689
|
-
//# sourceMappingURL=client-
|
|
689
|
+
//# sourceMappingURL=client-olMIaJZH.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as WorkspacePermissionKey, o as ConnectScope } from "./permissions-
|
|
2
|
-
import { n as
|
|
1
|
+
import { c as WorkspacePermissionKey, o as ConnectScope } from "./permissions-DKm_zC_X.js";
|
|
2
|
+
import { i as SortOf, n as Page, r as PageQuery, t as CountedPage } from "./page-j1OCu4of.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/workspace/transport.d.ts
|
|
5
5
|
/**
|
|
@@ -180,6 +180,36 @@ type ConnectTask = {
|
|
|
180
180
|
createdAt: string;
|
|
181
181
|
updatedAt: string;
|
|
182
182
|
};
|
|
183
|
+
/** 업무 타임라인의 사람 — 댓글 작성자·활동의 행위자 */
|
|
184
|
+
type ConnectTaskFeedMember = {
|
|
185
|
+
memberId: string;
|
|
186
|
+
name: string;
|
|
187
|
+
image: string | null;
|
|
188
|
+
};
|
|
189
|
+
type ConnectTaskComment = {
|
|
190
|
+
type: "comment";
|
|
191
|
+
id: string;
|
|
192
|
+
taskId: string;
|
|
193
|
+
/** 탈퇴한 멤버의 댓글은 null */
|
|
194
|
+
author: ConnectTaskFeedMember | null;
|
|
195
|
+
/** 평문 + 멘션 토큰(`@[이름](member:<id>)`) — `mentionToken()`으로 만들고 `splitMentions()`로 그린다 */
|
|
196
|
+
content: string;
|
|
197
|
+
isEdited: boolean;
|
|
198
|
+
createdAt: string;
|
|
199
|
+
};
|
|
200
|
+
/** 업무에 일어난 일 — 생성·단계 이동·담당자 변경 등. `activityType`은 서버가 더할 수 있어 문자열이다 */
|
|
201
|
+
type ConnectTaskActivity = {
|
|
202
|
+
type: "activity";
|
|
203
|
+
id: string;
|
|
204
|
+
/** 자동화·시스템이 한 일은 null */
|
|
205
|
+
actor: ConnectTaskFeedMember | null;
|
|
206
|
+
activityType: "created" | "stage_changed" | "assignees_changed" | "due_date_changed" | "priority_changed" | "retitled" | "external_synced" | (string & {});
|
|
207
|
+
payload: Record<string, unknown> | null;
|
|
208
|
+
createdAt: string;
|
|
209
|
+
};
|
|
210
|
+
type ConnectTaskFeedItem = (Omit<ConnectTaskComment, "taskId"> & {
|
|
211
|
+
taskId?: string;
|
|
212
|
+
}) | ConnectTaskActivity;
|
|
183
213
|
type ConnectPostGroupKind = "generic" | "blog" | "newsletter" | "announcement" | "changelog" | "faq" | "social" | (string & {});
|
|
184
214
|
type ConnectPostGroup = {
|
|
185
215
|
id: string;
|
|
@@ -288,6 +318,34 @@ type ConnectSignedUrl = {
|
|
|
288
318
|
};
|
|
289
319
|
type ConnectFormType = "feedback" | "inquiry" | "consultation" | "custom" | "booking" | (string & {});
|
|
290
320
|
type ConnectFormStatus = "draft" | "published" | "archived";
|
|
321
|
+
/**
|
|
322
|
+
* 앱에 열리는 알림 종류 — 업무(담당 지정·댓글·멘션·단계 이동·마감 임박), 폼 제출, 신규 고객. 리옵트의 다른 알림
|
|
323
|
+
* (결제·보안·구성원)은 이 표면에 오지 않는다.
|
|
324
|
+
*/
|
|
325
|
+
type ConnectNotificationKind = "task_assigned" | "task_comment" | "task_mention" | "task_stage_changed" | "task_due_soon" | "form_submitted" | "customer_created";
|
|
326
|
+
type ConnectNotification = {
|
|
327
|
+
id: string;
|
|
328
|
+
/** 목록에 없는 종류가 나중에 더해질 수 있다 — 모르는 값은 `subject`·`content`만 보여 주면 된다 */
|
|
329
|
+
kind: ConnectNotificationKind | (string & {});
|
|
330
|
+
/** 한 줄 제목(업무 알림은 업무 제목) */
|
|
331
|
+
subject: string | null;
|
|
332
|
+
/** 사람이 읽는 문장 — 리옵트가 쓴 그대로 */
|
|
333
|
+
content: string;
|
|
334
|
+
/** 읽은 시각 — 안 읽었으면 null */
|
|
335
|
+
seenAt: string | null;
|
|
336
|
+
createdAt: string;
|
|
337
|
+
/** 알림을 일으킨 사람(시스템이 낸 알림은 null) */
|
|
338
|
+
actorName: string | null;
|
|
339
|
+
actorImage: string | null;
|
|
340
|
+
/**
|
|
341
|
+
* 알림이 가리키는 것 — 앱이 자기 화면으로 보낼 때 쓴다(`task` → `works.getTask(id)`, `form` → 그 폼의 문의 목록).
|
|
342
|
+
* 여러 건을 묶은 알림("오늘 신규 고객 3명")은 가리키는 것이 없어 null.
|
|
343
|
+
*/
|
|
344
|
+
entity: {
|
|
345
|
+
type: "task" | "form" | (string & {});
|
|
346
|
+
id: string;
|
|
347
|
+
} | null;
|
|
348
|
+
};
|
|
291
349
|
type ConnectForm = {
|
|
292
350
|
id: string;
|
|
293
351
|
name: string;
|
|
@@ -394,6 +452,8 @@ type ConnectCustomerTag = {
|
|
|
394
452
|
};
|
|
395
453
|
type ConnectCustomerField = {
|
|
396
454
|
id: string;
|
|
455
|
+
/** 쓰기의 `attributes` 키 — `update(id, { attributes: { [field.name]: value } })`. 이름을 알 수 없는 옛 필드는 null */
|
|
456
|
+
name: string | null;
|
|
397
457
|
label: string;
|
|
398
458
|
dataType: string;
|
|
399
459
|
/** 선택형 필드의 값 후보 */
|
|
@@ -598,6 +658,8 @@ declare const connectBrandSchema: z.ZodType<ConnectBrand>;
|
|
|
598
658
|
declare const connectMemberSchema: z.ZodType<ConnectMember>;
|
|
599
659
|
declare const connectPipelineSchema: z.ZodType<ConnectPipeline>;
|
|
600
660
|
declare const connectTaskSchema: z.ZodType<ConnectTask>;
|
|
661
|
+
declare const connectTaskCommentSchema: z.ZodType<ConnectTaskComment>;
|
|
662
|
+
declare const connectTaskFeedItemSchema: z.ZodType<ConnectTaskFeedItem>;
|
|
601
663
|
declare const connectPostGroupSchema: z.ZodType<ConnectPostGroup>;
|
|
602
664
|
declare const connectPostTagSchema: z.ZodType<ConnectPostTag>;
|
|
603
665
|
declare const connectPostSummarySchema: z.ZodType<ConnectPostSummary>;
|
|
@@ -605,6 +667,7 @@ declare const connectPostSchema: z.ZodType<ConnectPost>;
|
|
|
605
667
|
declare const connectFolderSchema: z.ZodType<ConnectFolder>;
|
|
606
668
|
declare const connectFileSchema: z.ZodType<ConnectFile>;
|
|
607
669
|
declare const connectFileUsageSchema: z.ZodType<ConnectFileUsage>;
|
|
670
|
+
declare const connectNotificationSchema: z.ZodType<ConnectNotification>;
|
|
608
671
|
declare const connectFormSchema: z.ZodType<ConnectForm>;
|
|
609
672
|
declare const connectInquirySchema: z.ZodType<ConnectInquiry>;
|
|
610
673
|
declare const connectInquiryDetailSchema: z.ZodType<ConnectInquiryDetail>;
|
|
@@ -638,6 +701,18 @@ type ConnectClient = {
|
|
|
638
701
|
deleted: string[];
|
|
639
702
|
notFound: string[];
|
|
640
703
|
}>;
|
|
704
|
+
/** 업무의 타임라인 — 댓글과 활동(생성·단계 이동·담당자 변경…)이 시간순(오래된 것부터)으로 섞여 온다 */
|
|
705
|
+
listFeed: (taskId: string, options?: Options) => Promise<Page<ConnectTaskFeedItem>>;
|
|
706
|
+
/**
|
|
707
|
+
* 댓글 — 4,000자까지. 본문의 멘션 토큰(`mentionToken(member)`)마다 그 멤버에게, 그리고 담당자에게 리옵트 알림이 간다.
|
|
708
|
+
*/
|
|
709
|
+
addComment: (taskId: string, content: string, options?: Options) => Promise<ConnectTaskComment>;
|
|
710
|
+
/** 작성자 본인만 고칠 수 있다(403 `FORBIDDEN`) */
|
|
711
|
+
updateComment: (commentId: string, content: string, options?: Options) => Promise<ConnectTaskComment>;
|
|
712
|
+
/** 작성자 본인, 또는 `works:delete` 권한이 있는 멤버 */
|
|
713
|
+
deleteComment: (commentId: string, options?: Options) => Promise<{
|
|
714
|
+
id: string;
|
|
715
|
+
}>;
|
|
641
716
|
};
|
|
642
717
|
posts: {
|
|
643
718
|
listGroups: (options?: Options) => Promise<Page<ConnectPostGroup>>;
|
|
@@ -733,6 +808,30 @@ type ConnectClient = {
|
|
|
733
808
|
forms: {
|
|
734
809
|
list: (options?: Options) => Promise<Page<ConnectForm>>;
|
|
735
810
|
};
|
|
811
|
+
/**
|
|
812
|
+
* 알림 — 로그인한 직원이 리옵트에서 받은 것 중 **이 앱에 열린 범위의 것**(업무 담당 지정·댓글·멘션·단계 이동·마감 임박,
|
|
813
|
+
* 폼 제출, 신규 고객). 어느 종류가 오는지는 리옵트가 그 직원의 역할·동의한 scope·플랜으로 정한다(예: `customer_created`는
|
|
814
|
+
* `customer:read` scope가 있어야 온다). 결제·보안 알림은 오지 않는다.
|
|
815
|
+
*
|
|
816
|
+
* 읽음 상태는 Studio와 같은 값이다 — 여기서 읽으면 Studio 벨에서도 읽은 것이 되고, 그 반대도 같다.
|
|
817
|
+
*/
|
|
818
|
+
notifications: {
|
|
819
|
+
/** 최근순. `limit`을 안 주면 한 장에 20건(최대 50). `unseen: true`면 안 읽은 것만 */
|
|
820
|
+
list: (query?: {
|
|
821
|
+
unseen?: boolean;
|
|
822
|
+
} & PageQuery, options?: Options) => Promise<Page<ConnectNotification>>;
|
|
823
|
+
/** 벨의 숫자 — 100에서 멈춘다(100이면 "99+"로 보이면 된다) */
|
|
824
|
+
unseenCount: (options?: Options) => Promise<number>;
|
|
825
|
+
/** 한 건 읽음. 이미 읽은 것이면 처음 읽은 시각이 그대로 온다 */
|
|
826
|
+
markSeen: (id: string, options?: Options) => Promise<{
|
|
827
|
+
id: string;
|
|
828
|
+
seenAt: string | null;
|
|
829
|
+
}>;
|
|
830
|
+
/** 이 앱에 보이는 알림만 모두 읽음 — 보이지 않는 종류(결제·보안)는 건드리지 않는다. `count`는 바뀐 건수 */
|
|
831
|
+
markAllSeen: (options?: Options) => Promise<{
|
|
832
|
+
count: number;
|
|
833
|
+
}>;
|
|
834
|
+
};
|
|
736
835
|
/** 문의 = 브랜드폼 제출 + 운영 보드 단계. 읽기는 `customer:read` scope가 필요하다(연락처) */
|
|
737
836
|
inquiries: {
|
|
738
837
|
/** `formIds`는 1~50개. `limit`을 안 주면 한 장에 100건(최대 500) */
|
|
@@ -748,7 +847,7 @@ type ConnectClient = {
|
|
|
748
847
|
*/
|
|
749
848
|
customers: {
|
|
750
849
|
/** 최근 등록순. `limit`을 안 주면 한 장에 50명(최대 100). `total`은 조건에 맞는 전체 수 */
|
|
751
|
-
list: (query?: ConnectCustomerListQuery, options?: Options) => Promise<
|
|
850
|
+
list: (query?: ConnectCustomerListQuery, options?: Options) => Promise<CountedPage<ConnectCustomerSummary>>;
|
|
752
851
|
/** 태그 어휘 — `list({ tags })` 필터와 태그 입력 자동완성에 쓴다 */
|
|
753
852
|
listTags: (options?: Options) => Promise<Page<ConnectCustomerTag>>;
|
|
754
853
|
/** 커스텀 필드 정의 — `ConnectCustomer.fields[].id`의 뜻 */
|
|
@@ -799,5 +898,5 @@ type ConnectClient = {
|
|
|
799
898
|
};
|
|
800
899
|
declare function createConnectClient(config: ConnectClientConfig): ConnectClient;
|
|
801
900
|
//#endregion
|
|
802
|
-
export {
|
|
803
|
-
//# sourceMappingURL=connect-
|
|
901
|
+
export { ConnectStageColor as $, ConnectInquiryMoveResult as A, connectPostGroupSchema as At, ConnectPostGroup as B, ConnectFolder as C, connectInquiryDetailSchema as Ct, ConnectFormType as D, connectMemberSchema as Dt, ConnectFormStatus as E, connectMeSchema as Et, ConnectNotificationKind as F, connectTaskFeedItemSchema as Ft, ConnectPostSpec as G, ConnectPostListQuery as H, ConnectPipeline as I, connectTaskSchema as It, ConnectPostTag as J, ConnectPostStatus as K, ConnectPost as L, createConnectClient as Lt, ConnectMember as M, connectPostSummarySchema as Mt, ConnectMemberRole as N, connectPostTagSchema as Nt, ConnectInquiry as O, connectNotificationSchema as Ot, ConnectNotification as P, connectTaskCommentSchema as Pt, ConnectSignedUrlOptions as Q, ConnectPostAuthor as R, ConnectFileVisibility as S, connectFormSchema as St, ConnectForm as T, connectInquirySchema as Tt, ConnectPostMetaInput as U, ConnectPostGroupKind as V, ConnectPostSortField as W, ConnectRequestOptions as X, ConnectPostUpdateInput as Y, ConnectSignedUrl as Z, ConnectEavRecord as _, connectEavEntitySchema as _t, ConnectClientConfig as a, ConnectTaskFeedItem as at, ConnectFileSortField as b, connectFileUsageSchema as bt, ConnectCustomerEvent as c, ConnectTaskMoveInput as ct, ConnectCustomerNote as d, ConnectTaskUpdateInput as dt, ConnectStageOutcome as et, ConnectCustomerRecord as f, ConnectWorkspaceTier as ft, ConnectEavEntity as g, connectCustomerSummarySchema as gt, ConnectCustomerUpdateInput as h, connectCustomerSchema as ht, ConnectClient as i, ConnectTaskCreateInput as it, ConnectMe as j, connectPostSchema as jt, ConnectInquiryDetail as k, connectPipelineSchema as kt, ConnectCustomerField as l, ConnectTaskPriority as lt, ConnectCustomerTag as m, connectCustomerNoteSchema as mt, ConnectAnswerValue as n, ConnectTaskActivity as nt, ConnectCustomer as o, ConnectTaskFeedMember as ot, ConnectCustomerSummary as p, connectBrandSchema as pt, ConnectPostSummary as q, ConnectBrand as r, ConnectTaskComment as rt, ConnectCustomerCreateInput as s, ConnectTaskListQuery as st, ConnectAccessToken as t, ConnectTask as tt, ConnectCustomerListQuery as u, ConnectTaskSortField as ut, ConnectFile as v, connectEavRecordSchema as vt, ConnectFolderKind as w, connectInquiryMoveResultSchema as wt, ConnectFileUsage as x, connectFolderSchema as xt, ConnectFileListQuery as y, connectFileSchema as yt, ConnectPostCreateInput as z };
|
|
902
|
+
//# sourceMappingURL=connect-CTxppAjD.d.ts.map
|
package/dist/connect.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as ConnectOperationRule, c as WorkspacePermissionKey, d as canAny, f as canCall, i as ConnectOperation, l as can, n as CONNECT_OPERATION_NAMES, o as ConnectScope, r as CONNECT_SCOPES, s as WORKSPACE_PERMISSION_KEYS, t as CONNECT_OPERATIONS, u as canAll } from "./permissions-
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as PlatformSdkErrorCode, c as isNotImplemented, d as isPlatformError, f as isSignInRequired, i as PlatformFieldError, l as isPermissionDenied, n as PlatformApiError, o as PlatformServerErrorCode, r as PlatformErrorCode, s as SDK_ERROR_CODES, t as PLATFORM_ERROR_CODES, u as isPlatformApiError } from "./errors-
|
|
4
|
-
import { $ as
|
|
5
|
-
|
|
1
|
+
import { a as ConnectOperationRule, c as WorkspacePermissionKey, d as canAny, f as canCall, i as ConnectOperation, l as can, n as CONNECT_OPERATION_NAMES, o as ConnectScope, r as CONNECT_SCOPES, s as WORKSPACE_PERMISSION_KEYS, t as CONNECT_OPERATIONS, u as canAll } from "./permissions-DKm_zC_X.js";
|
|
2
|
+
import { a as iterate, i as SortOf, n as Page, o as listAll, r as PageQuery, t as CountedPage } from "./page-j1OCu4of.js";
|
|
3
|
+
import { a as PlatformSdkErrorCode, c as isNotImplemented, d as isPlatformError, f as isSignInRequired, i as PlatformFieldError, l as isPermissionDenied, n as PlatformApiError, o as PlatformServerErrorCode, r as PlatformErrorCode, s as SDK_ERROR_CODES, t as PLATFORM_ERROR_CODES, u as isPlatformApiError } from "./errors-CLUuzCNG.js";
|
|
4
|
+
import { $ as ConnectStageColor, A as ConnectInquiryMoveResult, At as connectPostGroupSchema, B as ConnectPostGroup, C as ConnectFolder, Ct as connectInquiryDetailSchema, D as ConnectFormType, Dt as connectMemberSchema, E as ConnectFormStatus, Et as connectMeSchema, F as ConnectNotificationKind, Ft as connectTaskFeedItemSchema, G as ConnectPostSpec, H as ConnectPostListQuery, I as ConnectPipeline, It as connectTaskSchema, J as ConnectPostTag, K as ConnectPostStatus, L as ConnectPost, Lt as createConnectClient, M as ConnectMember, Mt as connectPostSummarySchema, N as ConnectMemberRole, Nt as connectPostTagSchema, O as ConnectInquiry, Ot as connectNotificationSchema, P as ConnectNotification, Pt as connectTaskCommentSchema, Q as ConnectSignedUrlOptions, R as ConnectPostAuthor, S as ConnectFileVisibility, St as connectFormSchema, T as ConnectForm, Tt as connectInquirySchema, U as ConnectPostMetaInput, V as ConnectPostGroupKind, W as ConnectPostSortField, X as ConnectRequestOptions, Y as ConnectPostUpdateInput, Z as ConnectSignedUrl, _ as ConnectEavRecord, _t as connectEavEntitySchema, a as ConnectClientConfig, at as ConnectTaskFeedItem, b as ConnectFileSortField, bt as connectFileUsageSchema, c as ConnectCustomerEvent, ct as ConnectTaskMoveInput, d as ConnectCustomerNote, dt as ConnectTaskUpdateInput, et as ConnectStageOutcome, f as ConnectCustomerRecord, ft as ConnectWorkspaceTier, g as ConnectEavEntity, gt as connectCustomerSummarySchema, h as ConnectCustomerUpdateInput, ht as connectCustomerSchema, i as ConnectClient, it as ConnectTaskCreateInput, j as ConnectMe, jt as connectPostSchema, k as ConnectInquiryDetail, kt as connectPipelineSchema, l as ConnectCustomerField, lt as ConnectTaskPriority, m as ConnectCustomerTag, mt as connectCustomerNoteSchema, n as ConnectAnswerValue, nt as ConnectTaskActivity, o as ConnectCustomer, ot as ConnectTaskFeedMember, p as ConnectCustomerSummary, pt as connectBrandSchema, q as ConnectPostSummary, r as ConnectBrand, rt as ConnectTaskComment, s as ConnectCustomerCreateInput, st as ConnectTaskListQuery, t as ConnectAccessToken, tt as ConnectTask, u as ConnectCustomerListQuery, ut as ConnectTaskSortField, v as ConnectFile, vt as connectEavRecordSchema, w as ConnectFolderKind, wt as connectInquiryMoveResultSchema, x as ConnectFileUsage, xt as connectFolderSchema, y as ConnectFileListQuery, yt as connectFileSchema, z as ConnectPostCreateInput } from "./connect-CTxppAjD.js";
|
|
5
|
+
import { n as mentionToken, r as splitMentions, t as MentionSegment } from "./mentions-BMI2c7O6.js";
|
|
6
|
+
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, type ConnectAccessToken, type ConnectAnswerValue, type ConnectBrand, type ConnectClient, type ConnectClientConfig, type ConnectCustomer, type ConnectCustomerCreateInput, type ConnectCustomerEvent, type ConnectCustomerField, type ConnectCustomerListQuery, type ConnectCustomerNote, type ConnectCustomerRecord, type ConnectCustomerSummary, type ConnectCustomerTag, type ConnectCustomerUpdateInput, type ConnectEavEntity, type ConnectEavRecord, type ConnectFile, type ConnectFileListQuery, type ConnectFileSortField, type ConnectFileUsage, type ConnectFileVisibility, type ConnectFolder, type ConnectFolderKind, type ConnectForm, type ConnectFormStatus, type ConnectFormType, type ConnectInquiry, type ConnectInquiryDetail, type ConnectInquiryMoveResult, type ConnectMe, type ConnectMember, type ConnectMemberRole, type ConnectNotification, type ConnectNotificationKind, type ConnectOperation, type ConnectOperationRule, type ConnectPipeline, type ConnectPost, type ConnectPostAuthor, type ConnectPostCreateInput, type ConnectPostGroup, type ConnectPostGroupKind, type ConnectPostListQuery, type ConnectPostMetaInput, type ConnectPostSortField, type ConnectPostSpec, type ConnectPostStatus, type ConnectPostSummary, type ConnectPostTag, type ConnectPostUpdateInput, type ConnectRequestOptions, type ConnectScope, type ConnectSignedUrl, type ConnectSignedUrlOptions, type ConnectStageColor, type ConnectStageOutcome, type ConnectTask, type ConnectTaskActivity, type ConnectTaskComment, type ConnectTaskCreateInput, type ConnectTaskFeedItem, type ConnectTaskFeedMember, type ConnectTaskListQuery, type ConnectTaskMoveInput, type ConnectTaskPriority, type ConnectTaskSortField, type ConnectTaskUpdateInput, type ConnectWorkspaceTier, type CountedPage, type MentionSegment, PLATFORM_ERROR_CODES, type Page, type PageQuery, PlatformApiError, type PlatformErrorCode, type PlatformFieldError, type PlatformSdkErrorCode, type PlatformServerErrorCode, SDK_ERROR_CODES, type SortOf, WORKSPACE_PERMISSION_KEYS, type WorkspacePermissionKey, can, canAll, canAny, canCall, connectBrandSchema, type connectCustomerNoteSchema, type connectCustomerSchema, type connectCustomerSummarySchema, connectEavEntitySchema, connectEavRecordSchema, connectFileSchema, connectFileUsageSchema, connectFolderSchema, connectFormSchema, connectInquiryDetailSchema, type connectInquiryMoveResultSchema, connectInquirySchema, connectMeSchema, connectMemberSchema, type connectNotificationSchema, connectPipelineSchema, connectPostGroupSchema, connectPostSchema, connectPostSummarySchema, connectPostTagSchema, type connectTaskCommentSchema, type connectTaskFeedItemSchema, connectTaskSchema, createConnectClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll, mentionToken, splitMentions };
|
package/dist/connect.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as isPermissionDenied, c as isSignInRequired, i as isNotImplemented, n as PlatformApiError, o as isPlatformApiError, r as SDK_ERROR_CODES, s as isPlatformError, t as PLATFORM_ERROR_CODES } from "./errors-
|
|
1
|
+
import { a as isPermissionDenied, c as isSignInRequired, i as isNotImplemented, n as PlatformApiError, o as isPlatformApiError, r as SDK_ERROR_CODES, s as isPlatformError, t as PLATFORM_ERROR_CODES } from "./errors-DKMC4kId.js";
|
|
2
2
|
import { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, WORKSPACE_PERMISSION_KEYS, can, canAll, canAny, canCall } from "./permissions.js";
|
|
3
|
-
import {
|
|
3
|
+
import { mentionToken, splitMentions } from "./mentions.js";
|
|
4
|
+
import { _ as connectPostSummarySchema, a as connectEavRecordSchema, b as createConnectClient, c as connectFolderSchema, d as connectInquirySchema, f as connectMeSchema, g as connectPostSchema, h as connectPostGroupSchema, i as connectEavEntitySchema, l as connectFormSchema, m as connectPipelineSchema, n as listAll, o as connectFileSchema, p as connectMemberSchema, r as connectBrandSchema, s as connectFileUsageSchema, t as iterate, u as connectInquiryDetailSchema, v as connectPostTagSchema, y as connectTaskSchema } from "./page-rc95cliL.js";
|
|
4
5
|
|
|
5
|
-
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, PLATFORM_ERROR_CODES, PlatformApiError, SDK_ERROR_CODES, WORKSPACE_PERMISSION_KEYS, can, canAll, canAny, canCall, connectBrandSchema, connectEavEntitySchema, connectEavRecordSchema, connectFileSchema, connectFileUsageSchema, connectFolderSchema, connectFormSchema, connectInquiryDetailSchema, connectInquirySchema, connectMeSchema, connectMemberSchema, connectPipelineSchema, connectPostGroupSchema, connectPostSchema, connectPostSummarySchema, connectPostTagSchema, connectTaskSchema, createConnectClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll };
|
|
6
|
+
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, PLATFORM_ERROR_CODES, PlatformApiError, SDK_ERROR_CODES, WORKSPACE_PERMISSION_KEYS, can, canAll, canAny, canCall, connectBrandSchema, connectEavEntitySchema, connectEavRecordSchema, connectFileSchema, connectFileUsageSchema, connectFolderSchema, connectFormSchema, connectInquiryDetailSchema, connectInquirySchema, connectMeSchema, connectMemberSchema, connectPipelineSchema, connectPostGroupSchema, connectPostSchema, connectPostSummarySchema, connectPostTagSchema, connectTaskSchema, createConnectClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll, mentionToken, splitMentions };
|
|
@@ -32,6 +32,8 @@ type PlatformErrorCode = PlatformServerErrorCode | PlatformSdkErrorCode | (strin
|
|
|
32
32
|
type PlatformFieldError = {
|
|
33
33
|
field: string;
|
|
34
34
|
message: string;
|
|
35
|
+
/** 이 값을 이미 가진 레코드의 id — `CONTACT_TAKEN`에서 겹친 고객(`customers.get(relatedId)`로 연다) */
|
|
36
|
+
relatedId?: string;
|
|
35
37
|
};
|
|
36
38
|
declare class PlatformApiError extends Error {
|
|
37
39
|
readonly status: number;
|
|
@@ -73,4 +75,4 @@ declare function isSignInRequired(error: unknown): boolean;
|
|
|
73
75
|
declare function isPermissionDenied(error: unknown): boolean;
|
|
74
76
|
//#endregion
|
|
75
77
|
export { PlatformSdkErrorCode as a, isNotImplemented as c, isPlatformError as d, isSignInRequired as f, PlatformFieldError as i, isPermissionDenied as l, PlatformApiError as n, PlatformServerErrorCode as o, PlatformErrorCode as r, SDK_ERROR_CODES as s, PLATFORM_ERROR_CODES as t, isPlatformApiError as u };
|
|
76
|
-
//# sourceMappingURL=errors-
|
|
78
|
+
//# sourceMappingURL=errors-CLUuzCNG.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/version.ts
|
|
2
2
|
/** 이 패키지(`@reopt-ai/workspace-sdk`)의 버전 — 빌드가 package.json에서 주입한다(미번들 실행은 `0.0.0-dev`). */
|
|
3
|
-
const SDK_VERSION = "0.1.0-rc.
|
|
3
|
+
const SDK_VERSION = "0.1.0-rc.13";
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/workspace/errors.ts
|
|
@@ -120,4 +120,4 @@ function isPermissionDenied(error) {
|
|
|
120
120
|
|
|
121
121
|
//#endregion
|
|
122
122
|
export { isPermissionDenied as a, isSignInRequired as c, isNotImplemented as i, SDK_VERSION as l, PlatformApiError as n, isPlatformApiError as o, SDK_ERROR_CODES as r, isPlatformError as s, PLATFORM_ERROR_CODES as t };
|
|
123
|
-
//# sourceMappingURL=errors-
|
|
123
|
+
//# sourceMappingURL=errors-DKMC4kId.js.map
|
package/dist/forms.d.ts
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
//#region src/forms.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* `@reopt-ai/workspace-sdk/forms` — 공개 폼(브랜드폼) 클라이언트. 방문자 브라우저가 리옵트에 **직접** 제출한다.
|
|
4
|
+
*
|
|
5
|
+
* 의존이 없다 — 클라이언트 컴포넌트에서 쓴다. 인증도 없다: 폼 id는 비밀이 아니고, 게시된 폼만 열린다.
|
|
6
|
+
*
|
|
7
|
+
* 🔑 **앱 서버로 중계하지 않는다.** 리옵트의 제출 한도는 방문자 IP 기준이라, 서버가 대신 보내면 모든 방문자가 서버 IP
|
|
8
|
+
* 하나로 묶여 그 한도를 나눠 쓴다. 리옵트는 이 주소에 CORS를 열어 두었고 쿠키는 받지 않는다(RFC-0043 §3.6).
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* const forms = createPublicFormClient();
|
|
12
|
+
* const form = await forms.get(formId); // 게시된 정의 — 필드·동의 항목·버튼 문구
|
|
13
|
+
* try {
|
|
14
|
+
* const { successMessage } = await forms.submit(formId, { values, consents, meta: { hp } });
|
|
15
|
+
* } catch (error) {
|
|
16
|
+
* if (isPublicFormError(error)) showErrors(error.fieldErrors, error.message);
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
/** 리옵트 Studio 호스트 — 공개 폼 주소가 여기에 있다. */
|
|
21
|
+
declare const REOPT_STUDIO_URL: string;
|
|
22
|
+
type PublicFormFieldType = "string" | "number" | "boolean" | "date" | "email" | "url" | "select" | "multiselect" | "textarea" | "file";
|
|
23
|
+
type PublicFormField = {
|
|
24
|
+
/** 제출 본문 `values`의 키이자 문의 `answers`의 키 */
|
|
25
|
+
name: string;
|
|
26
|
+
label: string;
|
|
27
|
+
type: PublicFormFieldType | (string & {});
|
|
28
|
+
required: boolean;
|
|
29
|
+
placeholder: string | null;
|
|
30
|
+
description: string | null;
|
|
31
|
+
/** 선택형의 선택지 — 제출 값은 `value`다 */
|
|
32
|
+
options: {
|
|
33
|
+
value: string;
|
|
34
|
+
label: string;
|
|
35
|
+
}[] | null;
|
|
36
|
+
/** 브라우저 자동완성에 쓰는 의미(이름·이메일·전화) */
|
|
37
|
+
inputPurpose?: "name" | "email" | "tel" | null;
|
|
38
|
+
/** 저장 타입은 그대로 두고 입력 모양만 바꾸는 표현(전화·시간·별점 등) */
|
|
39
|
+
appearance?: string | null;
|
|
40
|
+
scaleMax?: number | null;
|
|
41
|
+
};
|
|
42
|
+
type PublicFormConsentItem = {
|
|
43
|
+
/** 제출 본문 `consents`의 키 */
|
|
44
|
+
id: string;
|
|
45
|
+
label: string;
|
|
46
|
+
details?: string | null;
|
|
47
|
+
/** 필수 동의 — 빠지면 리옵트가 `CONSENT_REQUIRED`로 거절한다 */
|
|
48
|
+
required: boolean;
|
|
49
|
+
/** 약관 전문 주소 */
|
|
50
|
+
linkUrl: string | null;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 게시된 폼의 정의. 여기 적힌 필드는 약속이고, 그 밖의 것(테마·페이지 분할·예약 정보 등 리옵트 렌더러가 쓰는 값)도
|
|
54
|
+
* 그대로 실려 온다 — 이름을 약속하지 않으므로 타입에는 없다.
|
|
55
|
+
*/
|
|
56
|
+
type PublicForm = {
|
|
57
|
+
formId: string;
|
|
58
|
+
name: string;
|
|
59
|
+
fields: PublicFormField[];
|
|
60
|
+
/** 제출 버튼 문구 — 없으면 앱이 정한다 */
|
|
61
|
+
submitLabel: string | null;
|
|
62
|
+
/** 제출 뒤 보여 줄 문구 */
|
|
63
|
+
successMessage: string | null;
|
|
64
|
+
/** 동의 항목 — 없으면 빈 배열 */
|
|
65
|
+
consent: PublicFormConsentItem[];
|
|
66
|
+
[extra: string]: unknown;
|
|
67
|
+
};
|
|
68
|
+
type PublicFormSubmitMeta = {
|
|
69
|
+
/**
|
|
70
|
+
* 허니팟 — 사람에게 보이지 않는 입력의 값. 채워져 있으면 리옵트는 **성공처럼 답하고 버린다**
|
|
71
|
+
* (`submissionId: null`). 봇에게 단서를 주지 않으려는 것이니 앱도 평소처럼 완료 화면을 보인다.
|
|
72
|
+
*/
|
|
73
|
+
hp?: string;
|
|
74
|
+
locale?: string;
|
|
75
|
+
/** 폼이 놓인 페이지 경로 */
|
|
76
|
+
pagePath?: string;
|
|
77
|
+
/** 유입 주소 — 리옵트가 origin + 경로만 남긴다 */
|
|
78
|
+
referrer?: string;
|
|
79
|
+
/** 추천 코드 */
|
|
80
|
+
ref?: string;
|
|
81
|
+
utm?: Partial<Record<"utm_source" | "utm_medium" | "utm_campaign" | "utm_term" | "utm_content", string>>;
|
|
82
|
+
/** 예약 폼 — 고른 시각(ISO)과 방문자 타임존 */
|
|
83
|
+
bookedAt?: string;
|
|
84
|
+
timezone?: string;
|
|
85
|
+
};
|
|
86
|
+
type PublicFormSubmission = {
|
|
87
|
+
/** 필드 `name` → 값. 비운 답(빈 문자열·null)은 "답하지 않음"으로 읽는다 */
|
|
88
|
+
values: Record<string, unknown>;
|
|
89
|
+
/** 동의 항목 `id` → 동의 여부 */
|
|
90
|
+
consents?: Record<string, boolean>;
|
|
91
|
+
meta?: PublicFormSubmitMeta;
|
|
92
|
+
};
|
|
93
|
+
type PublicFormSubmitResult = {
|
|
94
|
+
/** 허니팟에 걸린 제출은 null */
|
|
95
|
+
submissionId: string | null;
|
|
96
|
+
successMessage: string | null;
|
|
97
|
+
};
|
|
98
|
+
/** 리옵트가 내는 코드(앞의 여섯) + 클라이언트가 만드는 코드(뒤의 셋). 목록 밖의 코드도 문자열로 그대로 온다. */
|
|
99
|
+
type PublicFormErrorCode = "FORM_NOT_FOUND" | "VALIDATION_ERROR" | "CONSENT_REQUIRED" | "RATE_LIMITED" | "PAYLOAD_TOO_LARGE" | "SUBMISSION_IN_PROGRESS" | "NETWORK_ERROR" | "TIMEOUT" | "INVALID_RESPONSE" | (string & {});
|
|
100
|
+
/**
|
|
101
|
+
* 공개 폼 요청의 실패 — 이 클라이언트가 던지는 것은 언제나 이것이다(요청을 취소한 `AbortError`만 예외).
|
|
102
|
+
*
|
|
103
|
+
* - `fieldErrors` — 칸별 문구(필드 `name` 또는 동의 항목 `id` → 문구). 없으면 빈 객체
|
|
104
|
+
* - `message` — 방문자에게 그대로 보여도 되는 문구(리옵트가 준 것). 클라이언트가 만든 코드는 영문이다
|
|
105
|
+
* - `retryable` — 잠시 뒤 같은 요청을 다시 보내도 되는가(한도 초과·처리 중·네트워크)
|
|
106
|
+
*/
|
|
107
|
+
declare class PublicFormError extends Error {
|
|
108
|
+
readonly code: PublicFormErrorCode;
|
|
109
|
+
/** HTTP 상태 — 응답을 받지 못했으면 0 */
|
|
110
|
+
readonly status: number;
|
|
111
|
+
readonly fieldErrors: Record<string, string>;
|
|
112
|
+
readonly retryable: boolean;
|
|
113
|
+
constructor(input: {
|
|
114
|
+
code: PublicFormErrorCode;
|
|
115
|
+
message: string;
|
|
116
|
+
status: number;
|
|
117
|
+
fieldErrors?: Record<string, string>;
|
|
118
|
+
retryable?: boolean;
|
|
119
|
+
cause?: unknown;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/** `instanceof` 대신 — 번들이 둘로 갈려도(서버·클라이언트 사본) 맞는다. */
|
|
123
|
+
declare function isPublicFormError(error: unknown): error is PublicFormError;
|
|
124
|
+
type PublicFormClientOptions = {
|
|
125
|
+
/** 리옵트 Studio 주소 — 기본 `https://studio.reopt.ai`. 개발에서는 에뮬레이터의 `browserBaseUrl` */
|
|
126
|
+
studioUrl?: string;
|
|
127
|
+
fetch?: typeof globalThis.fetch;
|
|
128
|
+
/** 응답을 기다리는 상한(ms) — 기본 15000 */
|
|
129
|
+
timeoutMs?: number;
|
|
130
|
+
};
|
|
131
|
+
type PublicFormRequestOptions = {
|
|
132
|
+
signal?: AbortSignal;
|
|
133
|
+
};
|
|
134
|
+
type PublicFormClient = {
|
|
135
|
+
/** 정의를 읽는 주소 */
|
|
136
|
+
url: (formId: string) => string;
|
|
137
|
+
/** 제출 주소 — JS 없이 동작하는 `<form>`을 직접 짜거나 CSP `connect-src`에 넣을 때 */
|
|
138
|
+
submitUrl: (formId: string) => string;
|
|
139
|
+
/** 게시된 폼의 정의. 게시되지 않았거나 없는 폼은 `FORM_NOT_FOUND` */
|
|
140
|
+
get: (formId: string, options?: PublicFormRequestOptions) => Promise<PublicForm>;
|
|
141
|
+
/** 제출. 칸이 틀리면 `VALIDATION_ERROR`·`CONSENT_REQUIRED`에 `fieldErrors`가 실린다 */
|
|
142
|
+
submit: (formId: string, submission: PublicFormSubmission, options?: PublicFormRequestOptions) => Promise<PublicFormSubmitResult>;
|
|
143
|
+
};
|
|
144
|
+
declare function createPublicFormClient(options?: PublicFormClientOptions): PublicFormClient;
|
|
145
|
+
type LabeledAnswer = {
|
|
146
|
+
/** 필드 `name` */
|
|
147
|
+
name: string;
|
|
148
|
+
/** 폼의 라벨 — 지금 폼에 없는 칸(나중에 지운 필드)의 답이면 `name` 그대로 */
|
|
149
|
+
label: string;
|
|
150
|
+
value: unknown;
|
|
151
|
+
/** 사람이 읽는 값 — 선택형은 선택지 라벨, 여러 값은 쉼표로, 예/아니오 */
|
|
152
|
+
text: string;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* 제출된 답(`answers`)에 폼의 라벨을 붙인다 — 관리 화면이 필드 이름을 손으로 적지 않게.
|
|
156
|
+
* 순서는 폼의 필드 순서이고, 폼에 없는 키의 답은 뒤에 붙는다(지운 필드의 옛 답을 숨기지 않는다).
|
|
157
|
+
* 비어 있는 답은 뺀다.
|
|
158
|
+
*
|
|
159
|
+
* ```ts
|
|
160
|
+
* const form = await forms.get(inquiry.formId);
|
|
161
|
+
* labelAnswers(form.fields, inquiry.answers).map(({ label, text }) => …);
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
declare function labelAnswers(fields: readonly PublicFormField[], answers: Readonly<Record<string, unknown>>): LabeledAnswer[];
|
|
165
|
+
//#endregion
|
|
166
|
+
export { LabeledAnswer, PublicForm, PublicFormClient, PublicFormClientOptions, PublicFormConsentItem, PublicFormError, PublicFormErrorCode, PublicFormField, PublicFormFieldType, PublicFormRequestOptions, PublicFormSubmission, PublicFormSubmitMeta, PublicFormSubmitResult, REOPT_STUDIO_URL, createPublicFormClient, isPublicFormError, labelAnswers };
|
|
167
|
+
//# sourceMappingURL=forms.d.ts.map
|