@kivacore/signin 0.0.0 → 0.20.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 +1191 -1
- package/dist/constants-jx2_MXlr.d.ts +271 -0
- package/dist/core-index.d.ts +124 -0
- package/dist/core-index.js +1924 -0
- package/dist/core-index.js.map +1 -0
- package/dist/electron/index.d.ts +35 -0
- package/dist/electron/index.js +59 -0
- package/dist/electron/index.js.map +1 -0
- package/dist/index.d.ts +126 -0
- package/dist/index.js +2263 -0
- package/dist/index.js.map +1 -0
- package/dist/nextjs/index.d.ts +180 -0
- package/dist/nextjs/index.js +91 -0
- package/dist/nextjs/index.js.map +1 -0
- package/dist/react-native/index.d.ts +44 -0
- package/dist/react-native/index.js +2119 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/types-DmIgZa_v.d.ts +816 -0
- package/dist/use-docyrus-client-QqgMT3b9.d.ts +32 -0
- package/dist/vue/index.d.ts +214 -0
- package/dist/vue/index.js +2006 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +73 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { D as DocyrusAuthConfig, g as DocyrusAuthContextValue } from './types-DmIgZa_v.js';
|
|
4
|
+
import { RestApiClient } from '@kivacore/api-client';
|
|
5
|
+
|
|
6
|
+
interface DocyrusAuthProviderProps extends DocyrusAuthConfig {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** Render a custom screen for a blocking auth error. */
|
|
9
|
+
renderAuthError?: (error: Error) => ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function DocyrusAuthProvider({ children, renderAuthError, ...config }: DocyrusAuthProviderProps): react.JSX.Element;
|
|
12
|
+
|
|
13
|
+
declare const DocyrusAuthContext: react.Context<DocyrusAuthContextValue | null>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Hook to access Docyrus auth state.
|
|
17
|
+
* Must be used within a <DocyrusAuthProvider>.
|
|
18
|
+
*
|
|
19
|
+
* Returns: { status, mode, tokens, signIn, signInWithTokens, signOut, client, error }
|
|
20
|
+
*/
|
|
21
|
+
declare function useDocyrusAuth(): DocyrusAuthContextValue;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Hook to get the pre-configured RestApiClient.
|
|
25
|
+
* Returns null when not authenticated.
|
|
26
|
+
*
|
|
27
|
+
* Throws if used outside DocyrusAuthProvider.
|
|
28
|
+
*/
|
|
29
|
+
declare function useDocyrusClient(): RestApiClient | null;
|
|
30
|
+
|
|
31
|
+
export { DocyrusAuthContext as D, DocyrusAuthProvider as a, useDocyrusClient as c, useDocyrusAuth as u };
|
|
32
|
+
export type { DocyrusAuthProviderProps as b };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
import { OAuth2TokenStorage, OAuth2Tokens, RestApiClient } from '@kivacore/api-client';
|
|
4
|
+
import { c as AuthMode, e as AuthStatus, m as DocyrusSharePayload, i as DocyrusEmailPayload, h as DocyrusCalendarEventPayload, p as MsGraphClient } from '../types-DmIgZa_v.js';
|
|
5
|
+
import { HostNavigationHandler, HostNotificationHandler, RouteChangePayload, HostNavigationRequestOptions } from '../core-index.js';
|
|
6
|
+
export { b as AdaptiveCard, D as DocyrusAuthConfig, l as DocyrusShareAdaptiveCardPayload, n as DocyrusShareTextPayload, M as MsGraphAccount, q as MsGraphRequest, r as MsGraphRequestOptions, s as MsGraphResponse, t as MsGraphStatus } from '../types-DmIgZa_v.js';
|
|
7
|
+
|
|
8
|
+
interface DocyrusAuthState {
|
|
9
|
+
status: AuthStatus;
|
|
10
|
+
mode: AuthMode | null;
|
|
11
|
+
tokens: OAuth2Tokens | null;
|
|
12
|
+
client: RestApiClient | null;
|
|
13
|
+
error: Error | null;
|
|
14
|
+
signIn: () => void;
|
|
15
|
+
signInWithTokens: (tokens: OAuth2Tokens) => Promise<void>;
|
|
16
|
+
getAuthorizationUrl: () => Promise<string | null>;
|
|
17
|
+
signOut: () => Promise<void>;
|
|
18
|
+
onHostNavigation: (handler: HostNavigationHandler) => () => void;
|
|
19
|
+
onHostNotification: (handler: HostNotificationHandler) => () => void;
|
|
20
|
+
enableHostRouteSync: () => void;
|
|
21
|
+
notifyRouteChange: (payload?: RouteChangePayload) => void;
|
|
22
|
+
requestHostNavigation: (url: string, options?: HostNavigationRequestOptions) => void;
|
|
23
|
+
sendToDocy: (payload: DocyrusSharePayload) => Promise<void>;
|
|
24
|
+
sendToChat: (payload: DocyrusSharePayload) => Promise<void>;
|
|
25
|
+
sendToEmail: (payload: DocyrusEmailPayload) => Promise<void>;
|
|
26
|
+
sendToCalendar: (payload: DocyrusCalendarEventPayload) => Promise<void>;
|
|
27
|
+
msGraph: MsGraphClient | null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Vue composable to access Docyrus auth state.
|
|
31
|
+
* Must be used within a `<DocyrusAuthProvider>`.
|
|
32
|
+
*
|
|
33
|
+
* Returns: { status, mode, tokens, signIn, signInWithTokens, signOut, client, error }
|
|
34
|
+
*/
|
|
35
|
+
declare function getDocyrusAuth(): DocyrusAuthState;
|
|
36
|
+
/** @deprecated Use `getDocyrusAuth()` instead. */
|
|
37
|
+
declare const useDocyrusAuth: typeof getDocyrusAuth;
|
|
38
|
+
/**
|
|
39
|
+
* Vue composable to get the pre-configured RestApiClient.
|
|
40
|
+
* Returns a computed ref that is null when not authenticated.
|
|
41
|
+
*/
|
|
42
|
+
declare function getDocyrusClient(): vue.ComputedRef<RestApiClient | null>;
|
|
43
|
+
/** @deprecated Use `getDocyrusClient()` instead. */
|
|
44
|
+
declare const useDocyrusClient: typeof getDocyrusClient;
|
|
45
|
+
/**
|
|
46
|
+
* Vue provider component that wraps your app with Docyrus auth context.
|
|
47
|
+
*
|
|
48
|
+
* Usage:
|
|
49
|
+
* ```vue
|
|
50
|
+
* <template>
|
|
51
|
+
* <DocyrusAuthProvider :apiUrl="apiUrl">
|
|
52
|
+
* <App />
|
|
53
|
+
* </DocyrusAuthProvider>
|
|
54
|
+
* </template>
|
|
55
|
+
*
|
|
56
|
+
* <script setup>
|
|
57
|
+
* import { DocyrusAuthProvider } from '@kivacore/signin/vue';
|
|
58
|
+
* </script>
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare const DocyrusAuthProvider: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
62
|
+
clientId: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: undefined;
|
|
65
|
+
};
|
|
66
|
+
apiUrl: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: undefined;
|
|
69
|
+
};
|
|
70
|
+
scopes: {
|
|
71
|
+
type: PropType<string[]>;
|
|
72
|
+
default: undefined;
|
|
73
|
+
};
|
|
74
|
+
redirectUri: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
default: undefined;
|
|
77
|
+
};
|
|
78
|
+
callbackPath: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
default: undefined;
|
|
81
|
+
};
|
|
82
|
+
allowedHostOrigins: {
|
|
83
|
+
type: PropType<string[]>;
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
86
|
+
storageKeyPrefix: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
tokenStorage: {
|
|
91
|
+
type: PropType<OAuth2TokenStorage>;
|
|
92
|
+
default: undefined;
|
|
93
|
+
};
|
|
94
|
+
forceMode: {
|
|
95
|
+
type: PropType<AuthMode>;
|
|
96
|
+
default: undefined;
|
|
97
|
+
};
|
|
98
|
+
initialTokens: {
|
|
99
|
+
type: PropType<OAuth2Tokens>;
|
|
100
|
+
default: undefined;
|
|
101
|
+
};
|
|
102
|
+
syncRouteToHost: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
default: boolean;
|
|
105
|
+
};
|
|
106
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
109
|
+
[key: string]: any;
|
|
110
|
+
}>[] | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
111
|
+
clientId: {
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
default: undefined;
|
|
114
|
+
};
|
|
115
|
+
apiUrl: {
|
|
116
|
+
type: StringConstructor;
|
|
117
|
+
default: undefined;
|
|
118
|
+
};
|
|
119
|
+
scopes: {
|
|
120
|
+
type: PropType<string[]>;
|
|
121
|
+
default: undefined;
|
|
122
|
+
};
|
|
123
|
+
redirectUri: {
|
|
124
|
+
type: StringConstructor;
|
|
125
|
+
default: undefined;
|
|
126
|
+
};
|
|
127
|
+
callbackPath: {
|
|
128
|
+
type: StringConstructor;
|
|
129
|
+
default: undefined;
|
|
130
|
+
};
|
|
131
|
+
allowedHostOrigins: {
|
|
132
|
+
type: PropType<string[]>;
|
|
133
|
+
default: undefined;
|
|
134
|
+
};
|
|
135
|
+
storageKeyPrefix: {
|
|
136
|
+
type: StringConstructor;
|
|
137
|
+
default: undefined;
|
|
138
|
+
};
|
|
139
|
+
tokenStorage: {
|
|
140
|
+
type: PropType<OAuth2TokenStorage>;
|
|
141
|
+
default: undefined;
|
|
142
|
+
};
|
|
143
|
+
forceMode: {
|
|
144
|
+
type: PropType<AuthMode>;
|
|
145
|
+
default: undefined;
|
|
146
|
+
};
|
|
147
|
+
initialTokens: {
|
|
148
|
+
type: PropType<OAuth2Tokens>;
|
|
149
|
+
default: undefined;
|
|
150
|
+
};
|
|
151
|
+
syncRouteToHost: {
|
|
152
|
+
type: BooleanConstructor;
|
|
153
|
+
default: boolean;
|
|
154
|
+
};
|
|
155
|
+
}>> & Readonly<{}>, {
|
|
156
|
+
clientId: string;
|
|
157
|
+
apiUrl: string;
|
|
158
|
+
scopes: string[];
|
|
159
|
+
redirectUri: string;
|
|
160
|
+
callbackPath: string;
|
|
161
|
+
allowedHostOrigins: string[];
|
|
162
|
+
storageKeyPrefix: string;
|
|
163
|
+
tokenStorage: OAuth2TokenStorage;
|
|
164
|
+
forceMode: AuthMode;
|
|
165
|
+
initialTokens: OAuth2Tokens;
|
|
166
|
+
syncRouteToHost: boolean;
|
|
167
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
168
|
+
/**
|
|
169
|
+
* "Sign in with Docyrus" button component.
|
|
170
|
+
*
|
|
171
|
+
* In iframe mode: renders nothing (auth is handled by the host).
|
|
172
|
+
* When authenticated: renders nothing.
|
|
173
|
+
*
|
|
174
|
+
* Default look: [Logo] label — or — [Spinner] label (when loading).
|
|
175
|
+
* Use class or the scoped slot for full customization.
|
|
176
|
+
*
|
|
177
|
+
* Usage:
|
|
178
|
+
* ```vue
|
|
179
|
+
* <SignInButton />
|
|
180
|
+
* <SignInButton label="Login" class="btn-primary" />
|
|
181
|
+
* <SignInButton v-slot="{ signIn, isLoading }">
|
|
182
|
+
* <MyCustomButton @click="signIn" :loading="isLoading" />
|
|
183
|
+
* </SignInButton>
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
declare const SignInButton: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
187
|
+
label: {
|
|
188
|
+
type: StringConstructor;
|
|
189
|
+
default: string;
|
|
190
|
+
};
|
|
191
|
+
disabled: {
|
|
192
|
+
type: BooleanConstructor;
|
|
193
|
+
default: boolean;
|
|
194
|
+
};
|
|
195
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
196
|
+
[key: string]: any;
|
|
197
|
+
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
198
|
+
[key: string]: any;
|
|
199
|
+
}>[] | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
200
|
+
label: {
|
|
201
|
+
type: StringConstructor;
|
|
202
|
+
default: string;
|
|
203
|
+
};
|
|
204
|
+
disabled: {
|
|
205
|
+
type: BooleanConstructor;
|
|
206
|
+
default: boolean;
|
|
207
|
+
};
|
|
208
|
+
}>> & Readonly<{}>, {
|
|
209
|
+
label: string;
|
|
210
|
+
disabled: boolean;
|
|
211
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
212
|
+
|
|
213
|
+
export { AuthMode, AuthStatus, DocyrusAuthProvider, DocyrusCalendarEventPayload, DocyrusEmailPayload, DocyrusSharePayload, MsGraphClient, SignInButton, getDocyrusAuth, getDocyrusClient, useDocyrusAuth, useDocyrusClient };
|
|
214
|
+
export type { DocyrusAuthState };
|