@asgardeo/vue 0.3.3 → 0.3.5

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.
@@ -15,58 +15,18 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteResponse } from '@asgardeo/browser';
19
18
  import { type Component } from 'vue';
19
+ export type { BaseSignUpRenderProps, BaseSignUpProps } from './v2/BaseSignUp';
20
20
  /**
21
- * Render props passed to the default scoped slot.
22
- */
23
- export interface BaseSignUpRenderProps {
24
- components: any[];
25
- error?: Error | null;
26
- fieldErrors: Record<string, string>;
27
- handleInputChange: (name: string, value: string) => void;
28
- handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;
29
- isLoading: boolean;
30
- isValid: boolean;
31
- messages: Array<{
32
- message: string;
33
- type: string;
34
- }>;
35
- subtitle: string;
36
- title: string;
37
- touched: Record<string, boolean>;
38
- validateForm: () => {
39
- fieldErrors: Record<string, string>;
40
- isValid: boolean;
41
- };
42
- values: Record<string, string>;
43
- }
44
- export interface BaseSignUpProps {
45
- afterSignUpUrl?: string;
46
- buttonClassName?: string;
47
- className?: string;
48
- error?: Error | null;
49
- errorClassName?: string;
50
- inputClassName?: string;
51
- isInitialized?: boolean;
52
- messageClassName?: string;
53
- onComplete?: (response: EmbeddedFlowExecuteResponse) => void;
54
- onError?: (error: Error) => void;
55
- onFlowChange?: (response: EmbeddedFlowExecuteResponse) => void;
56
- onInitialize?: (payload?: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;
57
- onSubmit?: (payload: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;
58
- shouldRedirectAfterSignUp?: boolean;
59
- showLogo?: boolean;
60
- showSubtitle?: boolean;
61
- showTitle?: boolean;
62
- size?: 'small' | 'medium' | 'large';
63
- variant?: 'elevated' | 'outlined' | 'flat';
64
- }
65
- /**
66
- * BaseSignUp — app-native sign-up presentation component.
21
+ * BaseSignUp platform-aware base sign-up component.
22
+ *
23
+ * Routes to V1 (component-driven, V1 flow API: `TYPOGRAPHY` / `INPUT` /
24
+ * `BUTTON` / `FORM` shapes) or V2 (`AsgardeoV2` platform with `BLOCK` / `STACK`
25
+ * / `TEXT_INPUT` shapes) based on the `platform` value resolved by
26
+ * {@link useAsgardeo}.
67
27
  *
68
- * Manages the sign-up flow lifecycle including initialization, form state,
69
- * passkey registration, popup-based social OAuth, and renders the server-driven UI.
28
+ * Mirrors the React `BaseSignUp` dispatcher and matches the existing pattern
29
+ * already used by `BaseSignIn` in this package.
70
30
  */
71
31
  declare const BaseSignUp: Component;
72
32
  export default BaseSignUp;
@@ -16,10 +16,13 @@
16
16
  * under the License.
17
17
  */
18
18
  import { type Component } from 'vue';
19
- import type { BaseSignUpRenderProps } from './BaseSignUp';
20
- export type SignUpRenderProps = BaseSignUpRenderProps;
19
+ export type { SignUpRenderProps } from './v2/SignUp';
21
20
  /**
22
- * SignUp — embedded sign-up component that handles API calls and delegates UI to BaseSignUp.
21
+ * SignUp — platform-aware sign-up container.
22
+ *
23
+ * Routes to V1 (default, component-driven V1 flow API) or V2 (`AsgardeoV2`
24
+ * platform) based on the `platform` value from {@link useAsgardeo}. Mirrors
25
+ * the existing `SignIn` dispatcher pattern in this package.
23
26
  */
24
27
  declare const SignUp: Component;
25
28
  export default SignUp;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { type Component } from 'vue';
19
+ /**
20
+ * Render-prop payload exposed via the default slot.
21
+ */
22
+ export interface BaseSignUpRenderProps {
23
+ components: any[];
24
+ errors: Record<string, string>;
25
+ handleInputChange: (name: string, value: string) => void;
26
+ handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;
27
+ isLoading: boolean;
28
+ isValid: boolean;
29
+ messages: Array<{
30
+ message: string;
31
+ type: string;
32
+ }>;
33
+ subtitle: string;
34
+ title: string;
35
+ touched: Record<string, boolean>;
36
+ values: Record<string, string>;
37
+ }
38
+ /**
39
+ * V1 BaseSignUp — component-driven app-native sign-up for Vue.
40
+ *
41
+ * Mirrors `packages/react/.../SignUp/v1/BaseSignUp.tsx`. Reads the
42
+ * `/api/server/v1/flow/execute` response shape (`TYPOGRAPHY`, `FORM`, `INPUT`,
43
+ * `BUTTON`, `RICH_TEXT`, etc.) and renders it via the V1
44
+ * `SignUpOptionFactory`. Tracks form state internally and submits steps via
45
+ * the `onSubmit` prop until the flow completes.
46
+ */
47
+ declare const BaseSignUp: Component;
48
+ export default BaseSignUp;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { type Component } from 'vue';
19
+ import type { BaseSignUpRenderProps } from './BaseSignUp';
20
+ export type SignUpRenderProps = BaseSignUpRenderProps;
21
+ /**
22
+ * V1 SignUp container — wires `useAsgardeo().signUp` into `BaseSignUpV1` and
23
+ * handles redirects after the flow completes.
24
+ *
25
+ * Mirrors `sign-up/v2/.../SignUp.ts` but invokes the V1 base component which
26
+ * understands the `TYPOGRAPHY` / `INPUT` / `BUTTON` / `FORM` shapes returned by
27
+ * the V1 flow API.
28
+ */
29
+ declare const SignUp: Component;
30
+ export default SignUp;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { EmbeddedFlowComponent } from '@asgardeo/browser';
19
+ import { type VNode } from 'vue';
20
+ /**
21
+ * Props shared by all sign-up component renderers.
22
+ */
23
+ export interface BaseSignUpOptionProps {
24
+ buttonClassName?: string;
25
+ component: EmbeddedFlowComponent;
26
+ formErrors: Record<string, string>;
27
+ formValues: Record<string, string>;
28
+ inputClassName?: string;
29
+ isFormValid: boolean;
30
+ isLoading: boolean;
31
+ onInputChange: (name: string, value: string) => void;
32
+ onSubmit: (component: EmbeddedFlowComponent, data?: Record<string, any>) => void;
33
+ size?: 'small' | 'medium' | 'large';
34
+ touchedFields: Record<string, boolean>;
35
+ }
36
+ /**
37
+ * Build a VNode for a single V1 flow component. Returns `null` for unknown
38
+ * types (caller filters these out).
39
+ */
40
+ export declare const createSignUpComponent: (props: BaseSignUpOptionProps) => VNode | VNode[] | null;
41
+ /**
42
+ * Render an array of V1 flow components as Vue VNodes, flattening nested
43
+ * containers (FORM) into a single list.
44
+ */
45
+ export declare const renderSignUpComponents: (components: EmbeddedFlowComponent[], formValues: Record<string, string>, touchedFields: Record<string, boolean>, formErrors: Record<string, string>, isLoading: boolean, isFormValid: boolean, onInputChange: (name: string, value: string) => void, onSubmit: (component: EmbeddedFlowComponent, data?: Record<string, any>) => void, options?: {
46
+ buttonClassName?: string;
47
+ inputClassName?: string;
48
+ size?: "small" | "medium" | "large";
49
+ }) => VNode[];
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteResponse } from '@asgardeo/browser';
19
+ import { type Component } from 'vue';
20
+ /**
21
+ * Render props passed to the default scoped slot.
22
+ */
23
+ export interface BaseSignUpRenderProps {
24
+ components: any[];
25
+ error?: Error | null;
26
+ fieldErrors: Record<string, string>;
27
+ handleInputChange: (name: string, value: string) => void;
28
+ handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;
29
+ isLoading: boolean;
30
+ isValid: boolean;
31
+ messages: Array<{
32
+ message: string;
33
+ type: string;
34
+ }>;
35
+ subtitle: string;
36
+ title: string;
37
+ touched: Record<string, boolean>;
38
+ validateForm: () => {
39
+ fieldErrors: Record<string, string>;
40
+ isValid: boolean;
41
+ };
42
+ values: Record<string, string>;
43
+ }
44
+ export interface BaseSignUpProps {
45
+ afterSignUpUrl?: string;
46
+ buttonClassName?: string;
47
+ className?: string;
48
+ error?: Error | null;
49
+ errorClassName?: string;
50
+ inputClassName?: string;
51
+ isInitialized?: boolean;
52
+ messageClassName?: string;
53
+ onComplete?: (response: EmbeddedFlowExecuteResponse) => void;
54
+ onError?: (error: Error) => void;
55
+ onFlowChange?: (response: EmbeddedFlowExecuteResponse) => void;
56
+ onInitialize?: (payload?: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;
57
+ onSubmit?: (payload: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;
58
+ shouldRedirectAfterSignUp?: boolean;
59
+ showLogo?: boolean;
60
+ showSubtitle?: boolean;
61
+ showTitle?: boolean;
62
+ size?: 'small' | 'medium' | 'large';
63
+ variant?: 'elevated' | 'outlined' | 'flat';
64
+ }
65
+ /**
66
+ * BaseSignUp — app-native sign-up presentation component.
67
+ *
68
+ * Manages the sign-up flow lifecycle including initialization, form state,
69
+ * passkey registration, popup-based social OAuth, and renders the server-driven UI.
70
+ */
71
+ declare const BaseSignUp: Component;
72
+ export default BaseSignUp;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { type Component } from 'vue';
19
+ import type { BaseSignUpRenderProps } from './BaseSignUp';
20
+ export type SignUpRenderProps = BaseSignUpRenderProps;
21
+ /**
22
+ * SignUp — embedded sign-up component that handles API calls and delegates UI to BaseSignUp.
23
+ */
24
+ declare const SignUp: Component;
25
+ export default SignUp;
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@
16
16
  * under the License.
17
17
  */
18
18
  export { default as AsgardeoPlugin } from './plugins/AsgardeoPlugin';
19
+ export type { AsgardeoPluginOptions } from './plugins/AsgardeoPlugin';
19
20
  export { default as AsgardeoProvider } from './providers/AsgardeoProvider';
20
21
  export { default as BrandingProvider } from './providers/BrandingProvider';
21
22
  export { default as FlowMetaProvider } from './providers/FlowMetaProvider';