@authorizerdev/authorizer-js 1.2.1 → 1.2.2-beta.2

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.
@@ -1,185 +0,0 @@
1
- export interface ConfigType {
2
- authorizerURL: string;
3
- redirectURL: string;
4
- clientID: string;
5
- extraHeaders?: Record<string, string>;
6
- }
7
- export interface User {
8
- id: string;
9
- email: string;
10
- preferred_username: string;
11
- email_verified: boolean;
12
- signup_methods: string;
13
- given_name?: string | null;
14
- family_name?: string | null;
15
- middle_name?: string | null;
16
- nickname?: string | null;
17
- picture?: string | null;
18
- gender?: string | null;
19
- birthdate?: string | null;
20
- phone_number?: string | null;
21
- phone_number_verified?: boolean | null;
22
- roles?: string[];
23
- created_at: number;
24
- updated_at: number;
25
- is_multi_factor_auth_enabled?: boolean;
26
- }
27
- export interface AuthToken {
28
- message?: string;
29
- access_token: string;
30
- expires_in: number;
31
- id_token: string;
32
- refresh_token?: string;
33
- user?: User;
34
- should_show_otp_screen?: boolean;
35
- }
36
- export interface Response {
37
- message: string;
38
- }
39
- export type Headers = Record<string, string>;
40
- export interface LoginInput {
41
- email: string;
42
- password: string;
43
- roles?: string[];
44
- scope?: string[];
45
- state?: string;
46
- }
47
- export interface SignupInput {
48
- email: string;
49
- password: string;
50
- confirm_password: string;
51
- given_name?: string;
52
- family_name?: string;
53
- middle_name?: string;
54
- nickname?: string;
55
- picture?: string;
56
- gender?: string;
57
- birthdate?: string;
58
- phone_number?: string;
59
- roles?: string[];
60
- scope?: string[];
61
- redirect_uri?: string;
62
- is_multi_factor_auth_enabled?: boolean;
63
- state?: string;
64
- }
65
- export interface MagicLinkLoginInput {
66
- email: string;
67
- roles?: string[];
68
- scopes?: string[];
69
- state?: string;
70
- redirect_uri?: string;
71
- }
72
- export interface VerifyEmailInput {
73
- token: string;
74
- state?: string;
75
- }
76
- export interface VerifyOtpInput {
77
- email: string;
78
- otp: string;
79
- state?: string;
80
- }
81
- export interface ResendOtpInput {
82
- email: string;
83
- }
84
- export interface GraphqlQueryInput {
85
- query: string;
86
- variables?: Record<string, any>;
87
- headers?: Headers;
88
- }
89
- export interface MetaData {
90
- version: string;
91
- client_id: string;
92
- is_google_login_enabled: boolean;
93
- is_facebook_login_enabled: boolean;
94
- is_github_login_enabled: boolean;
95
- is_linkedin_login_enabled: boolean;
96
- is_apple_login_enabled: boolean;
97
- is_twitter_login_enabled: boolean;
98
- is_microsoft_login_enabled: boolean;
99
- is_email_verification_enabled: boolean;
100
- is_basic_authentication_enabled: boolean;
101
- is_magic_link_login_enabled: boolean;
102
- is_sign_up_enabled: boolean;
103
- is_strong_password_enabled: boolean;
104
- }
105
- export interface UpdateProfileInput {
106
- old_password?: string;
107
- new_password?: string;
108
- confirm_new_password?: string;
109
- email?: string;
110
- given_name?: string;
111
- family_name?: string;
112
- middle_name?: string;
113
- nickname?: string;
114
- gender?: string;
115
- birthdate?: string;
116
- phone_number?: string;
117
- picture?: string;
118
- is_multi_factor_auth_enabled?: boolean;
119
- }
120
- export interface ForgotPasswordInput {
121
- email: string;
122
- state?: string;
123
- redirect_uri?: string;
124
- }
125
- export interface ResetPasswordInput {
126
- token: string;
127
- password: string;
128
- confirm_password: string;
129
- }
130
- export interface SessionQueryInput {
131
- roles?: string[];
132
- }
133
- export interface IsValidJWTQueryInput {
134
- jwt: string;
135
- roles?: string[];
136
- }
137
- export interface ValidJWTResponse {
138
- valid: string;
139
- message: string;
140
- }
141
- export declare enum OAuthProviders {
142
- Apple = "apple",
143
- Github = "github",
144
- Google = "google",
145
- Facebook = "facebook",
146
- LinkedIn = "linkedin"
147
- }
148
- export declare enum ResponseTypes {
149
- Code = "code",
150
- Token = "token"
151
- }
152
- export interface AuthorizeInput {
153
- response_type: ResponseTypes;
154
- use_refresh_token?: boolean;
155
- response_mode?: string;
156
- }
157
- export interface AuthorizeResponse {
158
- state: string;
159
- code?: string;
160
- error?: string;
161
- error_description?: string;
162
- }
163
- export interface RevokeTokenInput {
164
- refresh_token: string;
165
- }
166
- export interface GetTokenInput {
167
- code?: string;
168
- grant_type?: string;
169
- refresh_token?: string;
170
- }
171
- export interface GetTokenResponse {
172
- access_token: string;
173
- expires_in: number;
174
- id_token: string;
175
- refresh_token?: string;
176
- }
177
- export interface ValidateJWTTokenInput {
178
- token_type: 'access_token' | 'id_token' | 'refresh_token';
179
- token: string;
180
- roles?: string[];
181
- }
182
- export interface ValidateJWTTokenResponse {
183
- is_valid: boolean;
184
- claims: Record<string, any>;
185
- }
@@ -1,13 +0,0 @@
1
- import { AuthorizeResponse } from './types';
2
- export declare const hasWindow: () => boolean;
3
- export declare const trimURL: (url: string) => string;
4
- export declare const getCrypto: () => Crypto | null;
5
- export declare const getCryptoSubtle: () => any;
6
- export declare const createRandomString: () => string;
7
- export declare const encode: (value: string) => string;
8
- export declare const decode: (value: string) => string;
9
- export declare const createQueryParams: (params: any) => string;
10
- export declare const sha256: (s: string) => Promise<any>;
11
- export declare const urlDecodeB64: (input: string) => string;
12
- export declare const bufferToBase64UrlEncoded: (input: number[] | Uint8Array) => string;
13
- export declare const executeIframe: (authorizeUrl: string, eventOrigin: string, timeoutInSeconds?: number) => Promise<AuthorizeResponse>;
package/lib/types.d.ts DELETED
@@ -1,185 +0,0 @@
1
- export interface ConfigType {
2
- authorizerURL: string;
3
- redirectURL: string;
4
- clientID: string;
5
- extraHeaders?: Record<string, string>;
6
- }
7
- export interface User {
8
- id: string;
9
- email: string;
10
- preferred_username: string;
11
- email_verified: boolean;
12
- signup_methods: string;
13
- given_name?: string | null;
14
- family_name?: string | null;
15
- middle_name?: string | null;
16
- nickname?: string | null;
17
- picture?: string | null;
18
- gender?: string | null;
19
- birthdate?: string | null;
20
- phone_number?: string | null;
21
- phone_number_verified?: boolean | null;
22
- roles?: string[];
23
- created_at: number;
24
- updated_at: number;
25
- is_multi_factor_auth_enabled?: boolean;
26
- }
27
- export interface AuthToken {
28
- message?: string;
29
- access_token: string;
30
- expires_in: number;
31
- id_token: string;
32
- refresh_token?: string;
33
- user?: User;
34
- should_show_otp_screen?: boolean;
35
- }
36
- export interface Response {
37
- message: string;
38
- }
39
- export type Headers = Record<string, string>;
40
- export interface LoginInput {
41
- email: string;
42
- password: string;
43
- roles?: string[];
44
- scope?: string[];
45
- state?: string;
46
- }
47
- export interface SignupInput {
48
- email: string;
49
- password: string;
50
- confirm_password: string;
51
- given_name?: string;
52
- family_name?: string;
53
- middle_name?: string;
54
- nickname?: string;
55
- picture?: string;
56
- gender?: string;
57
- birthdate?: string;
58
- phone_number?: string;
59
- roles?: string[];
60
- scope?: string[];
61
- redirect_uri?: string;
62
- is_multi_factor_auth_enabled?: boolean;
63
- state?: string;
64
- }
65
- export interface MagicLinkLoginInput {
66
- email: string;
67
- roles?: string[];
68
- scopes?: string[];
69
- state?: string;
70
- redirect_uri?: string;
71
- }
72
- export interface VerifyEmailInput {
73
- token: string;
74
- state?: string;
75
- }
76
- export interface VerifyOtpInput {
77
- email: string;
78
- otp: string;
79
- state?: string;
80
- }
81
- export interface ResendOtpInput {
82
- email: string;
83
- }
84
- export interface GraphqlQueryInput {
85
- query: string;
86
- variables?: Record<string, any>;
87
- headers?: Headers;
88
- }
89
- export interface MetaData {
90
- version: string;
91
- client_id: string;
92
- is_google_login_enabled: boolean;
93
- is_facebook_login_enabled: boolean;
94
- is_github_login_enabled: boolean;
95
- is_linkedin_login_enabled: boolean;
96
- is_apple_login_enabled: boolean;
97
- is_twitter_login_enabled: boolean;
98
- is_microsoft_login_enabled: boolean;
99
- is_email_verification_enabled: boolean;
100
- is_basic_authentication_enabled: boolean;
101
- is_magic_link_login_enabled: boolean;
102
- is_sign_up_enabled: boolean;
103
- is_strong_password_enabled: boolean;
104
- }
105
- export interface UpdateProfileInput {
106
- old_password?: string;
107
- new_password?: string;
108
- confirm_new_password?: string;
109
- email?: string;
110
- given_name?: string;
111
- family_name?: string;
112
- middle_name?: string;
113
- nickname?: string;
114
- gender?: string;
115
- birthdate?: string;
116
- phone_number?: string;
117
- picture?: string;
118
- is_multi_factor_auth_enabled?: boolean;
119
- }
120
- export interface ForgotPasswordInput {
121
- email: string;
122
- state?: string;
123
- redirect_uri?: string;
124
- }
125
- export interface ResetPasswordInput {
126
- token: string;
127
- password: string;
128
- confirm_password: string;
129
- }
130
- export interface SessionQueryInput {
131
- roles?: string[];
132
- }
133
- export interface IsValidJWTQueryInput {
134
- jwt: string;
135
- roles?: string[];
136
- }
137
- export interface ValidJWTResponse {
138
- valid: string;
139
- message: string;
140
- }
141
- export declare enum OAuthProviders {
142
- Apple = "apple",
143
- Github = "github",
144
- Google = "google",
145
- Facebook = "facebook",
146
- LinkedIn = "linkedin"
147
- }
148
- export declare enum ResponseTypes {
149
- Code = "code",
150
- Token = "token"
151
- }
152
- export interface AuthorizeInput {
153
- response_type: ResponseTypes;
154
- use_refresh_token?: boolean;
155
- response_mode?: string;
156
- }
157
- export interface AuthorizeResponse {
158
- state: string;
159
- code?: string;
160
- error?: string;
161
- error_description?: string;
162
- }
163
- export interface RevokeTokenInput {
164
- refresh_token: string;
165
- }
166
- export interface GetTokenInput {
167
- code?: string;
168
- grant_type?: string;
169
- refresh_token?: string;
170
- }
171
- export interface GetTokenResponse {
172
- access_token: string;
173
- expires_in: number;
174
- id_token: string;
175
- refresh_token?: string;
176
- }
177
- export interface ValidateJWTTokenInput {
178
- token_type: 'access_token' | 'id_token' | 'refresh_token';
179
- token: string;
180
- roles?: string[];
181
- }
182
- export interface ValidateJWTTokenResponse {
183
- is_valid: boolean;
184
- claims: Record<string, any>;
185
- }
package/lib/utils.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import { AuthorizeResponse } from './types';
2
- export declare const hasWindow: () => boolean;
3
- export declare const trimURL: (url: string) => string;
4
- export declare const getCrypto: () => Crypto | null;
5
- export declare const getCryptoSubtle: () => any;
6
- export declare const createRandomString: () => string;
7
- export declare const encode: (value: string) => string;
8
- export declare const decode: (value: string) => string;
9
- export declare const createQueryParams: (params: any) => string;
10
- export declare const sha256: (s: string) => Promise<any>;
11
- export declare const urlDecodeB64: (input: string) => string;
12
- export declare const bufferToBase64UrlEncoded: (input: number[] | Uint8Array) => string;
13
- export declare const executeIframe: (authorizeUrl: string, eventOrigin: string, timeoutInSeconds?: number) => Promise<AuthorizeResponse>;
package/src/constants.ts DELETED
@@ -1,3 +0,0 @@
1
- export const DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS = 60
2
- export const CLEANUP_IFRAME_TIMEOUT_IN_SECONDS = 2
3
- export const AUTHORIZE_IFRAME_TIMEOUT = 5