@foir/sdk 0.25.0 → 0.27.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/CHANGELOG.md +84 -0
- package/dist/app/client.d.ts +82 -14
- package/dist/app/index.d.ts +1 -1
- package/dist/app/vocabulary.generated.d.ts +1 -1
- package/dist/app.js +24 -6
- package/dist/auth/auth.d.ts +10 -1
- package/dist/auth/hosted.d.ts +14 -3
- package/dist/auth/index.d.ts +3 -3
- package/dist/auth/operations.d.ts +32 -0
- package/dist/auth/ops.d.ts +1 -0
- package/dist/auth/session-client.d.ts +7 -2
- package/dist/auth-session.js +2 -1
- package/dist/auth.js +16 -3
- package/dist/data/builtins.d.ts +38 -13
- package/dist/data/index.d.ts +3 -3
- package/dist/data.js +11 -1
- package/dist/next.js +3 -0
- package/dist/placement/index.d.ts +17 -0
- package/dist/placement.js +16 -3
- package/dist/push.js +3 -0
- package/dist/react/FoirFeedback.d.ts +12 -5
- package/dist/react/FoirProvider.d.ts +5 -4
- package/dist/react/feedback-notes.d.ts +38 -4
- package/dist/react.js +116 -23
- package/dist/server/index.d.ts +1 -1
- package/dist/server.js +13 -1
- package/dist/transport/foir-http.d.ts +17 -1
- package/package.json +2 -2
|
@@ -55,7 +55,14 @@ export declare function resolveFoirApiKey(env: FoirEnv): string | undefined;
|
|
|
55
55
|
* because an absent record is an answer rather than a failure. `NOT_FOUND` only
|
|
56
56
|
* appears when a mutation names something that does not exist.
|
|
57
57
|
*/
|
|
58
|
-
export type FoirErrorCode = 'INVALID_ARGUMENT' | 'NOT_FOUND' | 'ALREADY_EXISTS' | 'FAILED_PRECONDITION' | 'PERMISSION_DENIED' | 'UNAUTHENTICATED' | 'RATE_LIMITED' | 'TIMEOUT' | 'UNAVAILABLE' | 'CANCELED' | 'INTERNAL';
|
|
58
|
+
export type FoirErrorCode = 'INVALID_ARGUMENT' | 'NOT_FOUND' | 'ALREADY_EXISTS' | 'FAILED_PRECONDITION' | 'PERMISSION_DENIED' | 'UNAUTHENTICATED' | 'RATE_LIMITED' | 'TIMEOUT' | 'UNAVAILABLE' | 'CANCELED' | 'INTERNAL' | 'STEP_UP_REQUIRED';
|
|
59
|
+
/**
|
|
60
|
+
* What a `STEP_UP_REQUIRED` refusal asks of the signed-in user, in
|
|
61
|
+
* `extensions.stepUp`: `second_factor`, prove a second factor (the step-up
|
|
62
|
+
* flow) and retry; `sign_in_method`, sign in again with a method the
|
|
63
|
+
* organization the request stands in accepts.
|
|
64
|
+
*/
|
|
65
|
+
export type FoirStepUp = 'second_factor' | 'sign_in_method';
|
|
59
66
|
export interface FoirErrorExtensions {
|
|
60
67
|
/** Stable machine-readable code. Branch on this, never on `message`. */
|
|
61
68
|
code?: FoirErrorCode | string;
|
|
@@ -63,6 +70,8 @@ export interface FoirErrorExtensions {
|
|
|
63
70
|
requestId?: string;
|
|
64
71
|
/** On `RATE_LIMITED`: whole seconds to wait. Never less than 1. */
|
|
65
72
|
retryAfter?: number;
|
|
73
|
+
/** On `STEP_UP_REQUIRED`: what the signed-in user must do before retrying. */
|
|
74
|
+
stepUp?: FoirStepUp;
|
|
66
75
|
[key: string]: unknown;
|
|
67
76
|
}
|
|
68
77
|
export interface FoirGraphQLErrorItem {
|
|
@@ -115,6 +124,13 @@ export interface FoirRateLimitSnapshot {
|
|
|
115
124
|
/** Unix seconds at which the window resets. */
|
|
116
125
|
resetAt: number;
|
|
117
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* What an error asks of the signed-in user before the request can succeed, or
|
|
129
|
+
* null: an organization's sign-in rules turned the session away, because it
|
|
130
|
+
* requires a second factor the session has not proven (`second_factor`) or does
|
|
131
|
+
* not accept how the user signed in (`sign_in_method`).
|
|
132
|
+
*/
|
|
133
|
+
export declare function stepUpRequired(error: unknown): FoirStepUp | null;
|
|
118
134
|
export declare class FoirRequestError extends Error {
|
|
119
135
|
/** HTTP status code, when the request failed at the HTTP layer. */
|
|
120
136
|
readonly status?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foir/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Official Foir SDK — editor iframe client + server-side platform helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"blurhash": "^2.0.5",
|
|
169
169
|
"graphql": "^16.10.0",
|
|
170
170
|
"hls.js": "^1.6.16",
|
|
171
|
-
"jsdom": "^
|
|
171
|
+
"jsdom": "^28.1.0",
|
|
172
172
|
"react": "^19.2.0",
|
|
173
173
|
"react-dom": "^19.2.0",
|
|
174
174
|
"tsup": "^8.5.1",
|