@flow-industries/id 0.22.0 → 0.23.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 +69 -8
- package/contracts/v1/openapi.json +818 -0
- package/contracts/v1/reports.json +188 -0
- package/contracts/v1/sdk-exports.json +1165 -0
- package/dist/sdk/browser-contract.d.ts +30 -0
- package/dist/sdk/browser-contract.js +19 -0
- package/dist/sdk/browser-session-route.d.ts +8 -0
- package/dist/sdk/browser-session-route.js +196 -0
- package/dist/sdk/client/create-flow.js +176 -166
- package/dist/sdk/client/dialog-host.js +11 -6
- package/dist/sdk/client/flow-widget.js +4 -4
- package/dist/sdk/client/idb.d.ts +1 -0
- package/dist/sdk/client/idb.js +24 -0
- package/dist/sdk/client/iframe-host.d.ts +2 -1
- package/dist/sdk/client/iframe-host.js +11 -1
- package/dist/sdk/client/index.d.ts +2 -0
- package/dist/sdk/client/index.js +1 -0
- package/dist/sdk/client/open-profile.js +19 -8
- package/dist/sdk/client/profile-button.d.ts +1 -13
- package/dist/sdk/client/profile-button.js +114 -170
- package/dist/sdk/client/reports.d.ts +9 -0
- package/dist/sdk/client/reports.js +30 -0
- package/dist/sdk/client/session.d.ts +1 -10
- package/dist/sdk/client/session.js +0 -37
- package/dist/sdk/client/static-flow.js +1 -0
- package/dist/sdk/contracts/http.d.ts +155 -0
- package/dist/sdk/contracts/http.js +91 -0
- package/dist/sdk/contracts/reports.d.ts +130 -0
- package/dist/sdk/contracts/reports.js +67 -0
- package/dist/sdk/dialog/remote/Messenger.d.ts +3 -0
- package/dist/sdk/dialog/remote/Messenger.js +9 -3
- package/dist/sdk/react/hooks.d.ts +1 -1
- package/dist/sdk/react/profile-button.d.ts +1 -12
- package/dist/sdk/react/profile-button.js +1 -12
- package/dist/sdk/session-route.js +101 -4
- package/dist/sdk/types/dialog.d.ts +0 -3
- package/dist/sdk/types/index.d.ts +2 -1
- package/dist/sdk/types/landing.d.ts +1 -0
- package/dist/sdk/types/reports.d.ts +7 -0
- package/dist/sdk/types/reports.js +0 -0
- package/dist/sdk/types/sdk.d.ts +7 -21
- package/dist/sdk/types/server.d.ts +6 -0
- package/dist/sdk/wagmi/index.js +0 -3
- package/package.json +18 -9
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { RpcRequest } from "./protocol";
|
|
2
1
|
/**
|
|
3
2
|
* Async view state for a dialog panel — the three states every fetched
|
|
4
3
|
* section renders (spinner / retry row / content), so "empty" stays
|
|
@@ -91,7 +90,6 @@ export type DialogState = {
|
|
|
91
90
|
customLabels?: DialogCustomLabels;
|
|
92
91
|
};
|
|
93
92
|
export type SignUpProps = {
|
|
94
|
-
request: RpcRequest;
|
|
95
93
|
rpId: string;
|
|
96
94
|
accessKeyHash?: string | undefined;
|
|
97
95
|
guestToken?: string | undefined;
|
|
@@ -99,7 +97,6 @@ export type SignUpProps = {
|
|
|
99
97
|
onSignIn: () => void;
|
|
100
98
|
};
|
|
101
99
|
export type SignInWithEmailProps = {
|
|
102
|
-
request: RpcRequest;
|
|
103
100
|
onBack: () => void;
|
|
104
101
|
onHome: () => void;
|
|
105
102
|
};
|
|
@@ -13,9 +13,10 @@ export type { Bridge, BridgeParameters, FlowAccount, FlowRemote, FlowRemoteConfi
|
|
|
13
13
|
export type { OtpVerificationFailure, OtpVerificationResult, VerificationAdapter, } from "./otp";
|
|
14
14
|
export type { Call, ConnectCapabilities, ConnectRequest, ConnectResponse, GuestRequest, GuestResponse, MethodName, MethodParams, MethodResult, RestoreResponse, RpcRequest, SendCallsParams, SendCallsRequest, SendCallsResponse, SendTransactionParams, SendTransactionRequest, SendTransactionResponse, SignMessageRequest, SignMessageResponse, SignOutRequest, SignOutResponse, SignTypedDataRequest, SignTypedDataResponse, TransactionArgs, TypedData, TypedDataDomain, TypedDataField, } from "./protocol";
|
|
15
15
|
export { getConnectCapabilities, isPersonalSignParams, isSendCallsParams, isSendTransactionParams, } from "./protocol";
|
|
16
|
+
export type { ReportOperation, ReportRequest, ReportResponse, ReportsApi, ReportTransport, } from "./reports";
|
|
16
17
|
export type { CreateRoomEventInput, RoomEventArchive, RoomEventAttendance, RoomEventFrequency, RoomEventInstance, RoomEventInterest, RoomEventInterestState, RoomEventList, RoomEventOccurrence, RoomEventRecurrence, RoomEventRoomRef, RoomEventRun, RoomEventSeries, RoomEventStatus, SetInterestInput, UpdateRoomEventInput, } from "./room-events";
|
|
17
18
|
export type { CreateRoomInput, GlobalRole, ModerationSubject, MyRooms, PlayerPositionReport, RoleChangeVerdict, RoomCapabilities, RoomCapability, RoomChannel, RoomDetail, RoomList, RoomMemberEntry, RoomMembers, RoomOccupancy, RoomOwner, RoomPlayerPosition, RoomPresenceEntry, RoomPresenceSnapshot, RoomRestrictionKind, RoomRole, RoomSummary, RoomSurfaceSettings, RoomsApi, RoomVisibility, StaffEntry, UpdateRoomInput, VerifyRoomContext, Viewer, VoiceDecisionReason, VoiceDecisionSubject, VoiceRoomDecision, } from "./rooms";
|
|
18
|
-
export type { AccessKeyOptions, AccessKeyPreparation, Address, ColorScheme, CreateDialogHostOptions, CreateFlowOptions, DialogHost, DialogOpenOptions, FinalizeAccessKeyParams, Flow, FlowConnectorParameters, FlowCookieNames, FlowIdProviderProps, FlowSessionState, FlowState, FlowWidgetHandle, FlowWidgetName, FlowWidgetProps, Listener, LoginOptions, MountFlowWidgetOptions, MountProfileOptions, OpenProfileOptions, PrepareArgsWithAuth, PrepareTransactionRequestPhase, ProfileButtonHandle, ProfileButtonProps, ProfilePosition, ResolveAccountParams, ResolvedAccessKeyOptions, RootCredential,
|
|
19
|
+
export type { AccessKeyOptions, AccessKeyPreparation, Address, ColorScheme, CreateDialogHostOptions, CreateFlowOptions, DialogHost, DialogOpenOptions, FinalizeAccessKeyParams, Flow, FlowConnectorParameters, FlowCookieNames, FlowIdProviderProps, FlowSessionState, FlowState, FlowWidgetHandle, FlowWidgetName, FlowWidgetProps, Listener, LoginOptions, MountFlowWidgetOptions, MountProfileOptions, OpenProfileOptions, PrepareArgsWithAuth, PrepareTransactionRequestPhase, ProfileButtonHandle, ProfileButtonProps, ProfilePosition, ResolveAccountParams, ResolvedAccessKeyOptions, RootCredential, SendCallsArgs, SendTransactionArgs, Session, SigningContext, SignMessageArgs, SignTypedDataArgs, Store, StoredAccessKey, UseOpenProfileOptions, WagmiConnectCapabilities, WagmiConnectParams, } from "./sdk";
|
|
19
20
|
export type { GracefulShutdownCleanup, GracefulShutdownOptions, GracefulShutdownServer, GracefulShutdownSignal, ResolvedFlowSession, ResolveSessionOptions, SessionRouteOptions, SessionRouteResponse, SessionRouteSession, } from "./server";
|
|
20
21
|
export type { CosmeticOffer, PaintDescriptor, SettingDescriptor, Settings, SettingsMigration, StoredSettings, SurfaceRegistry, } from "./settings";
|
|
21
22
|
export type { CreateStudySubjectInput, ListStudySessionsInput, StudyCatalog, StudyCategory, StudyCategoryTotals, StudyField, StudyRange, StudySessionEntry, StudySessionPage, StudySessionsResult, StudySubject, StudySubjectCreation, StudySubjectList, StudySubjectRefusal, StudySubjectRemoval, StudySubjectRemovalResponse, StudySubjectTotals, StudySubjectUpdate, StudySummary, UpdateStudySubjectInput, } from "./study";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { httpOperations } from "../contracts/http";
|
|
3
|
+
export type ReportOperation = keyof typeof httpOperations;
|
|
4
|
+
export type ReportRequest<T extends ReportOperation> = z.input<(typeof httpOperations)[T]["request"]>;
|
|
5
|
+
export type ReportResponse<T extends ReportOperation> = z.output<(typeof httpOperations)[T]["response"]>;
|
|
6
|
+
export type ReportTransport = (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
7
|
+
export type ReportsApi = <T extends ReportOperation>(operation: T, body: ReportRequest<T>) => Promise<ReportResponse<T>>;
|
|
File without changes
|
package/dist/sdk/types/sdk.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Chain, Hex, PrepareTransactionRequestParameters, SendTransactionPa
|
|
|
3
3
|
import type { SendCallsParameters } from "viem/actions";
|
|
4
4
|
import type { RawValue } from "../json";
|
|
5
5
|
import type { AdditionalSession, FlowCredential, FlowUser, WebAuthnSignature } from "./auth";
|
|
6
|
-
import type { ConnectCapabilities
|
|
6
|
+
import type { ConnectCapabilities } from "./protocol";
|
|
7
7
|
import type { RoomsApi } from "./rooms";
|
|
8
8
|
export type Address = `0x${string}`;
|
|
9
9
|
/**
|
|
@@ -133,10 +133,9 @@ export type FlowCookieNames = {
|
|
|
133
133
|
refresh: string;
|
|
134
134
|
};
|
|
135
135
|
export type LoginOptions = {
|
|
136
|
-
|
|
136
|
+
returnTo?: string;
|
|
137
137
|
signUp?: boolean;
|
|
138
138
|
signIn?: boolean;
|
|
139
|
-
signInHeadless?: boolean;
|
|
140
139
|
};
|
|
141
140
|
export type Session = {
|
|
142
141
|
user: FlowUser;
|
|
@@ -197,7 +196,7 @@ export type ColorScheme = "light" | "dark" | "light dark";
|
|
|
197
196
|
export type ProfilePosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
198
197
|
export type MountProfileOptions = {
|
|
199
198
|
/**
|
|
200
|
-
* Element to mount the
|
|
199
|
+
* Element to mount the native account button into. When omitted, a fixed-position
|
|
201
200
|
* container is created and anchored via `position` — the path of least
|
|
202
201
|
* resistance for non-DOM hosts (the Godot canvas overlay).
|
|
203
202
|
*/
|
|
@@ -221,12 +220,10 @@ export type MountProfileOptions = {
|
|
|
221
220
|
};
|
|
222
221
|
export type ProfileButtonHandle = {
|
|
223
222
|
/**
|
|
224
|
-
* Recolors the mounted
|
|
225
|
-
* theme toggle calls this instead of remounting: rebuilding the iframe would
|
|
226
|
-
* reload the widget and flash the pill out of the layout on every toggle.
|
|
223
|
+
* Recolors the mounted account button without remounting it.
|
|
227
224
|
*/
|
|
228
225
|
setTheme: (theme: ColorScheme) => void;
|
|
229
|
-
/** Tears down the
|
|
226
|
+
/** Tears down the button, listeners, and any auto-created container. */
|
|
230
227
|
destroy: () => void;
|
|
231
228
|
};
|
|
232
229
|
export type OpenProfileOptions = {
|
|
@@ -332,7 +329,8 @@ export type Flow = {
|
|
|
332
329
|
* actions on `!isGuest`, not on `isAuthenticated`.
|
|
333
330
|
*/
|
|
334
331
|
readonly isGuest: boolean;
|
|
335
|
-
login(options?: LoginOptions): Promise<
|
|
332
|
+
login(options?: LoginOptions): Promise<never>;
|
|
333
|
+
openAccount(): boolean;
|
|
336
334
|
logout(): Promise<void>;
|
|
337
335
|
restore(): Promise<boolean>;
|
|
338
336
|
/**
|
|
@@ -413,18 +411,6 @@ export type ProfileButtonProps = {
|
|
|
413
411
|
/** Color scheme for the widget chrome; defaults to "light dark" (the OS). */
|
|
414
412
|
theme?: ColorScheme;
|
|
415
413
|
};
|
|
416
|
-
export type RunLoginParams = {
|
|
417
|
-
dialog: DialogHost;
|
|
418
|
-
store: Store<FlowState>;
|
|
419
|
-
options?: LoginOptions;
|
|
420
|
-
extraCapabilities?: ConnectCapabilities;
|
|
421
|
-
};
|
|
422
|
-
export type RunLoginResult = {
|
|
423
|
-
session: Session;
|
|
424
|
-
refreshToken: string;
|
|
425
|
-
webauthn: ConnectResponse["webauthn"];
|
|
426
|
-
additionalSessions?: AdditionalSession[];
|
|
427
|
-
};
|
|
428
414
|
export type FinalizeAccessKeyParams = {
|
|
429
415
|
address: Address;
|
|
430
416
|
credential: FlowCredential;
|
|
@@ -53,6 +53,12 @@ export type SessionRouteSession = {
|
|
|
53
53
|
};
|
|
54
54
|
export type SessionRouteResponse = {
|
|
55
55
|
state: SessionRouteSession | null;
|
|
56
|
+
loginCompletion?: {
|
|
57
|
+
loginId: string;
|
|
58
|
+
userId: string;
|
|
59
|
+
expires: number;
|
|
60
|
+
webauthn?: import("./auth").WebAuthnSignature;
|
|
61
|
+
};
|
|
56
62
|
/**
|
|
57
63
|
* Additional-audience sessions minted by a reconcile request (POST `{ mint }`)
|
|
58
64
|
* — one per allowed audience the caller asked to provision. The consumer
|
package/dist/sdk/wagmi/index.js
CHANGED
|
@@ -5,12 +5,9 @@ flowConnector.type = "flow";
|
|
|
5
5
|
function loginOptionsFromCapabilities(capabilities) {
|
|
6
6
|
const signUp = capabilities?.type === "sign-up" || capabilities?.createAccount;
|
|
7
7
|
const signIn = capabilities?.type === "sign-in" || capabilities?.signIn;
|
|
8
|
-
const headless = !signUp &&
|
|
9
|
-
(capabilities?.signInHeadless || capabilities?.type === "sign-in");
|
|
10
8
|
return {
|
|
11
9
|
signUp: signUp ? true : undefined,
|
|
12
10
|
signIn: !signUp && signIn ? true : undefined,
|
|
13
|
-
signInHeadless: headless ? true : undefined,
|
|
14
11
|
};
|
|
15
12
|
}
|
|
16
13
|
export function flowConnector(parameters = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flow-industries/id",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -54,24 +54,29 @@
|
|
|
54
54
|
"./focus": {
|
|
55
55
|
"types": "./dist/sdk/client/focus.d.ts",
|
|
56
56
|
"import": "./dist/sdk/client/focus.js"
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
|
+
"./contracts/v1/reports.json": "./contracts/v1/reports.json",
|
|
59
|
+
"./contracts/v1/openapi.json": "./contracts/v1/openapi.json",
|
|
60
|
+
"./contracts/v1/sdk-exports.json": "./contracts/v1/sdk-exports.json"
|
|
58
61
|
},
|
|
59
62
|
"files": [
|
|
60
|
-
"dist/sdk"
|
|
63
|
+
"dist/sdk",
|
|
64
|
+
"contracts"
|
|
61
65
|
],
|
|
62
66
|
"scripts": {
|
|
63
67
|
"dev": "./dev.sh",
|
|
64
68
|
"build:dialog": "bunx vite build",
|
|
69
|
+
"build:legacy-dialog": "bunx vite build --config vite.legacy.config.ts",
|
|
65
70
|
"build:playground": "bunx vite build --config vite.playground.config.ts",
|
|
66
71
|
"build:landing": "bunx vite build --config vite.landing.config.ts",
|
|
67
|
-
"build": "bunx vite build && bunx vite build --config vite.playground.config.ts && bunx vite build --config vite.landing.config.ts",
|
|
72
|
+
"build": "bun run build:legacy-dialog && bunx vite build && bunx vite build --config vite.playground.config.ts && bunx vite build --config vite.landing.config.ts",
|
|
68
73
|
"build:sdk": "tsc --project tsconfig.sdk.json",
|
|
69
74
|
"prepublishOnly": "bun run build:sdk",
|
|
70
75
|
"start": "bun run src/index.ts",
|
|
71
76
|
"worker": "bun run src/worker.ts",
|
|
72
77
|
"db:generate": "bunx @better-auth/cli generate",
|
|
73
78
|
"db:migrate:gen": "bunx drizzle-kit generate",
|
|
74
|
-
"db:migrate": "
|
|
79
|
+
"db:migrate": "bun scripts/db-migrate.ts",
|
|
75
80
|
"db:push": "bunx drizzle-kit push",
|
|
76
81
|
"db:studio": "bunx drizzle-kit studio",
|
|
77
82
|
"usernames:refresh": "bun run scripts/generate-reserved-usernames.ts",
|
|
@@ -80,7 +85,11 @@
|
|
|
80
85
|
"test:sdk-package": "bash scripts/test-sdk-package.sh",
|
|
81
86
|
"format": "biome format --write",
|
|
82
87
|
"check": "biome check --write",
|
|
83
|
-
"typecheck": "tsr generate && tsc --noEmit"
|
|
88
|
+
"typecheck": "tsr generate && (cd src/legacy-dialog && bunx tsr generate) && tsc --noEmit && tsc -p tsconfig.legacy.json --noEmit",
|
|
89
|
+
"contracts:generate": "bun scripts/generate-contracts.ts",
|
|
90
|
+
"contracts:check": "bun scripts/generate-contracts.ts --check && bun scripts/check-contract-compatibility.ts",
|
|
91
|
+
"db:check": "bun scripts/db-check.ts",
|
|
92
|
+
"test:migrations": "bun test scripts/migrations.test.ts scripts/migration-drift.test.ts"
|
|
84
93
|
},
|
|
85
94
|
"peerDependencies": {
|
|
86
95
|
"viem": ">=2.47.10",
|
|
@@ -122,7 +131,9 @@
|
|
|
122
131
|
"tailwindcss": "^4.1.18",
|
|
123
132
|
"tw-animate-css": "^1.4.0",
|
|
124
133
|
"typescript": "^5",
|
|
125
|
-
"vite": "^7.3.1"
|
|
134
|
+
"vite": "^7.3.1",
|
|
135
|
+
"react": "^19.2.4",
|
|
136
|
+
"react-dom": "^19.2.4"
|
|
126
137
|
},
|
|
127
138
|
"trustedDependencies": [
|
|
128
139
|
"esbuild",
|
|
@@ -155,8 +166,6 @@
|
|
|
155
166
|
"motion": "^12.33.0",
|
|
156
167
|
"pino": "^10.3.1",
|
|
157
168
|
"postgres": "^3.4.8",
|
|
158
|
-
"react": "^19.2.4",
|
|
159
|
-
"react-dom": "^19.2.4",
|
|
160
169
|
"react-intersection-observer": "^10.0.2",
|
|
161
170
|
"sharp": "^0.35.2",
|
|
162
171
|
"tempo.ts": "^0.14.2",
|