Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

azurite

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azurite - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

lib/actions/table/DeleteEntity.js

1

lib/actions/table/CreateTable.js

@@ -14,2 +14,3 @@ 'use strict';

.then((response) => {
res.set(request.httpProps);
if (request.httpProps[N.PREFER] === 'return-no-content') {

@@ -16,0 +17,0 @@ response.addHttpProperty(N.PREFERENCE_APPLIED, 'return-no-content');

3

lib/actions/table/DeleteTable.js

@@ -14,3 +14,4 @@ 'use strict';

.then((response) => {
res.status(201).send(204);
res.set(request.httpProps);
res.status(201).send();
});

@@ -17,0 +18,0 @@ }

@@ -14,2 +14,3 @@ 'use strict';

.then((response) => {
res.set(request.httpProps);
if (request.httpProps[N.PREFER] === 'return-no-content') {

@@ -16,0 +17,0 @@ response.addHttpProperty(N.PREFERENCE_APPLIED, 'return-no-content');

@@ -110,3 +110,4 @@ 'use strict';

INSERT_ENTITY: 'InsertEntity',
DELETE_TABLE: 'DeleteTable'
DELETE_TABLE: 'DeleteTable',
DELETE_ENTITY: 'DeleteEntity'
}

@@ -113,0 +114,0 @@ }

@@ -23,2 +23,4 @@ 'use strict';

CorsForbidden: new ErrorCode('Forbidden', 403, 'CORS validation failed.'),
MissingRequiredHeader: new ErrorCode('MissingRequiredHeader', 400, 'A required HTTP header was not specified.'),
ResourceNotFound: new ErrorCode('ResourceNotFound', 404, 'The specified resource does not exist.'),

@@ -32,3 +34,2 @@ // BLOB

MissingContentLengthHeader: new ErrorCode('MissingContentLengthHeader', 411, 'The Content-Length header was not specified.'),
MissingRequiredHeader: new ErrorCode('MissingRequiredHeader', 400, 'A required HTTP header was not specified.'),
Md5Mismatch: new ErrorCode('Md5Mismatch', 400, 'The MD5 value specified in the request did not match the MD5 value calculated by the server.'),

@@ -80,2 +81,3 @@ PreconditionFailed: new ErrorCode('PreconditionFailed', 412, 'One of the XML nodes specified in the request body is not supported.'),

ReservedTableName: new ErrorCode('BadRequest', 404, 'The table name is reserved.'),
UpdateConditionNotSatisfied: new ErrorCode('UpdateConditionNotSatisfied', 412, 'The update condition specified in the request was not satisfied.')
}

@@ -62,2 +62,7 @@ 'use strict';

deleteEntity(request) {
this._deleteEntity(request.tableName, request.partitionKey, request.rowKey);
return BbPromise.resolve(new AzuriteTableResponse({}));
}
_getTable(name) {

@@ -71,2 +76,19 @@ const coll = this.db.getCollection(Tables.Tables);

_deleteEntity(tableName, partitionKey, rowKey) {
const coll = this.db.getCollection(tableName),
result = coll.chain()
.find({
'$and':
[
{
PartitionKey: { '$eq': partitionKey }
},
{
RowKey: { '$eq': rowKey }
}
]
})
.remove();
}
_getEntity(tableName, partitionKey, rowKey) {

@@ -73,0 +95,0 @@ const coll = this.db.getCollection(tableName);

@@ -7,2 +7,3 @@ 'use strict';

deleteTable = require('./../../actions/table/DeleteTable'),
deleteEntity = require('./../../actions/table/DeleteEntity'),
createTable = require('./../../actions/table/CreateTable');

@@ -35,2 +36,6 @@

deleteTable.process(request, res);
}
actions[Operations.DELETE_ENTITY] = (request, res) => {
deleteEntity.process(request, res);
}

@@ -13,2 +13,4 @@ 'use strict';

TableNameVal = require('./../../validation/table/TableName'),
EntityExistsVal = require('./../../validation/table/EntityExists'),
EntityIfMatchVal = require('./../../validation/table/EntityIfMatch'),
ConflictingTableVal = require('./../../validation/table/ConflictingTable');

@@ -59,2 +61,9 @@

.run(TableExistsVal);
}
validations[Operations.DELETE_ENTITY] = (valContext) => {
valContext
.run(TableExistsVal)
.run(EntityExistsVal)
.run(EntityIfMatchVal);
}

@@ -55,3 +55,2 @@ 'use strict';

}
str = str.replace(/[\(\)]/g);
const regex = new RegExp(/\(PartitionKey='(.*)',\s*RowKey='(.*)'\)/);

@@ -58,0 +57,0 @@ const res = regex.exec(str);

@@ -32,4 +32,6 @@ 'use strict';

.delete((req, res, next) => {
req.azuriteOperation = Operations.DELETE_ENTITY;
req.azuriteRequest = new AzuriteTableRequest({ req: req });
next();
});
}
{
"name": "azurite",
"version": "2.1.0",
"version": "2.2.0",
"description": "A lightweight server clone of Azure Blob Storage that simulates most of the commands supported by it with minimal dependencies.",

@@ -5,0 +5,0 @@ "scripts": {

@@ -168,4 +168,3 @@ # Azurite

- Merge Entity [TODO]
- Delete Entity [TODO]
- Insert or Replace Entity [TODO]
- Insert or Merge Entity [TODO]
# 2.0
## 2.2.0
- support for DeleteEntity [#138](https://github.com/arafato/azurite/issues/138)
## 2.1.0

@@ -3,0 +5,0 @@ - support for InsertEntity [#131](https://github.com/arafato/azurite/issues/131)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc