@campxdev/server-shared 1.6.40 → 1.6.41

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/domain/index.d.ts +2 -0
  2. package/dist/domain/index.d.ts.map +1 -1
  3. package/dist/domain/index.js +2 -0
  4. package/dist/domain/index.js.map +1 -1
  5. package/dist/domain/mongodb-repositories/mongodb-oauth-client.repository.d.ts +44 -0
  6. package/dist/domain/mongodb-repositories/mongodb-oauth-client.repository.d.ts.map +1 -0
  7. package/dist/domain/mongodb-repositories/mongodb-oauth-client.repository.js +82 -0
  8. package/dist/domain/mongodb-repositories/mongodb-oauth-client.repository.js.map +1 -0
  9. package/dist/domain/repositories/oauth-client.repository.d.ts +16 -0
  10. package/dist/domain/repositories/oauth-client.repository.d.ts.map +1 -0
  11. package/dist/domain/repositories/oauth-client.repository.js +7 -0
  12. package/dist/domain/repositories/oauth-client.repository.js.map +1 -0
  13. package/dist/domain/schemas/oauth-client.schema.d.ts +54 -0
  14. package/dist/domain/schemas/oauth-client.schema.d.ts.map +1 -0
  15. package/dist/domain/schemas/oauth-client.schema.js +71 -0
  16. package/dist/domain/schemas/oauth-client.schema.js.map +1 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/oauth-clients/index.d.ts +3 -0
  22. package/dist/oauth-clients/index.d.ts.map +1 -0
  23. package/dist/oauth-clients/index.js +19 -0
  24. package/dist/oauth-clients/index.js.map +1 -0
  25. package/dist/oauth-clients/oauth-client.module.d.ts +3 -0
  26. package/dist/oauth-clients/oauth-client.module.d.ts.map +1 -0
  27. package/dist/oauth-clients/oauth-client.module.js +32 -0
  28. package/dist/oauth-clients/oauth-client.module.js.map +1 -0
  29. package/dist/oauth-clients/services/oauth-client.service.d.ts +15 -0
  30. package/dist/oauth-clients/services/oauth-client.service.d.ts.map +1 -0
  31. package/dist/oauth-clients/services/oauth-client.service.js +65 -0
  32. package/dist/oauth-clients/services/oauth-client.service.js.map +1 -0
  33. package/dist/oauth-clients/utils/oauth-client.utils.d.ts +8 -0
  34. package/dist/oauth-clients/utils/oauth-client.utils.d.ts.map +1 -0
  35. package/dist/oauth-clients/utils/oauth-client.utils.js +3 -0
  36. package/dist/oauth-clients/utils/oauth-client.utils.js.map +1 -0
  37. package/package.json +1 -1
@@ -10,6 +10,8 @@ export * from './schemas/data-import.schema';
10
10
  export * from './schemas/media-record.schema';
11
11
  export * from './services/shared-domain.service';
12
12
  export * from './types/dropdown.types';
13
+ export * from './schemas/oauth-client.schema';
14
+ export * from './repositories/oauth-client.repository';
13
15
  export * from './other-schemas';
14
16
  export * from './entities/profile-permission.entity';
15
17
  export * from './entities/profile.entity';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AAGvC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AAGvD,cAAc,iBAAiB,CAAC;AAGhC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC"}
@@ -26,6 +26,8 @@ __exportStar(require("./schemas/data-import.schema"), exports);
26
26
  __exportStar(require("./schemas/media-record.schema"), exports);
27
27
  __exportStar(require("./services/shared-domain.service"), exports);
28
28
  __exportStar(require("./types/dropdown.types"), exports);
29
+ __exportStar(require("./schemas/oauth-client.schema"), exports);
30
+ __exportStar(require("./repositories/oauth-client.repository"), exports);
29
31
  // other schemas
30
32
  __exportStar(require("./other-schemas"), exports);
31
33
  // To be removed
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,iEAA+C;AAC/C,iEAA+C;AAC/C,iEAA+C;AAC/C,wEAAsD;AACtD,wEAAsD;AACtD,yEAAuD;AACvD,mEAAiD;AACjD,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,yDAAuC;AAEvC,gBAAgB;AAChB,kDAAgC;AAEhC,gBAAgB;AAChB,uEAAqD;AACrD,4DAA0C;AAC1C,4DAA0C;AAC1C,yDAAuC;AACvC,gEAA8C;AAC9C,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,iEAA+C;AAC/C,iEAA+C;AAC/C,iEAA+C;AAC/C,wEAAsD;AACtD,wEAAsD;AACtD,yEAAuD;AACvD,mEAAiD;AACjD,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,yDAAuC;AACvC,gEAA8C;AAC9C,yEAAuD;AAEvD,gBAAgB;AAChB,kDAAgC;AAEhC,gBAAgB;AAChB,uEAAqD;AACrD,4DAA0C;AAC1C,4DAA0C;AAC1C,yDAAuC;AACvC,gEAA8C;AAC9C,0DAAwC"}
@@ -0,0 +1,44 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { Model } from 'mongoose';
26
+ import { MOAuthClient } from '../schemas/oauth-client.schema';
27
+ import { OAuthClientRepository } from '../repositories/oauth-client.repository';
28
+ export declare class MongoDbOAuthClientRepository implements OAuthClientRepository {
29
+ private readonly model;
30
+ constructor(model: Model<MOAuthClient>);
31
+ instance(data?: Partial<MOAuthClient>): MOAuthClient;
32
+ create(oauthClient: MOAuthClient): Promise<MOAuthClient>;
33
+ save(id: string, updatedFields: Partial<MOAuthClient>): Promise<MOAuthClient>;
34
+ delete(oauthClient: MOAuthClient): Promise<void>;
35
+ findByClientId(clientId: string): Promise<MOAuthClient | null>;
36
+ findByTenantId(tenantId: string): Promise<MOAuthClient[]>;
37
+ findById(id: string): Promise<MOAuthClient | null>;
38
+ find(): Promise<MOAuthClient[]>;
39
+ findAll(): Promise<{
40
+ count: number;
41
+ clients: MOAuthClient[];
42
+ }>;
43
+ }
44
+ //# sourceMappingURL=mongodb-oauth-client.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongodb-oauth-client.repository.d.ts","sourceRoot":"","sources":["../../../src/domain/mongodb-repositories/mongodb-oauth-client.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,YAAY,EAAsB,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAIhF,qBACa,4BAA6B,YAAW,qBAAqB;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;IAEvF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY;IAO9C,MAAM,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAQxD,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IAc7E,MAAM,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAK9D,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAKzD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAKlD,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAK/B,OAAO,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CAKrE"}
@@ -0,0 +1,82 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.MongoDbOAuthClientRepository = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const mongoose_1 = require("@nestjs/mongoose");
18
+ const mongoose_2 = require("mongoose");
19
+ const oauth_client_schema_1 = require("../schemas/oauth-client.schema");
20
+ const utils_1 = require("../../utils");
21
+ const request_store_1 = require("../../request-store");
22
+ let MongoDbOAuthClientRepository = class MongoDbOAuthClientRepository {
23
+ constructor(model) {
24
+ this.model = model;
25
+ }
26
+ instance(data) {
27
+ const client = new this.model(data);
28
+ const oauthClient = (0, oauth_client_schema_1.convertOAuthClient)(client);
29
+ oauthClient.id ??= (0, utils_1.generateId)();
30
+ return oauthClient;
31
+ }
32
+ async create(oauthClient) {
33
+ oauthClient.id ??= (0, utils_1.generateId)();
34
+ oauthClient.createdById ??= (0, request_store_1.getUserData)()?.userId;
35
+ const client = await this.model.create(oauthClient);
36
+ return (0, oauth_client_schema_1.convertOAuthClient)(client);
37
+ }
38
+ async save(id, updatedFields) {
39
+ const fieldsToUpdate = {
40
+ ...updatedFields,
41
+ updatedById: (0, request_store_1.getUserData)()?.userId,
42
+ };
43
+ const updatedClient = await this.model
44
+ .findOneAndUpdate({ id }, { $set: fieldsToUpdate }, { new: true })
45
+ .exec();
46
+ if (!updatedClient) {
47
+ throw new common_1.NotFoundException(`OAuth client with ID ${id} not found`);
48
+ }
49
+ return (0, oauth_client_schema_1.convertOAuthClient)(updatedClient);
50
+ }
51
+ async delete(oauthClient) {
52
+ await this.model.deleteOne({ clientId: oauthClient.clientId }).exec();
53
+ }
54
+ async findByClientId(clientId) {
55
+ const client = await this.model.findOne({ clientId }).exec();
56
+ return client ? (0, oauth_client_schema_1.convertOAuthClient)(client) : null;
57
+ }
58
+ async findByTenantId(tenantId) {
59
+ const clients = await this.model.find({ tenantId }).sort({ createdAt: -1 }).exec();
60
+ return clients.map(oauth_client_schema_1.convertOAuthClient);
61
+ }
62
+ async findById(id) {
63
+ const client = await this.model.findOne({ _id: id }).exec();
64
+ return client ? (0, oauth_client_schema_1.convertOAuthClient)(client) : null;
65
+ }
66
+ async find() {
67
+ const clients = await this.model.find().sort({ createdAt: -1 }).exec();
68
+ return clients.map(oauth_client_schema_1.convertOAuthClient);
69
+ }
70
+ async findAll() {
71
+ const count = await this.model.countDocuments().exec();
72
+ const clients = await this.find();
73
+ return { count, clients };
74
+ }
75
+ };
76
+ exports.MongoDbOAuthClientRepository = MongoDbOAuthClientRepository;
77
+ exports.MongoDbOAuthClientRepository = MongoDbOAuthClientRepository = __decorate([
78
+ (0, common_1.Injectable)(),
79
+ __param(0, (0, mongoose_1.InjectModel)(oauth_client_schema_1.MOAuthClient.name)),
80
+ __metadata("design:paramtypes", [mongoose_2.Model])
81
+ ], MongoDbOAuthClientRepository);
82
+ //# sourceMappingURL=mongodb-oauth-client.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongodb-oauth-client.repository.js","sourceRoot":"","sources":["../../../src/domain/mongodb-repositories/mongodb-oauth-client.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,+CAA+C;AAC/C,uCAAiC;AACjC,wEAAkF;AAElF,uCAAyC;AACzC,uDAAkD;AAG3C,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,YAA6D,KAA0B;QAA1B,UAAK,GAAL,KAAK,CAAqB;IAAG,CAAC;IAE3F,QAAQ,CAAC,IAA4B;QACnC,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,WAAW,GAAG,IAAA,wCAAkB,EAAC,MAAM,CAAC,CAAC;QAC/C,WAAW,CAAC,EAAE,KAAK,IAAA,kBAAU,GAAE,CAAC;QAChC,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,WAAyB;QACpC,WAAW,CAAC,EAAE,KAAK,IAAA,kBAAU,GAAE,CAAC;QAChC,WAAW,CAAC,WAAW,KAAK,IAAA,2BAAW,GAAE,EAAE,MAAM,CAAC;QAElD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,IAAA,wCAAkB,EAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAU,EAAE,aAAoC;QACzD,MAAM,cAAc,GAAG;YACrB,GAAG,aAAa;YACh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AAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5D,OAAO,MAAM,CAAC,CAAC,CAAC,IAAA,wCAAkB,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACvE,OAAO,OAAO,CAAC,GAAG,CAAC,wCAAkB,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,CAAC;QACvD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAC5B,CAAC;CACF,CAAA;AA7DY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,sBAAW,EAAC,kCAAY,CAAC,IAAI,CAAC,CAAA;qCAAyB,gBAAK;GAD9D,4BAA4B,CA6DxC"}
@@ -0,0 +1,16 @@
1
+ import { MOAuthClient } from '../schemas/oauth-client.schema';
2
+ export declare abstract class OAuthClientRepository {
3
+ abstract instance(data?: Partial<MOAuthClient>): MOAuthClient;
4
+ abstract create(oauthClient: MOAuthClient): Promise<MOAuthClient>;
5
+ abstract save(id: string, updatedFields: Partial<MOAuthClient>): Promise<MOAuthClient>;
6
+ abstract delete(oauthClient: MOAuthClient): Promise<void>;
7
+ abstract findByClientId(clientId: string): Promise<MOAuthClient>;
8
+ abstract findByTenantId(tenantId: string): Promise<MOAuthClient[]>;
9
+ abstract findById(id: string): Promise<MOAuthClient>;
10
+ abstract find(): Promise<MOAuthClient[]>;
11
+ abstract findAll(): Promise<{
12
+ count: number;
13
+ clients: MOAuthClient[];
14
+ }>;
15
+ }
16
+ //# sourceMappingURL=oauth-client.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.repository.d.ts","sourceRoot":"","sources":["../../../src/domain/repositories/oauth-client.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,8BAAsB,qBAAqB;IACzC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY;IAE7D,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAEjE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IAEtF,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAEzD,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAEhE,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAElE,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAEpD,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAExC,QAAQ,CAAC,OAAO,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CACxE"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OAuthClientRepository = void 0;
4
+ class OAuthClientRepository {
5
+ }
6
+ exports.OAuthClientRepository = OAuthClientRepository;
7
+ //# sourceMappingURL=oauth-client.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.repository.js","sourceRoot":"","sources":["../../../src/domain/repositories/oauth-client.repository.ts"],"names":[],"mappings":";;;AAEA,MAAsB,qBAAqB;CAkB1C;AAlBD,sDAkBC"}
@@ -0,0 +1,54 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { HydratedDocument, Schema as MongooseSchema } from 'mongoose';
26
+ export declare const OAuthClientCName = "oauth_clients";
27
+ export type OAuthClientDocument = HydratedDocument<MOAuthClient>;
28
+ export declare class MOAuthClient {
29
+ id: string;
30
+ clientId: string;
31
+ clientSecret: string;
32
+ authorizedDomain: string;
33
+ name: string;
34
+ description?: string;
35
+ tenantId: string;
36
+ createdById: string;
37
+ updatedById: string;
38
+ createdAt: Date;
39
+ updatedAt: Date;
40
+ }
41
+ export declare const convertOAuthClient: {
42
+ (value: (object | (import("mongoose").Document<unknown, {}, MOAuthClient> & MOAuthClient & {
43
+ _id: import("mongoose").Types.ObjectId;
44
+ }))[]): MOAuthClient[];
45
+ (value: object | (import("mongoose").Document<unknown, {}, MOAuthClient> & MOAuthClient & {
46
+ _id: import("mongoose").Types.ObjectId;
47
+ })): MOAuthClient;
48
+ };
49
+ export declare const OAuthClientSchema: MongooseSchema<MOAuthClient, import("mongoose").Model<MOAuthClient, any, any, any, import("mongoose").Document<unknown, any, MOAuthClient> & MOAuthClient & {
50
+ _id: import("mongoose").Types.ObjectId;
51
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, MOAuthClient, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<MOAuthClient>> & import("mongoose").FlatRecord<MOAuthClient> & {
52
+ _id: import("mongoose").Types.ObjectId;
53
+ }>;
54
+ //# sourceMappingURL=oauth-client.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.schema.d.ts","sourceRoot":"","sources":["../../../src/domain/schemas/oauth-client.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AAGtE,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAChD,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAEjE,qBACa,YAAY;IAEvB,EAAE,EAAE,MAAM,CAAC;IAGX,QAAQ,EAAE,MAAM,CAAC;IAGjB,YAAY,EAAE,MAAM,CAAC;IAGrB,gBAAgB,EAAE,MAAM,CAAC;IAGzB,IAAI,EAAE,MAAM,CAAC;IAGb,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,QAAQ,EAAE,MAAM,CAAC;IAGjB,WAAW,EAAE,MAAM,CAAC;IAGpB,WAAW,EAAE,MAAM,CAAC;IAGpB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,kBAAkB;;;;;;;CAA2B,CAAC;AAE3D,eAAO,MAAM,iBAAiB;;;;EAA6C,CAAC"}
@@ -0,0 +1,71 @@
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.OAuthClientSchema = exports.convertOAuthClient = exports.MOAuthClient = exports.OAuthClientCName = void 0;
13
+ const mongoose_1 = require("@nestjs/mongoose");
14
+ const mongoose_2 = require("mongoose");
15
+ const utils_1 = require("../../utils");
16
+ exports.OAuthClientCName = 'oauth_clients';
17
+ let MOAuthClient = class MOAuthClient {
18
+ };
19
+ exports.MOAuthClient = MOAuthClient;
20
+ __decorate([
21
+ (0, mongoose_1.Prop)({ required: true }),
22
+ __metadata("design:type", String)
23
+ ], MOAuthClient.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, mongoose_1.Prop)({ required: true, unique: true }),
26
+ __metadata("design:type", String)
27
+ ], MOAuthClient.prototype, "clientId", void 0);
28
+ __decorate([
29
+ (0, mongoose_1.Prop)({ required: true, unique: true }),
30
+ __metadata("design:type", String)
31
+ ], MOAuthClient.prototype, "clientSecret", void 0);
32
+ __decorate([
33
+ (0, mongoose_1.Prop)({ required: true }),
34
+ __metadata("design:type", String)
35
+ ], MOAuthClient.prototype, "authorizedDomain", void 0);
36
+ __decorate([
37
+ (0, mongoose_1.Prop)({ required: true }),
38
+ __metadata("design:type", String)
39
+ ], MOAuthClient.prototype, "name", void 0);
40
+ __decorate([
41
+ (0, mongoose_1.Prop)(),
42
+ __metadata("design:type", String)
43
+ ], MOAuthClient.prototype, "description", void 0);
44
+ __decorate([
45
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId }),
46
+ __metadata("design:type", String)
47
+ ], MOAuthClient.prototype, "tenantId", void 0);
48
+ __decorate([
49
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId }),
50
+ __metadata("design:type", String)
51
+ ], MOAuthClient.prototype, "createdById", void 0);
52
+ __decorate([
53
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId }),
54
+ __metadata("design:type", String)
55
+ ], MOAuthClient.prototype, "updatedById", void 0);
56
+ __decorate([
57
+ (0, mongoose_1.Prop)(),
58
+ __metadata("design:type", Date)
59
+ ], MOAuthClient.prototype, "createdAt", void 0);
60
+ __decorate([
61
+ (0, mongoose_1.Prop)(),
62
+ __metadata("design:type", Date)
63
+ ], MOAuthClient.prototype, "updatedAt", void 0);
64
+ exports.MOAuthClient = MOAuthClient = __decorate([
65
+ (0, mongoose_1.Schema)({ collection: exports.OAuthClientCName, timestamps: true })
66
+ ], MOAuthClient);
67
+ exports.convertOAuthClient = (0, utils_1.convertDoc)(MOAuthClient);
68
+ exports.OAuthClientSchema = mongoose_1.SchemaFactory.createForClass(MOAuthClient);
69
+ exports.OAuthClientSchema.index({ clientId: 1 }, { unique: true });
70
+ exports.OAuthClientSchema.index({ tenantId: 1, clientId: 1 }, { unique: true });
71
+ //# sourceMappingURL=oauth-client.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.schema.js","sourceRoot":"","sources":["../../../src/domain/schemas/oauth-client.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;A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BAAa,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAC5E,yBAAiB,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3D,yBAAiB,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -13,4 +13,5 @@ export * from './shared-module';
13
13
  export * from './task-queue';
14
14
  export * from './util-module';
15
15
  export * from './utils';
16
+ export * from './oauth-clients';
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -29,4 +29,5 @@ __exportStar(require("./shared-module"), exports);
29
29
  __exportStar(require("./task-queue"), exports);
30
30
  __exportStar(require("./util-module"), exports);
31
31
  __exportStar(require("./utils"), exports);
32
+ __exportStar(require("./oauth-clients"), exports);
32
33
  //# 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,uDAAqC;AACrC,2CAAyB;AACzB,+DAA6C;AAC7C,yDAAuC;AACvC,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,oDAAkC;AAClC,gDAA8B;AAC9B,kDAAgC;AAChC,kDAAgC;AAChC,+CAA6B;AAC7B,gDAA8B;AAC9B,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,2CAAyB;AACzB,+DAA6C;AAC7C,yDAAuC;AACvC,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,oDAAkC;AAClC,gDAA8B;AAC9B,kDAAgC;AAChC,kDAAgC;AAChC,+CAA6B;AAC7B,gDAA8B;AAC9B,0CAAwB;AACxB,kDAAgC"}
@@ -0,0 +1,3 @@
1
+ export * from './oauth-client.module';
2
+ export * from './services/oauth-client.service';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/oauth-clients/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,19 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./oauth-client.module"), exports);
18
+ __exportStar(require("./services/oauth-client.service"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/oauth-clients/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,kEAAgD"}
@@ -0,0 +1,3 @@
1
+ export declare class OAuthClientModule {
2
+ }
3
+ //# sourceMappingURL=oauth-client.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.module.d.ts","sourceRoot":"","sources":["../../src/oauth-clients/oauth-client.module.ts"],"names":[],"mappings":"AAcA,qBAKa,iBAAiB;CAAG"}
@@ -0,0 +1,32 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.OAuthClientModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const oauth_client_service_1 = require("./services/oauth-client.service");
12
+ const domain_1 = require("../domain");
13
+ const mongodb_oauth_client_repository_1 = require("../domain/mongodb-repositories/mongodb-oauth-client.repository");
14
+ const mongoose_1 = require("@nestjs/mongoose");
15
+ const repositories = [
16
+ oauth_client_service_1.OAuthClientService,
17
+ {
18
+ provide: domain_1.OAuthClientRepository,
19
+ useClass: mongodb_oauth_client_repository_1.MongoDbOAuthClientRepository,
20
+ },
21
+ ];
22
+ let OAuthClientModule = class OAuthClientModule {
23
+ };
24
+ exports.OAuthClientModule = OAuthClientModule;
25
+ exports.OAuthClientModule = OAuthClientModule = __decorate([
26
+ (0, common_1.Module)({
27
+ imports: [mongoose_1.MongooseModule.forFeature([{ name: domain_1.MOAuthClient.name, schema: domain_1.OAuthClientSchema }])],
28
+ providers: [...repositories],
29
+ exports: [...repositories],
30
+ })
31
+ ], OAuthClientModule);
32
+ //# sourceMappingURL=oauth-client.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.module.js","sourceRoot":"","sources":["../../src/oauth-clients/oauth-client.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAkD;AAClD,0EAAqE;AACrE,sCAAmF;AACnF,oHAA8G;AAC9G,+CAAkD;AAElD,MAAM,YAAY,GAAe;IAC/B,yCAAkB;IAClB;QACE,OAAO,EAAE,8BAAqB;QAC9B,QAAQ,EAAE,8DAA4B;KACvC;CACF,CAAC;AAOK,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,8CAAiB;4BAAjB,iBAAiB;IAL7B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAc,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,qBAAY,CAAC,IAAI,EAAE,MAAM,EAAE,0BAAiB,EAAE,CAAC,CAAC,CAAC;QAC9F,SAAS,EAAE,CAAC,GAAG,YAAY,CAAC;QAC5B,OAAO,EAAE,CAAC,GAAG,YAAY,CAAC;KAC3B,CAAC;GACW,iBAAiB,CAAG"}
@@ -0,0 +1,15 @@
1
+ import { MOAuthClient, OAuthClientRepository } from '../../domain';
2
+ import { OAuthClientType } from '../utils/oauth-client.utils';
3
+ export declare class OAuthClientService {
4
+ private readonly oauthClientRepository;
5
+ constructor(oauthClientRepository: OAuthClientRepository);
6
+ createClient(data: OAuthClientType): Promise<MOAuthClient>;
7
+ getClientById(clientId: string): Promise<MOAuthClient>;
8
+ updateClient(clientId: string, data: OAuthClientType): Promise<MOAuthClient>;
9
+ deleteClient(clientId: string): Promise<void>;
10
+ findAll(): Promise<{
11
+ count: number;
12
+ clients: MOAuthClient[];
13
+ }>;
14
+ }
15
+ //# sourceMappingURL=oauth-client.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.service.d.ts","sourceRoot":"","sources":["../../../src/oauth-clients/services/oauth-client.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,qBACa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAEnE,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;IAW1D,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAQtD,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;IAe5E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7C,OAAO,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CAGrE"}
@@ -0,0 +1,65 @@
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.OAuthClientService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const uuid_1 = require("uuid");
15
+ const domain_1 = require("../../domain");
16
+ let OAuthClientService = class OAuthClientService {
17
+ constructor(oauthClientRepository) {
18
+ this.oauthClientRepository = oauthClientRepository;
19
+ }
20
+ async createClient(data) {
21
+ const clientId = (0, uuid_1.v4)();
22
+ const clientSecret = (0, uuid_1.v4)();
23
+ const clientInstance = this.oauthClientRepository.instance({
24
+ ...data,
25
+ clientId,
26
+ clientSecret,
27
+ });
28
+ return await this.oauthClientRepository.create(clientInstance);
29
+ }
30
+ async getClientById(clientId) {
31
+ const client = await this.oauthClientRepository.findByClientId(clientId);
32
+ if (!client) {
33
+ throw new common_1.NotFoundException('Client not found');
34
+ }
35
+ return client;
36
+ }
37
+ async updateClient(clientId, data) {
38
+ const existingClient = await this.oauthClientRepository.findByClientId(clientId);
39
+ if (!existingClient) {
40
+ throw new common_1.NotFoundException(`OAuth client with ID ${clientId} not found`);
41
+ }
42
+ const updatedData = {
43
+ name: data.name,
44
+ authorizedDomain: data.authorizedDomain,
45
+ description: data.description,
46
+ };
47
+ return await this.oauthClientRepository.save(existingClient.id, updatedData);
48
+ }
49
+ async deleteClient(clientId) {
50
+ const client = await this.oauthClientRepository.findByClientId(clientId);
51
+ if (!client) {
52
+ throw new common_1.NotFoundException(`OAuth client with ID ${clientId} not found`);
53
+ }
54
+ await this.oauthClientRepository.delete(client);
55
+ }
56
+ async findAll() {
57
+ return await this.oauthClientRepository.findAll();
58
+ }
59
+ };
60
+ exports.OAuthClientService = OAuthClientService;
61
+ exports.OAuthClientService = OAuthClientService = __decorate([
62
+ (0, common_1.Injectable)(),
63
+ __metadata("design:paramtypes", [domain_1.OAuthClientRepository])
64
+ ], OAuthClientService);
65
+ //# sourceMappingURL=oauth-client.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.service.js","sourceRoot":"","sources":["../../../src/oauth-clients/services/oauth-client.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA+D;AAC/D,+BAAoC;AACpC,yCAAmE;AAI5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAA6B,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAG,CAAC;IAE7E,KAAK,CAAC,YAAY,CAAC,IAAqB;QACtC,MAAM,QAAQ,GAAG,IAAA,SAAM,GAAE,CAAC;QAC1B,MAAM,YAAY,GAAG,IAAA,SAAM,GAAE,CAAC;QAC9B,MAAM,cAAc,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC;YACzD,GAAG,IAAI;YACP,QAAQ;YACR,YAAY;SACb,CAAC,CAAC;QACH,OAAO,MAAM,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,QAAgB;QAClC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,cAAc,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thClientType = {
2
+ id?: string;
3
+ name: string;
4
+ authorizedDomain: string;
5
+ tenantId?: string;
6
+ description?: string;
7
+ };
8
+ //# sourceMappingURL=oauth-client.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.utils.d.ts","sourceRoot":"","sources":["../../../src/oauth-clients/utils/oauth-client.utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=oauth-client.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.utils.js","sourceRoot":"","sources":["../../../src/oauth-clients/utils/oauth-client.utils.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/server-shared",
3
- "version": "1.6.40",
3
+ "version": "1.6.41",
4
4
  "description": "Campx server shared files",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",