@mondaycom/apps-sdk
Advanced tools
Comparing version 3.0.1 to 3.0.2
"use strict"; | ||
exports.__esModule = true; | ||
exports["default"] = { name: '@mondaycom/apps-sdk', version: '3.0.1' }; | ||
exports["default"] = { name: '@mondaycom/apps-sdk', version: '3.0.2' }; | ||
//# sourceMappingURL=minimal-package.js.map |
{ | ||
"name": "@mondaycom/apps-sdk", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "monday apps SDK for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
@@ -61,3 +61,3 @@ "use strict"; | ||
var logger = new logger_1.Logger('SecureStorage', { mondayInternal: true }); | ||
var MIN_TOKEN_EXPIRE_TTL_HOURS = 0.5; | ||
var MIN_TOKEN_EXPIRE_TTL_HOURS = 0.05; | ||
var secureStorageFetch = function (path, connectionData, options) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -204,2 +204,3 @@ var _a, method, body, token, identityToken, fetchObj, result, error_1; | ||
if (!ttlPassedThreshold) return [3 /*break*/, 5]; | ||
logger.info("[authenticate] TTL PASSED ".concat(JSON.stringify({ tokenTtlInHours: tokenTtlInHours, expireTime: expireTime }))); | ||
return [4 /*yield*/, getConnectionData(connectionData)]; | ||
@@ -216,2 +217,3 @@ case 4: return [2 /*return*/, _b.sent()]; | ||
}); }; | ||
var connectionData; | ||
var SecureStorage = /** @class */ (function () { | ||
@@ -223,14 +225,12 @@ function SecureStorage() { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, fullPath; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_a = this; | ||
return [4 /*yield*/, authenticate(this.connectionData)]; | ||
var fullPath; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, authenticate(connectionData)]; | ||
case 1: | ||
_a.connectionData = _b.sent(); | ||
fullPath = generateCrudPath(key, this.connectionData.id); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, this.connectionData, { method: 'DELETE' })]; | ||
connectionData = _a.sent(); | ||
fullPath = generateCrudPath(key, connectionData.id); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, connectionData, { method: 'DELETE' })]; | ||
case 2: | ||
_b.sent(); | ||
_a.sent(); | ||
return [2 /*return*/, true]; | ||
@@ -244,14 +244,12 @@ } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _b, fullPath, result; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
_b = this; | ||
return [4 /*yield*/, authenticate(this.connectionData)]; | ||
var fullPath, result; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, authenticate(connectionData)]; | ||
case 1: | ||
_b.connectionData = _c.sent(); | ||
fullPath = generateCrudPath(key, this.connectionData.id); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, this.connectionData, { method: 'GET' })]; | ||
connectionData = _b.sent(); | ||
fullPath = generateCrudPath(key, connectionData.id); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, connectionData, { method: 'GET' })]; | ||
case 2: | ||
result = _c.sent(); | ||
result = _b.sent(); | ||
if (!(0, guards_1.isDefined)(result) || !(0, guards_1.isDefined)(result === null || result === void 0 ? void 0 : result.data)) { | ||
@@ -270,14 +268,12 @@ return [2 /*return*/, null]; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, fullPath, formalizedValue; | ||
var _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
_a = this; | ||
return [4 /*yield*/, authenticate(this.connectionData)]; | ||
var fullPath, formalizedValue; | ||
var _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, authenticate(connectionData)]; | ||
case 1: | ||
_a.connectionData = _c.sent(); | ||
fullPath = generateCrudPath(key, this.connectionData.id); | ||
formalizedValue = (0, validations_1.isObject)(value) ? value : (_b = {}, _b[secure_storage_consts_1.MONDAY_CODE_RESERVED_PRIMITIVES_KEY] = value, _b); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, this.connectionData, { | ||
connectionData = _b.sent(); | ||
fullPath = generateCrudPath(key, connectionData.id); | ||
formalizedValue = (0, validations_1.isObject)(value) ? value : (_a = {}, _a[secure_storage_consts_1.MONDAY_CODE_RESERVED_PRIMITIVES_KEY] = value, _a); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, connectionData, { | ||
method: 'PUT', | ||
@@ -287,3 +283,3 @@ body: { data: formalizedValue } | ||
case 2: | ||
_c.sent(); | ||
_b.sent(); | ||
return [2 /*return*/, true]; | ||
@@ -290,0 +286,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export default { name: '@mondaycom/apps-sdk', version: '3.0.1' }; | ||
export default { name: '@mondaycom/apps-sdk', version: '3.0.2' }; | ||
//# sourceMappingURL=minimal-package.js.map |
{ | ||
"name": "@mondaycom/apps-sdk", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "monday apps SDK for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
@@ -58,3 +58,3 @@ var __assign = (this && this.__assign) || function () { | ||
var logger = new Logger('SecureStorage', { mondayInternal: true }); | ||
var MIN_TOKEN_EXPIRE_TTL_HOURS = 0.5; | ||
var MIN_TOKEN_EXPIRE_TTL_HOURS = 0.05; | ||
var secureStorageFetch = function (path, connectionData, options) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -201,2 +201,3 @@ var _a, method, body, token, identityToken, fetchObj, result, error_1; | ||
if (!ttlPassedThreshold) return [3 /*break*/, 5]; | ||
logger.info("[authenticate] TTL PASSED ".concat(JSON.stringify({ tokenTtlInHours: tokenTtlInHours, expireTime: expireTime }))); | ||
return [4 /*yield*/, getConnectionData(connectionData)]; | ||
@@ -213,2 +214,3 @@ case 4: return [2 /*return*/, _b.sent()]; | ||
}); }; | ||
var connectionData; | ||
var SecureStorage = /** @class */ (function () { | ||
@@ -220,14 +222,12 @@ function SecureStorage() { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, fullPath; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_a = this; | ||
return [4 /*yield*/, authenticate(this.connectionData)]; | ||
var fullPath; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, authenticate(connectionData)]; | ||
case 1: | ||
_a.connectionData = _b.sent(); | ||
fullPath = generateCrudPath(key, this.connectionData.id); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, this.connectionData, { method: 'DELETE' })]; | ||
connectionData = _a.sent(); | ||
fullPath = generateCrudPath(key, connectionData.id); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, connectionData, { method: 'DELETE' })]; | ||
case 2: | ||
_b.sent(); | ||
_a.sent(); | ||
return [2 /*return*/, true]; | ||
@@ -241,14 +241,12 @@ } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _b, fullPath, result; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
_b = this; | ||
return [4 /*yield*/, authenticate(this.connectionData)]; | ||
var fullPath, result; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, authenticate(connectionData)]; | ||
case 1: | ||
_b.connectionData = _c.sent(); | ||
fullPath = generateCrudPath(key, this.connectionData.id); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, this.connectionData, { method: 'GET' })]; | ||
connectionData = _b.sent(); | ||
fullPath = generateCrudPath(key, connectionData.id); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, connectionData, { method: 'GET' })]; | ||
case 2: | ||
result = _c.sent(); | ||
result = _b.sent(); | ||
if (!isDefined(result) || !isDefined(result === null || result === void 0 ? void 0 : result.data)) { | ||
@@ -267,14 +265,12 @@ return [2 /*return*/, null]; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, fullPath, formalizedValue; | ||
var _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
_a = this; | ||
return [4 /*yield*/, authenticate(this.connectionData)]; | ||
var fullPath, formalizedValue; | ||
var _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, authenticate(connectionData)]; | ||
case 1: | ||
_a.connectionData = _c.sent(); | ||
fullPath = generateCrudPath(key, this.connectionData.id); | ||
formalizedValue = isObject(value) ? value : (_b = {}, _b[MONDAY_CODE_RESERVED_PRIMITIVES_KEY] = value, _b); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, this.connectionData, { | ||
connectionData = _b.sent(); | ||
fullPath = generateCrudPath(key, connectionData.id); | ||
formalizedValue = isObject(value) ? value : (_a = {}, _a[MONDAY_CODE_RESERVED_PRIMITIVES_KEY] = value, _a); | ||
return [4 /*yield*/, secureStorageFetch(fullPath, connectionData, { | ||
method: 'PUT', | ||
@@ -284,3 +280,3 @@ body: { data: formalizedValue } | ||
case 2: | ||
_c.sent(); | ||
_b.sent(); | ||
return [2 /*return*/, true]; | ||
@@ -287,0 +283,0 @@ } |
import { SecureStorage } from './secure-storage'; | ||
import { LocalSecureStorage } from './secure-storage.local'; | ||
declare const selectedSecureStorage: typeof SecureStorage | typeof LocalSecureStorage; | ||
declare const selectedSecureStorage: typeof SecureStorage; | ||
export { selectedSecureStorage as SecureStorage }; |
import { JsonValue } from '../types/general'; | ||
import { ISecureStorageInstance } from '../types/secure-storage'; | ||
export declare class SecureStorage implements ISecureStorageInstance { | ||
private connectionData; | ||
constructor(); | ||
@@ -6,0 +5,0 @@ delete(key: string): Promise<boolean>; |
{ | ||
"name": "@mondaycom/apps-sdk", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "monday apps SDK for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
285629
1078
3893