@feelflow/ffid-sdk 10.0.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1046 -1010
- package/dist/{chunk-OXW6QSTO.js → chunk-ITSQIAO5.js} +123 -42
- package/dist/{chunk-2LU2F3F2.cjs → chunk-VHOIA25Y.cjs} +125 -41
- 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/{ffid-client-5uxXRgIO.d.ts → ffid-client-DUbQLYTN.d.ts} +3 -2
- package/dist/{ffid-client-CumygXXz.d.cts → ffid-client-qcfCWLfs.d.cts} +3 -2
- package/dist/{index-KjewcNn1.d.cts → index-CWGoIgYL.d.cts} +2 -1
- package/dist/{index-KjewcNn1.d.ts → index-CWGoIgYL.d.ts} +2 -1
- package/dist/index.cjs +100 -88
- package/dist/index.d.cts +99 -7
- package/dist/index.d.ts +99 -7
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +51 -9
- package/dist/server/index.d.cts +74 -3
- package/dist/server/index.d.ts +74 -3
- package/dist/server/index.js +49 -10
- package/dist/server/test/index.d.cts +1 -1
- package/dist/server/test/index.d.ts +1 -1
- package/package.json +131 -131
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as
|
|
2
|
-
export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDOrganization, B as FFIDOrganizationLogoUploadResponse, C as FFIDOrganizationMember, D as FFIDOrganizationProfile, E as FFIDOrganizationProfileErrorCode, G as FFIDOrganizationProfileResponse, H as FFIDOtpSendResponse, I as FFIDOtpVerifyResponse, J as FFIDPasswordResetConfirmResponse, K as FFIDPasswordResetResponse, L as FFIDPasswordResetVerifyResponse, M as FFIDProfileCallOptions, N as FFIDProvisionMemberPlan, O as FFIDProvisionMemberPlanStatus, P as FFIDProvisionMemberResult, Q as FFIDProvisionMemberStatus, R as FFIDProvisionOrganizationDryRun, S as FFIDProvisionOrganizationMemberInput, T as FFIDProvisionOrganizationOutcome, U as FFIDProvisionOrganizationParams, V as FFIDProvisionOrganizationResponse, W as FFIDProvisionUserDryRun, X as FFIDProvisionUserOutcome, Y as FFIDProvisionUserParams, Z as FFIDProvisionUserProfileInput, _ as FFIDProvisionUserResponse, $ as FFIDProvisionedOrganization, a0 as FFIDProvisionedUser, a1 as FFIDPublishedPlan, a2 as FFIDRemoveMemberResponse, a3 as FFIDResetSessionResponse, a4 as FFIDSubscription, a5 as FFIDUpdateMemberRoleResponse, a6 as FFIDUpdateUserProfileRequest, a7 as FFIDUploadOrganizationLogoParams, a8 as FFIDUpsertOrganizationProfileParams, a9 as FFIDUpsertOrganizationProfileRequest, aa as FFIDUser, ab as FFIDUserProfile, ac as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ad as FFID_CATALOG_ENVIRONMENTS, ae as FFID_CATALOG_PUBLICATION_STATUSES, af as FFID_COMPANY_SIZE_CODES, ag as FFID_INDUSTRY_CODES, ah as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, aj as FFID_ORGANIZATION_PROFILE_ERROR_CODES, ak as TokenData, al as TokenStore, am as createFFIDClient, an as createTokenStore } from '../ffid-client-
|
|
1
|
+
import { F as FFIDError, a as FFIDLogger, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-DUbQLYTN.js';
|
|
2
|
+
export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDOrganization, B as FFIDOrganizationLogoUploadResponse, C as FFIDOrganizationMember, D as FFIDOrganizationProfile, E as FFIDOrganizationProfileErrorCode, G as FFIDOrganizationProfileResponse, H as FFIDOtpSendResponse, I as FFIDOtpVerifyResponse, J as FFIDPasswordResetConfirmResponse, K as FFIDPasswordResetResponse, L as FFIDPasswordResetVerifyResponse, M as FFIDProfileCallOptions, N as FFIDProvisionMemberPlan, O as FFIDProvisionMemberPlanStatus, P as FFIDProvisionMemberResult, Q as FFIDProvisionMemberStatus, R as FFIDProvisionOrganizationDryRun, S as FFIDProvisionOrganizationMemberInput, T as FFIDProvisionOrganizationOutcome, U as FFIDProvisionOrganizationParams, V as FFIDProvisionOrganizationResponse, W as FFIDProvisionUserDryRun, X as FFIDProvisionUserOutcome, Y as FFIDProvisionUserParams, Z as FFIDProvisionUserProfileInput, _ as FFIDProvisionUserResponse, $ as FFIDProvisionedOrganization, a0 as FFIDProvisionedUser, a1 as FFIDPublishedPlan, a2 as FFIDRemoveMemberResponse, a3 as FFIDResetSessionResponse, a4 as FFIDSubscription, a5 as FFIDUpdateMemberRoleResponse, a6 as FFIDUpdateUserProfileRequest, a7 as FFIDUploadOrganizationLogoParams, a8 as FFIDUpsertOrganizationProfileParams, a9 as FFIDUpsertOrganizationProfileRequest, aa as FFIDUser, ab as FFIDUserProfile, ac as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ad as FFID_CATALOG_ENVIRONMENTS, ae as FFID_CATALOG_PUBLICATION_STATUSES, af as FFID_COMPANY_SIZE_CODES, ag as FFID_INDUSTRY_CODES, ah as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, aj as FFID_ORGANIZATION_PROFILE_ERROR_CODES, ak as TokenData, al as TokenStore, am as createFFIDClient, an as createTokenStore } from '../ffid-client-DUbQLYTN.js';
|
|
3
3
|
export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-Ce2eXQtB.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '../types-Cjb9J0rL.js';
|
|
@@ -31,6 +31,77 @@ declare const FFID_ERROR_CODES: {
|
|
|
31
31
|
*/
|
|
32
32
|
type FFIDErrorCode = (typeof FFID_ERROR_CODES)[keyof typeof FFID_ERROR_CODES];
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* OAuth authorization errors returned to the service's `redirect_uri` (#6523)
|
|
36
|
+
*
|
|
37
|
+
* When FFID's `/oauth/authorize` refuses a user, it redirects back with
|
|
38
|
+
* `error=<OAuth error>&error_description=...&state=...` (RFC 6749 §4.1.2.1). For
|
|
39
|
+
* subscription / seat denials it also adds the FFID extension `denial_reason`
|
|
40
|
+
* (#6498), so a service can tell "no seat in this organization" from "no
|
|
41
|
+
* subscription" without parsing `error_description`.
|
|
42
|
+
*
|
|
43
|
+
* Both callback paths build the same {@link FFIDError} from those params:
|
|
44
|
+
* - `handleRedirectCallback` / token-mode `FFIDProvider` (browser, PKCE)
|
|
45
|
+
* - `createServerAuthClient().handleCallback` (confidential / BFF)
|
|
46
|
+
*
|
|
47
|
+
* `error.code` is the OAuth `error` value verbatim (e.g. `access_denied`), and
|
|
48
|
+
* `error.details` is {@link FFIDAuthorizationErrorDetails}. Read it with
|
|
49
|
+
* {@link getFFIDAuthorizationError}.
|
|
50
|
+
*
|
|
51
|
+
* This module has no browser dependency so the server entry can share it.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Values of FFID's `denial_reason` (the authorize error redirect and the
|
|
56
|
+
* `/oauth/userinfo` 403; `/oauth/introspect` only answers `active: false`). Kept
|
|
57
|
+
* identical to the FFID server's `DENIAL_REASONS` by a test in the FFID repository.
|
|
58
|
+
*
|
|
59
|
+
* This is a different vocabulary from `FFIDServiceAccessDenialReason`
|
|
60
|
+
* (`checkServiceAccess()`), which is derived from the subscription status.
|
|
61
|
+
*/
|
|
62
|
+
declare const FFID_OAUTH_DENIAL_REASONS: readonly ["no_membership", "no_active_subscription", "no_seat_assignment", "subscription_expired", "member_limit_reached"];
|
|
63
|
+
type FFIDOAuthDenialReason = (typeof FFID_OAUTH_DENIAL_REASONS)[number];
|
|
64
|
+
/** Runtime guard for {@link FFIDOAuthDenialReason}. Unknown values are `false`. */
|
|
65
|
+
declare function isFFIDOAuthDenialReason(value: unknown): value is FFIDOAuthDenialReason;
|
|
66
|
+
/** `FFIDError.details` of an authorization error */
|
|
67
|
+
interface FFIDAuthorizationErrorDetails {
|
|
68
|
+
/** Marks the error as an authorize redirect error (vs. token / network errors) */
|
|
69
|
+
source: 'authorization';
|
|
70
|
+
/**
|
|
71
|
+
* FFID's `denial_reason`. `null` when FFID did not send one (any OAuth error other
|
|
72
|
+
* than a subscription / seat denial) **or** sent a value this SDK version does not
|
|
73
|
+
* know — the error itself is still returned, only the reason is unknown.
|
|
74
|
+
*/
|
|
75
|
+
denialReason: FFIDOAuthDenialReason | null;
|
|
76
|
+
/**
|
|
77
|
+
* `error_description` as sent — short ASCII English meant for logs. The same text
|
|
78
|
+
* is `error.message` (when FFID sent one), so show end users guidance chosen by
|
|
79
|
+
* `denialReason` rather than the message itself.
|
|
80
|
+
*/
|
|
81
|
+
errorDescription: string | null;
|
|
82
|
+
}
|
|
83
|
+
/** An authorization error read back by {@link getFFIDAuthorizationError} */
|
|
84
|
+
interface FFIDAuthorizationError {
|
|
85
|
+
/** The OAuth `error` value, e.g. `access_denied`, `login_required` */
|
|
86
|
+
oauthError: string;
|
|
87
|
+
denialReason: FFIDOAuthDenialReason | null;
|
|
88
|
+
errorDescription: string | null;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Read an authorization error (and FFID's `denial_reason`) from an {@link FFIDError},
|
|
92
|
+
* e.g. `useFFID().error` or the result of `handleRedirectCallback` /
|
|
93
|
+
* `createServerAuthClient().handleCallback`. Returns `null` for any other error.
|
|
94
|
+
*
|
|
95
|
+
* ```ts
|
|
96
|
+
* const denial = getFFIDAuthorizationError(error)
|
|
97
|
+
* if (denial?.denialReason === 'no_seat_assignment') {
|
|
98
|
+
* // Ask an organization owner / admin to add the user. Do not call login() again:
|
|
99
|
+
* // FFID would refuse the same way.
|
|
100
|
+
* }
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
declare function getFFIDAuthorizationError(error: FFIDError | null | undefined): FFIDAuthorizationError | null;
|
|
104
|
+
|
|
34
105
|
/** Token verification - verifyAccessToken() implementation */
|
|
35
106
|
|
|
36
107
|
/** Dependencies required by verifyAccessToken */
|
|
@@ -566,4 +637,4 @@ declare function computeScopeHash(input: FFIDScopeHashInput): Promise<string>;
|
|
|
566
637
|
*/
|
|
567
638
|
declare function validatePublishedCatalog(catalog: unknown): asserts catalog is FFIDPublishedCatalog;
|
|
568
639
|
|
|
569
|
-
export { ALL_DENIED_EXCEPT_NECESSARY, type BuildAuthorizeUrlOptions, type BuildAuthorizeUrlResult, CATALOG_HASH_PATTERN, CONSENT_COOKIE_NAME, COOKIE_VERSION, type CookieOptions, FFIDCacheAdapter, type FFIDCanonicalJsonValue, FFIDCatalogEnvironment, FFIDCatalogHashError, type FFIDConsentCategories, type FFIDConsentCategoryCode, type FFIDCookieStoreLike, type FFIDErrorCode, FFIDOAuthUserInfo, type FFIDPaymentConfiguration, FFIDPublishedCatalog, type FFIDScopeHashInput, type FFIDScopeHashPlan, FFIDTaxBehavior, type FFIDTaxConfiguration, FFIDVerifyAccessTokenOptions, FFID_ERROR_CODES, FFID_SESSION_COOKIE_NAME, type HandleCallbackInput, type KVNamespaceLike, type ServerAuthClient, type ServerAuthConfig, type ServerSessionTokens, type ServerTokenResult, canonicalizeCatalogValue, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createKVCacheAdapter, createMemoryCacheAdapter, createServerAuthClient, createVerifyAccessToken, decodeConsentCookie, encodeConsentCookie, generateServerState, getFFIDConsentFromCookieHeader, getFFIDConsentFromCookies, hashCanonicalJson, sessionCookies, sha256Hex, validatePublishedCatalog };
|
|
640
|
+
export { ALL_DENIED_EXCEPT_NECESSARY, type BuildAuthorizeUrlOptions, type BuildAuthorizeUrlResult, CATALOG_HASH_PATTERN, CONSENT_COOKIE_NAME, COOKIE_VERSION, type CookieOptions, type FFIDAuthorizationError, type FFIDAuthorizationErrorDetails, FFIDCacheAdapter, type FFIDCanonicalJsonValue, FFIDCatalogEnvironment, FFIDCatalogHashError, type FFIDConsentCategories, type FFIDConsentCategoryCode, type FFIDCookieStoreLike, type FFIDErrorCode, type FFIDOAuthDenialReason, FFIDOAuthUserInfo, type FFIDPaymentConfiguration, FFIDPublishedCatalog, type FFIDScopeHashInput, type FFIDScopeHashPlan, FFIDTaxBehavior, type FFIDTaxConfiguration, FFIDVerifyAccessTokenOptions, FFID_ERROR_CODES, FFID_OAUTH_DENIAL_REASONS, FFID_SESSION_COOKIE_NAME, type HandleCallbackInput, type KVNamespaceLike, type ServerAuthClient, type ServerAuthConfig, type ServerSessionTokens, type ServerTokenResult, canonicalizeCatalogValue, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createKVCacheAdapter, createMemoryCacheAdapter, createServerAuthClient, createVerifyAccessToken, decodeConsentCookie, encodeConsentCookie, generateServerState, getFFIDAuthorizationError, getFFIDConsentFromCookieHeader, getFFIDConsentFromCookies, hashCanonicalJson, isFFIDOAuthDenialReason, sessionCookies, sha256Hex, validatePublishedCatalog };
|
package/dist/server/index.js
CHANGED
|
@@ -1370,7 +1370,7 @@ var FFID_ORGANIZATION_PROFILE_ERROR_CODES = {
|
|
|
1370
1370
|
};
|
|
1371
1371
|
|
|
1372
1372
|
// src/client/version-check.ts
|
|
1373
|
-
var SDK_VERSION = "10.
|
|
1373
|
+
var SDK_VERSION = "10.1.0";
|
|
1374
1374
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1375
1375
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1376
1376
|
function sdkHeaders() {
|
|
@@ -4364,6 +4364,50 @@ function createFFIDClient(config) {
|
|
|
4364
4364
|
};
|
|
4365
4365
|
}
|
|
4366
4366
|
|
|
4367
|
+
// src/client/authorization-error.ts
|
|
4368
|
+
var FFID_OAUTH_DENIAL_REASONS = [
|
|
4369
|
+
/** The user is not a member of the organization */
|
|
4370
|
+
"no_membership",
|
|
4371
|
+
/** The organization has no usable subscription for the service */
|
|
4372
|
+
"no_active_subscription",
|
|
4373
|
+
/** The organization has a subscription, but the user has no seat in it */
|
|
4374
|
+
"no_seat_assignment",
|
|
4375
|
+
/** The subscription has expired (canceled / past due beyond grace) */
|
|
4376
|
+
"subscription_expired",
|
|
4377
|
+
/** The flat plan's member limit is full, so no seat could be given */
|
|
4378
|
+
"member_limit_reached"
|
|
4379
|
+
];
|
|
4380
|
+
function isFFIDOAuthDenialReason(value) {
|
|
4381
|
+
return typeof value === "string" && FFID_OAUTH_DENIAL_REASONS.includes(value);
|
|
4382
|
+
}
|
|
4383
|
+
var DEFAULT_AUTHORIZATION_ERROR_MESSAGE = "\u8A8D\u53EF\u30B5\u30FC\u30D0\u30FC\u304C\u30A8\u30E9\u30FC\u3092\u8FD4\u3057\u307E\u3057\u305F";
|
|
4384
|
+
function buildAuthorizationError(params) {
|
|
4385
|
+
const oauthError = params.get("error");
|
|
4386
|
+
if (!oauthError) return null;
|
|
4387
|
+
const rawReason = params.get("denial_reason");
|
|
4388
|
+
const errorDescription = params.get("error_description");
|
|
4389
|
+
const details = {
|
|
4390
|
+
source: "authorization",
|
|
4391
|
+
denialReason: isFFIDOAuthDenialReason(rawReason) ? rawReason : null,
|
|
4392
|
+
errorDescription
|
|
4393
|
+
};
|
|
4394
|
+
return {
|
|
4395
|
+
code: oauthError,
|
|
4396
|
+
message: errorDescription ?? DEFAULT_AUTHORIZATION_ERROR_MESSAGE,
|
|
4397
|
+
details: { ...details }
|
|
4398
|
+
};
|
|
4399
|
+
}
|
|
4400
|
+
function getFFIDAuthorizationError(error) {
|
|
4401
|
+
const details = error?.details;
|
|
4402
|
+
if (!error || !details || details.source !== "authorization") return null;
|
|
4403
|
+
const description = details.errorDescription;
|
|
4404
|
+
return {
|
|
4405
|
+
oauthError: error.code,
|
|
4406
|
+
denialReason: isFFIDOAuthDenialReason(details.denialReason) ? details.denialReason : null,
|
|
4407
|
+
errorDescription: typeof description === "string" ? description : null
|
|
4408
|
+
};
|
|
4409
|
+
}
|
|
4410
|
+
|
|
4367
4411
|
// src/client/cache/memory-cache-adapter.ts
|
|
4368
4412
|
var MS_PER_SECOND2 = 1e3;
|
|
4369
4413
|
function createMemoryCacheAdapter() {
|
|
@@ -4654,14 +4698,9 @@ function createServerAuthClient(config) {
|
|
|
4654
4698
|
}
|
|
4655
4699
|
};
|
|
4656
4700
|
}
|
|
4657
|
-
const
|
|
4658
|
-
if (
|
|
4659
|
-
return {
|
|
4660
|
-
error: {
|
|
4661
|
-
code: errorParam,
|
|
4662
|
-
message: url.searchParams.get("error_description") ?? "\u8A8D\u53EF\u30B5\u30FC\u30D0\u30FC\u304C\u30A8\u30E9\u30FC\u3092\u8FD4\u3057\u307E\u3057\u305F"
|
|
4663
|
-
}
|
|
4664
|
-
};
|
|
4701
|
+
const authorizationError = buildAuthorizationError(url.searchParams);
|
|
4702
|
+
if (authorizationError) {
|
|
4703
|
+
return { error: authorizationError };
|
|
4665
4704
|
}
|
|
4666
4705
|
const code = url.searchParams.get("code");
|
|
4667
4706
|
if (!code) {
|
|
@@ -4752,4 +4791,4 @@ function clear(opts = {}) {
|
|
|
4752
4791
|
}
|
|
4753
4792
|
var sessionCookies = { serialize, read, clear };
|
|
4754
4793
|
|
|
4755
|
-
export { ALL_DENIED_EXCEPT_NECESSARY, CATALOG_HASH_PATTERN, CONSENT_COOKIE_NAME, COOKIE_VERSION, FFIDCatalogHashError, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_CODES, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SESSION_COOKIE_NAME, canonicalizeCatalogValue, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createServerAuthClient, createTokenStore, createVerifyAccessToken, decodeConsentCookie, encodeConsentCookie, generateServerState, getFFIDConsentFromCookieHeader, getFFIDConsentFromCookies, hashCanonicalJson, sessionCookies, sha256Hex, validatePublishedCatalog };
|
|
4794
|
+
export { ALL_DENIED_EXCEPT_NECESSARY, CATALOG_HASH_PATTERN, CONSENT_COOKIE_NAME, COOKIE_VERSION, FFIDCatalogHashError, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_CODES, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_OAUTH_DENIAL_REASONS, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SESSION_COOKIE_NAME, canonicalizeCatalogValue, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createServerAuthClient, createTokenStore, createVerifyAccessToken, decodeConsentCookie, encodeConsentCookie, generateServerState, getFFIDAuthorizationError, getFFIDConsentFromCookieHeader, getFFIDConsentFromCookies, hashCanonicalJson, isFFIDOAuthDenialReason, sessionCookies, sha256Hex, validatePublishedCatalog };
|
package/package.json
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@feelflow/ffid-sdk",
|
|
3
|
-
"version": "10.
|
|
4
|
-
"description": "FeelFlow ID Platform SDK for React/Next.js applications",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"feelflow",
|
|
7
|
-
"ffid",
|
|
8
|
-
"sdk",
|
|
9
|
-
"react",
|
|
10
|
-
"nextjs",
|
|
11
|
-
"authentication"
|
|
12
|
-
],
|
|
13
|
-
"author": "FeelFlow <dev@feelflow.net>",
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"homepage": "https://github.com/feel-flow/feelflow-id-platform/tree/develop/sdk/typescript#readme",
|
|
16
|
-
"bugs": {
|
|
17
|
-
"url": "https://github.com/feel-flow/feelflow-id-platform/issues"
|
|
18
|
-
},
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "https://github.com/feel-flow/feelflow-id-platform.git",
|
|
22
|
-
"directory": "sdk/typescript"
|
|
23
|
-
},
|
|
24
|
-
"type": "module",
|
|
25
|
-
"main": "./dist/index.cjs",
|
|
26
|
-
"module": "./dist/index.js",
|
|
27
|
-
"types": "./dist/index.d.ts",
|
|
28
|
-
"exports": {
|
|
29
|
-
".": {
|
|
30
|
-
"types": "./dist/index.d.ts",
|
|
31
|
-
"import": "./dist/index.js",
|
|
32
|
-
"require": "./dist/index.cjs"
|
|
33
|
-
},
|
|
34
|
-
"./components": {
|
|
35
|
-
"types": "./dist/components/index.d.ts",
|
|
36
|
-
"import": "./dist/components/index.js",
|
|
37
|
-
"require": "./dist/components/index.cjs"
|
|
38
|
-
},
|
|
39
|
-
"./consent": {
|
|
40
|
-
"types": "./dist/consent/index.d.ts",
|
|
41
|
-
"import": "./dist/consent/index.js",
|
|
42
|
-
"require": "./dist/consent/index.cjs"
|
|
43
|
-
},
|
|
44
|
-
"./legal": {
|
|
45
|
-
"types": "./dist/legal/index.d.ts",
|
|
46
|
-
"import": "./dist/legal/index.js",
|
|
47
|
-
"require": "./dist/legal/index.cjs"
|
|
48
|
-
},
|
|
49
|
-
"./webhooks": {
|
|
50
|
-
"types": "./dist/webhooks/index.d.ts",
|
|
51
|
-
"import": "./dist/webhooks/index.js",
|
|
52
|
-
"require": "./dist/webhooks/index.cjs"
|
|
53
|
-
},
|
|
54
|
-
"./announcements": {
|
|
55
|
-
"types": "./dist/announcements/index.d.ts",
|
|
56
|
-
"import": "./dist/announcements/index.js",
|
|
57
|
-
"require": "./dist/announcements/index.cjs"
|
|
58
|
-
},
|
|
59
|
-
"./agency": {
|
|
60
|
-
"types": "./dist/agency/index.d.ts",
|
|
61
|
-
"import": "./dist/agency/index.js",
|
|
62
|
-
"require": "./dist/agency/index.cjs"
|
|
63
|
-
},
|
|
64
|
-
"./server": {
|
|
65
|
-
"types": "./dist/server/index.d.ts",
|
|
66
|
-
"import": "./dist/server/index.js",
|
|
67
|
-
"require": "./dist/server/index.cjs"
|
|
68
|
-
},
|
|
69
|
-
"./server/test": {
|
|
70
|
-
"types": "./dist/server/test/index.d.ts",
|
|
71
|
-
"import": "./dist/server/test/index.js",
|
|
72
|
-
"require": "./dist/server/test/index.cjs"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"files": [
|
|
76
|
-
"dist",
|
|
77
|
-
"README.md"
|
|
78
|
-
],
|
|
79
|
-
"sideEffects": false,
|
|
80
|
-
"scripts": {
|
|
81
|
-
"build": "rimraf dist && tsup",
|
|
82
|
-
"dev": "tsup --watch",
|
|
83
|
-
"type-check": "tsc --noEmit",
|
|
84
|
-
"lint": "eslint src",
|
|
85
|
-
"lint:fix": "eslint src --fix",
|
|
86
|
-
"test": "vitest run",
|
|
87
|
-
"test:watch": "vitest",
|
|
88
|
-
"test:coverage": "vitest run --coverage",
|
|
89
|
-
"prepublishOnly": "npm run build",
|
|
90
|
-
"sdk:publish": "./scripts/publish.sh"
|
|
91
|
-
},
|
|
92
|
-
"dependencies": {
|
|
93
|
-
"jose": "^6.0.0",
|
|
94
|
-
"zod": "^4.4.3"
|
|
95
|
-
},
|
|
96
|
-
"peerDependencies": {
|
|
97
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
98
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
99
|
-
},
|
|
100
|
-
"peerDependenciesMeta": {
|
|
101
|
-
"react": {
|
|
102
|
-
"optional": true
|
|
103
|
-
},
|
|
104
|
-
"react-dom": {
|
|
105
|
-
"optional": true
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
"devDependencies": {
|
|
109
|
-
"@testing-library/jest-dom": "^6.0.0",
|
|
110
|
-
"@testing-library/react": "^16.0.0",
|
|
111
|
-
"@types/node": "^22.19.17",
|
|
112
|
-
"@types/react": "^19.0.0",
|
|
113
|
-
"@types/react-dom": "^19.0.0",
|
|
114
|
-
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
115
|
-
"@typescript-eslint/parser": "^8.58.0",
|
|
116
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
117
|
-
"jsdom": "^27.0.0",
|
|
118
|
-
"react": "^19.0.0",
|
|
119
|
-
"react-dom": "^19.0.0",
|
|
120
|
-
"rimraf": "^6.1.2",
|
|
121
|
-
"tsup": "^8.0.0",
|
|
122
|
-
"typescript": "^5.0.0",
|
|
123
|
-
"vitest": "^4.0.0"
|
|
124
|
-
},
|
|
125
|
-
"engines": {
|
|
126
|
-
"node": ">=18.0.0"
|
|
127
|
-
},
|
|
128
|
-
"publishConfig": {
|
|
129
|
-
"access": "public"
|
|
130
|
-
}
|
|
131
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@feelflow/ffid-sdk",
|
|
3
|
+
"version": "10.1.0",
|
|
4
|
+
"description": "FeelFlow ID Platform SDK for React/Next.js applications",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"feelflow",
|
|
7
|
+
"ffid",
|
|
8
|
+
"sdk",
|
|
9
|
+
"react",
|
|
10
|
+
"nextjs",
|
|
11
|
+
"authentication"
|
|
12
|
+
],
|
|
13
|
+
"author": "FeelFlow <dev@feelflow.net>",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://github.com/feel-flow/feelflow-id-platform/tree/develop/sdk/typescript#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/feel-flow/feelflow-id-platform/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/feel-flow/feelflow-id-platform.git",
|
|
22
|
+
"directory": "sdk/typescript"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "./dist/index.cjs",
|
|
26
|
+
"module": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js",
|
|
32
|
+
"require": "./dist/index.cjs"
|
|
33
|
+
},
|
|
34
|
+
"./components": {
|
|
35
|
+
"types": "./dist/components/index.d.ts",
|
|
36
|
+
"import": "./dist/components/index.js",
|
|
37
|
+
"require": "./dist/components/index.cjs"
|
|
38
|
+
},
|
|
39
|
+
"./consent": {
|
|
40
|
+
"types": "./dist/consent/index.d.ts",
|
|
41
|
+
"import": "./dist/consent/index.js",
|
|
42
|
+
"require": "./dist/consent/index.cjs"
|
|
43
|
+
},
|
|
44
|
+
"./legal": {
|
|
45
|
+
"types": "./dist/legal/index.d.ts",
|
|
46
|
+
"import": "./dist/legal/index.js",
|
|
47
|
+
"require": "./dist/legal/index.cjs"
|
|
48
|
+
},
|
|
49
|
+
"./webhooks": {
|
|
50
|
+
"types": "./dist/webhooks/index.d.ts",
|
|
51
|
+
"import": "./dist/webhooks/index.js",
|
|
52
|
+
"require": "./dist/webhooks/index.cjs"
|
|
53
|
+
},
|
|
54
|
+
"./announcements": {
|
|
55
|
+
"types": "./dist/announcements/index.d.ts",
|
|
56
|
+
"import": "./dist/announcements/index.js",
|
|
57
|
+
"require": "./dist/announcements/index.cjs"
|
|
58
|
+
},
|
|
59
|
+
"./agency": {
|
|
60
|
+
"types": "./dist/agency/index.d.ts",
|
|
61
|
+
"import": "./dist/agency/index.js",
|
|
62
|
+
"require": "./dist/agency/index.cjs"
|
|
63
|
+
},
|
|
64
|
+
"./server": {
|
|
65
|
+
"types": "./dist/server/index.d.ts",
|
|
66
|
+
"import": "./dist/server/index.js",
|
|
67
|
+
"require": "./dist/server/index.cjs"
|
|
68
|
+
},
|
|
69
|
+
"./server/test": {
|
|
70
|
+
"types": "./dist/server/test/index.d.ts",
|
|
71
|
+
"import": "./dist/server/test/index.js",
|
|
72
|
+
"require": "./dist/server/test/index.cjs"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"files": [
|
|
76
|
+
"dist",
|
|
77
|
+
"README.md"
|
|
78
|
+
],
|
|
79
|
+
"sideEffects": false,
|
|
80
|
+
"scripts": {
|
|
81
|
+
"build": "rimraf dist && tsup",
|
|
82
|
+
"dev": "tsup --watch",
|
|
83
|
+
"type-check": "tsc --noEmit",
|
|
84
|
+
"lint": "eslint src",
|
|
85
|
+
"lint:fix": "eslint src --fix",
|
|
86
|
+
"test": "vitest run",
|
|
87
|
+
"test:watch": "vitest",
|
|
88
|
+
"test:coverage": "vitest run --coverage",
|
|
89
|
+
"prepublishOnly": "npm run build",
|
|
90
|
+
"sdk:publish": "./scripts/publish.sh"
|
|
91
|
+
},
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"jose": "^6.0.0",
|
|
94
|
+
"zod": "^4.4.3"
|
|
95
|
+
},
|
|
96
|
+
"peerDependencies": {
|
|
97
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
98
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
99
|
+
},
|
|
100
|
+
"peerDependenciesMeta": {
|
|
101
|
+
"react": {
|
|
102
|
+
"optional": true
|
|
103
|
+
},
|
|
104
|
+
"react-dom": {
|
|
105
|
+
"optional": true
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"devDependencies": {
|
|
109
|
+
"@testing-library/jest-dom": "^6.0.0",
|
|
110
|
+
"@testing-library/react": "^16.0.0",
|
|
111
|
+
"@types/node": "^22.19.17",
|
|
112
|
+
"@types/react": "^19.0.0",
|
|
113
|
+
"@types/react-dom": "^19.0.0",
|
|
114
|
+
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
115
|
+
"@typescript-eslint/parser": "^8.58.0",
|
|
116
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
117
|
+
"jsdom": "^27.0.0",
|
|
118
|
+
"react": "^19.0.0",
|
|
119
|
+
"react-dom": "^19.0.0",
|
|
120
|
+
"rimraf": "^6.1.2",
|
|
121
|
+
"tsup": "^8.0.0",
|
|
122
|
+
"typescript": "^5.0.0",
|
|
123
|
+
"vitest": "^4.0.0"
|
|
124
|
+
},
|
|
125
|
+
"engines": {
|
|
126
|
+
"node": ">=18.0.0"
|
|
127
|
+
},
|
|
128
|
+
"publishConfig": {
|
|
129
|
+
"access": "public"
|
|
130
|
+
}
|
|
131
|
+
}
|