@ldsg/application 0.1.0-alpha.18 → 0.1.0-alpha.19
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/dist/resource.d.ts +2 -2
- package/dist/resource.d.ts.map +1 -1
- package/dist/resource.js +5 -14
- package/package.json +5 -5
package/dist/resource.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Resource } from "@ldsg/resource";
|
|
2
2
|
import { Express } from "express";
|
|
3
3
|
import { ApplicationSpecificResourceSettings } from "./types";
|
|
4
|
-
type CreateExpressApp = () =>
|
|
4
|
+
type CreateExpressApp = () => Express;
|
|
5
5
|
interface ExtendExpressAppParams {
|
|
6
6
|
app: Express;
|
|
7
7
|
}
|
|
8
|
-
export type ExtendExpressApp = (params: ExtendExpressAppParams) =>
|
|
8
|
+
export type ExtendExpressApp = (params: ExtendExpressAppParams) => void;
|
|
9
9
|
export declare class ApplicationResource extends Resource<ApplicationSpecificResourceSettings> {
|
|
10
10
|
createExpressApp: CreateExpressApp;
|
|
11
11
|
extendExpressApp: ExtendExpressApp;
|
package/dist/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,mCAAmC,EAAE,MAAM,SAAS,CAAC;AAE9D,KAAK,gBAAgB,GAAG,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,mCAAmC,EAAE,MAAM,SAAS,CAAC;AAE9D,KAAK,gBAAgB,GAAG,MAAM,OAAO,CAAC;AAEtC,UAAU,sBAAsB;IAC9B,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;AAExE,qBAAa,mBAAoB,SAAQ,QAAQ,CAAC,mCAAmC,CAAC;IACpF,gBAAgB,EAAE,gBAAgB,CAQhC;IAEF,gBAAgB,EAAE,gBAAgB,CA2BhC;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -18,14 +9,14 @@ const express_1 = __importDefault(require("express"));
|
|
|
18
9
|
class ApplicationResource extends resource_1.Resource {
|
|
19
10
|
constructor() {
|
|
20
11
|
super(...arguments);
|
|
21
|
-
this.createExpressApp = () =>
|
|
12
|
+
this.createExpressApp = () => {
|
|
22
13
|
const app = (0, express_1.default)();
|
|
23
|
-
|
|
14
|
+
this.extendExpressApp({
|
|
24
15
|
app,
|
|
25
16
|
});
|
|
26
17
|
return app;
|
|
27
|
-
}
|
|
28
|
-
this.extendExpressApp = (params) =>
|
|
18
|
+
};
|
|
19
|
+
this.extendExpressApp = (params) => {
|
|
29
20
|
const { app } = params;
|
|
30
21
|
const { id, settings: { name }, getFilteredResources, } = this;
|
|
31
22
|
app.get("/", (req, res) => {
|
|
@@ -41,7 +32,7 @@ class ApplicationResource extends resource_1.Resource {
|
|
|
41
32
|
resource.extendExpressApp(params);
|
|
42
33
|
}
|
|
43
34
|
});
|
|
44
|
-
}
|
|
35
|
+
};
|
|
45
36
|
}
|
|
46
37
|
}
|
|
47
38
|
exports.ApplicationResource = ApplicationResource;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/application",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"express": "^4.18.2",
|
|
18
|
-
"@ldsg/handler": "0.1.0-alpha.
|
|
19
|
-
"@ldsg/resource": "0.1.0-alpha.
|
|
20
|
-
"@ldsg/resource-definition": "0.1.0-alpha.
|
|
21
|
-
"@ldsg/types": "0.1.0-alpha.
|
|
18
|
+
"@ldsg/handler": "0.1.0-alpha.19",
|
|
19
|
+
"@ldsg/resource": "0.1.0-alpha.19",
|
|
20
|
+
"@ldsg/resource-definition": "0.1.0-alpha.19",
|
|
21
|
+
"@ldsg/types": "0.1.0-alpha.19"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/express": "^4.17.17",
|