From a088bfa65961a5b6a3771d3344340746b22537db Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Mon, 27 May 2024 21:51:47 -0600 Subject: [PATCH] add extra info to http result --- .../outgoing_http_requests/package-lock.json | 32 +++++-------------- examples/outgoing_http_requests/test/tests.ts | 2 +- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/examples/outgoing_http_requests/package-lock.json b/examples/outgoing_http_requests/package-lock.json index c53c5cf7a7..e5aba07e01 100644 --- a/examples/outgoing_http_requests/package-lock.json +++ b/examples/outgoing_http_requests/package-lock.json @@ -11,7 +11,7 @@ "@dfinity/agent": "0.11.1", "decode-utf8": "1.0.1", "ts-node": "10.7.0", - "typescript": "4.6.3", + "typescript": "5.2.2", "utf8-encoder": "1.0.1" } }, @@ -931,18 +931,6 @@ } } }, - "node_modules/azle/node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/base-x": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", @@ -2049,15 +2037,15 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typescript": { - "version": "4.6.3", - "dev": true, - "license": "Apache-2.0", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/universalify": { @@ -2626,11 +2614,6 @@ "make-error": "^1.1.1", "yn": "3.1.1" } - }, - "typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==" } } }, @@ -3510,8 +3493,9 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "typescript": { - "version": "4.6.3", - "dev": true + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==" }, "universalify": { "version": "2.0.0", diff --git a/examples/outgoing_http_requests/test/tests.ts b/examples/outgoing_http_requests/test/tests.ts index 6330603691..a56a14f2af 100644 --- a/examples/outgoing_http_requests/test/tests.ts +++ b/examples/outgoing_http_requests/test/tests.ts @@ -34,7 +34,7 @@ function checkXkcdResult(result: HttpResponse | string): AzleResult { ? JSON.parse(result) : JSON.parse(decodeUtf8(Uint8Array.from(result.body))); const expectedJson = JSON.parse( - `{"month": "9", "num": 642, "link": "", "year": "2009", "news": "", "safe_title": "Creepy", "alt": "And I even got out my adorable new netbook!", "img": "https://imgs.xkcd.com/comics/creepy.png", "title": "Creepy", "day": "28"}` + `{"month": "9", "num": 642, "link": "", "year": "2009", "news": "", "safe_title": "Creepy", "alt": "And I even got out my adorable new netbook!", "img": "https://imgs.xkcd.com/comics/creepy.png", "title": "Creepy", "day": "28", "transcript":"[[Two people are sitting on chairs.]]\\nMan: Hey, cute netbook.\\nWoman: \\nWhat.\\n\\n\\nMan: Your laptop. I just --\\nWoman: No, why are you talking to me.\\n\\nWoman: Who do you think you are? If I were even slightly interested, I'd have shown it.\\n\\nWoman: Hey everyone, this dude's hitting on me.\\nVoice #1: Haha\\nVoice #2: Creepy\\nVoice #3: Let's get his picture for Facebook to warn others.\\n\\n((This panel fades into a thought bubble of the actual man.))\\n[[The girl is typing on her laptop.]]\\nDear blog,\\nCute boy on train still ignoring me.\\n\\n{{Title text: And I even got out my adorable new netbook!}}"}` ); return testEquality(resultJson, expectedJson);