@bstage-sdk/bridge 0.14.2 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -2
- package/dist/{chunk-5OWBSJ6E.js → chunk-QMYFZ7I6.js} +577 -3
- package/dist/frame.d.cts +1 -1
- package/dist/frame.d.ts +1 -1
- package/dist/host.cjs +1110 -141
- package/dist/host.d.cts +83 -4
- package/dist/host.d.ts +83 -4
- package/dist/host.js +531 -136
- package/dist/index.cjs +581 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -1
- package/dist/{messages-Cdjpvu2S.d.cts → messages-_p1yCNj9.d.cts} +91 -4
- package/dist/{messages-Cdjpvu2S.d.ts → messages-_p1yCNj9.d.ts} +91 -4
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BRIDGE_ERROR_CODES,
|
|
1
|
+
export { A as ACCOUNT_SESSION_CAPABILITY, a as AccountHostQuery, b as AccountSpaceInfo, B as BRIDGE_ERROR_CODES, c as BRIDGE_SURFACES, d as BridgeError, e as BridgeErrorCode, f as BridgeErrorLike, g as BridgeEventMap, h as BridgeHostEventType, i as BridgeInit, j as BridgeLimits, k as BridgeRequestMap, l as BridgeRequestType, m as BridgeResult, n as BridgeSurface, o as BridgeTranslations, F as FRAME_UNLOAD_EVENT, p as FetchRequest, q as FetchResult, H as HOST_EVENT_TYPES, I as IFRAME_ATTRIBUTES, r as INIT_RESPONSE, K as KNOWN_CAPABILITIES, L as LogLevel, M as MemberState, N as NavigateOptions, O as OTP_OPS, s as OtpOp, t as OtpPurpose, u as OtpRequest, v as OtpResult, R as READY_EVENT, w as REPORTS_PER_SESSION, x as REPORT_COUNT_MAX, y as REPORT_FRAME_MAX_LENGTH, z as REPORT_MAX_FRAMES, C as REPORT_MESSAGE_MAX_LENGTH, D as REQUEST_TIMEOUT_MS, E as REQUEST_TYPES, G as ReverificationStatus, S as SESSION_OPS, J as SessionOp, P as SessionRequest, Q as SessionResult, T as SlotState, U as StorageOp, V as TEMPLATE_REPORT_KINDS, W as TemplateReport, X as TemplateReportKind, Y as ThemeState, Z as ToastKind, _ as WithSession, $ as isBridgeErrorCode, a0 as isBridgeErrorLike, a1 as isBridgeSurface, a2 as isHostEventType, a3 as isRequestType } from './messages-_p1yCNj9.js';
|
|
2
2
|
export { C as CreateSrcdocOptions, M as MAX_ELEMENT_NAME_LENGTH, a as MAX_MEDIA_ORIGINS, R as REPORT_FLUSH_DELAY_MS, b as buildFrameCsp, c as createNonce, d as createSession, e as createSrcdoc, i as isValidNonce, f as isValidSession } from './createSrcdoc-DYZk6dDJ.js';
|
|
3
3
|
|
|
4
4
|
/** 봉투 버전. 형식이 하위 호환되지 않게 바뀔 때만 올린다. */
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ACCOUNT_SESSION_CAPABILITY,
|
|
2
3
|
BRIDGE_ERROR_CODES,
|
|
3
4
|
BRIDGE_NAMESPACE,
|
|
4
5
|
BRIDGE_SURFACES,
|
|
@@ -8,10 +9,12 @@ import {
|
|
|
8
9
|
HOST_EVENT_TYPES,
|
|
9
10
|
IFRAME_ATTRIBUTES,
|
|
10
11
|
INIT_RESPONSE,
|
|
12
|
+
KNOWN_CAPABILITIES,
|
|
11
13
|
MAX_ELEMENT_NAME_LENGTH,
|
|
12
14
|
MAX_ENVELOPE_ID_LENGTH,
|
|
13
15
|
MAX_ENVELOPE_TYPE_LENGTH,
|
|
14
16
|
MAX_MEDIA_ORIGINS,
|
|
17
|
+
OTP_OPS,
|
|
15
18
|
READY_EVENT,
|
|
16
19
|
REPORTS_PER_SESSION,
|
|
17
20
|
REPORT_COUNT_MAX,
|
|
@@ -21,6 +24,7 @@ import {
|
|
|
21
24
|
REPORT_MESSAGE_MAX_LENGTH,
|
|
22
25
|
REQUEST_TIMEOUT_MS,
|
|
23
26
|
REQUEST_TYPES,
|
|
27
|
+
SESSION_OPS,
|
|
24
28
|
TEMPLATE_REPORT_KINDS,
|
|
25
29
|
buildFrameCsp,
|
|
26
30
|
createEnvelope,
|
|
@@ -36,9 +40,10 @@ import {
|
|
|
36
40
|
isRequestType,
|
|
37
41
|
isValidNonce,
|
|
38
42
|
isValidSession
|
|
39
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-QMYFZ7I6.js";
|
|
40
44
|
import "./chunk-TPKNGW34.js";
|
|
41
45
|
export {
|
|
46
|
+
ACCOUNT_SESSION_CAPABILITY,
|
|
42
47
|
BRIDGE_ERROR_CODES,
|
|
43
48
|
BRIDGE_NAMESPACE,
|
|
44
49
|
BRIDGE_SURFACES,
|
|
@@ -48,10 +53,12 @@ export {
|
|
|
48
53
|
HOST_EVENT_TYPES,
|
|
49
54
|
IFRAME_ATTRIBUTES,
|
|
50
55
|
INIT_RESPONSE,
|
|
56
|
+
KNOWN_CAPABILITIES,
|
|
51
57
|
MAX_ELEMENT_NAME_LENGTH,
|
|
52
58
|
MAX_ENVELOPE_ID_LENGTH,
|
|
53
59
|
MAX_ENVELOPE_TYPE_LENGTH,
|
|
54
60
|
MAX_MEDIA_ORIGINS,
|
|
61
|
+
OTP_OPS,
|
|
55
62
|
READY_EVENT,
|
|
56
63
|
REPORTS_PER_SESSION,
|
|
57
64
|
REPORT_COUNT_MAX,
|
|
@@ -61,6 +68,7 @@ export {
|
|
|
61
68
|
REPORT_MESSAGE_MAX_LENGTH,
|
|
62
69
|
REQUEST_TIMEOUT_MS,
|
|
63
70
|
REQUEST_TYPES,
|
|
71
|
+
SESSION_OPS,
|
|
64
72
|
TEMPLATE_REPORT_KINDS,
|
|
65
73
|
buildFrameCsp,
|
|
66
74
|
createEnvelope,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 브리지 오류 코드. */
|
|
2
|
-
declare const BRIDGE_ERROR_CODES: readonly ["FORBIDDEN_DESTINATION", "FORBIDDEN_METHOD", "BODY_TOO_LARGE", "RATE_LIMITED", "BAD_REQUEST", "TIMEOUT", "NETWORK_ERROR", "UNSUPPORTED"];
|
|
2
|
+
declare const BRIDGE_ERROR_CODES: readonly ["FORBIDDEN_DESTINATION", "FORBIDDEN_METHOD", "BODY_TOO_LARGE", "RATE_LIMITED", "BAD_REQUEST", "TIMEOUT", "NETWORK_ERROR", "UNSUPPORTED", "NOT_ALLOWED"];
|
|
3
3
|
type BridgeErrorCode = (typeof BRIDGE_ERROR_CODES)[number];
|
|
4
4
|
/** 코드가 붙은 브리지 오류. 호스트는 이 코드만 프레임에 돌려준다(내부 예외 메시지는 싣지 않는다). */
|
|
5
5
|
declare class BridgeError extends Error {
|
|
@@ -19,7 +19,7 @@ declare function isBridgeErrorLike(value: unknown): value is BridgeErrorLike;
|
|
|
19
19
|
/** 프레임 요청 타임아웃. */
|
|
20
20
|
declare const REQUEST_TIMEOUT_MS = 15000;
|
|
21
21
|
/** 프레임 → 호스트 요청 종류(브리지 프로토콜 표). */
|
|
22
|
-
declare const REQUEST_TYPES: readonly ["fetch", "navigate", "back", "openExternal", "toast", "resize", "track", "storage", "log", "report"];
|
|
22
|
+
declare const REQUEST_TYPES: readonly ["fetch", "navigate", "back", "openExternal", "toast", "resize", "track", "storage", "log", "report", "session", "otp"];
|
|
23
23
|
type BridgeRequestType = (typeof REQUEST_TYPES)[number];
|
|
24
24
|
/** 호스트 → 프레임 이벤트 종류. */
|
|
25
25
|
declare const HOST_EVENT_TYPES: readonly ["slot.context", "locale", "member", "theme", "visibility"];
|
|
@@ -83,6 +83,85 @@ interface BridgeInit {
|
|
|
83
83
|
readonly limits: BridgeLimits;
|
|
84
84
|
readonly partnerOrigins: readonly string[];
|
|
85
85
|
readonly translations?: BridgeTranslations;
|
|
86
|
+
/** 이 배치에 허용된 기능. 알려진 값만 싣는다(`ACCOUNT_SESSION_CAPABILITY`). 없으면 필드 자체가 없다. */
|
|
87
|
+
readonly capabilities?: readonly string[];
|
|
88
|
+
/** 아래 계정 필드는 `account-session` 권한이 있는 배치에만 실린다. */
|
|
89
|
+
readonly query?: AccountHostQuery;
|
|
90
|
+
/** 호스트의 국가 코드(가입 폼 기본 국가). */
|
|
91
|
+
readonly country?: string;
|
|
92
|
+
readonly space?: AccountSpaceInfo;
|
|
93
|
+
/** 재인증 임시토큰 보관 상태. 토큰 값은 싣지 않는다. */
|
|
94
|
+
readonly reverification?: ReverificationStatus;
|
|
95
|
+
}
|
|
96
|
+
/** 계정 세션 요청(session·otp)을 여는 배치 권한. 호스트가 이 값을 받아야만 처리한다(fail-closed). */
|
|
97
|
+
declare const ACCOUNT_SESSION_CAPABILITY = "account-session";
|
|
98
|
+
/** init.capabilities에 실을 수 있는 값. 그 밖의 값은 버린다. */
|
|
99
|
+
declare const KNOWN_CAPABILITIES: readonly string[];
|
|
100
|
+
/** 호스트 URL 쿼리 중 프레임에 주는 키(허용 목록). OAuth `code`·`state`는 싣지 않는다. */
|
|
101
|
+
interface AccountHostQuery {
|
|
102
|
+
readonly socialType?: string;
|
|
103
|
+
}
|
|
104
|
+
interface AccountSpaceInfo {
|
|
105
|
+
readonly title?: string;
|
|
106
|
+
readonly corporation?: {
|
|
107
|
+
readonly name?: string;
|
|
108
|
+
readonly country?: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
interface ReverificationStatus {
|
|
112
|
+
readonly available: boolean;
|
|
113
|
+
readonly expiresAt?: string;
|
|
114
|
+
}
|
|
115
|
+
/** 호스트가 대신 호출하는 계정 세션 작업. 엔드포인트는 호스트가 고정한다. */
|
|
116
|
+
declare const SESSION_OPS: readonly ["signup", "signupSocial", "loginAfterSignup", "phoneReverify"];
|
|
117
|
+
type SessionOp = (typeof SESSION_OPS)[number];
|
|
118
|
+
/** SMS OTP 작업. 목적(purpose)은 op로 호스트가 고정한다 — 프레임이 고르지 않는다. */
|
|
119
|
+
declare const OTP_OPS: readonly ["sendSignup", "sendPhoneChange", "verifySignup", "verifyPhoneChange"];
|
|
120
|
+
type OtpOp = (typeof OTP_OPS)[number];
|
|
121
|
+
type OtpPurpose = 'SIGNUP' | 'PHONE_CHANGE';
|
|
122
|
+
interface SessionRequest {
|
|
123
|
+
readonly op: SessionOp;
|
|
124
|
+
readonly body: Readonly<Record<string, unknown>>;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* `session` 결과. 토큰·회원 식별자는 싣지 않는다(허용 목록). `next`가 있으면 프레임 SDK가
|
|
128
|
+
* 그 경로로 전체 리로드 이동을 요청한다(호스트가 새 로그인 상태로 페이지를 다시 그리게).
|
|
129
|
+
*/
|
|
130
|
+
interface SessionResult {
|
|
131
|
+
readonly ok: boolean;
|
|
132
|
+
readonly status?: string;
|
|
133
|
+
readonly code?: number;
|
|
134
|
+
readonly message?: string;
|
|
135
|
+
readonly httpStatus?: number;
|
|
136
|
+
/** signup·signupSocial 성공 시 가입 시각. */
|
|
137
|
+
readonly createdAt?: string;
|
|
138
|
+
readonly next?: {
|
|
139
|
+
readonly path: string;
|
|
140
|
+
readonly reload: true;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
interface OtpRequest {
|
|
144
|
+
readonly op: OtpOp;
|
|
145
|
+
readonly body: Readonly<Record<string, unknown>>;
|
|
146
|
+
}
|
|
147
|
+
interface OtpResult {
|
|
148
|
+
readonly ok: boolean;
|
|
149
|
+
/** 게이트웨이 HTTP 상태. 응답을 받지 못했으면 0. */
|
|
150
|
+
readonly status: number;
|
|
151
|
+
readonly data?: Readonly<Record<string, string | number>>;
|
|
152
|
+
readonly error?: {
|
|
153
|
+
readonly code?: string;
|
|
154
|
+
readonly message?: {
|
|
155
|
+
readonly en?: string;
|
|
156
|
+
readonly vi?: string;
|
|
157
|
+
};
|
|
158
|
+
readonly retryAfterSeconds?: number;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/** navigate 옵션. `reload`는 같은 origin 경로로 전체 리로드 이동(로그인 직후 등). */
|
|
162
|
+
interface NavigateOptions {
|
|
163
|
+
readonly replace?: boolean;
|
|
164
|
+
readonly reload?: boolean;
|
|
86
165
|
}
|
|
87
166
|
interface FetchRequest {
|
|
88
167
|
readonly url: string;
|
|
@@ -133,7 +212,7 @@ interface BridgeRequestMap {
|
|
|
133
212
|
navigate: {
|
|
134
213
|
req: {
|
|
135
214
|
readonly path: string;
|
|
136
|
-
};
|
|
215
|
+
} & NavigateOptions;
|
|
137
216
|
res: Record<string, never>;
|
|
138
217
|
};
|
|
139
218
|
back: {
|
|
@@ -187,6 +266,14 @@ interface BridgeRequestMap {
|
|
|
187
266
|
req: TemplateReport;
|
|
188
267
|
res: Record<string, never>;
|
|
189
268
|
};
|
|
269
|
+
session: {
|
|
270
|
+
req: SessionRequest;
|
|
271
|
+
res: SessionResult;
|
|
272
|
+
};
|
|
273
|
+
otp: {
|
|
274
|
+
req: OtpRequest;
|
|
275
|
+
res: OtpResult;
|
|
276
|
+
};
|
|
190
277
|
}
|
|
191
278
|
/** 이벤트 type별 payload. */
|
|
192
279
|
interface BridgeEventMap {
|
|
@@ -221,4 +308,4 @@ declare const IFRAME_ATTRIBUTES: {
|
|
|
221
308
|
declare function isRequestType(value: unknown): value is BridgeRequestType;
|
|
222
309
|
declare function isHostEventType(value: unknown): value is BridgeHostEventType;
|
|
223
310
|
|
|
224
|
-
export {
|
|
311
|
+
export { isBridgeErrorCode as $, ACCOUNT_SESSION_CAPABILITY as A, BRIDGE_ERROR_CODES as B, REPORT_MESSAGE_MAX_LENGTH as C, REQUEST_TIMEOUT_MS as D, REQUEST_TYPES as E, FRAME_UNLOAD_EVENT as F, type ReverificationStatus as G, HOST_EVENT_TYPES as H, IFRAME_ATTRIBUTES as I, type SessionOp as J, KNOWN_CAPABILITIES as K, type LogLevel as L, type MemberState as M, type NavigateOptions as N, OTP_OPS as O, type SessionRequest as P, type SessionResult as Q, READY_EVENT as R, SESSION_OPS as S, type SlotState as T, type StorageOp as U, TEMPLATE_REPORT_KINDS as V, type TemplateReport as W, type TemplateReportKind as X, type ThemeState as Y, type ToastKind as Z, type WithSession as _, type AccountHostQuery as a, isBridgeErrorLike as a0, isBridgeSurface as a1, isHostEventType as a2, isRequestType as a3, type AccountSpaceInfo as b, BRIDGE_SURFACES as c, BridgeError as d, type BridgeErrorCode as e, type BridgeErrorLike as f, type BridgeEventMap as g, type BridgeHostEventType as h, type BridgeInit as i, type BridgeLimits as j, type BridgeRequestMap as k, type BridgeRequestType as l, type BridgeResult as m, type BridgeSurface as n, type BridgeTranslations as o, type FetchRequest as p, type FetchResult as q, INIT_RESPONSE as r, type OtpOp as s, type OtpPurpose as t, type OtpRequest as u, type OtpResult as v, REPORTS_PER_SESSION as w, REPORT_COUNT_MAX as x, REPORT_FRAME_MAX_LENGTH as y, REPORT_MAX_FRAMES as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 브리지 오류 코드. */
|
|
2
|
-
declare const BRIDGE_ERROR_CODES: readonly ["FORBIDDEN_DESTINATION", "FORBIDDEN_METHOD", "BODY_TOO_LARGE", "RATE_LIMITED", "BAD_REQUEST", "TIMEOUT", "NETWORK_ERROR", "UNSUPPORTED"];
|
|
2
|
+
declare const BRIDGE_ERROR_CODES: readonly ["FORBIDDEN_DESTINATION", "FORBIDDEN_METHOD", "BODY_TOO_LARGE", "RATE_LIMITED", "BAD_REQUEST", "TIMEOUT", "NETWORK_ERROR", "UNSUPPORTED", "NOT_ALLOWED"];
|
|
3
3
|
type BridgeErrorCode = (typeof BRIDGE_ERROR_CODES)[number];
|
|
4
4
|
/** 코드가 붙은 브리지 오류. 호스트는 이 코드만 프레임에 돌려준다(내부 예외 메시지는 싣지 않는다). */
|
|
5
5
|
declare class BridgeError extends Error {
|
|
@@ -19,7 +19,7 @@ declare function isBridgeErrorLike(value: unknown): value is BridgeErrorLike;
|
|
|
19
19
|
/** 프레임 요청 타임아웃. */
|
|
20
20
|
declare const REQUEST_TIMEOUT_MS = 15000;
|
|
21
21
|
/** 프레임 → 호스트 요청 종류(브리지 프로토콜 표). */
|
|
22
|
-
declare const REQUEST_TYPES: readonly ["fetch", "navigate", "back", "openExternal", "toast", "resize", "track", "storage", "log", "report"];
|
|
22
|
+
declare const REQUEST_TYPES: readonly ["fetch", "navigate", "back", "openExternal", "toast", "resize", "track", "storage", "log", "report", "session", "otp"];
|
|
23
23
|
type BridgeRequestType = (typeof REQUEST_TYPES)[number];
|
|
24
24
|
/** 호스트 → 프레임 이벤트 종류. */
|
|
25
25
|
declare const HOST_EVENT_TYPES: readonly ["slot.context", "locale", "member", "theme", "visibility"];
|
|
@@ -83,6 +83,85 @@ interface BridgeInit {
|
|
|
83
83
|
readonly limits: BridgeLimits;
|
|
84
84
|
readonly partnerOrigins: readonly string[];
|
|
85
85
|
readonly translations?: BridgeTranslations;
|
|
86
|
+
/** 이 배치에 허용된 기능. 알려진 값만 싣는다(`ACCOUNT_SESSION_CAPABILITY`). 없으면 필드 자체가 없다. */
|
|
87
|
+
readonly capabilities?: readonly string[];
|
|
88
|
+
/** 아래 계정 필드는 `account-session` 권한이 있는 배치에만 실린다. */
|
|
89
|
+
readonly query?: AccountHostQuery;
|
|
90
|
+
/** 호스트의 국가 코드(가입 폼 기본 국가). */
|
|
91
|
+
readonly country?: string;
|
|
92
|
+
readonly space?: AccountSpaceInfo;
|
|
93
|
+
/** 재인증 임시토큰 보관 상태. 토큰 값은 싣지 않는다. */
|
|
94
|
+
readonly reverification?: ReverificationStatus;
|
|
95
|
+
}
|
|
96
|
+
/** 계정 세션 요청(session·otp)을 여는 배치 권한. 호스트가 이 값을 받아야만 처리한다(fail-closed). */
|
|
97
|
+
declare const ACCOUNT_SESSION_CAPABILITY = "account-session";
|
|
98
|
+
/** init.capabilities에 실을 수 있는 값. 그 밖의 값은 버린다. */
|
|
99
|
+
declare const KNOWN_CAPABILITIES: readonly string[];
|
|
100
|
+
/** 호스트 URL 쿼리 중 프레임에 주는 키(허용 목록). OAuth `code`·`state`는 싣지 않는다. */
|
|
101
|
+
interface AccountHostQuery {
|
|
102
|
+
readonly socialType?: string;
|
|
103
|
+
}
|
|
104
|
+
interface AccountSpaceInfo {
|
|
105
|
+
readonly title?: string;
|
|
106
|
+
readonly corporation?: {
|
|
107
|
+
readonly name?: string;
|
|
108
|
+
readonly country?: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
interface ReverificationStatus {
|
|
112
|
+
readonly available: boolean;
|
|
113
|
+
readonly expiresAt?: string;
|
|
114
|
+
}
|
|
115
|
+
/** 호스트가 대신 호출하는 계정 세션 작업. 엔드포인트는 호스트가 고정한다. */
|
|
116
|
+
declare const SESSION_OPS: readonly ["signup", "signupSocial", "loginAfterSignup", "phoneReverify"];
|
|
117
|
+
type SessionOp = (typeof SESSION_OPS)[number];
|
|
118
|
+
/** SMS OTP 작업. 목적(purpose)은 op로 호스트가 고정한다 — 프레임이 고르지 않는다. */
|
|
119
|
+
declare const OTP_OPS: readonly ["sendSignup", "sendPhoneChange", "verifySignup", "verifyPhoneChange"];
|
|
120
|
+
type OtpOp = (typeof OTP_OPS)[number];
|
|
121
|
+
type OtpPurpose = 'SIGNUP' | 'PHONE_CHANGE';
|
|
122
|
+
interface SessionRequest {
|
|
123
|
+
readonly op: SessionOp;
|
|
124
|
+
readonly body: Readonly<Record<string, unknown>>;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* `session` 결과. 토큰·회원 식별자는 싣지 않는다(허용 목록). `next`가 있으면 프레임 SDK가
|
|
128
|
+
* 그 경로로 전체 리로드 이동을 요청한다(호스트가 새 로그인 상태로 페이지를 다시 그리게).
|
|
129
|
+
*/
|
|
130
|
+
interface SessionResult {
|
|
131
|
+
readonly ok: boolean;
|
|
132
|
+
readonly status?: string;
|
|
133
|
+
readonly code?: number;
|
|
134
|
+
readonly message?: string;
|
|
135
|
+
readonly httpStatus?: number;
|
|
136
|
+
/** signup·signupSocial 성공 시 가입 시각. */
|
|
137
|
+
readonly createdAt?: string;
|
|
138
|
+
readonly next?: {
|
|
139
|
+
readonly path: string;
|
|
140
|
+
readonly reload: true;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
interface OtpRequest {
|
|
144
|
+
readonly op: OtpOp;
|
|
145
|
+
readonly body: Readonly<Record<string, unknown>>;
|
|
146
|
+
}
|
|
147
|
+
interface OtpResult {
|
|
148
|
+
readonly ok: boolean;
|
|
149
|
+
/** 게이트웨이 HTTP 상태. 응답을 받지 못했으면 0. */
|
|
150
|
+
readonly status: number;
|
|
151
|
+
readonly data?: Readonly<Record<string, string | number>>;
|
|
152
|
+
readonly error?: {
|
|
153
|
+
readonly code?: string;
|
|
154
|
+
readonly message?: {
|
|
155
|
+
readonly en?: string;
|
|
156
|
+
readonly vi?: string;
|
|
157
|
+
};
|
|
158
|
+
readonly retryAfterSeconds?: number;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/** navigate 옵션. `reload`는 같은 origin 경로로 전체 리로드 이동(로그인 직후 등). */
|
|
162
|
+
interface NavigateOptions {
|
|
163
|
+
readonly replace?: boolean;
|
|
164
|
+
readonly reload?: boolean;
|
|
86
165
|
}
|
|
87
166
|
interface FetchRequest {
|
|
88
167
|
readonly url: string;
|
|
@@ -133,7 +212,7 @@ interface BridgeRequestMap {
|
|
|
133
212
|
navigate: {
|
|
134
213
|
req: {
|
|
135
214
|
readonly path: string;
|
|
136
|
-
};
|
|
215
|
+
} & NavigateOptions;
|
|
137
216
|
res: Record<string, never>;
|
|
138
217
|
};
|
|
139
218
|
back: {
|
|
@@ -187,6 +266,14 @@ interface BridgeRequestMap {
|
|
|
187
266
|
req: TemplateReport;
|
|
188
267
|
res: Record<string, never>;
|
|
189
268
|
};
|
|
269
|
+
session: {
|
|
270
|
+
req: SessionRequest;
|
|
271
|
+
res: SessionResult;
|
|
272
|
+
};
|
|
273
|
+
otp: {
|
|
274
|
+
req: OtpRequest;
|
|
275
|
+
res: OtpResult;
|
|
276
|
+
};
|
|
190
277
|
}
|
|
191
278
|
/** 이벤트 type별 payload. */
|
|
192
279
|
interface BridgeEventMap {
|
|
@@ -221,4 +308,4 @@ declare const IFRAME_ATTRIBUTES: {
|
|
|
221
308
|
declare function isRequestType(value: unknown): value is BridgeRequestType;
|
|
222
309
|
declare function isHostEventType(value: unknown): value is BridgeHostEventType;
|
|
223
310
|
|
|
224
|
-
export {
|
|
311
|
+
export { isBridgeErrorCode as $, ACCOUNT_SESSION_CAPABILITY as A, BRIDGE_ERROR_CODES as B, REPORT_MESSAGE_MAX_LENGTH as C, REQUEST_TIMEOUT_MS as D, REQUEST_TYPES as E, FRAME_UNLOAD_EVENT as F, type ReverificationStatus as G, HOST_EVENT_TYPES as H, IFRAME_ATTRIBUTES as I, type SessionOp as J, KNOWN_CAPABILITIES as K, type LogLevel as L, type MemberState as M, type NavigateOptions as N, OTP_OPS as O, type SessionRequest as P, type SessionResult as Q, READY_EVENT as R, SESSION_OPS as S, type SlotState as T, type StorageOp as U, TEMPLATE_REPORT_KINDS as V, type TemplateReport as W, type TemplateReportKind as X, type ThemeState as Y, type ToastKind as Z, type WithSession as _, type AccountHostQuery as a, isBridgeErrorLike as a0, isBridgeSurface as a1, isHostEventType as a2, isRequestType as a3, type AccountSpaceInfo as b, BRIDGE_SURFACES as c, BridgeError as d, type BridgeErrorCode as e, type BridgeErrorLike as f, type BridgeEventMap as g, type BridgeHostEventType as h, type BridgeInit as i, type BridgeLimits as j, type BridgeRequestMap as k, type BridgeRequestType as l, type BridgeResult as m, type BridgeSurface as n, type BridgeTranslations as o, type FetchRequest as p, type FetchResult as q, INIT_RESPONSE as r, type OtpOp as s, type OtpPurpose as t, type OtpRequest as u, type OtpResult as v, REPORTS_PER_SESSION as w, REPORT_COUNT_MAX as x, REPORT_FRAME_MAX_LENGTH as y, REPORT_MAX_FRAMES as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bstage-sdk/bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "bstage SDK bridge — isolated template iframe protocol, host policy and frame client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
],
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"tsup": "^8.0.0",
|
|
64
|
-
"typescript": "^5.5.0"
|
|
64
|
+
"typescript": "^5.5.0",
|
|
65
|
+
"@bstage-sdk/design": "0.15.1"
|
|
65
66
|
},
|
|
66
67
|
"license": "MIT",
|
|
67
68
|
"scripts": {
|