@doubao-apps/ai 0.0.33 → 0.0.34
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/README.md +1 -32
- package/dist/733.js +7 -15
- package/dist/cli.js +1 -1
- package/dist/manifest.json +3 -11
- package/dist/skills/doubao-apps-dev/SKILL.md +103 -227
- package/dist/skills/doubao-apps-dev/references/examples/common-patterns.md +80 -66
- package/dist/skills/doubao-apps-dev/references/examples/component-basics.md +24 -3
- package/dist/skills/doubao-apps-dev/references/examples/component-recipes.md +71 -0
- package/dist/skills/doubao-apps-dev/references/examples/open-api-recipes.md +203 -0
- package/dist/skills/doubao-apps-dev/references/guides/component-development.md +66 -42
- package/dist/skills/doubao-apps-dev/references/guides/expired-widget.md +113 -0
- package/dist/skills/doubao-apps-dev/references/guides/mcp-ui.md +275 -0
- package/dist/skills/doubao-apps-dev/references/guides/performance-optimization.md +24 -7
- package/dist/skills/doubao-apps-dev/references/reference/components-quick-ref.md +18 -7
- package/dist/skills/doubao-apps-dev/references/reference/framework-api-quick-ref.md +125 -107
- package/dist/skills/doubao-apps-dev/references/reference/open-api/01-/345/237/272/347/241/200.md +136 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/02-/347/263/273/347/273/237.md +257 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/03-/345/256/232/344/275/215.md +326 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/04-/345/255/230/345/202/250.md +284 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/05-/350/267/257/347/224/261.md +162 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/06-/344/272/244/344/272/222.md +290 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/07-/350/276/223/345/205/245.md +63 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/08-/347/275/221/347/273/234.md +124 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/09-/345/252/222/344/275/223.md +192 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/10-/344/270/232/345/212/241/350/203/275/345/212/233.md +431 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/11-/347/231/273/345/275/225.md +110 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/12-/346/224/257/344/273/230.md +224 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/13-/346/225/260/346/215/256/345/210/206/346/236/220.md +43 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/14-/350/223/235/347/211/231.md +598 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/15-wi-fi.md +210 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/16-/345/212/240/351/200/237/345/272/246/350/256/241.md +87 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/17-ibeacon.md +97 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/18-/347/275/227/347/233/230.md +78 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/19-/350/256/276/345/244/207/346/226/271/345/220/221.md +86 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/20-/351/231/200/350/236/272/344/273/252.md +87 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/21-/350/256/276/345/244/207-/347/275/221/347/273/234.md +102 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/22-/347/237/255/344/277/241.md +40 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/23-/346/227/240/351/232/234/347/242/215.md +40 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/24-/345/237/272/347/241/200/344/277/241/346/201/257.md +86 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/25-/347/224/265/346/261/240.md +63 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/26-/346/227/245/345/216/206.md +95 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/27-/345/211/252/350/264/264/346/235/277.md +64 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/28-/350/201/224/347/263/273/344/272/272.md +101 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/29-/345/212/240/345/257/206.md +43 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/30-/347/224/265/350/257/235.md +36 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/31-/346/211/253/347/240/201.md +58 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/32-/345/261/217/345/271/225.md +136 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/33-/351/234/207/345/212/250.md +62 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/34-/346/226/207/344/273/266/347/263/273/347/273/237.md +73 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api/README.md +34 -0
- package/dist/skills/doubao-apps-dev/references/reference/open-api.md +384 -2
- package/dist/skills/doubao-apps-dev/references/rules/dos-and-donts.md +44 -27
- package/dist/skills/h5-to-doubao/SKILL.md +8 -4
- package/dist/skills/weixin-to-doubao/SKILL.md +8 -4
- package/dist/skills/weixin-to-doubao/assets/migration-checklist-template.md +1 -1
- package/package.json +2 -3
- package/dist/contexts/doubao-apps-dev/AGENTS.md +0 -300
- package/dist/contexts/doubao-apps-dev/CLAUDE.md +0 -31
- package/dist/contexts/doubao-apps-dev/references/examples/common-patterns.md +0 -589
- package/dist/contexts/doubao-apps-dev/references/examples/component-basics.md +0 -526
- package/dist/contexts/doubao-apps-dev/references/guides/best-practices.md +0 -571
- package/dist/contexts/doubao-apps-dev/references/guides/component-development.md +0 -891
- package/dist/contexts/doubao-apps-dev/references/guides/performance-optimization.md +0 -402
- package/dist/contexts/doubao-apps-dev/references/guides/troubleshooting.md +0 -287
- package/dist/contexts/doubao-apps-dev/references/reference/components-quick-ref.md +0 -103
- package/dist/contexts/doubao-apps-dev/references/reference/framework-api-quick-ref.md +0 -550
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/README.md +0 -8
- package/dist/contexts/doubao-apps-dev/references/reference/open-api.md +0 -11
- package/dist/contexts/doubao-apps-dev/references/rules/dos-and-donts.md +0 -467
package/dist/skills/doubao-apps-dev/references/reference/open-api/12-/346/224/257/344/273/230.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Open API: 支付
|
|
2
|
+
|
|
3
|
+
订单创建、签名和支付能力。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [createSignOrder](#createsignorder) | 创建签约订单。 |
|
|
12
|
+
| [getOrderPaymentWithSign](#getorderpaymentwithsign) | 使用签名信息拉起收银台完成订单支付。 |
|
|
13
|
+
| [getOrderPayment](#getorderpayment) | 拉起收银台完成订单支付。 |
|
|
14
|
+
| [requestCombineOrder](#requestcombineorder) | 请求创建合单订单。 |
|
|
15
|
+
| [requestOrder](#requestorder) | 发起订单支付流程。 |
|
|
16
|
+
| [sign](#sign) | 拉起签约流程。 |
|
|
17
|
+
|
|
18
|
+
## API 详情
|
|
19
|
+
|
|
20
|
+
<a id="createsignorder"></a>
|
|
21
|
+
### createSignOrder()
|
|
22
|
+
|
|
23
|
+
创建签约订单。
|
|
24
|
+
|
|
25
|
+
## 代码示例
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { createSignOrder } from '@doubao-apps/framework/api';
|
|
29
|
+
|
|
30
|
+
const result = await createSignOrder({
|
|
31
|
+
data: '{"planId":"plan_001"}',
|
|
32
|
+
dbAuthorization: 'authorization-token'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
console.log(result);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 入参
|
|
39
|
+
|
|
40
|
+
|参数名|类型|必填|说明|
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
|data|`string`|是|签约订单请求数据。|
|
|
43
|
+
|dbAuthorization|`string`|是|签约订单授权信息。|
|
|
44
|
+
|
|
45
|
+
## 返回值
|
|
46
|
+
|
|
47
|
+
返回一个 Promise,解析为签约订单结果。
|
|
48
|
+
|
|
49
|
+
|字段名|类型|说明|
|
|
50
|
+
|---|---|---|
|
|
51
|
+
|authOrderId|`string`|签约订单 ID。|
|
|
52
|
+
|logId|`string`|用于问题排查的日志 ID。|
|
|
53
|
+
|errLogId|`string`|用于问题排查的错误日志 ID。|
|
|
54
|
+
|errMsg|`string`|错误信息。|
|
|
55
|
+
|errNo|`string`|错误码。|
|
|
56
|
+
|
|
57
|
+
<a id="getorderpaymentwithsign"></a>
|
|
58
|
+
### getOrderPaymentWithSign()
|
|
59
|
+
|
|
60
|
+
使用签名信息拉起收银台完成订单支付。
|
|
61
|
+
|
|
62
|
+
## 代码示例
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import { getOrderPaymentWithSign } from '@doubao-apps/framework/api';
|
|
66
|
+
|
|
67
|
+
const result = await getOrderPaymentWithSign({
|
|
68
|
+
orderId: 'order-id',
|
|
69
|
+
signData: 'sign-data',
|
|
70
|
+
signDbAuthorization: 'authorization-token'
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
console.log(result.orderId);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 入参
|
|
77
|
+
|
|
78
|
+
|参数名|类型|必填|说明|
|
|
79
|
+
|---|---|---|---|
|
|
80
|
+
|orderId|`string`|是|订单 ID。|
|
|
81
|
+
|signData|`string`|是|支付签名数据。|
|
|
82
|
+
|signDbAuthorization|`string`|是|签名支付授权信息。|
|
|
83
|
+
|
|
84
|
+
## 返回值
|
|
85
|
+
|
|
86
|
+
返回一个 Promise,成功时解析为订单支付结果。
|
|
87
|
+
|
|
88
|
+
|字段名|类型|说明|
|
|
89
|
+
|---|---|---|
|
|
90
|
+
|logId|`string`|用于问题排查的日志 ID。|
|
|
91
|
+
|orderId|`string`|订单 ID。|
|
|
92
|
+
|
|
93
|
+
<a id="getorderpayment"></a>
|
|
94
|
+
### getOrderPayment()
|
|
95
|
+
|
|
96
|
+
拉起收银台完成订单支付。
|
|
97
|
+
|
|
98
|
+
## 代码示例
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { getOrderPayment } from '@doubao-apps/framework/api';
|
|
102
|
+
|
|
103
|
+
const { orderId, logId } = await getOrderPayment({ orderId: 'order-id' });
|
|
104
|
+
|
|
105
|
+
console.log(orderId, logId);
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 入参
|
|
109
|
+
|
|
110
|
+
|参数名|类型|必填|说明|
|
|
111
|
+
|---|---|---|---|
|
|
112
|
+
|orderId|`string`|是|订单 ID。|
|
|
113
|
+
|
|
114
|
+
## 返回值
|
|
115
|
+
|
|
116
|
+
返回一个 Promise,成功时解析为订单支付结果。
|
|
117
|
+
|
|
118
|
+
|字段名|类型|说明|
|
|
119
|
+
|---|---|---|
|
|
120
|
+
|logId|`string`|用于问题排查的日志 ID。|
|
|
121
|
+
|orderId|`string`|订单 ID。|
|
|
122
|
+
|
|
123
|
+
<a id="requestcombineorder"></a>
|
|
124
|
+
### requestCombineOrder()
|
|
125
|
+
|
|
126
|
+
请求创建合单订单。
|
|
127
|
+
|
|
128
|
+
## 代码示例
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { requestCombineOrder } from '@doubao-apps/framework/api';
|
|
132
|
+
|
|
133
|
+
const result = await requestCombineOrder({
|
|
134
|
+
data: '{"orderList":["order_001","order_002"]}',
|
|
135
|
+
dbAuthorization: 'authorization-token'
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
console.log(result);
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 入参
|
|
142
|
+
|
|
143
|
+
|参数名|类型|必填|说明|
|
|
144
|
+
|---|---|---|---|
|
|
145
|
+
|data|`string`|是|合单订单请求数据。|
|
|
146
|
+
|dbAuthorization|`string`|是|合单订单授权信息。|
|
|
147
|
+
|
|
148
|
+
## 返回值
|
|
149
|
+
|
|
150
|
+
返回一个 Promise,解析为合单订单结果。
|
|
151
|
+
|
|
152
|
+
|字段名|类型|说明|
|
|
153
|
+
|---|---|---|
|
|
154
|
+
|combineOrderId|`string`|合单订单 ID。|
|
|
155
|
+
|logId|`string`|用于问题排查的日志 ID。|
|
|
156
|
+
|errLogId|`string`|用于问题排查的错误日志 ID。|
|
|
157
|
+
|errMsg|`string`|错误信息。|
|
|
158
|
+
|errNo|`string`|错误码。|
|
|
159
|
+
|
|
160
|
+
<a id="requestorder"></a>
|
|
161
|
+
### requestOrder()
|
|
162
|
+
|
|
163
|
+
发起订单支付流程。
|
|
164
|
+
|
|
165
|
+
## 代码示例
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
import { requestOrder } from '@doubao-apps/framework/api';
|
|
169
|
+
|
|
170
|
+
const { orderId, logId } = await requestOrder({
|
|
171
|
+
data: '{"skuId":"sku_001","count":1}',
|
|
172
|
+
dbAuthorization: 'authorization-token'
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
console.log(orderId, logId);
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## 入参
|
|
179
|
+
|
|
180
|
+
|参数名|类型|必填|说明|
|
|
181
|
+
|---|---|---|---|
|
|
182
|
+
|data|`string`|是|-|
|
|
183
|
+
|dbAuthorization|`string`|是|-|
|
|
184
|
+
|
|
185
|
+
## 返回值
|
|
186
|
+
|
|
187
|
+
返回订单支付请求结果。
|
|
188
|
+
|
|
189
|
+
|字段名|类型|说明|
|
|
190
|
+
|---|---|---|
|
|
191
|
+
|logId|`string`|-|
|
|
192
|
+
|orderId|`string`|-|
|
|
193
|
+
|
|
194
|
+
<a id="sign"></a>
|
|
195
|
+
### sign()
|
|
196
|
+
|
|
197
|
+
拉起签约流程。
|
|
198
|
+
|
|
199
|
+
## 代码示例
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
import { sign } from '@doubao-apps/framework/api';
|
|
203
|
+
|
|
204
|
+
const result = await sign({ orderId: 'sign-order-id' });
|
|
205
|
+
|
|
206
|
+
console.log(result);
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## 入参
|
|
210
|
+
|
|
211
|
+
|参数名|类型|必填|说明|
|
|
212
|
+
|---|---|---|---|
|
|
213
|
+
|orderId|`string`|是|签约订单 ID。|
|
|
214
|
+
|
|
215
|
+
## 返回值
|
|
216
|
+
|
|
217
|
+
返回一个 Promise,解析为签约结果。
|
|
218
|
+
|
|
219
|
+
|字段名|类型|说明|
|
|
220
|
+
|---|---|---|
|
|
221
|
+
|code|`number`|错误码。|
|
|
222
|
+
|errLogId|`string`|用于问题排查的错误日志 ID。|
|
|
223
|
+
|errMsg|`string`|错误信息。|
|
|
224
|
+
|errNo|`string`|错误编号。|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Open API: 数据分析
|
|
2
|
+
|
|
3
|
+
监控上报、事件和数据分析上报。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [reportEvent](#reportevent) | 上报数据分析事件。 |
|
|
12
|
+
|
|
13
|
+
## API 详情
|
|
14
|
+
|
|
15
|
+
<a id="reportevent"></a>
|
|
16
|
+
### reportEvent()
|
|
17
|
+
|
|
18
|
+
上报数据分析事件。
|
|
19
|
+
|
|
20
|
+
## 代码示例
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { reportEvent } from '@doubao-apps/framework/api';
|
|
24
|
+
|
|
25
|
+
await reportEvent({
|
|
26
|
+
eventName: 'page_view',
|
|
27
|
+
data: {
|
|
28
|
+
pageName: 'home',
|
|
29
|
+
source: 'feed'
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 入参
|
|
35
|
+
|
|
36
|
+
|参数名|类型|必填|说明|
|
|
37
|
+
|---|---|---|---|
|
|
38
|
+
|data|`Record<string, any>`|是|事件参数,会作为事件属性一并上报。|
|
|
39
|
+
|eventName|`string`|是|事件名称。|
|
|
40
|
+
|
|
41
|
+
## 返回值
|
|
42
|
+
|
|
43
|
+
返回一个 Promise,在事件上报请求成功发起时解析。
|