@feelflow/ffid-sdk 2.21.0 → 3.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.
Files changed (38) hide show
  1. package/dist/agency/index.cjs +3 -3
  2. package/dist/agency/index.d.cts +1 -1
  3. package/dist/agency/index.d.ts +1 -1
  4. package/dist/agency/index.js +2 -2
  5. package/dist/announcements/index.cjs +2 -2
  6. package/dist/announcements/index.js +1 -1
  7. package/dist/chunk-JEVK2XUM.js +5 -0
  8. package/dist/{chunk-HUU4Q5VH.cjs → chunk-JNR4AKL5.cjs} +71 -3
  9. package/dist/{chunk-YUIITYBE.cjs → chunk-MDHKSVLP.cjs} +2 -0
  10. package/dist/{chunk-I7NEMG52.js → chunk-XWI4BFKW.js} +71 -4
  11. package/dist/components/index.cjs +8 -8
  12. package/dist/components/index.d.cts +1 -1
  13. package/dist/components/index.d.ts +1 -1
  14. package/dist/components/index.js +1 -1
  15. package/dist/constants-D61jqRIO.d.cts +35 -0
  16. package/dist/constants-D61jqRIO.d.ts +35 -0
  17. package/dist/{ffid-client-DgJRU-YZ.d.cts → ffid-client-B26jbUp5.d.cts} +48 -0
  18. package/dist/{ffid-client-DgJRU-YZ.d.ts → ffid-client-B26jbUp5.d.ts} +48 -0
  19. package/dist/{index-Dr5G9HQ4.d.cts → index-C3zyNa4j.d.cts} +13 -0
  20. package/dist/{index-Dr5G9HQ4.d.ts → index-C3zyNa4j.d.ts} +13 -0
  21. package/dist/index.cjs +37 -31
  22. package/dist/index.d.cts +67 -4
  23. package/dist/index.d.ts +67 -4
  24. package/dist/index.js +4 -3
  25. package/dist/legal/index.cjs +3 -3
  26. package/dist/legal/index.d.cts +1 -1
  27. package/dist/legal/index.d.ts +1 -1
  28. package/dist/legal/index.js +2 -2
  29. package/dist/server/index.cjs +73 -5
  30. package/dist/server/index.d.cts +3 -3
  31. package/dist/server/index.d.ts +3 -3
  32. package/dist/server/index.js +68 -4
  33. package/dist/server/test/index.d.cts +1 -1
  34. package/dist/server/test/index.d.ts +1 -1
  35. package/package.json +1 -1
  36. package/dist/chunk-QBRM2RRC.js +0 -4
  37. package/dist/constants-DvTGHPZn.d.cts +0 -10
  38. package/dist/constants-DvTGHPZn.d.ts +0 -10
@@ -127,6 +127,40 @@ interface FFIDNewsletterUnsubscribeParams {
127
127
  interface FFIDNewsletterUnsubscribeResponse {
128
128
  ok: true;
129
129
  }
130
+ type FFIDNewsletterCampaignStatus = 'draft' | 'queued' | 'sending' | 'sent' | 'failed' | 'cancelled';
131
+ type FFIDNewsletterSegment = {
132
+ type: 'all';
133
+ } | {
134
+ type: 'filter';
135
+ conditions: Record<string, unknown>;
136
+ };
137
+ /**
138
+ * Body source XOR — exactly one of `htmlBody` / `templateId` must be set.
139
+ * V1 only ships `htmlBody`; `templateId` is reserved for SendGrid dynamic
140
+ * templates and is rejected server-side until that work lands.
141
+ */
142
+ type FFIDNewsletterBodySource = {
143
+ htmlBody: string;
144
+ templateId?: never;
145
+ } | {
146
+ templateId: string;
147
+ htmlBody?: never;
148
+ };
149
+ interface FFIDNewsletterDispatchParams {
150
+ subject: string;
151
+ /** Optional landing-page URL persisted on `newsletter_campaigns.article_url`. */
152
+ articleUrl?: string;
153
+ body: FFIDNewsletterBodySource;
154
+ /** Defaults to `{ type: 'all' }` server-side when omitted. */
155
+ segment?: FFIDNewsletterSegment;
156
+ }
157
+ interface FFIDNewsletterDispatchResponse {
158
+ campaignId: string;
159
+ totalRecipients: number;
160
+ status: FFIDNewsletterCampaignStatus;
161
+ sentCount: number;
162
+ failedCount: number;
163
+ }
130
164
 
131
165
  /** Cache adapter interface for FFID SDK token verification */
132
166
  /**
@@ -589,6 +623,19 @@ interface FFIDVerifyAccessTokenOptions {
589
623
  interface FFIDConfig {
590
624
  /** Service code to identify your application */
591
625
  serviceCode: string;
626
+ /**
627
+ * OAuth 2.0 scope (space-separated). Required since v3.0.0 (#2674).
628
+ *
629
+ * Use `DEFAULT_OAUTH_SCOPES` from `@feelflow/ffid-sdk` for the recommended
630
+ * baseline, or specify a least-privilege subset for your use case. Phase 3
631
+ * of `feelflow-id-platform#2656` will reject `/oauth/authorize` requests
632
+ * without this parameter, so passing an empty string here is also rejected
633
+ * — **except** in `service-key` mode (server-to-server, never calls
634
+ * `/oauth/authorize`), where `''` is permitted at runtime.
635
+ *
636
+ * @example 'openid email profile subscription:read legal:read'
637
+ */
638
+ scope: string;
592
639
  /** FFID API base URL (defaults to production) */
593
640
  apiBaseUrl?: string | undefined;
594
641
  /**
@@ -1125,6 +1172,7 @@ declare function createFFIDClient(config: FFIDConfig): {
1125
1172
  subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
1126
1173
  confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
1127
1174
  unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
1175
+ dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
1128
1176
  };
1129
1177
  /** Inquiry methods (create) */
1130
1178
  inquiry: {
@@ -192,6 +192,19 @@ interface FFIDVerifyAccessTokenOptions {
192
192
  interface FFIDConfig {
193
193
  /** Service code to identify your application */
194
194
  serviceCode: string;
195
+ /**
196
+ * OAuth 2.0 scope (space-separated). Required since v3.0.0 (#2674).
197
+ *
198
+ * Use `DEFAULT_OAUTH_SCOPES` from `@feelflow/ffid-sdk` for the recommended
199
+ * baseline, or specify a least-privilege subset for your use case. Phase 3
200
+ * of `feelflow-id-platform#2656` will reject `/oauth/authorize` requests
201
+ * without this parameter, so passing an empty string here is also rejected
202
+ * — **except** in `service-key` mode (server-to-server, never calls
203
+ * `/oauth/authorize`), where `''` is permitted at runtime.
204
+ *
205
+ * @example 'openid email profile subscription:read legal:read'
206
+ */
207
+ scope: string;
195
208
  /** FFID API base URL (defaults to production) */
196
209
  apiBaseUrl?: string | undefined;
197
210
  /**
@@ -192,6 +192,19 @@ interface FFIDVerifyAccessTokenOptions {
192
192
  interface FFIDConfig {
193
193
  /** Service code to identify your application */
194
194
  serviceCode: string;
195
+ /**
196
+ * OAuth 2.0 scope (space-separated). Required since v3.0.0 (#2674).
197
+ *
198
+ * Use `DEFAULT_OAUTH_SCOPES` from `@feelflow/ffid-sdk` for the recommended
199
+ * baseline, or specify a least-privilege subset for your use case. Phase 3
200
+ * of `feelflow-id-platform#2656` will reject `/oauth/authorize` requests
201
+ * without this parameter, so passing an empty string here is also rejected
202
+ * — **except** in `service-key` mode (server-to-server, never calls
203
+ * `/oauth/authorize`), where `''` is permitted at runtime.
204
+ *
205
+ * @example 'openid email profile subscription:read legal:read'
206
+ */
207
+ scope: string;
195
208
  /** FFID API base URL (defaults to production) */
196
209
  apiBaseUrl?: string | undefined;
197
210
  /**
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHUU4Q5VH_cjs = require('./chunk-HUU4Q5VH.cjs');
3
+ var chunkJNR4AKL5_cjs = require('./chunk-JNR4AKL5.cjs');
4
4
  var react = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
 
@@ -53,8 +53,8 @@ function defaultRedirect(url) {
53
53
  }
54
54
  function useRequireActiveSubscription(options) {
55
55
  const { redirectTo, allowGrace = true, onRedirect } = options;
56
- const { isLoading, error } = chunkHUU4Q5VH_cjs.useFFIDContext();
57
- const { effectiveStatus, isBlocked, isGrace } = chunkHUU4Q5VH_cjs.useSubscription();
56
+ const { isLoading, error } = chunkJNR4AKL5_cjs.useFFIDContext();
57
+ const { effectiveStatus, isBlocked, isGrace } = chunkJNR4AKL5_cjs.useSubscription();
58
58
  const hasFetchError = error !== null && effectiveStatus === null;
59
59
  const shouldRedirect = !isLoading && !hasFetchError && (isBlocked || !allowGrace && isGrace || effectiveStatus === null);
60
60
  react.useEffect(() => {
@@ -75,7 +75,7 @@ function useRequireActiveSubscription(options) {
75
75
  }
76
76
  function withFFIDAuth(Component, options = {}) {
77
77
  const WrappedComponent = (props) => {
78
- const { isLoading, isAuthenticated, login } = chunkHUU4Q5VH_cjs.useFFIDContext();
78
+ const { isLoading, isAuthenticated, login } = chunkJNR4AKL5_cjs.useFFIDContext();
79
79
  const hasRedirected = react.useRef(false);
80
80
  react.useEffect(() => {
81
81
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -100,115 +100,121 @@ function withFFIDAuth(Component, options = {}) {
100
100
 
101
101
  // src/newsletter/types.ts
102
102
  var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
103
+ var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
103
104
 
104
105
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
105
106
  enumerable: true,
106
- get: function () { return chunkHUU4Q5VH_cjs.DEFAULT_API_BASE_URL; }
107
+ get: function () { return chunkJNR4AKL5_cjs.DEFAULT_API_BASE_URL; }
108
+ });
109
+ Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
110
+ enumerable: true,
111
+ get: function () { return chunkJNR4AKL5_cjs.DEFAULT_OAUTH_SCOPES; }
107
112
  });
108
113
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
109
114
  enumerable: true,
110
- get: function () { return chunkHUU4Q5VH_cjs.FFIDAnnouncementBadge; }
115
+ get: function () { return chunkJNR4AKL5_cjs.FFIDAnnouncementBadge; }
111
116
  });
112
117
  Object.defineProperty(exports, "FFIDAnnouncementList", {
113
118
  enumerable: true,
114
- get: function () { return chunkHUU4Q5VH_cjs.FFIDAnnouncementList; }
119
+ get: function () { return chunkJNR4AKL5_cjs.FFIDAnnouncementList; }
115
120
  });
116
121
  Object.defineProperty(exports, "FFIDInquiryForm", {
117
122
  enumerable: true,
118
- get: function () { return chunkHUU4Q5VH_cjs.FFIDInquiryForm; }
123
+ get: function () { return chunkJNR4AKL5_cjs.FFIDInquiryForm; }
119
124
  });
120
125
  Object.defineProperty(exports, "FFIDLoginButton", {
121
126
  enumerable: true,
122
- get: function () { return chunkHUU4Q5VH_cjs.FFIDLoginButton; }
127
+ get: function () { return chunkJNR4AKL5_cjs.FFIDLoginButton; }
123
128
  });
124
129
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
125
130
  enumerable: true,
126
- get: function () { return chunkHUU4Q5VH_cjs.FFIDOrganizationSwitcher; }
131
+ get: function () { return chunkJNR4AKL5_cjs.FFIDOrganizationSwitcher; }
127
132
  });
128
133
  Object.defineProperty(exports, "FFIDProvider", {
129
134
  enumerable: true,
130
- get: function () { return chunkHUU4Q5VH_cjs.FFIDProvider; }
135
+ get: function () { return chunkJNR4AKL5_cjs.FFIDProvider; }
131
136
  });
132
137
  Object.defineProperty(exports, "FFIDSDKError", {
133
138
  enumerable: true,
134
- get: function () { return chunkHUU4Q5VH_cjs.FFIDSDKError; }
139
+ get: function () { return chunkJNR4AKL5_cjs.FFIDSDKError; }
135
140
  });
136
141
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
137
142
  enumerable: true,
138
- get: function () { return chunkHUU4Q5VH_cjs.FFIDSubscriptionBadge; }
143
+ get: function () { return chunkJNR4AKL5_cjs.FFIDSubscriptionBadge; }
139
144
  });
140
145
  Object.defineProperty(exports, "FFIDUserMenu", {
141
146
  enumerable: true,
142
- get: function () { return chunkHUU4Q5VH_cjs.FFIDUserMenu; }
147
+ get: function () { return chunkJNR4AKL5_cjs.FFIDUserMenu; }
143
148
  });
144
149
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
145
150
  enumerable: true,
146
- get: function () { return chunkHUU4Q5VH_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
151
+ get: function () { return chunkJNR4AKL5_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
147
152
  });
148
153
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
149
154
  enumerable: true,
150
- get: function () { return chunkHUU4Q5VH_cjs.FFID_INQUIRY_CATEGORIES; }
155
+ get: function () { return chunkJNR4AKL5_cjs.FFID_INQUIRY_CATEGORIES; }
151
156
  });
152
157
  Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
153
158
  enumerable: true,
154
- get: function () { return chunkHUU4Q5VH_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
159
+ get: function () { return chunkJNR4AKL5_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
155
160
  });
156
161
  Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
157
162
  enumerable: true,
158
- get: function () { return chunkHUU4Q5VH_cjs.computeEffectiveStatusFromSession; }
163
+ get: function () { return chunkJNR4AKL5_cjs.computeEffectiveStatusFromSession; }
159
164
  });
160
165
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
161
166
  enumerable: true,
162
- get: function () { return chunkHUU4Q5VH_cjs.createFFIDAnnouncementsClient; }
167
+ get: function () { return chunkJNR4AKL5_cjs.createFFIDAnnouncementsClient; }
163
168
  });
164
169
  Object.defineProperty(exports, "createFFIDClient", {
165
170
  enumerable: true,
166
- get: function () { return chunkHUU4Q5VH_cjs.createFFIDClient; }
171
+ get: function () { return chunkJNR4AKL5_cjs.createFFIDClient; }
167
172
  });
168
173
  Object.defineProperty(exports, "createTokenStore", {
169
174
  enumerable: true,
170
- get: function () { return chunkHUU4Q5VH_cjs.createTokenStore; }
175
+ get: function () { return chunkJNR4AKL5_cjs.createTokenStore; }
171
176
  });
172
177
  Object.defineProperty(exports, "generateCodeChallenge", {
173
178
  enumerable: true,
174
- get: function () { return chunkHUU4Q5VH_cjs.generateCodeChallenge; }
179
+ get: function () { return chunkJNR4AKL5_cjs.generateCodeChallenge; }
175
180
  });
176
181
  Object.defineProperty(exports, "generateCodeVerifier", {
177
182
  enumerable: true,
178
- get: function () { return chunkHUU4Q5VH_cjs.generateCodeVerifier; }
183
+ get: function () { return chunkJNR4AKL5_cjs.generateCodeVerifier; }
179
184
  });
180
185
  Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
181
186
  enumerable: true,
182
- get: function () { return chunkHUU4Q5VH_cjs.isFFIDInquiryCategorySite2026; }
187
+ get: function () { return chunkJNR4AKL5_cjs.isFFIDInquiryCategorySite2026; }
183
188
  });
184
189
  Object.defineProperty(exports, "normalizeRedirectUri", {
185
190
  enumerable: true,
186
- get: function () { return chunkHUU4Q5VH_cjs.normalizeRedirectUri; }
191
+ get: function () { return chunkJNR4AKL5_cjs.normalizeRedirectUri; }
187
192
  });
188
193
  Object.defineProperty(exports, "retrieveCodeVerifier", {
189
194
  enumerable: true,
190
- get: function () { return chunkHUU4Q5VH_cjs.retrieveCodeVerifier; }
195
+ get: function () { return chunkJNR4AKL5_cjs.retrieveCodeVerifier; }
191
196
  });
192
197
  Object.defineProperty(exports, "storeCodeVerifier", {
193
198
  enumerable: true,
194
- get: function () { return chunkHUU4Q5VH_cjs.storeCodeVerifier; }
199
+ get: function () { return chunkJNR4AKL5_cjs.storeCodeVerifier; }
195
200
  });
196
201
  Object.defineProperty(exports, "useFFID", {
197
202
  enumerable: true,
198
- get: function () { return chunkHUU4Q5VH_cjs.useFFID; }
203
+ get: function () { return chunkJNR4AKL5_cjs.useFFID; }
199
204
  });
200
205
  Object.defineProperty(exports, "useFFIDAnnouncements", {
201
206
  enumerable: true,
202
- get: function () { return chunkHUU4Q5VH_cjs.useFFIDAnnouncements; }
207
+ get: function () { return chunkJNR4AKL5_cjs.useFFIDAnnouncements; }
203
208
  });
204
209
  Object.defineProperty(exports, "useSubscription", {
205
210
  enumerable: true,
206
- get: function () { return chunkHUU4Q5VH_cjs.useSubscription; }
211
+ get: function () { return chunkJNR4AKL5_cjs.useSubscription; }
207
212
  });
208
213
  Object.defineProperty(exports, "withSubscription", {
209
214
  enumerable: true,
210
- get: function () { return chunkHUU4Q5VH_cjs.withSubscription; }
215
+ get: function () { return chunkJNR4AKL5_cjs.withSubscription; }
211
216
  });
217
+ exports.FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS;
212
218
  exports.FFID_NEWSLETTER_TYPES = FFID_NEWSLETTER_TYPES;
213
219
  exports.createKVCacheAdapter = createKVCacheAdapter;
214
220
  exports.createMemoryCacheAdapter = createMemoryCacheAdapter;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-Dr5G9HQ4.cjs';
2
- export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, 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, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-Dr5G9HQ4.cjs';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-C3zyNa4j.cjs';
2
+ export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, 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, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-C3zyNa4j.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -11,6 +11,31 @@ import { ReactNode, ComponentType, FC } from 'react';
11
11
  */
12
12
  /** Default FFID API base URL (production) */
13
13
  declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
14
+ /**
15
+ * Recommended default OAuth scope set for FFID-connected services (v3.0.0+).
16
+ *
17
+ * Coverage:
18
+ * - `openid email profile` — OIDC standard claims (always required)
19
+ * - `subscription:read` — `/api/v1/subscriptions/ext/*` 系(プラン / 課金 gate)
20
+ * - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
21
+ *
22
+ * Add feature-specific scopes on top of this when needed (browser SDK):
23
+ * - `analytics:read` for `/api/v1/ext/analytics/config`
24
+ * - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
25
+ * - `subscription:write` for self-serve plan changes
26
+ * - `legal:write` for recording user consent
27
+ * - `profile:read` / `profile:write` for profile UI
28
+ * - `organization:api-key` for org-level API key issuance
29
+ *
30
+ * **Note**: kept as a widened `string` (not `as const`) so consumers can
31
+ * concatenate additional scopes (e.g. `\`${DEFAULT_OAUTH_SCOPES} analytics:read\``)
32
+ * and so it remains assignable to `FFIDConfig.scope: string`. `widget:verify`
33
+ * is intentionally excluded — it is a service-key-only scope (`/api/v1/widget/*`),
34
+ * not used by the browser OAuth flow.
35
+ *
36
+ * Survey: feel-flow/feelflow-id-platform#2656 issuecomment-4324082742
37
+ */
38
+ declare const DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
14
39
 
15
40
  /**
16
41
  * Token Store
@@ -543,6 +568,7 @@ declare function createFFIDClient(config: FFIDConfig): {
543
568
  subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
544
569
  confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
545
570
  unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
571
+ dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
546
572
  };
547
573
  /** Inquiry methods (create) */
548
574
  inquiry: {
@@ -633,7 +659,7 @@ interface FFIDProviderProps extends FFIDConfig {
633
659
  * - Automatic session refresh
634
660
  * - Token mode: automatic code exchange and token refresh
635
661
  */
636
- declare function FFIDProvider({ children, serviceCode, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
662
+ declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
637
663
 
638
664
  /**
639
665
  * Return type for useFFID hook
@@ -1082,6 +1108,42 @@ interface FFIDNewsletterUnsubscribeParams {
1082
1108
  interface FFIDNewsletterUnsubscribeResponse {
1083
1109
  ok: true;
1084
1110
  }
1111
+ /** Recipient cap on a single dispatch — mirrors NEWSLETTER_DISPATCH_MAX_RECIPIENTS. */
1112
+ declare const FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1000;
1113
+ type FFIDNewsletterCampaignStatus = 'draft' | 'queued' | 'sending' | 'sent' | 'failed' | 'cancelled';
1114
+ type FFIDNewsletterSegment = {
1115
+ type: 'all';
1116
+ } | {
1117
+ type: 'filter';
1118
+ conditions: Record<string, unknown>;
1119
+ };
1120
+ /**
1121
+ * Body source XOR — exactly one of `htmlBody` / `templateId` must be set.
1122
+ * V1 only ships `htmlBody`; `templateId` is reserved for SendGrid dynamic
1123
+ * templates and is rejected server-side until that work lands.
1124
+ */
1125
+ type FFIDNewsletterBodySource = {
1126
+ htmlBody: string;
1127
+ templateId?: never;
1128
+ } | {
1129
+ templateId: string;
1130
+ htmlBody?: never;
1131
+ };
1132
+ interface FFIDNewsletterDispatchParams {
1133
+ subject: string;
1134
+ /** Optional landing-page URL persisted on `newsletter_campaigns.article_url`. */
1135
+ articleUrl?: string;
1136
+ body: FFIDNewsletterBodySource;
1137
+ /** Defaults to `{ type: 'all' }` server-side when omitted. */
1138
+ segment?: FFIDNewsletterSegment;
1139
+ }
1140
+ interface FFIDNewsletterDispatchResponse {
1141
+ campaignId: string;
1142
+ totalRecipients: number;
1143
+ status: FFIDNewsletterCampaignStatus;
1144
+ sentCount: number;
1145
+ failedCount: number;
1146
+ }
1085
1147
 
1086
1148
  /** Newsletter methods - subscribe / confirm / unsubscribe */
1087
1149
 
@@ -1094,6 +1156,7 @@ declare function createNewsletterMethods(deps: NewsletterMethodsDeps): {
1094
1156
  subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
1095
1157
  confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
1096
1158
  unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
1159
+ dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
1097
1160
  };
1098
1161
  type FFIDNewsletterClient = ReturnType<typeof createNewsletterMethods>;
1099
1162
 
@@ -1108,4 +1171,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
1108
1171
  };
1109
1172
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
1110
1173
 
1111
- export { AnnouncementListResponse, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, EffectiveSubscriptionStatus, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, FFIDMemberRole, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, FFIDUpdateMemberRoleResponse, FFIDUpdateUserProfileRequest, FFIDUser, FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
1174
+ export { AnnouncementListResponse, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, FFIDMemberRole, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, FFIDUpdateMemberRoleResponse, FFIDUpdateUserProfileRequest, FFIDUser, FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-Dr5G9HQ4.js';
2
- export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, 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, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-Dr5G9HQ4.js';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-C3zyNa4j.js';
2
+ export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, 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, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-C3zyNa4j.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -11,6 +11,31 @@ import { ReactNode, ComponentType, FC } from 'react';
11
11
  */
12
12
  /** Default FFID API base URL (production) */
13
13
  declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
14
+ /**
15
+ * Recommended default OAuth scope set for FFID-connected services (v3.0.0+).
16
+ *
17
+ * Coverage:
18
+ * - `openid email profile` — OIDC standard claims (always required)
19
+ * - `subscription:read` — `/api/v1/subscriptions/ext/*` 系(プラン / 課金 gate)
20
+ * - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
21
+ *
22
+ * Add feature-specific scopes on top of this when needed (browser SDK):
23
+ * - `analytics:read` for `/api/v1/ext/analytics/config`
24
+ * - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
25
+ * - `subscription:write` for self-serve plan changes
26
+ * - `legal:write` for recording user consent
27
+ * - `profile:read` / `profile:write` for profile UI
28
+ * - `organization:api-key` for org-level API key issuance
29
+ *
30
+ * **Note**: kept as a widened `string` (not `as const`) so consumers can
31
+ * concatenate additional scopes (e.g. `\`${DEFAULT_OAUTH_SCOPES} analytics:read\``)
32
+ * and so it remains assignable to `FFIDConfig.scope: string`. `widget:verify`
33
+ * is intentionally excluded — it is a service-key-only scope (`/api/v1/widget/*`),
34
+ * not used by the browser OAuth flow.
35
+ *
36
+ * Survey: feel-flow/feelflow-id-platform#2656 issuecomment-4324082742
37
+ */
38
+ declare const DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
14
39
 
15
40
  /**
16
41
  * Token Store
@@ -543,6 +568,7 @@ declare function createFFIDClient(config: FFIDConfig): {
543
568
  subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
544
569
  confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
545
570
  unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
571
+ dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
546
572
  };
547
573
  /** Inquiry methods (create) */
548
574
  inquiry: {
@@ -633,7 +659,7 @@ interface FFIDProviderProps extends FFIDConfig {
633
659
  * - Automatic session refresh
634
660
  * - Token mode: automatic code exchange and token refresh
635
661
  */
636
- declare function FFIDProvider({ children, serviceCode, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
662
+ declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
637
663
 
638
664
  /**
639
665
  * Return type for useFFID hook
@@ -1082,6 +1108,42 @@ interface FFIDNewsletterUnsubscribeParams {
1082
1108
  interface FFIDNewsletterUnsubscribeResponse {
1083
1109
  ok: true;
1084
1110
  }
1111
+ /** Recipient cap on a single dispatch — mirrors NEWSLETTER_DISPATCH_MAX_RECIPIENTS. */
1112
+ declare const FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1000;
1113
+ type FFIDNewsletterCampaignStatus = 'draft' | 'queued' | 'sending' | 'sent' | 'failed' | 'cancelled';
1114
+ type FFIDNewsletterSegment = {
1115
+ type: 'all';
1116
+ } | {
1117
+ type: 'filter';
1118
+ conditions: Record<string, unknown>;
1119
+ };
1120
+ /**
1121
+ * Body source XOR — exactly one of `htmlBody` / `templateId` must be set.
1122
+ * V1 only ships `htmlBody`; `templateId` is reserved for SendGrid dynamic
1123
+ * templates and is rejected server-side until that work lands.
1124
+ */
1125
+ type FFIDNewsletterBodySource = {
1126
+ htmlBody: string;
1127
+ templateId?: never;
1128
+ } | {
1129
+ templateId: string;
1130
+ htmlBody?: never;
1131
+ };
1132
+ interface FFIDNewsletterDispatchParams {
1133
+ subject: string;
1134
+ /** Optional landing-page URL persisted on `newsletter_campaigns.article_url`. */
1135
+ articleUrl?: string;
1136
+ body: FFIDNewsletterBodySource;
1137
+ /** Defaults to `{ type: 'all' }` server-side when omitted. */
1138
+ segment?: FFIDNewsletterSegment;
1139
+ }
1140
+ interface FFIDNewsletterDispatchResponse {
1141
+ campaignId: string;
1142
+ totalRecipients: number;
1143
+ status: FFIDNewsletterCampaignStatus;
1144
+ sentCount: number;
1145
+ failedCount: number;
1146
+ }
1085
1147
 
1086
1148
  /** Newsletter methods - subscribe / confirm / unsubscribe */
1087
1149
 
@@ -1094,6 +1156,7 @@ declare function createNewsletterMethods(deps: NewsletterMethodsDeps): {
1094
1156
  subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
1095
1157
  confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
1096
1158
  unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
1159
+ dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
1097
1160
  };
1098
1161
  type FFIDNewsletterClient = ReturnType<typeof createNewsletterMethods>;
1099
1162
 
@@ -1108,4 +1171,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
1108
1171
  };
1109
1172
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
1110
1173
 
1111
- export { AnnouncementListResponse, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, EffectiveSubscriptionStatus, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, FFIDMemberRole, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, FFIDUpdateMemberRoleResponse, FFIDUpdateUserProfileRequest, FFIDUser, FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
1174
+ export { AnnouncementListResponse, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, FFIDMemberRole, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, FFIDUpdateMemberRoleResponse, FFIDUpdateUserProfileRequest, FFIDUser, FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext, useSubscription } from './chunk-I7NEMG52.js';
2
- 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, useSubscription, withSubscription } from './chunk-I7NEMG52.js';
1
+ import { useFFIDContext, useSubscription } from './chunk-XWI4BFKW.js';
2
+ 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, useSubscription, withSubscription } from './chunk-XWI4BFKW.js';
3
3
  import { useEffect, useRef } from 'react';
4
4
  import { jsx, Fragment } from 'react/jsx-runtime';
5
5
 
@@ -99,5 +99,6 @@ function withFFIDAuth(Component, options = {}) {
99
99
 
100
100
  // src/newsletter/types.ts
101
101
  var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
102
+ var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
102
103
 
103
- export { FFID_NEWSLETTER_TYPES, createKVCacheAdapter, createMemoryCacheAdapter, useRequireActiveSubscription, withFFIDAuth };
104
+ export { FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, createKVCacheAdapter, createMemoryCacheAdapter, useRequireActiveSubscription, withFFIDAuth };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkYUIITYBE_cjs = require('../chunk-YUIITYBE.cjs');
3
+ var chunkMDHKSVLP_cjs = require('../chunk-MDHKSVLP.cjs');
4
4
 
5
5
  // src/legal/ffid-legal-client.ts
6
6
  var API_PREFIX = "/api/v1/legal/ext";
@@ -37,7 +37,7 @@ function createFFIDLegalClient(config) {
37
37
  if (!config.apiKey) {
38
38
  throw new Error("FFID Legal Client: apiKey \u304C\u672A\u8A2D\u5B9A\u3067\u3059");
39
39
  }
40
- const baseUrl = config.apiBaseUrl ?? chunkYUIITYBE_cjs.DEFAULT_API_BASE_URL;
40
+ const baseUrl = config.apiBaseUrl ?? chunkMDHKSVLP_cjs.DEFAULT_API_BASE_URL;
41
41
  const logger = config.logger ?? (config.debug ? consoleLogger : noopLogger);
42
42
  async function fetchWithApiKey(endpoint, options = {}) {
43
43
  const url = `${baseUrl}${API_PREFIX}${endpoint}`;
@@ -176,7 +176,7 @@ function createFFIDLegalClient(config) {
176
176
 
177
177
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
178
178
  enumerable: true,
179
- get: function () { return chunkYUIITYBE_cjs.DEFAULT_API_BASE_URL; }
179
+ get: function () { return chunkMDHKSVLP_cjs.DEFAULT_API_BASE_URL; }
180
180
  });
181
181
  exports.FFID_LEGAL_ERROR_CODES = FFID_LEGAL_ERROR_CODES;
182
182
  exports.createFFIDLegalClient = createFFIDLegalClient;
@@ -1,4 +1,4 @@
1
- export { D as DEFAULT_API_BASE_URL } from '../constants-DvTGHPZn.cjs';
1
+ export { D as DEFAULT_API_BASE_URL } from '../constants-D61jqRIO.cjs';
2
2
 
3
3
  /**
4
4
  * FFID Legal SDK Type Definitions
@@ -1,4 +1,4 @@
1
- export { D as DEFAULT_API_BASE_URL } from '../constants-DvTGHPZn.js';
1
+ export { D as DEFAULT_API_BASE_URL } from '../constants-D61jqRIO.js';
2
2
 
3
3
  /**
4
4
  * FFID Legal SDK Type Definitions
@@ -1,5 +1,5 @@
1
- import { DEFAULT_API_BASE_URL } from '../chunk-QBRM2RRC.js';
2
- export { DEFAULT_API_BASE_URL } from '../chunk-QBRM2RRC.js';
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/legal/ffid-legal-client.ts
5
5
  var API_PREFIX = "/api/v1/legal/ext";