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

@forge/storage

Package Overview
Dependencies
Maintainers
2
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forge/storage - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1-next.0

6

out/__test__/global-storage.test.js

@@ -350,3 +350,3 @@ "use strict";

limit
}, queries_1.listQuery(contextAri, {}).query);
}, (0, queries_1.listQuery)(contextAri, {}).query);
expect(response).toEqual(expect.objectContaining({

@@ -388,3 +388,3 @@ results: [

limit
}, queries_1.listQueryForCleanup(contextAri, {}).query);
}, (0, queries_1.listQueryForCleanup)(contextAri, {}).query);
expect(response).toEqual(expect.objectContaining({

@@ -414,3 +414,3 @@ results: [

limit: null
}, queries_1.listQuery(contextAri, {}).query);
}, (0, queries_1.listQuery)(contextAri, {}).query);
});

@@ -417,0 +417,0 @@ it('should handle an empty result set', async () => {

@@ -54,3 +54,3 @@ "use strict";

const globalStorage = newGlobalStorage();
await new query_api_1.DefaultQueryBuilder(globalStorage).where('key', conditions_1.startsWith('test')).getMany();
await new query_api_1.DefaultQueryBuilder(globalStorage).where('key', (0, conditions_1.startsWith)('test')).getMany();
expect(globalStorage.list).toHaveBeenCalledWith(expect.objectContaining({

@@ -68,3 +68,3 @@ where: [

const globalStorage = newGlobalStorage();
await new query_api_1.DefaultQueryBuilder(globalStorage).where('key', conditions_2.isNotEqualTo(['test', 'test2'])).getMany();
await new query_api_1.DefaultQueryBuilder(globalStorage).where('key', (0, conditions_2.isNotEqualTo)(['test', 'test2'])).getMany();
expect(globalStorage.list).toHaveBeenCalledWith(expect.objectContaining({

@@ -82,3 +82,3 @@ where: [

const globalStorage = newGlobalStorage();
await new query_api_1.DefaultQueryBuilder(globalStorage).where('key', conditions_2.isIn(['test', 'test2'])).getMany();
await new query_api_1.DefaultQueryBuilder(globalStorage).where('key', (0, conditions_2.isIn)(['test', 'test2'])).getMany();
expect(globalStorage.list).toHaveBeenCalledWith(expect.objectContaining({

@@ -96,3 +96,3 @@ where: [

const globalStorage = newGlobalStorage();
await new query_api_1.DefaultQueryBuilder(globalStorage).where('key', conditions_1.startsWith('test')).getMany();
await new query_api_1.DefaultQueryBuilder(globalStorage).where('key', (0, conditions_1.startsWith)('test')).getMany();
expect(globalStorage.list).toHaveBeenCalledWith(expect.objectContaining({

@@ -99,0 +99,0 @@ where: [

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.APIError = exports.getErrorMessage = exports.getErrorMessageFromCode = void 0;
exports.getErrorMessageFromCode = (code, message) => {
const getErrorMessageFromCode = (code, message) => {
return message !== null && message !== void 0 ? message : code;
};
exports.getErrorMessage = (statusCode) => {
exports.getErrorMessageFromCode = getErrorMessageFromCode;
const getErrorMessage = (statusCode) => {
switch (statusCode) {

@@ -25,2 +26,3 @@ case 400:

};
exports.getErrorMessage = getErrorMessage;
class APIError extends Error {

@@ -31,6 +33,6 @@ constructor(message) {

static forStatus(status) {
return new APIError(exports.getErrorMessage(status));
return new APIError((0, exports.getErrorMessage)(status));
}
static forErrorCode(code, message) {
return new APIError(exports.getErrorMessageFromCode(code, message));
return new APIError((0, exports.getErrorMessageFromCode)(code, message));
}

@@ -37,0 +39,0 @@ static forUnexpected(message) {

@@ -44,4 +44,4 @@ "use strict";

const requestBody = process.env.IS_CLEANUP_FUNCTION === 'true'
? queries_1.listQueryForCleanup(this.doGetAppContextAri(), options)
: queries_1.listQuery(this.doGetAppContextAri(), options);
? (0, queries_1.listQueryForCleanup)(this.doGetAppContextAri(), options)
: (0, queries_1.listQuery)(this.doGetAppContextAri(), options);
const response = await this.query(requestBody);

@@ -59,19 +59,19 @@ const edges = process.env.IS_CLEANUP_FUNCTION === 'true'

async set(key, value) {
const requestBody = queries_1.setQuery(this.doGetAppContextAri(), key, value, false);
const requestBody = (0, queries_1.setQuery)(this.doGetAppContextAri(), key, value, false);
await this.mutation(requestBody, 'setAppStoredEntity');
}
async setSecret(key, value) {
const requestBody = queries_1.setQuery(this.doGetAppContextAri(), key, value, true);
const requestBody = (0, queries_1.setQuery)(this.doGetAppContextAri(), key, value, true);
await this.mutation(requestBody, 'setAppStoredEntity');
}
async delete(key) {
const requestBody = queries_1.deleteQuery(this.doGetAppContextAri(), key, false);
const requestBody = (0, queries_1.deleteQuery)(this.doGetAppContextAri(), key, false);
await this.mutation(requestBody, 'deleteAppStoredEntity');
}
async deleteSecret(key) {
const requestBody = queries_1.deleteQuery(this.doGetAppContextAri(), key, true);
const requestBody = (0, queries_1.deleteQuery)(this.doGetAppContextAri(), key, true);
await this.mutation(requestBody, 'deleteAppStoredEntity');
}
async getInternal(key, encrypted) {
const requestBody = queries_1.getQuery(this.doGetAppContextAri(), key, encrypted);
const requestBody = (0, queries_1.getQuery)(this.doGetAppContextAri(), key, encrypted);
const { appStoredEntity: { value } } = await this.query(requestBody);

@@ -78,0 +78,0 @@ return value !== null && value !== void 0 ? value : undefined;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStorageInstanceWithQuery = void 0;
exports.APIError = exports.startsWith = exports.GlobalStorage = exports.getStorageInstanceWithQuery = void 0;
const query_api_1 = require("./query-api");
exports.getStorageInstanceWithQuery = (adapter) => {
const getStorageInstanceWithQuery = (adapter) => {
return {

@@ -16,2 +16,3 @@ get: adapter.get.bind(adapter),

};
exports.getStorageInstanceWithQuery = getStorageInstanceWithQuery;
var global_storage_1 = require("./global-storage");

@@ -18,0 +19,0 @@ Object.defineProperty(exports, "GlobalStorage", { enumerable: true, get: function () { return global_storage_1.GlobalStorage; } });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteQuery = exports.setQuery = exports.listQueryForCleanup = exports.listQuery = exports.getQuery = void 0;
exports.getQuery = (contextAri, key, encrypted) => ({
const getQuery = (contextAri, key, encrypted) => ({
query: `

@@ -19,3 +19,4 @@ query forge_app_getApplicationStorageEntity($contextAri: ID!, $key: ID!, $encrypted: Boolean!) {

});
exports.listQuery = (contextAri, options) => {
exports.getQuery = getQuery;
const listQuery = (contextAri, options) => {
var _a, _b, _c;

@@ -45,3 +46,4 @@ return ({

};
exports.listQueryForCleanup = (contextAri, options) => {
exports.listQuery = listQuery;
const listQueryForCleanup = (contextAri, options) => {
var _a, _b, _c;

@@ -71,3 +73,4 @@ return ({

};
exports.setQuery = (contextAri, key, value, encrypted) => ({
exports.listQueryForCleanup = listQueryForCleanup;
const setQuery = (contextAri, key, value, encrypted) => ({
query: `

@@ -98,3 +101,4 @@ mutation forge_app_setApplicationStorageEntity($input: SetAppStoredEntityMutationInput!) {

});
exports.deleteQuery = (contextAri, key, encrypted) => ({
exports.setQuery = setQuery;
const deleteQuery = (contextAri, key, encrypted) => ({
query: `

@@ -124,1 +128,2 @@ mutation forge_app_deleteApplicationStorageEntity($input: DeleteAppStoredEntityMutationInput!) {

});
exports.deleteQuery = deleteQuery;
{
"name": "@forge/storage",
"version": "1.3.0",
"version": "1.3.1-next.0",
"description": "Forge Storage methods",

@@ -20,4 +20,4 @@ "author": "Atlassian",

"@types/node-fetch": "^2.5.7",
"node-fetch": "2.6.1"
"node-fetch": "2.6.7"
}
}
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