3.0.47 • Published 7 months ago

@d8d-appcontainer/api v3.0.47

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

D8D AppContainer API 客户端

这个包提供了与 D8D AppContainer 服务进行交互的 API 客户端。

安装

npm install @d8d-appcontainer/api

基本使用

import { APIClientFactory } from '@d8d-appcontainer/api';

// 创建系统客户端
const systemClient = APIClientFactory.createSystemClient({
  endpoint: 'https://your-endpoint.com',
  token: 'your-token'
});

// 创建用户客户端
const userClient = APIClientFactory.createUserClient({
  endpoint: 'https://your-endpoint.com',
  token: 'your-token'
});

// 等待连接
await systemClient.connect();

// 使用服务
const result = await systemClient.database.query('your-collection', {});

可用服务

客户端提供以下服务:

系统客户端 (SystemAPIClient)

用户客户端 (UserAPIClient)

核心模块

工具函数

API 客户端还提供了以下工具函数:

  • uploadMinIOWithPolicy: 使用策略上传文件到 MinIO
  • uploadOSSWithPolicy: 使用策略上传文件到 OSS

类型

该库导出以下主要类型:

  • SystemAPIClient, UserAPIClient: 客户端类型
  • AppContainerBaseConfig, QueryOptions, APIResponse, ErrorCode, SchemaAPI: 基础配置和响应类型
  • Transaction: 数据库事务类型
  • WechatWebUserInfo, WechatMiniUserInfo: 微信用户信息类型

导出的类和API

  • BaseAPI: 所有API服务的基类
  • ConnectionManager: 处理与服务器的连接
  • ErrorHandler: 统一错误处理
  • APIClient: 客户端基类
  • APIClientFactory: 创建不同类型客户端的工厂
  • QueryBuilder: SQL查询构建器
3.0.47

7 months ago

3.0.46

7 months ago

3.0.45

7 months ago

3.0.44

7 months ago

3.0.43

7 months ago

3.0.42

7 months ago

3.0.41

7 months ago

3.0.40

7 months ago

3.0.39

8 months ago

3.0.38

8 months ago

3.0.37

8 months ago

3.0.36

8 months ago

3.0.35

8 months ago

3.0.34

8 months ago

3.0.33

8 months ago

3.0.32

8 months ago

3.0.31

8 months ago

3.0.30

8 months ago

3.0.29

8 months ago

3.0.28

8 months ago

3.0.27

8 months ago

3.0.26

8 months ago

3.0.25

8 months ago

3.0.24

8 months ago

3.0.23

8 months ago

3.0.22

9 months ago

3.0.21

9 months ago

3.0.20

9 months ago

3.0.19

9 months ago

3.0.18

9 months ago

3.0.17

9 months ago

3.0.16

9 months ago

3.0.15

9 months ago

3.0.14

10 months ago

3.0.13

10 months ago

3.0.12

10 months ago

3.0.11

10 months ago

3.0.10

10 months ago

3.0.9

10 months ago

3.0.8

10 months ago

3.0.7

10 months ago

3.0.6

10 months ago

3.0.5

10 months ago

3.0.4

10 months ago

3.0.3

10 months ago

3.0.1

11 months ago

3.0.0

11 months ago

2.0.0

11 months ago