1.0.47 • Published 11 months ago

@cubekit-cloud/cubekit-sdk-js v1.0.47

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Cubekit Client SDK

@cubekit-cloud/cubekit-sdk-js - the library for working with auto generated API from cubekit.com. This SDK uses axios to send requests.

Table of Contents

CubekitOrmClient

	// CubekitOrmClient is needed for working with auto generated ORM API
	import { IOrmClientConfig, CubekitOrmClient } from '@cubekit-cloud/cubekit-sdk-js';
	// You can get your configuration from your application page.
	const config: IOrmClientConfig = {
		baseUrl: 'url';
		serviceKey: 'key';
	};
	const ormClient = new CubekitOrmClient(config);
	ormClient.send({...});

Kind: global class

CubekitOrmClient~setConfig(config)

Set new configuration

Kind: inner method of CubekitOrmClient

ParamTypeDescription
configIOrmClientConfigan object with new configuration

Example

const config: IOrmClientConfig = {
 baseUrl: '/';
 serviceKey: 'xxxx-xxxx-xxxx-xxxx';
}

ormClient.setConfig(config);

CubekitOrmClient~setAuthorizationHeader(value)

Set authorization header

Kind: inner method of CubekitOrmClient

ParamTypeDescription
valuestringa string with auth data

Example

ormClient.setAuthorizationHeader('Basic YWxhZGRpbjpvcGVuc2VzYW1l');

CubekitOrmClient~send(params) ⇒ Promise.<AxiosResponse.<IResponse.<T2>, any>>

Send request to API cubkit.com with params.

Kind: inner method of CubekitOrmClient

ParamTypeDescription
paramsIOrmRequestParameter.<T>A generic object containing all the necessary parameters for successful request.
params.pathstringPath to a exactly model in your application. It can be got from documentation on main page of your application.
params.methodRequestOrmMethodsEnumRequest type.
params.optionsISearchOptions.<T> | IGetByIdOptions.<T> | ICreateOptions.<T> | IUpdateOptions.<T> | IDeleteOptionsData to be sent.

Example

interface A {
	id: string;
}
interface B extends A {
	name: string;
}
ormClient.send<A, A>({
}).then((response) => {...}) //response.data.data can be able to string | A | A[]
ormClient.send<A, B>({
}).then((response) => {...}) //response.data.data can be able to string | B | B[]

CubekitStorageClient

	// CubekitStorageClient is needed for working with auto generated Storage API
	import { IStorageClientConfig, CubekitStorageClient } from '@cubekit-cloud/cubekit-sdk-js';
	// You can get your configuration from your application page.
	const config: IStorageClientConfig = {
		baseUrl: 'url';
		serviceKey: 'key';
		storageId: 'id';
	};
	const storageClient = new CubekitStorageClient(config);
	storageClient.upload({...});

Kind: global class

CubekitStorageClient.setConfig(config)

Set new configuration

Kind: static method of CubekitStorageClient

ParamTypeDescription
configIStorageClientConfigan object with new configuration

Example

const config: IStorageClientConfig = {
 baseUrl: '/';
 serviceKey: 'xxxx-xxxx-xxxx-xxxx';
 storageId: 'xxxx-xxxx-xxxx-xxxx';
}

storageClient.setConfig(config);
1.0.40

1 year ago

1.0.44

11 months ago

1.0.43

11 months ago

1.0.42

11 months ago

1.0.41

11 months ago

1.0.47

11 months ago

1.0.46

11 months ago

1.0.45

11 months ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.26

1 year ago

1.0.27

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.23

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.0

1 year ago