@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/dist/forms.js
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
//#region src/forms.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
|
+
const REOPT_STUDIO_URL = "https://studio.reopt.ai";
|
|
22
|
+
const BRAND = "@reopt-ai/workspace-sdk:PublicFormError";
|
|
23
|
+
/**
|
|
24
|
+
* 공개 폼 요청의 실패 — 이 클라이언트가 던지는 것은 언제나 이것이다(요청을 취소한 `AbortError`만 예외).
|
|
25
|
+
*
|
|
26
|
+
* - `fieldErrors` — 칸별 문구(필드 `name` 또는 동의 항목 `id` → 문구). 없으면 빈 객체
|
|
27
|
+
* - `message` — 방문자에게 그대로 보여도 되는 문구(리옵트가 준 것). 클라이언트가 만든 코드는 영문이다
|
|
28
|
+
* - `retryable` — 잠시 뒤 같은 요청을 다시 보내도 되는가(한도 초과·처리 중·네트워크)
|
|
29
|
+
*/
|
|
30
|
+
var PublicFormError = class extends Error {
|
|
31
|
+
code;
|
|
32
|
+
/** HTTP 상태 — 응답을 받지 못했으면 0 */
|
|
33
|
+
status;
|
|
34
|
+
fieldErrors;
|
|
35
|
+
retryable;
|
|
36
|
+
constructor(input) {
|
|
37
|
+
super(input.message, input.cause === void 0 ? void 0 : { cause: input.cause });
|
|
38
|
+
this.name = "PublicFormError";
|
|
39
|
+
this.code = input.code;
|
|
40
|
+
this.status = input.status;
|
|
41
|
+
this.fieldErrors = input.fieldErrors ?? {};
|
|
42
|
+
this.retryable = input.retryable ?? false;
|
|
43
|
+
Object.defineProperty(this, BRAND, { value: true });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/** `instanceof` 대신 — 번들이 둘로 갈려도(서버·클라이언트 사본) 맞는다. */
|
|
47
|
+
function isPublicFormError(error) {
|
|
48
|
+
return typeof error === "object" && error !== null && error[BRAND] === true;
|
|
49
|
+
}
|
|
50
|
+
const DEFAULT_TIMEOUT_MS = 15e3;
|
|
51
|
+
const RETRYABLE = /* @__PURE__ */ new Set([
|
|
52
|
+
"RATE_LIMITED",
|
|
53
|
+
"SUBMISSION_IN_PROGRESS",
|
|
54
|
+
"NETWORK_ERROR",
|
|
55
|
+
"TIMEOUT"
|
|
56
|
+
]);
|
|
57
|
+
function isRecord(value) {
|
|
58
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
59
|
+
}
|
|
60
|
+
function readFieldErrors(error) {
|
|
61
|
+
const out = {};
|
|
62
|
+
if (isRecord(error.fieldErrors)) {
|
|
63
|
+
for (const [key, value] of Object.entries(error.fieldErrors)) if (typeof value === "string") out[key] = value;
|
|
64
|
+
}
|
|
65
|
+
if (Array.isArray(error.fields)) {
|
|
66
|
+
for (const item of error.fields) if (isRecord(item) && typeof item.field === "string" && typeof item.message === "string" && !(item.field in out)) out[item.field] = item.message;
|
|
67
|
+
}
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
function createPublicFormClient(options = {}) {
|
|
71
|
+
const base = (options.studioUrl ?? "https://studio.reopt.ai").replace(/\/+$/, "");
|
|
72
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
73
|
+
const url = (formId) => `${base}/api/brandfront/forms/${encodeURIComponent(formId)}`;
|
|
74
|
+
const submitUrl = (formId) => `${url(formId)}/submit`;
|
|
75
|
+
const request = async (target, init, signal) => {
|
|
76
|
+
const doFetch = options.fetch ?? globalThis.fetch;
|
|
77
|
+
const controller = new AbortController();
|
|
78
|
+
let timedOut = false;
|
|
79
|
+
const timer = setTimeout(() => {
|
|
80
|
+
timedOut = true;
|
|
81
|
+
controller.abort();
|
|
82
|
+
}, timeoutMs);
|
|
83
|
+
const onAbort = () => controller.abort(signal?.reason);
|
|
84
|
+
if (signal?.aborted) onAbort();
|
|
85
|
+
else signal?.addEventListener("abort", onAbort, { once: true });
|
|
86
|
+
let response;
|
|
87
|
+
let body;
|
|
88
|
+
try {
|
|
89
|
+
response = await doFetch(target, {
|
|
90
|
+
...init,
|
|
91
|
+
credentials: "omit",
|
|
92
|
+
signal: controller.signal
|
|
93
|
+
});
|
|
94
|
+
body = await response.json().catch(() => null);
|
|
95
|
+
} catch (cause) {
|
|
96
|
+
if (signal?.aborted && !timedOut) throw cause;
|
|
97
|
+
throw new PublicFormError(timedOut ? {
|
|
98
|
+
code: "TIMEOUT",
|
|
99
|
+
message: `Reopt did not answer within ${timeoutMs}ms`,
|
|
100
|
+
status: 0,
|
|
101
|
+
retryable: true,
|
|
102
|
+
cause
|
|
103
|
+
} : {
|
|
104
|
+
code: "NETWORK_ERROR",
|
|
105
|
+
message: "Could not reach Reopt",
|
|
106
|
+
status: 0,
|
|
107
|
+
retryable: true,
|
|
108
|
+
cause
|
|
109
|
+
});
|
|
110
|
+
} finally {
|
|
111
|
+
clearTimeout(timer);
|
|
112
|
+
signal?.removeEventListener("abort", onAbort);
|
|
113
|
+
}
|
|
114
|
+
if (!response.ok) {
|
|
115
|
+
const error = isRecord(body) && isRecord(body.error) ? body.error : null;
|
|
116
|
+
const code = error && typeof error.code === "string" ? error.code : response.status === 429 ? "RATE_LIMITED" : "INVALID_RESPONSE";
|
|
117
|
+
throw new PublicFormError({
|
|
118
|
+
code,
|
|
119
|
+
message: error && typeof error.message === "string" ? error.message : `Reopt answered ${response.status}`,
|
|
120
|
+
status: response.status,
|
|
121
|
+
fieldErrors: error ? readFieldErrors(error) : {},
|
|
122
|
+
retryable: RETRYABLE.has(code) || response.status >= 500
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
if (!isRecord(body) || !isRecord(body.data)) throw new PublicFormError({
|
|
126
|
+
code: "INVALID_RESPONSE",
|
|
127
|
+
message: "Reopt answered in an unexpected shape",
|
|
128
|
+
status: response.status
|
|
129
|
+
});
|
|
130
|
+
return body.data;
|
|
131
|
+
};
|
|
132
|
+
return {
|
|
133
|
+
url,
|
|
134
|
+
submitUrl,
|
|
135
|
+
get: async (formId, requestOptions) => {
|
|
136
|
+
const data = await request(url(formId), {
|
|
137
|
+
method: "GET",
|
|
138
|
+
headers: { Accept: "application/json" }
|
|
139
|
+
}, requestOptions?.signal);
|
|
140
|
+
if (typeof data.formId !== "string" || typeof data.name !== "string" || !Array.isArray(data.fields)) throw new PublicFormError({
|
|
141
|
+
code: "INVALID_RESPONSE",
|
|
142
|
+
message: "Reopt answered in an unexpected shape",
|
|
143
|
+
status: 200
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
...data,
|
|
147
|
+
formId: data.formId,
|
|
148
|
+
name: data.name,
|
|
149
|
+
fields: data.fields,
|
|
150
|
+
submitLabel: typeof data.submitLabel === "string" ? data.submitLabel : null,
|
|
151
|
+
successMessage: typeof data.successMessage === "string" ? data.successMessage : null,
|
|
152
|
+
consent: Array.isArray(data.consent) ? data.consent : []
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
submit: async (formId, submission, requestOptions) => {
|
|
156
|
+
const data = await request(submitUrl(formId), {
|
|
157
|
+
method: "POST",
|
|
158
|
+
headers: {
|
|
159
|
+
Accept: "application/json",
|
|
160
|
+
"Content-Type": "application/json"
|
|
161
|
+
},
|
|
162
|
+
body: JSON.stringify({
|
|
163
|
+
values: submission.values,
|
|
164
|
+
...submission.consents ? { consents: submission.consents } : {},
|
|
165
|
+
...submission.meta ? { meta: submission.meta } : {}
|
|
166
|
+
})
|
|
167
|
+
}, requestOptions?.signal);
|
|
168
|
+
return {
|
|
169
|
+
submissionId: typeof data.submissionId === "string" ? data.submissionId : null,
|
|
170
|
+
successMessage: typeof data.successMessage === "string" ? data.successMessage : null
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function answerText(value, options) {
|
|
176
|
+
if (value === null || value === void 0) return "";
|
|
177
|
+
if (Array.isArray(value)) return value.map((item) => answerText(item, options)).filter(Boolean).join(", ");
|
|
178
|
+
if (typeof value === "boolean") return value ? "예" : "아니오";
|
|
179
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
180
|
+
const raw = String(value);
|
|
181
|
+
return options?.find((option) => option.value === raw)?.label ?? raw;
|
|
182
|
+
}
|
|
183
|
+
if (isRecord(value)) {
|
|
184
|
+
if (typeof value.name === "string") return value.name;
|
|
185
|
+
if (typeof value.url === "string") return value.url;
|
|
186
|
+
}
|
|
187
|
+
return JSON.stringify(value);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* 제출된 답(`answers`)에 폼의 라벨을 붙인다 — 관리 화면이 필드 이름을 손으로 적지 않게.
|
|
191
|
+
* 순서는 폼의 필드 순서이고, 폼에 없는 키의 답은 뒤에 붙는다(지운 필드의 옛 답을 숨기지 않는다).
|
|
192
|
+
* 비어 있는 답은 뺀다.
|
|
193
|
+
*
|
|
194
|
+
* ```ts
|
|
195
|
+
* const form = await forms.get(inquiry.formId);
|
|
196
|
+
* labelAnswers(form.fields, inquiry.answers).map(({ label, text }) => …);
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
function labelAnswers(fields, answers) {
|
|
200
|
+
const rows = [];
|
|
201
|
+
const seen = /* @__PURE__ */ new Set();
|
|
202
|
+
const push = (name, label, options) => {
|
|
203
|
+
seen.add(name);
|
|
204
|
+
const value = answers[name];
|
|
205
|
+
const text = answerText(value, options);
|
|
206
|
+
if (text === "") return;
|
|
207
|
+
rows.push({
|
|
208
|
+
name,
|
|
209
|
+
label,
|
|
210
|
+
value,
|
|
211
|
+
text
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
for (const field of fields) push(field.name, field.label, field.options);
|
|
215
|
+
for (const name of Object.keys(answers)) if (!seen.has(name)) push(name, name, void 0);
|
|
216
|
+
return rows;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
//#endregion
|
|
220
|
+
export { PublicFormError, REOPT_STUDIO_URL, createPublicFormClient, isPublicFormError, labelAnswers };
|
|
221
|
+
//# sourceMappingURL=forms.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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
|
|
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";
|
|
5
6
|
import { a as REOPT_PLATFORM_URLS, c as resolvePlatformUrls, i as REOPT_PLATFORM_ID_URLS, n as PlatformUrls } from "./urls-DiYp_PHg.js";
|
|
6
|
-
import { $ as PlatformStageColor, A as PlatformEavSchemaApplyResult, At as platformOAuthClientUpsertInputSchema, B as PlatformOAuthClientUpsertInput, Bt as platformPublishedPostSummarySchema, C as PlatformBrandappUpsertInput, Ct as platformErrorSchema, D as PlatformEavDataType, Dt as platformMeSchema, E as PlatformEavBrandappResources, Et as platformLockReleasedSchema, F as PlatformManagedBy, Ft as platformPipelineUpsertInputSchema, G as PlatformPipelineUpsertInput, Gt as platformTaskStageInputSchema, H as PlatformPipelineImportInput, Ht as platformResourcesSchema, I as PlatformMe, It as platformPublishedPostDetailQuerySchema, J as PlatformPublishedPostListOptions, Jt as platformWebhookResourceSchema, K as PlatformPublishedPost, Kt as platformTaskStageSchema, L as PlatformOAuthClientImportInput, Lt as platformPublishedPostListQuerySchema, M as PlatformErrorBody, Mt as platformPipelineResourceSchema, N as PlatformLockAcquired, Nt as platformPipelineSchema, O as PlatformEavEntityResource, Ot as platformOAuthClientImportInputSchema, P as PlatformLockReleased, Pt as platformPipelineStageInputSchema, Q as PlatformResourcesV2, Qt as platformWriteMetaSchema, R as PlatformOAuthClientPurpose, Rt as platformPublishedPostPageSchema, S as PlatformBrandappResource, St as platformEavSchemaOperationSchema, T as PlatformDomainStatus, Tt as platformLockAcquiredSchema, U as PlatformPipelineResource, Ut as platformResourcesV2Schema, V as PlatformPipeline, Vt as platformResourceKeySchema, W as PlatformPipelineStageInput, Wt as platformTaskSchema, X as PlatformPublishedPostSummary, Xt as platformWebhookUpsertInputSchema, Y as PlatformPublishedPostPage, Yt as platformWebhookSchema, Z as PlatformResources, Zt as platformWorkTaskStageChangedEventSchema, _ as PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, _t as platformCustomerUpsertInputSchema, a as createPlatformClient, at as PlatformTaskUpsertInput, b as PlatformBrandResource, bt as platformEavSchemaApplyInputSchema, c as PLATFORM_DOMAIN_STATUSES, ct as PlatformWebhookTrigger, d as PLATFORM_OAUTH_APPLICATION_TYPES, dt as PlatformWriteMeta, et as PlatformTask, f as PLATFORM_OAUTH_CLIENT_PURPOSES, ft as platformBrandImportInputSchema, g as PLATFORM_TASK_PRIORITIES, gt as platformBrandappUpsertInputSchema, h as PLATFORM_TASK_OUTCOMES, ht as platformBrandappResourceSchema, i as PlatformWriteResult, it as PlatformTaskStageInput, j as PlatformEavSchemaOperation, jt as platformPipelineImportInputSchema, k as PlatformEavSchemaApplyInput, kt as platformOAuthClientResourceSchema, l as PLATFORM_EAV_DATA_TYPES, lt as PlatformWebhookUpsertInput, m as PLATFORM_STAGE_COLORS, mt as platformBrandUpsertInputSchema, n as PlatformClient, nt as PlatformTaskPriority, o as PLATFORM_ADMIN_SCOPE, ot as PlatformWebhook, p as PLATFORM_OAUTH_GRANT_TYPES, pt as platformBrandResourceSchema, q as PlatformPublishedPostGetOptions, qt as platformTaskUpsertInputSchema, r as PlatformClientConfig, rt as PlatformTaskStage, s as PLATFORM_BRANDAPP_STATUSES, st as PlatformWebhookResource, t as DEFAULT_PLATFORM_SCOPES, tt as PlatformTaskOutcome, u as PLATFORM_MANAGED_BY_VALUES, ut as PlatformWorkTaskStageChangedEvent, v as PLATFORM_WEBHOOK_TRIGGERS, vt as platformEavBrandappResourcesSchema, w as PlatformCustomerUpsertInput, wt as platformExternalIdSchema, x as PlatformBrandUpsertInput, xt as platformEavSchemaApplyResultSchema, y as PlatformBrandImportInput, yt as platformEavEntityResourceSchema, z as PlatformOAuthClientResource, zt as platformPublishedPostSchema } from "./client-
|
|
7
|
-
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, type ConnectAccessToken, type ConnectAnswerValue, type ConnectBrand, type ConnectClient, type ConnectClientConfig, 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 ConnectMe, type ConnectMember, type ConnectMemberRole, 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 ConnectTaskCreateInput, type ConnectTaskListQuery, type ConnectTaskMoveInput, type ConnectTaskPriority, type ConnectTaskSortField, type ConnectTaskUpdateInput, type ConnectWorkspaceTier, DEFAULT_PLATFORM_SCOPES, PLATFORM_ADMIN_SCOPE, PLATFORM_BRANDAPP_STATUSES, PLATFORM_DOMAIN_STATUSES, PLATFORM_EAV_DATA_TYPES, PLATFORM_ERROR_CODES, PLATFORM_MANAGED_BY_VALUES, PLATFORM_OAUTH_APPLICATION_TYPES, PLATFORM_OAUTH_CLIENT_PURPOSES, PLATFORM_OAUTH_GRANT_TYPES, PLATFORM_STAGE_COLORS, PLATFORM_TASK_OUTCOMES, PLATFORM_TASK_PRIORITIES, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, PLATFORM_WEBHOOK_TRIGGERS, type Page, type PageQuery, PlatformApiError, type PlatformBrandImportInput, type PlatformBrandResource, type PlatformBrandUpsertInput, type PlatformBrandappResource, type PlatformBrandappUpsertInput, type PlatformClient, type PlatformClientConfig, type PlatformCustomerUpsertInput, type PlatformDomainStatus, type PlatformEavBrandappResources, type PlatformEavDataType, type PlatformEavEntityResource, type PlatformEavSchemaApplyInput, type PlatformEavSchemaApplyResult, type PlatformEavSchemaOperation, type PlatformErrorBody, type PlatformErrorCode, type PlatformFieldError, type PlatformLockAcquired, type PlatformLockReleased, type PlatformManagedBy, type PlatformMe, type PlatformOAuthClientImportInput, type PlatformOAuthClientPurpose, type PlatformOAuthClientResource, type PlatformOAuthClientUpsertInput, type PlatformPipeline, type PlatformPipelineImportInput, type PlatformPipelineResource, type PlatformPipelineStageInput, type PlatformPipelineUpsertInput, type PlatformPublishedPost, type PlatformPublishedPostGetOptions, type PlatformPublishedPostListOptions, type PlatformPublishedPostPage, type PlatformPublishedPostSummary, type PlatformResources, type PlatformResourcesV2, type PlatformSdkErrorCode, type PlatformServerErrorCode, type PlatformStageColor, type PlatformTask, type PlatformTaskOutcome, type PlatformTaskPriority, type PlatformTaskStage, type PlatformTaskStageInput, type PlatformTaskUpsertInput, type PlatformUrls, type PlatformWebhook, type PlatformWebhookResource, type PlatformWebhookTrigger, type PlatformWebhookUpsertInput, type PlatformWorkTaskStageChangedEvent, type PlatformWriteMeta, type PlatformWriteResult, REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, SDK_ERROR_CODES, type SortOf, WORKSPACE_PERMISSION_KEYS, type WorkspacePermissionKey, can, canAll, canAny, canCall, connectBrandSchema, connectEavEntitySchema, connectEavRecordSchema, connectFileSchema, connectFileUsageSchema, connectFolderSchema, connectFormSchema, connectInquiryDetailSchema, connectInquirySchema, connectMeSchema, connectMemberSchema, connectPipelineSchema, connectPostGroupSchema, connectPostSchema, connectPostSummarySchema, connectPostTagSchema, connectTaskSchema, createConnectClient, createPlatformClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll, platformBrandImportInputSchema, platformBrandResourceSchema, platformBrandUpsertInputSchema, platformBrandappResourceSchema, platformBrandappUpsertInputSchema, platformCustomerUpsertInputSchema, platformEavBrandappResourcesSchema, platformEavEntityResourceSchema, platformEavSchemaApplyInputSchema, platformEavSchemaApplyResultSchema, platformEavSchemaOperationSchema, platformErrorSchema, platformExternalIdSchema, platformLockAcquiredSchema, platformLockReleasedSchema, platformMeSchema, platformOAuthClientImportInputSchema, platformOAuthClientResourceSchema, platformOAuthClientUpsertInputSchema, platformPipelineImportInputSchema, platformPipelineResourceSchema, platformPipelineSchema, platformPipelineStageInputSchema, platformPipelineUpsertInputSchema, platformPublishedPostDetailQuerySchema, platformPublishedPostListQuerySchema, platformPublishedPostPageSchema, platformPublishedPostSchema, platformPublishedPostSummarySchema, platformResourceKeySchema, platformResourcesSchema, platformResourcesV2Schema, platformTaskSchema, platformTaskStageInputSchema, platformTaskStageSchema, platformTaskUpsertInputSchema, platformWebhookResourceSchema, platformWebhookSchema, platformWebhookUpsertInputSchema, platformWorkTaskStageChangedEventSchema, platformWriteMetaSchema, resolvePlatformUrls };
|
|
7
|
+
import { $ as PlatformStageColor, A as PlatformEavSchemaApplyResult, At as platformOAuthClientUpsertInputSchema, B as PlatformOAuthClientUpsertInput, Bt as platformPublishedPostSummarySchema, C as PlatformBrandappUpsertInput, Ct as platformErrorSchema, D as PlatformEavDataType, Dt as platformMeSchema, E as PlatformEavBrandappResources, Et as platformLockReleasedSchema, F as PlatformManagedBy, Ft as platformPipelineUpsertInputSchema, G as PlatformPipelineUpsertInput, Gt as platformTaskStageInputSchema, H as PlatformPipelineImportInput, Ht as platformResourcesSchema, I as PlatformMe, It as platformPublishedPostDetailQuerySchema, J as PlatformPublishedPostListOptions, Jt as platformWebhookResourceSchema, K as PlatformPublishedPost, Kt as platformTaskStageSchema, L as PlatformOAuthClientImportInput, Lt as platformPublishedPostListQuerySchema, M as PlatformErrorBody, Mt as platformPipelineResourceSchema, N as PlatformLockAcquired, Nt as platformPipelineSchema, O as PlatformEavEntityResource, Ot as platformOAuthClientImportInputSchema, P as PlatformLockReleased, Pt as platformPipelineStageInputSchema, Q as PlatformResourcesV2, Qt as platformWriteMetaSchema, R as PlatformOAuthClientPurpose, Rt as platformPublishedPostPageSchema, S as PlatformBrandappResource, St as platformEavSchemaOperationSchema, T as PlatformDomainStatus, Tt as platformLockAcquiredSchema, U as PlatformPipelineResource, Ut as platformResourcesV2Schema, V as PlatformPipeline, Vt as platformResourceKeySchema, W as PlatformPipelineStageInput, Wt as platformTaskSchema, X as PlatformPublishedPostSummary, Xt as platformWebhookUpsertInputSchema, Y as PlatformPublishedPostPage, Yt as platformWebhookSchema, Z as PlatformResources, Zt as platformWorkTaskStageChangedEventSchema, _ as PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, _t as platformCustomerUpsertInputSchema, a as createPlatformClient, at as PlatformTaskUpsertInput, b as PlatformBrandResource, bt as platformEavSchemaApplyInputSchema, c as PLATFORM_DOMAIN_STATUSES, ct as PlatformWebhookTrigger, d as PLATFORM_OAUTH_APPLICATION_TYPES, dt as PlatformWriteMeta, et as PlatformTask, f as PLATFORM_OAUTH_CLIENT_PURPOSES, ft as platformBrandImportInputSchema, g as PLATFORM_TASK_PRIORITIES, gt as platformBrandappUpsertInputSchema, h as PLATFORM_TASK_OUTCOMES, ht as platformBrandappResourceSchema, i as PlatformWriteResult, it as PlatformTaskStageInput, j as PlatformEavSchemaOperation, jt as platformPipelineImportInputSchema, k as PlatformEavSchemaApplyInput, kt as platformOAuthClientResourceSchema, l as PLATFORM_EAV_DATA_TYPES, lt as PlatformWebhookUpsertInput, m as PLATFORM_STAGE_COLORS, mt as platformBrandUpsertInputSchema, n as PlatformClient, nt as PlatformTaskPriority, o as PLATFORM_ADMIN_SCOPE, ot as PlatformWebhook, p as PLATFORM_OAUTH_GRANT_TYPES, pt as platformBrandResourceSchema, q as PlatformPublishedPostGetOptions, qt as platformTaskUpsertInputSchema, r as PlatformClientConfig, rt as PlatformTaskStage, s as PLATFORM_BRANDAPP_STATUSES, st as PlatformWebhookResource, t as DEFAULT_PLATFORM_SCOPES, tt as PlatformTaskOutcome, u as PLATFORM_MANAGED_BY_VALUES, ut as PlatformWorkTaskStageChangedEvent, v as PLATFORM_WEBHOOK_TRIGGERS, vt as platformEavBrandappResourcesSchema, w as PlatformCustomerUpsertInput, wt as platformExternalIdSchema, x as PlatformBrandUpsertInput, xt as platformEavSchemaApplyResultSchema, y as PlatformBrandImportInput, yt as platformEavEntityResourceSchema, z as PlatformOAuthClientResource, zt as platformPublishedPostSchema } from "./client-olMIaJZH.js";
|
|
8
|
+
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, DEFAULT_PLATFORM_SCOPES, type MentionSegment, PLATFORM_ADMIN_SCOPE, PLATFORM_BRANDAPP_STATUSES, PLATFORM_DOMAIN_STATUSES, PLATFORM_EAV_DATA_TYPES, PLATFORM_ERROR_CODES, PLATFORM_MANAGED_BY_VALUES, PLATFORM_OAUTH_APPLICATION_TYPES, PLATFORM_OAUTH_CLIENT_PURPOSES, PLATFORM_OAUTH_GRANT_TYPES, PLATFORM_STAGE_COLORS, PLATFORM_TASK_OUTCOMES, PLATFORM_TASK_PRIORITIES, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, PLATFORM_WEBHOOK_TRIGGERS, type Page, type PageQuery, PlatformApiError, type PlatformBrandImportInput, type PlatformBrandResource, type PlatformBrandUpsertInput, type PlatformBrandappResource, type PlatformBrandappUpsertInput, type PlatformClient, type PlatformClientConfig, type PlatformCustomerUpsertInput, type PlatformDomainStatus, type PlatformEavBrandappResources, type PlatformEavDataType, type PlatformEavEntityResource, type PlatformEavSchemaApplyInput, type PlatformEavSchemaApplyResult, type PlatformEavSchemaOperation, type PlatformErrorBody, type PlatformErrorCode, type PlatformFieldError, type PlatformLockAcquired, type PlatformLockReleased, type PlatformManagedBy, type PlatformMe, type PlatformOAuthClientImportInput, type PlatformOAuthClientPurpose, type PlatformOAuthClientResource, type PlatformOAuthClientUpsertInput, type PlatformPipeline, type PlatformPipelineImportInput, type PlatformPipelineResource, type PlatformPipelineStageInput, type PlatformPipelineUpsertInput, type PlatformPublishedPost, type PlatformPublishedPostGetOptions, type PlatformPublishedPostListOptions, type PlatformPublishedPostPage, type PlatformPublishedPostSummary, type PlatformResources, type PlatformResourcesV2, type PlatformSdkErrorCode, type PlatformServerErrorCode, type PlatformStageColor, type PlatformTask, type PlatformTaskOutcome, type PlatformTaskPriority, type PlatformTaskStage, type PlatformTaskStageInput, type PlatformTaskUpsertInput, type PlatformUrls, type PlatformWebhook, type PlatformWebhookResource, type PlatformWebhookTrigger, type PlatformWebhookUpsertInput, type PlatformWorkTaskStageChangedEvent, type PlatformWriteMeta, type PlatformWriteResult, REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, 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, createPlatformClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll, mentionToken, platformBrandImportInputSchema, platformBrandResourceSchema, platformBrandUpsertInputSchema, platformBrandappResourceSchema, platformBrandappUpsertInputSchema, platformCustomerUpsertInputSchema, platformEavBrandappResourcesSchema, platformEavEntityResourceSchema, platformEavSchemaApplyInputSchema, platformEavSchemaApplyResultSchema, platformEavSchemaOperationSchema, platformErrorSchema, platformExternalIdSchema, platformLockAcquiredSchema, platformLockReleasedSchema, platformMeSchema, platformOAuthClientImportInputSchema, platformOAuthClientResourceSchema, platformOAuthClientUpsertInputSchema, platformPipelineImportInputSchema, platformPipelineResourceSchema, platformPipelineSchema, platformPipelineStageInputSchema, platformPipelineUpsertInputSchema, platformPublishedPostDetailQuerySchema, platformPublishedPostListQuerySchema, platformPublishedPostPageSchema, platformPublishedPostSchema, platformPublishedPostSummarySchema, platformResourceKeySchema, platformResourcesSchema, platformResourcesV2Schema, platformTaskSchema, platformTaskStageInputSchema, platformTaskStageSchema, platformTaskUpsertInputSchema, platformWebhookResourceSchema, platformWebhookSchema, platformWebhookUpsertInputSchema, platformWorkTaskStageChangedEventSchema, platformWriteMetaSchema, resolvePlatformUrls, splitMentions };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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 { REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, resolvePlatformUrls } from "./urls.js";
|
|
3
3
|
import { $ as platformWorkTaskStageChangedEventSchema, A as platformOAuthClientImportInputSchema, B as platformPublishedPostPageSchema, C as platformEavSchemaApplyResultSchema, D as platformLockAcquiredSchema, E as platformExternalIdSchema, F as platformPipelineSchema, G as platformResourcesV2Schema, H as platformPublishedPostSummarySchema, I as platformPipelineStageInputSchema, J as platformTaskStageSchema, K as platformTaskSchema, L as platformPipelineUpsertInputSchema, M as platformOAuthClientUpsertInputSchema, N as platformPipelineImportInputSchema, O as platformLockReleasedSchema, P as platformPipelineResourceSchema, Q as platformWebhookUpsertInputSchema, R as platformPublishedPostDetailQuerySchema, S as platformEavSchemaApplyInputSchema, T as platformErrorSchema, U as platformResourceKeySchema, V as platformPublishedPostSchema, W as platformResourcesSchema, X as platformWebhookResourceSchema, Y as platformTaskUpsertInputSchema, Z as platformWebhookSchema, _ as platformBrandappResourceSchema, a as PLATFORM_MANAGED_BY_VALUES, b as platformEavBrandappResourcesSchema, c as PLATFORM_OAUTH_GRANT_TYPES, d as PLATFORM_TASK_PRIORITIES, et as platformWriteMetaSchema, f as PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, g as platformBrandUpsertInputSchema, h as platformBrandResourceSchema, i as PLATFORM_EAV_DATA_TYPES, j as platformOAuthClientResourceSchema, k as platformMeSchema, l as PLATFORM_STAGE_COLORS, m as platformBrandImportInputSchema, n as PLATFORM_BRANDAPP_STATUSES, o as PLATFORM_OAUTH_APPLICATION_TYPES, p as PLATFORM_WEBHOOK_TRIGGERS, q as platformTaskStageInputSchema, r as PLATFORM_DOMAIN_STATUSES, s as PLATFORM_OAUTH_CLIENT_PURPOSES, t as PLATFORM_ADMIN_SCOPE, u as PLATFORM_TASK_OUTCOMES, v as platformBrandappUpsertInputSchema, w as platformEavSchemaOperationSchema, x as platformEavEntityResourceSchema, y as platformCustomerUpsertInputSchema, z as platformPublishedPostListQuerySchema } from "./schemas-eWh_FUfh.js";
|
|
4
|
-
import { n as createPlatformClient, t as DEFAULT_PLATFORM_SCOPES } from "./client-
|
|
4
|
+
import { n as createPlatformClient, t as DEFAULT_PLATFORM_SCOPES } from "./client-BX4VHJS6.js";
|
|
5
5
|
import { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, WORKSPACE_PERMISSION_KEYS, can, canAll, canAny, canCall } from "./permissions.js";
|
|
6
|
-
import {
|
|
6
|
+
import { mentionToken, splitMentions } from "./mentions.js";
|
|
7
|
+
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";
|
|
7
8
|
|
|
8
|
-
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, DEFAULT_PLATFORM_SCOPES, PLATFORM_ADMIN_SCOPE, PLATFORM_BRANDAPP_STATUSES, PLATFORM_DOMAIN_STATUSES, PLATFORM_EAV_DATA_TYPES, PLATFORM_ERROR_CODES, PLATFORM_MANAGED_BY_VALUES, PLATFORM_OAUTH_APPLICATION_TYPES, PLATFORM_OAUTH_CLIENT_PURPOSES, PLATFORM_OAUTH_GRANT_TYPES, PLATFORM_STAGE_COLORS, PLATFORM_TASK_OUTCOMES, PLATFORM_TASK_PRIORITIES, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, PLATFORM_WEBHOOK_TRIGGERS, PlatformApiError, REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, 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, createPlatformClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll, platformBrandImportInputSchema, platformBrandResourceSchema, platformBrandUpsertInputSchema, platformBrandappResourceSchema, platformBrandappUpsertInputSchema, platformCustomerUpsertInputSchema, platformEavBrandappResourcesSchema, platformEavEntityResourceSchema, platformEavSchemaApplyInputSchema, platformEavSchemaApplyResultSchema, platformEavSchemaOperationSchema, platformErrorSchema, platformExternalIdSchema, platformLockAcquiredSchema, platformLockReleasedSchema, platformMeSchema, platformOAuthClientImportInputSchema, platformOAuthClientResourceSchema, platformOAuthClientUpsertInputSchema, platformPipelineImportInputSchema, platformPipelineResourceSchema, platformPipelineSchema, platformPipelineStageInputSchema, platformPipelineUpsertInputSchema, platformPublishedPostDetailQuerySchema, platformPublishedPostListQuerySchema, platformPublishedPostPageSchema, platformPublishedPostSchema, platformPublishedPostSummarySchema, platformResourceKeySchema, platformResourcesSchema, platformResourcesV2Schema, platformTaskSchema, platformTaskStageInputSchema, platformTaskStageSchema, platformTaskUpsertInputSchema, platformWebhookResourceSchema, platformWebhookSchema, platformWebhookUpsertInputSchema, platformWorkTaskStageChangedEventSchema, platformWriteMetaSchema, resolvePlatformUrls };
|
|
9
|
+
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, DEFAULT_PLATFORM_SCOPES, PLATFORM_ADMIN_SCOPE, PLATFORM_BRANDAPP_STATUSES, PLATFORM_DOMAIN_STATUSES, PLATFORM_EAV_DATA_TYPES, PLATFORM_ERROR_CODES, PLATFORM_MANAGED_BY_VALUES, PLATFORM_OAUTH_APPLICATION_TYPES, PLATFORM_OAUTH_CLIENT_PURPOSES, PLATFORM_OAUTH_GRANT_TYPES, PLATFORM_STAGE_COLORS, PLATFORM_TASK_OUTCOMES, PLATFORM_TASK_PRIORITIES, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, PLATFORM_WEBHOOK_TRIGGERS, PlatformApiError, REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, 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, createPlatformClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll, mentionToken, platformBrandImportInputSchema, platformBrandResourceSchema, platformBrandUpsertInputSchema, platformBrandappResourceSchema, platformBrandappUpsertInputSchema, platformCustomerUpsertInputSchema, platformEavBrandappResourcesSchema, platformEavEntityResourceSchema, platformEavSchemaApplyInputSchema, platformEavSchemaApplyResultSchema, platformEavSchemaOperationSchema, platformErrorSchema, platformExternalIdSchema, platformLockAcquiredSchema, platformLockReleasedSchema, platformMeSchema, platformOAuthClientImportInputSchema, platformOAuthClientResourceSchema, platformOAuthClientUpsertInputSchema, platformPipelineImportInputSchema, platformPipelineResourceSchema, platformPipelineSchema, platformPipelineStageInputSchema, platformPipelineUpsertInputSchema, platformPublishedPostDetailQuerySchema, platformPublishedPostListQuerySchema, platformPublishedPostPageSchema, platformPublishedPostSchema, platformPublishedPostSummarySchema, platformResourceKeySchema, platformResourcesSchema, platformResourcesV2Schema, platformTaskSchema, platformTaskStageInputSchema, platformTaskStageSchema, platformTaskUpsertInputSchema, platformWebhookResourceSchema, platformWebhookSchema, platformWebhookUpsertInputSchema, platformWorkTaskStageChangedEventSchema, platformWriteMetaSchema, resolvePlatformUrls, splitMentions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as ClientPrivateJwk, r as ClientKeyRing } from "../keys-
|
|
1
|
+
import { i as ClientPrivateJwk, r as ClientKeyRing } from "../keys-BXkGh0VM.js";
|
|
2
2
|
import { n as PlatformUrls } from "../urls-DiYp_PHg.js";
|
|
3
|
-
import { Ft as platformPipelineUpsertInputSchema, f as PLATFORM_OAUTH_CLIENT_PURPOSES, gt as platformBrandappUpsertInputSchema, mt as platformBrandUpsertInputSchema, v as PLATFORM_WEBHOOK_TRIGGERS } from "../client-
|
|
4
|
-
import { t as MachineClient } from "../client-
|
|
3
|
+
import { Ft as platformPipelineUpsertInputSchema, f as PLATFORM_OAUTH_CLIENT_PURPOSES, gt as platformBrandappUpsertInputSchema, mt as platformBrandUpsertInputSchema, v as PLATFORM_WEBHOOK_TRIGGERS } from "../client-olMIaJZH.js";
|
|
4
|
+
import { t as MachineClient } from "../client-DVozA5Ep.js";
|
|
5
5
|
import * as jose from "jose";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/installation/schema.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { l as SDK_VERSION, n as PlatformApiError } from "../errors-
|
|
1
|
+
import { l as SDK_VERSION, n as PlatformApiError } from "../errors-DKMC4kId.js";
|
|
2
2
|
import { resolvePlatformUrls } from "../urls.js";
|
|
3
|
-
import { o as readClientKeyRing } from "../keys
|
|
4
|
-
import { r as createMachineClient } from "../client-
|
|
3
|
+
import { o as readClientKeyRing } from "../keys--ef_VwZ-.js";
|
|
4
|
+
import { r as createMachineClient } from "../client-BLaFMBbS.js";
|
|
5
5
|
import { L as platformPipelineUpsertInputSchema, T as platformErrorSchema, U as platformResourceKeySchema, g as platformBrandUpsertInputSchema, p as PLATFORM_WEBHOOK_TRIGGERS, s as PLATFORM_OAUTH_CLIENT_PURPOSES, v as platformBrandappUpsertInputSchema } from "../schemas-eWh_FUfh.js";
|
|
6
6
|
import * as jose from "jose";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -5,9 +5,10 @@ import * as jose from "jose";
|
|
|
5
5
|
* 기계 클라이언트 키 자재 (RFC-0034 §3.3) — 생성 · 공개키 추출 · JWKS 문서 · env 읽기.
|
|
6
6
|
*
|
|
7
7
|
* 서브 제품은 키쌍을 **자기 쪽에서** 만들고 개인키는 env(`REOPT_CLIENT_PRIVATE_KEY_JWK`)에만 둔다.
|
|
8
|
-
* 리옵트에는 공개키 주소(`jwksUri`)만 등록되므로 비밀이 전송되는 순간이 없다. 회전은
|
|
9
|
-
* ① `REOPT_CLIENT_PRIVATE_KEY_JWK_NEXT`에 새 키를
|
|
10
|
-
* ② 리옵트가 새
|
|
8
|
+
* 리옵트에는 공개키 주소(`jwksUri`)만 등록되므로 비밀이 전송되는 순간이 없다. 회전은 3단계다:
|
|
9
|
+
* ① `REOPT_CLIENT_PRIVATE_KEY_JWK_NEXT`에 새 키를 둔다 — JWKS에 두 키가 실린다. **서명은 그대로 현재 키다**
|
|
10
|
+
* ② 리옵트가 새 키를 알게 한다(콘솔 연동 상세의 "키 바꾸기", 또는 하루 한 번의 점검 — `jwksUri`를 직접 읽는 클라이언트는 5분)
|
|
11
|
+
* ③ NEXT를 본 키로 승격하고 옛 키를 지운다 — 이때부터 새 키로 서명한다. 옛 키는 JWKS에서 사라져 죽는다.
|
|
11
12
|
*
|
|
12
13
|
* 🔑 kid는 **JWK 지문(RFC 7638)**이다 — 사람이 이름을 짓지 않고, 같은 키는 어디서 만들어도 같은 kid다.
|
|
13
14
|
*/
|
|
@@ -86,7 +87,7 @@ function readClientKeyRing(env = typeof process === "undefined" ? {} : process.e
|
|
|
86
87
|
const next = nextRaw ? parseClientPrivateJwk(nextRaw, nextName) : null;
|
|
87
88
|
if (next && next.kid === current.kid) throw new Error(`[@reopt-ai/workspace-sdk/machine] ${nextName} has the same kid as ${currentName} — generate a new key for rotation`);
|
|
88
89
|
return {
|
|
89
|
-
signing:
|
|
90
|
+
signing: current,
|
|
90
91
|
published: next ? [current, next] : [current]
|
|
91
92
|
};
|
|
92
93
|
}
|
|
@@ -99,4 +100,4 @@ const CLIENT_JWKS_PATH = "/.well-known/reopt-client-jwks.json";
|
|
|
99
100
|
|
|
100
101
|
//#endregion
|
|
101
102
|
export { parseClientPrivateJwk as a, generateClientKeyPair as i, DEFAULT_CLIENT_KEY_ALGORITHM as n, readClientKeyRing as o, buildClientJwks as r, toPublicJwk as s, CLIENT_JWKS_PATH as t };
|
|
102
|
-
//# sourceMappingURL=keys
|
|
103
|
+
//# sourceMappingURL=keys--ef_VwZ-.js.map
|
|
@@ -20,7 +20,15 @@ declare function toPublicJwk(privateKeyJwk: ClientPrivateJwk): ClientPublicJwk;
|
|
|
20
20
|
/** JSON 문자열(env 값)을 개인키 JWK로 — 모양이 틀리면 **어디가** 틀렸는지 말하고 값은 절대 되풀이하지 않는다. */
|
|
21
21
|
declare function parseClientPrivateJwk(raw: string, envName?: string): ClientPrivateJwk;
|
|
22
22
|
type ClientKeyRing = {
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* 서명에 쓰는 키 — **언제나 현재 키**다. NEXT는 게시만 한다.
|
|
25
|
+
*
|
|
26
|
+
* 🔴 0.1.0-rc.11까지는 NEXT가 있으면 NEXT로 서명했다 — 플랫폼 콘솔의 회전 안내("서명은 아직 지금 키로 합니다")와 반대였다.
|
|
27
|
+
* 리옵트가 앱의 공개키를 **등록해 두는** 연결(워크스페이스 앱 — RFC-0043 §8 Q6)은 등록되지 않은 키의 서명을 앱의
|
|
28
|
+
* `jwks_uri`를 다시 읽어 확인하는데, 그 경로는 리옵트가 신뢰하는 도메인만 지난다. 고객 자기 도메인의 앱은 새 키가
|
|
29
|
+
* 등록되기 전(콘솔의 "공개키 다시 읽기" 또는 하루 한 번의 점검 전)까지 토큰을 받지 못할 수 있었다(코드로 확인, 미실측).
|
|
30
|
+
* 현재 키로 서명하면 새 키가 등록될 때까지 아무것도 달라지지 않는다.
|
|
31
|
+
*/
|
|
24
32
|
signing: ClientPrivateJwk;
|
|
25
33
|
/** JWKS에 실을 키 전부(현재 + NEXT). */
|
|
26
34
|
published: ClientPrivateJwk[];
|
|
@@ -41,4 +49,4 @@ declare function buildClientJwks(keys: readonly ClientPrivateJwk[]): {
|
|
|
41
49
|
declare const CLIENT_JWKS_PATH = "/.well-known/reopt-client-jwks.json";
|
|
42
50
|
//#endregion
|
|
43
51
|
export { ClientPublicJwk as a, generateClientKeyPair as c, toPublicJwk as d, ClientPrivateJwk as i, parseClientPrivateJwk as l, ClientKeyAlgorithm as n, DEFAULT_CLIENT_KEY_ALGORITHM as o, ClientKeyRing as r, buildClientJwks as s, CLIENT_JWKS_PATH as t, readClientKeyRing as u };
|
|
44
|
-
//# sourceMappingURL=keys-
|
|
52
|
+
//# sourceMappingURL=keys-BXkGh0VM.d.ts.map
|
package/dist/machine/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as ClientPublicJwk, c as generateClientKeyPair, d as toPublicJwk, i as ClientPrivateJwk, l as parseClientPrivateJwk, n as ClientKeyAlgorithm, o as DEFAULT_CLIENT_KEY_ALGORITHM, r as ClientKeyRing, s as buildClientJwks, t as CLIENT_JWKS_PATH, u as readClientKeyRing } from "../keys-
|
|
2
|
-
import { a as createDpopProof, i as MachineTokenState, n as MachineClientConfig, o as createMachineClient, r as MachineTokenError, t as MachineClient } from "../client-
|
|
1
|
+
import { a as ClientPublicJwk, c as generateClientKeyPair, d as toPublicJwk, i as ClientPrivateJwk, l as parseClientPrivateJwk, n as ClientKeyAlgorithm, o as DEFAULT_CLIENT_KEY_ALGORITHM, r as ClientKeyRing, s as buildClientJwks, t as CLIENT_JWKS_PATH, u as readClientKeyRing } from "../keys-BXkGh0VM.js";
|
|
2
|
+
import { a as createDpopProof, i as MachineTokenState, n as MachineClientConfig, o as createMachineClient, r as MachineTokenError, t as MachineClient } from "../client-DVozA5Ep.js";
|
|
3
3
|
export { CLIENT_JWKS_PATH, type ClientKeyAlgorithm, type ClientKeyRing, type ClientPrivateJwk, type ClientPublicJwk, DEFAULT_CLIENT_KEY_ALGORITHM, type MachineClient, type MachineClientConfig, MachineTokenError, type MachineTokenState, buildClientJwks, createDpopProof, createMachineClient, generateClientKeyPair, parseClientPrivateJwk, readClientKeyRing, toPublicJwk };
|
package/dist/machine/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as parseClientPrivateJwk, i as generateClientKeyPair, n as DEFAULT_CLIENT_KEY_ALGORITHM, o as readClientKeyRing, r as buildClientJwks, s as toPublicJwk, t as CLIENT_JWKS_PATH } from "../keys
|
|
2
|
-
import { n as createDpopProof, r as createMachineClient, t as MachineTokenError } from "../client-
|
|
1
|
+
import { a as parseClientPrivateJwk, i as generateClientKeyPair, n as DEFAULT_CLIENT_KEY_ALGORITHM, o as readClientKeyRing, r as buildClientJwks, s as toPublicJwk, t as CLIENT_JWKS_PATH } from "../keys--ef_VwZ-.js";
|
|
2
|
+
import { n as createDpopProof, r as createMachineClient, t as MachineTokenError } from "../client-BLaFMBbS.js";
|
|
3
3
|
|
|
4
4
|
export { CLIENT_JWKS_PATH, DEFAULT_CLIENT_KEY_ALGORITHM, MachineTokenError, buildClientJwks, createDpopProof, createMachineClient, generateClientKeyPair, parseClientPrivateJwk, readClientKeyRing, toPublicJwk };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/mentions.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* 댓글 본문에 넣는 멘션 토큰 — `@[이름](member:<id>)`. Studio 댓글과 같은 형식이라 양쪽에서 같게 보이고,
|
|
4
|
+
* 리옵트가 이 토큰으로 알림 대상을 찾는다. 이름의 `]`는 토큰을 깨므로 뺀다.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* await reopt.works.addComment(task.id, `${mentionToken(member)} 확인 부탁드립니다`);
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
declare function mentionToken(member: {
|
|
11
|
+
memberId: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}): string;
|
|
14
|
+
type MentionSegment = {
|
|
15
|
+
type: "text";
|
|
16
|
+
text: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: "mention";
|
|
19
|
+
name: string;
|
|
20
|
+
memberId: string;
|
|
21
|
+
};
|
|
22
|
+
/** 댓글 본문을 글과 멘션으로 나눈다 — 멘션을 강조해 그릴 때. 토큰이 없으면 글 한 조각이다. */
|
|
23
|
+
declare function splitMentions(content: string): MentionSegment[];
|
|
24
|
+
//#endregion
|
|
25
|
+
export { mentionToken as n, splitMentions as r, MentionSegment as t };
|
|
26
|
+
//# sourceMappingURL=mentions-BMI2c7O6.d.ts.map
|
package/dist/mentions.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region src/mentions.ts
|
|
2
|
+
/**
|
|
3
|
+
* `@reopt-ai/workspace-sdk/mentions` — 업무 댓글의 멘션 토큰을 만들고 나눈다.
|
|
4
|
+
*
|
|
5
|
+
* 의존이 없다 — **클라이언트 컴포넌트에서 써도 된다**(입력 중인 댓글의 멘션 미리보기). 같은 함수가 `/connect`와
|
|
6
|
+
* 패키지 루트에서도 나간다.
|
|
7
|
+
*/
|
|
8
|
+
const MENTION = /@\[([^\]]+)\]\(member:([0-9a-fA-F-]{36})\)/g;
|
|
9
|
+
/**
|
|
10
|
+
* 댓글 본문에 넣는 멘션 토큰 — `@[이름](member:<id>)`. Studio 댓글과 같은 형식이라 양쪽에서 같게 보이고,
|
|
11
|
+
* 리옵트가 이 토큰으로 알림 대상을 찾는다. 이름의 `]`는 토큰을 깨므로 뺀다.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* await reopt.works.addComment(task.id, `${mentionToken(member)} 확인 부탁드립니다`);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
function mentionToken(member) {
|
|
18
|
+
return `@[${member.name.replace(/\]/g, "")}](member:${member.memberId})`;
|
|
19
|
+
}
|
|
20
|
+
/** 댓글 본문을 글과 멘션으로 나눈다 — 멘션을 강조해 그릴 때. 토큰이 없으면 글 한 조각이다. */
|
|
21
|
+
function splitMentions(content) {
|
|
22
|
+
const segments = [];
|
|
23
|
+
let last = 0;
|
|
24
|
+
for (const match of content.matchAll(MENTION)) {
|
|
25
|
+
if (match.index > last) segments.push({
|
|
26
|
+
type: "text",
|
|
27
|
+
text: content.slice(last, match.index)
|
|
28
|
+
});
|
|
29
|
+
segments.push({
|
|
30
|
+
type: "mention",
|
|
31
|
+
name: match[1],
|
|
32
|
+
memberId: match[2]
|
|
33
|
+
});
|
|
34
|
+
last = match.index + match[0].length;
|
|
35
|
+
}
|
|
36
|
+
if (last < content.length) segments.push({
|
|
37
|
+
type: "text",
|
|
38
|
+
text: content.slice(last)
|
|
39
|
+
});
|
|
40
|
+
return segments;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { mentionToken, splitMentions };
|
|
45
|
+
//# sourceMappingURL=mentions.js.map
|
|
@@ -22,6 +22,10 @@ type Page<T> = {
|
|
|
22
22
|
/** 조건에 맞는 전체 건수 — 서버가 세는 목록만 싣는다(`customers.list`). 없으면 undefined */
|
|
23
23
|
total?: number;
|
|
24
24
|
};
|
|
25
|
+
/** 전체 건수가 늘 실리는 목록(`customers.list`) */
|
|
26
|
+
type CountedPage<T> = Page<T> & {
|
|
27
|
+
total: number;
|
|
28
|
+
};
|
|
25
29
|
type PageQuery = {
|
|
26
30
|
/** 한 장의 크기 — 자원마다 상한이 있다(넘기면 400) */
|
|
27
31
|
limit?: number;
|
|
@@ -35,13 +39,13 @@ type PageFetcher<T, Q> = (query?: Q) => Promise<Page<T>>;
|
|
|
35
39
|
* 끝까지 훑는 비동기 이터레이터 — 한 장씩 읽으며 항목을 낸다. `maxItems`(기본 10,000)를 넘으면 멈춘다 — 필터를 잘못 준
|
|
36
40
|
* 호출이 워크스페이스 전체를 끌어오지 않게.
|
|
37
41
|
*/
|
|
38
|
-
declare function iterate<T, Q extends PageQuery>(fetchPage: PageFetcher<T, Q>, query?: NoInfer<Omit<Q, "offset">>, options?: {
|
|
42
|
+
declare function iterate<T, Q extends object = PageQuery>(fetchPage: PageFetcher<T, Q>, query?: NoInfer<Omit<Q, "offset">>, options?: {
|
|
39
43
|
maxItems?: number;
|
|
40
44
|
}): AsyncGenerator<T, void, undefined>;
|
|
41
45
|
/** 끝까지 읽어 배열로 — 작은·중간 크기 목록용. 큰 목록은 `iterate`로 흘려 읽는다. */
|
|
42
|
-
declare function listAll<T, Q extends PageQuery>(fetchPage: PageFetcher<T, Q>, query?: NoInfer<Omit<Q, "offset">>, options?: {
|
|
46
|
+
declare function listAll<T, Q extends object = PageQuery>(fetchPage: PageFetcher<T, Q>, query?: NoInfer<Omit<Q, "offset">>, options?: {
|
|
43
47
|
maxItems?: number;
|
|
44
48
|
}): Promise<T[]>;
|
|
45
49
|
//#endregion
|
|
46
|
-
export {
|
|
47
|
-
//# sourceMappingURL=page-
|
|
50
|
+
export { iterate as a, SortOf as i, Page as n, listAll as o, PageQuery as r, CountedPage as t };
|
|
51
|
+
//# sourceMappingURL=page-j1OCu4of.d.ts.map
|