@modular-rest/server 1.12.0 → 1.12.2
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 +2 -2
- package/dist/config.d.ts +6 -3
- package/package.json +1 -1
- package/src/config.ts +6 -3
- package/typedoc.mjs +4 -4
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript version of a Node.js module based on Koa.js for developing REST APIs in a modular solution.
|
|
4
4
|
|
|
5
|
-
## Version
|
|
5
|
+
## Version 1.12 Breaking Changes
|
|
6
6
|
|
|
7
|
-
The
|
|
7
|
+
The 1.12 release includes several breaking changes:
|
|
8
8
|
|
|
9
9
|
- Complete rewrite in TypeScript with full type safety and improved IDE support
|
|
10
10
|
- Auto-generated API documentation using TypeDoc
|
package/dist/config.d.ts
CHANGED
|
@@ -3,8 +3,11 @@ import { CollectionDefinition } from './class/collection_definition';
|
|
|
3
3
|
import { PermissionGroup } from './class/security';
|
|
4
4
|
import { CmsTrigger } from './class/cms_trigger';
|
|
5
5
|
import { DefinedFunction } from './services/functions/service';
|
|
6
|
-
import
|
|
6
|
+
import { Options as KoaCorsOptions } from '@koa/cors';
|
|
7
7
|
import { Options as KoaStaticOptionsBase } from 'koa-static';
|
|
8
|
+
/**
|
|
9
|
+
* The options for the static file server, it's a combination of modular-rest and [koa-static options](https://github.com/koajs/static?tab=readme-ov-file#options)
|
|
10
|
+
*/
|
|
8
11
|
export interface StaticPathOptions extends KoaStaticOptionsBase {
|
|
9
12
|
/**
|
|
10
13
|
* The actual path of the static files on your server
|
|
@@ -50,7 +53,7 @@ interface AdminUser {
|
|
|
50
53
|
/**
|
|
51
54
|
* Configuration options for creating a REST API instance
|
|
52
55
|
* @interface RestOptions
|
|
53
|
-
* @property {
|
|
56
|
+
* @property {KoaCorsOptions} [cors] - CORS configuration [options](https://github.com/koajs/cors?tab=readme-ov-file#corsoptions)
|
|
54
57
|
* @property {string} [modulesPath] - Path to custom modules directory
|
|
55
58
|
* @property {string} [uploadDirectory] - Directory for file uploads
|
|
56
59
|
* @property {any} [koaBodyOptions] - Options for koa-body middleware
|
|
@@ -70,7 +73,7 @@ interface AdminUser {
|
|
|
70
73
|
* @property {DefinedFunction[]} [functions] - Custom API functions
|
|
71
74
|
*/
|
|
72
75
|
export interface RestOptions {
|
|
73
|
-
cors?:
|
|
76
|
+
cors?: KoaCorsOptions;
|
|
74
77
|
modulesPath?: string;
|
|
75
78
|
uploadDirectory?: string;
|
|
76
79
|
koaBodyOptions?: any;
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -4,9 +4,12 @@ import { CollectionDefinition } from './class/collection_definition';
|
|
|
4
4
|
import { PermissionGroup } from './class/security';
|
|
5
5
|
import { CmsTrigger } from './class/cms_trigger';
|
|
6
6
|
import { DefinedFunction } from './services/functions/service';
|
|
7
|
-
import
|
|
7
|
+
import { Options as KoaCorsOptions } from '@koa/cors';
|
|
8
8
|
import { Options as KoaStaticOptionsBase } from 'koa-static';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* The options for the static file server, it's a combination of modular-rest and [koa-static options](https://github.com/koajs/static?tab=readme-ov-file#options)
|
|
12
|
+
*/
|
|
10
13
|
export interface StaticPathOptions extends KoaStaticOptionsBase {
|
|
11
14
|
/**
|
|
12
15
|
* The actual path of the static files on your server
|
|
@@ -56,7 +59,7 @@ interface AdminUser {
|
|
|
56
59
|
/**
|
|
57
60
|
* Configuration options for creating a REST API instance
|
|
58
61
|
* @interface RestOptions
|
|
59
|
-
* @property {
|
|
62
|
+
* @property {KoaCorsOptions} [cors] - CORS configuration [options](https://github.com/koajs/cors?tab=readme-ov-file#corsoptions)
|
|
60
63
|
* @property {string} [modulesPath] - Path to custom modules directory
|
|
61
64
|
* @property {string} [uploadDirectory] - Directory for file uploads
|
|
62
65
|
* @property {any} [koaBodyOptions] - Options for koa-body middleware
|
|
@@ -76,7 +79,7 @@ interface AdminUser {
|
|
|
76
79
|
* @property {DefinedFunction[]} [functions] - Custom API functions
|
|
77
80
|
*/
|
|
78
81
|
export interface RestOptions {
|
|
79
|
-
cors?:
|
|
82
|
+
cors?: KoaCorsOptions;
|
|
80
83
|
modulesPath?: string;
|
|
81
84
|
uploadDirectory?: string;
|
|
82
85
|
koaBodyOptions?: any;
|
package/typedoc.mjs
CHANGED
|
@@ -2,10 +2,10 @@ export default {
|
|
|
2
2
|
plugin: ['typedoc-plugin-missing-exports', 'typedoc-plugin-markdown'],
|
|
3
3
|
|
|
4
4
|
disableSources: true,
|
|
5
|
-
excludeProtected:
|
|
6
|
-
excludeInternal:
|
|
7
|
-
excludePrivate:
|
|
8
|
-
excludeExternals:
|
|
5
|
+
excludeProtected: true,
|
|
6
|
+
excludeInternal: true,
|
|
7
|
+
excludePrivate: true,
|
|
8
|
+
excludeExternals: true,
|
|
9
9
|
|
|
10
10
|
//
|
|
11
11
|
// Formatting `typedoc-plugin-markdown`
|