abowire
Version:
This is the official **Abowire Javascript SDK**, which makes it easy to connect to the Abowire **GraphQL API** and includes all the required dependencies you need.
110 lines (109 loc) • 7.62 kB
TypeScript
import { ModuleConfiguration } from '../helpers/configuration/configuration';
import { SDKConfigOptions } from './sdk.schema';
import { AbowireGraphQLClient } from '../graphql/graphql-client';
import * as queries from '../queries';
import { Authentication, LoginOptions } from '../auth/types';
import { gql } from '../gen/gql';
import { CustomerApi } from './api/customer';
import { SubscriptionApi } from './api/subscription';
import { LicenseApi } from './api/license';
import { InvoiceApi } from './api/invoice';
import { TransactionApi } from './api/transaction';
import { LicenseUserApi } from './api/licenseUser';
import { ProductApi } from './api/product';
import { MemberApi } from './api/member';
import { AppApi } from './api/app';
import { UserApi } from './api/user';
import { CreditNoteApi } from './api/creditNote';
export declare abstract class BaseSDK {
protected auth?: Authentication;
protected config: ModuleConfiguration<import("yup/lib/object").AssertsShape<{
clientId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
secret: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
accountId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
scopes: any;
locale: any;
authUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
graphqlUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
checkSession: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
useStorage: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
enableLogging: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
autoLogin: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
}>>;
protected graphql?: AbowireGraphQLClient;
gql: typeof gql;
queries: typeof queries;
constructor(config?: SDKConfigOptions);
get configure(): {
(key: "secret" | "scopes" | "locale" | "graphqlUrl" | "authUrl" | "clientId" | "accountId" | "checkSession" | "useStorage" | "enableLogging" | "autoLogin", value: any): import("yup/lib/object").AssertsShape<{
clientId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
secret: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
accountId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
scopes: any;
locale: any;
authUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
graphqlUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
checkSession: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
useStorage: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
enableLogging: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
autoLogin: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
}>;
(config?: Partial<import("yup/lib/object").AssertsShape<{
clientId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
secret: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
accountId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
scopes: any;
locale: any;
authUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
graphqlUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
checkSession: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
useStorage: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
enableLogging: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
autoLogin: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
}>> | undefined): import("yup/lib/object").AssertsShape<{
clientId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
secret: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
accountId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
scopes: any;
locale: any;
authUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
graphqlUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
checkSession: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
useStorage: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
enableLogging: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
autoLogin: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
}>;
};
get getConfig(): () => import("yup/lib/object").AssertsShape<{
clientId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
secret: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
accountId: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
scopes: any;
locale: any;
authUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
graphqlUrl: import("yup").StringSchema<string, import("yup/lib/types").AnyObject, string>;
checkSession: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
useStorage: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
enableLogging: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
autoLogin: import("yup").BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean>;
}>;
get Helpers(): {
transform: <TInput = any, TOutput extends object = any>(input: TInput, outputSchema: import("../transform/types").Schema) => Promise<TOutput>;
};
get app(): AppApi;
get customer(): CustomerApi;
get product(): ProductApi;
get subscription(): SubscriptionApi;
get license(): LicenseApi;
get licenseUser(): LicenseUserApi;
get invoice(): InvoiceApi;
get creditNote(): CreditNoteApi;
get transaction(): TransactionApi;
get member(): MemberApi;
get user(): UserApi;
get GraphQL(): AbowireGraphQLClient;
protected abstract getAuth(): Authentication;
getTokens(): Promise<import("../auth/types").Tokens | undefined>;
login(options?: LoginOptions): Promise<import("../auth/types").Tokens | undefined>;
logout(): Promise<void>;
}