@feelflow/ffid-sdk 5.31.1 → 6.0.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 +112 -0
- package/dist/agency/index.d.cts +177 -2
- package/dist/agency/index.d.ts +177 -2
- package/dist/agency/index.js +112 -1
- package/dist/{chunk-3YIX4DFI.cjs → chunk-CI6RBG77.cjs} +6 -2
- package/dist/{chunk-SLYSWV4S.js → chunk-NBBHMLXO.js} +6 -2
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.js +1 -1
- package/dist/{constants-D61jqRIO.d.cts → constants-Ce2eXQtB.d.cts} +5 -2
- package/dist/{constants-D61jqRIO.d.ts → constants-Ce2eXQtB.d.ts} +5 -2
- package/dist/{ffid-client-BTTbDVj7.d.cts → ffid-client-C8XV7lUt.d.cts} +24 -3
- package/dist/{ffid-client-C5lc7SkY.d.ts → ffid-client-CpVixUM3.d.ts} +24 -3
- package/dist/index.cjs +58 -58
- package/dist/index.d.cts +29 -5
- package/dist/index.d.ts +29 -5
- package/dist/index.js +2 -2
- package/dist/legal/index.cjs +16 -1
- package/dist/legal/index.d.cts +33 -6
- package/dist/legal/index.d.ts +33 -6
- package/dist/legal/index.js +16 -1
- package/dist/server/index.cjs +6 -2
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +6 -2
- 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/agency/index.js
CHANGED
|
@@ -162,6 +162,14 @@ function createFFIDAgencyClient(config = {}) {
|
|
|
162
162
|
{ method: "DELETE" }
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
|
+
async function provisionOrganization(agencyId, data) {
|
|
166
|
+
const err = validateIds([agencyId, "agencyId"]);
|
|
167
|
+
if (err) return err;
|
|
168
|
+
return fetchWithCredentials(`/${encodeURIComponent(agencyId)}/organizations/provision`, {
|
|
169
|
+
method: "POST",
|
|
170
|
+
body: JSON.stringify(data)
|
|
171
|
+
});
|
|
172
|
+
}
|
|
165
173
|
async function getSubAgencies(agencyId) {
|
|
166
174
|
const err = validateIds([agencyId, "agencyId"]);
|
|
167
175
|
if (err) return err;
|
|
@@ -289,6 +297,7 @@ function createFFIDAgencyClient(config = {}) {
|
|
|
289
297
|
getOrganizations,
|
|
290
298
|
linkOrganization,
|
|
291
299
|
unlinkOrganization,
|
|
300
|
+
provisionOrganization,
|
|
292
301
|
// Sub-Agencies
|
|
293
302
|
getSubAgencies,
|
|
294
303
|
createSubAgency,
|
|
@@ -315,4 +324,106 @@ function createFFIDAgencyClient(config = {}) {
|
|
|
315
324
|
};
|
|
316
325
|
}
|
|
317
326
|
|
|
318
|
-
|
|
327
|
+
// src/agency/ffid-agency-server-client.ts
|
|
328
|
+
var API_PREFIX2 = "/api/v1/ext/agencies";
|
|
329
|
+
var AGENCY_API_KEY_HEADER = "X-Agency-Api-Key";
|
|
330
|
+
var SDK_LOG_PREFIX2 = "[FFID Agency Server SDK]";
|
|
331
|
+
var noopLogger2 = {
|
|
332
|
+
debug: () => {
|
|
333
|
+
},
|
|
334
|
+
info: () => {
|
|
335
|
+
},
|
|
336
|
+
warn: () => {
|
|
337
|
+
},
|
|
338
|
+
error: () => {
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
var consoleLogger2 = {
|
|
342
|
+
debug: (...args) => console.debug(SDK_LOG_PREFIX2, ...args),
|
|
343
|
+
info: (...args) => console.info(SDK_LOG_PREFIX2, ...args),
|
|
344
|
+
warn: (...args) => console.warn(SDK_LOG_PREFIX2, ...args),
|
|
345
|
+
error: (...args) => console.error(SDK_LOG_PREFIX2, ...args)
|
|
346
|
+
};
|
|
347
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
348
|
+
function createFFIDAgencyServerClient(config) {
|
|
349
|
+
const apiKey = config.apiKey?.trim() ?? "";
|
|
350
|
+
if (apiKey === "") {
|
|
351
|
+
throw new Error(
|
|
352
|
+
"createFFIDAgencyServerClient: apiKey is required (set it from an environment variable, never in browser code)"
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
const baseUrl = config.apiBaseUrl ?? DEFAULT_API_BASE_URL;
|
|
356
|
+
const logger = config.logger ?? (config.debug ? consoleLogger2 : noopLogger2);
|
|
357
|
+
const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
358
|
+
async function request(endpoint, body) {
|
|
359
|
+
const url = `${baseUrl}${API_PREFIX2}${endpoint}`;
|
|
360
|
+
let response;
|
|
361
|
+
try {
|
|
362
|
+
response = await fetch(url, {
|
|
363
|
+
method: "POST",
|
|
364
|
+
headers: {
|
|
365
|
+
"Content-Type": "application/json",
|
|
366
|
+
[AGENCY_API_KEY_HEADER]: apiKey
|
|
367
|
+
},
|
|
368
|
+
body: JSON.stringify(body),
|
|
369
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
370
|
+
});
|
|
371
|
+
} catch (error) {
|
|
372
|
+
logger.error("Network error:", { url, error });
|
|
373
|
+
return {
|
|
374
|
+
error: {
|
|
375
|
+
code: FFID_AGENCY_ERROR_CODES.NETWORK_ERROR,
|
|
376
|
+
// タイムアウトも組織が作られた後かもしれない。再試行の前に確認を促す。
|
|
377
|
+
message: `${error instanceof Error ? error.message : "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}\u3002\u7D44\u7E54\u304C\u4F5C\u6210\u3055\u308C\u305F\u53EF\u80FD\u6027\u304C\u3042\u308B\u305F\u3081\u3001\u518D\u8A66\u884C\u524D\u306B\u7D44\u7E54\u4E00\u89A7\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
let payload;
|
|
382
|
+
try {
|
|
383
|
+
payload = await response.json();
|
|
384
|
+
} catch (parseError) {
|
|
385
|
+
logger.error("Parse error:", { url, status: response.status, parseError });
|
|
386
|
+
return {
|
|
387
|
+
error: {
|
|
388
|
+
code: FFID_AGENCY_ERROR_CODES.PARSE_ERROR,
|
|
389
|
+
message: `\u30B5\u30FC\u30D0\u30FC\u304B\u3089\u4E0D\u6B63\u306A\u30EC\u30B9\u30DD\u30F3\u30B9\u3092\u53D7\u4FE1\u3057\u307E\u3057\u305F (status: ${response.status})\u3002\u7D44\u7E54\u304C\u4F5C\u6210\u3055\u308C\u305F\u53EF\u80FD\u6027\u304C\u3042\u308B\u305F\u3081\u3001\u518D\u8A66\u884C\u524D\u306B\u7D44\u7E54\u4E00\u89A7\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
if (payload === null || typeof payload !== "object") {
|
|
394
|
+
logger.error("Malformed response body:", { url, status: response.status });
|
|
395
|
+
return {
|
|
396
|
+
error: {
|
|
397
|
+
code: FFID_AGENCY_ERROR_CODES.PARSE_ERROR,
|
|
398
|
+
message: `\u30B5\u30FC\u30D0\u30FC\u304B\u3089\u4E0D\u6B63\u306A\u30EC\u30B9\u30DD\u30F3\u30B9\u3092\u53D7\u4FE1\u3057\u307E\u3057\u305F (status: ${response.status})`
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
const parsed = payload;
|
|
403
|
+
if (!response.ok || parsed.success !== true) {
|
|
404
|
+
return {
|
|
405
|
+
error: {
|
|
406
|
+
code: parsed.error?.code ?? FFID_AGENCY_ERROR_CODES.UNKNOWN_ERROR,
|
|
407
|
+
message: parsed.error?.message ?? `\u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u5931\u6557\u3057\u307E\u3057\u305F (${response.status})`
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
if (parsed.data === void 0) {
|
|
412
|
+
logger.error("Missing data in successful response:", { url });
|
|
413
|
+
return {
|
|
414
|
+
error: {
|
|
415
|
+
code: FFID_AGENCY_ERROR_CODES.UNKNOWN_ERROR,
|
|
416
|
+
message: "\u30B5\u30FC\u30D0\u30FC\u304B\u3089\u30C7\u30FC\u30BF\u304C\u8FD4\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
return { data: parsed.data };
|
|
421
|
+
}
|
|
422
|
+
return {
|
|
423
|
+
async provisionCustomerOrganization(data) {
|
|
424
|
+
return request("/organizations/provision", data);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export { FFID_AGENCY_ERROR_CODES, createFFIDAgencyClient, createFFIDAgencyServerClient };
|
|
@@ -1347,7 +1347,11 @@ function createProvisioningMethods(deps) {
|
|
|
1347
1347
|
}
|
|
1348
1348
|
return fetchWithAuth(USER_WELCOME_EMAIL_ENDPOINT, {
|
|
1349
1349
|
method: "POST",
|
|
1350
|
-
body: JSON.stringify({
|
|
1350
|
+
body: JSON.stringify({
|
|
1351
|
+
email: params.email.trim(),
|
|
1352
|
+
...params.template !== void 0 ? { template: params.template } : {},
|
|
1353
|
+
...params.returnTo !== void 0 ? { returnTo: params.returnTo } : {}
|
|
1354
|
+
})
|
|
1351
1355
|
});
|
|
1352
1356
|
}
|
|
1353
1357
|
async function provisionOrganization(params) {
|
|
@@ -1673,7 +1677,7 @@ function validateTokenResponse(tokenResponse) {
|
|
|
1673
1677
|
}
|
|
1674
1678
|
|
|
1675
1679
|
// src/client/version-check.ts
|
|
1676
|
-
var SDK_VERSION = "
|
|
1680
|
+
var SDK_VERSION = "6.0.0";
|
|
1677
1681
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1678
1682
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1679
1683
|
function sdkHeaders() {
|
|
@@ -1345,7 +1345,11 @@ function createProvisioningMethods(deps) {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
return fetchWithAuth(USER_WELCOME_EMAIL_ENDPOINT, {
|
|
1347
1347
|
method: "POST",
|
|
1348
|
-
body: JSON.stringify({
|
|
1348
|
+
body: JSON.stringify({
|
|
1349
|
+
email: params.email.trim(),
|
|
1350
|
+
...params.template !== void 0 ? { template: params.template } : {},
|
|
1351
|
+
...params.returnTo !== void 0 ? { returnTo: params.returnTo } : {}
|
|
1352
|
+
})
|
|
1349
1353
|
});
|
|
1350
1354
|
}
|
|
1351
1355
|
async function provisionOrganization(params) {
|
|
@@ -1671,7 +1675,7 @@ function validateTokenResponse(tokenResponse) {
|
|
|
1671
1675
|
}
|
|
1672
1676
|
|
|
1673
1677
|
// src/client/version-check.ts
|
|
1674
|
-
var SDK_VERSION = "
|
|
1678
|
+
var SDK_VERSION = "6.0.0";
|
|
1675
1679
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1676
1680
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1677
1681
|
function sdkHeaders() {
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCI6RBG77_cjs = require('../chunk-CI6RBG77.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 chunkCI6RBG77_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDInquiryForm; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDLoginButton; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDOrganizationSwitcher; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDSubscriptionBadge; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDUserMenu; }
|
|
34
34
|
});
|
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-NBBHMLXO.js';
|
|
@@ -11,13 +11,16 @@ declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
|
|
|
11
11
|
*
|
|
12
12
|
* Coverage:
|
|
13
13
|
* - `openid email profile` — OIDC standard claims (always required)
|
|
14
|
-
* - `subscription:read` — `/api/v1/subscriptions/ext/*`
|
|
14
|
+
* - `subscription:read` — `/api/v1/subscriptions/ext/*` 系の **読み取り**
|
|
15
|
+
* (`check` / `plans` / 契約詳細・シート参照。プラン / 課金 gate)
|
|
15
16
|
* - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
|
|
16
17
|
*
|
|
17
18
|
* Add feature-specific scopes on top of this when needed (browser SDK):
|
|
18
19
|
* - `analytics:read` for `/api/v1/ext/analytics/config`
|
|
19
20
|
* - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
|
|
20
|
-
* - `subscription:write` for
|
|
21
|
+
* - `subscription:write` for every subscription **mutation** — `subscribe()`
|
|
22
|
+
* (`POST /ext/subscribe`), plan changes, and cancellation. `subscription:read`
|
|
23
|
+
* does NOT cover these despite the shared `/ext/*` prefix (FFID #4744)
|
|
21
24
|
* - `legal:write` for recording user consent
|
|
22
25
|
* - `profile:read` / `profile:write` for profile UI
|
|
23
26
|
* - `organization:api-key` for org-level API key issuance
|
|
@@ -11,13 +11,16 @@ declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
|
|
|
11
11
|
*
|
|
12
12
|
* Coverage:
|
|
13
13
|
* - `openid email profile` — OIDC standard claims (always required)
|
|
14
|
-
* - `subscription:read` — `/api/v1/subscriptions/ext/*`
|
|
14
|
+
* - `subscription:read` — `/api/v1/subscriptions/ext/*` 系の **読み取り**
|
|
15
|
+
* (`check` / `plans` / 契約詳細・シート参照。プラン / 課金 gate)
|
|
15
16
|
* - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
|
|
16
17
|
*
|
|
17
18
|
* Add feature-specific scopes on top of this when needed (browser SDK):
|
|
18
19
|
* - `analytics:read` for `/api/v1/ext/analytics/config`
|
|
19
20
|
* - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
|
|
20
|
-
* - `subscription:write` for
|
|
21
|
+
* - `subscription:write` for every subscription **mutation** — `subscribe()`
|
|
22
|
+
* (`POST /ext/subscribe`), plan changes, and cancellation. `subscription:read`
|
|
23
|
+
* does NOT cover these despite the shared `/ext/*` prefix (FFID #4744)
|
|
21
24
|
* - `legal:write` for recording user consent
|
|
22
25
|
* - `profile:read` / `profile:write` for profile UI
|
|
23
26
|
* - `organization:api-key` for org-level API key issuance
|
|
@@ -860,10 +860,31 @@ interface FFIDProvisionUserDryRun {
|
|
|
860
860
|
* response. This mirrors how `FFIDApiResponse` is narrowed on `data` / `error`.
|
|
861
861
|
*/
|
|
862
862
|
type FFIDProvisionUserResponse = FFIDProvisionUserOutcome | FFIDProvisionUserDryRun;
|
|
863
|
-
/**
|
|
863
|
+
/**
|
|
864
|
+
* Copy variant for `sendProvisionWelcomeEmail` (#5035).
|
|
865
|
+
*
|
|
866
|
+
* Both variants carry the same password-setup link; only the wording differs.
|
|
867
|
+
* Mirrors the server's `provisionEmailTemplateSchema` — the API rejects unknown
|
|
868
|
+
* values rather than defaulting, so a typo here surfaces as a 400 instead of
|
|
869
|
+
* mailing the wrong copy.
|
|
870
|
+
*/
|
|
871
|
+
type FFIDProvisionEmailTemplate = 'account-provisioned' | 'password-reset';
|
|
872
|
+
/** Parameters for `sendProvisionWelcomeEmail` (#4449, #4470, #5035). */
|
|
864
873
|
interface FFIDProvisionWelcomeEmailParams {
|
|
865
874
|
/** Email of the provisioned FFID user to notify (must already exist). */
|
|
866
875
|
email: string;
|
|
876
|
+
/**
|
|
877
|
+
* Which copy to send (#5035). Omit for the historical
|
|
878
|
+
* `account-provisioned`(「アカウント発行のお知らせ」); pass `'password-reset'`
|
|
879
|
+
* for an already-active member whose admin requested a reset
|
|
880
|
+
* (「パスワード再設定のご案内」).
|
|
881
|
+
*/
|
|
882
|
+
template?: FFIDProvisionEmailTemplate;
|
|
883
|
+
/**
|
|
884
|
+
* Post-setup landing URL (#4470). Validated against the calling service's
|
|
885
|
+
* `allowed_redirect_uris` server-side. Omit to keep the FFID login page.
|
|
886
|
+
*/
|
|
887
|
+
returnTo?: string;
|
|
867
888
|
}
|
|
868
889
|
/**
|
|
869
890
|
* Response from `sendProvisionWelcomeEmail` (#4449).
|
|
@@ -1461,8 +1482,8 @@ declare const FFID_CATALOG_ENVIRONMENTS: readonly ["staging", "production"];
|
|
|
1461
1482
|
type FFIDCatalogEnvironment = (typeof FFID_CATALOG_ENVIRONMENTS)[number];
|
|
1462
1483
|
/**
|
|
1463
1484
|
* Tax behavior of a published price.
|
|
1464
|
-
* `inclusive`: displayed price contains Stripe-calculated tax
|
|
1465
|
-
* `exclusive`: tax is added on top of the base price
|
|
1485
|
+
* `inclusive`: displayed price contains Stripe-calculated tax.
|
|
1486
|
+
* `exclusive`: tax is added on top of the base price.
|
|
1466
1487
|
*/
|
|
1467
1488
|
type FFIDTaxBehavior = 'inclusive' | 'exclusive';
|
|
1468
1489
|
/**
|
|
@@ -860,10 +860,31 @@ interface FFIDProvisionUserDryRun {
|
|
|
860
860
|
* response. This mirrors how `FFIDApiResponse` is narrowed on `data` / `error`.
|
|
861
861
|
*/
|
|
862
862
|
type FFIDProvisionUserResponse = FFIDProvisionUserOutcome | FFIDProvisionUserDryRun;
|
|
863
|
-
/**
|
|
863
|
+
/**
|
|
864
|
+
* Copy variant for `sendProvisionWelcomeEmail` (#5035).
|
|
865
|
+
*
|
|
866
|
+
* Both variants carry the same password-setup link; only the wording differs.
|
|
867
|
+
* Mirrors the server's `provisionEmailTemplateSchema` — the API rejects unknown
|
|
868
|
+
* values rather than defaulting, so a typo here surfaces as a 400 instead of
|
|
869
|
+
* mailing the wrong copy.
|
|
870
|
+
*/
|
|
871
|
+
type FFIDProvisionEmailTemplate = 'account-provisioned' | 'password-reset';
|
|
872
|
+
/** Parameters for `sendProvisionWelcomeEmail` (#4449, #4470, #5035). */
|
|
864
873
|
interface FFIDProvisionWelcomeEmailParams {
|
|
865
874
|
/** Email of the provisioned FFID user to notify (must already exist). */
|
|
866
875
|
email: string;
|
|
876
|
+
/**
|
|
877
|
+
* Which copy to send (#5035). Omit for the historical
|
|
878
|
+
* `account-provisioned`(「アカウント発行のお知らせ」); pass `'password-reset'`
|
|
879
|
+
* for an already-active member whose admin requested a reset
|
|
880
|
+
* (「パスワード再設定のご案内」).
|
|
881
|
+
*/
|
|
882
|
+
template?: FFIDProvisionEmailTemplate;
|
|
883
|
+
/**
|
|
884
|
+
* Post-setup landing URL (#4470). Validated against the calling service's
|
|
885
|
+
* `allowed_redirect_uris` server-side. Omit to keep the FFID login page.
|
|
886
|
+
*/
|
|
887
|
+
returnTo?: string;
|
|
867
888
|
}
|
|
868
889
|
/**
|
|
869
890
|
* Response from `sendProvisionWelcomeEmail` (#4449).
|
|
@@ -1461,8 +1482,8 @@ declare const FFID_CATALOG_ENVIRONMENTS: readonly ["staging", "production"];
|
|
|
1461
1482
|
type FFIDCatalogEnvironment = (typeof FFID_CATALOG_ENVIRONMENTS)[number];
|
|
1462
1483
|
/**
|
|
1463
1484
|
* Tax behavior of a published price.
|
|
1464
|
-
* `inclusive`: displayed price contains Stripe-calculated tax
|
|
1465
|
-
* `exclusive`: tax is added on top of the base price
|
|
1485
|
+
* `inclusive`: displayed price contains Stripe-calculated tax.
|
|
1486
|
+
* `exclusive`: tax is added on top of the base price.
|
|
1466
1487
|
*/
|
|
1467
1488
|
type FFIDTaxBehavior = 'inclusive' | 'exclusive';
|
|
1468
1489
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCI6RBG77_cjs = require('./chunk-CI6RBG77.cjs');
|
|
4
4
|
var chunkH5O2CCAY_cjs = require('./chunk-H5O2CCAY.cjs');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -54,8 +54,8 @@ function defaultRedirect(url) {
|
|
|
54
54
|
}
|
|
55
55
|
function useRequireActiveSubscription(options) {
|
|
56
56
|
const { redirectTo, allowGrace = true, onRedirect } = options;
|
|
57
|
-
const { isLoading, error } =
|
|
58
|
-
const { effectiveStatus, isBlocked, isGrace } =
|
|
57
|
+
const { isLoading, error } = chunkCI6RBG77_cjs.useFFIDContext();
|
|
58
|
+
const { effectiveStatus, isBlocked, isGrace } = chunkCI6RBG77_cjs.useSubscription();
|
|
59
59
|
const hasFetchError = error !== null && effectiveStatus === null;
|
|
60
60
|
const shouldRedirect = !isLoading && !hasFetchError && (isBlocked || !allowGrace && isGrace || effectiveStatus === null);
|
|
61
61
|
react.useEffect(() => {
|
|
@@ -76,7 +76,7 @@ function useRequireActiveSubscription(options) {
|
|
|
76
76
|
}
|
|
77
77
|
function withFFIDAuth(Component, options = {}) {
|
|
78
78
|
const WrappedComponent = (props) => {
|
|
79
|
-
const { isLoading, isAuthenticated, login } =
|
|
79
|
+
const { isLoading, isAuthenticated, login } = chunkCI6RBG77_cjs.useFFIDContext();
|
|
80
80
|
const hasRedirected = react.useRef(false);
|
|
81
81
|
react.useEffect(() => {
|
|
82
82
|
if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
|
|
@@ -105,219 +105,219 @@ var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
|
|
|
105
105
|
|
|
106
106
|
Object.defineProperty(exports, "ACCESS_GRANTING_EFFECTIVE_STATUSES", {
|
|
107
107
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
108
|
+
get: function () { return chunkCI6RBG77_cjs.ACCESS_GRANTING_EFFECTIVE_STATUSES; }
|
|
109
109
|
});
|
|
110
110
|
Object.defineProperty(exports, "BLOCKING_EFFECTIVE_STATUSES", {
|
|
111
111
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
112
|
+
get: function () { return chunkCI6RBG77_cjs.BLOCKING_EFFECTIVE_STATUSES; }
|
|
113
113
|
});
|
|
114
114
|
Object.defineProperty(exports, "CATALOG_HASH_PATTERN", {
|
|
115
115
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
116
|
+
get: function () { return chunkCI6RBG77_cjs.CATALOG_HASH_PATTERN; }
|
|
117
117
|
});
|
|
118
118
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
119
119
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
120
|
+
get: function () { return chunkCI6RBG77_cjs.DEFAULT_API_BASE_URL; }
|
|
121
121
|
});
|
|
122
122
|
Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
|
|
123
123
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunkCI6RBG77_cjs.DEFAULT_OAUTH_SCOPES; }
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "EFFECTIVE_SUBSCRIPTION_STATUSES", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkCI6RBG77_cjs.EFFECTIVE_SUBSCRIPTION_STATUSES; }
|
|
129
129
|
});
|
|
130
130
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
131
131
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDAnnouncementBadge; }
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDAnnouncementList; }
|
|
137
137
|
});
|
|
138
138
|
Object.defineProperty(exports, "FFIDCatalogHashError", {
|
|
139
139
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
140
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDCatalogHashError; }
|
|
141
141
|
});
|
|
142
142
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
143
143
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDInquiryForm; }
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDLoginButton; }
|
|
149
149
|
});
|
|
150
150
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
151
151
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
152
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDOrganizationSwitcher; }
|
|
153
153
|
});
|
|
154
154
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
155
155
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
156
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDProvider; }
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "FFIDSDKError", {
|
|
159
159
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
160
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDSDKError; }
|
|
161
161
|
});
|
|
162
162
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
163
163
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
164
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDSubscriptionBadge; }
|
|
165
165
|
});
|
|
166
166
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
167
167
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
168
|
+
get: function () { return chunkCI6RBG77_cjs.FFIDUserMenu; }
|
|
169
169
|
});
|
|
170
170
|
Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
|
|
171
171
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
172
|
+
get: function () { return chunkCI6RBG77_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
|
|
173
173
|
});
|
|
174
174
|
Object.defineProperty(exports, "FFID_CATALOG_ENVIRONMENTS", {
|
|
175
175
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
176
|
+
get: function () { return chunkCI6RBG77_cjs.FFID_CATALOG_ENVIRONMENTS; }
|
|
177
177
|
});
|
|
178
178
|
Object.defineProperty(exports, "FFID_CATALOG_PUBLICATION_STATUSES", {
|
|
179
179
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
180
|
+
get: function () { return chunkCI6RBG77_cjs.FFID_CATALOG_PUBLICATION_STATUSES; }
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "FFID_ERROR_CODES", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunkCI6RBG77_cjs.FFID_ERROR_CODES; }
|
|
185
185
|
});
|
|
186
186
|
Object.defineProperty(exports, "FFID_INQUIRY_ACQUISITION_SOURCES", {
|
|
187
187
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunkCI6RBG77_cjs.FFID_INQUIRY_ACQUISITION_SOURCES; }
|
|
189
189
|
});
|
|
190
190
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
|
|
191
191
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
192
|
+
get: function () { return chunkCI6RBG77_cjs.FFID_INQUIRY_CATEGORIES; }
|
|
193
193
|
});
|
|
194
194
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
|
|
195
195
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
196
|
+
get: function () { return chunkCI6RBG77_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
|
|
197
197
|
});
|
|
198
198
|
Object.defineProperty(exports, "canonicalizeCatalogValue", {
|
|
199
199
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
200
|
+
get: function () { return chunkCI6RBG77_cjs.canonicalizeCatalogValue; }
|
|
201
201
|
});
|
|
202
202
|
Object.defineProperty(exports, "clearState", {
|
|
203
203
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
204
|
+
get: function () { return chunkCI6RBG77_cjs.cleanupStateStorage; }
|
|
205
205
|
});
|
|
206
206
|
Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
|
|
207
207
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
208
|
+
get: function () { return chunkCI6RBG77_cjs.computeEffectiveStatusFromSession; }
|
|
209
209
|
});
|
|
210
210
|
Object.defineProperty(exports, "computeFFIDCheckoutCopyHash", {
|
|
211
211
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
212
|
+
get: function () { return chunkCI6RBG77_cjs.computeFFIDCheckoutCopyHash; }
|
|
213
213
|
});
|
|
214
214
|
Object.defineProperty(exports, "computeLegalDisclosureHash", {
|
|
215
215
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
216
|
+
get: function () { return chunkCI6RBG77_cjs.computeLegalDisclosureHash; }
|
|
217
217
|
});
|
|
218
218
|
Object.defineProperty(exports, "computePaymentConfigurationHash", {
|
|
219
219
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
220
|
+
get: function () { return chunkCI6RBG77_cjs.computePaymentConfigurationHash; }
|
|
221
221
|
});
|
|
222
222
|
Object.defineProperty(exports, "computePraxisCopyHash", {
|
|
223
223
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
224
|
+
get: function () { return chunkCI6RBG77_cjs.computePraxisCopyHash; }
|
|
225
225
|
});
|
|
226
226
|
Object.defineProperty(exports, "computeScopeHash", {
|
|
227
227
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
228
|
+
get: function () { return chunkCI6RBG77_cjs.computeScopeHash; }
|
|
229
229
|
});
|
|
230
230
|
Object.defineProperty(exports, "computeTaxConfigurationHash", {
|
|
231
231
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
232
|
+
get: function () { return chunkCI6RBG77_cjs.computeTaxConfigurationHash; }
|
|
233
233
|
});
|
|
234
234
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
235
235
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
236
|
+
get: function () { return chunkCI6RBG77_cjs.createFFIDAnnouncementsClient; }
|
|
237
237
|
});
|
|
238
238
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
239
239
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
240
|
+
get: function () { return chunkCI6RBG77_cjs.createFFIDClient; }
|
|
241
241
|
});
|
|
242
242
|
Object.defineProperty(exports, "createTokenStore", {
|
|
243
243
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
244
|
+
get: function () { return chunkCI6RBG77_cjs.createTokenStore; }
|
|
245
245
|
});
|
|
246
246
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
247
247
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
248
|
+
get: function () { return chunkCI6RBG77_cjs.generateCodeChallenge; }
|
|
249
249
|
});
|
|
250
250
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
251
251
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
252
|
+
get: function () { return chunkCI6RBG77_cjs.generateCodeVerifier; }
|
|
253
253
|
});
|
|
254
254
|
Object.defineProperty(exports, "handleRedirectCallback", {
|
|
255
255
|
enumerable: true,
|
|
256
|
-
get: function () { return
|
|
256
|
+
get: function () { return chunkCI6RBG77_cjs.handleRedirectCallback; }
|
|
257
257
|
});
|
|
258
258
|
Object.defineProperty(exports, "hasAccessFromUserinfo", {
|
|
259
259
|
enumerable: true,
|
|
260
|
-
get: function () { return
|
|
260
|
+
get: function () { return chunkCI6RBG77_cjs.hasAccessFromUserinfo; }
|
|
261
261
|
});
|
|
262
262
|
Object.defineProperty(exports, "hashCanonicalJson", {
|
|
263
263
|
enumerable: true,
|
|
264
|
-
get: function () { return
|
|
264
|
+
get: function () { return chunkCI6RBG77_cjs.hashCanonicalJson; }
|
|
265
265
|
});
|
|
266
266
|
Object.defineProperty(exports, "isBlockedFromUserinfo", {
|
|
267
267
|
enumerable: true,
|
|
268
|
-
get: function () { return
|
|
268
|
+
get: function () { return chunkCI6RBG77_cjs.isBlockedFromUserinfo; }
|
|
269
269
|
});
|
|
270
270
|
Object.defineProperty(exports, "isFFIDInquiryAcquisitionSource", {
|
|
271
271
|
enumerable: true,
|
|
272
|
-
get: function () { return
|
|
272
|
+
get: function () { return chunkCI6RBG77_cjs.isFFIDInquiryAcquisitionSource; }
|
|
273
273
|
});
|
|
274
274
|
Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
|
|
275
275
|
enumerable: true,
|
|
276
|
-
get: function () { return
|
|
276
|
+
get: function () { return chunkCI6RBG77_cjs.isFFIDInquiryCategorySite2026; }
|
|
277
277
|
});
|
|
278
278
|
Object.defineProperty(exports, "normalizeRedirectUri", {
|
|
279
279
|
enumerable: true,
|
|
280
|
-
get: function () { return
|
|
280
|
+
get: function () { return chunkCI6RBG77_cjs.normalizeRedirectUri; }
|
|
281
281
|
});
|
|
282
282
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
283
283
|
enumerable: true,
|
|
284
|
-
get: function () { return
|
|
284
|
+
get: function () { return chunkCI6RBG77_cjs.retrieveCodeVerifier; }
|
|
285
285
|
});
|
|
286
286
|
Object.defineProperty(exports, "retrieveState", {
|
|
287
287
|
enumerable: true,
|
|
288
|
-
get: function () { return
|
|
288
|
+
get: function () { return chunkCI6RBG77_cjs.retrieveState; }
|
|
289
289
|
});
|
|
290
290
|
Object.defineProperty(exports, "sha256Hex", {
|
|
291
291
|
enumerable: true,
|
|
292
|
-
get: function () { return
|
|
292
|
+
get: function () { return chunkCI6RBG77_cjs.sha256Hex; }
|
|
293
293
|
});
|
|
294
294
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
295
295
|
enumerable: true,
|
|
296
|
-
get: function () { return
|
|
296
|
+
get: function () { return chunkCI6RBG77_cjs.storeCodeVerifier; }
|
|
297
297
|
});
|
|
298
298
|
Object.defineProperty(exports, "storeState", {
|
|
299
299
|
enumerable: true,
|
|
300
|
-
get: function () { return
|
|
300
|
+
get: function () { return chunkCI6RBG77_cjs.storeState; }
|
|
301
301
|
});
|
|
302
302
|
Object.defineProperty(exports, "useFFID", {
|
|
303
303
|
enumerable: true,
|
|
304
|
-
get: function () { return
|
|
304
|
+
get: function () { return chunkCI6RBG77_cjs.useFFID; }
|
|
305
305
|
});
|
|
306
306
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
307
307
|
enumerable: true,
|
|
308
|
-
get: function () { return
|
|
308
|
+
get: function () { return chunkCI6RBG77_cjs.useFFIDAnnouncements; }
|
|
309
309
|
});
|
|
310
310
|
Object.defineProperty(exports, "useSubscription", {
|
|
311
311
|
enumerable: true,
|
|
312
|
-
get: function () { return
|
|
312
|
+
get: function () { return chunkCI6RBG77_cjs.useSubscription; }
|
|
313
313
|
});
|
|
314
314
|
Object.defineProperty(exports, "validatePublishedCatalog", {
|
|
315
315
|
enumerable: true,
|
|
316
|
-
get: function () { return
|
|
316
|
+
get: function () { return chunkCI6RBG77_cjs.validatePublishedCatalog; }
|
|
317
317
|
});
|
|
318
318
|
Object.defineProperty(exports, "withSubscription", {
|
|
319
319
|
enumerable: true,
|
|
320
|
-
get: function () { return
|
|
320
|
+
get: function () { return chunkCI6RBG77_cjs.withSubscription; }
|
|
321
321
|
});
|
|
322
322
|
Object.defineProperty(exports, "ALL_DENIED_EXCEPT_NECESSARY", {
|
|
323
323
|
enumerable: true,
|