@cloudbase/oauth 1.0.0-alpha.4 → 1.2.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/index.d.ts +29 -0
- package/app/index.js +50 -0
- package/app/index.js.map +1 -0
- package/app/internal.d.ts +12 -0
- package/app/internal.js +25 -0
- package/app/internal.js.map +1 -0
- package/app/openuri.d.ts +20 -0
- package/app/openuri.js +106 -0
- package/app/openuri.js.map +1 -0
- package/app/request.d.ts +19 -0
- package/app/request.js +52 -0
- package/app/request.js.map +1 -0
- package/app/storage.d.ts +41 -0
- package/app/storage.js +35 -0
- package/app/storage.js.map +1 -0
- package/{dist/auth → auth}/consts.d.ts +21 -9
- package/auth/consts.js +79 -0
- package/auth/consts.js.map +1 -0
- package/auth/index.d.ts +242 -0
- package/auth/index.js +550 -0
- package/auth/index.js.map +1 -0
- package/auth/models.d.ts +284 -0
- package/auth/models.js +4 -0
- package/auth/models.js.map +1 -0
- package/captcha/index.d.ts +45 -0
- package/captcha/index.js +135 -0
- package/captcha/index.js.map +1 -0
- package/function/index.d.ts +38 -0
- package/function/index.js +80 -0
- package/function/index.js.map +1 -0
- package/index.d.ts +8 -0
- package/index.js +17 -0
- package/index.js.map +1 -0
- package/{dist/oauth2client → oauthclient}/consts.d.ts +1 -22
- package/oauthclient/consts.js +53 -0
- package/oauthclient/consts.js.map +1 -0
- package/oauthclient/index.d.ts +18 -0
- package/oauthclient/index.js +21 -0
- package/oauthclient/index.js.map +1 -0
- package/oauthclient/interface.d.ts +29 -0
- package/oauthclient/interface.js +10 -0
- package/oauthclient/interface.js.map +1 -0
- package/oauthclient/models.d.ts +40 -0
- package/oauthclient/models.js +3 -0
- package/oauthclient/models.js.map +1 -0
- package/oauthclient/oauthclient.d.ts +146 -0
- package/oauthclient/oauthclient.js +414 -0
- package/oauthclient/oauthclient.js.map +1 -0
- package/package.json +14 -26
- package/utils/promise.d.ts +18 -0
- package/utils/promise.js +48 -0
- package/utils/promise.js.map +1 -0
- package/utils/uuid.d.ts +5 -0
- package/utils/uuid.js +16 -0
- package/utils/uuid.js.map +1 -0
- package/.eslintignore +0 -2
- package/.eslintrc +0 -26
- package/CHANGELOG.md +0 -30
- package/Dockerfile +0 -15
- package/README.md +0 -183
- package/_exmaple/assets/scripts/function/function.ts +0 -99
- package/_exmaple/assets/scripts/index.ts +0 -101
- package/_exmaple/assets/scripts/request.ts +0 -11
- package/_exmaple/index.html +0 -15
- package/_exmaple/package.json +0 -33
- package/_exmaple/tsconfig.json +0 -71
- package/_exmaple/typings.d.ts +0 -0
- package/_exmaple/webpack.config.js +0 -42
- package/dist/auth/apis.d.ts +0 -55
- package/dist/auth/apis.js +0 -572
- package/dist/auth/consts.js +0 -61
- package/dist/auth/models.d.ts +0 -355
- package/dist/auth/models.js +0 -3
- package/dist/captcha/captcha.d.ts +0 -35
- package/dist/captcha/captcha.js +0 -267
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -63
- package/dist/oauth2client/consts.js +0 -73
- package/dist/oauth2client/interface.d.ts +0 -15
- package/dist/oauth2client/interface.js +0 -10
- package/dist/oauth2client/models.d.ts +0 -47
- package/dist/oauth2client/models.js +0 -3
- package/dist/oauth2client/oauth2client.d.ts +0 -71
- package/dist/oauth2client/oauth2client.js +0 -634
- package/dist/utils/function/single-promise.d.ts +0 -5
- package/dist/utils/function/single-promise.js +0 -89
- package/dist/utils/uuid.d.ts +0 -1
- package/dist/utils/uuid.js +0 -12
- package/publish.sh +0 -2
- package/src/auth/apis.ts +0 -646
- package/src/auth/consts.ts +0 -57
- package/src/auth/models.ts +0 -445
- package/src/captcha/captcha.ts +0 -222
- package/src/index.ts +0 -49
- package/src/oauth2client/consts.ts +0 -69
- package/src/oauth2client/interface.ts +0 -57
- package/src/oauth2client/models.ts +0 -61
- package/src/oauth2client/oauth2client.ts +0 -615
- package/src/utils/function/single-promise.ts +0 -40
- package/src/utils/uuid.ts +0 -11
- package/tsconfig.json +0 -44
- package/wiki/README.md +0 -75
package/wiki/README.md
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
## cloudbase sdk 更新内容
|
|
2
|
-
|
|
3
|
-
### 自动模块化的SDK
|
|
4
|
-
|
|
5
|
-
参考 Firebase v9, 所有的sdk 在同一个仓库, 维护全局App对象,其他对象根据
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
import {initializeApp} from '@clodbasesdk/js-sdk/app';
|
|
9
|
-
import {getFunction} from '@clodbasesdk/js-sdk/functions';
|
|
10
|
-
import {getAuth} from '@xbasesdk/js-sdk/auth';
|
|
11
|
-
export const config = {
|
|
12
|
-
env: 'env-4gh5dh6nf62145a9'
|
|
13
|
-
};
|
|
14
|
-
const app = initializeApp(config)
|
|
15
|
-
const auth = getAuth(app)
|
|
16
|
-
const functions = getFunction(app)
|
|
17
|
-
export {app, auth, functions}
|
|
18
|
-
// 调用API
|
|
19
|
-
const loginState = await client.auth.hasLoginState()
|
|
20
|
-
// 获取 accessToken
|
|
21
|
-
const accessToken = await client.oAuth2Client.getAccessToken();
|
|
22
|
-
// 用 OIDC Token 用自己的API
|
|
23
|
-
export interface ExampleData {
|
|
24
|
-
result?: string;
|
|
25
|
-
}
|
|
26
|
-
const data = await client.oAuth2Client.request<ExampleData>("https://example.com", {withCredentials:true})
|
|
27
|
-
console.log(data.result)
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### 初始化SDK
|
|
31
|
-
|
|
32
|
-
默认情况下,在Web端,你可以采用以下初始化方式。
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
import {initializeApp} from '@clodbasesdk/js-sdk/app';
|
|
36
|
-
import {getFunction} from '@clodbasesdk/js-sdk/functions';
|
|
37
|
-
import {getAuth} from '@xbasesdk/js-sdk/auth';
|
|
38
|
-
const config = {
|
|
39
|
-
env: 'env-4gh5dh6nf62145a9'
|
|
40
|
-
};
|
|
41
|
-
const app = initializeApp(config)
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
在微信小程序等其他端,则可以使用对应的插件或自己实现三个方法,比如:
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
import {initializeApp} from '@clodbasesdk/js-sdk/app';
|
|
48
|
-
import {initializeConfig} from '@clodbasesdk/plugins/wechat';
|
|
49
|
-
let config = {
|
|
50
|
-
env: 'env-4gh5dh6nf62145a9'
|
|
51
|
-
};
|
|
52
|
-
config = initializeConfig(config)
|
|
53
|
-
const app = initializeApp(config)
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### 文档
|
|
57
|
-
|
|
58
|
-
核心变更:
|
|
59
|
-
|
|
60
|
-
利用OAuht
|
|
61
|
-
|
|
62
|
-
### 关于SDK
|
|
63
|
-
|
|
64
|
-
### 登录认证
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
### 重置密码
|
|
69
|
-
|
|
70
|
-
### 修改个人资料
|
|
71
|
-
|
|
72
|
-
### 修改密码
|
|
73
|
-
|
|
74
|
-
### Demo
|
|
75
|
-
|