@feathersjs/feathers 5.0.0 → 5.0.1

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 CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **core:** Add PaginationParams to general find method ([#3095](https://github.com/feathersjs/feathers/issues/3095)) ([8ebdcf5](https://github.com/feathersjs/feathers/commit/8ebdcf5107fae5fa23920390052b871033de3a0a))
11
+
6
12
  # [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24)
7
13
 
8
14
  **Note:** Version bump only for package @feathersjs/feathers
@@ -53,7 +53,9 @@ export interface ClientService<Result = any, Data = Partial<Result>, PatchData =
53
53
  remove(id: null, params?: P): Promise<Result[]>;
54
54
  }
55
55
  export interface ServiceMethods<Result = any, Data = Partial<Result>, ServiceParams = Params, PatchData = Partial<Data>> {
56
- find(params?: ServiceParams): Promise<Result | Result[]>;
56
+ find(params?: ServiceParams & {
57
+ paginate?: PaginationParams;
58
+ }): Promise<Result | Result[]>;
57
59
  get(id: Id, params?: ServiceParams): Promise<Result>;
58
60
  create(data: Data, params?: ServiceParams): Promise<Result>;
59
61
  update(id: NullableId, data: Data, params?: ServiceParams): Promise<Result | Result[]>;
@@ -85,7 +87,9 @@ export interface ServiceAddons<A = Application, S = Service> extends EventEmitte
85
87
  hooks(options: HookOptions<A, S>): this;
86
88
  }
87
89
  export interface ServiceHookOverloads<S, P = Params> {
88
- find(params: P, context: HookContext): Promise<HookContext>;
90
+ find(params: P & {
91
+ paginate?: PaginationParams;
92
+ }, context: HookContext): Promise<HookContext>;
89
93
  get(id: Id, params: P, context: HookContext): Promise<HookContext>;
90
94
  create(data: ServiceGenericData<S> | ServiceGenericData<S>[], params: P, context: HookContext): Promise<HookContext>;
91
95
  update(id: NullableId, data: ServiceGenericData<S>, params: P, context: HookContext): Promise<HookContext>;
@@ -234,6 +238,11 @@ export interface Params<Q = Query> {
234
238
  [key: string]: any;
235
239
  };
236
240
  }
241
+ export interface PaginationOptions {
242
+ default?: number;
243
+ max?: number;
244
+ }
245
+ export type PaginationParams = false | PaginationOptions;
237
246
  export interface Http {
238
247
  /**
239
248
  * A writeable, optional property with status code override.
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "5.0.0";
1
+ declare const _default: "5.0.1";
2
2
  export default _default;
package/lib/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '5.0.0';
3
+ exports.default = '5.0.1';
4
4
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@feathersjs/feathers",
3
3
  "description": "A framework for real-time applications and REST API with JavaScript and TypeScript",
4
- "version": "5.0.0",
4
+ "version": "5.0.1",
5
5
  "homepage": "http://feathersjs.com",
6
6
  "repository": {
7
7
  "type": "git",
@@ -58,17 +58,17 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "@feathersjs/commons": "^5.0.0",
61
+ "@feathersjs/commons": "^5.0.1",
62
62
  "@feathersjs/hooks": "^0.8.1",
63
63
  "events": "^3.3.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/mocha": "^10.0.1",
67
- "@types/node": "^18.14.1",
67
+ "@types/node": "^18.14.6",
68
68
  "mocha": "^10.2.0",
69
69
  "shx": "^0.3.4",
70
70
  "ts-node": "^10.9.1",
71
71
  "typescript": "^4.9.5"
72
72
  },
73
- "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5"
73
+ "gitHead": "18b7f4ab0a8075572a81d78956ba1205a9795c91"
74
74
  }
@@ -72,7 +72,7 @@ export interface ServiceMethods<
72
72
  ServiceParams = Params,
73
73
  PatchData = Partial<Data>
74
74
  > {
75
- find(params?: ServiceParams): Promise<Result | Result[]>
75
+ find(params?: ServiceParams & { paginate?: PaginationParams }): Promise<Result | Result[]>
76
76
 
77
77
  get(id: Id, params?: ServiceParams): Promise<Result>
78
78
 
@@ -137,7 +137,7 @@ export interface ServiceAddons<A = Application, S = Service> extends EventEmitte
137
137
  }
138
138
 
139
139
  export interface ServiceHookOverloads<S, P = Params> {
140
- find(params: P, context: HookContext): Promise<HookContext>
140
+ find(params: P & { paginate?: PaginationParams }, context: HookContext): Promise<HookContext>
141
141
 
142
142
  get(id: Id, params: P, context: HookContext): Promise<HookContext>
143
143
 
@@ -331,6 +331,13 @@ export interface Params<Q = Query> {
331
331
  headers?: { [key: string]: any }
332
332
  }
333
333
 
334
+ export interface PaginationOptions {
335
+ default?: number
336
+ max?: number
337
+ }
338
+
339
+ export type PaginationParams = false | PaginationOptions
340
+
334
341
  export interface Http {
335
342
  /**
336
343
  * A writeable, optional property with status code override.
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export default '5.0.0'
1
+ export default '5.0.1'