@feelflow/ffid-sdk 2.21.0 → 3.1.0
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/dist/agency/index.cjs +3 -3
- package/dist/agency/index.d.cts +1 -1
- package/dist/agency/index.d.ts +1 -1
- package/dist/agency/index.js +2 -2
- package/dist/announcements/index.cjs +2 -2
- package/dist/announcements/index.js +1 -1
- package/dist/{chunk-HUU4Q5VH.cjs → chunk-HZZQ2BX7.cjs} +83 -11
- package/dist/chunk-JEVK2XUM.js +5 -0
- package/dist/{chunk-YUIITYBE.cjs → chunk-MDHKSVLP.cjs} +2 -0
- package/dist/{chunk-I7NEMG52.js → chunk-RRN3DTET.js} +83 -12
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/constants-D61jqRIO.d.cts +35 -0
- package/dist/constants-D61jqRIO.d.ts +35 -0
- package/dist/{ffid-client-DgJRU-YZ.d.cts → ffid-client-DM_t1seS.d.cts} +71 -1
- package/dist/{ffid-client-DgJRU-YZ.d.ts → ffid-client-DM_t1seS.d.ts} +71 -1
- package/dist/{index-Dr5G9HQ4.d.cts → index-COnReU8h.d.cts} +24 -2
- package/dist/{index-Dr5G9HQ4.d.ts → index-COnReU8h.d.ts} +24 -2
- package/dist/index.cjs +37 -31
- package/dist/index.d.cts +101 -7
- package/dist/index.d.ts +101 -7
- package/dist/index.js +4 -3
- package/dist/legal/index.cjs +3 -3
- package/dist/legal/index.d.cts +1 -1
- package/dist/legal/index.d.ts +1 -1
- package/dist/legal/index.js +2 -2
- package/dist/server/index.cjs +83 -11
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +78 -10
- package/dist/server/test/index.d.cts +1 -1
- package/dist/server/test/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-QBRM2RRC.js +0 -4
- package/dist/constants-DvTGHPZn.d.cts +0 -10
- package/dist/constants-DvTGHPZn.d.ts +0 -10
package/dist/agency/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMDHKSVLP_cjs = require('../chunk-MDHKSVLP.cjs');
|
|
4
4
|
|
|
5
5
|
// src/agency/ffid-agency-client.ts
|
|
6
6
|
var API_PREFIX = "/api/v1/agencies";
|
|
@@ -26,7 +26,7 @@ var consoleLogger = {
|
|
|
26
26
|
error: (...args) => console.error(SDK_LOG_PREFIX, ...args)
|
|
27
27
|
};
|
|
28
28
|
function createFFIDAgencyClient(config = {}) {
|
|
29
|
-
const baseUrl = config.apiBaseUrl ??
|
|
29
|
+
const baseUrl = config.apiBaseUrl ?? chunkMDHKSVLP_cjs.DEFAULT_API_BASE_URL;
|
|
30
30
|
const logger = config.logger ?? (config.debug ? consoleLogger : noopLogger);
|
|
31
31
|
function validateIds(...pairs) {
|
|
32
32
|
for (const [value, name] of pairs) {
|
|
@@ -316,7 +316,7 @@ function createFFIDAgencyClient(config = {}) {
|
|
|
316
316
|
|
|
317
317
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
318
318
|
enumerable: true,
|
|
319
|
-
get: function () { return
|
|
319
|
+
get: function () { return chunkMDHKSVLP_cjs.DEFAULT_API_BASE_URL; }
|
|
320
320
|
});
|
|
321
321
|
exports.FFID_AGENCY_ERROR_CODES = FFID_AGENCY_ERROR_CODES;
|
|
322
322
|
exports.createFFIDAgencyClient = createFFIDAgencyClient;
|
package/dist/agency/index.d.cts
CHANGED
package/dist/agency/index.d.ts
CHANGED
package/dist/agency/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_API_BASE_URL } from '../chunk-
|
|
2
|
-
export { DEFAULT_API_BASE_URL } from '../chunk-
|
|
1
|
+
import { DEFAULT_API_BASE_URL } from '../chunk-JEVK2XUM.js';
|
|
2
|
+
export { DEFAULT_API_BASE_URL } from '../chunk-JEVK2XUM.js';
|
|
3
3
|
|
|
4
4
|
// src/agency/ffid-agency-client.ts
|
|
5
5
|
var API_PREFIX = "/api/v1/agencies";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMDHKSVLP_cjs = require('../chunk-MDHKSVLP.cjs');
|
|
4
4
|
|
|
5
5
|
// src/announcements/ffid-announcements-client.ts
|
|
6
6
|
var API_PATH = "/api/v1/announcements";
|
|
@@ -29,7 +29,7 @@ var consoleLogger = {
|
|
|
29
29
|
error: (...args) => console.error(SDK_LOG_PREFIX, ...args)
|
|
30
30
|
};
|
|
31
31
|
function createFFIDAnnouncementsClient(config = {}) {
|
|
32
|
-
const baseUrl = config.apiBaseUrl ??
|
|
32
|
+
const baseUrl = config.apiBaseUrl ?? chunkMDHKSVLP_cjs.DEFAULT_API_BASE_URL;
|
|
33
33
|
const logger = config.logger ?? (config.debug ? consoleLogger : quietLogger);
|
|
34
34
|
async function fetchApi(endpoint) {
|
|
35
35
|
const url = `${baseUrl}${endpoint}`;
|
|
@@ -6,6 +6,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
|
|
7
7
|
// src/constants.ts
|
|
8
8
|
var DEFAULT_API_BASE_URL = "https://id.feelflow.net";
|
|
9
|
+
var DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
|
|
9
10
|
|
|
10
11
|
// src/auth/token-store.ts
|
|
11
12
|
var STORAGE_KEY = "ffid_tokens";
|
|
@@ -807,7 +808,7 @@ function createProfileMethods(deps) {
|
|
|
807
808
|
}
|
|
808
809
|
|
|
809
810
|
// src/client/version-check.ts
|
|
810
|
-
var SDK_VERSION = "
|
|
811
|
+
var SDK_VERSION = "3.1.0";
|
|
811
812
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
812
813
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
813
814
|
function sdkHeaders() {
|
|
@@ -1368,6 +1369,8 @@ function base64UrlEncode(buffer) {
|
|
|
1368
1369
|
// src/client/redirect.ts
|
|
1369
1370
|
var OAUTH_AUTHORIZE_ENDPOINT = "/api/v1/oauth/authorize";
|
|
1370
1371
|
var AUTH_LOGOUT_ENDPOINT = "/api/v1/auth/logout";
|
|
1372
|
+
var SCREEN_HINT_SIGNUP = "signup";
|
|
1373
|
+
var SCREEN_HINT_PARAM = "screen_hint";
|
|
1371
1374
|
var STATE_RANDOM_BYTES = 16;
|
|
1372
1375
|
var HEX_BASE2 = 16;
|
|
1373
1376
|
var REDIRECT_LOOP_KEY = "ffid_sdk_redirect_loop_history";
|
|
@@ -1462,6 +1465,7 @@ function createRedirectMethods(deps) {
|
|
|
1462
1465
|
baseUrl,
|
|
1463
1466
|
clientId,
|
|
1464
1467
|
serviceCode,
|
|
1468
|
+
scope,
|
|
1465
1469
|
resolvedRedirectUri,
|
|
1466
1470
|
logger
|
|
1467
1471
|
} = deps;
|
|
@@ -1470,6 +1474,24 @@ function createRedirectMethods(deps) {
|
|
|
1470
1474
|
logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
|
|
1471
1475
|
return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
|
|
1472
1476
|
}
|
|
1477
|
+
if (authMode === "service-key") {
|
|
1478
|
+
logger.error(
|
|
1479
|
+
"[FFID SDK] service-key \u30E2\u30FC\u30C9\u3067\u306F redirectToAuthorize \u306F\u547C\u3073\u51FA\u305B\u307E\u305B\u3093 \u2014 server-to-server \u7528\u9014\u306E\u305F\u3081 OAuth \u30D6\u30E9\u30A6\u30B6 flow \u3092\u6301\u3061\u307E\u305B\u3093"
|
|
1480
|
+
);
|
|
1481
|
+
return {
|
|
1482
|
+
success: false,
|
|
1483
|
+
error: "service-key \u30E2\u30FC\u30C9\u3067\u306F OAuth \u8A8D\u53EF\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u306F\u5229\u7528\u3067\u304D\u307E\u305B\u3093"
|
|
1484
|
+
};
|
|
1485
|
+
}
|
|
1486
|
+
if (!scope || !scope.trim()) {
|
|
1487
|
+
logger.error(
|
|
1488
|
+
"[FFID SDK] scope \u304C\u672A\u8A2D\u5B9A\u306E\u305F\u3081 /oauth/authorize \u3092\u547C\u3073\u51FA\u305B\u307E\u305B\u3093 (#2674) \u2014 FFIDConfig.scope \u306B DEFAULT_OAUTH_SCOPES \u307E\u305F\u306F\u660E\u793A\u7684\u306A scope \u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
1489
|
+
);
|
|
1490
|
+
return {
|
|
1491
|
+
success: false,
|
|
1492
|
+
error: "OAuth scope \u304C\u672A\u8A2D\u5B9A\u306E\u305F\u3081\u8A8D\u53EF\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093"
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1473
1495
|
const authorizeKey = buildAuthorizeKey(baseUrl, clientId, options?.organizationId);
|
|
1474
1496
|
const now = Date.now();
|
|
1475
1497
|
const recentCount = getRecentRedirectCount(authorizeKey, now, logger);
|
|
@@ -1502,6 +1524,7 @@ function createRedirectMethods(deps) {
|
|
|
1502
1524
|
const params = new URLSearchParams({
|
|
1503
1525
|
response_type: "code",
|
|
1504
1526
|
client_id: clientId,
|
|
1527
|
+
scope,
|
|
1505
1528
|
redirect_uri: redirectUri,
|
|
1506
1529
|
state,
|
|
1507
1530
|
code_challenge: challenge,
|
|
@@ -1515,6 +1538,9 @@ function createRedirectMethods(deps) {
|
|
|
1515
1538
|
}
|
|
1516
1539
|
params.set("organization_id", trimmedOrgId);
|
|
1517
1540
|
}
|
|
1541
|
+
if (options?.screenHint === SCREEN_HINT_SIGNUP) {
|
|
1542
|
+
params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
|
|
1543
|
+
}
|
|
1518
1544
|
const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
|
|
1519
1545
|
logger.debug("Redirecting to authorize:", authorizeUrl);
|
|
1520
1546
|
recordRedirectAttempt(authorizeKey, now, logger);
|
|
@@ -1526,18 +1552,17 @@ function createRedirectMethods(deps) {
|
|
|
1526
1552
|
}
|
|
1527
1553
|
return { success: true };
|
|
1528
1554
|
}
|
|
1529
|
-
async function redirectToLogin() {
|
|
1555
|
+
async function redirectToLogin(options) {
|
|
1530
1556
|
if (typeof window === "undefined") {
|
|
1531
1557
|
logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
|
|
1532
1558
|
return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
|
|
1533
1559
|
}
|
|
1534
1560
|
if (authMode === "token") {
|
|
1535
|
-
return redirectToAuthorize();
|
|
1561
|
+
return redirectToAuthorize(options);
|
|
1536
1562
|
}
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
window.location.href = loginUrl;
|
|
1563
|
+
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
|
|
1564
|
+
logger.debug("Redirecting to auth page:", targetUrl);
|
|
1565
|
+
window.location.href = targetUrl;
|
|
1541
1566
|
return { success: true };
|
|
1542
1567
|
}
|
|
1543
1568
|
function getLoginUrl(redirectUrl) {
|
|
@@ -1984,6 +2009,7 @@ function createContractWizardMethods(deps) {
|
|
|
1984
2009
|
var EXT_SUBSCRIBE_ENDPOINT2 = "/api/v1/ext/newsletter/subscribe";
|
|
1985
2010
|
var CONFIRM_ENDPOINT = "/api/newsletter/confirm";
|
|
1986
2011
|
var UNSUBSCRIBE_ENDPOINT = "/api/newsletter/unsubscribe";
|
|
2012
|
+
var DISPATCH_ENDPOINT = "/api/v1/newsletter/dispatch";
|
|
1987
2013
|
function trimOrEmpty(s) {
|
|
1988
2014
|
return typeof s === "string" ? s.trim() : "";
|
|
1989
2015
|
}
|
|
@@ -2089,7 +2115,36 @@ function createNewsletterMethods(deps) {
|
|
|
2089
2115
|
}
|
|
2090
2116
|
);
|
|
2091
2117
|
}
|
|
2092
|
-
|
|
2118
|
+
async function dispatch(params) {
|
|
2119
|
+
const subject = trimOrEmpty(params.subject);
|
|
2120
|
+
if (!subject) {
|
|
2121
|
+
return { error: createError("VALIDATION_ERROR", "subject \u306F\u5FC5\u9808\u3067\u3059") };
|
|
2122
|
+
}
|
|
2123
|
+
if (!params.body || typeof params.body !== "object") {
|
|
2124
|
+
return { error: createError("VALIDATION_ERROR", "body \u306F\u5FC5\u9808\u3067\u3059") };
|
|
2125
|
+
}
|
|
2126
|
+
const bodySource = params.body;
|
|
2127
|
+
const hasHtmlBody = typeof bodySource.htmlBody === "string" && bodySource.htmlBody.length > 0;
|
|
2128
|
+
const hasTemplateId = typeof bodySource.templateId === "string" && bodySource.templateId.length > 0;
|
|
2129
|
+
if (hasHtmlBody === hasTemplateId) {
|
|
2130
|
+
return {
|
|
2131
|
+
error: createError(
|
|
2132
|
+
"BODY_SOURCE_REQUIRED",
|
|
2133
|
+
"body \u306F htmlBody \u307E\u305F\u306F templateId \u306E\u3044\u305A\u308C\u304B\u4E00\u65B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
2134
|
+
)
|
|
2135
|
+
};
|
|
2136
|
+
}
|
|
2137
|
+
return fetchWithAuth(DISPATCH_ENDPOINT, {
|
|
2138
|
+
method: "POST",
|
|
2139
|
+
body: JSON.stringify({
|
|
2140
|
+
subject,
|
|
2141
|
+
articleUrl: params.articleUrl,
|
|
2142
|
+
body: params.body,
|
|
2143
|
+
segment: params.segment
|
|
2144
|
+
})
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
2147
|
+
return { subscribe, confirm, unsubscribe, dispatch };
|
|
2093
2148
|
}
|
|
2094
2149
|
|
|
2095
2150
|
// src/inquiry/ffid-inquiry-client.ts
|
|
@@ -2191,8 +2246,21 @@ function createFFIDClient(config) {
|
|
|
2191
2246
|
if (!config.serviceCode || !config.serviceCode.trim()) {
|
|
2192
2247
|
throw new Error("FFID Client: serviceCode \u304C\u672A\u8A2D\u5B9A\u3067\u3059");
|
|
2193
2248
|
}
|
|
2249
|
+
const scope = config.scope?.trim() ?? "";
|
|
2194
2250
|
const baseUrl = config.apiBaseUrl ?? DEFAULT_API_BASE_URL;
|
|
2195
2251
|
const authMode = config.authMode ?? "cookie";
|
|
2252
|
+
const VALID_AUTH_MODES = ["cookie", "token", "service-key"];
|
|
2253
|
+
if (!VALID_AUTH_MODES.includes(authMode)) {
|
|
2254
|
+
throw new Error(
|
|
2255
|
+
`FFID Client: authMode \u304C\u4E0D\u6B63\u3067\u3059 (\u53D7\u4FE1: ${JSON.stringify(authMode)}, \u6709\u52B9\u5024: ${VALID_AUTH_MODES.join(" | ")})`
|
|
2256
|
+
);
|
|
2257
|
+
}
|
|
2258
|
+
if (authMode !== "service-key" && !scope) {
|
|
2259
|
+
const received = config.scope === void 0 ? "undefined" : JSON.stringify(config.scope);
|
|
2260
|
+
throw new Error(
|
|
2261
|
+
`FFID Client: scope \u304C\u672A\u8A2D\u5B9A\u3067\u3059 (\u53D7\u4FE1: ${received})\u3002\`DEFAULT_OAUTH_SCOPES\` \u3092 import \u3059\u308B\u304B\u3001\u660E\u793A\u7684\u306B scope \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044 (#2674)`
|
|
2262
|
+
);
|
|
2263
|
+
}
|
|
2196
2264
|
const clientId = config.clientId ?? config.serviceCode;
|
|
2197
2265
|
const rawRedirectUri = config.redirectUri ?? null;
|
|
2198
2266
|
const serviceApiKey = config.serviceApiKey?.trim();
|
|
@@ -2363,6 +2431,7 @@ function createFFIDClient(config) {
|
|
|
2363
2431
|
baseUrl,
|
|
2364
2432
|
clientId,
|
|
2365
2433
|
serviceCode: config.serviceCode,
|
|
2434
|
+
scope,
|
|
2366
2435
|
resolvedRedirectUri,
|
|
2367
2436
|
logger
|
|
2368
2437
|
});
|
|
@@ -2547,6 +2616,7 @@ var FFIDClientContext = react.createContext(null);
|
|
|
2547
2616
|
function FFIDProvider({
|
|
2548
2617
|
children,
|
|
2549
2618
|
serviceCode,
|
|
2619
|
+
scope,
|
|
2550
2620
|
apiBaseUrl,
|
|
2551
2621
|
debug = false,
|
|
2552
2622
|
logger,
|
|
@@ -2573,13 +2643,14 @@ function FFIDProvider({
|
|
|
2573
2643
|
const client = react.useMemo(
|
|
2574
2644
|
() => createFFIDClient({
|
|
2575
2645
|
serviceCode,
|
|
2646
|
+
scope,
|
|
2576
2647
|
apiBaseUrl,
|
|
2577
2648
|
debug,
|
|
2578
2649
|
logger,
|
|
2579
2650
|
authMode,
|
|
2580
2651
|
clientId
|
|
2581
2652
|
}),
|
|
2582
|
-
[serviceCode, apiBaseUrl, debug, logger, authMode, clientId]
|
|
2653
|
+
[serviceCode, scope, apiBaseUrl, debug, logger, authMode, clientId]
|
|
2583
2654
|
);
|
|
2584
2655
|
const refresh = react.useCallback(async () => {
|
|
2585
2656
|
client.logger.debug("Refreshing session...");
|
|
@@ -2624,8 +2695,8 @@ function FFIDProvider({
|
|
|
2624
2695
|
setIsLoading(false);
|
|
2625
2696
|
}
|
|
2626
2697
|
}, [client]);
|
|
2627
|
-
const login = react.useCallback(() => {
|
|
2628
|
-
client.redirectToLogin().catch((err) => {
|
|
2698
|
+
const login = react.useCallback((options) => {
|
|
2699
|
+
client.redirectToLogin(options).catch((err) => {
|
|
2629
2700
|
client.logger.error("\u30ED\u30B0\u30A4\u30F3\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F:", err);
|
|
2630
2701
|
});
|
|
2631
2702
|
}, [client]);
|
|
@@ -4571,6 +4642,7 @@ function FFIDInquiryForm({
|
|
|
4571
4642
|
}
|
|
4572
4643
|
|
|
4573
4644
|
exports.DEFAULT_API_BASE_URL = DEFAULT_API_BASE_URL;
|
|
4645
|
+
exports.DEFAULT_OAUTH_SCOPES = DEFAULT_OAUTH_SCOPES;
|
|
4574
4646
|
exports.FFIDAnnouncementBadge = FFIDAnnouncementBadge;
|
|
4575
4647
|
exports.FFIDAnnouncementList = FFIDAnnouncementList;
|
|
4576
4648
|
exports.FFIDInquiryForm = FFIDInquiryForm;
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/constants.ts
|
|
4
4
|
var DEFAULT_API_BASE_URL = "https://id.feelflow.net";
|
|
5
|
+
var DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
|
|
5
6
|
|
|
6
7
|
exports.DEFAULT_API_BASE_URL = DEFAULT_API_BASE_URL;
|
|
8
|
+
exports.DEFAULT_OAUTH_SCOPES = DEFAULT_OAUTH_SCOPES;
|
|
@@ -4,6 +4,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
4
4
|
|
|
5
5
|
// src/constants.ts
|
|
6
6
|
var DEFAULT_API_BASE_URL = "https://id.feelflow.net";
|
|
7
|
+
var DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
|
|
7
8
|
|
|
8
9
|
// src/auth/token-store.ts
|
|
9
10
|
var STORAGE_KEY = "ffid_tokens";
|
|
@@ -805,7 +806,7 @@ function createProfileMethods(deps) {
|
|
|
805
806
|
}
|
|
806
807
|
|
|
807
808
|
// src/client/version-check.ts
|
|
808
|
-
var SDK_VERSION = "
|
|
809
|
+
var SDK_VERSION = "3.1.0";
|
|
809
810
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
810
811
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
811
812
|
function sdkHeaders() {
|
|
@@ -1366,6 +1367,8 @@ function base64UrlEncode(buffer) {
|
|
|
1366
1367
|
// src/client/redirect.ts
|
|
1367
1368
|
var OAUTH_AUTHORIZE_ENDPOINT = "/api/v1/oauth/authorize";
|
|
1368
1369
|
var AUTH_LOGOUT_ENDPOINT = "/api/v1/auth/logout";
|
|
1370
|
+
var SCREEN_HINT_SIGNUP = "signup";
|
|
1371
|
+
var SCREEN_HINT_PARAM = "screen_hint";
|
|
1369
1372
|
var STATE_RANDOM_BYTES = 16;
|
|
1370
1373
|
var HEX_BASE2 = 16;
|
|
1371
1374
|
var REDIRECT_LOOP_KEY = "ffid_sdk_redirect_loop_history";
|
|
@@ -1460,6 +1463,7 @@ function createRedirectMethods(deps) {
|
|
|
1460
1463
|
baseUrl,
|
|
1461
1464
|
clientId,
|
|
1462
1465
|
serviceCode,
|
|
1466
|
+
scope,
|
|
1463
1467
|
resolvedRedirectUri,
|
|
1464
1468
|
logger
|
|
1465
1469
|
} = deps;
|
|
@@ -1468,6 +1472,24 @@ function createRedirectMethods(deps) {
|
|
|
1468
1472
|
logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
|
|
1469
1473
|
return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
|
|
1470
1474
|
}
|
|
1475
|
+
if (authMode === "service-key") {
|
|
1476
|
+
logger.error(
|
|
1477
|
+
"[FFID SDK] service-key \u30E2\u30FC\u30C9\u3067\u306F redirectToAuthorize \u306F\u547C\u3073\u51FA\u305B\u307E\u305B\u3093 \u2014 server-to-server \u7528\u9014\u306E\u305F\u3081 OAuth \u30D6\u30E9\u30A6\u30B6 flow \u3092\u6301\u3061\u307E\u305B\u3093"
|
|
1478
|
+
);
|
|
1479
|
+
return {
|
|
1480
|
+
success: false,
|
|
1481
|
+
error: "service-key \u30E2\u30FC\u30C9\u3067\u306F OAuth \u8A8D\u53EF\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u306F\u5229\u7528\u3067\u304D\u307E\u305B\u3093"
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
if (!scope || !scope.trim()) {
|
|
1485
|
+
logger.error(
|
|
1486
|
+
"[FFID SDK] scope \u304C\u672A\u8A2D\u5B9A\u306E\u305F\u3081 /oauth/authorize \u3092\u547C\u3073\u51FA\u305B\u307E\u305B\u3093 (#2674) \u2014 FFIDConfig.scope \u306B DEFAULT_OAUTH_SCOPES \u307E\u305F\u306F\u660E\u793A\u7684\u306A scope \u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
1487
|
+
);
|
|
1488
|
+
return {
|
|
1489
|
+
success: false,
|
|
1490
|
+
error: "OAuth scope \u304C\u672A\u8A2D\u5B9A\u306E\u305F\u3081\u8A8D\u53EF\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093"
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1471
1493
|
const authorizeKey = buildAuthorizeKey(baseUrl, clientId, options?.organizationId);
|
|
1472
1494
|
const now = Date.now();
|
|
1473
1495
|
const recentCount = getRecentRedirectCount(authorizeKey, now, logger);
|
|
@@ -1500,6 +1522,7 @@ function createRedirectMethods(deps) {
|
|
|
1500
1522
|
const params = new URLSearchParams({
|
|
1501
1523
|
response_type: "code",
|
|
1502
1524
|
client_id: clientId,
|
|
1525
|
+
scope,
|
|
1503
1526
|
redirect_uri: redirectUri,
|
|
1504
1527
|
state,
|
|
1505
1528
|
code_challenge: challenge,
|
|
@@ -1513,6 +1536,9 @@ function createRedirectMethods(deps) {
|
|
|
1513
1536
|
}
|
|
1514
1537
|
params.set("organization_id", trimmedOrgId);
|
|
1515
1538
|
}
|
|
1539
|
+
if (options?.screenHint === SCREEN_HINT_SIGNUP) {
|
|
1540
|
+
params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
|
|
1541
|
+
}
|
|
1516
1542
|
const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
|
|
1517
1543
|
logger.debug("Redirecting to authorize:", authorizeUrl);
|
|
1518
1544
|
recordRedirectAttempt(authorizeKey, now, logger);
|
|
@@ -1524,18 +1550,17 @@ function createRedirectMethods(deps) {
|
|
|
1524
1550
|
}
|
|
1525
1551
|
return { success: true };
|
|
1526
1552
|
}
|
|
1527
|
-
async function redirectToLogin() {
|
|
1553
|
+
async function redirectToLogin(options) {
|
|
1528
1554
|
if (typeof window === "undefined") {
|
|
1529
1555
|
logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
|
|
1530
1556
|
return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
|
|
1531
1557
|
}
|
|
1532
1558
|
if (authMode === "token") {
|
|
1533
|
-
return redirectToAuthorize();
|
|
1559
|
+
return redirectToAuthorize(options);
|
|
1534
1560
|
}
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
window.location.href = loginUrl;
|
|
1561
|
+
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
|
|
1562
|
+
logger.debug("Redirecting to auth page:", targetUrl);
|
|
1563
|
+
window.location.href = targetUrl;
|
|
1539
1564
|
return { success: true };
|
|
1540
1565
|
}
|
|
1541
1566
|
function getLoginUrl(redirectUrl) {
|
|
@@ -1982,6 +2007,7 @@ function createContractWizardMethods(deps) {
|
|
|
1982
2007
|
var EXT_SUBSCRIBE_ENDPOINT2 = "/api/v1/ext/newsletter/subscribe";
|
|
1983
2008
|
var CONFIRM_ENDPOINT = "/api/newsletter/confirm";
|
|
1984
2009
|
var UNSUBSCRIBE_ENDPOINT = "/api/newsletter/unsubscribe";
|
|
2010
|
+
var DISPATCH_ENDPOINT = "/api/v1/newsletter/dispatch";
|
|
1985
2011
|
function trimOrEmpty(s) {
|
|
1986
2012
|
return typeof s === "string" ? s.trim() : "";
|
|
1987
2013
|
}
|
|
@@ -2087,7 +2113,36 @@ function createNewsletterMethods(deps) {
|
|
|
2087
2113
|
}
|
|
2088
2114
|
);
|
|
2089
2115
|
}
|
|
2090
|
-
|
|
2116
|
+
async function dispatch(params) {
|
|
2117
|
+
const subject = trimOrEmpty(params.subject);
|
|
2118
|
+
if (!subject) {
|
|
2119
|
+
return { error: createError("VALIDATION_ERROR", "subject \u306F\u5FC5\u9808\u3067\u3059") };
|
|
2120
|
+
}
|
|
2121
|
+
if (!params.body || typeof params.body !== "object") {
|
|
2122
|
+
return { error: createError("VALIDATION_ERROR", "body \u306F\u5FC5\u9808\u3067\u3059") };
|
|
2123
|
+
}
|
|
2124
|
+
const bodySource = params.body;
|
|
2125
|
+
const hasHtmlBody = typeof bodySource.htmlBody === "string" && bodySource.htmlBody.length > 0;
|
|
2126
|
+
const hasTemplateId = typeof bodySource.templateId === "string" && bodySource.templateId.length > 0;
|
|
2127
|
+
if (hasHtmlBody === hasTemplateId) {
|
|
2128
|
+
return {
|
|
2129
|
+
error: createError(
|
|
2130
|
+
"BODY_SOURCE_REQUIRED",
|
|
2131
|
+
"body \u306F htmlBody \u307E\u305F\u306F templateId \u306E\u3044\u305A\u308C\u304B\u4E00\u65B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
2132
|
+
)
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2135
|
+
return fetchWithAuth(DISPATCH_ENDPOINT, {
|
|
2136
|
+
method: "POST",
|
|
2137
|
+
body: JSON.stringify({
|
|
2138
|
+
subject,
|
|
2139
|
+
articleUrl: params.articleUrl,
|
|
2140
|
+
body: params.body,
|
|
2141
|
+
segment: params.segment
|
|
2142
|
+
})
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
return { subscribe, confirm, unsubscribe, dispatch };
|
|
2091
2146
|
}
|
|
2092
2147
|
|
|
2093
2148
|
// src/inquiry/ffid-inquiry-client.ts
|
|
@@ -2189,8 +2244,21 @@ function createFFIDClient(config) {
|
|
|
2189
2244
|
if (!config.serviceCode || !config.serviceCode.trim()) {
|
|
2190
2245
|
throw new Error("FFID Client: serviceCode \u304C\u672A\u8A2D\u5B9A\u3067\u3059");
|
|
2191
2246
|
}
|
|
2247
|
+
const scope = config.scope?.trim() ?? "";
|
|
2192
2248
|
const baseUrl = config.apiBaseUrl ?? DEFAULT_API_BASE_URL;
|
|
2193
2249
|
const authMode = config.authMode ?? "cookie";
|
|
2250
|
+
const VALID_AUTH_MODES = ["cookie", "token", "service-key"];
|
|
2251
|
+
if (!VALID_AUTH_MODES.includes(authMode)) {
|
|
2252
|
+
throw new Error(
|
|
2253
|
+
`FFID Client: authMode \u304C\u4E0D\u6B63\u3067\u3059 (\u53D7\u4FE1: ${JSON.stringify(authMode)}, \u6709\u52B9\u5024: ${VALID_AUTH_MODES.join(" | ")})`
|
|
2254
|
+
);
|
|
2255
|
+
}
|
|
2256
|
+
if (authMode !== "service-key" && !scope) {
|
|
2257
|
+
const received = config.scope === void 0 ? "undefined" : JSON.stringify(config.scope);
|
|
2258
|
+
throw new Error(
|
|
2259
|
+
`FFID Client: scope \u304C\u672A\u8A2D\u5B9A\u3067\u3059 (\u53D7\u4FE1: ${received})\u3002\`DEFAULT_OAUTH_SCOPES\` \u3092 import \u3059\u308B\u304B\u3001\u660E\u793A\u7684\u306B scope \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044 (#2674)`
|
|
2260
|
+
);
|
|
2261
|
+
}
|
|
2194
2262
|
const clientId = config.clientId ?? config.serviceCode;
|
|
2195
2263
|
const rawRedirectUri = config.redirectUri ?? null;
|
|
2196
2264
|
const serviceApiKey = config.serviceApiKey?.trim();
|
|
@@ -2361,6 +2429,7 @@ function createFFIDClient(config) {
|
|
|
2361
2429
|
baseUrl,
|
|
2362
2430
|
clientId,
|
|
2363
2431
|
serviceCode: config.serviceCode,
|
|
2432
|
+
scope,
|
|
2364
2433
|
resolvedRedirectUri,
|
|
2365
2434
|
logger
|
|
2366
2435
|
});
|
|
@@ -2545,6 +2614,7 @@ var FFIDClientContext = createContext(null);
|
|
|
2545
2614
|
function FFIDProvider({
|
|
2546
2615
|
children,
|
|
2547
2616
|
serviceCode,
|
|
2617
|
+
scope,
|
|
2548
2618
|
apiBaseUrl,
|
|
2549
2619
|
debug = false,
|
|
2550
2620
|
logger,
|
|
@@ -2571,13 +2641,14 @@ function FFIDProvider({
|
|
|
2571
2641
|
const client = useMemo(
|
|
2572
2642
|
() => createFFIDClient({
|
|
2573
2643
|
serviceCode,
|
|
2644
|
+
scope,
|
|
2574
2645
|
apiBaseUrl,
|
|
2575
2646
|
debug,
|
|
2576
2647
|
logger,
|
|
2577
2648
|
authMode,
|
|
2578
2649
|
clientId
|
|
2579
2650
|
}),
|
|
2580
|
-
[serviceCode, apiBaseUrl, debug, logger, authMode, clientId]
|
|
2651
|
+
[serviceCode, scope, apiBaseUrl, debug, logger, authMode, clientId]
|
|
2581
2652
|
);
|
|
2582
2653
|
const refresh = useCallback(async () => {
|
|
2583
2654
|
client.logger.debug("Refreshing session...");
|
|
@@ -2622,8 +2693,8 @@ function FFIDProvider({
|
|
|
2622
2693
|
setIsLoading(false);
|
|
2623
2694
|
}
|
|
2624
2695
|
}, [client]);
|
|
2625
|
-
const login = useCallback(() => {
|
|
2626
|
-
client.redirectToLogin().catch((err) => {
|
|
2696
|
+
const login = useCallback((options) => {
|
|
2697
|
+
client.redirectToLogin(options).catch((err) => {
|
|
2627
2698
|
client.logger.error("\u30ED\u30B0\u30A4\u30F3\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F:", err);
|
|
2628
2699
|
});
|
|
2629
2700
|
}, [client]);
|
|
@@ -4568,4 +4639,4 @@ function FFIDInquiryForm({
|
|
|
4568
4639
|
);
|
|
4569
4640
|
}
|
|
4570
4641
|
|
|
4571
|
-
export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useFFIDContext, useSubscription, withSubscription };
|
|
4642
|
+
export { DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useFFIDContext, useSubscription, withSubscription };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHZZQ2BX7_cjs = require('../chunk-HZZQ2BX7.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkHZZQ2BX7_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkHZZQ2BX7_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkHZZQ2BX7_cjs.FFIDInquiryForm; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkHZZQ2BX7_cjs.FFIDLoginButton; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkHZZQ2BX7_cjs.FFIDOrganizationSwitcher; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkHZZQ2BX7_cjs.FFIDSubscriptionBadge; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkHZZQ2BX7_cjs.FFIDUserMenu; }
|
|
34
34
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-
|
|
1
|
+
export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-COnReU8h.cjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-
|
|
1
|
+
export { N as FFIDAnnouncementBadge, am as FFIDAnnouncementBadgeClassNames, an as FFIDAnnouncementBadgeProps, O as FFIDAnnouncementList, ao as FFIDAnnouncementListClassNames, ap as FFIDAnnouncementListProps, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, aq as FFIDLoginButtonProps, aa as FFIDOrganizationSwitcher, ar as FFIDOrganizationSwitcherClassNames, as as FFIDOrganizationSwitcherProps, ad as FFIDSubscriptionBadge, at as FFIDSubscriptionBadgeClassNames, au as FFIDSubscriptionBadgeProps, af as FFIDUserMenu, av as FFIDUserMenuClassNames, aw as FFIDUserMenuProps } from '../index-COnReU8h.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-
|
|
1
|
+
export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-RRN3DTET.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FFID SDK Shared Constants
|
|
3
|
+
*
|
|
4
|
+
* Constants shared across all SDK entry points.
|
|
5
|
+
* Centralizing these prevents drift during domain/URL changes.
|
|
6
|
+
*/
|
|
7
|
+
/** Default FFID API base URL (production) */
|
|
8
|
+
declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
|
|
9
|
+
/**
|
|
10
|
+
* Recommended default OAuth scope set for FFID-connected services (v3.0.0+).
|
|
11
|
+
*
|
|
12
|
+
* Coverage:
|
|
13
|
+
* - `openid email profile` — OIDC standard claims (always required)
|
|
14
|
+
* - `subscription:read` — `/api/v1/subscriptions/ext/*` 系(プラン / 課金 gate)
|
|
15
|
+
* - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
|
|
16
|
+
*
|
|
17
|
+
* Add feature-specific scopes on top of this when needed (browser SDK):
|
|
18
|
+
* - `analytics:read` for `/api/v1/ext/analytics/config`
|
|
19
|
+
* - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
|
|
20
|
+
* - `subscription:write` for self-serve plan changes
|
|
21
|
+
* - `legal:write` for recording user consent
|
|
22
|
+
* - `profile:read` / `profile:write` for profile UI
|
|
23
|
+
* - `organization:api-key` for org-level API key issuance
|
|
24
|
+
*
|
|
25
|
+
* **Note**: kept as a widened `string` (not `as const`) so consumers can
|
|
26
|
+
* concatenate additional scopes (e.g. `\`${DEFAULT_OAUTH_SCOPES} analytics:read\``)
|
|
27
|
+
* and so it remains assignable to `FFIDConfig.scope: string`. `widget:verify`
|
|
28
|
+
* is intentionally excluded — it is a service-key-only scope (`/api/v1/widget/*`),
|
|
29
|
+
* not used by the browser OAuth flow.
|
|
30
|
+
*
|
|
31
|
+
* Survey: feel-flow/feelflow-id-platform#2656 issuecomment-4324082742
|
|
32
|
+
*/
|
|
33
|
+
declare const DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
|
|
34
|
+
|
|
35
|
+
export { DEFAULT_API_BASE_URL as D, DEFAULT_OAUTH_SCOPES as a };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FFID SDK Shared Constants
|
|
3
|
+
*
|
|
4
|
+
* Constants shared across all SDK entry points.
|
|
5
|
+
* Centralizing these prevents drift during domain/URL changes.
|
|
6
|
+
*/
|
|
7
|
+
/** Default FFID API base URL (production) */
|
|
8
|
+
declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
|
|
9
|
+
/**
|
|
10
|
+
* Recommended default OAuth scope set for FFID-connected services (v3.0.0+).
|
|
11
|
+
*
|
|
12
|
+
* Coverage:
|
|
13
|
+
* - `openid email profile` — OIDC standard claims (always required)
|
|
14
|
+
* - `subscription:read` — `/api/v1/subscriptions/ext/*` 系(プラン / 課金 gate)
|
|
15
|
+
* - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
|
|
16
|
+
*
|
|
17
|
+
* Add feature-specific scopes on top of this when needed (browser SDK):
|
|
18
|
+
* - `analytics:read` for `/api/v1/ext/analytics/config`
|
|
19
|
+
* - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
|
|
20
|
+
* - `subscription:write` for self-serve plan changes
|
|
21
|
+
* - `legal:write` for recording user consent
|
|
22
|
+
* - `profile:read` / `profile:write` for profile UI
|
|
23
|
+
* - `organization:api-key` for org-level API key issuance
|
|
24
|
+
*
|
|
25
|
+
* **Note**: kept as a widened `string` (not `as const`) so consumers can
|
|
26
|
+
* concatenate additional scopes (e.g. `\`${DEFAULT_OAUTH_SCOPES} analytics:read\``)
|
|
27
|
+
* and so it remains assignable to `FFIDConfig.scope: string`. `widget:verify`
|
|
28
|
+
* is intentionally excluded — it is a service-key-only scope (`/api/v1/widget/*`),
|
|
29
|
+
* not used by the browser OAuth flow.
|
|
30
|
+
*
|
|
31
|
+
* Survey: feel-flow/feelflow-id-platform#2656 issuecomment-4324082742
|
|
32
|
+
*/
|
|
33
|
+
declare const DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
|
|
34
|
+
|
|
35
|
+
export { DEFAULT_API_BASE_URL as D, DEFAULT_OAUTH_SCOPES as a };
|