@tryghost/http-stream 0.1.22 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2013-2022 Ghost Foundation
3
+ Copyright (c) 2013-2023 Ghost Foundation
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -38,4 +38,4 @@ Follow the instructions for the top-level repo.
38
38
 
39
39
  # Copyright & License
40
40
 
41
- Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE).
41
+ Copyright (c) 2013-2023 Ghost Foundation - Released under the [MIT license](LICENSE).
@@ -13,14 +13,15 @@ class HttpStream {
13
13
  throw new GhostError.IncorrectUsageError({message: 'Type Error: Http transport requires log data to be an object'});
14
14
  }
15
15
 
16
- let body = {
16
+ const options = {
17
17
  ...this.config,
18
18
  method: 'POST',
19
- headers: {'Content-Type': 'application/json'},
20
- body: JSON.stringify(data)
19
+ json: data
21
20
  };
21
+ const {url} = options;
22
+ delete options.url;
22
23
 
23
- return await request(this.config.url, body);
24
+ return await request(url, options);
24
25
  } catch (error) {
25
26
  debug('Failed to ship log', error.message);
26
27
  return false;
@@ -28,4 +29,4 @@ class HttpStream {
28
29
  }
29
30
  }
30
31
 
31
- module.exports = HttpStream;
32
+ module.exports = HttpStream;
package/package.json CHANGED
@@ -1,18 +1,10 @@
1
1
  {
2
2
  "name": "@tryghost/http-stream",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "repository": "https://github.com/TryGhost/framework/tree/main/packages/http-stream",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
8
- "scripts": {
9
- "dev": "echo \"Implement me!\"",
10
- "test": "NODE_ENV=testing c8 --all --check-coverage --100 --reporter text --reporter cobertura mocha './test/**/*.test.js'",
11
- "lint:code": "eslint *.js lib/ --ext .js --cache",
12
- "lint": "yarn lint:code && yarn lint:test",
13
- "lint:test": "eslint -c test/.eslintrc.js test/ --ext .js --cache",
14
- "posttest": "yarn lint"
15
- },
16
8
  "files": [
17
9
  "index.js",
18
10
  "lib"
@@ -28,8 +20,17 @@
28
20
  "sinon": "15.0.4"
29
21
  },
30
22
  "dependencies": {
31
- "@tryghost/errors": "^1.2.25",
32
- "@tryghost/request": "^0.1.40"
23
+ "@tryghost/errors": "^1.2.26",
24
+ "@tryghost/request": "^1.0.0"
25
+ },
26
+ "gitHead": "aa6fbed5ae4dd839c4ff5d120c28d23dcfffb0f3",
27
+ "scripts": {
28
+ "dev": "echo \"Implement me!\"",
29
+ "test": "NODE_ENV=testing c8 --all --check-coverage --100 --reporter text --reporter cobertura mocha './test/**/*.test.js'",
30
+ "lint:code": "eslint *.js lib/ --ext .js --cache",
31
+ "lint": "yarn lint:code && yarn lint:test",
32
+ "lint:test": "eslint -c test/.eslintrc.js test/ --ext .js --cache",
33
+ "posttest": "yarn lint"
33
34
  },
34
- "gitHead": "4bf425a83dabe8e70ee28dffa37cf678b640068e"
35
- }
35
+ "readme": "# Http Stream\n\nA http stream to use alongside bunyan for logging\n\n## Install\n\n`npm install @tryghost/http-stream --save`\n\nor\n\n`yarn add @tryghost/http-stream`\n\n\n## Usage\n\n\n## Develop\n\nThis is a mono repository, managed with [lerna](https://lernajs.io/).\n\nFollow the instructions for the top-level repo.\n1. `git clone` this repo & `cd` into it as usual\n2. Run `yarn` to install top-level dependencies.\n\n\n## Run\n\n- `yarn dev`\n\n\n## Test\n\n- `yarn lint` run just eslint\n- `yarn test` run lint and tests\n\n\n\n\n# Copyright & License \n\nCopyright (c) 2013-2023 Ghost Foundation - Released under the [MIT license](LICENSE)."
36
+ }