@loopstack/auth 0.14.0 → 0.15.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.
Files changed (37) hide show
  1. package/dist/auth.module.js +2 -2
  2. package/dist/controllers/auth.controller.d.ts +2 -1
  3. package/dist/controllers/auth.controller.js +5 -5
  4. package/dist/controllers/auth.controller.js.map +1 -1
  5. package/dist/dtos/auth-response.dto.d.ts +6 -0
  6. package/dist/dtos/auth-response.dto.js +11 -0
  7. package/dist/dtos/auth-response.dto.js.map +1 -0
  8. package/dist/dtos/user-response.dto.d.ts +7 -0
  9. package/dist/dtos/user-response.dto.js +12 -0
  10. package/dist/dtos/user-response.dto.js.map +1 -0
  11. package/dist/guards/jwt-auth.guard.js +4 -4
  12. package/dist/guards/jwt-auth.guard.js.map +1 -1
  13. package/dist/guards/roles.guard.js +2 -2
  14. package/dist/repositories/user.repository.d.ts +1 -1
  15. package/dist/repositories/user.repository.js +4 -4
  16. package/dist/repositories/user.repository.js.map +1 -1
  17. package/dist/services/auth.service.d.ts +3 -1
  18. package/dist/services/auth.service.js.map +1 -1
  19. package/dist/services/hub.service.d.ts +1 -1
  20. package/dist/services/hub.service.js.map +1 -1
  21. package/dist/services/token.service.d.ts +1 -1
  22. package/dist/strategies/hub.strategy.d.ts +1 -1
  23. package/dist/strategies/hub.strategy.js +3 -4
  24. package/dist/strategies/hub.strategy.js.map +1 -1
  25. package/dist/strategies/jwt.strategy.d.ts +2 -2
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +17 -15
  28. package/CHANGELOG.md +0 -218
  29. package/dist/guards/conditional-auth.guard.d.ts +0 -11
  30. package/dist/guards/conditional-auth.guard.js +0 -41
  31. package/dist/guards/conditional-auth.guard.js.map +0 -1
  32. package/dist/guards/local-dev-mode.guard.d.ts +0 -7
  33. package/dist/guards/local-dev-mode.guard.js +0 -35
  34. package/dist/guards/local-dev-mode.guard.js.map +0 -1
  35. package/dist/services/user.service.d.ts +0 -8
  36. package/dist/services/user.service.js +0 -33
  37. package/dist/services/user.service.js.map +0 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@loopstack/auth",
3
3
  "displayName": "Loopstack Auth Module",
4
4
  "description": "The auth module of the loopstack automation framework",
5
- "version": "0.14.0",
5
+ "version": "0.15.1",
6
6
  "author": {
7
7
  "name": "Jakob Klippel",
8
8
  "url": "https://www.linkedin.com/in/jakob-klippel/"
@@ -10,9 +10,22 @@
10
10
  "license": "BSL",
11
11
  "main": "dist/index.js",
12
12
  "types": "dist/index.d.ts",
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "watch": "tsc --watch",
16
+ "prepare": "npm run build",
17
+ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
18
+ "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
19
+ "test": "jest",
20
+ "test:watch": "jest --watch",
21
+ "test:cov": "jest --coverage",
22
+ "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
23
+ "test:e2e": "jest --config ./test/jest-e2e.json"
24
+ },
13
25
  "dependencies": {
14
- "@loopstack/core": "^0.14.0",
15
- "@loopstack/shared": "^0.14.0",
26
+ "@loopstack/common": "^0.15.1",
27
+ "@loopstack/contracts": "^0.15.0",
28
+ "@loopstack/core": "^0.15.3",
16
29
  "@nestjs/common": "^11.0.1",
17
30
  "@nestjs/config": "^4.0.0",
18
31
  "@nestjs/core": "^11.0.1",
@@ -82,16 +95,5 @@
82
95
  ],
83
96
  "coverageDirectory": "../coverage",
84
97
  "testEnvironment": "node"
85
- },
86
- "scripts": {
87
- "build": "tsc",
88
- "watch": "tsc --watch",
89
- "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
90
- "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
91
- "test": "jest",
92
- "test:watch": "jest --watch",
93
- "test:cov": "jest --coverage",
94
- "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
95
- "test:e2e": "jest --config ./test/jest-e2e.json"
96
98
  }
97
- }
99
+ }
package/CHANGELOG.md DELETED
@@ -1,218 +0,0 @@
1
- # @loopstack/auth
2
-
3
- ## 0.14.0
4
-
5
- ### Minor Changes
6
-
7
- - 8067b2d: This release focuses on enhancing the user experience in Loopstack Studio by introducing the ability to execute workflows with arguments directly from the frontend. This feature allows users to customize and control workflow execution more effectively. In addition to this major update, support for Vercel AI Elements has been added, along with the capability to define workflow and pipeline UI forms and actions through configuration. Various bug fixes and improvements are also included in this release.
8
- - Add support for defining workflow and pipeline UI forms and actions via configuration.
9
- - Add support for executing workflows with arguments from Loopstack Studio frontend.
10
- - Add support for Vercel AI Elements in Loopstack Studio.
11
- - Various bugfixes and improvements.
12
-
13
- ### Patch Changes
14
-
15
- - Updated dependencies [8067b2d]
16
- - @loopstack/core@0.14.0
17
- - @loopstack/shared@0.14.0
18
-
19
- ## 0.13.0
20
-
21
- ### Minor Changes
22
-
23
- - 41aabbf: Use local frontend without authentication
24
-
25
- ### Patch Changes
26
-
27
- - Updated dependencies [41aabbf]
28
- - @loopstack/core@0.13.0
29
- - @loopstack/shared@0.13.0
30
-
31
- ## 0.12.2
32
-
33
- ### Patch Changes
34
-
35
- - 1b88ec2: Bump version
36
- - Updated dependencies [1b88ec2]
37
- - @loopstack/core@0.12.2
38
- - @loopstack/shared@0.12.2
39
-
40
- ## 0.12.1
41
-
42
- ### Patch Changes
43
-
44
- - 228674f: Minor changes, Use Client Secret fallback
45
- - Updated dependencies [228674f]
46
- - @loopstack/core@0.12.1
47
- - @loopstack/shared@0.12.1
48
-
49
- ## 0.12.0
50
-
51
- ### Minor Changes
52
-
53
- - 04b6c66: Beta Release
54
-
55
- ### Patch Changes
56
-
57
- - Updated dependencies [04b6c66]
58
- - @loopstack/core@0.12.0
59
- - @loopstack/shared@0.12.0
60
-
61
- ## 0.11.1
62
-
63
- ### Patch Changes
64
-
65
- - fb1600e: Various fixes and improvements
66
- - Updated dependencies [fb1600e]
67
- - @loopstack/core@0.11.1
68
- - @loopstack/shared@0.11.1
69
-
70
- ## 0.11.0
71
-
72
- ### Minor Changes
73
-
74
- - f1db120: Implement Block Wrapper for Typescript services
75
-
76
- ### Patch Changes
77
-
78
- - Updated dependencies [f1db120]
79
- - @loopstack/core@0.11.0
80
- - @loopstack/shared@0.11.0
81
-
82
- ## 0.10.0
83
-
84
- ### Minor Changes
85
-
86
- - Implement Block Processing
87
-
88
- ### Patch Changes
89
-
90
- - Updated dependencies
91
- - @loopstack/core@0.10.0
92
- - @loopstack/shared@0.10.0
93
-
94
- ## 0.9.0
95
-
96
- ### Minor Changes
97
-
98
- - Implement block scopes for automation components
99
-
100
- ### Patch Changes
101
-
102
- - Updated dependencies
103
- - @loopstack/core@0.9.0
104
- - @loopstack/shared@0.9.0
105
-
106
- ## 0.8.1
107
-
108
- ### Patch Changes
109
-
110
- - Bump dependencies
111
- - Updated dependencies
112
- - @loopstack/core@0.8.1
113
- - @loopstack/shared@0.8.1
114
-
115
- ## 0.8.0
116
-
117
- ### Minor Changes
118
-
119
- - Implement oauth flow
120
- - b24bb28: Use vercel ai sdk with structured data
121
-
122
- ### Patch Changes
123
-
124
- - b24bb28: Use AI Sdk for all message types front and backend
125
- - Updated dependencies
126
- - Updated dependencies [b24bb28]
127
- - Updated dependencies [b24bb28]
128
- - Updated dependencies
129
- - @loopstack/core@0.8.0
130
- - @loopstack/shared@0.8.0
131
-
132
- ## 0.7.5
133
-
134
- ### Patch Changes
135
-
136
- - Add prepare script
137
- - Updated dependencies
138
- - @loopstack/core@0.7.4
139
- - @loopstack/shared@0.7.4
140
-
141
- ## 0.7.4
142
-
143
- ### Patch Changes
144
-
145
- - bump redis fix
146
- - Updated dependencies
147
- - @loopstack/core@0.7.3
148
- - @loopstack/shared@0.7.3
149
-
150
- ## 0.7.3
151
-
152
- ### Patch Changes
153
-
154
- - Fix redis for core scheduler
155
- - Updated dependencies
156
- - @loopstack/core@0.7.2
157
- - @loopstack/shared@0.7.2
158
-
159
- ## 0.7.2
160
-
161
- ### Patch Changes
162
-
163
- - set cookie domain and cors origin for auth api and websocket
164
-
165
- ## 0.7.1
166
-
167
- ### Patch Changes
168
-
169
- - Remove shared module peerDependencies
170
- - Updated dependencies
171
- - @loopstack/core@0.7.1
172
- - @loopstack/shared@0.7.1
173
-
174
- ## 0.7.0
175
-
176
- ### Minor Changes
177
-
178
- - feat: add validation handlers and error results for documents
179
-
180
- ### Patch Changes
181
-
182
- - Updated dependencies
183
- - Updated dependencies
184
- - @loopstack/core@0.7.0
185
- - @loopstack/shared@0.7.0
186
-
187
- ## 0.6.1
188
-
189
- ### Patch Changes
190
-
191
- - Added core tools and improvements
192
- - Updated dependencies
193
- - @loopstack/core@0.6.1
194
- - @loopstack/shared@0.6.1
195
-
196
- ## 0.6.0
197
-
198
- ### Minor Changes
199
-
200
- - Refactor to use config keys consistently
201
-
202
- ### Patch Changes
203
-
204
- - Updated dependencies
205
- - @loopstack/core@0.6.0
206
- - @loopstack/shared@0.6.0
207
-
208
- ## 0.5.0
209
-
210
- ### Minor Changes
211
-
212
- - Add AuthModule to framework, Enable Startup Tasks/Schedules, Run Processes via BullMQ, Various Bugfixes
213
-
214
- ### Patch Changes
215
-
216
- - Updated dependencies
217
- - @loopstack/core@0.5.0
218
- - @loopstack/shared@0.5.0
@@ -1,11 +0,0 @@
1
- import { CanActivate, ExecutionContext } from '@nestjs/common';
2
- import { ConfigService } from '@nestjs/config';
3
- import { JwtAuthGuard } from './jwt-auth.guard';
4
- import { LocalDevModeGuard } from './local-dev-mode.guard';
5
- export declare class ConditionalAuthGuard implements CanActivate {
6
- private readonly configService;
7
- private readonly jwtAuthGuard;
8
- private readonly localDevModeGuard;
9
- constructor(configService: ConfigService, jwtAuthGuard: JwtAuthGuard, localDevModeGuard: LocalDevModeGuard);
10
- canActivate(context: ExecutionContext): Promise<boolean>;
11
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ConditionalAuthGuard = void 0;
13
- const common_1 = require("@nestjs/common");
14
- const config_1 = require("@nestjs/config");
15
- const jwt_auth_guard_1 = require("./jwt-auth.guard");
16
- const local_dev_mode_guard_1 = require("./local-dev-mode.guard");
17
- let ConditionalAuthGuard = class ConditionalAuthGuard {
18
- configService;
19
- jwtAuthGuard;
20
- localDevModeGuard;
21
- constructor(configService, jwtAuthGuard, localDevModeGuard) {
22
- this.configService = configService;
23
- this.jwtAuthGuard = jwtAuthGuard;
24
- this.localDevModeGuard = localDevModeGuard;
25
- }
26
- async canActivate(context) {
27
- const isLocalDevMode = this.configService.get('app.isLocalMode');
28
- if (isLocalDevMode) {
29
- return this.localDevModeGuard.canActivate(context);
30
- }
31
- return this.jwtAuthGuard.canActivate(context);
32
- }
33
- };
34
- exports.ConditionalAuthGuard = ConditionalAuthGuard;
35
- exports.ConditionalAuthGuard = ConditionalAuthGuard = __decorate([
36
- (0, common_1.Injectable)(),
37
- __metadata("design:paramtypes", [config_1.ConfigService,
38
- jwt_auth_guard_1.JwtAuthGuard,
39
- local_dev_mode_guard_1.LocalDevModeGuard])
40
- ], ConditionalAuthGuard);
41
- //# sourceMappingURL=conditional-auth.guard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditional-auth.guard.js","sourceRoot":"","sources":["../../src/guards/conditional-auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAC3E,2CAA+C;AAC/C,qDAAgD;AAChD,iEAA2D;AAGpD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAEZ;IACA;IACA;IAHnB,YACmB,aAA4B,EAC5B,YAA0B,EAC1B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAC5B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,OAAyB;QACzC,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAU,iBAAiB,CAAC,CAAC;QAE1E,IAAI,cAAc,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;CACF,CAAA;AAhBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAGuB,sBAAa;QACd,6BAAY;QACP,wCAAiB;GAJ5C,oBAAoB,CAgBhC"}
@@ -1,7 +0,0 @@
1
- import { CanActivate, ExecutionContext } from '@nestjs/common';
2
- import { ConfigService } from '@nestjs/config';
3
- export declare class LocalDevModeGuard implements CanActivate {
4
- private configService;
5
- constructor(configService: ConfigService);
6
- canActivate(context: ExecutionContext): boolean;
7
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.LocalDevModeGuard = void 0;
13
- const common_1 = require("@nestjs/common");
14
- const config_1 = require("@nestjs/config");
15
- let LocalDevModeGuard = class LocalDevModeGuard {
16
- configService;
17
- constructor(configService) {
18
- this.configService = configService;
19
- }
20
- canActivate(context) {
21
- const request = context.switchToHttp().getRequest();
22
- request.user = {
23
- userId: this.configService.get('auth.devUserId'),
24
- workerId: 'local',
25
- roles: [],
26
- };
27
- return true;
28
- }
29
- };
30
- exports.LocalDevModeGuard = LocalDevModeGuard;
31
- exports.LocalDevModeGuard = LocalDevModeGuard = __decorate([
32
- (0, common_1.Injectable)(),
33
- __metadata("design:paramtypes", [config_1.ConfigService])
34
- ], LocalDevModeGuard);
35
- //# sourceMappingURL=local-dev-mode.guard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"local-dev-mode.guard.js","sourceRoot":"","sources":["../../src/guards/local-dev-mode.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAE3E,2CAA+C;AAGxC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAER;IAApB,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAGpD,WAAW,CAAC,OAAyB;QACnC,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QAEpD,OAAO,CAAC,IAAI,GAAG;YACb,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,gBAAgB,CAAE;YACzD,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,EAAE;SACqB,CAAC;QAEjC,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAhBY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAGwB,sBAAa;GAFrC,iBAAiB,CAgB7B"}
@@ -1,8 +0,0 @@
1
- import { ConfigService } from '@nestjs/config';
2
- import { UserRepository } from '../repositories';
3
- export declare class UserService {
4
- private readonly configService;
5
- private userRepository;
6
- constructor(configService: ConfigService, userRepository: UserRepository);
7
- getUser(where: any): any;
8
- }
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.UserService = void 0;
13
- const common_1 = require("@nestjs/common");
14
- const config_1 = require("@nestjs/config");
15
- const repositories_1 = require("../repositories");
16
- let UserService = class UserService {
17
- configService;
18
- userRepository;
19
- constructor(configService, userRepository) {
20
- this.configService = configService;
21
- this.userRepository = userRepository;
22
- }
23
- getUser(where) {
24
- return this.userRepository.find;
25
- }
26
- };
27
- exports.UserService = UserService;
28
- exports.UserService = UserService = __decorate([
29
- (0, common_1.Injectable)(),
30
- __metadata("design:paramtypes", [config_1.ConfigService,
31
- repositories_1.UserRepository])
32
- ], UserService);
33
- //# sourceMappingURL=user.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../src/services/user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAA+C;AAC/C,kDAAiD;AAK1C,IAAM,WAAW,GAAjB,MAAM,WAAW;IAEH;IACT;IAFV,YACmB,aAA4B,EACrC,cAA8B;QADrB,kBAAa,GAAb,aAAa,CAAe;QACrC,mBAAc,GAAd,cAAc,CAAgB;IACrC,CAAC;IAEJ,OAAO,CAAC,KAAK;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAA;IACjC,CAAC;CACF,CAAA;AATY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAGuB,sBAAa;QACrB,6BAAc;GAH7B,WAAW,CASvB"}