lazy-bee 1.0.1

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.
@@ -0,0 +1,40 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+ # on:
11
+ # release:
12
+ # types: [created]
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: actions/setup-node@v4
20
+ with:
21
+ node-version: 20
22
+ - run: npm ci
23
+ # - run: npm test
24
+
25
+ publish-gpr:
26
+ needs: build
27
+ runs-on: ubuntu-latest
28
+ permissions:
29
+ contents: read
30
+ packages: write
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - uses: actions/setup-node@v4
34
+ with:
35
+ node-version: 20
36
+ registry-url: https://registry.npmjs.org/
37
+ - run: npm ci
38
+ - run: npm publish
39
+ env:
40
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # LazyBee 辛勤蜂
2
+
3
+ 哦,其实你也可以叫它懒碧
package/index.d.ts ADDED
@@ -0,0 +1,160 @@
1
+ interface UrlToken {
2
+ /**
3
+ * name - 名称, 可选, 默认 'token'
4
+ */
5
+ name?: string
6
+
7
+ /**
8
+ * position - 位置, 可选, 默认 'all'
9
+ */
10
+ position?: 'search' | 'hash' | 'all'
11
+
12
+ /**
13
+ * type - 类型, 可选, 默认 'cq'
14
+ */
15
+ type?: 'cq' | 'jt'
16
+ }
17
+
18
+ interface MyToken {
19
+ /**
20
+ * name - 名称, 可选, 默认 'mytoken'
21
+ */
22
+ name?: string
23
+
24
+ /**
25
+ * position - 位置, 可选, 默认 'all'
26
+ */
27
+ position?: 'search' | 'hash' | 'all'
28
+ }
29
+
30
+ interface AppToken {
31
+ /**
32
+ * sourceId - 6位数字
33
+ */
34
+ sourceId: string
35
+ }
36
+
37
+ interface SessToken {
38
+ /**
39
+ * name - 名称, 可选, 默认 'token'
40
+ */
41
+ name?: string
42
+
43
+ /**
44
+ * position - 位置, 可选, 默认 'session'
45
+ */
46
+ position?: 'session' | 'local'
47
+ }
48
+
49
+ interface McToken {
50
+ /**
51
+ * name - 名称, 可选, 默认 'mctoken'
52
+ */
53
+ name?: 'mctoken'
54
+
55
+ /**
56
+ * position - 位置, 可选, 默认 'all'
57
+ */
58
+ position?: 'search' | 'hash' | 'all'
59
+ }
60
+
61
+ interface ConverTokenOptions {
62
+ /**
63
+ * urlToken - url中的token, 可选
64
+ */
65
+ urlToken?: UrlToken
66
+
67
+ /**
68
+ * myToken - 商城1.0的token, 可选
69
+ */
70
+ myToken?: MyToken
71
+
72
+ /**
73
+ * myToken - 集团app的token, 可选
74
+ */
75
+ appToken?: AppToken
76
+
77
+ /**
78
+ * sessToken - 本地存储的token, 可选
79
+ */
80
+ sessToken?: SessToken
81
+
82
+ /**
83
+ * mcToken - 商城2.0的token, 可选
84
+ */
85
+ mcToken?: MyToken
86
+
87
+ /**
88
+ * mcToken - 本地存储的token
89
+ */
90
+ host: string
91
+ }
92
+
93
+ export declare function converToken(
94
+ options: ConverTokenOptions
95
+ ): Promise<void>
96
+
97
+
98
+ interface SendSMSParams {
99
+ /**
100
+ * mobile - 输入的手机号
101
+ */
102
+ mobile: string
103
+ }
104
+
105
+ interface SendSMSCallback {
106
+ /**
107
+ * countdown - 启动倒计时方法
108
+ */
109
+ (countdown: () => void): void
110
+ }
111
+
112
+ interface LoginParams {
113
+ /**
114
+ * mobile - 输入的手机号
115
+ */
116
+ mobile: string
117
+
118
+ /**
119
+ * mobile - 输入的验证码
120
+ */
121
+ sms: string
122
+ }
123
+
124
+ interface LoginCallback {
125
+ (): void
126
+ }
127
+
128
+ interface LoginModalOptions {
129
+ /**
130
+ * sendSMS - 发送验证码回调
131
+ */
132
+ sendSMS: (params: SendSMSParams, callback: SendSMSCallback) => void
133
+
134
+ /**
135
+ * login - 登录回调
136
+ */
137
+ login: (params: LoginParams, callback: LoginCallback) => void
138
+ }
139
+
140
+ declare function LoginModal(options: LoginModalOptions): void
141
+
142
+
143
+ declare function share(options: {
144
+ /**
145
+ * title - 分享标题
146
+ */
147
+ title: string
148
+ /**
149
+ * content - 分享内容
150
+ */
151
+ content: string
152
+ /**
153
+ * link - 分享链接
154
+ */
155
+ link: string
156
+ /**
157
+ * imgUrl - 分享小图
158
+ */
159
+ imgUrl: string
160
+ }): void
package/index.js ADDED
@@ -0,0 +1,13 @@
1
+ import {
2
+ converToken,
3
+ share,
4
+ LoginPage,
5
+ LoginModal
6
+ } from './src/lazy-bee'
7
+
8
+ export {
9
+ converToken,
10
+ share,
11
+ LoginPage,
12
+ LoginModal
13
+ }
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "lazy-bee",
3
+ "version": "1.0.1",
4
+ "description": "lazy bee",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "keywords": [],
11
+ "author": "K13",
12
+ "license": "ISC",
13
+ "publishConfig": {
14
+ "registry": "https://registry.npmjs.org/"
15
+ },
16
+ "peerDependencies": {
17
+ "lazy-koala": "^1.1.3"
18
+ }
19
+ }