@azure/communication-email 1.0.0-beta.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.
- package/LICENSE.txt +21 -0
- package/README.md +183 -0
- package/dist/index.js +668 -0
- package/dist/index.js.map +1 -0
- package/dist-esm/samples-dev/checkMessageStatus.js +46 -0
- package/dist-esm/samples-dev/checkMessageStatus.js.map +1 -0
- package/dist-esm/samples-dev/sendEmailMultipleRecipients.js +59 -0
- package/dist-esm/samples-dev/sendEmailMultipleRecipients.js.map +1 -0
- package/dist-esm/samples-dev/sendEmailSingleRecipient.js +43 -0
- package/dist-esm/samples-dev/sendEmailSingleRecipient.js.map +1 -0
- package/dist-esm/samples-dev/sendEmailWithAttachments.js +50 -0
- package/dist-esm/samples-dev/sendEmailWithAttachments.js.map +1 -0
- package/dist-esm/src/constants.js +4 -0
- package/dist-esm/src/constants.js.map +1 -0
- package/dist-esm/src/emailClient.js +64 -0
- package/dist-esm/src/emailClient.js.map +1 -0
- package/dist-esm/src/generated/src/emailRestApiClient.js +26 -0
- package/dist-esm/src/generated/src/emailRestApiClient.js.map +1 -0
- package/dist-esm/src/generated/src/emailRestApiClientContext.js +38 -0
- package/dist-esm/src/generated/src/emailRestApiClientContext.js.map +1 -0
- package/dist-esm/src/generated/src/models/index.js +9 -0
- package/dist-esm/src/generated/src/models/index.js.map +1 -0
- package/dist-esm/src/generated/src/models/mappers.js +331 -0
- package/dist-esm/src/generated/src/models/mappers.js.map +1 -0
- package/dist-esm/src/generated/src/models/parameters.js +76 -0
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -0
- package/dist-esm/src/generated/src/operations/email.js +96 -0
- package/dist-esm/src/generated/src/operations/email.js.map +1 -0
- package/dist-esm/src/generated/src/operations/index.js +9 -0
- package/dist-esm/src/generated/src/operations/index.js.map +1 -0
- package/dist-esm/src/index.js +5 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/logger.js +8 -0
- package/dist-esm/src/logger.js.map +1 -0
- package/dist-esm/src/models.js +4 -0
- package/dist-esm/src/models.js.map +1 -0
- package/dist-esm/test/public/emailClient.spec.js +137 -0
- package/dist-esm/test/public/emailClient.spec.js.map +1 -0
- package/dist-esm/test/public/utils/recordedClient.js +46 -0
- package/dist-esm/test/public/utils/recordedClient.js.map +1 -0
- package/package.json +110 -0
- package/types/communication-email.d.ts +200 -0
@@ -0,0 +1,331 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
export const SendStatusResult = {
|
9
|
+
type: {
|
10
|
+
name: "Composite",
|
11
|
+
className: "SendStatusResult",
|
12
|
+
modelProperties: {
|
13
|
+
messageId: {
|
14
|
+
serializedName: "messageId",
|
15
|
+
required: true,
|
16
|
+
type: {
|
17
|
+
name: "String"
|
18
|
+
}
|
19
|
+
},
|
20
|
+
status: {
|
21
|
+
serializedName: "status",
|
22
|
+
required: true,
|
23
|
+
type: {
|
24
|
+
name: "String"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
};
|
30
|
+
export const CommunicationErrorResponse = {
|
31
|
+
type: {
|
32
|
+
name: "Composite",
|
33
|
+
className: "CommunicationErrorResponse",
|
34
|
+
modelProperties: {
|
35
|
+
error: {
|
36
|
+
serializedName: "error",
|
37
|
+
type: {
|
38
|
+
name: "Composite",
|
39
|
+
className: "CommunicationError"
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
};
|
45
|
+
export const CommunicationError = {
|
46
|
+
type: {
|
47
|
+
name: "Composite",
|
48
|
+
className: "CommunicationError",
|
49
|
+
modelProperties: {
|
50
|
+
code: {
|
51
|
+
serializedName: "code",
|
52
|
+
required: true,
|
53
|
+
type: {
|
54
|
+
name: "String"
|
55
|
+
}
|
56
|
+
},
|
57
|
+
message: {
|
58
|
+
serializedName: "message",
|
59
|
+
required: true,
|
60
|
+
type: {
|
61
|
+
name: "String"
|
62
|
+
}
|
63
|
+
},
|
64
|
+
target: {
|
65
|
+
serializedName: "target",
|
66
|
+
readOnly: true,
|
67
|
+
type: {
|
68
|
+
name: "String"
|
69
|
+
}
|
70
|
+
},
|
71
|
+
details: {
|
72
|
+
serializedName: "details",
|
73
|
+
readOnly: true,
|
74
|
+
type: {
|
75
|
+
name: "Sequence",
|
76
|
+
element: {
|
77
|
+
type: { name: "Composite", className: "CommunicationError" }
|
78
|
+
}
|
79
|
+
}
|
80
|
+
},
|
81
|
+
innerError: {
|
82
|
+
serializedName: "innererror",
|
83
|
+
type: {
|
84
|
+
name: "Composite",
|
85
|
+
className: "CommunicationError"
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
};
|
91
|
+
export const EmailMessage = {
|
92
|
+
type: {
|
93
|
+
name: "Composite",
|
94
|
+
className: "EmailMessage",
|
95
|
+
modelProperties: {
|
96
|
+
customHeaders: {
|
97
|
+
serializedName: "headers",
|
98
|
+
type: {
|
99
|
+
name: "Sequence",
|
100
|
+
element: {
|
101
|
+
type: { name: "Composite", className: "EmailCustomHeader" }
|
102
|
+
}
|
103
|
+
}
|
104
|
+
},
|
105
|
+
sender: {
|
106
|
+
serializedName: "sender",
|
107
|
+
required: true,
|
108
|
+
type: {
|
109
|
+
name: "String"
|
110
|
+
}
|
111
|
+
},
|
112
|
+
content: {
|
113
|
+
serializedName: "content",
|
114
|
+
type: {
|
115
|
+
name: "Composite",
|
116
|
+
className: "EmailContent"
|
117
|
+
}
|
118
|
+
},
|
119
|
+
importance: {
|
120
|
+
defaultValue: "normal",
|
121
|
+
serializedName: "importance",
|
122
|
+
type: {
|
123
|
+
name: "String"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
recipients: {
|
127
|
+
serializedName: "recipients",
|
128
|
+
type: {
|
129
|
+
name: "Composite",
|
130
|
+
className: "EmailRecipients"
|
131
|
+
}
|
132
|
+
},
|
133
|
+
attachments: {
|
134
|
+
serializedName: "attachments",
|
135
|
+
type: {
|
136
|
+
name: "Sequence",
|
137
|
+
element: { type: { name: "Composite", className: "EmailAttachment" } }
|
138
|
+
}
|
139
|
+
},
|
140
|
+
replyTo: {
|
141
|
+
serializedName: "replyTo",
|
142
|
+
type: {
|
143
|
+
name: "Sequence",
|
144
|
+
element: { type: { name: "Composite", className: "EmailAddress" } }
|
145
|
+
}
|
146
|
+
},
|
147
|
+
disableUserEngagementTracking: {
|
148
|
+
serializedName: "disableUserEngagementTracking",
|
149
|
+
type: {
|
150
|
+
name: "Boolean"
|
151
|
+
}
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}
|
155
|
+
};
|
156
|
+
export const EmailCustomHeader = {
|
157
|
+
type: {
|
158
|
+
name: "Composite",
|
159
|
+
className: "EmailCustomHeader",
|
160
|
+
modelProperties: {
|
161
|
+
name: {
|
162
|
+
serializedName: "name",
|
163
|
+
required: true,
|
164
|
+
type: {
|
165
|
+
name: "String"
|
166
|
+
}
|
167
|
+
},
|
168
|
+
value: {
|
169
|
+
serializedName: "value",
|
170
|
+
required: true,
|
171
|
+
type: {
|
172
|
+
name: "String"
|
173
|
+
}
|
174
|
+
}
|
175
|
+
}
|
176
|
+
}
|
177
|
+
};
|
178
|
+
export const EmailContent = {
|
179
|
+
type: {
|
180
|
+
name: "Composite",
|
181
|
+
className: "EmailContent",
|
182
|
+
modelProperties: {
|
183
|
+
subject: {
|
184
|
+
serializedName: "subject",
|
185
|
+
required: true,
|
186
|
+
type: {
|
187
|
+
name: "String"
|
188
|
+
}
|
189
|
+
},
|
190
|
+
plainText: {
|
191
|
+
serializedName: "plainText",
|
192
|
+
type: {
|
193
|
+
name: "String"
|
194
|
+
}
|
195
|
+
},
|
196
|
+
html: {
|
197
|
+
serializedName: "html",
|
198
|
+
type: {
|
199
|
+
name: "String"
|
200
|
+
}
|
201
|
+
}
|
202
|
+
}
|
203
|
+
}
|
204
|
+
};
|
205
|
+
export const EmailRecipients = {
|
206
|
+
type: {
|
207
|
+
name: "Composite",
|
208
|
+
className: "EmailRecipients",
|
209
|
+
modelProperties: {
|
210
|
+
to: {
|
211
|
+
serializedName: "to",
|
212
|
+
required: true,
|
213
|
+
type: {
|
214
|
+
name: "Sequence",
|
215
|
+
element: { type: { name: "Composite", className: "EmailAddress" } }
|
216
|
+
}
|
217
|
+
},
|
218
|
+
cC: {
|
219
|
+
serializedName: "cC",
|
220
|
+
type: {
|
221
|
+
name: "Sequence",
|
222
|
+
element: { type: { name: "Composite", className: "EmailAddress" } }
|
223
|
+
}
|
224
|
+
},
|
225
|
+
bCC: {
|
226
|
+
serializedName: "bCC",
|
227
|
+
type: {
|
228
|
+
name: "Sequence",
|
229
|
+
element: { type: { name: "Composite", className: "EmailAddress" } }
|
230
|
+
}
|
231
|
+
}
|
232
|
+
}
|
233
|
+
}
|
234
|
+
};
|
235
|
+
export const EmailAddress = {
|
236
|
+
type: {
|
237
|
+
name: "Composite",
|
238
|
+
className: "EmailAddress",
|
239
|
+
modelProperties: {
|
240
|
+
email: {
|
241
|
+
serializedName: "email",
|
242
|
+
required: true,
|
243
|
+
type: {
|
244
|
+
name: "String"
|
245
|
+
}
|
246
|
+
},
|
247
|
+
displayName: {
|
248
|
+
serializedName: "displayName",
|
249
|
+
type: {
|
250
|
+
name: "String"
|
251
|
+
}
|
252
|
+
}
|
253
|
+
}
|
254
|
+
}
|
255
|
+
};
|
256
|
+
export const EmailAttachment = {
|
257
|
+
type: {
|
258
|
+
name: "Composite",
|
259
|
+
className: "EmailAttachment",
|
260
|
+
modelProperties: {
|
261
|
+
name: {
|
262
|
+
serializedName: "name",
|
263
|
+
required: true,
|
264
|
+
type: {
|
265
|
+
name: "String"
|
266
|
+
}
|
267
|
+
},
|
268
|
+
attachmentType: {
|
269
|
+
serializedName: "attachmentType",
|
270
|
+
required: true,
|
271
|
+
type: {
|
272
|
+
name: "String"
|
273
|
+
}
|
274
|
+
},
|
275
|
+
contentBytesBase64: {
|
276
|
+
serializedName: "contentBytesBase64",
|
277
|
+
required: true,
|
278
|
+
type: {
|
279
|
+
name: "String"
|
280
|
+
}
|
281
|
+
}
|
282
|
+
}
|
283
|
+
}
|
284
|
+
};
|
285
|
+
export const EmailGetSendStatusHeaders = {
|
286
|
+
type: {
|
287
|
+
name: "Composite",
|
288
|
+
className: "EmailGetSendStatusHeaders",
|
289
|
+
modelProperties: {
|
290
|
+
retryAfter: {
|
291
|
+
serializedName: "retry-after",
|
292
|
+
type: {
|
293
|
+
name: "Number"
|
294
|
+
}
|
295
|
+
}
|
296
|
+
}
|
297
|
+
}
|
298
|
+
};
|
299
|
+
export const EmailSendHeaders = {
|
300
|
+
type: {
|
301
|
+
name: "Composite",
|
302
|
+
className: "EmailSendHeaders",
|
303
|
+
modelProperties: {
|
304
|
+
repeatabilityResult: {
|
305
|
+
serializedName: "repeatability-result",
|
306
|
+
type: {
|
307
|
+
name: "String"
|
308
|
+
}
|
309
|
+
},
|
310
|
+
operationLocation: {
|
311
|
+
serializedName: "operation-location",
|
312
|
+
type: {
|
313
|
+
name: "String"
|
314
|
+
}
|
315
|
+
},
|
316
|
+
retryAfter: {
|
317
|
+
serializedName: "retry-after",
|
318
|
+
type: {
|
319
|
+
name: "Number"
|
320
|
+
}
|
321
|
+
},
|
322
|
+
xMsRequestId: {
|
323
|
+
serializedName: "x-ms-request-id",
|
324
|
+
type: {
|
325
|
+
name: "String"
|
326
|
+
}
|
327
|
+
}
|
328
|
+
}
|
329
|
+
}
|
330
|
+
};
|
331
|
+
//# sourceMappingURL=mappers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../../../../src/generated/src/models/mappers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,IAAI,EAAE;QAC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ed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreHttp from \"@azure/core-http\";\n\nexport const SendStatusResult: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SendStatusResult\",\n modelProperties: {\n messageId: {\n serializedName: \"messageId\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n status: {\n serializedName: \"status\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CommunicationErrorResponse: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CommunicationErrorResponse\",\n modelProperties: {\n error: {\n serializedName: \"error\",\n type: {\n name: \"Composite\",\n className: \"CommunicationError\"\n }\n }\n }\n }\n};\n\nexport const CommunicationError: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CommunicationError\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n message: {\n serializedName: \"message\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n readOnly: true,\n type: {\n name: \"String\"\n }\n },\n details: {\n serializedName: \"details\",\n readOnly: true,\n type: {\n name: \"Sequence\",\n element: {\n type: { name: \"Composite\", className: \"CommunicationError\" }\n }\n }\n },\n innerError: {\n serializedName: \"innererror\",\n type: {\n name: \"Composite\",\n className: \"CommunicationError\"\n }\n }\n }\n }\n};\n\nexport const EmailMessage: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailMessage\",\n modelProperties: {\n customHeaders: {\n serializedName: \"headers\",\n type: {\n name: \"Sequence\",\n element: {\n type: { name: \"Composite\", className: \"EmailCustomHeader\" }\n }\n }\n },\n sender: {\n serializedName: \"sender\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n content: {\n serializedName: \"content\",\n type: {\n name: \"Composite\",\n className: \"EmailContent\"\n }\n },\n importance: {\n defaultValue: \"normal\",\n serializedName: \"importance\",\n type: {\n name: \"String\"\n }\n },\n recipients: {\n serializedName: \"recipients\",\n type: {\n name: \"Composite\",\n className: \"EmailRecipients\"\n }\n },\n attachments: {\n serializedName: \"attachments\",\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"EmailAttachment\" } }\n }\n },\n replyTo: {\n serializedName: \"replyTo\",\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"EmailAddress\" } }\n }\n },\n disableUserEngagementTracking: {\n serializedName: \"disableUserEngagementTracking\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const EmailCustomHeader: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailCustomHeader\",\n modelProperties: {\n name: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n value: {\n serializedName: \"value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const EmailContent: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailContent\",\n modelProperties: {\n subject: {\n serializedName: \"subject\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n plainText: {\n serializedName: \"plainText\",\n type: {\n name: \"String\"\n }\n },\n html: {\n serializedName: \"html\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const EmailRecipients: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailRecipients\",\n modelProperties: {\n to: {\n serializedName: \"to\",\n required: true,\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"EmailAddress\" } }\n }\n },\n cC: {\n serializedName: \"cC\",\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"EmailAddress\" } }\n }\n },\n bCC: {\n serializedName: \"bCC\",\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"EmailAddress\" } }\n }\n }\n }\n }\n};\n\nexport const EmailAddress: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\",\n modelProperties: {\n email: {\n serializedName: \"email\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n displayName: {\n serializedName: \"displayName\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const EmailAttachment: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailAttachment\",\n modelProperties: {\n name: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n attachmentType: {\n serializedName: \"attachmentType\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contentBytesBase64: {\n serializedName: \"contentBytesBase64\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const EmailGetSendStatusHeaders: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailGetSendStatusHeaders\",\n modelProperties: {\n retryAfter: {\n serializedName: \"retry-after\",\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\n\nexport const EmailSendHeaders: coreHttp.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailSendHeaders\",\n modelProperties: {\n repeatabilityResult: {\n serializedName: \"repeatability-result\",\n type: {\n name: \"String\"\n }\n },\n operationLocation: {\n serializedName: \"operation-location\",\n type: {\n name: \"String\"\n }\n },\n retryAfter: {\n serializedName: \"retry-after\",\n type: {\n name: \"Number\"\n }\n },\n xMsRequestId: {\n serializedName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n"]}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import { EmailMessage as EmailMessageMapper } from "../models/mappers";
|
9
|
+
export const endpoint = {
|
10
|
+
parameterPath: "endpoint",
|
11
|
+
mapper: {
|
12
|
+
serializedName: "endpoint",
|
13
|
+
required: true,
|
14
|
+
type: {
|
15
|
+
name: "String"
|
16
|
+
}
|
17
|
+
},
|
18
|
+
skipEncoding: true
|
19
|
+
};
|
20
|
+
export const messageId = {
|
21
|
+
parameterPath: "messageId",
|
22
|
+
mapper: {
|
23
|
+
serializedName: "messageId",
|
24
|
+
required: true,
|
25
|
+
type: {
|
26
|
+
name: "String"
|
27
|
+
}
|
28
|
+
}
|
29
|
+
};
|
30
|
+
export const apiVersion = {
|
31
|
+
parameterPath: "apiVersion",
|
32
|
+
mapper: {
|
33
|
+
defaultValue: "2021-10-01-preview",
|
34
|
+
isConstant: true,
|
35
|
+
serializedName: "api-version",
|
36
|
+
type: {
|
37
|
+
name: "String"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
};
|
41
|
+
export const contentType = {
|
42
|
+
parameterPath: ["options", "contentType"],
|
43
|
+
mapper: {
|
44
|
+
defaultValue: "application/json",
|
45
|
+
isConstant: true,
|
46
|
+
serializedName: "Content-Type",
|
47
|
+
type: {
|
48
|
+
name: "String"
|
49
|
+
}
|
50
|
+
}
|
51
|
+
};
|
52
|
+
export const emailMessage = {
|
53
|
+
parameterPath: "emailMessage",
|
54
|
+
mapper: EmailMessageMapper
|
55
|
+
};
|
56
|
+
export const repeatabilityRequestId = {
|
57
|
+
parameterPath: "repeatabilityRequestId",
|
58
|
+
mapper: {
|
59
|
+
serializedName: "repeatability-request-id",
|
60
|
+
required: true,
|
61
|
+
type: {
|
62
|
+
name: "String"
|
63
|
+
}
|
64
|
+
}
|
65
|
+
};
|
66
|
+
export const repeatabilityFirstSent = {
|
67
|
+
parameterPath: "repeatabilityFirstSent",
|
68
|
+
mapper: {
|
69
|
+
serializedName: "repeatability-first-sent",
|
70
|
+
required: true,
|
71
|
+
type: {
|
72
|
+
name: "String"
|
73
|
+
}
|
74
|
+
}
|
75
|
+
};
|
76
|
+
//# sourceMappingURL=parameters.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../../src/generated/src/models/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvE,MAAM,CAAC,MAAM,QAAQ,GAA0B;IAC7C,aAAa,EAAE,UAAU;IACzB,MAAM,EAAE;QACN,cAAc,EAAE,UAAU;QAC1B,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;IACD,YAAY,EAAE,IAAI;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAA0B;IAC9C,aAAa,EAAE,WAAW;IAC1B,MAAM,EAAE;QACN,cAAc,EAAE,WAAW;QAC3B,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAA4B;IACjD,aAAa,EAAE,YAAY;IAC3B,MAAM,EAAE;QACN,YAAY,EAAE,oBAAoB;QAClC,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,aAAa;QAC7B,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAuB;IAC7C,aAAa,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;IACzC,MAAM,EAAE;QACN,YAAY,EAAE,kBAAkB;QAChC,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,cAAc;QAC9B,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAuB;IAC9C,aAAa,EAAE,cAAc;IAC7B,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAuB;IACxD,aAAa,EAAE,wBAAwB;IACvC,MAAM,EAAE;QACN,cAAc,EAAE,0BAA0B;QAC1C,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAuB;IACxD,aAAa,EAAE,wBAAwB;IACvC,MAAM,EAAE;QACN,cAAc,EAAE,0BAA0B;QAC1C,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n OperationURLParameter,\n OperationQueryParameter,\n OperationParameter\n} from \"@azure/core-http\";\nimport { EmailMessage as EmailMessageMapper } from \"../models/mappers\";\n\nexport const endpoint: OperationURLParameter = {\n parameterPath: \"endpoint\",\n mapper: {\n serializedName: \"endpoint\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const messageId: OperationURLParameter = {\n parameterPath: \"messageId\",\n mapper: {\n serializedName: \"messageId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const apiVersion: OperationQueryParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n defaultValue: \"2021-10-01-preview\",\n isConstant: true,\n serializedName: \"api-version\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const emailMessage: OperationParameter = {\n parameterPath: \"emailMessage\",\n mapper: EmailMessageMapper\n};\n\nexport const repeatabilityRequestId: OperationParameter = {\n parameterPath: \"repeatabilityRequestId\",\n mapper: {\n serializedName: \"repeatability-request-id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const repeatabilityFirstSent: OperationParameter = {\n parameterPath: \"repeatabilityFirstSent\",\n mapper: {\n serializedName: \"repeatability-first-sent\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n"]}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import * as coreHttp from "@azure/core-http";
|
9
|
+
import * as Mappers from "../models/mappers";
|
10
|
+
import * as Parameters from "../models/parameters";
|
11
|
+
/**
|
12
|
+
* Class representing a Email.
|
13
|
+
*/
|
14
|
+
export class Email {
|
15
|
+
/**
|
16
|
+
* Initialize a new instance of the class Email class.
|
17
|
+
* @param client Reference to the service client
|
18
|
+
*/
|
19
|
+
constructor(client) {
|
20
|
+
this.client = client;
|
21
|
+
}
|
22
|
+
/**
|
23
|
+
* Gets the status of a message sent previously.
|
24
|
+
* @param messageId System generated message id (GUID) returned from a previous call to send email
|
25
|
+
* @param options The options parameters.
|
26
|
+
*/
|
27
|
+
getSendStatus(messageId, options) {
|
28
|
+
const operationOptions = coreHttp.operationOptionsToRequestOptionsBase(options || {});
|
29
|
+
return this.client.sendOperationRequest({ messageId, options: operationOptions }, getSendStatusOperationSpec);
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Queues an email message to be sent to one or more recipients
|
33
|
+
* @param repeatabilityRequestId If specified, the client directs that the request is repeatable; that
|
34
|
+
* is, that the client can make the request multiple times with the same Repeatability-Request-Id and
|
35
|
+
* get back an appropriate response without the server executing the request multiple times. The value
|
36
|
+
* of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique
|
37
|
+
* for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs.
|
38
|
+
* @param repeatabilityFirstSent Must be sent by clients to specify that a request is repeatable.
|
39
|
+
* Repeatability-First-Sent is used to specify the date and time at which the request was first created
|
40
|
+
* in the IMF-fix date form of HTTP-date as defined in RFC7231. eg- Tue, 26 Mar 2019 16:06:51 GMT
|
41
|
+
* @param emailMessage Message payload for sending an email
|
42
|
+
* @param options The options parameters.
|
43
|
+
*/
|
44
|
+
send(repeatabilityRequestId, repeatabilityFirstSent, emailMessage, options) {
|
45
|
+
const operationOptions = coreHttp.operationOptionsToRequestOptionsBase(options || {});
|
46
|
+
return this.client.sendOperationRequest({
|
47
|
+
repeatabilityRequestId,
|
48
|
+
repeatabilityFirstSent,
|
49
|
+
emailMessage,
|
50
|
+
options: operationOptions
|
51
|
+
}, sendOperationSpec);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
// Operation Specifications
|
55
|
+
const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);
|
56
|
+
const getSendStatusOperationSpec = {
|
57
|
+
path: "/emails/{messageId}/status",
|
58
|
+
httpMethod: "GET",
|
59
|
+
responses: {
|
60
|
+
200: {
|
61
|
+
bodyMapper: Mappers.SendStatusResult,
|
62
|
+
headersMapper: Mappers.EmailGetSendStatusHeaders
|
63
|
+
},
|
64
|
+
default: {
|
65
|
+
bodyMapper: Mappers.CommunicationErrorResponse,
|
66
|
+
headersMapper: Mappers.EmailGetSendStatusHeaders
|
67
|
+
}
|
68
|
+
},
|
69
|
+
queryParameters: [Parameters.apiVersion],
|
70
|
+
urlParameters: [Parameters.endpoint, Parameters.messageId],
|
71
|
+
serializer
|
72
|
+
};
|
73
|
+
const sendOperationSpec = {
|
74
|
+
path: "/emails:send",
|
75
|
+
httpMethod: "POST",
|
76
|
+
responses: {
|
77
|
+
202: {
|
78
|
+
headersMapper: Mappers.EmailSendHeaders
|
79
|
+
},
|
80
|
+
default: {
|
81
|
+
bodyMapper: Mappers.CommunicationErrorResponse,
|
82
|
+
headersMapper: Mappers.EmailSendHeaders
|
83
|
+
}
|
84
|
+
},
|
85
|
+
requestBody: Parameters.emailMessage,
|
86
|
+
queryParameters: [Parameters.apiVersion],
|
87
|
+
urlParameters: [Parameters.endpoint],
|
88
|
+
headerParameters: [
|
89
|
+
Parameters.contentType,
|
90
|
+
Parameters.repeatabilityRequestId,
|
91
|
+
Parameters.repeatabilityFirstSent
|
92
|
+
],
|
93
|
+
mediaType: "json",
|
94
|
+
serializer
|
95
|
+
};
|
96
|
+
//# sourceMappingURL=email.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/email.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AAQnD;;GAEG;AACH,MAAM,OAAO,KAAK;IAGhB;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,aAAa,CACX,SAAiB,EACjB,OAAmC;QAEnC,MAAM,gBAAgB,GAAgC,QAAQ,CAAC,oCAAoC,CACjG,OAAO,IAAI,EAAE,CACd,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,EACxC,0BAA0B,CACY,CAAC;IAC3C,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,sBAA8B,EAC9B,sBAA8B,EAC9B,YAA0B,EAC1B,OAAmC;QAEnC,MAAM,gBAAgB,GAAgC,QAAQ,CAAC,oCAAoC,CACjG,OAAO,IAAI,EAAE,CACd,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC;YACE,sBAAsB;YACtB,sBAAsB;YACtB,YAAY;YACZ,OAAO,EAAE,gBAAgB;SAC1B,EACD,iBAAiB,CACY,CAAC;IAClC,CAAC;CACF;AACD,2BAA2B;AAE3B,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAEvE,MAAM,0BAA0B,GAA2B;IACzD,IAAI,EAAE,4BAA4B;IAClC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gBAAgB;YACpC,aAAa,EAAE,OAAO,CAAC,yBAAyB;SACjD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;YAC9C,aAAa,EAAE,OAAO,CAAC,yBAAyB;SACjD;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC;IAC1D,UAAU;CACX,CAAC;AACF,MAAM,iBAAiB,GAA2B;IAChD,IAAI,EAAE,cAAc;IACpB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,aAAa,EAAE,OAAO,CAAC,gBAAgB;SACxC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;YAC9C,aAAa,EAAE,OAAO,CAAC,gBAAgB;SACxC;KACF;IACD,WAAW,EAAE,UAAU,CAAC,YAAY;IACpC,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE;QAChB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,sBAAsB;QACjC,UAAU,CAAC,sBAAsB;KAClC;IACD,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreHttp from \"@azure/core-http\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { EmailRestApiClient } from \"../emailRestApiClient\";\nimport {\n EmailGetSendStatusResponse,\n EmailMessage,\n EmailSendResponse\n} from \"../models\";\n\n/**\n * Class representing a Email.\n */\nexport class Email {\n private readonly client: EmailRestApiClient;\n\n /**\n * Initialize a new instance of the class Email class.\n * @param client Reference to the service client\n */\n constructor(client: EmailRestApiClient) {\n this.client = client;\n }\n\n /**\n * Gets the status of a message sent previously.\n * @param messageId System generated message id (GUID) returned from a previous call to send email\n * @param options The options parameters.\n */\n getSendStatus(\n messageId: string,\n options?: coreHttp.OperationOptions\n ): Promise<EmailGetSendStatusResponse> {\n const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase(\n options || {}\n );\n return this.client.sendOperationRequest(\n { messageId, options: operationOptions },\n getSendStatusOperationSpec\n ) as Promise<EmailGetSendStatusResponse>;\n }\n\n /**\n * Queues an email message to be sent to one or more recipients\n * @param repeatabilityRequestId If specified, the client directs that the request is repeatable; that\n * is, that the client can make the request multiple times with the same Repeatability-Request-Id and\n * get back an appropriate response without the server executing the request multiple times. The value\n * of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique\n * for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs.\n * @param repeatabilityFirstSent Must be sent by clients to specify that a request is repeatable.\n * Repeatability-First-Sent is used to specify the date and time at which the request was first created\n * in the IMF-fix date form of HTTP-date as defined in RFC7231. eg- Tue, 26 Mar 2019 16:06:51 GMT\n * @param emailMessage Message payload for sending an email\n * @param options The options parameters.\n */\n send(\n repeatabilityRequestId: string,\n repeatabilityFirstSent: string,\n emailMessage: EmailMessage,\n options?: coreHttp.OperationOptions\n ): Promise<EmailSendResponse> {\n const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase(\n options || {}\n );\n return this.client.sendOperationRequest(\n {\n repeatabilityRequestId,\n repeatabilityFirstSent,\n emailMessage,\n options: operationOptions\n },\n sendOperationSpec\n ) as Promise<EmailSendResponse>;\n }\n}\n// Operation Specifications\n\nconst serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);\n\nconst getSendStatusOperationSpec: coreHttp.OperationSpec = {\n path: \"/emails/{messageId}/status\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SendStatusResult,\n headersMapper: Mappers.EmailGetSendStatusHeaders\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n headersMapper: Mappers.EmailGetSendStatusHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.messageId],\n serializer\n};\nconst sendOperationSpec: coreHttp.OperationSpec = {\n path: \"/emails:send\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.EmailSendHeaders\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse,\n headersMapper: Mappers.EmailSendHeaders\n }\n },\n requestBody: Parameters.emailMessage,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.contentType,\n Parameters.repeatabilityRequestId,\n Parameters.repeatabilityFirstSent\n ],\n mediaType: \"json\",\n serializer\n};\n"]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
export * from "./email";
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,SAAS,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./email\";\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./emailClient\";\nexport * from \"./models\";\n"]}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT license.
|
3
|
+
import { createClientLogger } from "@azure/logger";
|
4
|
+
/**
|
5
|
+
* The \@azure/logger configuration for this package.
|
6
|
+
*/
|
7
|
+
export const logger = createClientLogger("communication-email");
|
8
|
+
//# sourceMappingURL=logger.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,qBAAqB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The \\@azure/logger configuration for this package.\n */\nexport const logger = createClientLogger(\"communication-email\");\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { PipelineOptions } from \"@azure/core-http\";\n\n/**\n * Client options used to configure SMS Client API requests.\n */\nexport interface EmailClientOptions extends PipelineOptions {}\n\n/**\n * Results of a sent email.\n */\nexport interface SendEmailResult {\n /**\n * MessageId of the sent email.\n */\n messageId: string;\n}\n\nexport {\n EmailMessage,\n EmailCustomHeader,\n EmailContent,\n EmailImportance,\n EmailRecipients,\n EmailAddress,\n EmailAttachment,\n EmailAttachmentType,\n SendStatus,\n SendStatusResult,\n} from \"./generated/src/models\";\n"]}
|