@azure/communication-email 1.0.0-alpha.20220524.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/generated/src/models/mappers.ts","../src/generated/src/models/parameters.ts","../src/generated/src/operations/email.ts","../src/generated/src/emailRestApiClientContext.ts","../src/generated/src/emailRestApiClient.ts","../src/constants.ts","../src/logger.ts","../src/emailClient.ts"],"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\";\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","/*\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","/*\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","/*\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 { EmailRestApiClientOptionalParams } from \"./models\";\n\nconst packageName = \"@azure/communication-email\";\nconst packageVersion = \"1.0.0-beta.1\";\n\nexport class EmailRestApiClientContext extends coreHttp.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the EmailRestApiClientContext class.\n * @param endpoint The communication resource, for example https://my-resource.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: EmailRestApiClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n\n if (!options.userAgent) {\n const defaultUserAgent = coreHttp.getDefaultUserAgentValue();\n options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;\n }\n\n super(undefined, options);\n\n this.requestContentType = \"application/json; charset=utf-8\";\n\n this.baseUri = options.endpoint || \"{endpoint}\";\n\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2021-10-01-preview\";\n }\n}\n","/*\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 operations from \"./operations\";\nimport * as Models from \"./models\";\nimport * as Mappers from \"./models/mappers\";\nimport { EmailRestApiClientContext } from \"./emailRestApiClientContext\";\nimport { EmailRestApiClientOptionalParams } from \"./models\";\n\nclass EmailRestApiClient extends EmailRestApiClientContext {\n /**\n * Initializes a new instance of the EmailRestApiClient class.\n * @param endpoint The communication resource, for example https://my-resource.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: EmailRestApiClientOptionalParams) {\n super(endpoint, options);\n this.email = new operations.Email(this);\n }\n\n email: operations.Email;\n}\n\n// Operation Specifications\n\nexport {\n EmailRestApiClient,\n EmailRestApiClientContext,\n Models as EmailRestApiModels,\n Mappers as EmailRestApiMappers\n};\nexport * from \"./operations\";\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"1.0.0-beta.1\";\n","// 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","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { EmailClientOptions, EmailMessage, SendEmailResult, SendStatusResult } from \"./models\";\nimport {\n InternalPipelineOptions,\n RequestPolicyFactory,\n ServiceClientOptions,\n createPipelineFromOptions,\n} from \"@azure/core-http\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport { EmailRestApiClient } from \"./generated/src/emailRestApiClient\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { SDK_VERSION } from \"./constants\";\nimport { logger } from \"./logger\";\nimport { v4 as uuid } from \"uuid\";\n\n/**\n * Checks whether the type of a value is EmailClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isEmailClientOptions = (options: any): options is EmailClientOptions =>\n !!options && !isKeyCredential(options);\n\n/**\n * The Email service client.\n */\nexport class EmailClient {\n private readonly api: EmailRestApiClient;\n\n /**\n * Initializes a new instance of the EmailClient class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(connectionString: string, options?: EmailClientOptions);\n\n /**\n * Initializes a new instance of the EmailClient class using an Azure KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(endpoint: string, credential: KeyCredential, options?: EmailClientOptions);\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: EmailClientOptions | KeyCredential,\n maybeOptions: EmailClientOptions = {}\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isEmailClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions;\n const libInfo = `azsdk-js-communication-email/${SDK_VERSION}`;\n\n if (!options.userAgentOptions) {\n options.userAgentOptions = {};\n }\n\n if (options.userAgentOptions.userAgentPrefix) {\n options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;\n } else {\n options.userAgentOptions.userAgentPrefix = libInfo;\n }\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const authPolicy: RequestPolicyFactory = createCommunicationAuthPolicy(credential);\n const pipeline: ServiceClientOptions = createPipelineFromOptions(\n internalPipelineOptions,\n authPolicy\n );\n\n this.api = new EmailRestApiClient(url, pipeline);\n }\n\n /**\n * Queues an email message to be sent to one or more recipients\n * @param emailMessage - Message payload for sending an email\n */\n public async send(emailMessage: EmailMessage): Promise<SendEmailResult> {\n const response = await this.api.email.send(uuid(), new Date().toUTCString(), emailMessage);\n\n return {\n messageId: response.xMsRequestId ?? \"\",\n };\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 */\n public async getSendStatus(messageId: string): Promise<SendStatusResult> {\n const response = await this.api.email.getSendStatus(messageId);\n\n return {\n messageId: response.messageId,\n status: response.status,\n };\n }\n}\n"],"names":["EmailMessageMapper","coreHttp","Mappers.SendStatusResult","Mappers.EmailGetSendStatusHeaders","Mappers.CommunicationErrorResponse","Parameters.apiVersion","Parameters.endpoint","Parameters.messageId","Mappers.EmailSendHeaders","Parameters.emailMessage","Parameters.contentType","Parameters.repeatabilityRequestId","Parameters.repeatabilityFirstSent","operations.Email","createClientLogger","isKeyCredential","parseClientArguments","createCommunicationAuthPolicy","createPipelineFromOptions","uuid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMG;AAII,MAAM,gBAAgB,GAA6B;AACxD,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,SAAS,EAAE,kBAAkB;AAC7B,QAAA,eAAe,EAAE;AACf,YAAA,SAAS,EAAE;AACT,gBAAA,cAAc,EAAE,WAAW;A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AAA,MAAM,UAAU,GAAyBC,iDAA6B,CAAC,UAAU,CAAC,CAAC;QACnF,MAAM,QAAQ,GAAyBC,kCAAyB,CAC9D,uBAAuB,EACvB,UAAU,CACX,CAAC;QAEF,IAAI,CAAC,GAAG,GAAG,IAAI,kBAAkB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;KAClD;AAED;;;AAGG;IACI,MAAM,IAAI,CAAC,YAA0B,EAAA;;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAACC,OAAI,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,YAAY,CAAC,CAAC;QAE3F,OAAO;AACL,YAAA,SAAS,EAAE,CAAA,EAAA,GAAA,QAAQ,CAAC,YAAY,mCAAI,EAAE;SACvC,CAAC;KACH;AAED;;;AAGG;IACI,MAAM,aAAa,CAAC,SAAiB,EAAA;AAC1C,QAAA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAE/D,OAAO;YACL,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC;KACH;AACF;;;;"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/**
|
4
|
+
* @summary Checks the message status of a sent email
|
5
|
+
*/
|
6
|
+
import { EmailClient } from "@azure/communication-email";
|
7
|
+
// Load the .env file (you will need to set these environment variables)
|
8
|
+
import * as dotenv from "dotenv";
|
9
|
+
dotenv.config();
|
10
|
+
const connectionString = process.env["COMMUNICATION_CONNECTION_STRING"] || "";
|
11
|
+
const senderAddress = process.env["SENDER_ADDRESS"] || "";
|
12
|
+
const recipientAddress = process.env["RECIPIENT_ADDRESS"] || "";
|
13
|
+
const getMessageStatusFromEmail = async () => {
|
14
|
+
// Create the Email Client
|
15
|
+
const emailClient = new EmailClient(connectionString);
|
16
|
+
// Create the Email Message to be sent
|
17
|
+
const emailMessage = {
|
18
|
+
sender: senderAddress,
|
19
|
+
content: {
|
20
|
+
subject: "This is the subject",
|
21
|
+
plainText: "This is the body",
|
22
|
+
html: "<html><h1>This is the body</h1></html>",
|
23
|
+
},
|
24
|
+
recipients: {
|
25
|
+
to: [
|
26
|
+
{
|
27
|
+
email: recipientAddress,
|
28
|
+
displayName: "Customer Name",
|
29
|
+
},
|
30
|
+
],
|
31
|
+
},
|
32
|
+
};
|
33
|
+
try {
|
34
|
+
// Send the email message
|
35
|
+
const sendEmailResponse = await emailClient.send(emailMessage);
|
36
|
+
// Use the message id to get the status of the email
|
37
|
+
const messageId = sendEmailResponse.messageId || "";
|
38
|
+
const getMessageStatusResponse = await emailClient.getSendStatus(messageId);
|
39
|
+
console.log("Message Status: " + getMessageStatusResponse);
|
40
|
+
}
|
41
|
+
catch (error) {
|
42
|
+
console.log(error);
|
43
|
+
}
|
44
|
+
};
|
45
|
+
void getMessageStatusFromEmail();
|
46
|
+
//# sourceMappingURL=checkMessageStatus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"checkMessageStatus.js","sourceRoot":"","sources":["../../samples-dev/checkMessageStatus.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAgB,MAAM,4BAA4B,CAAC;AAEvE,wEAAwE;AACxE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,IAAI,EAAE,CAAC;AAC9E,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;AAC1D,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;AAEhE,MAAM,yBAAyB,GAAG,KAAK,IAAmB,EAAE;IAC1D,0BAA0B;IAC1B,MAAM,WAAW,GAAgB,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEnE,sCAAsC;IACtC,MAAM,YAAY,GAAiB;QACjC,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE;YACP,OAAO,EAAE,qBAAqB;YAC9B,SAAS,EAAE,kBAAkB;YAC7B,IAAI,EAAE,wCAAwC;SAC/C;QACD,UAAU,EAAE;YACV,EAAE,EAAE;gBACF;oBACE,KAAK,EAAE,gBAAgB;oBACvB,WAAW,EAAE,eAAe;iBAC7B;aACF;SACF;KACF,CAAC;IAEF,IAAI;QACF,yBAAyB;QACzB,MAAM,iBAAiB,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE/D,oDAAoD;QACpD,MAAM,SAAS,GAAG,iBAAiB,CAAC,SAAS,IAAI,EAAE,CAAC;QACpD,MAAM,wBAAwB,GAAG,MAAM,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAE5E,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,wBAAwB,CAAC,CAAC;KAC5D;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC,CAAC;AAEF,KAAK,yBAAyB,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @summary Checks the message status of a sent email\n */\n\nimport { EmailClient, EmailMessage } from \"@azure/communication-email\";\n\n// Load the .env file (you will need to set these environment variables)\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\nconst connectionString = process.env[\"COMMUNICATION_CONNECTION_STRING\"] || \"\";\nconst senderAddress = process.env[\"SENDER_ADDRESS\"] || \"\";\nconst recipientAddress = process.env[\"RECIPIENT_ADDRESS\"] || \"\";\n\nconst getMessageStatusFromEmail = async (): Promise<void> => {\n // Create the Email Client\n const emailClient: EmailClient = new EmailClient(connectionString);\n\n // Create the Email Message to be sent\n const emailMessage: EmailMessage = {\n sender: senderAddress,\n content: {\n subject: \"This is the subject\",\n plainText: \"This is the body\",\n html: \"<html><h1>This is the body</h1></html>\",\n },\n recipients: {\n to: [\n {\n email: recipientAddress,\n displayName: \"Customer Name\",\n },\n ],\n },\n };\n\n try {\n // Send the email message\n const sendEmailResponse = await emailClient.send(emailMessage);\n\n // Use the message id to get the status of the email\n const messageId = sendEmailResponse.messageId || \"\";\n const getMessageStatusResponse = await emailClient.getSendStatus(messageId);\n\n console.log(\"Message Status: \" + getMessageStatusResponse);\n } catch (error) {\n console.log(error);\n }\n};\n\nvoid getMessageStatusFromEmail();\n"]}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/**
|
4
|
+
* @summary Sends an email with multiple recipients
|
5
|
+
*/
|
6
|
+
import { EmailClient } from "@azure/communication-email";
|
7
|
+
// Load the .env file (you will need to set these environment variables)
|
8
|
+
import * as dotenv from "dotenv";
|
9
|
+
dotenv.config();
|
10
|
+
const connectionString = process.env["COMMUNICATION_CONNECTION_STRING"] || "";
|
11
|
+
const senderAddress = process.env["SENDER_ADDRESS"] || "";
|
12
|
+
const recipientAddress = process.env["RECIPIENT_ADDRESS"] || "";
|
13
|
+
const sendEmailMultipleRecipients = async () => {
|
14
|
+
// Create the Email Client
|
15
|
+
const emailClient = new EmailClient(connectionString);
|
16
|
+
// Create the Email Message to be sent
|
17
|
+
const emailMessage = {
|
18
|
+
sender: senderAddress,
|
19
|
+
content: {
|
20
|
+
subject: "This is the subject",
|
21
|
+
plainText: "This is the body",
|
22
|
+
html: "<html><h1>This is the body</h1></html>",
|
23
|
+
},
|
24
|
+
recipients: {
|
25
|
+
to: [
|
26
|
+
{
|
27
|
+
email: recipientAddress,
|
28
|
+
displayName: "Customer Name",
|
29
|
+
},
|
30
|
+
{
|
31
|
+
email: recipientAddress,
|
32
|
+
displayName: "Customer Name",
|
33
|
+
},
|
34
|
+
],
|
35
|
+
cC: [
|
36
|
+
{
|
37
|
+
email: recipientAddress,
|
38
|
+
displayName: "Customer Name",
|
39
|
+
},
|
40
|
+
],
|
41
|
+
bCC: [
|
42
|
+
{
|
43
|
+
email: recipientAddress,
|
44
|
+
displayName: "Customer Name",
|
45
|
+
},
|
46
|
+
],
|
47
|
+
},
|
48
|
+
};
|
49
|
+
try {
|
50
|
+
// Send the email message
|
51
|
+
const response = await emailClient.send(emailMessage);
|
52
|
+
console.log("Message ID: " + response.messageId);
|
53
|
+
}
|
54
|
+
catch (error) {
|
55
|
+
console.log(error);
|
56
|
+
}
|
57
|
+
};
|
58
|
+
void sendEmailMultipleRecipients();
|
59
|
+
//# sourceMappingURL=sendEmailMultipleRecipients.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sendEmailMultipleRecipients.js","sourceRoot":"","sources":["../../samples-dev/sendEmailMultipleRecipients.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAgB,MAAM,4BAA4B,CAAC;AAEvE,wEAAwE;AACxE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,IAAI,EAAE,CAAC;AAC9E,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;AAC1D,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;AAEhE,MAAM,2BAA2B,GAAG,KAAK,IAAmB,EAAE;IAC5D,0BAA0B;IAC1B,MAAM,WAAW,GAAgB,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEnE,sCAAsC;IACtC,MAAM,YAAY,GAAiB;QACjC,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE;YACP,OAAO,EAAE,qBAAqB;YAC9B,SAAS,EAAE,kBAAkB;YAC7B,IAAI,EAAE,wCAAwC;SAC/C;QACD,UAAU,EAAE;YACV,EAAE,EAAE;gBACF;oBACE,KAAK,EAAE,gBAAgB;oBACvB,WAAW,EAAE,eAAe;iBAC7B;gBACD;oBACE,KAAK,EAAE,gBAAgB;oBACvB,WAAW,EAAE,eAAe;iBAC7B;aACF;YACD,EAAE,EAAE;gBACF;oBACE,KAAK,EAAE,gBAAgB;oBACvB,WAAW,EAAE,eAAe;iBAC7B;aACF;YACD,GAAG,EAAE;gBACH;oBACE,KAAK,EAAE,gBAAgB;oBACvB,WAAW,EAAE,eAAe;iBAC7B;aACF;SACF;KACF,CAAC;IAEF,IAAI;QACF,yBAAyB;QACzB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEtD,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;KAClD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC,CAAC;AAEF,KAAK,2BAA2B,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @summary Sends an email with multiple recipients\n */\n\nimport { EmailClient, EmailMessage } from \"@azure/communication-email\";\n\n// Load the .env file (you will need to set these environment variables)\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\nconst connectionString = process.env[\"COMMUNICATION_CONNECTION_STRING\"] || \"\";\nconst senderAddress = process.env[\"SENDER_ADDRESS\"] || \"\";\nconst recipientAddress = process.env[\"RECIPIENT_ADDRESS\"] || \"\";\n\nconst sendEmailMultipleRecipients = async (): Promise<void> => {\n // Create the Email Client\n const emailClient: EmailClient = new EmailClient(connectionString);\n\n // Create the Email Message to be sent\n const emailMessage: EmailMessage = {\n sender: senderAddress,\n content: {\n subject: \"This is the subject\",\n plainText: \"This is the body\",\n html: \"<html><h1>This is the body</h1></html>\",\n },\n recipients: {\n to: [\n {\n email: recipientAddress,\n displayName: \"Customer Name\",\n },\n {\n email: recipientAddress,\n displayName: \"Customer Name\",\n },\n ],\n cC: [\n {\n email: recipientAddress,\n displayName: \"Customer Name\",\n },\n ],\n bCC: [\n {\n email: recipientAddress,\n displayName: \"Customer Name\",\n },\n ],\n },\n };\n\n try {\n // Send the email message\n const response = await emailClient.send(emailMessage);\n\n console.log(\"Message ID: \" + response.messageId);\n } catch (error) {\n console.log(error);\n }\n};\n\nvoid sendEmailMultipleRecipients();\n"]}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/**
|
4
|
+
* @summary Sends an email with a single recipient
|
5
|
+
*/
|
6
|
+
import { EmailClient } from "@azure/communication-email";
|
7
|
+
// Load the .env file (you will need to set these environment variables)
|
8
|
+
import * as dotenv from "dotenv";
|
9
|
+
dotenv.config();
|
10
|
+
const connectionString = process.env["COMMUNICATION_CONNECTION_STRING"] || "";
|
11
|
+
const senderAddress = process.env["SENDER_ADDRESS"] || "";
|
12
|
+
const recipientAddress = process.env["RECIPIENT_ADDRESS"] || "";
|
13
|
+
const sendSingleEmail = async () => {
|
14
|
+
// Create the Email Client
|
15
|
+
const emailClient = new EmailClient(connectionString);
|
16
|
+
// Create the Email Message to be sent
|
17
|
+
const emailMessage = {
|
18
|
+
sender: senderAddress,
|
19
|
+
content: {
|
20
|
+
subject: "This is the subject",
|
21
|
+
plainText: "This is the body",
|
22
|
+
html: "<html><h1>This is the body</h1></html>",
|
23
|
+
},
|
24
|
+
recipients: {
|
25
|
+
to: [
|
26
|
+
{
|
27
|
+
email: recipientAddress,
|
28
|
+
displayName: "Customer Name",
|
29
|
+
},
|
30
|
+
],
|
31
|
+
},
|
32
|
+
};
|
33
|
+
try {
|
34
|
+
// Send the email message
|
35
|
+
const response = await emailClient.send(emailMessage);
|
36
|
+
console.log("Message ID: " + response.messageId);
|
37
|
+
}
|
38
|
+
catch (error) {
|
39
|
+
console.log(error);
|
40
|
+
}
|
41
|
+
};
|
42
|
+
void sendSingleEmail();
|
43
|
+
//# sourceMappingURL=sendEmailSingleRecipient.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sendEmailSingleRecipient.js","sourceRoot":"","sources":["../../samples-dev/sendEmailSingleRecipient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAgB,MAAM,4BAA4B,CAAC;AAEvE,wEAAwE;AACxE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,IAAI,EAAE,CAAC;AAC9E,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;AAC1D,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;AAEhE,MAAM,eAAe,GAAG,KAAK,IAAmB,EAAE;IAChD,0BAA0B;IAC1B,MAAM,WAAW,GAAgB,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEnE,sCAAsC;IACtC,MAAM,YAAY,GAAiB;QACjC,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE;YACP,OAAO,EAAE,qBAAqB;YAC9B,SAAS,EAAE,kBAAkB;YAC7B,IAAI,EAAE,wCAAwC;SAC/C;QACD,UAAU,EAAE;YACV,EAAE,EAAE;gBACF;oBACE,KAAK,EAAE,gBAAgB;oBACvB,WAAW,EAAE,eAAe;iBAC7B;aACF;SACF;KACF,CAAC;IAEF,IAAI;QACF,yBAAyB;QACzB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEtD,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;KAClD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC,CAAC;AAEF,KAAK,eAAe,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @summary Sends an email with a single recipient\n */\n\nimport { EmailClient, EmailMessage } from \"@azure/communication-email\";\n\n// Load the .env file (you will need to set these environment variables)\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\nconst connectionString = process.env[\"COMMUNICATION_CONNECTION_STRING\"] || \"\";\nconst senderAddress = process.env[\"SENDER_ADDRESS\"] || \"\";\nconst recipientAddress = process.env[\"RECIPIENT_ADDRESS\"] || \"\";\n\nconst sendSingleEmail = async (): Promise<void> => {\n // Create the Email Client\n const emailClient: EmailClient = new EmailClient(connectionString);\n\n // Create the Email Message to be sent\n const emailMessage: EmailMessage = {\n sender: senderAddress,\n content: {\n subject: \"This is the subject\",\n plainText: \"This is the body\",\n html: \"<html><h1>This is the body</h1></html>\",\n },\n recipients: {\n to: [\n {\n email: recipientAddress,\n displayName: \"Customer Name\",\n },\n ],\n },\n };\n\n try {\n // Send the email message\n const response = await emailClient.send(emailMessage);\n\n console.log(\"Message ID: \" + response.messageId);\n } catch (error) {\n console.log(error);\n }\n};\n\nvoid sendSingleEmail();\n"]}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/**
|
4
|
+
* @summary Sends an email with a txt file attachment
|
5
|
+
*/
|
6
|
+
import { EmailClient } from "@azure/communication-email";
|
7
|
+
// Load the .env file (you will need to set these environment variables)
|
8
|
+
import * as dotenv from "dotenv";
|
9
|
+
dotenv.config();
|
10
|
+
const connectionString = process.env["COMMUNICATION_CONNECTION_STRING"] || "";
|
11
|
+
const senderAddress = process.env["SENDER_ADDRESS"] || "";
|
12
|
+
const recipientAddress = process.env["RECIPIENT_ADDRESS"] || "";
|
13
|
+
const sendEmailWithAttachments = async () => {
|
14
|
+
// Create the Email Client
|
15
|
+
const emailClient = new EmailClient(connectionString);
|
16
|
+
// Create the Email Message to be sent
|
17
|
+
const emailMessage = {
|
18
|
+
sender: senderAddress,
|
19
|
+
content: {
|
20
|
+
subject: "This is the subject",
|
21
|
+
plainText: "This is the body",
|
22
|
+
html: "<html><h1>This is the body</h1></html>",
|
23
|
+
},
|
24
|
+
recipients: {
|
25
|
+
to: [
|
26
|
+
{
|
27
|
+
email: recipientAddress,
|
28
|
+
displayName: "Customer Name",
|
29
|
+
},
|
30
|
+
],
|
31
|
+
},
|
32
|
+
attachments: [
|
33
|
+
{
|
34
|
+
name: "readme.txt",
|
35
|
+
attachmentType: "txt",
|
36
|
+
contentBytesBase64: "ZW1haWwgdGVzdCBhdHRhY2htZW50",
|
37
|
+
},
|
38
|
+
],
|
39
|
+
};
|
40
|
+
try {
|
41
|
+
// Send the email message
|
42
|
+
const response = await emailClient.send(emailMessage);
|
43
|
+
console.log("Message ID: " + response.messageId);
|
44
|
+
}
|
45
|
+
catch (error) {
|
46
|
+
console.log(error);
|
47
|
+
}
|
48
|
+
};
|
49
|
+
void sendEmailWithAttachments();
|
50
|
+
//# sourceMappingURL=sendEmailWithAttachments.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sendEmailWithAttachments.js","sourceRoot":"","sources":["../../samples-dev/sendEmailWithAttachments.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAgB,MAAM,4BAA4B,CAAC;AAEvE,wEAAwE;AACxE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,IAAI,EAAE,CAAC;AAC9E,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;AAC1D,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;AAEhE,MAAM,wBAAwB,GAAG,KAAK,IAAmB,EAAE;IACzD,0BAA0B;IAC1B,MAAM,WAAW,GAAgB,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEnE,sCAAsC;IACtC,MAAM,YAAY,GAAiB;QACjC,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE;YACP,OAAO,EAAE,qBAAqB;YAC9B,SAAS,EAAE,kBAAkB;YAC7B,IAAI,EAAE,wCAAwC;SAC/C;QACD,UAAU,EAAE;YACV,EAAE,EAAE;gBACF;oBACE,KAAK,EAAE,gBAAgB;oBACvB,WAAW,EAAE,eAAe;iBAC7B;aACF;SACF;QACD,WAAW,EAAE;YACX;gBACE,IAAI,EAAE,YAAY;gBAClB,cAAc,EAAE,KAAK;gBACrB,kBAAkB,EAAE,8BAA8B;aACnD;SACF;KACF,CAAC;IAEF,IAAI;QACF,yBAAyB;QACzB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEtD,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;KAClD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC,CAAC;AAEF,KAAK,wBAAwB,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @summary Sends an email with a txt file attachment\n */\n\nimport { EmailClient, EmailMessage } from \"@azure/communication-email\";\n\n// Load the .env file (you will need to set these environment variables)\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\nconst connectionString = process.env[\"COMMUNICATION_CONNECTION_STRING\"] || \"\";\nconst senderAddress = process.env[\"SENDER_ADDRESS\"] || \"\";\nconst recipientAddress = process.env[\"RECIPIENT_ADDRESS\"] || \"\";\n\nconst sendEmailWithAttachments = async (): Promise<void> => {\n // Create the Email Client\n const emailClient: EmailClient = new EmailClient(connectionString);\n\n // Create the Email Message to be sent\n const emailMessage: EmailMessage = {\n sender: senderAddress,\n content: {\n subject: \"This is the subject\",\n plainText: \"This is the body\",\n html: \"<html><h1>This is the body</h1></html>\",\n },\n recipients: {\n to: [\n {\n email: recipientAddress,\n displayName: \"Customer Name\",\n },\n ],\n },\n attachments: [\n {\n name: \"readme.txt\",\n attachmentType: \"txt\",\n contentBytesBase64: \"ZW1haWwgdGVzdCBhdHRhY2htZW50\",\n },\n ],\n };\n\n try {\n // Send the email message\n const response = await emailClient.send(emailMessage);\n\n console.log(\"Message ID: \" + response.messageId);\n } catch (error) {\n console.log(error);\n }\n};\n\nvoid sendEmailWithAttachments();\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"1.0.0-beta.1\";\n"]}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT license.
|
3
|
+
import { createPipelineFromOptions, } from "@azure/core-http";
|
4
|
+
import { createCommunicationAuthPolicy, isKeyCredential, parseClientArguments, } from "@azure/communication-common";
|
5
|
+
import { EmailRestApiClient } from "./generated/src/emailRestApiClient";
|
6
|
+
import { SDK_VERSION } from "./constants";
|
7
|
+
import { logger } from "./logger";
|
8
|
+
import { v4 as uuid } from "uuid";
|
9
|
+
/**
|
10
|
+
* Checks whether the type of a value is EmailClientOptions or not.
|
11
|
+
*
|
12
|
+
* @param options - The value being checked.
|
13
|
+
*/
|
14
|
+
const isEmailClientOptions = (options) => !!options && !isKeyCredential(options);
|
15
|
+
/**
|
16
|
+
* The Email service client.
|
17
|
+
*/
|
18
|
+
export class EmailClient {
|
19
|
+
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
20
|
+
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
21
|
+
const options = isEmailClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions;
|
22
|
+
const libInfo = `azsdk-js-communication-email/${SDK_VERSION}`;
|
23
|
+
if (!options.userAgentOptions) {
|
24
|
+
options.userAgentOptions = {};
|
25
|
+
}
|
26
|
+
if (options.userAgentOptions.userAgentPrefix) {
|
27
|
+
options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;
|
28
|
+
}
|
29
|
+
else {
|
30
|
+
options.userAgentOptions.userAgentPrefix = libInfo;
|
31
|
+
}
|
32
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
33
|
+
loggingOptions: {
|
34
|
+
logger: logger.info,
|
35
|
+
},
|
36
|
+
});
|
37
|
+
const authPolicy = createCommunicationAuthPolicy(credential);
|
38
|
+
const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy);
|
39
|
+
this.api = new EmailRestApiClient(url, pipeline);
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* Queues an email message to be sent to one or more recipients
|
43
|
+
* @param emailMessage - Message payload for sending an email
|
44
|
+
*/
|
45
|
+
async send(emailMessage) {
|
46
|
+
var _a;
|
47
|
+
const response = await this.api.email.send(uuid(), new Date().toUTCString(), emailMessage);
|
48
|
+
return {
|
49
|
+
messageId: (_a = response.xMsRequestId) !== null && _a !== void 0 ? _a : "",
|
50
|
+
};
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Gets the status of a message sent previously.
|
54
|
+
* @param messageId - System generated message id (GUID) returned from a previous call to send email
|
55
|
+
*/
|
56
|
+
async getSendStatus(messageId) {
|
57
|
+
const response = await this.api.email.getSendStatus(messageId);
|
58
|
+
return {
|
59
|
+
messageId: response.messageId,
|
60
|
+
status: response.status,
|
61
|
+
};
|
62
|
+
}
|
63
|
+
}
|
64
|
+
//# sourceMappingURL=emailClient.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"emailClient.js","sourceRoot":"","sources":["../../src/emailClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAIL,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,6BAA6B,EAC7B,eAAe,EACf,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,CAAC,OAAY,EAAiC,EAAE,CAC3E,CAAC,CAAC,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AAEzC;;GAEG;AACH,MAAM,OAAO,WAAW;IAmBtB,YACE,qBAA6B,EAC7B,mBAAwD,EACxD,eAAmC,EAAE;QAErC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,oBAAoB,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,CAAC;QAC7F,MAAM,OAAO,GAAG,oBAAoB,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,YAAY,CA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M,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { EmailClientOptions, EmailMessage, SendEmailResult, SendStatusResult } from \"./models\";\nimport {\n InternalPipelineOptions,\n RequestPolicyFactory,\n ServiceClientOptions,\n createPipelineFromOptions,\n} from \"@azure/core-http\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport { EmailRestApiClient } from \"./generated/src/emailRestApiClient\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { SDK_VERSION } from \"./constants\";\nimport { logger } from \"./logger\";\nimport { v4 as uuid } from \"uuid\";\n\n/**\n * Checks whether the type of a value is EmailClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isEmailClientOptions = (options: any): options is EmailClientOptions =>\n !!options && !isKeyCredential(options);\n\n/**\n * The Email service client.\n */\nexport class EmailClient {\n private readonly api: EmailRestApiClient;\n\n /**\n * Initializes a new instance of the EmailClient class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(connectionString: string, options?: EmailClientOptions);\n\n /**\n * Initializes a new instance of the EmailClient class using an Azure KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(endpoint: string, credential: KeyCredential, options?: EmailClientOptions);\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: EmailClientOptions | KeyCredential,\n maybeOptions: EmailClientOptions = {}\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isEmailClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions;\n const libInfo = `azsdk-js-communication-email/${SDK_VERSION}`;\n\n if (!options.userAgentOptions) {\n options.userAgentOptions = {};\n }\n\n if (options.userAgentOptions.userAgentPrefix) {\n options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;\n } else {\n options.userAgentOptions.userAgentPrefix = libInfo;\n }\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const authPolicy: RequestPolicyFactory = createCommunicationAuthPolicy(credential);\n const pipeline: ServiceClientOptions = createPipelineFromOptions(\n internalPipelineOptions,\n authPolicy\n );\n\n this.api = new EmailRestApiClient(url, pipeline);\n }\n\n /**\n * Queues an email message to be sent to one or more recipients\n * @param emailMessage - Message payload for sending an email\n */\n public async send(emailMessage: EmailMessage): Promise<SendEmailResult> {\n const response = await this.api.email.send(uuid(), new Date().toUTCString(), emailMessage);\n\n return {\n messageId: response.xMsRequestId ?? \"\",\n };\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 */\n public async getSendStatus(messageId: string): Promise<SendStatusResult> {\n const response = await this.api.email.getSendStatus(messageId);\n\n return {\n messageId: response.messageId,\n status: response.status,\n };\n }\n}\n"]}
|
@@ -0,0 +1,26 @@
|
|
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 operations from "./operations";
|
9
|
+
import * as Models from "./models";
|
10
|
+
import * as Mappers from "./models/mappers";
|
11
|
+
import { EmailRestApiClientContext } from "./emailRestApiClientContext";
|
12
|
+
class EmailRestApiClient extends EmailRestApiClientContext {
|
13
|
+
/**
|
14
|
+
* Initializes a new instance of the EmailRestApiClient class.
|
15
|
+
* @param endpoint The communication resource, for example https://my-resource.communication.azure.com
|
16
|
+
* @param options The parameter options
|
17
|
+
*/
|
18
|
+
constructor(endpoint, options) {
|
19
|
+
super(endpoint, options);
|
20
|
+
this.email = new operations.Email(this);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
// Operation Specifications
|
24
|
+
export { EmailRestApiClient, EmailRestApiClientContext, Models as EmailRestApiModels, Mappers as EmailRestApiMappers };
|
25
|
+
export * from "./operations";
|
26
|
+
//# sourceMappingURL=emailRestApiClient.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"emailRestApiClient.js","sourceRoot":"","sources":["../../../../src/generated/src/emailRestApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,MAAM,kBAAmB,SAAQ,yBAAyB;IACxD;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAA0C;QACtE,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CAGF;AAED,2BAA2B;AAE3B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,MAAM,IAAI,kBAAkB,EAC5B,OAAO,IAAI,mBAAmB,EAC/B,CAAC;AACF,cAAc,cAAc,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 operations from \"./operations\";\nimport * as Models from \"./models\";\nimport * as Mappers from \"./models/mappers\";\nimport { EmailRestApiClientContext } from \"./emailRestApiClientContext\";\nimport { EmailRestApiClientOptionalParams } from \"./models\";\n\nclass EmailRestApiClient extends EmailRestApiClientContext {\n /**\n * Initializes a new instance of the EmailRestApiClient class.\n * @param endpoint The communication resource, for example https://my-resource.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: EmailRestApiClientOptionalParams) {\n super(endpoint, options);\n this.email = new operations.Email(this);\n }\n\n email: operations.Email;\n}\n\n// Operation Specifications\n\nexport {\n EmailRestApiClient,\n EmailRestApiClientContext,\n Models as EmailRestApiModels,\n Mappers as EmailRestApiMappers\n};\nexport * from \"./operations\";\n"]}
|
@@ -0,0 +1,38 @@
|
|
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
|
+
const packageName = "@azure/communication-email";
|
10
|
+
const packageVersion = "1.0.0-beta.1";
|
11
|
+
export class EmailRestApiClientContext extends coreHttp.ServiceClient {
|
12
|
+
/**
|
13
|
+
* Initializes a new instance of the EmailRestApiClientContext class.
|
14
|
+
* @param endpoint The communication resource, for example https://my-resource.communication.azure.com
|
15
|
+
* @param options The parameter options
|
16
|
+
*/
|
17
|
+
constructor(endpoint, options) {
|
18
|
+
if (endpoint === undefined) {
|
19
|
+
throw new Error("'endpoint' cannot be null");
|
20
|
+
}
|
21
|
+
// Initializing default values for options
|
22
|
+
if (!options) {
|
23
|
+
options = {};
|
24
|
+
}
|
25
|
+
if (!options.userAgent) {
|
26
|
+
const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
|
27
|
+
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
|
28
|
+
}
|
29
|
+
super(undefined, options);
|
30
|
+
this.requestContentType = "application/json; charset=utf-8";
|
31
|
+
this.baseUri = options.endpoint || "{endpoint}";
|
32
|
+
// Parameter assignments
|
33
|
+
this.endpoint = endpoint;
|
34
|
+
// Assigning values to Constant parameters
|
35
|
+
this.apiVersion = options.apiVersion || "2021-10-01-preview";
|
36
|
+
}
|
37
|
+
}
|
38
|
+
//# sourceMappingURL=emailRestApiClientContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"emailRestApiClientContext.js","sourceRoot":"","sources":["../../../../src/generated/src/emailRestApiClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAG7C,MAAM,WAAW,GAAG,4BAA4B,CAAC;AACjD,MAAM,cAAc,GAAG,cAAc,CAAC;AAEtC,MAAM,OAAO,yBAA0B,SAAQ,QAAQ,CAAC,aAAa;IAInE;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAA0C;QACtE,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QAED,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YACtB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,wBAAwB,EAAE,CAAC;YAC7D,OAAO,CAAC,SAAS,GAAG,GAAG,WAAW,IAAI,cAAc,IAAI,gBAAgB,EAAE,CAAC;SAC5E;QAED,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAE1B,IAAI,CAAC,kBAAkB,GAAG,iCAAiC,CAAC;QAE5D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,IAAI,YAAY,CAAC;QAEhD,wBAAwB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,0CAA0C;QAC1C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAoB,CAAC;IAC/D,CAAC;CACF","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 { EmailRestApiClientOptionalParams } from \"./models\";\n\nconst packageName = \"@azure/communication-email\";\nconst packageVersion = \"1.0.0-beta.1\";\n\nexport class EmailRestApiClientContext extends coreHttp.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the EmailRestApiClientContext class.\n * @param endpoint The communication resource, for example https://my-resource.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: EmailRestApiClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n\n if (!options.userAgent) {\n const defaultUserAgent = coreHttp.getDefaultUserAgentValue();\n options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;\n }\n\n super(undefined, options);\n\n this.requestContentType = \"application/json; charset=utf-8\";\n\n this.baseUri = options.endpoint || \"{endpoint}\";\n\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2021-10-01-preview\";\n }\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 {};
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generated/src/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","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\";\n\n/**\n * Status of an email message that was sent previously.\n */\nexport interface SendStatusResult {\n /**\n * System generated id of an email message sent.\n */\n messageId: string;\n /**\n * The type indicating the status of a request.\n */\n status: SendStatus;\n}\n\n/**\n * The Communication Services error.\n */\nexport interface CommunicationErrorResponse {\n /**\n * The Communication Services error.\n */\n error: CommunicationError;\n}\n\n/**\n * The Communication Services error.\n */\nexport interface CommunicationError {\n /**\n * The error code.\n */\n code: string;\n /**\n * The error message.\n */\n message: string;\n /**\n * The error target.\n */\n readonly target?: string;\n /**\n * Further details about specific errors that led to this error.\n */\n readonly details?: CommunicationError[];\n /**\n * The inner error if any.\n */\n readonly innerError?: CommunicationError;\n}\n\n/**\n * Message payload for sending an email\n */\nexport interface EmailMessage {\n /**\n * Custom email headers to be passed.\n */\n customHeaders?: EmailCustomHeader[];\n /**\n * Sender email address from a verified domain.\n */\n sender: string;\n /**\n * Email content to be sent.\n */\n content: EmailContent;\n /**\n * The importance type for the email.\n */\n importance?: EmailImportance;\n /**\n * Recipients for the email.\n */\n recipients: EmailRecipients;\n /**\n * list of attachments\n */\n attachments?: EmailAttachment[];\n /**\n * Email addresses where recipients' replies will be sent to.\n */\n replyTo?: EmailAddress[];\n /**\n * Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane.\n */\n disableUserEngagementTracking?: boolean;\n}\n\n/**\n * Custom header for email.\n */\nexport interface EmailCustomHeader {\n /**\n * Header name.\n */\n name: string;\n /**\n * Header value.\n */\n value: string;\n}\n\n/**\n * Content of the email.\n */\nexport interface EmailContent {\n /**\n * Subject of the email message\n */\n subject: string;\n /**\n * Plain text version of the email message.\n */\n plainText?: string;\n /**\n * Html version of the email message.\n */\n html?: string;\n}\n\n/**\n * Recipients of the email\n */\nexport interface EmailRecipients {\n /**\n * Email to recipients\n */\n to: EmailAddress[];\n /**\n * Email cc recipients\n */\n cC?: EmailAddress[];\n /**\n * Email bcc recipients\n */\n bCC?: EmailAddress[];\n}\n\n/**\n * An object representing the email address and its display name\n */\nexport interface EmailAddress {\n /**\n * Email address.\n */\n email: string;\n /**\n * Email display name.\n */\n displayName?: string;\n}\n\n/**\n * Attachment to the email.\n */\nexport interface EmailAttachment {\n /**\n * Name of the attachment\n */\n name: string;\n /**\n * The type of attachment file.\n */\n attachmentType: EmailAttachmentType;\n /**\n * Base64 encoded contents of the attachment\n */\n contentBytesBase64: string;\n}\n\n/**\n * Defines headers for Email_getSendStatus operation.\n */\nexport interface EmailGetSendStatusHeaders {\n retryAfter?: number;\n}\n\n/**\n * Defines headers for Email_send operation.\n */\nexport interface EmailSendHeaders {\n repeatabilityResult?: string;\n operationLocation?: string;\n retryAfter?: number;\n xMsRequestId?: string;\n}\n\n/**\n * Defines values for SendStatus.\n */\nexport type SendStatus = \"queued\" | \"outForDelivery\" | \"dropped\";\n/**\n * Defines values for EmailImportance.\n */\nexport type EmailImportance = \"high\" | \"normal\" | \"low\";\n/**\n * Defines values for EmailAttachmentType.\n */\nexport type EmailAttachmentType =\n | \"avi\"\n | \"bmp\"\n | \"doc\"\n | \"docm\"\n | \"docx\"\n | \"gif\"\n | \"jpeg\"\n | \"mp3\"\n | \"one\"\n | \"pdf\"\n | \"png\"\n | \"ppsm\"\n | \"ppsx\"\n | \"ppt\"\n | \"pptm\"\n | \"pptx\"\n | \"pub\"\n | \"rpmsg\"\n | \"rtf\"\n | \"tif\"\n | \"txt\"\n | \"vsd\"\n | \"wav\"\n | \"wma\"\n | \"xls\"\n | \"xlsb\"\n | \"xlsm\"\n | \"xlsx\";\n\n/**\n * Contains response data for the getSendStatus operation.\n */\nexport type EmailGetSendStatusResponse = EmailGetSendStatusHeaders &\n SendStatusResult & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: SendStatusResult;\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: EmailGetSendStatusHeaders;\n };\n };\n\n/**\n * Contains response data for the send operation.\n */\nexport type EmailSendResponse = EmailSendHeaders & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: EmailSendHeaders;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface EmailRestApiClientOptionalParams\n extends coreHttp.ServiceClientOptions {\n /**\n * Api Version\n */\n apiVersion?: string;\n /**\n * Overrides client endpoint.\n */\n endpoint?: string;\n}\n"]}
|