@ucloud-sdks/ucloud-sdk-js 0.2.46 → 0.2.48

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.
@@ -11,6 +11,7 @@ export declare class Client extends BaseClient {
11
11
  ipsecvpn(): any;
12
12
  pathx(): any;
13
13
  sandbox(): any;
14
+ ses(): any;
14
15
  uaccount(): any;
15
16
  uai_modelverse(): any;
16
17
  ubill(): any;
@@ -7,6 +7,7 @@ const CubeClient = require('./cube').default;
7
7
  const IPSecVPNClient = require('./ipsecvpn').default;
8
8
  const PathXClient = require('./pathx').default;
9
9
  const SandboxClient = require('./sandbox').default;
10
+ const SESClient = require('./ses').default;
10
11
  const UAccountClient = require('./uaccount').default;
11
12
  const UAIModelverseClient = require('./uai_modelverse').default;
12
13
  const UBillClient = require('./ubill').default;
@@ -74,6 +75,12 @@ class Client extends BaseClient {
74
75
  credential: this.credential,
75
76
  });
76
77
  }
78
+ ses() {
79
+ return new SESClient({
80
+ config: this.config,
81
+ credential: this.credential,
82
+ });
83
+ }
77
84
  uaccount() {
78
85
  return new UAccountClient({
79
86
  config: this.config,
@@ -0,0 +1,263 @@
1
+ import Client from '../../core/client';
2
+ import { ConfigOptions } from '../../core/config';
3
+ import { CredentialOptions } from '../../core/credential';
4
+ /**
5
+ * This client is used to call actions of **ses** service
6
+ */
7
+ export default class SESClient extends Client {
8
+ constructor({ config, credential, }: {
9
+ config: ConfigOptions;
10
+ credential: CredentialOptions;
11
+ });
12
+ /**
13
+ * SendSESEmail - 直接发送邮件,无需创建发送任务和模版,支持 HTML/纯文本内容、主题、抄送/密送、附件和邮件头,单次最多 100 个收件人。
14
+ *
15
+ * See also: https://docs.ucloud.cn/api/ses-api/send_ses_email
16
+ */
17
+ sendSESEmail(request?: SendSESEmailRequest): Promise<SendSESEmailResponse>;
18
+ /**
19
+ * SendSESEmailTemplate - 通过模版发送邮件,无需创建发送任务。支持自定义主题、摘要、预览文本、抄送/密送、附件和邮件头,单次最多 100 个收件人。
20
+ *
21
+ * See also: https://docs.ucloud.cn/api/ses-api/send_ses_email_template
22
+ */
23
+ sendSESEmailTemplate(request?: SendSESEmailTemplateRequest): Promise<SendSESEmailTemplateResponse>;
24
+ }
25
+ /**
26
+ * SendSESEmail - 直接发送邮件,无需创建发送任务和模版,支持 HTML/纯文本内容、主题、抄送/密送、附件和邮件头,单次最多 100 个收件人。
27
+ */
28
+ export interface SendSESEmailRequest {
29
+ /**
30
+ * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
31
+ */
32
+ Zone?: string;
33
+ /**
34
+ * 邮件主题(长度 1~200 字符)
35
+ */
36
+ Subject: string;
37
+ /**
38
+ * 发件人邮箱,配置地址:https://console.ucloud.cn/ses/email-config?tab=sender-list
39
+ */
40
+ From: string;
41
+ /**
42
+ * 收件人
43
+ */
44
+ To: string[];
45
+ /**
46
+ * HTML 内容 (与Text二选一,长度上限 10,485,760个字符)
47
+ */
48
+ Html?: string;
49
+ /**
50
+ * 纯文本内容 (与Html二选一,长度上限 10,485,760个字符)
51
+ */
52
+ Text?: string;
53
+ /**
54
+ * 邮件预览文本
55
+ */
56
+ PreHeader?: string;
57
+ /**
58
+ * 发件人名称,不传或为空时,自动回落到该发件人在控制台配置的别名(Alias)
59
+ */
60
+ FromName?: string;
61
+ /**
62
+ * 抄送(抄送+密送总数量不能超过100)
63
+ */
64
+ Cc?: string[];
65
+ /**
66
+ * 密送(抄送+密送总数量不能超过100)
67
+ */
68
+ Bcc?: string[];
69
+ /**
70
+ *
71
+ */
72
+ Attachments?: {
73
+ /**
74
+ * 附件文件名
75
+ */
76
+ Filename?: string;
77
+ /**
78
+ * MIME 类型,如: application/pdf
79
+ */
80
+ ContentType?: string;
81
+ /**
82
+ * 附件内容(Base64 编码),单次请求最多 10 个附件;总大小不超过 10MB
83
+ */
84
+ Data?: string;
85
+ }[];
86
+ /**
87
+ *
88
+ */
89
+ Headers?: {
90
+ /**
91
+ * 邮件头名称,最多 20 个且仅允许字母、数字和 -(正则 ^[A-Za-z0-9-]+$)。禁止使用保留名称:From/To/Cc/Bcc/Subject/Reply-To/Content-Type/Mime-Version,以及 X-SES- 前缀(均不区分大小写)。
92
+ */
93
+ Name?: string;
94
+ /**
95
+ * 邮件头值
96
+ */
97
+ Value?: string;
98
+ }[];
99
+ }
100
+ /**
101
+ * SendSESEmail - 直接发送邮件,无需创建发送任务和模版,支持 HTML/纯文本内容、主题、抄送/密送、附件和邮件头,单次最多 100 个收件人。
102
+ */
103
+ export interface SendSESEmailResponse {
104
+ /**
105
+ * 本次发送任务的唯一标识
106
+ */
107
+ SessionNo: string;
108
+ /**
109
+ * 发送成功数
110
+ */
111
+ SuccessCount: number;
112
+ /**
113
+ * 发送失败的收件人列表
114
+ */
115
+ FailContent: {
116
+ /**
117
+ * 收件人
118
+ */
119
+ To?: string;
120
+ /**
121
+ * 收件邮箱
122
+ */
123
+ EmailAddress?: string;
124
+ /**
125
+ * 抄送
126
+ */
127
+ Cc?: string[];
128
+ /**
129
+ * 密送
130
+ */
131
+ Bcc?: string[];
132
+ /**
133
+ * 模版变量
134
+ */
135
+ TemplateVariableParams?: string[];
136
+ /**
137
+ * 失败原因
138
+ */
139
+ FailureReason?: string;
140
+ }[];
141
+ }
142
+ /**
143
+ * SendSESEmailTemplate - 通过模版发送邮件,无需创建发送任务。支持自定义主题、摘要、预览文本、抄送/密送、附件和邮件头,单次最多 100 个收件人。
144
+ */
145
+ export interface SendSESEmailTemplateRequest {
146
+ /**
147
+ * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
148
+ */
149
+ Zone?: string;
150
+ /**
151
+ * 模版 ID,获取:https://console.ucloud.cn/ses/email-config?tab=template
152
+ */
153
+ TemplateId: string;
154
+ /**
155
+ * 发件人邮箱
156
+ */
157
+ From: string;
158
+ /**
159
+ * 邮件主题
160
+ */
161
+ Subject: string;
162
+ /**
163
+ * 邮件预览文本
164
+ */
165
+ PreHeader?: string;
166
+ /**
167
+ *
168
+ */
169
+ EmailContent?: {
170
+ /**
171
+ * 收件人,最多100条
172
+ */
173
+ To?: string;
174
+ /**
175
+ * 抄送(抄送+密送总数量不能超过100)
176
+ */
177
+ Cc?: string[];
178
+ /**
179
+ * 密送(抄送+密送总数量不能超过100)
180
+ */
181
+ Bcc?: string[];
182
+ /**
183
+ * 模版变量,格式 variableName{##}variableValue (例:{"name{##}Tom", "code{##}1234"})
184
+ */
185
+ TemplateVariableParams?: string[];
186
+ }[];
187
+ /**
188
+ * 发件人名称,不传或为空时,自动回落到该发件人在控制台配置的别名(Alias)
189
+ */
190
+ FromName?: string;
191
+ /**
192
+ *
193
+ */
194
+ Attachments?: {
195
+ /**
196
+ * 附件文件名
197
+ */
198
+ Filename?: string;
199
+ /**
200
+ * MIME 类型,如: application/pdf
201
+ */
202
+ ContentType?: string;
203
+ /**
204
+ * 附件内容(Base64 编码),单次请求最多 10 个附件;总大小不超过 10MB
205
+ */
206
+ Data?: string;
207
+ }[];
208
+ /**
209
+ *
210
+ */
211
+ Headers?: {
212
+ /**
213
+ * 邮件头名称,最多 20 个且仅允许字母、数字和 -(正则 ^[A-Za-z0-9-]+$)。禁止使用保留名称:From/To/Cc/Bcc/Subject/Reply-To/Content-Type/Mime-Version,以及 X-SES- 前缀(均不区分大小写)。
214
+ */
215
+ Name?: string;
216
+ /**
217
+ * 邮件头值
218
+ */
219
+ Value?: string;
220
+ }[];
221
+ }
222
+ /**
223
+ * SendSESEmailTemplate - 通过模版发送邮件,无需创建发送任务。支持自定义主题、摘要、预览文本、抄送/密送、附件和邮件头,单次最多 100 个收件人。
224
+ */
225
+ export interface SendSESEmailTemplateResponse {
226
+ /**
227
+ * 本次发送任务的唯一标识
228
+ */
229
+ SessionNo: string;
230
+ /**
231
+ * 发送成功数
232
+ */
233
+ SuccessCount: number;
234
+ /**
235
+ * 发送失败的收件人列表
236
+ */
237
+ FailContent: {
238
+ /**
239
+ * 收件人
240
+ */
241
+ To?: string;
242
+ /**
243
+ * 收件邮箱
244
+ */
245
+ EmailAddress?: string;
246
+ /**
247
+ * 抄送
248
+ */
249
+ Cc?: string[];
250
+ /**
251
+ * 密送
252
+ */
253
+ Bcc?: string[];
254
+ /**
255
+ * 模版变量
256
+ */
257
+ TemplateVariableParams?: string[];
258
+ /**
259
+ * 失败原因
260
+ */
261
+ FailureReason?: string;
262
+ }[];
263
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const client_1 = __importDefault(require("../../core/client"));
7
+ const request_1 = __importDefault(require("../../core/request"));
8
+ /**
9
+ * This client is used to call actions of **ses** service
10
+ */
11
+ class SESClient extends client_1.default {
12
+ constructor({ config, credential, }) {
13
+ super({ config, credential });
14
+ }
15
+ /**
16
+ * SendSESEmail - 直接发送邮件,无需创建发送任务和模版,支持 HTML/纯文本内容、主题、抄送/密送、附件和邮件头,单次最多 100 个收件人。
17
+ *
18
+ * See also: https://docs.ucloud.cn/api/ses-api/send_ses_email
19
+ */
20
+ sendSESEmail(request) {
21
+ const args = Object.assign({ Action: 'SendSESEmail' }, (request || {}));
22
+ return this.invoke(new request_1.default(args)).then((resp) => resp.toObject());
23
+ }
24
+ /**
25
+ * SendSESEmailTemplate - 通过模版发送邮件,无需创建发送任务。支持自定义主题、摘要、预览文本、抄送/密送、附件和邮件头,单次最多 100 个收件人。
26
+ *
27
+ * See also: https://docs.ucloud.cn/api/ses-api/send_ses_email_template
28
+ */
29
+ sendSESEmailTemplate(request) {
30
+ const args = Object.assign({ Action: 'SendSESEmailTemplate' }, (request || {}));
31
+ return this.invoke(new request_1.default(args)).then((resp) => resp.toObject());
32
+ }
33
+ }
34
+ exports.default = SESClient;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ucloud-sdks/ucloud-sdk-js",
3
3
  "description": "ucloud-sdk-js",
4
- "version": "0.2.46",
4
+ "version": "0.2.48",
5
5
  "author": "oas@ucloud.cn",
6
6
  "license": "MIT",
7
7
  "private": false,