@hellocoop/fastify 1.13.12 → 1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.d.ts +1 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +6 -0
- package/package.json +7 -4
package/dist/auth.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import { FastifyPluginAsync } from 'fastify';
|
2
|
-
import { FastifyPluginOptions } from 'fastify';
|
1
|
+
import { FastifyPluginAsync, FastifyPluginOptions } from 'fastify';
|
3
2
|
import { Auth } from '@hellocoop/definitions';
|
4
3
|
import { Config } from '@hellocoop/api';
|
5
4
|
declare module 'fastify' {
|
package/dist/auth.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,kBAAkB,
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,kBAAkB,EAGlB,oBAAoB,EACtB,MAAM,SAAS,CAAA;AAMjB,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EASH,MAAM,EAET,MAAO,gBAAgB,CAAA;AAqDxB,OAAO,QAAQ,SAAS,CAAC;IACrB,UAAU,cAAc;QACtB,IAAI,CAAC,EAAE,IAAI,CAAC;QACZ,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAC7B;IACD,UAAU,YAAY;QACpB,SAAS,EAAE,MAAM,IAAI,CAAC;KACvB;CACF;AAEH,MAAM,WAAW,WAAY,SAAQ,oBAAoB,EAAE,MAAM;CAAG;AA+BpE,eAAO,MAAM,IAAI,iCAAoB,CAAA"}
|
package/dist/auth.js
CHANGED
@@ -6,8 +6,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
7
7
|
exports.auth = void 0;
|
8
8
|
const fastify_plugin_1 = __importDefault(require("fastify-plugin"));
|
9
|
+
const formbody_1 = __importDefault(require("@fastify/formbody"));
|
9
10
|
const cookie_1 = require("cookie");
|
10
11
|
const api_1 = require("@hellocoop/api");
|
12
|
+
// set name and version to provide in metadata
|
13
|
+
const package_json_1 = __importDefault(require("../package.json"));
|
14
|
+
const { name, version } = package_json_1.default;
|
15
|
+
api_1.PackageMetadata.setMetadata(name, version);
|
11
16
|
const convertToHelloRequest = (req, res) => {
|
12
17
|
return {
|
13
18
|
headers: () => { return req.headers; },
|
@@ -51,6 +56,7 @@ const convertToHelloResponse = (res) => {
|
|
51
56
|
const helloPlugin = async (instance, options) => {
|
52
57
|
if (!api_1.isConfigured)
|
53
58
|
(0, api_1.configure)(options);
|
59
|
+
instance.register(formbody_1.default);
|
54
60
|
instance.decorateRequest('auth', undefined);
|
55
61
|
instance.decorateRequest('getAuth', async function () {
|
56
62
|
const dummyResponse = {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hellocoop/fastify",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.14.1",
|
4
4
|
"description": "Fastify SDK for Hellō https://hello.dev",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -38,7 +38,9 @@
|
|
38
38
|
"prebuild": "rimraf dist node_modules",
|
39
39
|
"build": "tsc --declaration",
|
40
40
|
"test": "npm run build && docker compose -f ./spec/docker-compose.yml up --build --abort-on-container-exit",
|
41
|
-
"
|
41
|
+
"test:debug": "npm run build && docker compose -f ./spec/docker-compose.yml -f ./spec/docker-compose.debug.yml up --build --abort-on-container-exit",
|
42
|
+
"spec": "wait-on http://mockin:3333/mock && mocha './spec/**/*.spec.mjs'",
|
43
|
+
"spec:debug": "wait-on http://mockin:3333/mock && node --inspect-brk=0.0.0.0 ./node_modules/.bin/mocha './spec/**/*.spec.mjs'"
|
42
44
|
},
|
43
45
|
"peerDependencies": {
|
44
46
|
"fastify": "^4"
|
@@ -53,9 +55,10 @@
|
|
53
55
|
"node": ">=18"
|
54
56
|
},
|
55
57
|
"dependencies": {
|
56
|
-
"@
|
58
|
+
"@fastify/formbody": "^8.0.2",
|
59
|
+
"@hellocoop/api": "^2.2.1",
|
57
60
|
"dotenv": "^16.3.1",
|
58
61
|
"fastify-plugin": "^4.5.1"
|
59
62
|
},
|
60
|
-
"gitHead": "
|
63
|
+
"gitHead": "3d2e3dfbe982218f8abfce50126b2463fceb5831"
|
61
64
|
}
|