@turbofy-ai/app-runtime 0.0.13 → 0.0.14
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/dist/src/dsl.d.ts +3 -2
- package/dist/src/dsl.js +4 -0
- package/dist/src/lib/auth.d.ts +4 -0
- package/dist/src/lib/guest-page.d.ts +8 -0
- package/dist/src/lib/guest-page.test.d.ts +1 -0
- package/dist/src/lib/preview-auth.d.ts +1 -0
- package/dist/src/lib/social-callback.d.ts +11 -0
- package/dist/src/lib/social-callback.test.d.ts +1 -0
- package/dist/src/lib/social-popup.d.ts +23 -0
- package/dist/src/lib/social-popup.test.d.ts +1 -0
- package/dist/src/lib/social-sign-in.test.d.ts +1 -0
- package/package.json +1 -1
- package/dist/src/lib/auth-actions.d.ts +0 -33
package/dist/src/dsl.d.ts
CHANGED
|
@@ -1753,6 +1753,7 @@ export type IAppSlugConfig = {
|
|
|
1753
1753
|
};
|
|
1754
1754
|
export declare const PAGE_VISIBILITY: readonly [
|
|
1755
1755
|
"public",
|
|
1756
|
+
"guest",
|
|
1756
1757
|
"authenticated",
|
|
1757
1758
|
"group",
|
|
1758
1759
|
"user"
|
|
@@ -1901,8 +1902,8 @@ export interface IPageOptions {
|
|
|
1901
1902
|
localizedConfig?: string;
|
|
1902
1903
|
/**
|
|
1903
1904
|
* Access level for the published page. Absent ⇒ "public".
|
|
1904
|
-
*
|
|
1905
|
-
* user/group
|
|
1905
|
+
* "guest" redirects signed-in visitors away. Private modes require a valid
|
|
1906
|
+
* end-user session; user/group permissions are enforced by the data layer.
|
|
1906
1907
|
*/
|
|
1907
1908
|
visibility?: PageVisibility;
|
|
1908
1909
|
/** Building block instances on this page. */
|
package/dist/src/dsl.js
CHANGED
|
@@ -16013,6 +16013,9 @@ function hasScheduleExpression(config2) {
|
|
|
16013
16013
|
return config2.cron !== void 0 || config2.rate !== void 0;
|
|
16014
16014
|
}
|
|
16015
16015
|
|
|
16016
|
+
// .tmp/declarations.ts
|
|
16017
|
+
var PAGE_VISIBILITY = ["public", "guest", "authenticated", "group", "user"];
|
|
16018
|
+
|
|
16016
16019
|
// ../dsl-builders/src/apps/app-builder.ts
|
|
16017
16020
|
var app_builder_exports = {};
|
|
16018
16021
|
__export(app_builder_exports, {
|
|
@@ -22882,6 +22885,7 @@ ${errors.map((message) => `- ${message}`).join("\n")}`
|
|
|
22882
22885
|
};
|
|
22883
22886
|
}
|
|
22884
22887
|
export {
|
|
22888
|
+
PAGE_VISIBILITY,
|
|
22885
22889
|
PublishingTypeEnum,
|
|
22886
22890
|
app_builder_exports as appBuilder,
|
|
22887
22891
|
collectSecretIds,
|
package/dist/src/lib/auth.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ISocialSignInOptions, ISocialSignInResult } from "@/lib/social-popup";
|
|
1
2
|
export interface IAuthResult {
|
|
2
3
|
ok: boolean;
|
|
3
4
|
error?: string;
|
|
@@ -47,6 +48,9 @@ export declare const socialSignIn: (params: {
|
|
|
47
48
|
state: string;
|
|
48
49
|
codeVerifier: string;
|
|
49
50
|
}) => Promise<IAuthResult>;
|
|
51
|
+
export type { ISocialSignInOptions, ISocialSignInResult, } from "@/lib/social-popup";
|
|
52
|
+
/** Preview uses the console callback; published apps supply their own callback. */
|
|
53
|
+
export declare const signInWithSocialProvider: (provider: string, options?: ISocialSignInOptions) => Promise<ISocialSignInResult>;
|
|
50
54
|
export declare const logout: () => Promise<IAuthResult>;
|
|
51
55
|
/** The signed-in end user, or null without a valid session. */
|
|
52
56
|
export declare const currentUser: () => Promise<ICurrentUserResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const pageRoutePattern: (locale: string, slug: string) => string;
|
|
2
|
+
export declare const resolveGuestRedirect: ({ next, defaultPath, homePath, currentPath, guestPatterns, }: {
|
|
3
|
+
next?: string;
|
|
4
|
+
defaultPath?: string;
|
|
5
|
+
homePath: string;
|
|
6
|
+
currentPath: string;
|
|
7
|
+
guestPatterns: string[];
|
|
8
|
+
}) => string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const APP_AUTH_CALLBACK_PATH = "/auth/app-callback";
|
|
2
|
+
export declare const APP_AUTH_CALLBACK_MESSAGE = "turbofy:app-auth-callback";
|
|
3
|
+
export interface ISocialCallback {
|
|
4
|
+
state: string;
|
|
5
|
+
code?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const parseSocialCallback: (search: string) => ISocialCallback | null;
|
|
9
|
+
export declare const readSocialCallbackMessage: (event: MessageEvent, popup: Window, callbackUrl: URL, state: string) => ISocialCallback | null;
|
|
10
|
+
export type ISocialCallbackStatus = "returning" | "returned" | "invalid" | "missingOpener" | "timedOut";
|
|
11
|
+
export declare const relaySocialCallback: (callback: ISocialCallback | null, onStatus: (status: ISocialCallbackStatus) => void) => (() => void);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IAuthResult, ISocialAuthorizeResult } from "@/lib/auth";
|
|
2
|
+
export type ISocialSignInErrorCode = "NOT_CONFIGURED" | "POPUP_BLOCKED" | "CANCELLED" | "TIMED_OUT" | "IN_PROGRESS" | "SIGN_IN_FAILED";
|
|
3
|
+
export type ISocialSignInResult = IAuthResult & {
|
|
4
|
+
errorCode?: ISocialSignInErrorCode;
|
|
5
|
+
};
|
|
6
|
+
export interface ISocialSignInOptions {
|
|
7
|
+
redirectUri?: string;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
interface IPopupActions {
|
|
11
|
+
authorize: (params: {
|
|
12
|
+
provider: string;
|
|
13
|
+
redirectUri: string;
|
|
14
|
+
codeChallenge: string;
|
|
15
|
+
}) => Promise<ISocialAuthorizeResult>;
|
|
16
|
+
exchange: (params: {
|
|
17
|
+
code: string;
|
|
18
|
+
state: string;
|
|
19
|
+
codeVerifier: string;
|
|
20
|
+
}) => Promise<IAuthResult>;
|
|
21
|
+
}
|
|
22
|
+
export declare const runSocialSignInPopup: (provider: string, options: ISocialSignInOptions, actions: IPopupActions) => Promise<ISocialSignInResult>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface IAuthUser {
|
|
2
|
-
sub: string;
|
|
3
|
-
email?: string;
|
|
4
|
-
groups?: string[];
|
|
5
|
-
}
|
|
6
|
-
export interface IAuthActionResult {
|
|
7
|
-
ok: boolean;
|
|
8
|
-
error?: string;
|
|
9
|
-
code?: string;
|
|
10
|
-
needsConfirmation?: boolean;
|
|
11
|
-
signedIn?: boolean;
|
|
12
|
-
signInError?: string;
|
|
13
|
-
user?: IAuthUser | null;
|
|
14
|
-
}
|
|
15
|
-
export type IInvokeAuthAction = (actionId: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
16
|
-
/** Each client belongs to one app and one session transport. */
|
|
17
|
-
export declare const createAuthActions: (invoke: IInvokeAuthAction) => {
|
|
18
|
-
login: (email: string, password: string) => Promise<IAuthActionResult>;
|
|
19
|
-
logout: () => Promise<IAuthActionResult>;
|
|
20
|
-
currentUser: () => Promise<IAuthActionResult>;
|
|
21
|
-
refreshAccessToken: () => Promise<IAuthActionResult>;
|
|
22
|
-
forgotPassword: (email: string) => Promise<IAuthActionResult>;
|
|
23
|
-
resetPassword: (email: string, code: string, newPassword: string) => Promise<IAuthActionResult>;
|
|
24
|
-
changePassword: (currentPassword: string, newPassword: string) => Promise<IAuthActionResult>;
|
|
25
|
-
signup: (params: {
|
|
26
|
-
email: string;
|
|
27
|
-
password: string;
|
|
28
|
-
name?: string;
|
|
29
|
-
}) => Promise<IAuthActionResult>;
|
|
30
|
-
confirmSignup: (email: string, code: string, password?: string) => Promise<IAuthActionResult>;
|
|
31
|
-
getSocialAuthorizeUrl: (provider: string, redirectUri: string) => Promise<string>;
|
|
32
|
-
socialSignIn: (callbackUrl: string) => Promise<IAuthActionResult>;
|
|
33
|
-
};
|