@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.
Files changed (86) hide show
  1. package/CHANGELOG.md +229 -0
  2. package/README.md +2 -2
  3. package/dist/core.d.ts +1 -0
  4. package/dist/core.js +1861 -3627
  5. package/dist/core.js.map +1 -1
  6. package/dist/core.min.js +1 -1
  7. package/dist/feathers.d.ts +8 -0
  8. package/dist/feathers.js +5106 -5755
  9. package/dist/feathers.js.map +1 -1
  10. package/dist/feathers.min.js +1 -1
  11. package/package.json +44 -38
  12. package/src/core.ts +1 -0
  13. package/src/feathers.ts +13 -0
  14. package/.babelrc +0 -8
  15. package/.cache/lasso/default/6a3076a5/dependencyFingerprints/cache +0 -0
  16. package/.cache/lasso/default/6a3076a5/key +0 -1
  17. package/.cache/lasso/default/6a3076a5/lasso-require/inspect-/5d47a286cdceb98f64bf9128488dd355fde40e81/cache +0 -0
  18. package/.cache/lasso/default/7be4a25c/dependencyFingerprints/cache +0 -0
  19. package/.cache/lasso/default/7be4a25c/key +0 -1
  20. package/.cache/lasso/default/7be4a25c/lasso-require/inspect/cache +0 -0
  21. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/filter-query.js +0 -1998
  22. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/index.js +0 -694
  23. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/service.js +0 -1636
  24. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/sort.js +0 -2259
  25. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/filter-query.js +0 -98
  26. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/index.js +0 -37
  27. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/service.js +0 -94
  28. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/sort.js +0 -112
  29. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test-run.js +0 -1
  30. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test.js +0 -1037
  31. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/dist/feathers.js +0 -78377
  32. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test-run.js +0 -1
  33. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test.js +0 -102
  34. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/dist/feathers.js +0 -5231
  35. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/hooks.js +0 -2626
  36. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/index.js +0 -540
  37. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/utils.js +0 -1991
  38. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/hooks.js +0 -170
  39. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/index.js +0 -17
  40. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/utils.js +0 -102
  41. package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.0/lib/index.js +0 -2262
  42. package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.1/lib/index.js +0 -251
  43. package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.0/lib/client.js +0 -1506
  44. package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.1/lib/client.js +0 -83
  45. package/.mocha-puppeteer/test-page/assert$1.5.0/assert.js +0 -508
  46. package/.mocha-puppeteer/test-page/debug$4.1.1/src/browser.js +0 -266
  47. package/.mocha-puppeteer/test-page/debug$4.1.1/src/common.js +0 -268
  48. package/.mocha-puppeteer/test-page/feathers-memory$4.1.0/lib/index.js +0 -143
  49. package/.mocha-puppeteer/test-page/inherits$2.0.1/inherits_browser.js +0 -25
  50. package/.mocha-puppeteer/test-page/lasso-modules-client$2.0.5/src/index.js +0 -592
  51. package/.mocha-puppeteer/test-page/lasso-modules-meta.js +0 -28
  52. package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot-run.js +0 -1
  53. package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot.js +0 -95
  54. package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot-run.js +0 -1
  55. package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot.js +0 -95
  56. package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot-run.js +0 -1
  57. package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot.js +0 -3
  58. package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.css +0 -326
  59. package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.js +0 -16590
  60. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests-run.js +0 -1
  61. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests.js +0 -53
  62. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup-run.js +0 -1
  63. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup.js +0 -10
  64. package/.mocha-puppeteer/test-page/ms$2.1.2/index.js +0 -164
  65. package/.mocha-puppeteer/test-page/object-assign$4.1.1/index.js +0 -92
  66. package/.mocha-puppeteer/test-page/process$0.11.10/browser.js +0 -186
  67. package/.mocha-puppeteer/test-page/sift$8.5.1/lib/index.js +0 -738
  68. package/.mocha-puppeteer/test-page/superagent$3.8.3/superagent.js +0 -2035
  69. package/.mocha-puppeteer/test-page/util$0.10.3/support/isBufferBrowser.js +0 -7
  70. package/.mocha-puppeteer/test-page/util$0.10.3/util.js +0 -588
  71. package/.nyc_output/coverage.json +0 -1
  72. package/authentication.js +0 -1
  73. package/dist/authentication.js +0 -2242
  74. package/dist/authentication.js.map +0 -1
  75. package/dist/authentication.min.js +0 -1
  76. package/dist/rest.js +0 -3287
  77. package/dist/rest.js.map +0 -1
  78. package/dist/rest.min.js +0 -1
  79. package/dist/socketio.js +0 -2384
  80. package/dist/socketio.js.map +0 -1
  81. package/dist/socketio.min.js +0 -1
  82. package/index.d.ts +0 -23
  83. package/index.js +0 -1
  84. package/rest.js +0 -1
  85. package/socketio.js +0 -1
  86. package/webpack.config.js +0 -69
@@ -1,170 +0,0 @@
1
- $_mod.def("/@feathersjs/commons$4.5.1/lib/hooks", function(require, exports, module, __filename, __dirname) { "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require('/@feathersjs/commons$4.5.1/lib/utils'/*"./utils"*/);
4
- const { each, pick } = utils_1._;
5
- exports.ACTIVATE_HOOKS = utils_1.createSymbol('__feathersActivateHooks');
6
- function createHookObject(method, data = {}) {
7
- const hook = {};
8
- Object.defineProperty(hook, 'toJSON', {
9
- value() {
10
- return pick(this, 'type', 'method', 'path', 'params', 'id', 'data', 'result', 'error');
11
- }
12
- });
13
- return Object.assign(hook, data, {
14
- method,
15
- // A dynamic getter that returns the path of the service
16
- get path() {
17
- const { app, service } = data;
18
- if (!service || !app || !app.services) {
19
- return null;
20
- }
21
- return Object.keys(app.services)
22
- .find(path => app.services[path] === service);
23
- }
24
- });
25
- }
26
- exports.createHookObject = createHookObject;
27
- // Fallback used by `makeArguments` which usually won't be used
28
- function defaultMakeArguments(hook) {
29
- const result = [];
30
- if (typeof hook.id !== 'undefined') {
31
- result.push(hook.id);
32
- }
33
- if (hook.data) {
34
- result.push(hook.data);
35
- }
36
- result.push(hook.params || {});
37
- return result;
38
- }
39
- exports.defaultMakeArguments = defaultMakeArguments;
40
- // Turns a hook object back into a list of arguments
41
- // to call a service method with
42
- function makeArguments(hook) {
43
- switch (hook.method) {
44
- case 'find':
45
- return [hook.params];
46
- case 'get':
47
- case 'remove':
48
- return [hook.id, hook.params];
49
- case 'update':
50
- case 'patch':
51
- return [hook.id, hook.data, hook.params];
52
- case 'create':
53
- return [hook.data, hook.params];
54
- }
55
- return defaultMakeArguments(hook);
56
- }
57
- exports.makeArguments = makeArguments;
58
- // Converts different hook registration formats into the
59
- // same internal format
60
- function convertHookData(obj) {
61
- let hook = {};
62
- if (Array.isArray(obj)) {
63
- hook = { all: obj };
64
- }
65
- else if (typeof obj !== 'object') {
66
- hook = { all: [obj] };
67
- }
68
- else {
69
- each(obj, function (value, key) {
70
- hook[key] = !Array.isArray(value) ? [value] : value;
71
- });
72
- }
73
- return hook;
74
- }
75
- exports.convertHookData = convertHookData;
76
- // Duck-checks a given object to be a hook object
77
- // A valid hook object has `type` and `method`
78
- function isHookObject(hookObject) {
79
- return typeof hookObject === 'object' &&
80
- typeof hookObject.method === 'string' &&
81
- typeof hookObject.type === 'string';
82
- }
83
- exports.isHookObject = isHookObject;
84
- // Returns all service and application hooks combined
85
- // for a given method and type `appLast` sets if the hooks
86
- // from `app` should be added last (or first by default)
87
- function getHooks(app, service, type, method, appLast = false) {
88
- const appHooks = app.__hooks[type][method] || [];
89
- const serviceHooks = service.__hooks[type][method] || [];
90
- if (appLast) {
91
- // Run hooks in the order of service -> app -> finally
92
- return serviceHooks.concat(appHooks);
93
- }
94
- return appHooks.concat(serviceHooks);
95
- }
96
- exports.getHooks = getHooks;
97
- function processHooks(hooks, initialHookObject) {
98
- let hookObject = initialHookObject;
99
- const updateCurrentHook = (current) => {
100
- // Either use the returned hook object or the current
101
- // hook object from the chain if the hook returned undefined
102
- if (current) {
103
- if (!isHookObject(current)) {
104
- throw new Error(`${hookObject.type} hook for '${hookObject.method}' method returned invalid hook object`);
105
- }
106
- hookObject = current;
107
- }
108
- return hookObject;
109
- };
110
- // Go through all hooks and chain them into our promise
111
- const promise = hooks.reduce((current, fn) => {
112
- // @ts-ignore
113
- const hook = fn.bind(this);
114
- // Use the returned hook object or the old one
115
- return current.then((currentHook) => hook(currentHook)).then(updateCurrentHook);
116
- }, Promise.resolve(hookObject));
117
- return promise.then(() => hookObject).catch(error => {
118
- // Add the hook information to any errors
119
- error.hook = hookObject;
120
- throw error;
121
- });
122
- }
123
- exports.processHooks = processHooks;
124
- // Add `.hooks` functionality to an object
125
- function enableHooks(obj, methods, types) {
126
- if (typeof obj.hooks === 'function') {
127
- return obj;
128
- }
129
- const hookData = {};
130
- types.forEach(type => {
131
- // Initialize properties where hook functions are stored
132
- hookData[type] = {};
133
- });
134
- // Add non-enumerable `__hooks` property to the object
135
- Object.defineProperty(obj, '__hooks', {
136
- configurable: true,
137
- value: hookData,
138
- writable: true
139
- });
140
- return Object.assign(obj, {
141
- hooks(allHooks) {
142
- each(allHooks, (current, type) => {
143
- // @ts-ignore
144
- if (!this.__hooks[type]) {
145
- throw new Error(`'${type}' is not a valid hook type`);
146
- }
147
- const hooks = convertHookData(current);
148
- each(hooks, (_value, method) => {
149
- if (method !== 'all' && methods.indexOf(method) === -1) {
150
- throw new Error(`'${method}' is not a valid hook method`);
151
- }
152
- });
153
- methods.forEach(method => {
154
- // @ts-ignore
155
- const myHooks = this.__hooks[type][method] || (this.__hooks[type][method] = []);
156
- if (hooks.all) {
157
- myHooks.push.apply(myHooks, hooks.all);
158
- }
159
- if (hooks[method]) {
160
- myHooks.push.apply(myHooks, hooks[method]);
161
- }
162
- });
163
- });
164
- return this;
165
- }
166
- });
167
- }
168
- exports.enableHooks = enableHooks;
169
- //# sourceMappingURL=hooks.js.map
170
- });
@@ -1,17 +0,0 @@
1
- $_mod.def("/@feathersjs/commons$4.5.1/lib/index", function(require, exports, module, __filename, __dirname) { "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
5
- var __importStar = (this && this.__importStar) || function (mod) {
6
- if (mod && mod.__esModule) return mod;
7
- var result = {};
8
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
9
- result["default"] = mod;
10
- return result;
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- const hookUtils = __importStar(require('/@feathersjs/commons$4.5.1/lib/hooks'/*"./hooks"*/));
14
- __export(require('/@feathersjs/commons$4.5.1/lib/utils'/*"./utils"*/));
15
- exports.hooks = hookUtils;
16
- //# sourceMappingURL=index.js.map
17
- });
@@ -1,102 +0,0 @@
1
- $_mod.def("/@feathersjs/commons$4.5.1/lib/utils", function(require, exports, module, __filename, __dirname) { "use strict";var process=require("process");
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // Removes all leading and trailing slashes from a path
4
- function stripSlashes(name) {
5
- return name.replace(/^(\/+)|(\/+)$/g, '');
6
- }
7
- exports.stripSlashes = stripSlashes;
8
- // A set of lodash-y utility functions that use ES6
9
- exports._ = {
10
- each(obj, callback) {
11
- if (obj && typeof obj.forEach === 'function') {
12
- obj.forEach(callback);
13
- }
14
- else if (exports._.isObject(obj)) {
15
- Object.keys(obj).forEach(key => callback(obj[key], key));
16
- }
17
- },
18
- some(value, callback) {
19
- return Object.keys(value)
20
- .map(key => [value[key], key])
21
- .some(([val, key]) => callback(val, key));
22
- },
23
- every(value, callback) {
24
- return Object.keys(value)
25
- .map(key => [value[key], key])
26
- .every(([val, key]) => callback(val, key));
27
- },
28
- keys(obj) {
29
- return Object.keys(obj);
30
- },
31
- values(obj) {
32
- return exports._.keys(obj).map(key => obj[key]);
33
- },
34
- isMatch(obj, item) {
35
- return exports._.keys(item).every(key => obj[key] === item[key]);
36
- },
37
- isEmpty(obj) {
38
- return exports._.keys(obj).length === 0;
39
- },
40
- isObject(item) {
41
- return (typeof item === 'object' && !Array.isArray(item) && item !== null);
42
- },
43
- isObjectOrArray(value) {
44
- return typeof value === 'object' && value !== null;
45
- },
46
- extend(first, ...rest) {
47
- return Object.assign(first, ...rest);
48
- },
49
- omit(obj, ...keys) {
50
- const result = exports._.extend({}, obj);
51
- keys.forEach(key => delete result[key]);
52
- return result;
53
- },
54
- pick(source, ...keys) {
55
- return keys.reduce((result, key) => {
56
- if (source[key] !== undefined) {
57
- result[key] = source[key];
58
- }
59
- return result;
60
- }, {});
61
- },
62
- // Recursively merge the source object into the target object
63
- merge(target, source) {
64
- if (exports._.isObject(target) && exports._.isObject(source)) {
65
- Object.keys(source).forEach(key => {
66
- if (exports._.isObject(source[key])) {
67
- if (!target[key]) {
68
- Object.assign(target, { [key]: {} });
69
- }
70
- exports._.merge(target[key], source[key]);
71
- }
72
- else {
73
- Object.assign(target, { [key]: source[key] });
74
- }
75
- });
76
- }
77
- return target;
78
- }
79
- };
80
- // Duck-checks if an object looks like a promise
81
- function isPromise(result) {
82
- return exports._.isObject(result) &&
83
- typeof result.then === 'function';
84
- }
85
- exports.isPromise = isPromise;
86
- function makeUrl(path, app = {}) {
87
- const get = typeof app.get === 'function' ? app.get.bind(app) : () => { };
88
- const env = get('env') || process.env.NODE_ENV;
89
- const host = get('host') || process.env.HOST_NAME || 'localhost';
90
- const protocol = (env === 'development' || env === 'test' || (env === undefined)) ? 'http' : 'https';
91
- const PORT = get('port') || process.env.PORT || 3030;
92
- const port = (env === 'development' || env === 'test' || (env === undefined)) ? `:${PORT}` : '';
93
- path = path || '';
94
- return `${protocol}://${host}${port}/${exports.stripSlashes(path)}`;
95
- }
96
- exports.makeUrl = makeUrl;
97
- function createSymbol(name) {
98
- return typeof Symbol !== 'undefined' ? Symbol(name) : name;
99
- }
100
- exports.createSymbol = createSymbol;
101
- //# sourceMappingURL=utils.js.map
102
- });