Skip to content

Commit

Permalink
Add build files and add node-fetch library rather than the default
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipperalez committed May 13, 2024
1 parent 376fd87 commit a160e0f
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lib/hub/action_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,19 @@ class ActionRequest {
})
.on("finish", () => {
winston.info(`[stream] PassThrough stream finished`, this.logInfo);
resolve();
})
.on("close", () => {
winston.info(`[stream] PassThrough stream closed`, this.logInfo);
resolve();
});
}
else {
const responseText = `There was a problem in the streaming callback Error Code: ${response.status}`;
const responseText = `[stream] There was a problem in the callback HTTPS Status Code: ${response.status}`;
winston.warn(responseText, this.logInfo);
reject(responseText);
}
}).catch((err) => {
const responseText = `There was a problem in the fetch request Error Code: ${err.toString()}`;
const responseText = `[stream] There was a problem in the fetch request: ${err.toString()}`;
winston.warn(responseText, this.logInfo);
reject(responseText);
});
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@types/express": "^4.17.17",
"@types/jsforce": "^1.9.33",
"@types/node": "^18.11.11",
"@types/node-fetch": "^2.6.11",
"@types/node-fetch": "^3.0.3",
"@types/nodemailer": "^4.6.8",
"@types/normalize-url": "3.3.0",
"@types/oboe": "^2.0.29",
Expand Down Expand Up @@ -81,6 +81,7 @@
"node-marketo-rest": "^0.7.8",
"nodemailer": "^6.6.1",
"nodemon": "^1.19.4",
"node-fetch": "^3.3.2",
"normalize-url": "4.0.0",
"oboe": "^2.1.5",
"queue": "^4.5.1",
Expand Down
6 changes: 3 additions & 3 deletions src/hub/action_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,18 @@ export class ActionRequest {
})
.on("finish", () => {
winston.info(`[stream] PassThrough stream finished`, this.logInfo)
resolve()
})
.on("close", () => {
winston.info(`[stream] PassThrough stream closed`, this.logInfo)
resolve()
})
} else {
const responseText = `There was a problem in the streaming callback Error Code: ${response.status}`
const responseText = `[stream] There was a problem in the callback HTTPS Status Code: ${response.status}`
winston.warn(responseText, this.logInfo)
reject(responseText)
}
}).catch((err: any) => {
const responseText = `There was a problem in the fetch request Error Code: ${err.toString()}`
const responseText = `[stream] There was a problem in the fetch request: ${err.toString()}`
winston.warn(responseText, this.logInfo)
reject(responseText)
})
Expand Down
50 changes: 44 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,12 @@
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.3.tgz#bbeb55fbc73f28ea6de601fbfa4613f58d785323"
integrity sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==

"@types/node-fetch@^2.6.11":
version "2.6.11"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24"
integrity sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==
"@types/node-fetch@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-3.0.3.tgz#9d969c9a748e841554a40ee435d26e53fa3ee899"
integrity sha512-HhggYPH5N+AQe/OmN6fmhKmRRt2XuNJow+R3pQwJxOOF9GuwM7O2mheyGeIrs5MOIeNjDEdgdoyHBOrFeJBR3g==
dependencies:
"@types/node" "*"
form-data "^4.0.0"
node-fetch "*"

"@types/node@*":
version "17.0.10"
Expand Down Expand Up @@ -2040,6 +2039,11 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"

data-uri-to-buffer@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e"
integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==

datauri@^1.0.5:
version "1.1.0"
resolved "https://registry.yarnpkg.com/datauri/-/datauri-1.1.0.tgz#c6184ff6b928ede4e41ccc23ab954c7839c4fb39"
Expand Down Expand Up @@ -2681,6 +2685,14 @@ fecha@^4.2.0:
resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.2.tgz#902c69d332b93c69be48992b9a11e41d36c03581"
integrity sha512-5rOQWkBVz3FnYWTi/ELZmq4CoK1Pb+xKNZWuJRsOwo0+8DrP43CrWJtyLVvb5U7z7ggE5llahfDbLjaVNzXVJQ==

fetch-blob@^3.1.2, fetch-blob@^3.1.4:
version "3.2.0"
resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9"
integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==
dependencies:
node-domexception "^1.0.0"
web-streams-polyfill "^3.0.3"

file-uri-to-path@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
Expand Down Expand Up @@ -2851,6 +2863,13 @@ form-data@~2.3.2:
combined-stream "^1.0.6"
mime-types "^2.1.12"

formdata-polyfill@^4.0.10:
version "4.0.10"
resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423"
integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==
dependencies:
fetch-blob "^3.1.2"

formidable@^1.2.2, formidable@^3.2.4:
version "3.2.4"
resolved "https://registry.yarnpkg.com/formidable/-/formidable-3.2.4.tgz#c0019368718de33ecb637c66d03b6342a677893a"
Expand Down Expand Up @@ -4805,6 +4824,20 @@ nise@^1.3.3:
lolex "^5.0.1"
path-to-regexp "^1.7.0"

node-domexception@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5"
integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==

node-fetch@*, node-fetch@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b"
integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==
dependencies:
data-uri-to-buffer "^4.0.0"
fetch-blob "^3.1.4"
formdata-polyfill "^4.0.10"

node-fetch@^2.6.1, node-fetch@^2.6.7:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
Expand Down Expand Up @@ -6981,6 +7014,11 @@ weak-map@^1.0.5:
resolved "https://registry.yarnpkg.com/weak-map/-/weak-map-1.0.8.tgz#394c18a9e8262e790544ed8b55c6a4ddad1cb1a3"
integrity sha512-lNR9aAefbGPpHO7AEnY0hCFjz1eTkWCXYvkTRrTHs9qv8zJp+SkVYpzfLIFXQQiG3tVvbNFQgVg2bQS8YGgxyw==

web-streams-polyfill@^3.0.3:
version "3.3.3"
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b"
integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
Expand Down

0 comments on commit a160e0f

Please sign in to comment.