@feelflow/ffid-sdk 2.12.1 → 2.15.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/README.md +38 -0
- package/dist/{chunk-DJPOGNAO.cjs → chunk-6XEWLARZ.cjs} +148 -23
- package/dist/{chunk-MDBV4WY3.js → chunk-OOGFUCRJ.js} +147 -24
- 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/{index-BuT9VaRt.d.cts → index-LPTvxtgt.d.cts} +165 -10
- package/dist/{index-BuT9VaRt.d.ts → index-LPTvxtgt.d.ts} +165 -10
- package/dist/index.cjs +34 -26
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +72 -5
- package/dist/server/index.d.cts +138 -4
- package/dist/server/index.d.ts +138 -4
- package/dist/server/index.js +72 -5
- package/package.json +1 -1
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6XEWLARZ_cjs = require('../chunk-6XEWLARZ.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 chunk6XEWLARZ_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDInquiryForm; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDLoginButton; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDOrganizationSwitcher; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDSubscriptionBadge; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDUserMenu; }
|
|
34
34
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { K as FFIDAnnouncementBadge, aj as FFIDAnnouncementBadgeClassNames, ak as FFIDAnnouncementBadgeProps, M as FFIDAnnouncementList, al as FFIDAnnouncementListClassNames, am as FFIDAnnouncementListProps, U as FFIDInquiryForm, V as FFIDInquiryFormCategoryItem, W as FFIDInquiryFormClassNames, X as FFIDInquiryFormOrganization, Y as FFIDInquiryFormPlaceholderContext, Z as FFIDInquiryFormPrefill, _ as FFIDInquiryFormProps, $ as FFIDInquiryFormSubmitData, a0 as FFIDInquiryFormSubmitResult, a2 as FFIDLoginButton, an as FFIDLoginButtonProps, a8 as FFIDOrganizationSwitcher, ao as FFIDOrganizationSwitcherClassNames, ap as FFIDOrganizationSwitcherProps, aa as FFIDSubscriptionBadge, aq as FFIDSubscriptionBadgeClassNames, ar as FFIDSubscriptionBadgeProps, ac as FFIDUserMenu, as as FFIDUserMenuClassNames, at as FFIDUserMenuProps } from '../index-LPTvxtgt.cjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { K as FFIDAnnouncementBadge, aj as FFIDAnnouncementBadgeClassNames, ak as FFIDAnnouncementBadgeProps, M as FFIDAnnouncementList, al as FFIDAnnouncementListClassNames, am as FFIDAnnouncementListProps, U as FFIDInquiryForm, V as FFIDInquiryFormCategoryItem, W as FFIDInquiryFormClassNames, X as FFIDInquiryFormOrganization, Y as FFIDInquiryFormPlaceholderContext, Z as FFIDInquiryFormPrefill, _ as FFIDInquiryFormProps, $ as FFIDInquiryFormSubmitData, a0 as FFIDInquiryFormSubmitResult, a2 as FFIDLoginButton, an as FFIDLoginButtonProps, a8 as FFIDOrganizationSwitcher, ao as FFIDOrganizationSwitcherClassNames, ap as FFIDOrganizationSwitcherProps, aa as FFIDSubscriptionBadge, aq as FFIDSubscriptionBadgeClassNames, ar as FFIDSubscriptionBadgeProps, ac as FFIDUserMenu, as as FFIDUserMenuClassNames, at as FFIDUserMenuProps } from '../index-LPTvxtgt.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-OOGFUCRJ.js';
|
|
@@ -426,6 +426,96 @@ interface FFIDUpdateMemberRoleResponse {
|
|
|
426
426
|
interface FFIDRemoveMemberResponse {
|
|
427
427
|
message: string;
|
|
428
428
|
}
|
|
429
|
+
/**
|
|
430
|
+
* User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
|
|
431
|
+
*
|
|
432
|
+
* Mirrors the FFID backend `UserProfile` shape exposed via
|
|
433
|
+
* `GET /api/v1/users/ext/me` and `PUT /api/v1/users/ext/me`.
|
|
434
|
+
*/
|
|
435
|
+
interface FFIDUserProfile {
|
|
436
|
+
/** User ID (UUID) */
|
|
437
|
+
id: string;
|
|
438
|
+
/** Email address */
|
|
439
|
+
email: string;
|
|
440
|
+
/** Display name (nullable when not set) */
|
|
441
|
+
displayName: string | null;
|
|
442
|
+
/** Avatar URL (nullable when not set) */
|
|
443
|
+
avatarUrl: string | null;
|
|
444
|
+
/** Phone number (nullable when not set) */
|
|
445
|
+
phone: string | null;
|
|
446
|
+
/** Company name (nullable when not set) */
|
|
447
|
+
companyName: string | null;
|
|
448
|
+
/** Department (nullable when not set) */
|
|
449
|
+
department: string | null;
|
|
450
|
+
/** Job title (nullable when not set) */
|
|
451
|
+
jobTitle: string | null;
|
|
452
|
+
/** IANA timezone (e.g. 'Asia/Tokyo') */
|
|
453
|
+
timezone: string;
|
|
454
|
+
/** Locale (e.g. 'ja', 'en') */
|
|
455
|
+
locale: string;
|
|
456
|
+
/** Arbitrary user preferences bag */
|
|
457
|
+
preferences: Record<string, unknown>;
|
|
458
|
+
/** Account creation timestamp (ISO 8601) */
|
|
459
|
+
createdAt: string;
|
|
460
|
+
/** Profile last-updated timestamp (ISO 8601) */
|
|
461
|
+
updatedAt: string;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Per-call options for profile methods (`getProfile` / `updateProfile`).
|
|
465
|
+
*
|
|
466
|
+
* Supply `accessToken` to forward an end-user Bearer token for the single call
|
|
467
|
+
* without mutating client-level auth state. Designed for server runtimes (Cloudflare
|
|
468
|
+
* Workers, Edge, Node) that receive a user-scoped Bearer per request and want to
|
|
469
|
+
* act as that user against `/api/v1/users/ext/me`.
|
|
470
|
+
*
|
|
471
|
+
* When `accessToken` is supplied with a non-empty value, it overrides the client's
|
|
472
|
+
* configured auth mode: authentication for that request uses only
|
|
473
|
+
* `Authorization: Bearer <accessToken>` (no service key, no cookie, no token-store
|
|
474
|
+
* lookup, no auto-refresh on 401). Non-auth headers such as `Content-Type` and
|
|
475
|
+
* SDK metadata headers (User-Agent / X-FFID-SDK-Version) are still attached.
|
|
476
|
+
*
|
|
477
|
+
* Runtime semantics:
|
|
478
|
+
* - `accessToken` omitted (or `undefined`) → no override, configured `authMode` is used
|
|
479
|
+
* - `accessToken` is empty string / whitespace-only → rejected as `VALIDATION_ERROR`
|
|
480
|
+
* before any network call (prevents silent impersonation fallback when a caller
|
|
481
|
+
* extracts a missing/blank `Authorization` header into this field)
|
|
482
|
+
* - `accessToken` is a non-empty string → override activated
|
|
483
|
+
*/
|
|
484
|
+
interface FFIDProfileCallOptions {
|
|
485
|
+
/**
|
|
486
|
+
* End-user Bearer token forwarded for this single request.
|
|
487
|
+
*
|
|
488
|
+
* Must be a non-empty string when supplied. Passing `''` or a whitespace-only
|
|
489
|
+
* string is treated as a caller error and surfaces as `VALIDATION_ERROR` —
|
|
490
|
+
* this guards against the common footgun where a server runtime extracts the
|
|
491
|
+
* Bearer from an incoming request without checking the header is present.
|
|
492
|
+
*/
|
|
493
|
+
accessToken?: string;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Request payload for `updateProfile`.
|
|
497
|
+
*
|
|
498
|
+
* Mirrors the FFID backend `UpdateUserProfileRequest` shape. All fields are
|
|
499
|
+
* optional — only the supplied keys will be updated (partial update semantics).
|
|
500
|
+
*/
|
|
501
|
+
interface FFIDUpdateUserProfileRequest {
|
|
502
|
+
/** Display name */
|
|
503
|
+
displayName?: string;
|
|
504
|
+
/** Phone number */
|
|
505
|
+
phone?: string;
|
|
506
|
+
/** Company name */
|
|
507
|
+
companyName?: string;
|
|
508
|
+
/** Department */
|
|
509
|
+
department?: string;
|
|
510
|
+
/** Job title */
|
|
511
|
+
jobTitle?: string;
|
|
512
|
+
/** IANA timezone */
|
|
513
|
+
timezone?: string;
|
|
514
|
+
/** Locale */
|
|
515
|
+
locale?: string;
|
|
516
|
+
/** Arbitrary user preferences bag */
|
|
517
|
+
preferences?: Record<string, unknown>;
|
|
518
|
+
}
|
|
429
519
|
/**
|
|
430
520
|
* Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
|
|
431
521
|
*
|
|
@@ -638,21 +728,69 @@ declare function useFFIDAnnouncements(options?: UseFFIDAnnouncementsOptions): Us
|
|
|
638
728
|
* `<FFIDInquiryForm />` and submit through either endpoint.
|
|
639
729
|
*/
|
|
640
730
|
/**
|
|
641
|
-
*
|
|
642
|
-
*
|
|
731
|
+
* Legacy 6-value canonical categories. Retained for historical DB rows
|
|
732
|
+
* (the pre-2026 values `general`, `sales`, `support`, `press` still appear
|
|
733
|
+
* in older inquiries) and for 2.x backwards compatibility with SDK
|
|
734
|
+
* consumers that pinned to this exact set.
|
|
735
|
+
*
|
|
736
|
+
* Note: `partnership` and `other` intentionally also appear in
|
|
737
|
+
* {@link FFID_INQUIRY_CATEGORIES_SITE_2026}; the legacy-only subset is
|
|
738
|
+
* `general`, `sales`, `support`, `press`.
|
|
739
|
+
*
|
|
740
|
+
* @deprecated New integrations should use
|
|
741
|
+
* {@link FFID_INQUIRY_CATEGORIES_SITE_2026} (13 values, aligned with
|
|
742
|
+
* feelflow-website-2026 `/contact`). This legacy constant remains
|
|
743
|
+
* exported for 2.x compatibility and may be removed in 3.x.
|
|
643
744
|
*/
|
|
644
745
|
declare const FFID_INQUIRY_CATEGORIES: readonly ["general", "sales", "support", "partnership", "press", "other"];
|
|
746
|
+
/**
|
|
747
|
+
* Type alias derived from the legacy 6-value list. Still referenced by
|
|
748
|
+
* {@link FFIDInquiryCreateParams.category} so existing callers compile
|
|
749
|
+
* without changes; no `@deprecated` on the type itself because the
|
|
750
|
+
* actionable migration target is the runtime constant above, and
|
|
751
|
+
* propagating `@deprecated` to the type would surface false-positive
|
|
752
|
+
* warnings on public API that deliberately accepts both shapes.
|
|
753
|
+
*/
|
|
645
754
|
type FFIDInquiryCategory = (typeof FFID_INQUIRY_CATEGORIES)[number];
|
|
755
|
+
/**
|
|
756
|
+
* 13-value category list that mirrors feelflow-website-2026
|
|
757
|
+
* `/contact` (`feelflow-site/src/lib/contact-schema.ts` `CATEGORY_OPTIONS`).
|
|
758
|
+
*
|
|
759
|
+
* Source-of-truth ownership: **the site repo is authoritative**; this
|
|
760
|
+
* constant is a delayed-sync snapshot shipped through the SDK so
|
|
761
|
+
* consumers can get autocomplete without depending on the site repo.
|
|
762
|
+
* Drift between site and the FFID admin UI is detected automatically by
|
|
763
|
+
* `scripts/sync-inquiry-categories.ts` (SDK-side drift is a separate
|
|
764
|
+
* follow-up and today is caught only if the SDK snapshot is updated
|
|
765
|
+
* alongside the admin UI constants).
|
|
766
|
+
*/
|
|
767
|
+
declare const FFID_INQUIRY_CATEGORIES_SITE_2026: readonly ["consulting", "saas", "development", "agent-hub", "ai-feel-chatbot", "knowledge-db", "biz-simulator", "discussion-board", "realtime-ai", "partnership", "media", "recruiting", "other"];
|
|
768
|
+
type FFIDInquiryCategorySite2026 = (typeof FFID_INQUIRY_CATEGORIES_SITE_2026)[number];
|
|
769
|
+
/**
|
|
770
|
+
* Runtime type guard for the 13-value site-2026 list. Use when narrowing
|
|
771
|
+
* an unknown string (e.g., a value read from analytics or a URL query
|
|
772
|
+
* parameter) to the canonical union.
|
|
773
|
+
*/
|
|
774
|
+
declare const isFFIDInquiryCategorySite2026: (value: string) => value is FFIDInquiryCategorySite2026;
|
|
646
775
|
/**
|
|
647
776
|
* Parameters for `client.inquiry.create()`. When submitting from a
|
|
648
777
|
* server-side SDK (Service API Key), set `source` to a stable
|
|
649
778
|
* origin string so admins can trace the submission back.
|
|
779
|
+
*
|
|
780
|
+
* `category` accepts any string at the SDK boundary to keep the SDK
|
|
781
|
+
* forward-compatible with new site-side categories added before the SDK
|
|
782
|
+
* re-publishes. FFID ext-endpoint validation (`/api/v1/ext/inquiry`) is
|
|
783
|
+
* lenient — `z.string().max(100).optional()` — so unknown strings flow
|
|
784
|
+
* through to the DB unchanged. Note: the `(string & {})` arm of the
|
|
785
|
+
* union intentionally keeps autocomplete active while allowing arbitrary
|
|
786
|
+
* strings; callers using exhaustive `switch` statements should include
|
|
787
|
+
* a `default` branch.
|
|
650
788
|
*/
|
|
651
789
|
interface FFIDInquiryCreateParams {
|
|
652
790
|
email: string;
|
|
653
791
|
name: string;
|
|
654
792
|
message: string;
|
|
655
|
-
category?: FFIDInquiryCategory | (string & {});
|
|
793
|
+
category?: FFIDInquiryCategorySite2026 | FFIDInquiryCategory | (string & {});
|
|
656
794
|
company?: string;
|
|
657
795
|
phone?: string;
|
|
658
796
|
locale?: 'ja' | 'en';
|
|
@@ -1040,12 +1178,29 @@ interface FFIDInquiryFormProps {
|
|
|
1040
1178
|
turnstileSlot?: ReactNode;
|
|
1041
1179
|
onSubmit: (data: FFIDInquiryFormSubmitData) => Promise<FFIDInquiryFormSubmitResult>;
|
|
1042
1180
|
/**
|
|
1043
|
-
* Called after every change to
|
|
1044
|
-
*
|
|
1045
|
-
*
|
|
1046
|
-
*
|
|
1047
|
-
* `
|
|
1048
|
-
*
|
|
1181
|
+
* Called after every change to the submittable form state — initial
|
|
1182
|
+
* mount, every user keystroke, and every checkbox / select toggle.
|
|
1183
|
+
* Consent checkboxes are intentionally excluded — they are not part
|
|
1184
|
+
* of `FFIDInquiryFormSubmitData`. Emitted values use the same
|
|
1185
|
+
* normalization as `onSubmit` (trimmed strings; empty `company` /
|
|
1186
|
+
* `phone` become `null`). React StrictMode double-invokes effects in
|
|
1187
|
+
* dev, so expect two calls per mount.
|
|
1188
|
+
*
|
|
1189
|
+
* Suppressed in two cases:
|
|
1190
|
+
* - While the success view is rendered (truthy `successMessage`).
|
|
1191
|
+
* The form internally clears `message` after a successful submit,
|
|
1192
|
+
* and surfacing that reset would look like a "user cleared the
|
|
1193
|
+
* field" event in consumer analytics. The gate uses the same
|
|
1194
|
+
* truthy check as the render, so a consumer that returns
|
|
1195
|
+
* `{ ok: true, message: '' }` (which keeps the form visible because
|
|
1196
|
+
* the success view requires a truthy `successMessage`) keeps
|
|
1197
|
+
* broadcasting normally.
|
|
1198
|
+
* - In `requireCategorySelection` mode while no category is selected.
|
|
1199
|
+
* Emitting an empty `category` would violate the
|
|
1200
|
+
* `FFIDInquiryFormSubmitData.category: string` contract; consumers
|
|
1201
|
+
* who need to observe the unselected state can read it from a
|
|
1202
|
+
* function-form `messagePlaceholder` (`{ category: null }`) or
|
|
1203
|
+
* from their own `prefill.category` state.
|
|
1049
1204
|
*/
|
|
1050
1205
|
onChange?: (data: FFIDInquiryFormSubmitData) => void;
|
|
1051
1206
|
/**
|
|
@@ -1106,4 +1261,4 @@ interface FFIDInquiryFormPlaceholderContext {
|
|
|
1106
1261
|
}
|
|
1107
1262
|
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, separateLegalCheckboxes, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
1108
1263
|
|
|
1109
|
-
export { type
|
|
1264
|
+
export { type FFIDInquiryFormSubmitData as $, type FFIDSubscription as A, type FFIDSubscriptionContextValue as B, type FFIDAnnouncementsClientConfig as C, type FFIDAnnouncementsApiResponse as D, type AnnouncementListResponse as E, type FFIDSubscriptionStatus as F, type FFIDAnnouncementsLogger as G, type Announcement as H, type AnnouncementStatus as I, type AnnouncementType as J, FFIDAnnouncementBadge as K, type ListAnnouncementsOptions as L, FFIDAnnouncementList as M, type FFIDAnnouncementsError as N, type FFIDAnnouncementsErrorCode as O, type FFIDAnnouncementsServerResponse as P, type FFIDCacheConfig as Q, type FFIDContextValue as R, type FFIDInquiryCategory as S, type FFIDInquiryCategorySite2026 as T, FFIDInquiryForm as U, type FFIDInquiryFormCategoryItem as V, type FFIDInquiryFormClassNames as W, type FFIDInquiryFormOrganization as X, type FFIDInquiryFormPlaceholderContext as Y, type FFIDInquiryFormPrefill as Z, type FFIDInquiryFormProps as _, type FFIDConfig as a, type FFIDInquiryFormSubmitResult as a0, type FFIDJwtClaims as a1, FFIDLoginButton as a2, type FFIDMemberStatus as a3, type FFIDOAuthTokenResponse as a4, type FFIDOAuthUserInfoMemberRole as a5, type FFIDOAuthUserInfoSubscription as a6, type FFIDOrganizationMember as a7, FFIDOrganizationSwitcher as a8, type FFIDSeatModel as a9, FFIDSubscriptionBadge as aa, type FFIDTokenIntrospectionResponse as ab, FFIDUserMenu as ac, FFID_INQUIRY_CATEGORIES as ad, FFID_INQUIRY_CATEGORIES_SITE_2026 as ae, type UseFFIDAnnouncementsOptions as af, type UseFFIDAnnouncementsReturn as ag, isFFIDInquiryCategorySite2026 as ah, useFFIDAnnouncements as ai, type FFIDAnnouncementBadgeClassNames as aj, type FFIDAnnouncementBadgeProps as ak, type FFIDAnnouncementListClassNames as al, type FFIDAnnouncementListProps as am, type FFIDLoginButtonProps as an, type FFIDOrganizationSwitcherClassNames as ao, type FFIDOrganizationSwitcherProps as ap, type FFIDSubscriptionBadgeClassNames as aq, type FFIDSubscriptionBadgeProps as ar, type FFIDUserMenuClassNames as as, type FFIDUserMenuProps as at, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDProfileCallOptions as k, type FFIDUserProfile as l, type FFIDUpdateUserProfileRequest as m, type FFIDCreateCheckoutParams as n, type FFIDCheckoutSessionResponse as o, type FFIDCreatePortalParams as p, type FFIDPortalSessionResponse as q, type FFIDVerifyAccessTokenOptions as r, type FFIDOAuthUserInfo as s, type FFIDInquiryCreateParams as t, type FFIDInquiryCreateResponse as u, type FFIDAuthMode as v, type FFIDLogger as w, type FFIDCacheAdapter as x, type FFIDUser as y, type FFIDOrganization as z };
|
|
@@ -426,6 +426,96 @@ interface FFIDUpdateMemberRoleResponse {
|
|
|
426
426
|
interface FFIDRemoveMemberResponse {
|
|
427
427
|
message: string;
|
|
428
428
|
}
|
|
429
|
+
/**
|
|
430
|
+
* User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
|
|
431
|
+
*
|
|
432
|
+
* Mirrors the FFID backend `UserProfile` shape exposed via
|
|
433
|
+
* `GET /api/v1/users/ext/me` and `PUT /api/v1/users/ext/me`.
|
|
434
|
+
*/
|
|
435
|
+
interface FFIDUserProfile {
|
|
436
|
+
/** User ID (UUID) */
|
|
437
|
+
id: string;
|
|
438
|
+
/** Email address */
|
|
439
|
+
email: string;
|
|
440
|
+
/** Display name (nullable when not set) */
|
|
441
|
+
displayName: string | null;
|
|
442
|
+
/** Avatar URL (nullable when not set) */
|
|
443
|
+
avatarUrl: string | null;
|
|
444
|
+
/** Phone number (nullable when not set) */
|
|
445
|
+
phone: string | null;
|
|
446
|
+
/** Company name (nullable when not set) */
|
|
447
|
+
companyName: string | null;
|
|
448
|
+
/** Department (nullable when not set) */
|
|
449
|
+
department: string | null;
|
|
450
|
+
/** Job title (nullable when not set) */
|
|
451
|
+
jobTitle: string | null;
|
|
452
|
+
/** IANA timezone (e.g. 'Asia/Tokyo') */
|
|
453
|
+
timezone: string;
|
|
454
|
+
/** Locale (e.g. 'ja', 'en') */
|
|
455
|
+
locale: string;
|
|
456
|
+
/** Arbitrary user preferences bag */
|
|
457
|
+
preferences: Record<string, unknown>;
|
|
458
|
+
/** Account creation timestamp (ISO 8601) */
|
|
459
|
+
createdAt: string;
|
|
460
|
+
/** Profile last-updated timestamp (ISO 8601) */
|
|
461
|
+
updatedAt: string;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Per-call options for profile methods (`getProfile` / `updateProfile`).
|
|
465
|
+
*
|
|
466
|
+
* Supply `accessToken` to forward an end-user Bearer token for the single call
|
|
467
|
+
* without mutating client-level auth state. Designed for server runtimes (Cloudflare
|
|
468
|
+
* Workers, Edge, Node) that receive a user-scoped Bearer per request and want to
|
|
469
|
+
* act as that user against `/api/v1/users/ext/me`.
|
|
470
|
+
*
|
|
471
|
+
* When `accessToken` is supplied with a non-empty value, it overrides the client's
|
|
472
|
+
* configured auth mode: authentication for that request uses only
|
|
473
|
+
* `Authorization: Bearer <accessToken>` (no service key, no cookie, no token-store
|
|
474
|
+
* lookup, no auto-refresh on 401). Non-auth headers such as `Content-Type` and
|
|
475
|
+
* SDK metadata headers (User-Agent / X-FFID-SDK-Version) are still attached.
|
|
476
|
+
*
|
|
477
|
+
* Runtime semantics:
|
|
478
|
+
* - `accessToken` omitted (or `undefined`) → no override, configured `authMode` is used
|
|
479
|
+
* - `accessToken` is empty string / whitespace-only → rejected as `VALIDATION_ERROR`
|
|
480
|
+
* before any network call (prevents silent impersonation fallback when a caller
|
|
481
|
+
* extracts a missing/blank `Authorization` header into this field)
|
|
482
|
+
* - `accessToken` is a non-empty string → override activated
|
|
483
|
+
*/
|
|
484
|
+
interface FFIDProfileCallOptions {
|
|
485
|
+
/**
|
|
486
|
+
* End-user Bearer token forwarded for this single request.
|
|
487
|
+
*
|
|
488
|
+
* Must be a non-empty string when supplied. Passing `''` or a whitespace-only
|
|
489
|
+
* string is treated as a caller error and surfaces as `VALIDATION_ERROR` —
|
|
490
|
+
* this guards against the common footgun where a server runtime extracts the
|
|
491
|
+
* Bearer from an incoming request without checking the header is present.
|
|
492
|
+
*/
|
|
493
|
+
accessToken?: string;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Request payload for `updateProfile`.
|
|
497
|
+
*
|
|
498
|
+
* Mirrors the FFID backend `UpdateUserProfileRequest` shape. All fields are
|
|
499
|
+
* optional — only the supplied keys will be updated (partial update semantics).
|
|
500
|
+
*/
|
|
501
|
+
interface FFIDUpdateUserProfileRequest {
|
|
502
|
+
/** Display name */
|
|
503
|
+
displayName?: string;
|
|
504
|
+
/** Phone number */
|
|
505
|
+
phone?: string;
|
|
506
|
+
/** Company name */
|
|
507
|
+
companyName?: string;
|
|
508
|
+
/** Department */
|
|
509
|
+
department?: string;
|
|
510
|
+
/** Job title */
|
|
511
|
+
jobTitle?: string;
|
|
512
|
+
/** IANA timezone */
|
|
513
|
+
timezone?: string;
|
|
514
|
+
/** Locale */
|
|
515
|
+
locale?: string;
|
|
516
|
+
/** Arbitrary user preferences bag */
|
|
517
|
+
preferences?: Record<string, unknown>;
|
|
518
|
+
}
|
|
429
519
|
/**
|
|
430
520
|
* Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
|
|
431
521
|
*
|
|
@@ -638,21 +728,69 @@ declare function useFFIDAnnouncements(options?: UseFFIDAnnouncementsOptions): Us
|
|
|
638
728
|
* `<FFIDInquiryForm />` and submit through either endpoint.
|
|
639
729
|
*/
|
|
640
730
|
/**
|
|
641
|
-
*
|
|
642
|
-
*
|
|
731
|
+
* Legacy 6-value canonical categories. Retained for historical DB rows
|
|
732
|
+
* (the pre-2026 values `general`, `sales`, `support`, `press` still appear
|
|
733
|
+
* in older inquiries) and for 2.x backwards compatibility with SDK
|
|
734
|
+
* consumers that pinned to this exact set.
|
|
735
|
+
*
|
|
736
|
+
* Note: `partnership` and `other` intentionally also appear in
|
|
737
|
+
* {@link FFID_INQUIRY_CATEGORIES_SITE_2026}; the legacy-only subset is
|
|
738
|
+
* `general`, `sales`, `support`, `press`.
|
|
739
|
+
*
|
|
740
|
+
* @deprecated New integrations should use
|
|
741
|
+
* {@link FFID_INQUIRY_CATEGORIES_SITE_2026} (13 values, aligned with
|
|
742
|
+
* feelflow-website-2026 `/contact`). This legacy constant remains
|
|
743
|
+
* exported for 2.x compatibility and may be removed in 3.x.
|
|
643
744
|
*/
|
|
644
745
|
declare const FFID_INQUIRY_CATEGORIES: readonly ["general", "sales", "support", "partnership", "press", "other"];
|
|
746
|
+
/**
|
|
747
|
+
* Type alias derived from the legacy 6-value list. Still referenced by
|
|
748
|
+
* {@link FFIDInquiryCreateParams.category} so existing callers compile
|
|
749
|
+
* without changes; no `@deprecated` on the type itself because the
|
|
750
|
+
* actionable migration target is the runtime constant above, and
|
|
751
|
+
* propagating `@deprecated` to the type would surface false-positive
|
|
752
|
+
* warnings on public API that deliberately accepts both shapes.
|
|
753
|
+
*/
|
|
645
754
|
type FFIDInquiryCategory = (typeof FFID_INQUIRY_CATEGORIES)[number];
|
|
755
|
+
/**
|
|
756
|
+
* 13-value category list that mirrors feelflow-website-2026
|
|
757
|
+
* `/contact` (`feelflow-site/src/lib/contact-schema.ts` `CATEGORY_OPTIONS`).
|
|
758
|
+
*
|
|
759
|
+
* Source-of-truth ownership: **the site repo is authoritative**; this
|
|
760
|
+
* constant is a delayed-sync snapshot shipped through the SDK so
|
|
761
|
+
* consumers can get autocomplete without depending on the site repo.
|
|
762
|
+
* Drift between site and the FFID admin UI is detected automatically by
|
|
763
|
+
* `scripts/sync-inquiry-categories.ts` (SDK-side drift is a separate
|
|
764
|
+
* follow-up and today is caught only if the SDK snapshot is updated
|
|
765
|
+
* alongside the admin UI constants).
|
|
766
|
+
*/
|
|
767
|
+
declare const FFID_INQUIRY_CATEGORIES_SITE_2026: readonly ["consulting", "saas", "development", "agent-hub", "ai-feel-chatbot", "knowledge-db", "biz-simulator", "discussion-board", "realtime-ai", "partnership", "media", "recruiting", "other"];
|
|
768
|
+
type FFIDInquiryCategorySite2026 = (typeof FFID_INQUIRY_CATEGORIES_SITE_2026)[number];
|
|
769
|
+
/**
|
|
770
|
+
* Runtime type guard for the 13-value site-2026 list. Use when narrowing
|
|
771
|
+
* an unknown string (e.g., a value read from analytics or a URL query
|
|
772
|
+
* parameter) to the canonical union.
|
|
773
|
+
*/
|
|
774
|
+
declare const isFFIDInquiryCategorySite2026: (value: string) => value is FFIDInquiryCategorySite2026;
|
|
646
775
|
/**
|
|
647
776
|
* Parameters for `client.inquiry.create()`. When submitting from a
|
|
648
777
|
* server-side SDK (Service API Key), set `source` to a stable
|
|
649
778
|
* origin string so admins can trace the submission back.
|
|
779
|
+
*
|
|
780
|
+
* `category` accepts any string at the SDK boundary to keep the SDK
|
|
781
|
+
* forward-compatible with new site-side categories added before the SDK
|
|
782
|
+
* re-publishes. FFID ext-endpoint validation (`/api/v1/ext/inquiry`) is
|
|
783
|
+
* lenient — `z.string().max(100).optional()` — so unknown strings flow
|
|
784
|
+
* through to the DB unchanged. Note: the `(string & {})` arm of the
|
|
785
|
+
* union intentionally keeps autocomplete active while allowing arbitrary
|
|
786
|
+
* strings; callers using exhaustive `switch` statements should include
|
|
787
|
+
* a `default` branch.
|
|
650
788
|
*/
|
|
651
789
|
interface FFIDInquiryCreateParams {
|
|
652
790
|
email: string;
|
|
653
791
|
name: string;
|
|
654
792
|
message: string;
|
|
655
|
-
category?: FFIDInquiryCategory | (string & {});
|
|
793
|
+
category?: FFIDInquiryCategorySite2026 | FFIDInquiryCategory | (string & {});
|
|
656
794
|
company?: string;
|
|
657
795
|
phone?: string;
|
|
658
796
|
locale?: 'ja' | 'en';
|
|
@@ -1040,12 +1178,29 @@ interface FFIDInquiryFormProps {
|
|
|
1040
1178
|
turnstileSlot?: ReactNode;
|
|
1041
1179
|
onSubmit: (data: FFIDInquiryFormSubmitData) => Promise<FFIDInquiryFormSubmitResult>;
|
|
1042
1180
|
/**
|
|
1043
|
-
* Called after every change to
|
|
1044
|
-
*
|
|
1045
|
-
*
|
|
1046
|
-
*
|
|
1047
|
-
* `
|
|
1048
|
-
*
|
|
1181
|
+
* Called after every change to the submittable form state — initial
|
|
1182
|
+
* mount, every user keystroke, and every checkbox / select toggle.
|
|
1183
|
+
* Consent checkboxes are intentionally excluded — they are not part
|
|
1184
|
+
* of `FFIDInquiryFormSubmitData`. Emitted values use the same
|
|
1185
|
+
* normalization as `onSubmit` (trimmed strings; empty `company` /
|
|
1186
|
+
* `phone` become `null`). React StrictMode double-invokes effects in
|
|
1187
|
+
* dev, so expect two calls per mount.
|
|
1188
|
+
*
|
|
1189
|
+
* Suppressed in two cases:
|
|
1190
|
+
* - While the success view is rendered (truthy `successMessage`).
|
|
1191
|
+
* The form internally clears `message` after a successful submit,
|
|
1192
|
+
* and surfacing that reset would look like a "user cleared the
|
|
1193
|
+
* field" event in consumer analytics. The gate uses the same
|
|
1194
|
+
* truthy check as the render, so a consumer that returns
|
|
1195
|
+
* `{ ok: true, message: '' }` (which keeps the form visible because
|
|
1196
|
+
* the success view requires a truthy `successMessage`) keeps
|
|
1197
|
+
* broadcasting normally.
|
|
1198
|
+
* - In `requireCategorySelection` mode while no category is selected.
|
|
1199
|
+
* Emitting an empty `category` would violate the
|
|
1200
|
+
* `FFIDInquiryFormSubmitData.category: string` contract; consumers
|
|
1201
|
+
* who need to observe the unselected state can read it from a
|
|
1202
|
+
* function-form `messagePlaceholder` (`{ category: null }`) or
|
|
1203
|
+
* from their own `prefill.category` state.
|
|
1049
1204
|
*/
|
|
1050
1205
|
onChange?: (data: FFIDInquiryFormSubmitData) => void;
|
|
1051
1206
|
/**
|
|
@@ -1106,4 +1261,4 @@ interface FFIDInquiryFormPlaceholderContext {
|
|
|
1106
1261
|
}
|
|
1107
1262
|
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, separateLegalCheckboxes, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
1108
1263
|
|
|
1109
|
-
export { type
|
|
1264
|
+
export { type FFIDInquiryFormSubmitData as $, type FFIDSubscription as A, type FFIDSubscriptionContextValue as B, type FFIDAnnouncementsClientConfig as C, type FFIDAnnouncementsApiResponse as D, type AnnouncementListResponse as E, type FFIDSubscriptionStatus as F, type FFIDAnnouncementsLogger as G, type Announcement as H, type AnnouncementStatus as I, type AnnouncementType as J, FFIDAnnouncementBadge as K, type ListAnnouncementsOptions as L, FFIDAnnouncementList as M, type FFIDAnnouncementsError as N, type FFIDAnnouncementsErrorCode as O, type FFIDAnnouncementsServerResponse as P, type FFIDCacheConfig as Q, type FFIDContextValue as R, type FFIDInquiryCategory as S, type FFIDInquiryCategorySite2026 as T, FFIDInquiryForm as U, type FFIDInquiryFormCategoryItem as V, type FFIDInquiryFormClassNames as W, type FFIDInquiryFormOrganization as X, type FFIDInquiryFormPlaceholderContext as Y, type FFIDInquiryFormPrefill as Z, type FFIDInquiryFormProps as _, type FFIDConfig as a, type FFIDInquiryFormSubmitResult as a0, type FFIDJwtClaims as a1, FFIDLoginButton as a2, type FFIDMemberStatus as a3, type FFIDOAuthTokenResponse as a4, type FFIDOAuthUserInfoMemberRole as a5, type FFIDOAuthUserInfoSubscription as a6, type FFIDOrganizationMember as a7, FFIDOrganizationSwitcher as a8, type FFIDSeatModel as a9, FFIDSubscriptionBadge as aa, type FFIDTokenIntrospectionResponse as ab, FFIDUserMenu as ac, FFID_INQUIRY_CATEGORIES as ad, FFID_INQUIRY_CATEGORIES_SITE_2026 as ae, type UseFFIDAnnouncementsOptions as af, type UseFFIDAnnouncementsReturn as ag, isFFIDInquiryCategorySite2026 as ah, useFFIDAnnouncements as ai, type FFIDAnnouncementBadgeClassNames as aj, type FFIDAnnouncementBadgeProps as ak, type FFIDAnnouncementListClassNames as al, type FFIDAnnouncementListProps as am, type FFIDLoginButtonProps as an, type FFIDOrganizationSwitcherClassNames as ao, type FFIDOrganizationSwitcherProps as ap, type FFIDSubscriptionBadgeClassNames as aq, type FFIDSubscriptionBadgeProps as ar, type FFIDUserMenuClassNames as as, type FFIDUserMenuProps as at, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDProfileCallOptions as k, type FFIDUserProfile as l, type FFIDUpdateUserProfileRequest as m, type FFIDCreateCheckoutParams as n, type FFIDCheckoutSessionResponse as o, type FFIDCreatePortalParams as p, type FFIDPortalSessionResponse as q, type FFIDVerifyAccessTokenOptions as r, type FFIDOAuthUserInfo as s, type FFIDInquiryCreateParams as t, type FFIDInquiryCreateResponse as u, type FFIDAuthMode as v, type FFIDLogger as w, type FFIDCacheAdapter as x, type FFIDUser as y, type FFIDOrganization as z };
|