1.0.39 • Published 2 months ago

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

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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.39

2 months ago

1.0.38

2 months ago

1.0.37

2 months ago

1.0.36

2 months ago

1.0.35

2 months ago

1.0.34

2 months ago

1.0.33

2 months ago

1.0.32

2 months ago

1.0.29

2 months ago

1.0.28

2 months ago

1.0.31

2 months ago

1.0.30

2 months ago

1.0.26

2 months ago

1.0.27

2 months ago

1.0.25

2 months ago

1.0.24

3 months ago

1.0.22

4 months ago

1.0.21

4 months ago

1.0.20

4 months ago

1.0.23

4 months ago

1.0.19

4 months ago

1.0.18

4 months ago

1.0.17

4 months ago

1.0.16

4 months ago

1.0.15

4 months ago

1.0.14

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.11

4 months ago

1.0.10

4 months ago

1.0.13

4 months ago

1.0.12

4 months ago

1.0.0

4 months ago