Skip to content

Commit

Permalink
Merge branch 'develop' into feature/sdk-v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
trunges21 committed Sep 8, 2023
2 parents 0614c3b + e25628f commit 39ff0da
Show file tree
Hide file tree
Showing 13 changed files with 123 additions and 802 deletions.
818 changes: 44 additions & 774 deletions README.md

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions dist/SDK/KindeSDK.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
*
*/
/// <reference types="react-native" />
import * as runtime from '../ApiClient';
import { AuthBrowserOptions } from '../types/Auth';
import { AdditionalParameters, FeatureFlag, OptionalFlag, OrgAdditionalParams, TokenResponse } from '../types/KindeSDK';
import { TokenType } from './Enums';
import * as runtime from '../ApiClient';
/**
* The KindeSDK module.
* @module SDK/KindeSDK
Expand All @@ -27,6 +28,7 @@ declare class KindeSDK extends runtime.BaseAPI {
scope: string;
clientSecret?: string;
additionalParameters: AdditionalParameters;
authBrowserOptions?: AuthBrowserOptions;
/**
* The constructor function takes in a bunch of parameters and sets them to the class properties
* @param {string} issuer - The URL of the OIDC provider.
Expand All @@ -37,41 +39,46 @@ declare class KindeSDK extends runtime.BaseAPI {
* @param {string} [scope=openid profile email offline] - The scope of the authentication. This is
* a space-separated list of scopes.
* @param {AdditionalParameters} additionalParameters - AdditionalParameters = {}
* @param {AuthBrowserOptions} [authBrowserOptions] - Authentication browser options.
*/
constructor(issuer: string, redirectUri: string, clientId: string, logoutRedirectUri: string, scope?: string, additionalParameters?: Pick<AdditionalParameters, 'audience'>);
constructor(issuer: string, redirectUri: string, clientId: string, logoutRedirectUri: string, scope?: string, additionalParameters?: Pick<AdditionalParameters, 'audience'>, authBrowserOptions?: AuthBrowserOptions);
/**
* The function takes an object as an argument, and if the object is empty, it will use the default
* object
* @param {AdditionalParameters} additionalParameters - AdditionalParameters = {}
* @param {AuthBrowserOptions} [authBrowserOptions] - Authentication browser options.
* @returns A promise that resolves to void.
*/
login(additionalParameters?: Omit<OrgAdditionalParams, 'is_create_org'>): Promise<TokenResponse | null>;
login(additionalParameters?: Omit<OrgAdditionalParams, 'is_create_org'>, authBrowserOptions?: AuthBrowserOptions): Promise<TokenResponse | null>;
/**
* This function registers an organization with additional parameters and authenticates it using an
* authorization code.
* @param {OrgAdditionalParams} additionalParameters - `additionalParameters` is an optional object
* parameter that can be passed to the `register` function. It is used to provide additional
* parameters that may be required for the registration process. These parameters can vary
* depending on the specific implementation of the registration process.
* @param {AuthBrowserOptions} [authBrowserOptions] - Authentication browser options.
* @returns A Promise that resolves to void.
*/
register(additionalParameters?: OrgAdditionalParams): Promise<TokenResponse | null>;
register(additionalParameters?: OrgAdditionalParams, authBrowserOptions?: AuthBrowserOptions): Promise<TokenResponse | null>;
/**
* This function creates an organization with additional parameters.
* @param additionalParameters
* @param {AuthBrowserOptions} [authBrowserOptions] - Authentication browser options.
* @returns A promise that resolves to void.
*/
createOrg(additionalParameters?: Omit<OrgAdditionalParams, 'is_create_org'>): Promise<TokenResponse | null>;
createOrg(additionalParameters?: Omit<OrgAdditionalParams, 'is_create_org'>, authBrowserOptions?: AuthBrowserOptions): Promise<TokenResponse | null>;
/**
* The `logout` function is an asynchronous function that performs cleanup tasks and then either
* revokes the user's authorization or redirects them to a logout endpoint.
* @param [isRevoke=false] - A boolean value indicating whether the logout should also revoke the
* user's authorization.
* @param {AuthBrowserOptions} [authBrowserOptions] - Authentication browser options.
* @returns a boolean value. If the `isRevoke` parameter is `true`, it returns `true` if the revoke
* request is successful, and `false` if there is an error. If the `isRevoke` parameter is `false`,
* it returns `true` if the logout redirect is successful, and `false` if there is an error.
*/
logout(isRevoke?: boolean): Promise<boolean>;
logout(isRevoke?: boolean, authBrowserOptions?: AuthBrowserOptions): Promise<boolean>;
/**
* This function retrieves a token from a given URL using authorization code grant type and checks
* for validity before doing so.
Expand Down
2 changes: 1 addition & 1 deletion dist/SDK/KindeSDK.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/SDK/OAuth/AuthorizationCode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
import { AdditionalParameters, TokenResponse } from '../../types/KindeSDK';
import KindeSDK from '../KindeSDK';
import { AuthBrowserOptions } from '../../types/Auth';
declare class AuthorizationCode {
/**
* It opens the login page in the browser.
Expand All @@ -21,7 +22,7 @@ declare class AuthorizationCode {
* @param {AdditionalParameters} additionalParameters - AdditionalParameters = {}
* @returns A promise that resolves when the URL is opened.
*/
authenticate(kindeSDK: KindeSDK, usePKCE?: boolean, startPage?: 'login' | 'registration', additionalParameters?: AdditionalParameters): Promise<TokenResponse | null>;
authenticate(kindeSDK: KindeSDK, usePKCE?: boolean, startPage?: 'login' | 'registration', additionalParameters?: AdditionalParameters, options?: AuthBrowserOptions): Promise<TokenResponse | null>;
buildBaseAuthenticateURL(kindeSDK: KindeSDK): Record<string, string | undefined>;
}
export default AuthorizationCode;
2 changes: 1 addition & 1 deletion dist/SDK/OAuth/AuthorizationCode.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/SDK/Utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ export declare const checkAdditionalParameters: (additionalParameters?: Addition
*/
export declare const addAdditionalParameters: (target: Record<string, string | undefined>, additionalParameters?: AdditionalParameters) => Record<string, string | undefined>;
export declare const isExpoGo: boolean;
export declare const OpenWebInApp: (url: string, kindeSDK: KindeSDK) => Promise<import("../types/KindeSDK").TokenResponse | null>;
export declare const openWebBrowser: (url: string, redirectUri: string) => Promise<WebBrowser.WebBrowserRedirectResult | WebBrowser.WebBrowserResult | import("react-native-inappbrowser-reborn").BrowserResult>;
export declare const OpenWebInApp: (url: string, kindeSDK: KindeSDK, options?: WebBrowser.AuthSessionOpenOptions | import("react-native-inappbrowser-reborn").InAppBrowseriOSOptions | import("react-native-inappbrowser-reborn").InAppBrowserAndroidOptions | undefined) => Promise<import("../types/KindeSDK").TokenResponse | null>;
export declare const openWebBrowser: (url: string, redirectUri: string, options?: WebBrowser.AuthSessionOpenOptions | import("react-native-inappbrowser-reborn").InAppBrowseriOSOptions | import("react-native-inappbrowser-reborn").InAppBrowserAndroidOptions | undefined) => Promise<WebBrowser.WebBrowserRedirectResult | WebBrowser.WebBrowserResult | import("react-native-inappbrowser-reborn").BrowserResult>;
export declare const convertObject2FormData: (obj: Record<string, any>) => FormData;
Loading

0 comments on commit 39ff0da

Please sign in to comment.