@journeyapps/cloudcode
Advanced tools
Comparing version 0.0.0-dev.ca2c7b1 to 0.0.0-dev.cb261bb
@@ -43,3 +43,3 @@ "use strict"; | ||
processId: exports.PROCESS_ID, | ||
message: `Start process. Process trace ID: ${exports.PROCESS_ID}. Revision: ${global.CloudCode.deployInfo.description}.` | ||
message: `Start process. Process trace ID: ${exports.PROCESS_ID}. Revision: ${CloudCode.deployInfo.description}.` | ||
}); | ||
@@ -46,0 +46,0 @@ // Default Lambda uncaughtException handler does a process.exit(1), preventing us from logging the error. |
@@ -6,3 +6,2 @@ "use strict"; | ||
const event_sources_1 = require("./event_sources"); | ||
const node_fetch_1 = require("node-fetch"); | ||
const DatabaseAuth_1 = require("./DatabaseAuth"); | ||
@@ -128,3 +127,3 @@ const api_db_1 = require("./api_db"); | ||
logs_1.systemConsole.debug('Enqueue request:', payload); | ||
const response = await (0, node_fetch_1.default)(`${SCHEDULER_ENDPOINT}/api/tasks/enqueue`, { | ||
const response = await fetch(`${SCHEDULER_ENDPOINT}/api/tasks/enqueue`, { | ||
headers: { | ||
@@ -144,4 +143,4 @@ Authorization: `Token ${this.currentTaskContext.token}`, | ||
logs_1.systemConsole.debug('Enqueue response:', result); | ||
logs_1.systemConsole.info(`Enqueued '${options.task}' with trace ID '${result.trace_id}'.`); | ||
return result.trace_id; | ||
logs_1.systemConsole.info(`Enqueued '${options.task}' with trace ID '${result['trace_id']}'.`); | ||
return result['trace_id']; | ||
} | ||
@@ -148,0 +147,0 @@ } |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { Headers } from 'node-fetch'; | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { URL, URLSearchParams } from 'url'; | ||
@@ -5,0 +6,0 @@ /** |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CloudCodeRequest = void 0; | ||
const node_fetch_1 = require("node-fetch"); | ||
const url_1 = require("url"); | ||
@@ -48,3 +47,3 @@ /** | ||
url: rawRequest.url, | ||
headers: new node_fetch_1.Headers(rawRequest.headers), | ||
headers: new Headers(rawRequest.headers), | ||
body: rawRequest.body, | ||
@@ -51,0 +50,0 @@ ip: rawRequest.sourceIp |
/// <reference types="node" /> | ||
import { Headers } from 'node-fetch'; | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
export declare class CloudCodeResponse { | ||
@@ -4,0 +5,0 @@ readonly headers: Headers; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CloudCodeResponse = void 0; | ||
const node_fetch_1 = require("node-fetch"); | ||
const http_1 = require("http"); | ||
@@ -9,3 +8,3 @@ const DEBUG_MODE = process.env.DEBUG === '1'; // Currently used for tests only | ||
constructor() { | ||
this.headers = new node_fetch_1.Headers(); | ||
this.headers = new Headers(); | ||
} | ||
@@ -12,0 +11,0 @@ static notFound() { |
@@ -89,3 +89,3 @@ 'use strict'; | ||
type: rawRequest.eventSource, | ||
message: `Start '${rawRequest.eventSource}' request. Process trace ID: '${bootstrap_1.PROCESS_ID}'. Revision: '${global.CloudCode.deployInfo.description}'.` | ||
message: `Start '${rawRequest.eventSource}' request. Process trace ID: '${bootstrap_1.PROCESS_ID}'. Revision: '${CloudCode.deployInfo.description}'.` | ||
}); | ||
@@ -179,4 +179,3 @@ // TODO: Remove these non-webby bits | ||
} | ||
const response = await router.handleRequest(taskContext, request); | ||
return response; | ||
return await router.handleRequest(taskContext, request); | ||
} | ||
@@ -183,0 +182,0 @@ else if (taskContext.source == event_sources_1.default.IDP) { |
@@ -7,3 +7,2 @@ "use strict"; | ||
const db_1 = require("@journeyapps/db"); | ||
const node_fetch_1 = require("node-fetch"); | ||
const assert = require("assert"); | ||
@@ -19,5 +18,7 @@ const httpLib = require("http"); | ||
indexModule.setCloudCode(cloudcode); | ||
// @ts-ignore | ||
global.CloudCode = cloudcode; | ||
// @ts-ignore | ||
global.Day = db_1.Day; | ||
global.fetch = node_fetch_1.default; | ||
// @ts-ignore | ||
global.Attachment = db_1.Attachment; | ||
@@ -24,0 +25,0 @@ Object.defineProperty(global, 'DB', { |
import { CloudCodeEnvironment } from './CloudCodeEnvironment'; | ||
import { Day as DayConstructor, Attachment as AttachmentConstructor } from '@journeyapps/db'; | ||
import fetchModule from 'node-fetch'; | ||
declare global { | ||
namespace NodeJS { | ||
interface Global { | ||
CloudCode: CloudCodeEnvironment; | ||
Day: typeof DayConstructor; | ||
fetch: typeof fetchModule; | ||
Attachment: typeof AttachmentConstructor; | ||
} | ||
} | ||
const CloudCode: CloudCodeEnvironment; | ||
const Day: typeof DayConstructor; | ||
const fetch: typeof fetchModule; | ||
const Attachment: typeof AttachmentConstructor; | ||
@@ -17,0 +7,0 @@ type Day = DayConstructor; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.flush = exports.setLogContext = exports.createLoggers = exports.systemConsole = exports.systemStream = void 0; | ||
/* | ||
* | ||
*/ | ||
const highland = require("highland"); | ||
@@ -8,0 +5,0 @@ const node_fetch_1 = require("node-fetch"); |
{ | ||
"name": "@journeyapps/cloudcode", | ||
"version": "0.0.0-dev.ca2c7b1", | ||
"version": "0.0.0-dev.cb261bb", | ||
"main": "./dist/index", | ||
@@ -18,3 +18,3 @@ "types": "./dist/index", | ||
"@journeyapps/db": "^6.0.1", | ||
"@types/node": "^10.14.14", | ||
"@types/node": "^20.17.6", | ||
"base64url": "^3.0.1", | ||
@@ -24,5 +24,5 @@ "bs58": "^4.0.1", | ||
"highland": "^2.13.5", | ||
"lodash": "^4.17.15", | ||
"node-fetch": "^2.6.0", | ||
"source-map-support": "^0.5.13" | ||
"lodash": "^4.17.21", | ||
"node-fetch": "^3.3.2", | ||
"source-map-support": "^0.5.21" | ||
}, | ||
@@ -29,0 +29,0 @@ "devDependencies": { |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
158772
2765
9
+ Added@types/node@20.17.14(transitive)
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
- Removed@types/node@10.17.60(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
Updated@types/node@^20.17.6
Updatedlodash@^4.17.21
Updatednode-fetch@^3.3.2
Updatedsource-map-support@^0.5.21