@hellocoop/fastify 1.7.5 → 1.9.0

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/auth.d.ts CHANGED
@@ -13,6 +13,5 @@ declare module 'fastify' {
13
13
  }
14
14
  export interface HelloConfig extends FastifyPluginOptions, Config {
15
15
  }
16
- declare const _default: FastifyPluginAsync<HelloConfig>;
17
- export default _default;
16
+ export declare const auth: FastifyPluginAsync<HelloConfig>;
18
17
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,kBAAkB,EACpB,MAAM,SAAS,CAAA;AAGjB,OAAO,EAGH,oBAAoB,EACvB,MAAM,SAAS,CAAA;AAIhB,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAQH,MAAM,EACT,MAAO,mBAAmB,CAAA;AAqC3B,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;;AAwBpE,wBAAgC"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,kBAAkB,EACpB,MAAM,SAAS,CAAA;AAGjB,OAAO,EAGH,oBAAoB,EACvB,MAAM,SAAS,CAAA;AAIhB,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAQH,MAAM,EACT,MAAO,mBAAmB,CAAA;AAqC3B,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;AAwBpE,eAAO,MAAM,IAAI,iCAAoB,CAAA"}
package/dist/auth.js CHANGED
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.auth = void 0;
7
8
  const fastify_plugin_1 = __importDefault(require("fastify-plugin"));
8
9
  const cookie_1 = require("cookie");
9
10
  const router_1 = require("@hellocoop/router");
@@ -56,4 +57,4 @@ const helloPlugin = async (instance, options) => {
56
57
  return await (0, router_1.router)(helloReq, helloRes);
57
58
  });
58
59
  };
59
- exports.default = (0, fastify_plugin_1.default)(helloPlugin);
60
+ exports.auth = (0, fastify_plugin_1.default)(helloPlugin);
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { default as auth, HelloConfig } from './auth';
1
+ import { auth, HelloConfig } from './auth';
2
2
  export default auth;
3
3
  export { auth as helloAuth, HelloConfig };
4
+ export { redirect, unauthorized, setAuth } from './middleware';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACrD,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAC1C,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,WAAW,EAAE,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.helloAuth = void 0;
7
- const auth_1 = __importDefault(require("./auth"));
8
- Object.defineProperty(exports, "helloAuth", { enumerable: true, get: function () { return auth_1.default; } });
9
- exports.default = auth_1.default;
3
+ exports.setAuth = exports.unauthorized = exports.redirect = exports.helloAuth = void 0;
4
+ const auth_1 = require("./auth");
5
+ Object.defineProperty(exports, "helloAuth", { enumerable: true, get: function () { return auth_1.auth; } });
6
+ exports.default = auth_1.auth;
7
+ var middleware_1 = require("./middleware");
8
+ Object.defineProperty(exports, "redirect", { enumerable: true, get: function () { return middleware_1.redirect; } });
9
+ Object.defineProperty(exports, "unauthorized", { enumerable: true, get: function () { return middleware_1.unauthorized; } });
10
+ Object.defineProperty(exports, "setAuth", { enumerable: true, get: function () { return middleware_1.setAuth; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hellocoop/fastify",
3
- "version": "1.7.5",
3
+ "version": "1.9.0",
4
4
  "description": "Fastify SDK for Hellō https://hello.dev",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,8 +10,7 @@
10
10
  "main": "./dist/index.js",
11
11
  "types": "./dist/index.d.ts",
12
12
  "exports": {
13
- ".": "./dist/index.js",
14
- "./middleware": "./dist/middleware.js"
13
+ ".": "./dist/index.js"
15
14
  },
16
15
  "files": [
17
16
  "dist/"