@automattic/request-promise-native 1.1.0 → 2.0.0

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/README.md CHANGED
@@ -3,11 +3,9 @@ Request-Promise-Native
3
3
 
4
4
  [![Test with mocha](https://github.com/Automattic/request-promise-native/actions/workflows/test.yml/badge.svg)](https://github.com/Automattic/request-promise-native/actions/workflows/test.yml)
5
5
 
6
- # Deprecated!
6
+ # Important note
7
7
 
8
- As of Feb 11th 2020, [`request`](https://github.com/request/request) is fully deprecated. No new changes are expected to land. In fact, none have landed for some time. This package is also deprecated because it depends on `request`. We're only keeping the library's dependencies up to date.
9
-
10
- Fyi, here is the [reasoning of `request`'s deprecation](https://github.com/request/request/issues/3142) and a [list of alternative libraries](https://github.com/request/request/issues/3143).
8
+ As of Feb 11th 2020, [`request`](https://github.com/request/request) is fully deprecated. Hence, we're using [the forked version of it - `@cypress/request`](https://github.com/cypress-io/request).
11
9
 
12
10
  ---
13
11
 
@@ -48,6 +46,8 @@ If you want to debug a test you should use `gulp test-without-coverage` to run a
48
46
 
49
47
  ## Change History
50
48
 
49
+ - v1.1.0 (2025-02-95)
50
+ - Dependencies cleaned up and updated.
51
51
  - v1.0.9 (2020-07-21)
52
52
  - Security fix: bumped `request-promise-core` which bumps `lodash` to `^4.17.19` following [this advisory](https://www.npmjs.com/advisories/1523).
53
53
  - v1.0.8 (2019-11-03)
package/errors.js CHANGED
@@ -1,3 +1 @@
1
- 'use strict';
2
-
3
1
  module.exports = require('request-promise-core/errors');
@@ -0,0 +1,212 @@
1
+ import globals from 'globals';
2
+
3
+ // https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects
4
+ export default [{
5
+ plugins: {},
6
+
7
+ languageOptions: {
8
+ globals: {
9
+ ...globals.node,
10
+ ...globals.mocha, // for tests
11
+ Promise: false
12
+ },
13
+
14
+ ecmaVersion: 2020,
15
+ sourceType: 'module',
16
+
17
+ parserOptions: {
18
+ ecmaFeatures: {}
19
+ }
20
+ },
21
+
22
+ rules: {
23
+ 'no-cond-assign': 2,
24
+ 'no-console': 0,
25
+ 'no-constant-condition': 2,
26
+ 'no-control-regex': 2,
27
+ 'no-debugger': 2,
28
+ 'no-dupe-args': 2,
29
+ 'no-dupe-keys': 2,
30
+ 'no-duplicate-case': 2,
31
+
32
+ 'no-empty': [2, {
33
+ allowEmptyCatch: false
34
+ }],
35
+
36
+ 'no-empty-character-class': 2,
37
+ 'no-ex-assign': 2,
38
+ 'no-extra-boolean-cast': 2,
39
+ 'no-extra-parens': [2, 'all'],
40
+ 'no-extra-semi': 2,
41
+ 'no-func-assign': 2,
42
+ 'no-inner-declarations': [2, 'functions'],
43
+ 'no-invalid-regexp': 2,
44
+
45
+ 'no-irregular-whitespace': [2, {
46
+ skipComments: false
47
+ }],
48
+
49
+ 'no-negated-in-lhs': 2,
50
+ 'no-obj-calls': 2,
51
+ 'no-prototype-builtins': 2,
52
+ 'no-regex-spaces': 2,
53
+ 'no-sparse-arrays': 2,
54
+ 'no-unexpected-multiline': 2,
55
+ 'no-unreachable': 2,
56
+ 'no-unsafe-finally': 2,
57
+ 'use-isnan': 2,
58
+ 'valid-jsdoc': 0,
59
+ 'valid-typeof': 2,
60
+ 'accessor-pairs': 2,
61
+ curly: [2, 'multi-line'],
62
+ 'dot-location': [2, 'property'],
63
+ eqeqeq: 2,
64
+ 'no-caller': 2,
65
+ 'no-empty-pattern': 0,
66
+ 'no-eval': 2,
67
+ 'no-extend-native': 2,
68
+ 'no-extra-bind': 2,
69
+ 'no-fallthrough': 2,
70
+ 'no-floating-decimal': 2,
71
+ 'no-implied-eval': 2,
72
+ 'no-iterator': 2,
73
+ 'no-labels': 2,
74
+ 'no-lone-blocks': 2,
75
+ 'no-magic-numbers': 0,
76
+ 'no-multi-spaces': 2,
77
+ 'no-multi-str': 2,
78
+ 'no-native-reassign': 2,
79
+ 'no-new': 2,
80
+ 'no-new-func': 2,
81
+ 'no-new-wrappers': 2,
82
+ 'no-octal': 2,
83
+ 'no-octal-escape': 2,
84
+ 'no-proto': 2,
85
+ 'no-redeclare': 2,
86
+ 'no-return-assign': [2, 'except-parens'],
87
+ 'no-self-assign': 2,
88
+ 'no-self-compare': 2,
89
+ 'no-sequences': 2,
90
+ 'no-throw-literal': 2,
91
+ 'no-unmodified-loop-condition': 2,
92
+ 'no-useless-call': 2,
93
+ 'no-useless-escape': 2,
94
+ 'no-with': 2,
95
+ 'wrap-iife': [2, 'inside'],
96
+ yoda: 2,
97
+ strict: [2, 'safe'],
98
+ 'init-declarations': [2, 'always'],
99
+ 'no-catch-shadow': 0,
100
+ 'no-delete-var': 2,
101
+ 'no-label-var': 2,
102
+ 'no-restricted-globals': 0,
103
+
104
+ 'no-shadow': [2, {
105
+ builtinGlobals: false,
106
+ hoist: 'all',
107
+ allow: []
108
+ }],
109
+
110
+ 'no-shadow-restricted-names': 2,
111
+
112
+ 'no-undef': [2, {
113
+ typeof: true
114
+ }],
115
+
116
+ 'no-undef-init': 2,
117
+ 'no-undefined': 0,
118
+
119
+ 'no-unused-vars': [2, {
120
+ vars: 'local',
121
+ args: 'none',
122
+ caughtErrors: 'none'
123
+ }],
124
+
125
+ 'no-use-before-define': [2, {
126
+ functions: false,
127
+ classes: true
128
+ }],
129
+
130
+ 'callback-return': 0,
131
+ 'global-require': 0,
132
+ 'handle-callback-err': [2, '^(err|error)$'],
133
+ 'no-mixed-requires': 0,
134
+ 'no-new-require': 2,
135
+ 'no-path-concat': 2,
136
+ 'no-process-env': 2,
137
+ 'no-process-exit': 2,
138
+ 'no-restricted-modules': 0,
139
+ 'no-sync': 2,
140
+ 'block-spacing': 2,
141
+
142
+ 'brace-style': [2, '1tbs', {
143
+ allowSingleLine: true
144
+ }],
145
+
146
+ camelcase: [2, {
147
+ properties: 'never'
148
+ }],
149
+
150
+ 'comma-dangle': [2, 'never'],
151
+ 'comma-spacing': 2,
152
+ 'comma-style': 2,
153
+ 'eol-last': 2,
154
+
155
+ indent: [2, 4, {
156
+ SwitchCase: 1
157
+ }],
158
+
159
+ 'jsx-quotes': 0,
160
+ 'key-spacing': 2,
161
+ 'keyword-spacing': 2,
162
+ 'new-cap': 0,
163
+ 'new-parens': 2,
164
+ 'no-array-constructor': 2,
165
+ 'no-mixed-spaces-and-tabs': 2,
166
+
167
+ 'no-multiple-empty-lines': [2, {
168
+ max: 2,
169
+ maxBOF: 0,
170
+ maxEOF: 1
171
+ }],
172
+
173
+ 'no-new-object': 2,
174
+
175
+ 'no-plusplus': [2, {
176
+ allowForLoopAfterthoughts: false
177
+ }],
178
+
179
+ 'no-spaced-func': 2,
180
+ 'no-trailing-spaces': 2,
181
+
182
+ 'no-unneeded-ternary': [2, {
183
+ defaultAssignment: false
184
+ }],
185
+
186
+ 'no-whitespace-before-property': 2,
187
+ 'one-var': 0,
188
+
189
+ 'operator-linebreak': [2, 'after', {
190
+ overrides: {
191
+ '?': 'before',
192
+ ':': 'before'
193
+ }
194
+ }],
195
+
196
+ 'padded-blocks': 0,
197
+ quotes: [2, 'single', 'avoid-escape'],
198
+ semi: [2, 'always'],
199
+ 'semi-spacing': 2,
200
+ 'space-before-blocks': 2,
201
+
202
+ 'space-before-function-paren': [2, {
203
+ anonymous: 'always',
204
+ named: 'never'
205
+ }],
206
+
207
+ 'space-in-parens': 0,
208
+ 'space-infix-ops': 0,
209
+ 'space-unary-ops': 2,
210
+ 'spaced-comment': 0
211
+ }
212
+ }];
package/lib/rp.js CHANGED
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  var configure = require('request-promise-core/configure/request2'),
4
2
  stealthyRequire = require('stealthy-require');
5
3
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/request-promise-native",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "description": "The simplified HTTP request client 'request' with Promise support. Powered by native ES6 promises.",
5
5
  "keywords": [
6
6
  "xhr",
@@ -14,40 +14,38 @@
14
14
  ],
15
15
  "main": "./lib/rp.js",
16
16
  "scripts": {
17
- "test": "mocha test/spec"
17
+ "lint": "eslint .",
18
+ "lint:fix": "eslint --fix .",
19
+ "test": "mocha test/spec",
20
+ "check-dependencies": "npx depcheck@1.4.7"
18
21
  },
19
22
  "repository": {
20
23
  "type": "git",
21
- "url": "git+https://github.com/request/request-promise-native.git"
24
+ "url": "git+https://github.com/Automattic/request-promise-native.git"
22
25
  },
23
26
  "author": "Nicolai Kamenzky (https://github.com/analog-nico)",
24
27
  "license": "ISC",
25
28
  "bugs": {
26
- "url": "https://github.com/request/request-promise-native/issues"
29
+ "url": "https://github.com/Automattic/request-promise-native/issues"
27
30
  },
28
- "homepage": "https://github.com/request/request-promise-native#readme",
31
+ "homepage": "https://github.com/Automattic/request-promise-native#readme",
29
32
  "engines": {
30
33
  "node": ">=18.x"
31
34
  },
32
35
  "dependencies": {
33
- "request": "^2.88.2",
36
+ "request": "npm:@cypress/request@^3.0.7",
34
37
  "request-promise-core": "1.1.4",
35
- "stealthy-require": "^1.1.1",
36
- "tough-cookie": "^5.1.0"
38
+ "stealthy-require": "^1.1.1"
37
39
  },
38
40
  "overrides": {
39
- "request": {
40
- "tough-cookie": "^5.1.0",
41
- "uuid": "^7.0.0"
41
+ "request-promise-core": {
42
+ "request": "npm:@cypress/request@^3.0.7"
42
43
  }
43
44
  },
44
45
  "devDependencies": {
45
46
  "body-parser": "~1.20.3",
46
47
  "chai": "^4.5.0",
47
- "chalk": "~5.4.1",
48
- "lodash": "~4.17.21",
49
- "mocha": "^11.1.0",
50
- "rimraf": "~6.0.1",
51
- "run-sequence": "~2.2.1"
48
+ "eslint": "^9.19.0",
49
+ "mocha": "^11.1.0"
52
50
  }
53
51
  }
@@ -1,8 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: "npm"
4
- directory: "/"
5
- schedule:
6
- interval: "daily"
7
- open-pull-requests-limit: 15
8
-
@@ -1,23 +0,0 @@
1
- # This workflow will publish this package to npm on each release created.
2
- # NPM_TOKEN secret needs to be created via https://www.npmjs.com/settings/a8c/tokens/ (choose automation token) and stored in this repository.
3
- #
4
- # See https://docs.github.com/en/actions/guides/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
5
-
6
- name: Publish to npm
7
-
8
- on:
9
- release:
10
- types: [created]
11
-
12
- jobs:
13
- publish-npm:
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: actions/checkout@v4
17
- - uses: actions/setup-node@v4
18
- with:
19
- node-version: "latest"
20
- registry-url: https://registry.npmjs.org/
21
- - run: npm publish --access public
22
- env:
23
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
@@ -1,30 +0,0 @@
1
- name: Test with mocha
2
-
3
- on:
4
- push:
5
- branches: [ "master" ]
6
- pull_request:
7
- branches: [ "master" ]
8
-
9
- jobs:
10
- test:
11
- runs-on: ubuntu-latest
12
-
13
- strategy:
14
- matrix:
15
- # https://nodejs.org/en/about/previous-releases#release-schedule
16
- # https://github.com/actions/setup-node?tab=readme-ov-file#supported-version-syntax
17
- node-version: [18.x, 20.x, 22.x, 23.x]
18
-
19
- steps:
20
- - uses: actions/checkout@v4
21
-
22
- - name: Use Node.js ${{ matrix.node-version }}
23
- uses: actions/setup-node@v4
24
- with:
25
- node-version: ${{ matrix.node-version }}
26
-
27
- - name: Build and test
28
- run: |
29
- npm ci
30
- npm t