@isomorph.ai/app-sdk 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/index.d.ts +6 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +5 -0
- package/dist/supabase-compat.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -230,6 +230,10 @@ and no second GET is sent. When the refresh fails, `identity.current()`
|
|
|
230
230
|
answers `null` and listeners hear `null`, as before. On the page's own origin
|
|
231
231
|
the identity GET is never renewed (it is the renewal). (1.5.3)
|
|
232
232
|
|
|
233
|
+
## External OTP users
|
|
234
|
+
|
|
235
|
+
Use `user.id` for ownership and database row rules. External users can sign in with a phone number and have no email. `user.name`, `user.phone`, `user.email` and the `emailVerified`/`phoneVerified` flags describe their profile; an optional contact is not verified automatically. `user.directory` identifies `company` or `external`. Database transactions also expose `current_setting('harbour.directory', true)` when a row rule needs that distinction.
|
|
236
|
+
|
|
233
237
|
## The signed-in user's groups
|
|
234
238
|
|
|
235
239
|
`user.groups` — the company groups your identity provider sent at sign-in; use
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,12 @@ export declare class IsomorphError extends Error {
|
|
|
13
13
|
}
|
|
14
14
|
export interface IsomorphUser {
|
|
15
15
|
id: string;
|
|
16
|
-
email
|
|
16
|
+
email?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
phone?: string;
|
|
19
|
+
directory?: 'company' | 'external';
|
|
20
|
+
emailVerified?: boolean;
|
|
21
|
+
phoneVerified?: boolean;
|
|
17
22
|
/**
|
|
18
23
|
* The company groups your identity provider sent at sign-in, `[]` when it
|
|
19
24
|
* sent none. Use them for in-app roles: who may open the app at all is
|
package/dist/runtime.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const GET_RUN_ACTION = "isomorph-jobs-get";
|
|
|
11
11
|
export declare const CANCEL_RUN_ACTION = "isomorph-jobs-cancel";
|
|
12
12
|
export interface ActionContext {
|
|
13
13
|
signal: AbortSignal;
|
|
14
|
-
user:
|
|
14
|
+
user: IsomorphUser;
|
|
15
15
|
tenant: string;
|
|
16
16
|
app: string;
|
|
17
17
|
requestId: string;
|
package/dist/runtime.js
CHANGED
|
@@ -489,11 +489,16 @@ export class Runtime {
|
|
|
489
489
|
const controller = new AbortController();
|
|
490
490
|
const abort = () => controller.abort();
|
|
491
491
|
response.once('close', abort);
|
|
492
|
+
const directory = header(request, 'X-Harbour-Verified-Directory');
|
|
492
493
|
const user = {
|
|
493
494
|
id: header(request, 'X-Harbour-Verified-User-ID'),
|
|
494
495
|
email: header(request, 'X-Harbour-Verified-User-Email'),
|
|
495
496
|
groups: userGroupsFromHeader(header(request, 'X-Harbour-Verified-User-Groups')),
|
|
496
497
|
role: userRole(header(request, 'X-Harbour-Verified-User-Role')),
|
|
498
|
+
...(directory === 'company' || directory === 'external' ? { directory } : {}),
|
|
499
|
+
...(header(request, 'X-Harbour-Verified-User-Name') ? { name: header(request, 'X-Harbour-Verified-User-Name') } : {}),
|
|
500
|
+
...(header(request, 'X-Harbour-Verified-User-Phone') ? { phone: header(request, 'X-Harbour-Verified-User-Phone') } : {}),
|
|
501
|
+
...(directory === 'external' ? { emailVerified: header(request, 'X-Harbour-Verified-Email-Verified') === 'true', phoneVerified: header(request, 'X-Harbour-Verified-Phone-Verified') === 'true' } : {}),
|
|
497
502
|
};
|
|
498
503
|
const streams = header(request, 'accept').toLowerCase().includes(PROGRESS_MEDIA_TYPE);
|
|
499
504
|
let steps = 0;
|
|
@@ -130,7 +130,7 @@ export declare class SupabaseCompatQueryBuilder<T, Result = T[], Head extends bo
|
|
|
130
130
|
}
|
|
131
131
|
export interface SupabaseCompatUser {
|
|
132
132
|
id: string;
|
|
133
|
-
email
|
|
133
|
+
email?: string;
|
|
134
134
|
app_metadata: Record<string, unknown>;
|
|
135
135
|
/** Isomorph's per-app user record (`IsomorphUser.appUser`) when it is an object. */
|
|
136
136
|
user_metadata: Record<string, unknown>;
|