@mondaycom/apps-sdk
Advanced tools
Comparing version 3.0.0 to 3.0.1-beta.1
"use strict"; | ||
exports.__esModule = true; | ||
exports["default"] = { name: '@mondaycom/apps-sdk', version: '3.0.0' }; | ||
exports["default"] = { name: '@mondaycom/apps-sdk', version: '3.0.1-beta.1' }; | ||
//# sourceMappingURL=minimal-package.js.map |
{ | ||
"name": "@mondaycom/apps-sdk", | ||
"version": "3.0.0", | ||
"version": "3.0.1-beta.1", | ||
"description": "monday apps SDK for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
@@ -203,2 +203,3 @@ "use strict"; | ||
if (!ttlPassedThreshold) return [3 /*break*/, 5]; | ||
logger.info("[authenticate] TTL PASSED ".concat(JSON.stringify({ tokenTtlInHours: tokenTtlInHours, expireTime: expireTime }))); | ||
return [4 /*yield*/, getConnectionData(connectionData)]; | ||
@@ -215,2 +216,3 @@ case 4: return [2 /*return*/, _b.sent()]; | ||
}); }; | ||
var connectionData; | ||
var SecureStorage = /** @class */ (function () { | ||
@@ -222,14 +224,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]; | ||
@@ -243,14 +243,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)) { | ||
@@ -269,14 +267,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', | ||
@@ -286,3 +282,3 @@ body: { data: formalizedValue } | ||
case 2: | ||
_c.sent(); | ||
_b.sent(); | ||
return [2 /*return*/, true]; | ||
@@ -289,0 +285,0 @@ } |
@@ -115,3 +115,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var result; | ||
var result, version, value; | ||
return __generator(this, function (_a) { | ||
@@ -125,3 +125,4 @@ switch (_a.label) { | ||
} | ||
return [2 /*return*/, __assign({ success: true }, result)]; | ||
version = result.version, value = result.value; | ||
return [2 /*return*/, { success: true, value: value, version: version }]; | ||
} | ||
@@ -128,0 +129,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
export default { name: '@mondaycom/apps-sdk', version: '3.0.0' }; | ||
export default { name: '@mondaycom/apps-sdk', version: '3.0.1-beta.1' }; | ||
//# sourceMappingURL=minimal-package.js.map |
{ | ||
"name": "@mondaycom/apps-sdk", | ||
"version": "3.0.0", | ||
"version": "3.0.1-beta.1", | ||
"description": "monday apps SDK for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
@@ -200,2 +200,3 @@ var __assign = (this && this.__assign) || function () { | ||
if (!ttlPassedThreshold) return [3 /*break*/, 5]; | ||
logger.info("[authenticate] TTL PASSED ".concat(JSON.stringify({ tokenTtlInHours: tokenTtlInHours, expireTime: expireTime }))); | ||
return [4 /*yield*/, getConnectionData(connectionData)]; | ||
@@ -212,2 +213,3 @@ case 4: return [2 /*return*/, _b.sent()]; | ||
}); }; | ||
var connectionData; | ||
var SecureStorage = /** @class */ (function () { | ||
@@ -219,14 +221,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]; | ||
@@ -240,14 +240,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)) { | ||
@@ -266,14 +264,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', | ||
@@ -283,3 +279,3 @@ body: { data: formalizedValue } | ||
case 2: | ||
_c.sent(); | ||
_b.sent(); | ||
return [2 /*return*/, true]; | ||
@@ -286,0 +282,0 @@ } |
@@ -112,3 +112,3 @@ var __extends = (this && this.__extends) || (function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var result; | ||
var result, version, value; | ||
return __generator(this, function (_a) { | ||
@@ -122,3 +122,4 @@ switch (_a.label) { | ||
} | ||
return [2 /*return*/, __assign({ success: true }, result)]; | ||
version = result.version, value = result.value; | ||
return [2 /*return*/, { success: true, value: value, version: version }]; | ||
} | ||
@@ -125,0 +126,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>; |
import { BaseStorage } from '../storage/base-storage'; | ||
import { CounterOptions, IStorageInstance, Options, Period } from '../types/storage'; | ||
import { JsonValue } from '../types/general'; | ||
import { CounterOptions, GetResponse, IStorageInstance, Options, Period } from '../types/storage'; | ||
export declare class Storage extends BaseStorage implements IStorageInstance { | ||
@@ -22,8 +23,3 @@ incrementCounter(period: Period, options?: CounterOptions): Promise<{ | ||
}>; | ||
get<T>(key: string, options?: Options): Promise<{ | ||
success: boolean; | ||
value: null; | ||
} | ({ | ||
success: boolean; | ||
} & Awaited<T>)>; | ||
get<T extends JsonValue>(key: string, options?: Options): Promise<GetResponse<T>>; | ||
set(key: string, value: any, options?: Options): Promise<{ | ||
@@ -30,0 +26,0 @@ version: string; |
@@ -0,1 +1,2 @@ | ||
import { JsonValue } from './general'; | ||
export type Token = string; | ||
@@ -16,7 +17,10 @@ export declare enum Period { | ||
}; | ||
export type GetResponse = { | ||
export type GetServerResponse<T extends JsonValue> = { | ||
version?: string; | ||
value: T | null; | ||
}; | ||
export type GetResponse<T extends JsonValue> = { | ||
success: boolean; | ||
error?: string; | ||
}; | ||
} & GetServerResponse<T>; | ||
export type CounterResponse = { | ||
@@ -40,5 +44,5 @@ message: string; | ||
export type IStorageInstance = { | ||
set: <T extends object>(key: string, value: T, options?: Options) => Promise<SetResponse>; | ||
get: (key: string, options?: Options) => Promise<GetResponse>; | ||
set: <T extends JsonValue>(key: string, value: T, options?: Options) => Promise<SetResponse>; | ||
get: <T extends JsonValue>(key: string, options?: Options) => Promise<GetResponse<T>>; | ||
delete: (key: string, options?: Options) => Promise<DeleteResponse>; | ||
}; |
{ | ||
"name": "@mondaycom/apps-sdk", | ||
"version": "3.0.0", | ||
"version": "3.0.1-beta.1", | ||
"description": "monday apps SDK for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
@@ -100,4 +100,2 @@ <h3 style="color:red"><b>Public access to this SDK is currently restricted but will become available in the next few months</b></h3> | ||
- `value: any` - value to store (must be serializable) | ||
- If value is not an object it will be wrapped in an object with a key `value` | ||
- If value is an object it will be stored as is | ||
@@ -104,0 +102,0 @@ ```typescript |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
285662
3893
1
223