@azure/communication-email 1.0.0-alpha.20230303.2 → 1.0.0-alpha.20230303.3
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +32 -24
- package/dist/index.js +155 -220
- package/dist/index.js.map +1 -1
- package/dist-esm/samples-dev/checkMessageStatus.js +41 -0
- package/dist-esm/samples-dev/checkMessageStatus.js.map +1 -0
- package/dist-esm/samples-dev/sendEmailMultipleRecipients.js +8 -10
- package/dist-esm/samples-dev/sendEmailMultipleRecipients.js.map +1 -1
- package/dist-esm/samples-dev/sendEmailSingleRecipient.js +5 -7
- package/dist-esm/samples-dev/sendEmailSingleRecipient.js.map +1 -1
- package/dist-esm/samples-dev/sendEmailWithAttachments.js +7 -9
- package/dist-esm/samples-dev/sendEmailWithAttachments.js.map +1 -1
- package/dist-esm/src/emailClient.js +19 -4
- package/dist-esm/src/emailClient.js.map +1 -1
- package/dist-esm/src/generated/src/emailRestApiClient.js +1 -1
- package/dist-esm/src/generated/src/emailRestApiClient.js.map +1 -1
- package/dist-esm/src/generated/src/models/index.js +80 -14
- package/dist-esm/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/src/generated/src/models/mappers.js +87 -77
- package/dist-esm/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/src/models/parameters.js +16 -14
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/src/operations/email.js +26 -72
- package/dist-esm/src/generated/src/operations/email.js.map +1 -1
- package/dist-esm/src/generated/src/operationsInterfaces/email.js.map +1 -1
- package/dist-esm/src/models.js +1 -1
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/test/public/emailClient.spec.js +74 -24
- package/dist-esm/test/public/emailClient.spec.js.map +1 -1
- package/dist-esm/test/public/utils/recordedClient.js +13 -9
- package/dist-esm/test/public/utils/recordedClient.js.map +1 -1
- package/package.json +2 -3
- package/types/communication-email.d.ts +110 -132
- package/dist-esm/src/generated/src/lroImpl.js +0 -25
- package/dist-esm/src/generated/src/lroImpl.js.map +0 -1
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/generated/src/models/mappers.ts","../src/generated/src/models/parameters.ts","../src/generated/src/lroImpl.ts","../src/generated/src/operations/email.ts","../src/generated/src/emailRestApiClient.ts","../src/logger.ts","../src/emailClient.ts","../src/generated/src/models/index.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 coreClient from \"@azure/core-client\";\n\nexport const EmailSendResult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailSendResult\",\n modelProperties: {\n id: {\n serializedName: \"id\",\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 error: {\n serializedName: \"error\",\n type: {\n name: \"Composite\",\n className: \"ErrorDetail\"\n }\n }\n }\n }\n};\n\nexport const ErrorDetail: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorDetail\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n readOnly: true,\n type: {\n name: \"String\"\n }\n },\n message: {\n serializedName: \"message\",\n readOnly: 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: {\n name: \"Composite\",\n className: \"ErrorDetail\"\n }\n }\n }\n },\n additionalInfo: {\n serializedName: \"additionalInfo\",\n readOnly: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"ErrorAdditionalInfo\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const ErrorAdditionalInfo: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorAdditionalInfo\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n readOnly: true,\n type: {\n name: \"String\"\n }\n },\n info: {\n serializedName: \"info\",\n readOnly: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n};\n\nexport const ErrorResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorResponse\",\n modelProperties: {\n error: {\n serializedName: \"error\",\n type: {\n name: \"Composite\",\n className: \"ErrorDetail\"\n }\n }\n }\n }\n};\n\nexport const EmailMessage: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailMessage\",\n modelProperties: {\n headers: {\n serializedName: \"headers\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n }\n },\n senderAddress: {\n serializedName: \"senderAddress\",\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 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: {\n type: {\n name: \"Composite\",\n className: \"EmailAttachment\"\n }\n }\n }\n },\n replyTo: {\n serializedName: \"replyTo\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\"\n }\n }\n }\n },\n userEngagementTrackingDisabled: {\n serializedName: \"userEngagementTrackingDisabled\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const EmailContent: coreClient.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: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailRecipients\",\n modelProperties: {\n to: {\n serializedName: \"to\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\"\n }\n }\n }\n },\n cc: {\n serializedName: \"cc\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\"\n }\n }\n }\n },\n bcc: {\n serializedName: \"bcc\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const EmailAddress: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\",\n modelProperties: {\n address: {\n serializedName: \"address\",\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: coreClient.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 contentType: {\n serializedName: \"contentType\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contentInBase64: {\n serializedName: \"contentInBase64\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const EmailGetSendResultHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailGetSendResultHeaders\",\n modelProperties: {\n retryAfter: {\n serializedName: \"retry-after\",\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\n\nexport const EmailGetSendResultExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailGetSendResultExceptionHeaders\",\n modelProperties: {\n xMsErrorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const EmailSendHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailSendHeaders\",\n modelProperties: {\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 }\n }\n};\n\nexport const EmailSendExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailSendExceptionHeaders\",\n modelProperties: {\n xMsErrorCode: {\n serializedName: \"x-ms-error-code\",\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 OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport { EmailMessage as EmailMessageMapper } from \"../models/mappers\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\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 operationId: OperationURLParameter = {\n parameterPath: \"operationId\",\n mapper: {\n serializedName: \"operationId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const apiVersion: OperationQueryParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n defaultValue: \"2023-01-15-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 message: OperationParameter = {\n parameterPath: \"message\",\n mapper: EmailMessageMapper\n};\n\nexport const operationId1: OperationParameter = {\n parameterPath: [\"options\", \"operationId\"],\n mapper: {\n serializedName: \"Operation-Id\",\n type: {\n name: \"Uuid\"\n }\n }\n};\n\nexport const clientRequestId: OperationParameter = {\n parameterPath: [\"options\", \"clientRequestId\"],\n mapper: {\n serializedName: \"x-ms-client-request-id\",\n type: {\n name: \"Uuid\"\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 { LongRunningOperation, LroResponse } from \"@azure/core-lro\";\n\nexport class LroImpl<T> implements LongRunningOperation<T> {\n constructor(\n private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,\n private args: Record<string, unknown>,\n private spec: {\n readonly requestBody?: unknown;\n readonly path?: string;\n readonly httpMethod: string;\n } & Record<string, any>,\n public requestPath: string = spec.path!,\n public requestMethod: string = spec.httpMethod\n ) {}\n public async sendInitialRequest(): Promise<LroResponse<T>> {\n return this.sendOperationFn(this.args, this.spec);\n }\n public async sendPollRequest(path: string): Promise<LroResponse<T>> {\n const { requestBody, ...restSpec } = this.spec;\n return this.sendOperationFn(this.args, {\n ...restSpec,\n path,\n httpMethod: \"GET\"\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 { Email } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { EmailRestApiClient } from \"../emailRestApiClient\";\nimport { PollerLike, PollOperationState, LroEngine } from \"@azure/core-lro\";\nimport { LroImpl } from \"../lroImpl\";\nimport {\n EmailGetSendResultOptionalParams,\n EmailGetSendResultResponse,\n EmailMessage,\n EmailSendOptionalParams,\n EmailSendResponse\n} from \"../models\";\n\n/** Class containing Email operations. */\nexport class EmailImpl implements 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 the email send operation.\n * @param operationId ID of the long running operation (GUID) returned from a previous call to send\n * email\n * @param options The options parameters.\n */\n getSendResult(\n operationId: string,\n options?: EmailGetSendResultOptionalParams\n ): Promise<EmailGetSendResultResponse> {\n return this.client.sendOperationRequest(\n { operationId, options },\n getSendResultOperationSpec\n );\n }\n\n /**\n * Queues an email message to be sent to one or more recipients\n * @param message Message payload for sending an email\n * @param options The options parameters.\n */\n async beginSend(\n message: EmailMessage,\n options?: EmailSendOptionalParams\n ): Promise<\n PollerLike<PollOperationState<EmailSendResponse>, EmailSendResponse>\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<EmailSendResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = new LroImpl(\n sendOperation,\n { message, options },\n sendOperationSpec\n );\n const poller = new LroEngine(lro, {\n resumeFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n lroResourceLocationConfig: \"azure-async-operation\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Queues an email message to be sent to one or more recipients\n * @param message Message payload for sending an email\n * @param options The options parameters.\n */\n async beginSendAndWait(\n message: EmailMessage,\n options?: EmailSendOptionalParams\n ): Promise<EmailSendResponse> {\n const poller = await this.beginSend(message, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSendResultOperationSpec: coreClient.OperationSpec = {\n path: \"/emails/operations/{operationId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.EmailSendResult,\n headersMapper: Mappers.EmailGetSendResultHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n headersMapper: Mappers.EmailGetSendResultExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.operationId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendOperationSpec: coreClient.OperationSpec = {\n path: \"/emails:send\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.EmailSendResult,\n headersMapper: Mappers.EmailSendHeaders\n },\n 201: {\n bodyMapper: Mappers.EmailSendResult,\n headersMapper: Mappers.EmailSendHeaders\n },\n 202: {\n bodyMapper: Mappers.EmailSendResult,\n headersMapper: Mappers.EmailSendHeaders\n },\n 204: {\n bodyMapper: Mappers.EmailSendResult,\n headersMapper: Mappers.EmailSendHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n headersMapper: Mappers.EmailSendExceptionHeaders\n }\n },\n requestBody: Parameters.message,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.accept,\n Parameters.contentType,\n Parameters.operationId1,\n Parameters.clientRequestId\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 coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { EmailImpl } from \"./operations\";\nimport { Email } from \"./operationsInterfaces\";\nimport { EmailRestApiClientOptionalParams } from \"./models\";\n\nexport class EmailRestApiClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\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 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 const defaults: EmailRestApiClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-email/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2023-01-15-preview\";\n this.email = new EmailImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n email: Email;\n}\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, EmailSendOptionalParams } from \"./models\";\nimport { KeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { PollerLike, PollOperationState } from \"@azure/core-lro\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport { EmailRestApiClient } from \"./generated/src/emailRestApiClient\";\nimport { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\nimport { logger } from \"./logger\";\nimport { EmailSendResponse } from \"./generated/src\";\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 && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * The Email service client.\n */\nexport class EmailClient {\n private readonly generatedClient: 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(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options?: EmailClientOptions\n );\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: EmailClientOptions | TokenCredential | KeyCredential,\n maybeOptions: EmailClientOptions = {}\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isEmailClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions;\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.generatedClient = new EmailRestApiClient(url, internalPipelineOptions);\n this.generatedClient.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Queues an email message to be sent to one or more recipients\n * @param message - Message payload for sending an email\n * @param options - The options parameters.\n */\n beginSend(\n message: EmailMessage,\n options?: EmailSendOptionalParams\n ): Promise<PollerLike<PollOperationState<EmailSendResponse>, EmailSendResponse>> {\n return this.generatedClient.email.beginSend(message, options);\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 coreClient from \"@azure/core-client\";\n\n/** Status of the long running operation */\nexport interface EmailSendResult {\n /** The unique id of the operation. Use a UUID. */\n id: string;\n /** Status of operation. */\n status: EmailSendStatus;\n /** Error details when status is a non-success terminal state. */\n error?: ErrorDetail;\n}\n\n/** The error detail. */\nexport interface ErrorDetail {\n /**\n * The error code.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly code?: string;\n /**\n * The error message.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly message?: string;\n /**\n * The error target.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly target?: string;\n /**\n * The error details.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly details?: ErrorDetail[];\n /**\n * The error additional info.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly additionalInfo?: ErrorAdditionalInfo[];\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfo {\n /**\n * The additional info type.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly type?: string;\n /**\n * The additional info.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly info?: Record<string, unknown>;\n}\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */\nexport interface ErrorResponse {\n /** The error object. */\n error?: ErrorDetail;\n}\n\n/** Message payload for sending an email */\nexport interface EmailMessage {\n /** Custom email headers to be passed. */\n headers?: { [propertyName: string]: string };\n /** Sender email address from a verified domain. */\n senderAddress: string;\n /** Email content to be sent. */\n content: EmailContent;\n /** Recipients for the email. */\n recipients: EmailRecipients;\n /** List of attachments. Please note that we limit the total size of an email request (which includes attachments) to 10MB. */\n attachments?: EmailAttachment[];\n /** Email addresses where recipients' replies will be sent to. */\n replyTo?: EmailAddress[];\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 userEngagementTrackingDisabled?: boolean;\n}\n\n/** Content of the email. */\nexport interface EmailContent {\n /** Subject of the email message */\n subject: string;\n /** Plain text version of the email message. */\n plainText?: string;\n /** Html version of the email message. */\n html?: string;\n}\n\n/** Recipients of the email */\nexport interface EmailRecipients {\n /** Email To recipients */\n to?: EmailAddress[];\n /** Email CC recipients */\n cc?: EmailAddress[];\n /** Email BCC recipients */\n bcc?: EmailAddress[];\n}\n\n/** An object representing the email address and its display name */\nexport interface EmailAddress {\n /** Email address. */\n address: string;\n /** Email display name. */\n displayName?: string;\n}\n\n/** Attachment to the email. */\nexport interface EmailAttachment {\n /** Name of the attachment */\n name: string;\n /** MIME type of the content being attached. */\n contentType: string;\n /** Base64 encoded contents of the attachment */\n contentInBase64: string;\n}\n\n/** Defines headers for Email_getSendResult operation. */\nexport interface EmailGetSendResultHeaders {\n /** This header will only be present when the status is a non-terminal status. It indicates the minimum amount of time in seconds to wait before polling for operation status again. */\n retryAfter?: number;\n}\n\n/** Defines headers for Email_getSendResult operation. */\nexport interface EmailGetSendResultExceptionHeaders {\n /** Error code - this will be the same as the code in the error property in the response body. */\n xMsErrorCode?: string;\n}\n\n/** Defines headers for Email_send operation. */\nexport interface EmailSendHeaders {\n /** Location url of where to poll the status of this operation from. */\n operationLocation?: string;\n /** This header will only be present when the operation status is a non-terminal status. It indicates the minimum amount of time in seconds to wait before polling for operation status again. */\n retryAfter?: number;\n}\n\n/** Defines headers for Email_send operation. */\nexport interface EmailSendExceptionHeaders {\n /** Error code - this will be the same as the code in the error property in the response body. */\n xMsErrorCode?: string;\n}\n\n/** Known values of {@link EmailSendStatus} that the service accepts. */\nexport enum KnownEmailSendStatus {\n /** NotStarted */\n NotStarted = \"NotStarted\",\n /** Running */\n Running = \"Running\",\n /** Succeeded */\n Succeeded = \"Succeeded\",\n /** Failed */\n Failed = \"Failed\",\n /** Canceled */\n Canceled = \"Canceled\"\n}\n\n/**\n * Defines values for EmailSendStatus. \\\n * {@link KnownEmailSendStatus} can be used interchangeably with EmailSendStatus,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **NotStarted** \\\n * **Running** \\\n * **Succeeded** \\\n * **Failed** \\\n * **Canceled**\n */\nexport type EmailSendStatus = string;\n\n/** Optional parameters. */\nexport interface EmailGetSendResultOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the getSendResult operation. */\nexport type EmailGetSendResultResponse = EmailGetSendResultHeaders &\n EmailSendResult;\n\n/** Optional parameters. */\nexport interface EmailSendOptionalParams extends coreClient.OperationOptions {\n /** This is the ID used by the status monitor for this long running operation. */\n operationId?: string;\n /** Tracking ID sent with the request to help with debugging. */\n clientRequestId?: string;\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */\n resumeFrom?: string;\n}\n\n/** Contains response data for the send operation. */\nexport type EmailSendResponse = EmailSendHeaders & EmailSendResult;\n\n/** Optional parameters. */\nexport interface EmailRestApiClientOptionalParams\n extends coreClient.ServiceClientOptions {\n /** Api Version */\n apiVersion?: string;\n /** Overrides client endpoint. */\n endpoint?: string;\n}\n"],"names":["EmailMessageMapper","__rest","LroEngine","coreClient","Mappers.EmailSendResult","Mappers.EmailGetSendResultHeaders","Mappers.ErrorResponse","Mappers.EmailGetSendResultExceptionHeaders","Parameters.apiVersion","Parameters.endpoint","Parameters.operationId","Parameters.accept","Mappers.EmailSendHeaders","Mappers.EmailSendExceptionHeaders","Parameters.message","Parameters.contentType","Parameters.operationId1","Parameters.clientRequestId","createClientLogger","isTokenCredential","isKeyCredential","parseClientArguments","createCommunicationAuthPolicy","KnownEmailSendStatus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMG;AAII,MAAM,eAAe,GAA+B;AACzD,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,SAAS,EAAE,iBAAiB;AAC5B,QAAA,eAAe,EAAE;AACf,YAAA,EAAE,EAAE;AACF,gBAAA,cAAc,EAAE,IAAI;AACpB,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE;AACJ,oBAAA,IAAI,EAAE,QAAQ;AACf,iBAAA;AACF,aAAA;AACD,YAAA,MAAM,EAAE;AACN,gBAAA,cAAc,EAAE,QAAQ;AACxB,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE;AACJ,oBAAA,IAAI,EAAE,QAAQ;AACf,iBAAA;AACF,aAAA;AACD,YAAA,KAAK,EAAE;AACL,gBAAA,cAAc,EAAE,OAAO;AACvB,gBAAA,IAAI,EAAE;AACJ,oBAAA,IAAI,EAAE,WAAW;AACjB,oBAAA,SAAS,EAAE,aAAa;AACzB,iBAAA;AACF,aAAA;AACF,SAAA;AACF,KAAA;CACF,CAAC;AAEK,MAAM,WAAW,GAA+B;AACrD,IAAA,IAAI,EAAE;AACJ,QAAA,IA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AA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,OAAO,CACP,EAAA;AACD,YAAA,cAAc,EAAE;gBACd,MAAM,EAAE,MAAM,CAAC,IAAI;AACpB,aAAA;AACF,SAAA,CACF,CAAC;AAEF,QAAA,MAAM,UAAU,GAAGC,iDAA6B,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,CAAC,eAAe,GAAG,IAAI,kBAAkB,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;QAC5E,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;KACrD;AAED;;;;AAIG;IACH,SAAS,CACP,OAAqB,EACrB,OAAiC,EAAA;AAEjC,QAAA,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;KAC/D;AACF;;ACnFD;;;;;;AAMG;AAiJH;AACYC,sCAWX;AAXD,CAAA,UAAY,oBAAoB,EAAA;;AAE9B,IAAA,oBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB,CAAA;;AAEzB,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;;AAEnB,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB,CAAA;;AAEvB,IAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;;AAEjB,IAAA,oBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACvB,CAAC,EAXWA,4BAAoB,KAApBA,4BAAoB,GAW/B,EAAA,CAAA,CAAA;;;;"}
|
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/emailRestApiClient.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 coreClient from \"@azure/core-client\";\n\nexport const SendStatusResult: coreClient.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: coreClient.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: coreClient.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: {\n name: \"Composite\",\n className: \"CommunicationError\"\n }\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: coreClient.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: {\n name: \"Composite\",\n className: \"EmailCustomHeader\"\n }\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: {\n type: {\n name: \"Composite\",\n className: \"EmailAttachment\"\n }\n }\n }\n },\n replyTo: {\n serializedName: \"replyTo\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\"\n }\n }\n }\n },\n disableUserEngagementTracking: {\n serializedName: \"disableUserEngagementTracking\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const EmailCustomHeader: coreClient.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: coreClient.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: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailRecipients\",\n modelProperties: {\n to: {\n serializedName: \"to\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\"\n }\n }\n }\n },\n cc: {\n serializedName: \"CC\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\"\n }\n }\n }\n },\n bcc: {\n serializedName: \"bCC\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"EmailAddress\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const EmailAddress: coreClient.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: coreClient.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: coreClient.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 EmailGetSendStatusExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailGetSendStatusExceptionHeaders\",\n modelProperties: {\n xMsErrorCode: {\n serializedName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const EmailSendHeaders: coreClient.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\nexport const EmailSendExceptionHeaders: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EmailSendExceptionHeaders\",\n modelProperties: {\n xMsErrorCode: {\n serializedName: \"x-ms-error-code\",\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 OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport { EmailMessage as EmailMessageMapper } from \"../models/mappers\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\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 { Email } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { EmailRestApiClient } from \"../emailRestApiClient\";\nimport {\n EmailGetSendStatusOptionalParams,\n EmailGetSendStatusResponse,\n EmailMessage,\n EmailSendOptionalParams,\n EmailSendResponse\n} from \"../models\";\n\n/** Class containing Email operations. */\nexport class EmailImpl implements 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?: EmailGetSendStatusOptionalParams\n ): Promise<EmailGetSendStatusResponse> {\n return this.client.sendOperationRequest(\n { messageId, options },\n getSendStatusOperationSpec\n );\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?: EmailSendOptionalParams\n ): Promise<EmailSendResponse> {\n return this.client.sendOperationRequest(\n { repeatabilityRequestId, repeatabilityFirstSent, emailMessage, options },\n sendOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getSendStatusOperationSpec: coreClient.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.EmailGetSendStatusExceptionHeaders\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.messageId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst sendOperationSpec: coreClient.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.EmailSendExceptionHeaders\n }\n },\n requestBody: Parameters.emailMessage,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [\n Parameters.accept,\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 coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { EmailImpl } from \"./operations\";\nimport { Email } from \"./operationsInterfaces\";\nimport { EmailRestApiClientOptionalParams } from \"./models\";\n\nexport class EmailRestApiClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\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 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 const defaults: EmailRestApiClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-email/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2021-10-01-preview\";\n this.email = new EmailImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n email: Email;\n}\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 { KeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport { EmailRestApiClient } from \"./generated/src/emailRestApiClient\";\nimport { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\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 && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * The Email service client.\n */\nexport class EmailClient {\n private readonly generatedClient: 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 /**\n * Initializes a new instance of the EmailClient class using a TokenCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential 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: TokenCredential, options?: EmailClientOptions);\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: EmailClientOptions | TokenCredential | KeyCredential,\n maybeOptions: EmailClientOptions = {}\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isEmailClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions;\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.generatedClient = new EmailRestApiClient(url, internalPipelineOptions);\n this.generatedClient.pipeline.addPolicy(authPolicy);\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.generatedClient.email.send(\n uuid(),\n new Date().toUTCString(),\n emailMessage\n );\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.generatedClient.email.getSendStatus(messageId);\n\n return {\n messageId: response.messageId,\n status: response.status,\n };\n }\n}\n"],"names":["EmailMessageMapper","coreClient","Mappers.SendStatusResult","Mappers.EmailGetSendStatusHeaders","Mappers.CommunicationErrorResponse","Mappers.EmailGetSendStatusExceptionHeaders","Parameters.apiVersion","Parameters.endpoint","Parameters.messageId","Parameters.accept","Mappers.EmailSendHeaders","Mappers.EmailSendExceptionHeaders","Parameters.emailMessage","Parameters.contentType","Parameters.repeatabilityRequestId","Parameters.repeatabilityFirstSent","createClientLogger","isTokenCredential","isKeyCredential","parseClientArguments","createCommunicationAuthPolicy","uuid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMG;AAII,MAAM,gBAAgB,GAA+B;AAC1D,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;AAC3B,gBAAA,QAAQ,EAA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
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: [{ email: recipientAddress, displayName: "Customer Name" }],
|
26
|
+
},
|
27
|
+
};
|
28
|
+
try {
|
29
|
+
// Send the email message
|
30
|
+
const sendEmailResponse = await emailClient.send(emailMessage);
|
31
|
+
// Use the message id to get the status of the email
|
32
|
+
const messageId = sendEmailResponse.messageId || "";
|
33
|
+
const getMessageStatusResponse = await emailClient.getSendStatus(messageId);
|
34
|
+
console.log("Message Status: " + getMessageStatusResponse);
|
35
|
+
}
|
36
|
+
catch (error) {
|
37
|
+
console.log(error);
|
38
|
+
}
|
39
|
+
};
|
40
|
+
void getMessageStatusFromEmail();
|
41
|
+
//# 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,KAA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\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: [{ email: recipientAddress, displayName: \"Customer Name\" }],\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"]}
|
@@ -15,8 +15,8 @@ const sendEmailMultipleRecipients = async () => {
|
|
15
15
|
// Create the Email Client
|
16
16
|
const emailClient = new EmailClient(connectionString);
|
17
17
|
// Create the Email Message to be sent
|
18
|
-
const
|
19
|
-
|
18
|
+
const emailMessage = {
|
19
|
+
sender: senderAddress,
|
20
20
|
content: {
|
21
21
|
subject: "This is the subject",
|
22
22
|
plainText: "This is the body",
|
@@ -24,19 +24,17 @@ const sendEmailMultipleRecipients = async () => {
|
|
24
24
|
},
|
25
25
|
recipients: {
|
26
26
|
to: [
|
27
|
-
{
|
28
|
-
{
|
27
|
+
{ email: recipientAddress, displayName: "Customer Name" },
|
28
|
+
{ email: secondRecipientAddress, displayName: "Customer Name 2" },
|
29
29
|
],
|
30
|
-
cc: [{
|
31
|
-
bcc: [{
|
30
|
+
cc: [{ email: recipientAddress, displayName: "Customer Name" }],
|
31
|
+
bcc: [{ email: secondRecipientAddress, displayName: "Customer Name 2" }],
|
32
32
|
},
|
33
33
|
};
|
34
34
|
try {
|
35
35
|
// Send the email message
|
36
|
-
const
|
37
|
-
|
38
|
-
// Get the OperationId so that it can be used for tracking the message for troubleshooting
|
39
|
-
console.log("Operation ID: " + response.id);
|
36
|
+
const response = await emailClient.send(emailMessage);
|
37
|
+
console.log("Message ID: " + response.messageId);
|
40
38
|
}
|
41
39
|
catch (error) {
|
42
40
|
console.log(error);
|
@@ -1 +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;AAChE,MAAM,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,IAAI,EAAE,CAAC;AAE7E,MAAM,2BAA2B,GAAG,KAAK,IAAmB,EAAE;IAC5D,0BAA0B;IAC1B,MAAM,WAAW,GAAgB,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEnE,sCAAsC;IACtC,MAAM,
|
1
|
+
{"version":3,"file":"sendEmailMultipleRecipients.js","sourceRoot":"","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AEF,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\"] || \"\";\nconst secondRecipientAddress = process.env[\"SECOND_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 { email: recipientAddress, displayName: \"Customer Name\" },\n { email: secondRecipientAddress, displayName: \"Customer Name 2\" },\n ],\n cc: [{ email: recipientAddress, displayName: \"Customer Name\" }],\n bcc: [{ email: secondRecipientAddress, displayName: \"Customer Name 2\" }],\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"]}
|
@@ -14,23 +14,21 @@ const sendSingleEmail = async () => {
|
|
14
14
|
// Create the Email Client
|
15
15
|
const emailClient = new EmailClient(connectionString);
|
16
16
|
// Create the Email Message to be sent
|
17
|
-
const
|
18
|
-
|
17
|
+
const emailMessage = {
|
18
|
+
sender: senderAddress,
|
19
19
|
content: {
|
20
20
|
subject: "This is the subject",
|
21
21
|
plainText: "This is the body",
|
22
22
|
html: "<html><h1>This is the body</h1></html>",
|
23
23
|
},
|
24
24
|
recipients: {
|
25
|
-
to: [{
|
25
|
+
to: [{ email: recipientAddress, displayName: "Customer Name" }],
|
26
26
|
},
|
27
27
|
};
|
28
28
|
try {
|
29
29
|
// Send the email message
|
30
|
-
const
|
31
|
-
|
32
|
-
// Get the OperationId so that it can be used for tracking the message for troubleshooting
|
33
|
-
console.log("Operation ID: " + response.id);
|
30
|
+
const response = await emailClient.send(emailMessage);
|
31
|
+
console.log("Message ID: " + response.messageId);
|
34
32
|
}
|
35
33
|
catch (error) {
|
36
34
|
console.log(error);
|
@@ -1 +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,GA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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: [{ email: recipientAddress, displayName: \"Customer Name\" }],\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"]}
|
@@ -14,30 +14,28 @@ const sendEmailWithAttachments = async () => {
|
|
14
14
|
// Create the Email Client
|
15
15
|
const emailClient = new EmailClient(connectionString);
|
16
16
|
// Create the Email Message to be sent
|
17
|
-
const
|
18
|
-
|
17
|
+
const emailMessage = {
|
18
|
+
sender: senderAddress,
|
19
19
|
content: {
|
20
20
|
subject: "This is the subject",
|
21
21
|
plainText: "This is the body",
|
22
22
|
html: "<html><h1>This is the body</h1></html>",
|
23
23
|
},
|
24
24
|
recipients: {
|
25
|
-
to: [{
|
25
|
+
to: [{ email: recipientAddress, displayName: "Customer Name" }],
|
26
26
|
},
|
27
27
|
attachments: [
|
28
28
|
{
|
29
29
|
name: "readme.txt",
|
30
|
-
|
31
|
-
|
30
|
+
attachmentType: "txt",
|
31
|
+
contentBytesBase64: "ZW1haWwgdGVzdCBhdHRhY2htZW50",
|
32
32
|
},
|
33
33
|
],
|
34
34
|
};
|
35
35
|
try {
|
36
36
|
// Send the email message
|
37
|
-
const
|
38
|
-
|
39
|
-
// Get the OperationId so that it can be used for tracking the message for troubleshooting
|
40
|
-
console.log("Operation ID: " + response.id);
|
37
|
+
const response = await emailClient.send(emailMessage);
|
38
|
+
console.log("Message ID: " + response.messageId);
|
41
39
|
}
|
42
40
|
catch (error) {
|
43
41
|
console.log(error);
|
@@ -1 +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,
|
1
|
+
{"version":3,"file":"sendEmailWithAttachments.js","sourceRoot":"","sources":["../../samples-dev/sendEmailWithAttachments.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AAEH,OAAO,EAAE,W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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: [{ email: recipientAddress, displayName: \"Customer Name\" }],\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"]}
|
@@ -4,6 +4,7 @@ import { isTokenCredential } from "@azure/core-auth";
|
|
4
4
|
import { createCommunicationAuthPolicy, isKeyCredential, parseClientArguments, } from "@azure/communication-common";
|
5
5
|
import { EmailRestApiClient } from "./generated/src/emailRestApiClient";
|
6
6
|
import { logger } from "./logger";
|
7
|
+
import { v4 as uuid } from "uuid";
|
7
8
|
/**
|
8
9
|
* Checks whether the type of a value is EmailClientOptions or not.
|
9
10
|
*
|
@@ -28,11 +29,25 @@ export class EmailClient {
|
|
28
29
|
}
|
29
30
|
/**
|
30
31
|
* Queues an email message to be sent to one or more recipients
|
31
|
-
* @param
|
32
|
-
* @param options - The options parameters.
|
32
|
+
* @param emailMessage - Message payload for sending an email
|
33
33
|
*/
|
34
|
-
|
35
|
-
|
34
|
+
async send(emailMessage) {
|
35
|
+
var _a;
|
36
|
+
const response = await this.generatedClient.email.send(uuid(), new Date().toUTCString(), emailMessage);
|
37
|
+
return {
|
38
|
+
messageId: (_a = response.xMsRequestId) !== null && _a !== void 0 ? _a : "",
|
39
|
+
};
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* Gets the status of a message sent previously.
|
43
|
+
* @param messageId - System generated message id (GUID) returned from a previous call to send email
|
44
|
+
*/
|
45
|
+
async getSendStatus(messageId) {
|
46
|
+
const response = await this.generatedClient.email.getSendStatus(messageId);
|
47
|
+
return {
|
48
|
+
messageId: response.messageId,
|
49
|
+
status: response.status,
|
50
|
+
};
|
36
51
|
}
|
37
52
|
}
|
38
53
|
//# sourceMappingURL=emailClient.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"emailClient.js","sourceRoot":"","sources":["../../src/emailClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAkC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"emailClient.js","sourceRoot":"","sources":["../../src/emailClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAkC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EACL,6BAA6B,EAC7B,eAAe,EACf,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,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,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe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sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { EmailClientOptions, EmailMessage, SendEmailResult, SendStatusResult } from \"./models\";\nimport { KeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport { EmailRestApiClient } from \"./generated/src/emailRestApiClient\";\nimport { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\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 && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * The Email service client.\n */\nexport class EmailClient {\n private readonly generatedClient: 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 /**\n * Initializes a new instance of the EmailClient class using a TokenCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential 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: TokenCredential, options?: EmailClientOptions);\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: EmailClientOptions | TokenCredential | KeyCredential,\n maybeOptions: EmailClientOptions = {}\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isEmailClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions;\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.generatedClient = new EmailRestApiClient(url, internalPipelineOptions);\n this.generatedClient.pipeline.addPolicy(authPolicy);\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.generatedClient.email.send(\n uuid(),\n new Date().toUTCString(),\n emailMessage\n );\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.generatedClient.email.getSendStatus(messageId);\n\n return {\n messageId: response.messageId,\n status: response.status,\n };\n }\n}\n"]}
|
@@ -36,7 +36,7 @@ export class EmailRestApiClient extends coreClient.ServiceClient {
|
|
36
36
|
// Parameter assignments
|
37
37
|
this.endpoint = endpoint;
|
38
38
|
// Assigning values to Constant parameters
|
39
|
-
this.apiVersion = options.apiVersion || "
|
39
|
+
this.apiVersion = options.apiVersion || "2021-10-01-preview";
|
40
40
|
this.email = new EmailImpl(this);
|
41
41
|
this.addCustomApiVersionPolicy(options.apiVersion);
|
42
42
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"emailRestApiClient.js","sourceRoot":"","sources":["../../../../src/generated/src/emailRestApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,M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AK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;oBACpB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE;4BACpC,OAAO,cAAc,GAAG,UAAU,CAAC;yBACpC;6BAAM;4BACL,OAAO,IAAI,CAAC;yBACb;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBACpD;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAGF","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 coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { EmailImpl } from \"./operations\";\nimport { Email } from \"./operationsInterfaces\";\nimport { EmailRestApiClientOptionalParams } from \"./models\";\n\nexport class EmailRestApiClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\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 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 const defaults: EmailRestApiClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-email/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"
|
1
|
+
{"version":3,"file":"emailRestApiClient.js","sourceRoot":"","sources":["../../../../src/generated/src/emailRestApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,MAAM,OAAO,kBAAmB,SAAQ,UAAU,CAAC,aAAa;IAI9D;;;;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;QACD,MAAM,QAAQ,GAAqC;YACjD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,2CAA2C,CAAC;QACnE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,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CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBACpD;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAGF","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 coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { EmailImpl } from \"./operations\";\nimport { Email } from \"./operationsInterfaces\";\nimport { EmailRestApiClientOptionalParams } from \"./models\";\n\nexport class EmailRestApiClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\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 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 const defaults: EmailRestApiClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-email/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2021-10-01-preview\";\n this.email = new EmailImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n email: Email;\n}\n"]}
|