unconventional 1.3.2 → 1.4.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.
@@ -145,6 +145,8 @@ class AbstractBaseController {
145
145
  let limit = parseInt(queryParams.limit) || this._pageLimitDefault;
146
146
  if (limit > this._pageLimitMax && !options?.limitOverride)
147
147
  limit = this._pageLimitMax;
148
+ else if (limit < 0)
149
+ limit = this._pageLimitDefault;
148
150
  // Request
149
151
  let response = await this._service.getAll({
150
152
  limit: limit,
@@ -27,7 +27,7 @@ export declare class BaseService<M extends typeof BaseModel> {
27
27
  /**
28
28
  * Gets all instances of the document
29
29
  * @param config - An object containing pagination and sorting options.
30
- * @param config.limit - The maximum number of documents to return.
30
+ * @param config.limit - The maximum number of documents to return. Default 12. Negative limits return all documents.
31
31
  * @param config.cursor - The id of the document to start the query from.
32
32
  * @param config.sort - An object containing the fields to sort by and their sort order.
33
33
  * @param config.filters - A string containing the fields to filter by and their values.
@@ -79,7 +79,7 @@ class BaseService {
79
79
  /**
80
80
  * Gets all instances of the document
81
81
  * @param config - An object containing pagination and sorting options.
82
- * @param config.limit - The maximum number of documents to return.
82
+ * @param config.limit - The maximum number of documents to return. Default 12. Negative limits return all documents.
83
83
  * @param config.cursor - The id of the document to start the query from.
84
84
  * @param config.sort - An object containing the fields to sort by and their sort order.
85
85
  * @param config.filters - A string containing the fields to filter by and their values.
@@ -92,7 +92,7 @@ class BaseService {
92
92
  page = await base_cache_1.BaseCache.getPage(cache, this.model, modifiers);
93
93
  }
94
94
  if (!page) {
95
- const limit = modifiers.limit || 12;
95
+ const limit = modifiers.limit ? (modifiers.limit > 0 ? modifiers.limit : undefined) : 12;
96
96
  page = await this.model.findMany({ limit, ...modifiers });
97
97
  if (cache) {
98
98
  await base_cache_1.BaseCache.setPage(cache, page, modifiers, cacheTTL);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unconventional",
3
- "version": "1.3.2",
3
+ "version": "1.4.1",
4
4
  "description": "A complete server built on Cloudflare Workers/Pages",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -38,7 +38,10 @@
38
38
  "docs:dev": "vitepress dev docs",
39
39
  "docs:build": "vitepress build docs",
40
40
  "docs:preview": "vitepress preview docs",
41
- "docs:serve": "vitepress serve docs"
41
+ "docs:serve": "vitepress serve docs",
42
+ "release:major": "changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags",
43
+ "release:minor": "changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags",
44
+ "release:patch": "changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags"
42
45
  },
43
46
  "peerDependencies": {
44
47
  "hono": "^4",