@azure/storage-queue
Version:
Microsoft Azure Storage SDK for JavaScript - Queue
140 lines (139 loc) • 5.22 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var messageId_exports = {};
__export(messageId_exports, {
MessageIdImpl: () => MessageIdImpl
});
module.exports = __toCommonJS(messageId_exports);
var coreClient = __toESM(require("@azure/core-client"));
var Mappers = __toESM(require("../models/mappers.js"));
var Parameters = __toESM(require("../models/parameters.js"));
class MessageIdImpl {
client;
/**
* Initialize a new instance of the class MessageId class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update
* Message operation updates the visibility timeout of a message. You can also use this operation to
* update the contents of a message. A message must be in a format that can be included in an XML
* request with UTF-8 encoding, and the encoded message can be up to 64KB in size.
* @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to
* the Get Messages or Update Message operation.
* @param visibilityTimeout Optional. Specifies the new visibility timeout value, in seconds, relative
* to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1
* second, and cannot be larger than 7 days, or larger than 2 hours on REST protocol versions prior to
* version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry
* time.
* @param options The options parameters.
*/
update(popReceipt, visibilityTimeout, options) {
return this.client.sendOperationRequest(
{ popReceipt, visibilityTimeout, options },
updateOperationSpec
);
}
/**
* The Delete operation deletes the specified message.
* @param popReceipt Required. Specifies the valid pop receipt value returned from an earlier call to
* the Get Messages or Update Message operation.
* @param options The options parameters.
*/
delete(popReceipt, options) {
return this.client.sendOperationRequest(
{ popReceipt, options },
deleteOperationSpec
);
}
}
const xmlSerializer = coreClient.createSerializer(
Mappers,
/* isXml */
true
);
const updateOperationSpec = {
path: "/{queueName}/messages/{messageid}",
httpMethod: "PUT",
responses: {
204: {
headersMapper: Mappers.MessageIdUpdateHeaders
},
default: {
bodyMapper: Mappers.StorageError,
headersMapper: Mappers.MessageIdUpdateExceptionHeaders
}
},
requestBody: Parameters.queueMessage1,
queryParameters: [
Parameters.timeoutInSeconds,
Parameters.popReceipt,
Parameters.visibilityTimeout1
],
urlParameters: [Parameters.url],
headerParameters: [
Parameters.contentType,
Parameters.accept,
Parameters.version,
Parameters.requestId
],
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer
};
const deleteOperationSpec = {
path: "/{queueName}/messages/{messageid}",
httpMethod: "DELETE",
responses: {
204: {
headersMapper: Mappers.MessageIdDeleteHeaders
},
default: {
bodyMapper: Mappers.StorageError,
headersMapper: Mappers.MessageIdDeleteExceptionHeaders
}
},
queryParameters: [Parameters.timeoutInSeconds, Parameters.popReceipt],
urlParameters: [Parameters.url],
headerParameters: [
Parameters.version,
Parameters.requestId,
Parameters.accept1
],
isXML: true,
serializer: xmlSerializer
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MessageIdImpl
});
//# sourceMappingURL=messageId.js.map