How to use the azure-common.Constants function in azure-common

To help you get started, we’ve selected a few azure-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / queue / models / queuemessageresult.js View on Github external
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var azureCommon = require('azure-common');
var xmlbuilder = azureCommon.xmlbuilder;
var Constants = azureCommon.Constants;

var HeaderConstants = Constants.HeaderConstants;

function QueueMessageResult(queue, messageid, popreceipt, metadata) {
  if (queue) {
    this.queue = queue;
  }

  if (messageid) {
    this.messageid = messageid;
  }

  if (popreceipt) {
    this.popreceipt = popreceipt;
  }
github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / filereadstream.js View on Github external
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

var fs = require('fs');
var util = require('util');

var azureCommon = require('azure-common');
var Constants = azureCommon.Constants;

var EventEmitter = require('events').EventEmitter;
var bufferSize = Constants.BlobConstants.DEFAULT_WRITE_BLOCK_SIZE_IN_BYTES;

/**
* File read stream
* 1. Calculate md5
* 2. Track reading offset
* 3. Could with customize memory allocator
* 4. Buffer data from file or stream.
* @param {object} options stream.Readable options
*/
function FileReadStream(path, options) {
  EventEmitter.call(this);
  this._streamEnded = false;
  this._fd = null;
github Azure / azure-xplat-cli / lib / util / communityUtil.js View on Github external
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Module dependencies.
var url = require('url');
var util = require('util');

var azureCommon = require('azure-common');
var ServiceClient = azureCommon.ServiceClient;
var WebResource = azureCommon.WebResource;
var Constants = azureCommon.Constants;
var HeaderConstants = Constants.HeaderConstants;

// Expose 'CommunityUtil'.
exports = module.exports = CommunityUtil;

/**
* Creates a new CommunityUtil object.
*
* @constructor
*/
function CommunityUtil(managementEndPoint) {
  CommunityUtil['super_'].call(this);
  var serviceHost = 'vmdepot.msopentech.com';
  var managementEndPointAsUrl = url.parse(managementEndPoint);
  if (managementEndPointAsUrl.host == 'management.core.chinacloudapi.cn') {
    serviceHost = 'vmdepot.msopentech.cn';
github BabylonJS / Extensions / LeaderBoard / Zumo / service / node_modules / azure / lib / azure.js View on Github external
* @param {string} [credentials.pem]         The PEM file content.
* @return {CertificateCloudCredentials}
*/
exports.createCertificateCloudCredentials = azureCommon.createCertificateCloudCredentials;

/**
* Creates a new BasicAuthenticationCloudCredentials object.
* Either a pair of cert / key values need to be pass or a pem file location.
*
* @param {string} credentials.username            The username.
* @param {string} credentials.password            The password.
* @return {BasicAuthenticationCloudCredentials}
*/
exports.createBasicAuthenticationCloudCredentials = azureWebSite.createBasicAuthenticationCloudCredentials;

exports.Constants = azureCommon.Constants;
exports.ServiceClient = azureCommon.ServiceClient;
exports.ServiceClientConstants = azureCommon.ServiceClientConstants;
exports.ConnectionStringParser = azureCommon.ConnectionStringParser;
exports.Logger = azureCommon.Logger;
exports.WebResource = azureCommon.WebResource;
exports.Validate = azureCommon.validate;
exports.date = azureCommon.date;

exports.ServiceSettings = azureCommon.ServiceSettings;
exports.ServiceBusSettings = azureCommon.ServiceBusSettings;
exports.ServiceManagementSettings = azureCommon.ServiceManagementSettings;
exports.StorageServiceSettings = azureCommon.StorageServiceSettings;

// Credentials
exports.CertificateCloudCredentials = azureCommon.CertificateCloudCredentials;
exports.TokenCloudCredentials = azureCommon.TokenCloudCredentials;
github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / chunkStream.js View on Github external
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

var stream = require('stream');
var crypto = require('crypto');

var azureCommon = require('azure-common');
var Constants = azureCommon.Constants;

var util = require('util');
var bufferSize = Constants.BlobConstants.DEFAULT_WRITE_BLOCK_SIZE_IN_BYTES;

/**
*  Chunk stream
*  1. Calculate md5
*  2. Track reading offset
*  3. Work with customize memory allocator
*  4. Buffer data from stream.
*  @param {object} options stream.Readable options
*/
function ChunkStream(options) {
  stream.Stream.call(this);
  this.writable = this.readable = true;
github Azure / azure-sdk-for-node / lib / services / serviceBus / lib / servicebusservicebase.js View on Github external
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var _ = require('underscore');
var util = require('util');
var url = require('url');

var azureCommon = require('azure-common');
var ServiceBusServiceClient = require('./servicebusserviceclient');

var WebResource = azureCommon.WebResource;
var Constants = azureCommon.Constants;
var ServiceClientConstants = azureCommon.ServiceClientConstants;
var QueryStringConstants = Constants.QueryStringConstants;
var HeaderConstants = Constants.HeaderConstants;

var ServiceSettings = azureCommon.ServiceSettings;
var ServiceBusSettings = azureCommon.ServiceBusSettings;

/**
* Creates a new ServiceBusServiceBase object.
*
* @constructor
* @augments {ServiceClient}
*
* @param {string} [configOrNamespaceOrConnectionStringOrSettings]  The sdk configuraiton, service bus namespace, the connection string, or service settings.
* @param {string} [accessKey]                              The password. Only necessary if no connection string passed.
* @param {string} [issuer]                                 The issuer.
github Azure / azure-sdk-for-node / lib / services / legacyStorage / lib / table / models / querytablesresultcontinuation.js View on Github external
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var Constants = azureCommon.Constants;
var TableConstants = Constants.TableConstants;

/**
* Creates a new QueryTablesResultContinuation object.
*/
function QueryTablesResultContinuation(tableService, nextTableName) {
  if (tableService) {
    this.tableService = tableService;
  }

  if (nextTableName) {
    this.nextTableName = nextTableName;
  }
}

QueryTablesResultContinuation.parse = function (tableService, response) {
github Azure / azure-sdk-for-node / lib / services / serviceBus / lib / notificationhubservice.js View on Github external
// Module dependencies.
var _ = require('underscore');
var url = require('url');
var util = require('util');

var ServiceBusServiceBase = require('./servicebusservicebase');
var WnsService = require('./wnsservice');
var ApnsService = require('./apnsservice');
var GcmService = require('./gcmservice');
var MpnsService = require('./mpnsservice');

var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var WebResource = azureCommon.WebResource;
var Constants = azureCommon.Constants;
var HeaderConstants = Constants.HeaderConstants;

var ServiceBusSettings = azureCommon.ServiceBusSettings;

var registrationResult = require('./models/registrationresult');

/**
* Creates a new NotificationHubService object.
* @class
* The NotificationHubService allows you to send push notifications to iOS, Android, and Windows Store devices.
*
* For more information on Notification Hubs, as well as task focused information on using them from Node.js applications, see
* [How to Use Service Bus Notification Hubs](https://www.windowsazure.com/en-us/develop/nodejs/how-to-guides/service-bus-notification-hubs/).
* @constructor
* 
* @param {string} hubName                         The notification hub name.
github Azure / azure-sdk-for-node / lib / services / serviceBus / lib / models / queuemessageresult.js View on Github external
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var azureutil = require('azure-common').util;
var RFC1123 = require('azure-common').RFC1123;

var Constants = require('azure-common').Constants;
var HeaderConstants = Constants.HeaderConstants;

exports = module.exports;

exports.parse = function (responseObject) {
  var queueMessageResult = {};

  queueMessageResult.body = responseObject.body;

  if (responseObject.headers[HeaderConstants.BROKER_PROPERTIES_HEADER]) {
    queueMessageResult.brokerProperties = {};

    var brokerProperties = JSON.parse(responseObject.headers[HeaderConstants.BROKER_PROPERTIES_HEADER]);
    Object.keys(brokerProperties).forEach(function (property) {
      queueMessageResult.brokerProperties[property] = brokerProperties[property];
    });
github Azure / azure-sdk-for-node / lib / services / serviceBus / lib / internal / wrap.js View on Github external
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Module dependencies.
var url = require('url');

var WrapTokenManager = require('./wraptokenmanager');

var Constants = require('azure-common').Constants;
var HeaderConstants = Constants.HeaderConstants;
var ServiceBusConstants = Constants.ServiceBusConstants;

/**
* Creates a new Wrap object.
*
* @param {string} acsHost                 The access control host.
* @param {string} issuer                  The service bus issuer.
* @param {string} accessKey               The service bus issuer password.
*/
function Wrap(acsHost, issuer, accessKey) {
  this.acsHost = acsHost;
  this.issuer = issuer;
  this.accessKey = accessKey;
  this.wrapTokenManager = new WrapTokenManager(acsHost, issuer, accessKey);
}