@cheqd/studio 3.12.1-develop.1 → 3.13.0-develop.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 (75) hide show
  1. package/dist/app.d.ts.map +1 -1
  2. package/dist/app.js +17 -1
  3. package/dist/app.js.map +1 -1
  4. package/dist/controllers/admin/subscriptions.d.ts.map +1 -1
  5. package/dist/controllers/admin/subscriptions.js.map +1 -1
  6. package/dist/controllers/api/accreditation.js.map +1 -1
  7. package/dist/controllers/api/providers.controller.d.ts +152 -0
  8. package/dist/controllers/api/providers.controller.d.ts.map +1 -0
  9. package/dist/controllers/api/providers.controller.js +348 -0
  10. package/dist/controllers/api/providers.controller.js.map +1 -0
  11. package/dist/database/entities/credential-provider.entity.d.ts +16 -0
  12. package/dist/database/entities/credential-provider.entity.d.ts.map +1 -0
  13. package/dist/database/entities/credential-provider.entity.js +109 -0
  14. package/dist/database/entities/credential-provider.entity.js.map +1 -0
  15. package/dist/database/entities/provider-configuration.entity.d.ts +23 -0
  16. package/dist/database/entities/provider-configuration.entity.d.ts.map +1 -0
  17. package/dist/database/entities/provider-configuration.entity.js +139 -0
  18. package/dist/database/entities/provider-configuration.entity.js.map +1 -0
  19. package/dist/database/migrations/1758011998054-studio-migrations.d.ts +7 -0
  20. package/dist/database/migrations/1758011998054-studio-migrations.d.ts.map +1 -0
  21. package/dist/database/migrations/1758011998054-studio-migrations.js +18 -0
  22. package/dist/database/migrations/1758011998054-studio-migrations.js.map +1 -0
  23. package/dist/database/seeds/providers.seed.d.ts +2 -0
  24. package/dist/database/seeds/providers.seed.d.ts.map +1 -0
  25. package/dist/database/seeds/providers.seed.js +89 -0
  26. package/dist/database/seeds/providers.seed.js.map +1 -0
  27. package/dist/database/types/types.d.ts.map +1 -1
  28. package/dist/database/types/types.js +6 -0
  29. package/dist/database/types/types.js.map +1 -1
  30. package/dist/middleware/auth/routes/api/accreditation-auth.js.map +1 -1
  31. package/dist/middleware/auth/routes/api/provider-auth.d.ts +5 -0
  32. package/dist/middleware/auth/routes/api/provider-auth.d.ts.map +1 -0
  33. package/dist/middleware/auth/routes/api/provider-auth.js +27 -0
  34. package/dist/middleware/auth/routes/api/provider-auth.js.map +1 -0
  35. package/dist/middleware/authentication.d.ts.map +1 -1
  36. package/dist/middleware/authentication.js +2 -0
  37. package/dist/middleware/authentication.js.map +1 -1
  38. package/dist/services/api/base-provider.service.d.ts +22 -0
  39. package/dist/services/api/base-provider.service.d.ts.map +1 -0
  40. package/dist/services/api/base-provider.service.js +60 -0
  41. package/dist/services/api/base-provider.service.js.map +1 -0
  42. package/dist/services/api/dock-api.service.d.ts +16 -0
  43. package/dist/services/api/dock-api.service.d.ts.map +1 -0
  44. package/dist/services/api/dock-api.service.js +93 -0
  45. package/dist/services/api/dock-api.service.js.map +1 -0
  46. package/dist/services/api/hovi-api.service.d.ts +16 -0
  47. package/dist/services/api/hovi-api.service.d.ts.map +1 -0
  48. package/dist/services/api/hovi-api.service.js +99 -0
  49. package/dist/services/api/hovi-api.service.js.map +1 -0
  50. package/dist/services/api/paradym-api.service.d.ts +16 -0
  51. package/dist/services/api/paradym-api.service.d.ts.map +1 -0
  52. package/dist/services/api/paradym-api.service.js +99 -0
  53. package/dist/services/api/paradym-api.service.js.map +1 -0
  54. package/dist/services/api/provider.factory.d.ts +9 -0
  55. package/dist/services/api/provider.factory.d.ts.map +1 -0
  56. package/dist/services/api/provider.factory.js +41 -0
  57. package/dist/services/api/provider.factory.js.map +1 -0
  58. package/dist/services/api/provider.service.d.ts +25 -0
  59. package/dist/services/api/provider.service.d.ts.map +1 -0
  60. package/dist/services/api/provider.service.js +148 -0
  61. package/dist/services/api/provider.service.js.map +1 -0
  62. package/dist/services/api/studio-api.service.d.ts +18 -0
  63. package/dist/services/api/studio-api.service.d.ts.map +1 -0
  64. package/dist/services/api/studio-api.service.js +104 -0
  65. package/dist/services/api/studio-api.service.js.map +1 -0
  66. package/dist/services/connectors/resource.d.ts.map +1 -1
  67. package/dist/services/connectors/resource.js.map +1 -1
  68. package/dist/services/identity/postgres.js.map +1 -1
  69. package/dist/static/swagger-api.json +200 -0
  70. package/dist/types/provider.types.d.ts +30 -0
  71. package/dist/types/provider.types.d.ts.map +1 -0
  72. package/dist/types/provider.types.js +2 -0
  73. package/dist/types/provider.types.js.map +1 -0
  74. package/example.env +6 -0
  75. package/package.json +2 -2
@@ -0,0 +1,348 @@
1
+ import { StatusCodes } from 'http-status-codes';
2
+ import { ProviderService } from '../../services/api/provider.service.js';
3
+ export class ProvidersController {
4
+ /**
5
+ * @openapi
6
+ * /providers:
7
+ * get:
8
+ * tags: [Providers]
9
+ * summary: Get all available credential providers
10
+ * description: Returns list of available credential providers
11
+ * responses:
12
+ * 200:
13
+ * description: Successful response
14
+ * content:
15
+ * application/json:
16
+ * schema:
17
+ * type: object
18
+ * properties:
19
+ * providers:
20
+ * type: array
21
+ * items:
22
+ * type: object
23
+ */
24
+ async getProviders(req, res) {
25
+ try {
26
+ const providers = await ProviderService.instance.getAllProviders();
27
+ return res.status(StatusCodes.OK).json({ providers });
28
+ }
29
+ catch (error) {
30
+ return res.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
31
+ error: `Internal error: ${error?.message || error}`,
32
+ });
33
+ }
34
+ }
35
+ /**
36
+ * @openapi
37
+ * /providers/activated:
38
+ * get:
39
+ * tags: [Providers]
40
+ * summary: Get customer's activated providers
41
+ * description: Returns list of providers activated by the customer
42
+ * responses:
43
+ * 200:
44
+ * description: Successful response
45
+ */
46
+ async getActiveProviders(req, res) {
47
+ try {
48
+ const customer = res.locals.customer;
49
+ const configurations = await ProviderService.instance.getCustomerConfigurations(customer.customerId);
50
+ const configuredProviders = configurations.map((config) => ({
51
+ configId: config.configId,
52
+ providerId: config.providerId,
53
+ tenantId: config.tenantId,
54
+ providerName: config.provider.name,
55
+ providerType: config.provider.providerType,
56
+ apiEndpoint: config.apiEndpoint,
57
+ webhookUrl: config.webhookUrl,
58
+ validated: config.validated,
59
+ validatedAt: config.validatedAt,
60
+ active: config.active,
61
+ defaultSettings: config.defaultSettings,
62
+ createdAt: config.createdAt,
63
+ updatedAt: config.updatedAt,
64
+ }));
65
+ return res.status(StatusCodes.OK).json({ providers: configuredProviders });
66
+ }
67
+ catch (error) {
68
+ return res.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
69
+ error: `Internal error: ${error?.message || error}`,
70
+ });
71
+ }
72
+ }
73
+ /**
74
+ * @openapi
75
+ * /providers/{providerId}/configuration:
76
+ * get:
77
+ * tags: [Providers]
78
+ * summary: Get provider configuration
79
+ * parameters:
80
+ * - name: providerId
81
+ * in: path
82
+ * required: true
83
+ * schema:
84
+ * type: string
85
+ * responses:
86
+ * 200:
87
+ * description: Provider configuration
88
+ */
89
+ async getProviderConfiguration(req, res) {
90
+ try {
91
+ const customer = res.locals.customer;
92
+ const { providerId } = req.params;
93
+ const config = await ProviderService.instance.getProviderConfiguration(customer.customerId, providerId);
94
+ if (!config) {
95
+ return res.status(StatusCodes.NOT_FOUND).json({
96
+ error: `No configuration found for provider ${providerId}`,
97
+ });
98
+ }
99
+ // Don't return encrypted API key
100
+ const safeConfig = {
101
+ configId: config.configId,
102
+ providerId: config.providerId,
103
+ tenantId: config.tenantId,
104
+ apiEndpoint: config.apiEndpoint,
105
+ webhookUrl: config.webhookUrl,
106
+ validated: config.validated,
107
+ validatedAt: config.validatedAt,
108
+ active: config.active,
109
+ defaultSettings: config.defaultSettings,
110
+ hasApiKey: !!config.encryptedApiKey,
111
+ provider: {
112
+ name: config.provider.name,
113
+ description: config.provider.description,
114
+ providerType: config.provider.providerType,
115
+ supportedFormats: config.provider.supportedFormats,
116
+ supportedProtocols: config.provider.supportedProtocols,
117
+ metadata: config.provider.metadata,
118
+ },
119
+ };
120
+ return res.status(StatusCodes.OK).json({ configuration: safeConfig });
121
+ }
122
+ catch (error) {
123
+ return res.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
124
+ error: `Internal error: ${error?.message || error}`,
125
+ });
126
+ }
127
+ }
128
+ /**
129
+ * @openapi
130
+ * /providers/{providerId}/activate:
131
+ * post:
132
+ * tags: [Providers]
133
+ * summary: Activate a provider for the customer
134
+ * parameters:
135
+ * - name: providerId
136
+ * in: path
137
+ * required: true
138
+ * schema:
139
+ * type: string
140
+ * responses:
141
+ * 200:
142
+ * description: Provider activated successfully
143
+ * 400:
144
+ * description: Invalid provider or already activated
145
+ * 404:
146
+ * description: Provider not found
147
+ */
148
+ async activateProvider(req, res) {
149
+ try {
150
+ const customer = res.locals.customer;
151
+ const { providerId } = req.params;
152
+ const config = await ProviderService.instance.activateProvider(customer.customerId, providerId);
153
+ return res.status(StatusCodes.OK).json({
154
+ message: 'Provider activated successfully',
155
+ configuration: {
156
+ configId: config.configId,
157
+ providerId: config.providerId,
158
+ tenantId: config.tenantId,
159
+ providerName: config.provider.name,
160
+ apiEndpoint: config.apiEndpoint,
161
+ active: config.active,
162
+ createdAt: config.createdAt,
163
+ },
164
+ });
165
+ }
166
+ catch (error) {
167
+ const status = error?.message.includes('not found')
168
+ ? StatusCodes.NOT_FOUND
169
+ : error?.message.includes('already activated')
170
+ ? StatusCodes.CONFLICT
171
+ : StatusCodes.BAD_REQUEST;
172
+ return res.status(status).json({
173
+ error: `Activation failed: ${error?.message || error}`,
174
+ });
175
+ }
176
+ }
177
+ /**
178
+ * @openapi
179
+ * /providers/{providerId}/configuration:
180
+ * put:
181
+ * tags: [Providers]
182
+ * summary: Update provider configuration
183
+ * parameters:
184
+ * - name: providerId
185
+ * in: path
186
+ * required: true
187
+ * schema:
188
+ * type: string
189
+ * requestBody:
190
+ * required: true
191
+ * content:
192
+ * application/json:
193
+ * schema:
194
+ * type: object
195
+ * properties:
196
+ * apiEndpoint:
197
+ * type: string
198
+ * format: uri
199
+ * description: API endpoint URL
200
+ * webhookUrl:
201
+ * type: string
202
+ * format: uri
203
+ * description: Webhook URL for notifications
204
+ * defaultSettings:
205
+ * type: object
206
+ * description: Provider-specific default settings
207
+ * responses:
208
+ * 200:
209
+ * description: Configuration updated successfully
210
+ * 400:
211
+ * description: Invalid configuration data
212
+ * 404:
213
+ * description: Provider configuration not found
214
+ */
215
+ async updateProviderConfiguration(req, res) {
216
+ try {
217
+ const customer = res.locals.customer;
218
+ const { providerId } = req.params;
219
+ const { apiEndpoint, webhookUrl, defaultSettings } = req.body;
220
+ // Validate input
221
+ if (apiEndpoint && typeof apiEndpoint !== 'string') {
222
+ return res.status(StatusCodes.BAD_REQUEST).json({
223
+ error: 'Invalid API endpoint: must be a string',
224
+ });
225
+ }
226
+ if (webhookUrl && typeof webhookUrl !== 'string') {
227
+ return res.status(StatusCodes.BAD_REQUEST).json({
228
+ error: 'Invalid webhook URL: must be a string',
229
+ });
230
+ }
231
+ if (process.env.APPLICATION_BASE_URL?.includes('localhost')) {
232
+ console.warn('Skipping URL validation in local development environment');
233
+ }
234
+ else {
235
+ if (apiEndpoint && !apiEndpoint.startsWith('https://')) {
236
+ return res.status(StatusCodes.BAD_REQUEST).json({
237
+ error: 'API endpoint must be a valid HTTPS URL',
238
+ });
239
+ }
240
+ if (webhookUrl && webhookUrl.trim() && !webhookUrl.startsWith('https://')) {
241
+ return res.status(StatusCodes.BAD_REQUEST).json({
242
+ error: 'Webhook URL must be a valid HTTPS URL',
243
+ });
244
+ }
245
+ }
246
+ const updatedConfig = await ProviderService.instance.updateProviderConfiguration(customer.customerId, providerId, {
247
+ apiEndpoint: apiEndpoint?.trim() || undefined,
248
+ webhookUrl: webhookUrl?.trim() || undefined,
249
+ defaultSettings: defaultSettings || undefined,
250
+ });
251
+ const safeConfig = {
252
+ configId: updatedConfig.configId,
253
+ providerId: updatedConfig.providerId,
254
+ apiEndpoint: updatedConfig.apiEndpoint,
255
+ webhookUrl: updatedConfig.webhookUrl,
256
+ validated: updatedConfig.validated,
257
+ validatedAt: updatedConfig.validatedAt,
258
+ active: updatedConfig.active,
259
+ defaultSettings: updatedConfig.defaultSettings,
260
+ hasApiKey: !!updatedConfig.encryptedApiKey,
261
+ updatedAt: updatedConfig.updatedAt,
262
+ };
263
+ return res.status(StatusCodes.OK).json({
264
+ message: 'Provider configuration updated successfully',
265
+ data: safeConfig,
266
+ });
267
+ }
268
+ catch (error) {
269
+ const status = error?.message.includes('not found')
270
+ ? StatusCodes.NOT_FOUND
271
+ : StatusCodes.BAD_REQUEST;
272
+ return res.status(status).json({
273
+ error: `Configuration update failed: ${error?.message || error}`,
274
+ });
275
+ }
276
+ }
277
+ /**
278
+ * @openapi
279
+ * /providers/{providerId}/test:
280
+ * post:
281
+ * tags: [Providers]
282
+ * summary: Test connection to a provider
283
+ * parameters:
284
+ * - name: providerId
285
+ * in: path
286
+ * required: true
287
+ * schema:
288
+ * type: string
289
+ * responses:
290
+ * 200:
291
+ * description: Connection test completed
292
+ * 400:
293
+ * description: Connection test failed
294
+ * 404:
295
+ * description: Provider configuration not found
296
+ */
297
+ async testConnection(req, res) {
298
+ try {
299
+ const customer = res.locals.customer;
300
+ const { providerId } = req.params;
301
+ const result = await ProviderService.instance.testConnection(customer.customerId, providerId);
302
+ const statusCode = result.success ? StatusCodes.OK : StatusCodes.BAD_REQUEST;
303
+ return res.status(statusCode).json({
304
+ providerId,
305
+ success: result.success,
306
+ message: result.message,
307
+ testedAt: new Date().toISOString(),
308
+ });
309
+ }
310
+ catch (error) {
311
+ return res.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
312
+ error: `Connection test failed: ${error?.message || error}`,
313
+ });
314
+ }
315
+ }
316
+ /**
317
+ * @openapi
318
+ * /providers/{providerId}:
319
+ * delete:
320
+ * tags: [Providers]
321
+ * summary: Remove provider configuration
322
+ * parameters:
323
+ * - name: providerId
324
+ * in: path
325
+ * required: true
326
+ * schema:
327
+ * type: string
328
+ * responses:
329
+ * 200:
330
+ * description: Configuration removed successfully
331
+ */
332
+ async removeProvider(req, res) {
333
+ try {
334
+ const customer = res.locals.customer;
335
+ const { providerId } = req.params;
336
+ await ProviderService.instance.deleteConfiguration(customer.customerId, providerId);
337
+ return res.status(StatusCodes.OK).json({
338
+ message: `Provider ${providerId} configuration removed successfully`,
339
+ });
340
+ }
341
+ catch (error) {
342
+ return res.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
343
+ error: `Internal error: ${error?.message || error}`,
344
+ });
345
+ }
346
+ }
347
+ }
348
+ //# sourceMappingURL=providers.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.controller.js","sourceRoot":"","sources":["../../../src/controllers/api/providers.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAGzE,MAAM,OAAO,mBAAmB;IAC/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CAAC,YAAY,CAAC,GAAY,EAAE,GAAa;QAC7C,IAAI,CAAC;YACJ,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;YACnE,OAAO,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QACvD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC;gBACzD,KAAK,EAAE,mBAAoB,KAAe,EAAE,OAAO,IAAI,KAAK,EAAE;aAC9D,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,kBAAkB,CAAC,GAAY,EAAE,GAAa;QACnD,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,QAA0B,CAAC;YACvD,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC,QAAQ,CAAC,yBAAyB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YAErG,MAAM,mBAAmB,GAAG,cAAc,C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;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,cAAc,CAAC,GAAY,EAAE,GAAa;QAC/C,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,QAA0B,CAAC;YACvD,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;YAElC,MAAM,eAAe,CAAC,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;YAEpF,OAAO,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC;gBACtC,OAAO,EAAE,YAAY,UAAU,qCAAqC;aACpE,CAAC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC;gBACzD,KAAK,EAAE,mBAAoB,KAAe,EAAE,OAAO,IAAI,KAAK,EAAE;aAC9D,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD"}
@@ -0,0 +1,16 @@
1
+ export declare class CredentialProviderEntity {
2
+ providerId: string;
3
+ name: string;
4
+ description?: string;
5
+ providerType: string;
6
+ supportedFormats: string[];
7
+ supportedProtocols: string[];
8
+ metadata?: any;
9
+ deprecated: boolean;
10
+ createdAt: Date;
11
+ updatedAt?: Date;
12
+ setCreatedAt(): void;
13
+ setUpdateAt(): void;
14
+ constructor(providerId: string, name: string, providerType: string, supportedFormats?: string[], supportedProtocols?: string[], description?: string, metadata?: any);
15
+ }
16
+ //# sourceMappingURL=credential-provider.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-provider.entity.d.ts","sourceRoot":"","sources":["../../../src/database/entities/credential-provider.entity.ts"],"names":[],"mappings":"AAKA,qBACa,wBAAwB;IAKpC,UAAU,EAAG,MAAM,CAAC;IAMpB,IAAI,EAAG,MAAM,CAAC;IAMd,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,YAAY,EAAG,MAAM,CAAC;IAOtB,gBAAgB,EAAG,MAAM,EAAE,CAAC;IAO5B,kBAAkB,EAAG,MAAM,EAAE,CAAC;IAM9B,QAAQ,CAAC,EAAE,GAAG,CAAC;IAMf,UAAU,EAAG,OAAO,CAAC;IAMrB,SAAS,EAAG,IAAI,CAAC;IAMjB,SAAS,CAAC,EAAE,IAAI,CAAC;IAGjB,YAAY;IAKZ,WAAW;gBAKV,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,gBAAgB,GAAE,MAAM,EAAO,EAC/B,kBAAkB,GAAE,MAAM,EAAO,EACjC,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,GAAG;CAUf"}
@@ -0,0 +1,109 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BeforeInsert, BeforeUpdate, Column, Entity } from 'typeorm';
8
+ import * as dotenv from 'dotenv';
9
+ dotenv.config();
10
+ let CredentialProviderEntity = class CredentialProviderEntity {
11
+ providerId;
12
+ name;
13
+ description;
14
+ providerType; // 'credential-all', 'credential-issuance', 'credential-verification', 'etc'
15
+ supportedFormats;
16
+ supportedProtocols;
17
+ metadata;
18
+ deprecated;
19
+ createdAt;
20
+ updatedAt;
21
+ setCreatedAt() {
22
+ this.createdAt = new Date();
23
+ }
24
+ setUpdateAt() {
25
+ this.updatedAt = new Date();
26
+ }
27
+ constructor(providerId, name, providerType, supportedFormats = [], supportedProtocols = [], description, metadata) {
28
+ this.providerId = providerId;
29
+ this.name = name;
30
+ this.providerType = providerType;
31
+ this.supportedFormats = supportedFormats;
32
+ this.supportedProtocols = supportedProtocols;
33
+ this.description = description;
34
+ this.metadata = metadata;
35
+ }
36
+ };
37
+ __decorate([
38
+ Column({
39
+ type: 'varchar',
40
+ primary: true,
41
+ })
42
+ ], CredentialProviderEntity.prototype, "providerId", void 0);
43
+ __decorate([
44
+ Column({
45
+ type: 'varchar',
46
+ nullable: false,
47
+ })
48
+ ], CredentialProviderEntity.prototype, "name", void 0);
49
+ __decorate([
50
+ Column({
51
+ type: 'text',
52
+ nullable: true,
53
+ })
54
+ ], CredentialProviderEntity.prototype, "description", void 0);
55
+ __decorate([
56
+ Column({
57
+ type: 'varchar',
58
+ nullable: false,
59
+ })
60
+ ], CredentialProviderEntity.prototype, "providerType", void 0);
61
+ __decorate([
62
+ Column({
63
+ type: 'json',
64
+ nullable: false,
65
+ default: '[]',
66
+ })
67
+ ], CredentialProviderEntity.prototype, "supportedFormats", void 0);
68
+ __decorate([
69
+ Column({
70
+ type: 'json',
71
+ nullable: false,
72
+ default: '[]',
73
+ })
74
+ ], CredentialProviderEntity.prototype, "supportedProtocols", void 0);
75
+ __decorate([
76
+ Column({
77
+ type: 'json',
78
+ nullable: false,
79
+ })
80
+ ], CredentialProviderEntity.prototype, "metadata", void 0);
81
+ __decorate([
82
+ Column({
83
+ type: 'boolean',
84
+ default: false,
85
+ })
86
+ ], CredentialProviderEntity.prototype, "deprecated", void 0);
87
+ __decorate([
88
+ Column({
89
+ type: 'timestamptz',
90
+ nullable: false,
91
+ })
92
+ ], CredentialProviderEntity.prototype, "createdAt", void 0);
93
+ __decorate([
94
+ Column({
95
+ type: 'timestamptz',
96
+ nullable: true,
97
+ })
98
+ ], CredentialProviderEntity.prototype, "updatedAt", void 0);
99
+ __decorate([
100
+ BeforeInsert()
101
+ ], CredentialProviderEntity.prototype, "setCreatedAt", null);
102
+ __decorate([
103
+ BeforeUpdate()
104
+ ], CredentialProviderEntity.prototype, "setUpdateAt", null);
105
+ CredentialProviderEntity = __decorate([
106
+ Entity('credentialProvider')
107
+ ], CredentialProviderEntity);
108
+ export { CredentialProviderEntity };
109
+ //# sourceMappingURL=credential-provider.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-provider.entity.js","sourceRoot":"","sources":["../../../src/database/entities/credential-provider.entity.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAGT,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAKpC,UAAU,CAAU;IAMpB,IAAI,CAAU;IAMd,WAAW,CAAU;IAMrB,YAAY,CAAU,CAAC,4EAA4E;IAOnG,gBAAgB,CAAY;IAO5B,kBAAkB,CAAY;IAM9B,QAAQ,CAAO;IAMf,UAAU,CAAW;IAMrB,SAAS,CAAQ;IAMjB,SAAS,CAAQ;IAGjB,YAAY;QACX,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,CAAC;IAGD,WAAW;QACV,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,YACC,UAAkB,EAClB,IAAY,EACZ,YAAoB,EACpB,mBAA6B,EAAE,EAC/B,qBAA+B,EAAE,EACjC,WAAoB,EACpB,QAAc;QAEd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,WA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ProviderEntity } from './credential-provider.entity.js';
3
+ export declare class ProviderConfigurationEntity {
4
+ configId: string;
5
+ providerId: string;
6
+ tenantId: string;
7
+ encryptedApiKey: string;
8
+ apiEndpoint: string;
9
+ webhookUrl?: string;
10
+ validated: boolean;
11
+ validatedAt?: Date;
12
+ active: boolean;
13
+ defaultSettings?: any;
14
+ deprecated: boolean;
15
+ createdAt: Date;
16
+ updatedAt?: Date;
17
+ customer: CustomerEntity;
18
+ provider: CredentialProviderEntity;
19
+ setCreatedAt(): void;
20
+ setUpdateAt(): void;
21
+ constructor(providerId: string, tenantId: string, encryptedApiKey: string, apiEndpoint: string, customer: CustomerEntity, provider: CredentialProviderEntity, webhookUrl?: string, defaultSettings?: any);
22
+ }
23
+ //# sourceMappingURL=provider-configuration.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-configuration.entity.d.ts","sourceRoot":"","sources":["../../../src/database/entities/provider-configuration.entity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAK3E,qBACa,2BAA2B;IAEvC,QAAQ,EAAG,MAAM,CAAC;IAMlB,UAAU,EAAG,MAAM,CAAC;IAMpB,QAAQ,EAAG,MAAM,CAAC;IAMlB,eAAe,EAAG,MAAM,CAAC;IAMzB,WAAW,EAAG,MAAM,CAAC;IAMrB,UAAU,CAAC,EAAE,MAAM,CAAC;IAMpB,SAAS,EAAG,OAAO,CAAC;IAMpB,WAAW,CAAC,EAAE,IAAI,CAAC;IAMnB,MAAM,EAAG,OAAO,CAAC;IAMjB,eAAe,CAAC,EAAE,GAAG,CAAC;IAMtB,UAAU,EAAG,OAAO,CAAC;IAMrB,SAAS,EAAG,IAAI,CAAC;IAMjB,SAAS,CAAC,EAAE,IAAI,CAAC;IAIjB,QAAQ,EAAG,cAAc,CAAC;IAI1B,QAAQ,EAAG,wBAAwB,CAAC;IAGpC,YAAY;IAKZ,WAAW;gBAKV,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,wBAAwB,EAClC,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,GAAG;CAWtB"}
@@ -0,0 +1,139 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ // src/database/entities/provider-configuration.entity.ts
8
+ import { BeforeInsert, BeforeUpdate, Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
9
+ import { CustomerEntity } from './customer.entity.js';
10
+ import { CredentialProviderEntity } from './credential-provider.entity.js';
11
+ import * as dotenv from 'dotenv';
12
+ dotenv.config();
13
+ let ProviderConfigurationEntity = class ProviderConfigurationEntity {
14
+ configId;
15
+ providerId;
16
+ tenantId;
17
+ encryptedApiKey;
18
+ apiEndpoint;
19
+ webhookUrl;
20
+ validated;
21
+ validatedAt;
22
+ active;
23
+ defaultSettings;
24
+ deprecated;
25
+ createdAt;
26
+ updatedAt;
27
+ customer;
28
+ provider;
29
+ setCreatedAt() {
30
+ this.createdAt = new Date();
31
+ }
32
+ setUpdateAt() {
33
+ this.updatedAt = new Date();
34
+ }
35
+ constructor(providerId, tenantId, encryptedApiKey, apiEndpoint, customer, provider, webhookUrl, defaultSettings) {
36
+ this.providerId = providerId;
37
+ this.tenantId = tenantId;
38
+ this.encryptedApiKey = encryptedApiKey;
39
+ this.apiEndpoint = apiEndpoint;
40
+ this.customer = customer;
41
+ this.provider = provider;
42
+ this.webhookUrl = webhookUrl;
43
+ this.defaultSettings = defaultSettings;
44
+ }
45
+ };
46
+ __decorate([
47
+ PrimaryGeneratedColumn('uuid')
48
+ ], ProviderConfigurationEntity.prototype, "configId", void 0);
49
+ __decorate([
50
+ Column({
51
+ type: 'varchar',
52
+ nullable: false,
53
+ })
54
+ ], ProviderConfigurationEntity.prototype, "providerId", void 0);
55
+ __decorate([
56
+ Column({
57
+ type: 'varchar',
58
+ nullable: false,
59
+ })
60
+ ], ProviderConfigurationEntity.prototype, "tenantId", void 0);
61
+ __decorate([
62
+ Column({
63
+ type: 'text',
64
+ nullable: false,
65
+ })
66
+ ], ProviderConfigurationEntity.prototype, "encryptedApiKey", void 0);
67
+ __decorate([
68
+ Column({
69
+ type: 'text',
70
+ nullable: false,
71
+ })
72
+ ], ProviderConfigurationEntity.prototype, "apiEndpoint", void 0);
73
+ __decorate([
74
+ Column({
75
+ type: 'text',
76
+ nullable: true,
77
+ })
78
+ ], ProviderConfigurationEntity.prototype, "webhookUrl", void 0);
79
+ __decorate([
80
+ Column({
81
+ type: 'boolean',
82
+ default: false,
83
+ })
84
+ ], ProviderConfigurationEntity.prototype, "validated", void 0);
85
+ __decorate([
86
+ Column({
87
+ type: 'timestamptz',
88
+ nullable: true,
89
+ })
90
+ ], ProviderConfigurationEntity.prototype, "validatedAt", void 0);
91
+ __decorate([
92
+ Column({
93
+ type: 'boolean',
94
+ default: false,
95
+ })
96
+ ], ProviderConfigurationEntity.prototype, "active", void 0);
97
+ __decorate([
98
+ Column({
99
+ type: 'json',
100
+ nullable: true,
101
+ })
102
+ ], ProviderConfigurationEntity.prototype, "defaultSettings", void 0);
103
+ __decorate([
104
+ Column({
105
+ type: 'boolean',
106
+ default: false,
107
+ })
108
+ ], ProviderConfigurationEntity.prototype, "deprecated", void 0);
109
+ __decorate([
110
+ Column({
111
+ type: 'timestamptz',
112
+ nullable: false,
113
+ })
114
+ ], ProviderConfigurationEntity.prototype, "createdAt", void 0);
115
+ __decorate([
116
+ Column({
117
+ type: 'timestamptz',
118
+ nullable: true,
119
+ })
120
+ ], ProviderConfigurationEntity.prototype, "updatedAt", void 0);
121
+ __decorate([
122
+ ManyToOne(() => CustomerEntity, (customer) => customer.customerId, { nullable: false, onDelete: 'CASCADE' }),
123
+ JoinColumn({ name: 'customerId' })
124
+ ], ProviderConfigurationEntity.prototype, "customer", void 0);
125
+ __decorate([
126
+ ManyToOne(() => CredentialProviderEntity, (provider) => provider.providerId, { nullable: false }),
127
+ JoinColumn({ name: 'providerId' })
128
+ ], ProviderConfigurationEntity.prototype, "provider", void 0);
129
+ __decorate([
130
+ BeforeInsert()
131
+ ], ProviderConfigurationEntity.prototype, "setCreatedAt", null);
132
+ __decorate([
133
+ BeforeUpdate()
134
+ ], ProviderConfigurationEntity.prototype, "setUpdateAt", null);
135
+ ProviderConfigurationEntity = __decorate([
136
+ Entity('providerConfiguration')
137
+ ], ProviderConfigurationEntity);
138
+ export { ProviderConfigurationEntity };
139
+ //# sourceMappingURL=provider-configuration.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-configuration.entity.js","sourceRoot":"","sources":["../../../src/database/entities/provider-configuration.entity.ts"],"names":[],"mappings":";;;;;;AAAA,yDAAyD;AACzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAGT,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAEvC,QAAQ,CAAU;IAMlB,UAAU,CA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