@feathersjs/client 5.0.0-pre.0 → 5.0.0-pre.15
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/CHANGELOG.md +229 -0
- package/README.md +2 -2
- package/dist/core.d.ts +1 -0
- package/dist/core.js +1861 -3627
- package/dist/core.js.map +1 -1
- package/dist/core.min.js +1 -1
- package/dist/feathers.d.ts +8 -0
- package/dist/feathers.js +5106 -5755
- package/dist/feathers.js.map +1 -1
- package/dist/feathers.min.js +1 -1
- package/package.json +44 -38
- package/src/core.ts +1 -0
- package/src/feathers.ts +13 -0
- package/.babelrc +0 -8
- package/.cache/lasso/default/6a3076a5/dependencyFingerprints/cache +0 -0
- package/.cache/lasso/default/6a3076a5/key +0 -1
- package/.cache/lasso/default/6a3076a5/lasso-require/inspect-/5d47a286cdceb98f64bf9128488dd355fde40e81/cache +0 -0
- package/.cache/lasso/default/7be4a25c/dependencyFingerprints/cache +0 -0
- package/.cache/lasso/default/7be4a25c/key +0 -1
- package/.cache/lasso/default/7be4a25c/lasso-require/inspect/cache +0 -0
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/filter-query.js +0 -1998
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/index.js +0 -694
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/service.js +0 -1636
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/sort.js +0 -2259
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/filter-query.js +0 -98
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/index.js +0 -37
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/service.js +0 -94
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/sort.js +0 -112
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test-run.js +0 -1
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test.js +0 -1037
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/dist/feathers.js +0 -78377
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test-run.js +0 -1
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test.js +0 -102
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/dist/feathers.js +0 -5231
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/hooks.js +0 -2626
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/index.js +0 -540
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/utils.js +0 -1991
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/hooks.js +0 -170
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/index.js +0 -17
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/utils.js +0 -102
- package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.0/lib/index.js +0 -2262
- package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.1/lib/index.js +0 -251
- package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.0/lib/client.js +0 -1506
- package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.1/lib/client.js +0 -83
- package/.mocha-puppeteer/test-page/assert$1.5.0/assert.js +0 -508
- package/.mocha-puppeteer/test-page/debug$4.1.1/src/browser.js +0 -266
- package/.mocha-puppeteer/test-page/debug$4.1.1/src/common.js +0 -268
- package/.mocha-puppeteer/test-page/feathers-memory$4.1.0/lib/index.js +0 -143
- package/.mocha-puppeteer/test-page/inherits$2.0.1/inherits_browser.js +0 -25
- package/.mocha-puppeteer/test-page/lasso-modules-client$2.0.5/src/index.js +0 -592
- package/.mocha-puppeteer/test-page/lasso-modules-meta.js +0 -28
- package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot-run.js +0 -1
- package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot.js +0 -95
- package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot-run.js +0 -1
- package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot.js +0 -95
- package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot-run.js +0 -1
- package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot.js +0 -3
- package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.css +0 -326
- package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.js +0 -16590
- package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests-run.js +0 -1
- package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests.js +0 -53
- package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup-run.js +0 -1
- package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup.js +0 -10
- package/.mocha-puppeteer/test-page/ms$2.1.2/index.js +0 -164
- package/.mocha-puppeteer/test-page/object-assign$4.1.1/index.js +0 -92
- package/.mocha-puppeteer/test-page/process$0.11.10/browser.js +0 -186
- package/.mocha-puppeteer/test-page/sift$8.5.1/lib/index.js +0 -738
- package/.mocha-puppeteer/test-page/superagent$3.8.3/superagent.js +0 -2035
- package/.mocha-puppeteer/test-page/util$0.10.3/support/isBufferBrowser.js +0 -7
- package/.mocha-puppeteer/test-page/util$0.10.3/util.js +0 -588
- package/.nyc_output/coverage.json +0 -1
- package/authentication.js +0 -1
- package/dist/authentication.js +0 -2242
- package/dist/authentication.js.map +0 -1
- package/dist/authentication.min.js +0 -1
- package/dist/rest.js +0 -3287
- package/dist/rest.js.map +0 -1
- package/dist/rest.min.js +0 -1
- package/dist/socketio.js +0 -2384
- package/dist/socketio.js.map +0 -1
- package/dist/socketio.min.js +0 -1
- package/index.d.ts +0 -23
- package/index.js +0 -1
- package/rest.js +0 -1
- package/socketio.js +0 -1
- package/webpack.config.js +0 -69
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
$_mod.def("/@feathersjs/errors$4.5.1/lib/index", function(require, exports, module, __filename, __dirname) { const debug = require('/debug$4.1.1/src/browser'/*'debug'*/)('@feathersjs/errors');
|
|
2
|
-
|
|
3
|
-
function FeathersError (msg, name, code, className, data) {
|
|
4
|
-
msg = msg || 'Error';
|
|
5
|
-
|
|
6
|
-
let errors;
|
|
7
|
-
let message;
|
|
8
|
-
let newData;
|
|
9
|
-
|
|
10
|
-
if (msg instanceof Error) {
|
|
11
|
-
message = msg.message || 'Error';
|
|
12
|
-
|
|
13
|
-
// NOTE (EK): This is typically to handle validation errors
|
|
14
|
-
if (msg.errors) {
|
|
15
|
-
errors = msg.errors;
|
|
16
|
-
}
|
|
17
|
-
} else if (typeof msg === 'object') { // Support plain old objects
|
|
18
|
-
message = msg.message || 'Error';
|
|
19
|
-
data = msg;
|
|
20
|
-
} else { // message is just a string
|
|
21
|
-
message = msg;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (data) {
|
|
25
|
-
// NOTE(EK): To make sure that we are not messing
|
|
26
|
-
// with immutable data, just make a copy.
|
|
27
|
-
// https://github.com/feathersjs/errors/issues/19
|
|
28
|
-
newData = JSON.parse(JSON.stringify(data));
|
|
29
|
-
|
|
30
|
-
if (newData.errors) {
|
|
31
|
-
errors = newData.errors;
|
|
32
|
-
delete newData.errors;
|
|
33
|
-
} else if (data.errors) {
|
|
34
|
-
// The errors property from data could be
|
|
35
|
-
// stripped away while cloning resulting newData not to have it
|
|
36
|
-
// For example: when cloning arrays this property
|
|
37
|
-
errors = JSON.parse(JSON.stringify(data.errors));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// NOTE (EK): Babel doesn't support this so
|
|
42
|
-
// we have to pass in the class name manually.
|
|
43
|
-
// this.name = this.constructor.name;
|
|
44
|
-
this.type = 'FeathersError';
|
|
45
|
-
this.name = name;
|
|
46
|
-
this.message = message;
|
|
47
|
-
this.code = code;
|
|
48
|
-
this.className = className;
|
|
49
|
-
this.data = newData;
|
|
50
|
-
this.errors = errors || {};
|
|
51
|
-
|
|
52
|
-
debug(`${this.name}(${this.code}): ${this.message}`);
|
|
53
|
-
debug(this.errors);
|
|
54
|
-
|
|
55
|
-
if (Error.captureStackTrace) {
|
|
56
|
-
Error.captureStackTrace(this, FeathersError);
|
|
57
|
-
} else {
|
|
58
|
-
this.stack = (new Error()).stack;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function inheritsFrom (Child, Parent) {
|
|
63
|
-
Child.prototype = Object.create(Parent.prototype);
|
|
64
|
-
Child.prototype.constructor = Child;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
inheritsFrom(FeathersError, Error);
|
|
68
|
-
|
|
69
|
-
// NOTE (EK): A little hack to get around `message` not
|
|
70
|
-
// being included in the default toJSON call.
|
|
71
|
-
Object.defineProperty(FeathersError.prototype, 'toJSON', {
|
|
72
|
-
value: function () {
|
|
73
|
-
return {
|
|
74
|
-
name: this.name,
|
|
75
|
-
message: this.message,
|
|
76
|
-
code: this.code,
|
|
77
|
-
className: this.className,
|
|
78
|
-
data: this.data,
|
|
79
|
-
errors: this.errors
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
// 400 - Bad Request
|
|
85
|
-
function BadRequest (message, data) {
|
|
86
|
-
FeathersError.call(this, message, 'BadRequest', 400, 'bad-request', data);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
inheritsFrom(BadRequest, FeathersError);
|
|
90
|
-
|
|
91
|
-
// 401 - Not Authenticated
|
|
92
|
-
function NotAuthenticated (message, data) {
|
|
93
|
-
FeathersError.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
inheritsFrom(NotAuthenticated, FeathersError);
|
|
97
|
-
|
|
98
|
-
// 402 - Payment Error
|
|
99
|
-
function PaymentError (message, data) {
|
|
100
|
-
FeathersError.call(this, message, 'PaymentError', 402, 'payment-error', data);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
inheritsFrom(PaymentError, FeathersError);
|
|
104
|
-
|
|
105
|
-
// 403 - Forbidden
|
|
106
|
-
function Forbidden (message, data) {
|
|
107
|
-
FeathersError.call(this, message, 'Forbidden', 403, 'forbidden', data);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
inheritsFrom(Forbidden, FeathersError);
|
|
111
|
-
|
|
112
|
-
// 404 - Not Found
|
|
113
|
-
function NotFound (message, data) {
|
|
114
|
-
FeathersError.call(this, message, 'NotFound', 404, 'not-found', data);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
inheritsFrom(NotFound, FeathersError);
|
|
118
|
-
|
|
119
|
-
// 405 - Method Not Allowed
|
|
120
|
-
function MethodNotAllowed (message, data) {
|
|
121
|
-
FeathersError.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
inheritsFrom(MethodNotAllowed, FeathersError);
|
|
125
|
-
|
|
126
|
-
// 406 - Not Acceptable
|
|
127
|
-
function NotAcceptable (message, data) {
|
|
128
|
-
FeathersError.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
inheritsFrom(NotAcceptable, FeathersError);
|
|
132
|
-
|
|
133
|
-
// 408 - Timeout
|
|
134
|
-
function Timeout (message, data) {
|
|
135
|
-
FeathersError.call(this, message, 'Timeout', 408, 'timeout', data);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
inheritsFrom(Timeout, FeathersError);
|
|
139
|
-
|
|
140
|
-
// 409 - Conflict
|
|
141
|
-
function Conflict (message, data) {
|
|
142
|
-
FeathersError.call(this, message, 'Conflict', 409, 'conflict', data);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
inheritsFrom(Conflict, FeathersError);
|
|
146
|
-
|
|
147
|
-
// 411 - Length Required
|
|
148
|
-
function LengthRequired (message, data) {
|
|
149
|
-
FeathersError.call(this, message, 'LengthRequired', 411, 'length-required', data);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
inheritsFrom(LengthRequired, FeathersError);
|
|
153
|
-
|
|
154
|
-
// 422 Unprocessable
|
|
155
|
-
function Unprocessable (message, data) {
|
|
156
|
-
FeathersError.call(this, message, 'Unprocessable', 422, 'unprocessable', data);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
inheritsFrom(Unprocessable, FeathersError);
|
|
160
|
-
|
|
161
|
-
// 429 Too Many Requests
|
|
162
|
-
function TooManyRequests (message, data) {
|
|
163
|
-
FeathersError.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
inheritsFrom(TooManyRequests, FeathersError);
|
|
167
|
-
|
|
168
|
-
// 500 - General Error
|
|
169
|
-
function GeneralError (message, data) {
|
|
170
|
-
FeathersError.call(this, message, 'GeneralError', 500, 'general-error', data);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
inheritsFrom(GeneralError, FeathersError);
|
|
174
|
-
|
|
175
|
-
// 501 - Not Implemented
|
|
176
|
-
function NotImplemented (message, data) {
|
|
177
|
-
FeathersError.call(this, message, 'NotImplemented', 501, 'not-implemented', data);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
inheritsFrom(NotImplemented, FeathersError);
|
|
181
|
-
|
|
182
|
-
// 502 - Bad Gateway
|
|
183
|
-
function BadGateway (message, data) {
|
|
184
|
-
FeathersError.call(this, message, 'BadGateway', 502, 'bad-gateway', data);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
inheritsFrom(BadGateway, FeathersError);
|
|
188
|
-
|
|
189
|
-
// 503 - Unavailable
|
|
190
|
-
function Unavailable (message, data) {
|
|
191
|
-
FeathersError.call(this, message, 'Unavailable', 503, 'unavailable', data);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
inheritsFrom(Unavailable, FeathersError);
|
|
195
|
-
|
|
196
|
-
const errors = {
|
|
197
|
-
FeathersError,
|
|
198
|
-
BadRequest,
|
|
199
|
-
NotAuthenticated,
|
|
200
|
-
PaymentError,
|
|
201
|
-
Forbidden,
|
|
202
|
-
NotFound,
|
|
203
|
-
MethodNotAllowed,
|
|
204
|
-
NotAcceptable,
|
|
205
|
-
Timeout,
|
|
206
|
-
Conflict,
|
|
207
|
-
LengthRequired,
|
|
208
|
-
Unprocessable,
|
|
209
|
-
TooManyRequests,
|
|
210
|
-
GeneralError,
|
|
211
|
-
NotImplemented,
|
|
212
|
-
BadGateway,
|
|
213
|
-
Unavailable,
|
|
214
|
-
400: BadRequest,
|
|
215
|
-
401: NotAuthenticated,
|
|
216
|
-
402: PaymentError,
|
|
217
|
-
403: Forbidden,
|
|
218
|
-
404: NotFound,
|
|
219
|
-
405: MethodNotAllowed,
|
|
220
|
-
406: NotAcceptable,
|
|
221
|
-
408: Timeout,
|
|
222
|
-
409: Conflict,
|
|
223
|
-
411: LengthRequired,
|
|
224
|
-
422: Unprocessable,
|
|
225
|
-
429: TooManyRequests,
|
|
226
|
-
500: GeneralError,
|
|
227
|
-
501: NotImplemented,
|
|
228
|
-
502: BadGateway,
|
|
229
|
-
503: Unavailable
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
function convert (error) {
|
|
233
|
-
if (!error) {
|
|
234
|
-
return error;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
const FeathersError = errors[error.name];
|
|
238
|
-
const result = FeathersError
|
|
239
|
-
? new FeathersError(error.message, error.data)
|
|
240
|
-
: new Error(error.message || error);
|
|
241
|
-
|
|
242
|
-
if (typeof error === 'object') {
|
|
243
|
-
Object.assign(result, error);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
return result;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
module.exports = Object.assign({ convert }, errors);
|
|
250
|
-
|
|
251
|
-
});
|