connectbase-client 0.1.12 → 0.1.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/README.md +2 -2
- package/dist/cli.js +3 -2
- package/dist/index.d.mts +5 -16
- package/dist/index.d.ts +5 -16
- package/dist/index.js +5 -16
- package/dist/index.mjs +5 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -352,8 +352,8 @@ const session = await cb.auth.signIn({
|
|
|
352
352
|
// OAuth login (리다이렉트 방식)
|
|
353
353
|
await cb.oauth.signIn('google', 'https://myapp.com/oauth/callback')
|
|
354
354
|
|
|
355
|
-
// OAuth login (팝업 방식)
|
|
356
|
-
const result = await cb.oauth.signInWithPopup('google', 'https://myapp.com/oauth/
|
|
355
|
+
// OAuth login (팝업 방식 - 동일한 콜백 URL 사용 가능)
|
|
356
|
+
const result = await cb.oauth.signInWithPopup('google', 'https://myapp.com/oauth/callback')
|
|
357
357
|
|
|
358
358
|
// Get current user
|
|
359
359
|
const user = await cb.auth.getCurrentUser()
|
package/dist/cli.js
CHANGED
|
@@ -223,7 +223,7 @@ async function deploy(directory, config) {
|
|
|
223
223
|
process.exit(1);
|
|
224
224
|
}
|
|
225
225
|
log(`${colors.dim}${files.length}\uAC1C \uD30C\uC77C \uBC1C\uACAC${colors.reset}`);
|
|
226
|
-
const url = `${config.baseUrl}/v1/storages/webs/${config.storageId}/deploy`;
|
|
226
|
+
const url = `${config.baseUrl}/v1/public/storages/webs/${config.storageId}/deploy`;
|
|
227
227
|
info("\uBC30\uD3EC \uC911...");
|
|
228
228
|
try {
|
|
229
229
|
const response = await makeRequest(
|
|
@@ -250,7 +250,8 @@ ${colors.cyan}URL: ${data.url}${colors.reset}
|
|
|
250
250
|
}
|
|
251
251
|
} else {
|
|
252
252
|
const data = response.data;
|
|
253
|
-
|
|
253
|
+
const errorMsg = typeof data === "object" && data !== null ? data.message || data.error || JSON.stringify(data) : typeof data === "string" ? data : `HTTP ${response.status}`;
|
|
254
|
+
error(`\uBC30\uD3EC \uC2E4\uD328: ${errorMsg}`);
|
|
254
255
|
process.exit(1);
|
|
255
256
|
}
|
|
256
257
|
} catch (err) {
|
package/dist/index.d.mts
CHANGED
|
@@ -1359,25 +1359,14 @@ declare class OAuthAPI {
|
|
|
1359
1359
|
*
|
|
1360
1360
|
* @example
|
|
1361
1361
|
* ```typescript
|
|
1362
|
-
*
|
|
1362
|
+
* // 리다이렉트 방식과 동일한 콜백 URL 사용 가능
|
|
1363
|
+
* const result = await cb.oauth.signInWithPopup('google', 'https://myapp.com/oauth/callback')
|
|
1363
1364
|
* console.log('로그인 성공:', result.member_id)
|
|
1364
1365
|
* ```
|
|
1365
1366
|
*
|
|
1366
|
-
*
|
|
1367
|
-
*
|
|
1368
|
-
*
|
|
1369
|
-
* <script src="https://unpkg.com/connectbase-client"></script>
|
|
1370
|
-
* <script>
|
|
1371
|
-
* const cb = new ConnectBase({ apiKey: 'YOUR_API_KEY' })
|
|
1372
|
-
* const result = cb.oauth.getCallbackResult()
|
|
1373
|
-
*
|
|
1374
|
-
* window.opener.postMessage({
|
|
1375
|
-
* type: 'oauth-callback',
|
|
1376
|
-
* ...result
|
|
1377
|
-
* }, '*')
|
|
1378
|
-
* window.close()
|
|
1379
|
-
* </script>
|
|
1380
|
-
* ```
|
|
1367
|
+
* 콜백 페이지에서 `getCallbackResult()`를 호출하면 팝업 여부를 자동 감지합니다:
|
|
1368
|
+
* - 팝업: 부모 창에 결과 전달 후 자동 닫힘
|
|
1369
|
+
* - 리다이렉트: 토큰 저장 후 결과 반환
|
|
1381
1370
|
*/
|
|
1382
1371
|
signInWithPopup(provider: OAuthProvider, callbackUrl: string): Promise<OAuthCallbackResponse>;
|
|
1383
1372
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1359,25 +1359,14 @@ declare class OAuthAPI {
|
|
|
1359
1359
|
*
|
|
1360
1360
|
* @example
|
|
1361
1361
|
* ```typescript
|
|
1362
|
-
*
|
|
1362
|
+
* // 리다이렉트 방식과 동일한 콜백 URL 사용 가능
|
|
1363
|
+
* const result = await cb.oauth.signInWithPopup('google', 'https://myapp.com/oauth/callback')
|
|
1363
1364
|
* console.log('로그인 성공:', result.member_id)
|
|
1364
1365
|
* ```
|
|
1365
1366
|
*
|
|
1366
|
-
*
|
|
1367
|
-
*
|
|
1368
|
-
*
|
|
1369
|
-
* <script src="https://unpkg.com/connectbase-client"></script>
|
|
1370
|
-
* <script>
|
|
1371
|
-
* const cb = new ConnectBase({ apiKey: 'YOUR_API_KEY' })
|
|
1372
|
-
* const result = cb.oauth.getCallbackResult()
|
|
1373
|
-
*
|
|
1374
|
-
* window.opener.postMessage({
|
|
1375
|
-
* type: 'oauth-callback',
|
|
1376
|
-
* ...result
|
|
1377
|
-
* }, '*')
|
|
1378
|
-
* window.close()
|
|
1379
|
-
* </script>
|
|
1380
|
-
* ```
|
|
1367
|
+
* 콜백 페이지에서 `getCallbackResult()`를 호출하면 팝업 여부를 자동 감지합니다:
|
|
1368
|
+
* - 팝업: 부모 창에 결과 전달 후 자동 닫힘
|
|
1369
|
+
* - 리다이렉트: 토큰 저장 후 결과 반환
|
|
1381
1370
|
*/
|
|
1382
1371
|
signInWithPopup(provider: OAuthProvider, callbackUrl: string): Promise<OAuthCallbackResponse>;
|
|
1383
1372
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2078,25 +2078,14 @@ var OAuthAPI = class {
|
|
|
2078
2078
|
*
|
|
2079
2079
|
* @example
|
|
2080
2080
|
* ```typescript
|
|
2081
|
-
*
|
|
2081
|
+
* // 리다이렉트 방식과 동일한 콜백 URL 사용 가능
|
|
2082
|
+
* const result = await cb.oauth.signInWithPopup('google', 'https://myapp.com/oauth/callback')
|
|
2082
2083
|
* console.log('로그인 성공:', result.member_id)
|
|
2083
2084
|
* ```
|
|
2084
2085
|
*
|
|
2085
|
-
*
|
|
2086
|
-
*
|
|
2087
|
-
*
|
|
2088
|
-
* <script src="https://unpkg.com/connectbase-client"></script>
|
|
2089
|
-
* <script>
|
|
2090
|
-
* const cb = new ConnectBase({ apiKey: 'YOUR_API_KEY' })
|
|
2091
|
-
* const result = cb.oauth.getCallbackResult()
|
|
2092
|
-
*
|
|
2093
|
-
* window.opener.postMessage({
|
|
2094
|
-
* type: 'oauth-callback',
|
|
2095
|
-
* ...result
|
|
2096
|
-
* }, '*')
|
|
2097
|
-
* window.close()
|
|
2098
|
-
* </script>
|
|
2099
|
-
* ```
|
|
2086
|
+
* 콜백 페이지에서 `getCallbackResult()`를 호출하면 팝업 여부를 자동 감지합니다:
|
|
2087
|
+
* - 팝업: 부모 창에 결과 전달 후 자동 닫힘
|
|
2088
|
+
* - 리다이렉트: 토큰 저장 후 결과 반환
|
|
2100
2089
|
*/
|
|
2101
2090
|
async signInWithPopup(provider, callbackUrl) {
|
|
2102
2091
|
const params = new URLSearchParams({ app_callback: callbackUrl });
|
package/dist/index.mjs
CHANGED
|
@@ -2044,25 +2044,14 @@ var OAuthAPI = class {
|
|
|
2044
2044
|
*
|
|
2045
2045
|
* @example
|
|
2046
2046
|
* ```typescript
|
|
2047
|
-
*
|
|
2047
|
+
* // 리다이렉트 방식과 동일한 콜백 URL 사용 가능
|
|
2048
|
+
* const result = await cb.oauth.signInWithPopup('google', 'https://myapp.com/oauth/callback')
|
|
2048
2049
|
* console.log('로그인 성공:', result.member_id)
|
|
2049
2050
|
* ```
|
|
2050
2051
|
*
|
|
2051
|
-
*
|
|
2052
|
-
*
|
|
2053
|
-
*
|
|
2054
|
-
* <script src="https://unpkg.com/connectbase-client"></script>
|
|
2055
|
-
* <script>
|
|
2056
|
-
* const cb = new ConnectBase({ apiKey: 'YOUR_API_KEY' })
|
|
2057
|
-
* const result = cb.oauth.getCallbackResult()
|
|
2058
|
-
*
|
|
2059
|
-
* window.opener.postMessage({
|
|
2060
|
-
* type: 'oauth-callback',
|
|
2061
|
-
* ...result
|
|
2062
|
-
* }, '*')
|
|
2063
|
-
* window.close()
|
|
2064
|
-
* </script>
|
|
2065
|
-
* ```
|
|
2052
|
+
* 콜백 페이지에서 `getCallbackResult()`를 호출하면 팝업 여부를 자동 감지합니다:
|
|
2053
|
+
* - 팝업: 부모 창에 결과 전달 후 자동 닫힘
|
|
2054
|
+
* - 리다이렉트: 토큰 저장 후 결과 반환
|
|
2066
2055
|
*/
|
|
2067
2056
|
async signInWithPopup(provider, callbackUrl) {
|
|
2068
2057
|
const params = new URLSearchParams({ app_callback: callbackUrl });
|