@mondaycom/apps-sdk
Advanced tools
Comparing version 3.0.10 to 3.0.11
@@ -52,5 +52,7 @@ "use strict"; | ||
var logger = new logger_1.Logger('SecureStorage', { mondayInternal: true }); | ||
var googleAuthClient = new google_auth_library_1.GoogleAuth({ authClient: new google_auth_library_1.Compute() }); | ||
googleAuthClient.defaultScopes = [gcp_1.GCP_SCOPES.CLOUD_PLATFORM]; | ||
var generateJwtSigningUrl = function (serviceAccountEmail) { return "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/".concat(serviceAccountEmail, ":signJwt"); }; | ||
var generateGcpIdentityToken = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var secureStorageAddress, googleAuthClient, idTokenClient, identityToken; | ||
var secureStorageAddress, idTokenClient, identityToken; | ||
return __generator(this, function (_a) { | ||
@@ -60,3 +62,2 @@ switch (_a.label) { | ||
secureStorageAddress = (0, env_1.getMondayCodeContext)().secureStorageAddress; | ||
googleAuthClient = new google_auth_library_1.GoogleAuth(); | ||
return [4 /*yield*/, googleAuthClient.getIdTokenClient(secureStorageAddress)]; | ||
@@ -103,3 +104,3 @@ case 1: | ||
var getGcpConnectionData = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var auth, projectId, serviceAccountEmail, accessToken, issueTimeInSeconds, expirationInSeconds, payload, jwtSigningUrl, response, responseJson, signedToken; | ||
var projectId, serviceAccountEmail, accessToken, issueTimeInSeconds, expirationInSeconds, payload, jwtSigningUrl, response, responseJson, signedToken; | ||
return __generator(this, function (_a) { | ||
@@ -109,11 +110,9 @@ switch (_a.label) { | ||
(0, env_1.validateEnvironment)(); | ||
auth = new google_auth_library_1.GoogleAuth(); | ||
auth.defaultScopes = [gcp_1.GCP_SCOPES.CLOUD_PLATFORM]; | ||
return [4 /*yield*/, auth.getProjectId()]; | ||
return [4 /*yield*/, googleAuthClient.getProjectId()]; | ||
case 1: | ||
projectId = _a.sent(); | ||
return [4 /*yield*/, auth.getCredentials()]; | ||
return [4 /*yield*/, googleAuthClient.getCredentials()]; | ||
case 2: | ||
serviceAccountEmail = (_a.sent()).client_email; | ||
return [4 /*yield*/, auth.getAccessToken()]; | ||
return [4 /*yield*/, googleAuthClient.getAccessToken()]; | ||
case 3: | ||
@@ -120,0 +119,0 @@ accessToken = _a.sent(); |
"use strict"; | ||
exports.__esModule = true; | ||
exports["default"] = { name: '@mondaycom/apps-sdk', version: '3.0.10' }; | ||
exports["default"] = { name: '@mondaycom/apps-sdk', version: '3.0.11' }; | ||
//# sourceMappingURL=minimal-package.js.map |
{ | ||
"name": "@mondaycom/apps-sdk", | ||
"version": "3.0.10", | ||
"version": "3.0.11", | ||
"description": "monday apps SDK for NodeJS", | ||
@@ -51,3 +51,3 @@ "main": "./dist/cjs/index.js", | ||
"@types/app-root-path": "^1.2.4", | ||
"@types/jest": "^29.5.0", | ||
"@types/jest": "^27.3.1", | ||
"@types/jsonwebtoken": "^9.0.1", | ||
@@ -66,3 +66,3 @@ "@types/node-fetch": "^2.6.4", | ||
"prettier": "^2.8.4", | ||
"ts-jest": "^27.0.5", | ||
"ts-jest": "^27.1.4", | ||
"tsc-alias": "^1.8.4", | ||
@@ -73,5 +73,5 @@ "tsconfig-paths": "^4.1.2", | ||
"dependencies": { | ||
"@google-cloud/pubsub": "^4.0.7", | ||
"@google-cloud/pubsub": "^4.4.0", | ||
"app-root-path": "^3.1.0", | ||
"google-auth-library": "^8.7.0", | ||
"google-auth-library": "^9.10.0", | ||
"http-status-codes": "^2.2.0", | ||
@@ -78,0 +78,0 @@ "jsonwebtoken": "^9.0.0", |
@@ -41,2 +41,3 @@ "use strict"; | ||
var pubsub_1 = require("@google-cloud/pubsub"); | ||
var google_auth_library_1 = require("google-auth-library"); | ||
var apps_sdk_error_1 = require("../errors/apps-sdk-error.js"); | ||
@@ -47,3 +48,5 @@ var logger_1 = require("../utils/logger.js"); | ||
function QueueProd() { | ||
this.pubSubClient = new pubsub_1.PubSub(); | ||
var computeClient = new google_auth_library_1.Compute(); | ||
var auth = new google_auth_library_1.GoogleAuth({ authClient: computeClient }); | ||
this.pubSubClient = new pubsub_1.PubSub({ auth: auth }); | ||
} | ||
@@ -50,0 +53,0 @@ QueueProd.prototype.publishMessage = function (message, options) { |
@@ -37,3 +37,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { GoogleAuth } from 'google-auth-library'; | ||
import { Compute, GoogleAuth } from 'google-auth-library'; | ||
import jwt from 'jsonwebtoken'; | ||
@@ -47,5 +47,7 @@ import fetch from 'node-fetch'; | ||
var logger = new Logger('SecureStorage', { mondayInternal: true }); | ||
var googleAuthClient = new GoogleAuth({ authClient: new Compute() }); | ||
googleAuthClient.defaultScopes = [GCP_SCOPES.CLOUD_PLATFORM]; | ||
var generateJwtSigningUrl = function (serviceAccountEmail) { return "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/".concat(serviceAccountEmail, ":signJwt"); }; | ||
var generateGcpIdentityToken = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var secureStorageAddress, googleAuthClient, idTokenClient, identityToken; | ||
var secureStorageAddress, idTokenClient, identityToken; | ||
return __generator(this, function (_a) { | ||
@@ -55,3 +57,2 @@ switch (_a.label) { | ||
secureStorageAddress = getMondayCodeContext().secureStorageAddress; | ||
googleAuthClient = new GoogleAuth(); | ||
return [4 /*yield*/, googleAuthClient.getIdTokenClient(secureStorageAddress)]; | ||
@@ -97,3 +98,3 @@ case 1: | ||
export var getGcpConnectionData = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var auth, projectId, serviceAccountEmail, accessToken, issueTimeInSeconds, expirationInSeconds, payload, jwtSigningUrl, response, responseJson, signedToken; | ||
var projectId, serviceAccountEmail, accessToken, issueTimeInSeconds, expirationInSeconds, payload, jwtSigningUrl, response, responseJson, signedToken; | ||
return __generator(this, function (_a) { | ||
@@ -103,11 +104,9 @@ switch (_a.label) { | ||
validateEnvironment(); | ||
auth = new GoogleAuth(); | ||
auth.defaultScopes = [GCP_SCOPES.CLOUD_PLATFORM]; | ||
return [4 /*yield*/, auth.getProjectId()]; | ||
return [4 /*yield*/, googleAuthClient.getProjectId()]; | ||
case 1: | ||
projectId = _a.sent(); | ||
return [4 /*yield*/, auth.getCredentials()]; | ||
return [4 /*yield*/, googleAuthClient.getCredentials()]; | ||
case 2: | ||
serviceAccountEmail = (_a.sent()).client_email; | ||
return [4 /*yield*/, auth.getAccessToken()]; | ||
return [4 /*yield*/, googleAuthClient.getAccessToken()]; | ||
case 3: | ||
@@ -114,0 +113,0 @@ accessToken = _a.sent(); |
@@ -1,2 +0,2 @@ | ||
export default { name: '@mondaycom/apps-sdk', version: '3.0.10' }; | ||
export default { name: '@mondaycom/apps-sdk', version: '3.0.11' }; | ||
//# sourceMappingURL=minimal-package.js.map |
{ | ||
"name": "@mondaycom/apps-sdk", | ||
"version": "3.0.10", | ||
"version": "3.0.11", | ||
"description": "monday apps SDK for NodeJS", | ||
@@ -51,3 +51,3 @@ "main": "./dist/cjs/index.js", | ||
"@types/app-root-path": "^1.2.4", | ||
"@types/jest": "^29.5.0", | ||
"@types/jest": "^27.3.1", | ||
"@types/jsonwebtoken": "^9.0.1", | ||
@@ -66,3 +66,3 @@ "@types/node-fetch": "^2.6.4", | ||
"prettier": "^2.8.4", | ||
"ts-jest": "^27.0.5", | ||
"ts-jest": "^27.1.4", | ||
"tsc-alias": "^1.8.4", | ||
@@ -73,5 +73,5 @@ "tsconfig-paths": "^4.1.2", | ||
"dependencies": { | ||
"@google-cloud/pubsub": "^4.0.7", | ||
"@google-cloud/pubsub": "^4.4.0", | ||
"app-root-path": "^3.1.0", | ||
"google-auth-library": "^8.7.0", | ||
"google-auth-library": "^9.10.0", | ||
"http-status-codes": "^2.2.0", | ||
@@ -78,0 +78,0 @@ "jsonwebtoken": "^9.0.0", |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { PubSub } from '@google-cloud/pubsub'; | ||
import { Compute, GoogleAuth } from 'google-auth-library'; | ||
import { BadRequestError, InternalServerError } from '../errors/apps-sdk-error.js'; | ||
@@ -44,3 +45,5 @@ import { Logger } from '../utils/logger.js'; | ||
function QueueProd() { | ||
this.pubSubClient = new PubSub(); | ||
var computeClient = new Compute(); | ||
var auth = new GoogleAuth({ authClient: computeClient }); | ||
this.pubSubClient = new PubSub({ auth: auth }); | ||
} | ||
@@ -47,0 +50,0 @@ QueueProd.prototype.publishMessage = function (message, options) { |
{ | ||
"name": "@mondaycom/apps-sdk", | ||
"version": "3.0.10", | ||
"version": "3.0.11", | ||
"description": "monday apps SDK for NodeJS", | ||
@@ -51,3 +51,3 @@ "main": "./dist/cjs/index.js", | ||
"@types/app-root-path": "^1.2.4", | ||
"@types/jest": "^29.5.0", | ||
"@types/jest": "^27.3.1", | ||
"@types/jsonwebtoken": "^9.0.1", | ||
@@ -66,3 +66,3 @@ "@types/node-fetch": "^2.6.4", | ||
"prettier": "^2.8.4", | ||
"ts-jest": "^27.0.5", | ||
"ts-jest": "^27.1.4", | ||
"tsc-alias": "^1.8.4", | ||
@@ -73,5 +73,5 @@ "tsconfig-paths": "^4.1.2", | ||
"dependencies": { | ||
"@google-cloud/pubsub": "^4.0.7", | ||
"@google-cloud/pubsub": "^4.4.0", | ||
"app-root-path": "^3.1.0", | ||
"google-auth-library": "^8.7.0", | ||
"google-auth-library": "^9.10.0", | ||
"http-status-codes": "^2.2.0", | ||
@@ -78,0 +78,0 @@ "jsonwebtoken": "^9.0.0", |
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
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
298001
4076
- Removedfast-text-encoding@1.0.6(transitive)
- Removedgaxios@5.1.3(transitive)
- Removedgcp-metadata@5.3.0(transitive)
- Removedgoogle-auth-library@8.9.0(transitive)
- Removedgoogle-p12-pem@4.0.1(transitive)
- Removedgtoken@6.1.2(transitive)
- Removedlru-cache@6.0.0(transitive)
- Removednode-forge@1.3.1(transitive)
- Removedyallist@4.0.0(transitive)
Updated@google-cloud/pubsub@^4.4.0
Updatedgoogle-auth-library@^9.10.0