@nmshd/connector-types 6.26.1 → 7.0.0-alpha.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/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/httpServer/BaseController.d.ts +5 -2
- package/dist/infrastructure/httpServer/BaseController.d.ts.map +1 -1
- package/dist/infrastructure/httpServer/BaseController.js +39 -3
- package/dist/infrastructure/httpServer/BaseController.js.map +1 -1
- package/package.json +2 -2
- package/dist/QRCode.d.ts +0 -7
- package/dist/QRCode.d.ts.map +0 -1
- package/dist/QRCode.js +0 -52
- package/dist/QRCode.js.map +0 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,5 +19,4 @@ __exportStar(require("./ConnectorMode"), exports);
|
|
|
19
19
|
__exportStar(require("./ConnectorRuntimeModule"), exports);
|
|
20
20
|
__exportStar(require("./DocumentationLink"), exports);
|
|
21
21
|
__exportStar(require("./infrastructure"), exports);
|
|
22
|
-
__exportStar(require("./QRCode"), exports);
|
|
23
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,kDAAgC;AAChC,2DAAyC;AACzC,sDAAoC;AACpC,mDAAiC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,kDAAgC;AAChC,2DAAyC;AACzC,sDAAoC;AACpC,mDAAiC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Result } from "@js-soft/ts-utils";
|
|
2
2
|
import { Return } from "@nmshd/typescript-rest";
|
|
3
3
|
import express from "express";
|
|
4
|
-
import { QRCode } from "../../QRCode";
|
|
5
4
|
import { Envelope } from "./common/Envelope";
|
|
6
5
|
import { Mimetype } from "./common/Mimetype";
|
|
7
6
|
export declare abstract class BaseController {
|
|
@@ -11,6 +10,10 @@ export declare abstract class BaseController {
|
|
|
11
10
|
private json;
|
|
12
11
|
private guard;
|
|
13
12
|
protected file<T extends Result<any>>(result: T, contentPredicate: (result: T) => Buffer | string | Uint8Array | undefined, filenamePredicate: (result: T) => string, mimetypePredicate: (result: T) => Mimetype, response: express.Response, status: number): void;
|
|
14
|
-
protected qrCode<T extends Result<
|
|
13
|
+
protected qrCode<T extends Result<{
|
|
14
|
+
reference: {
|
|
15
|
+
url: string;
|
|
16
|
+
};
|
|
17
|
+
}>>(result: T, filename: string, response: express.Response, status: number): Promise<void>;
|
|
15
18
|
}
|
|
16
19
|
//# sourceMappingURL=BaseController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseController.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/httpServer/BaseController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;A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E,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAgBnK"}
|
|
@@ -1,7 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.BaseController = void 0;
|
|
4
37
|
const typescript_rest_1 = require("@nmshd/typescript-rest");
|
|
38
|
+
const qrcodeLibrary = __importStar(require("qrcode"));
|
|
5
39
|
const Envelope_1 = require("./common/Envelope");
|
|
6
40
|
const Mimetype_1 = require("./common/Mimetype");
|
|
7
41
|
class BaseController {
|
|
@@ -47,11 +81,13 @@ class BaseController {
|
|
|
47
81
|
.setHeader("content-disposition", `attachment;filename=${encodeURIComponent(filename)}`)
|
|
48
82
|
.send(buffer);
|
|
49
83
|
}
|
|
50
|
-
async qrCode(result,
|
|
84
|
+
async qrCode(result, filename, response, status) {
|
|
51
85
|
this.guard(result);
|
|
52
86
|
const mimetype = Mimetype_1.Mimetype.png();
|
|
53
|
-
const
|
|
54
|
-
const
|
|
87
|
+
const reference = result.value.reference.url;
|
|
88
|
+
const dataUrl = await qrcodeLibrary.toDataURL(reference);
|
|
89
|
+
const base64 = dataUrl.split(",")[1];
|
|
90
|
+
const buffer = Buffer.from(base64, "base64");
|
|
55
91
|
response
|
|
56
92
|
.status(status)
|
|
57
93
|
.setHeader("content-type", mimetype.value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseController.js","sourceRoot":"","sources":["../../../src/infrastructure/httpServer/BaseController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseController.js","sourceRoot":"","sources":["../../../src/infrastructure/httpServer/BaseController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAAgD;AAEhD,sDAAwC;AACxC,gDAA6C;AAC7C,gDAA6C;AAE7C,MAAsB,cAAc;IACtB,OAAO,CAAI,MAAiB;QAClC,OAAO,IAAI,wBAAM,CAAC,WAAW,CAAW,GAAG,EAAE,IAAI,CAAC,IAAI,CAAI,MAAM,CAAC,CAAC,CAAC;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AAC;aACd,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,KAAK,CAAC;aACzC,SAAS,CAAC,qBAAqB,EAAE,uBAAuB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;aACvF,IAAI,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;IAES,KAAK,CAAC,MAAM,CAAmD,MAAS,EAAE,QAAgB,EAAE,QAA0B,EAAE,MAAc;QAC5I,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEnB,MAAM,QAAQ,GAAG,mBAAQ,CAAC,GAAG,EAAE,CAAC;QAEhC,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;QAC7C,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAE7C,QAAQ;aACH,MAAM,CAAC,MAAM,CAAC;aACd,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,KAAK,CAAC;aACzC,SAAS,CAAC,qBAAqB,EAAE,uBAAuB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;aACvF,IAAI,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CACJ;AAzED,wCAyEC"}
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@js-soft/docdb-access-abstractions": "^1.1.0",
|
|
37
37
|
"@js-soft/ts-utils": "^2.3.3",
|
|
38
|
-
"@nmshd/runtime": "^
|
|
38
|
+
"@nmshd/runtime": "^7.0.0-alpha.26",
|
|
39
39
|
"@nmshd/typescript-rest": "^3.1.3",
|
|
40
40
|
"express": "^5.1.0"
|
|
41
41
|
},
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"qrcode": "^1.5.4"
|
|
48
48
|
},
|
|
49
|
-
"version": "
|
|
49
|
+
"version": "7.0.0-alpha.1"
|
|
50
50
|
}
|
package/dist/QRCode.d.ts
DELETED
package/dist/QRCode.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QRCode.d.ts","sourceRoot":"","sources":["../src/QRCode.ts"],"names":[],"mappings":"AAEA,qBAAa,MAAM;IACK,OAAO,CAAC,QAAQ,CAAC,MAAM;IAA3C,OAAO;IAEA,QAAQ,IAAI,MAAM;WAIL,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAM9D"}
|
package/dist/QRCode.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.QRCode = void 0;
|
|
37
|
-
const qrcodeLibrary = __importStar(require("qrcode"));
|
|
38
|
-
class QRCode {
|
|
39
|
-
constructor(base64) {
|
|
40
|
-
this.base64 = base64;
|
|
41
|
-
}
|
|
42
|
-
asBase64() {
|
|
43
|
-
return this.base64;
|
|
44
|
-
}
|
|
45
|
-
static async for(reference) {
|
|
46
|
-
const dataUrl = await qrcodeLibrary.toDataURL(reference.startsWith("http") ? reference : `nmshd://tr#${reference}`);
|
|
47
|
-
const base64 = dataUrl.split(",")[1];
|
|
48
|
-
return new QRCode(base64);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.QRCode = QRCode;
|
|
52
|
-
//# sourceMappingURL=QRCode.js.map
|
package/dist/QRCode.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QRCode.js","sourceRoot":"","sources":["../src/QRCode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AAExC,MAAa,MAAM;IACf,YAAqC,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEhD,QAAQ;QACX,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAiB;QACrC,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC;QACpH,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAErC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACJ;AAbD,wBAaC"}
|