@hed-hog/core 0.0.360 → 0.0.361

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 (62) hide show
  1. package/dist/ai/ai.service.d.ts +1 -1
  2. package/dist/auth/auth.controller.d.ts +26 -26
  3. package/dist/auth/auth.service.d.ts +34 -34
  4. package/dist/challenge/challenge.service.d.ts +12 -12
  5. package/dist/core/system.controller.d.ts +2 -2
  6. package/dist/core/system.service.d.ts +2 -2
  7. package/dist/dashboard/dashboard/dashboard.controller.d.ts +66 -66
  8. package/dist/dashboard/dashboard/dashboard.service.d.ts +66 -66
  9. package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +26 -26
  10. package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +26 -26
  11. package/dist/dashboard/dashboard-component-role/dashboard-component-role.controller.d.ts +34 -34
  12. package/dist/dashboard/dashboard-component-role/dashboard-component-role.service.d.ts +34 -34
  13. package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +8 -8
  14. package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +8 -8
  15. package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +5 -5
  16. package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +5 -5
  17. package/dist/dashboard/dashboard-role/dashboard-role.controller.d.ts +25 -25
  18. package/dist/dashboard/dashboard-role/dashboard-role.service.d.ts +25 -25
  19. package/dist/file/file.controller.d.ts +6 -6
  20. package/dist/file/file.service.d.ts +50 -24
  21. package/dist/file/file.service.d.ts.map +1 -1
  22. package/dist/file/file.service.js +37 -0
  23. package/dist/file/file.service.js.map +1 -1
  24. package/dist/integration-profile/integration-profile.controller.d.ts +15 -15
  25. package/dist/integration-profile/integration-profile.service.d.ts +15 -15
  26. package/dist/locale/locale.controller.d.ts +4 -4
  27. package/dist/locale/locale.service.d.ts +4 -4
  28. package/dist/mail/mail.controller.d.ts +7 -7
  29. package/dist/mail/mail.service.d.ts +7 -7
  30. package/dist/mail-sent/mail-sent.controller.d.ts +12 -12
  31. package/dist/mail-sent/mail-sent.service.d.ts +12 -12
  32. package/dist/mcp/mcp-api-key.controller.d.ts +2 -2
  33. package/dist/mcp/mcp-api-key.service.d.ts +2 -2
  34. package/dist/mcp-chat/mcp-chat.controller.d.ts +8 -8
  35. package/dist/mcp-chat/mcp-chat.service.d.ts +8 -8
  36. package/dist/menu/menu.controller.d.ts +10 -10
  37. package/dist/menu/menu.service.d.ts +10 -10
  38. package/dist/notification/notification.controller.d.ts +36 -36
  39. package/dist/notification/notification.service.d.ts +36 -36
  40. package/dist/profile/profile.controller.d.ts +16 -16
  41. package/dist/profile/profile.service.d.ts +16 -16
  42. package/dist/role/role.controller.d.ts +6 -6
  43. package/dist/role/role.service.d.ts +6 -6
  44. package/dist/screen/screen.controller.d.ts +3 -3
  45. package/dist/screen/screen.service.d.ts +3 -3
  46. package/dist/session/session.controller.d.ts +2 -2
  47. package/dist/session/session.service.d.ts +6 -6
  48. package/dist/setting/setting.controller.d.ts +18 -18
  49. package/dist/setting/setting.service.d.ts +18 -18
  50. package/dist/setting/setting.service.d.ts.map +1 -1
  51. package/dist/setting/setting.service.js +0 -1
  52. package/dist/setting/setting.service.js.map +1 -1
  53. package/dist/user/user.controller.d.ts +29 -29
  54. package/dist/user/user.service.d.ts +67 -67
  55. package/dist/webhook-integration/webhook-integration.controller.d.ts +2 -2
  56. package/dist/webhook-integration/webhook-integration.service.d.ts +2 -2
  57. package/hedhog/data/setting_group.yaml +0 -26
  58. package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +1 -33
  59. package/hedhog/table/setting_runtime_state.yaml +9 -0
  60. package/package.json +4 -3
  61. package/src/file/file.service.ts +88 -0
  62. package/src/setting/setting.service.ts +0 -1
@@ -22,13 +22,13 @@ export declare class UserService {
22
22
  private validateRoleExists;
23
23
  private validateEmailAvailable;
24
24
  verifyIdentifier(locale: string, userId: number, identifierId: number): Promise<{
25
- type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
26
25
  id: number;
27
- value: string;
28
- enabled: boolean;
29
26
  user_id: number;
30
27
  created_at: Date;
31
28
  updated_at: Date;
29
+ type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
30
+ value: string;
31
+ enabled: boolean;
32
32
  verified_at: Date | null;
33
33
  }>;
34
34
  list(paginationParams: any): Promise<{
@@ -46,16 +46,6 @@ export declare class UserService {
46
46
  };
47
47
  }>;
48
48
  get(locale: string, userId: number): Promise<{
49
- user_identifier: {
50
- type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
51
- id: number;
52
- value: string;
53
- enabled: boolean;
54
- user_id: number;
55
- created_at: Date;
56
- updated_at: Date;
57
- verified_at: Date | null;
58
- }[];
59
49
  role_user: ({
60
50
  role: {
61
51
  id: number;
@@ -72,82 +62,92 @@ export declare class UserService {
72
62
  })[];
73
63
  user_account: {
74
64
  id: number;
75
- email: string | null;
76
- provider: import("@prisma/client").$Enums.user_account_provider_52222e2ecb_enum;
77
65
  user_id: number;
78
66
  created_at: Date;
79
67
  updated_at: Date;
80
- provider_user_id: string;
81
- scopes: string | null;
68
+ email: string | null;
82
69
  refresh_token: import("@prisma/client/runtime/library").Bytes | null;
70
+ provider: import("@prisma/client").$Enums.user_account_provider_52222e2ecb_enum;
71
+ scopes: string | null;
72
+ provider_user_id: string;
83
73
  token_expires_at: Date | null;
84
74
  }[];
85
75
  user_activity: {
86
76
  id: number;
87
- action: string;
88
77
  user_id: number;
89
78
  created_at: Date;
90
79
  updated_at: Date;
80
+ action: string;
91
81
  }[];
92
82
  user_credential: {
93
- type: import("@prisma/client").$Enums.user_credential_type_4466d7f008_enum;
94
83
  id: number;
95
- hash: string;
96
84
  user_id: number;
97
85
  created_at: Date;
98
86
  updated_at: Date;
99
- expires_at: Date | null;
87
+ type: import("@prisma/client").$Enums.user_credential_type_4466d7f008_enum;
88
+ hash: string;
100
89
  revoked_at: Date | null;
90
+ expires_at: Date | null;
101
91
  requires_reset: boolean;
102
92
  }[];
93
+ user_identifier: {
94
+ id: number;
95
+ user_id: number;
96
+ created_at: Date;
97
+ updated_at: Date;
98
+ type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
99
+ value: string;
100
+ enabled: boolean;
101
+ verified_at: Date | null;
102
+ }[];
103
103
  user_session: {
104
104
  id: number;
105
- hash: string;
106
105
  user_id: number;
107
106
  user_agent: string;
108
107
  created_at: Date;
109
108
  updated_at: Date;
109
+ hash: string;
110
110
  ip_address: string;
111
- expires_at: Date;
112
111
  revoked_at: Date | null;
112
+ expires_at: Date;
113
113
  }[];
114
114
  } & {
115
- name: string;
116
115
  id: number;
117
116
  created_at: Date;
118
- updated_at: Date;
117
+ name: string;
119
118
  photo_id: number | null;
120
119
  suspended_until: Date | null;
121
120
  last_login_at: Date | null;
122
121
  suspended_reason: string | null;
123
122
  deactivated_at: Date | null;
123
+ updated_at: Date;
124
124
  }>;
125
125
  createWithEmailAndPassword(locale: string, { email, name, password }: CreateWithEmailAndPasswordDTO): Promise<{
126
126
  user: {
127
- name: string;
128
127
  id: number;
129
128
  created_at: Date;
130
- updated_at: Date;
129
+ name: string;
131
130
  photo_id: number | null;
132
131
  suspended_until: Date | null;
133
132
  last_login_at: Date | null;
134
133
  suspended_reason: string | null;
135
134
  deactivated_at: Date | null;
135
+ updated_at: Date;
136
136
  };
137
137
  challenge: {
138
138
  challengeId: number;
139
139
  };
140
140
  }>;
141
141
  update(locale: string, userId: number, { name }: UpdateDTO): Promise<{
142
- name: string;
143
142
  id: number;
144
143
  created_at: Date;
145
- updated_at: Date;
144
+ name: string;
146
145
  photo_id: number | null;
147
146
  suspended_until: Date | null;
148
147
  last_login_at: Date | null;
149
148
  suspended_reason: string | null;
150
149
  deactivated_at: Date | null;
150
+ updated_at: Date;
151
151
  }>;
152
152
  resetPassword(locale: string, userId: number, { password }: ResetPasswordDTO): Promise<{
153
153
  password: string;
@@ -160,16 +160,6 @@ export declare class UserService {
160
160
  }>;
161
161
  openPublicAvatar(locale: string, fileId: number, ifNoneMatch: string | undefined, res: any): Promise<void>;
162
162
  findUserById(locale: string, id: number): Promise<{
163
- user_identifier: {
164
- type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
165
- id: number;
166
- value: string;
167
- enabled: boolean;
168
- user_id: number;
169
- created_at: Date;
170
- updated_at: Date;
171
- verified_at: Date | null;
172
- }[];
173
163
  role_user: ({
174
164
  role: {
175
165
  id: number;
@@ -186,99 +176,109 @@ export declare class UserService {
186
176
  })[];
187
177
  user_account: {
188
178
  id: number;
189
- email: string | null;
190
- provider: import("@prisma/client").$Enums.user_account_provider_52222e2ecb_enum;
191
179
  user_id: number;
192
180
  created_at: Date;
193
181
  updated_at: Date;
194
- provider_user_id: string;
195
- scopes: string | null;
182
+ email: string | null;
196
183
  refresh_token: import("@prisma/client/runtime/library").Bytes | null;
184
+ provider: import("@prisma/client").$Enums.user_account_provider_52222e2ecb_enum;
185
+ scopes: string | null;
186
+ provider_user_id: string;
197
187
  token_expires_at: Date | null;
198
188
  }[];
199
189
  user_activity: {
200
190
  id: number;
201
- action: string;
202
191
  user_id: number;
203
192
  created_at: Date;
204
193
  updated_at: Date;
194
+ action: string;
205
195
  }[];
206
196
  user_credential: {
207
- type: import("@prisma/client").$Enums.user_credential_type_4466d7f008_enum;
208
197
  id: number;
209
- hash: string;
210
198
  user_id: number;
211
199
  created_at: Date;
212
200
  updated_at: Date;
213
- expires_at: Date | null;
201
+ type: import("@prisma/client").$Enums.user_credential_type_4466d7f008_enum;
202
+ hash: string;
214
203
  revoked_at: Date | null;
204
+ expires_at: Date | null;
215
205
  requires_reset: boolean;
216
206
  }[];
207
+ user_identifier: {
208
+ id: number;
209
+ user_id: number;
210
+ created_at: Date;
211
+ updated_at: Date;
212
+ type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
213
+ value: string;
214
+ enabled: boolean;
215
+ verified_at: Date | null;
216
+ }[];
217
217
  user_session: {
218
218
  id: number;
219
- hash: string;
220
219
  user_id: number;
221
220
  user_agent: string;
222
221
  created_at: Date;
223
222
  updated_at: Date;
223
+ hash: string;
224
224
  ip_address: string;
225
- expires_at: Date;
226
225
  revoked_at: Date | null;
226
+ expires_at: Date;
227
227
  }[];
228
228
  } & {
229
- name: string;
230
229
  id: number;
231
230
  created_at: Date;
232
- updated_at: Date;
231
+ name: string;
233
232
  photo_id: number | null;
234
233
  suspended_until: Date | null;
235
234
  last_login_at: Date | null;
236
235
  suspended_reason: string | null;
237
236
  deactivated_at: Date | null;
237
+ updated_at: Date;
238
238
  }>;
239
239
  findUserByEmail(_locale: string, email: string): Promise<{
240
- user_identifier: {
241
- type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
240
+ user_credential: {
242
241
  id: number;
243
- value: string;
244
- enabled: boolean;
245
242
  user_id: number;
246
243
  created_at: Date;
247
244
  updated_at: Date;
248
- verified_at: Date | null;
249
- }[];
250
- user_credential: {
251
245
  type: import("@prisma/client").$Enums.user_credential_type_4466d7f008_enum;
252
- id: number;
253
246
  hash: string;
247
+ revoked_at: Date | null;
248
+ expires_at: Date | null;
249
+ requires_reset: boolean;
250
+ }[];
251
+ user_identifier: {
252
+ id: number;
254
253
  user_id: number;
255
254
  created_at: Date;
256
255
  updated_at: Date;
257
- expires_at: Date | null;
258
- revoked_at: Date | null;
259
- requires_reset: boolean;
256
+ type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
257
+ value: string;
258
+ enabled: boolean;
259
+ verified_at: Date | null;
260
260
  }[];
261
261
  user_session: {
262
262
  id: number;
263
- hash: string;
264
263
  user_id: number;
265
264
  user_agent: string;
266
265
  created_at: Date;
267
266
  updated_at: Date;
267
+ hash: string;
268
268
  ip_address: string;
269
- expires_at: Date;
270
269
  revoked_at: Date | null;
270
+ expires_at: Date;
271
271
  }[];
272
272
  } & {
273
- name: string;
274
273
  id: number;
275
274
  created_at: Date;
276
- updated_at: Date;
275
+ name: string;
277
276
  photo_id: number | null;
278
277
  suspended_until: Date | null;
279
278
  last_login_at: Date | null;
280
279
  suspended_reason: string | null;
281
280
  deactivated_at: Date | null;
281
+ updated_at: Date;
282
282
  }>;
283
283
  getUserRoles(userId: number): Promise<{
284
284
  id: any;
@@ -314,10 +314,10 @@ export declare class UserService {
314
314
  }>;
315
315
  registerUserActivity(userId: number | null | undefined, action: string): Promise<{
316
316
  id: number;
317
- action: string;
318
317
  user_id: number;
319
318
  created_at: Date;
320
319
  updated_at: Date;
320
+ action: string;
321
321
  }>;
322
322
  private validateDeleteIds;
323
323
  private deleteOldAvatar;
@@ -20,10 +20,10 @@ export declare class WebhookIntegrationController {
20
20
  name: string;
21
21
  }): Promise<{
22
22
  rawToken: string;
23
- name: string;
24
- type: string;
25
23
  id: number;
26
24
  created_at: Date;
25
+ name: string;
26
+ type: string;
27
27
  token_prefix: string;
28
28
  }>;
29
29
  listInternalRoutes(): Promise<any>;
@@ -53,10 +53,10 @@ export declare class WebhookIntegrationService {
53
53
  listUserApiTokens(userId: number): Promise<any>;
54
54
  createUserApiToken(userId: number, name: string): Promise<{
55
55
  rawToken: string;
56
- name: string;
57
- type: string;
58
56
  id: number;
59
57
  created_at: Date;
58
+ name: string;
59
+ type: string;
60
60
  token_prefix: string;
61
61
  }>;
62
62
  listInternalRoutes(): Promise<any>;
@@ -417,32 +417,6 @@
417
417
  subgroup_id:
418
418
  where:
419
419
  slug: session-management
420
- - slug: admin-login-page-oauth-providers
421
- type: array
422
- component: checkbox
423
- name:
424
- en: Administration Login Page
425
- pt: Página de Login da Administração
426
- description:
427
- en: Select which enabled OAuth providers are shown on the Admin login page
428
- pt: Selecione quais provedores OAuth habilitados serão exibidos na página de login do Admin
429
- value: '["facebook","github","google","microsoft","microsoft-entra-id"]'
430
- user_override: false
431
- relations:
432
- setting_list:
433
- - value: facebook
434
- order: 0
435
- - value: github
436
- order: 1
437
- - value: google
438
- order: 2
439
- - value: microsoft
440
- order: 3
441
- - value: microsoft-entra-id
442
- order: 4
443
- subgroup_id:
444
- where:
445
- slug: admin-login-page
446
420
  - slug: localization
447
421
  icon: world
448
422
  name:
@@ -103,14 +103,6 @@ const OAUTH_PROFILE_SLUG_TO_PROVIDER: Record<string, string> = {
103
103
  'oauth-microsoft-profile-id': 'microsoft-oauth',
104
104
  'oauth-microsoft-entra-id-profile-id': 'microsoft-entra-id-oauth',
105
105
  };
106
- const ADMIN_LOGIN_OAUTH_SETTING_SLUG = 'admin-login-page-oauth-providers';
107
- const ADMIN_LOGIN_PROVIDER_ENABLED_SLUG_BY_PROVIDER: Record<string, string> = {
108
- facebook: 'oauth-facebook-enabled',
109
- github: 'oauth-github-enabled',
110
- google: 'oauth-google-enabled',
111
- microsoft: 'oauth-microsoft-enabled',
112
- 'microsoft-entra-id': 'oauth-microsoft-entra-id-enabled',
113
- };
114
106
  const INTEGRATION_PROFILE_PICKER_SLUGS = [
115
107
  'file-storage-profile-id',
116
108
  ...AI_PROFILE_SETTING_SLUGS,
@@ -524,8 +516,6 @@ export const SettingField = ({ setting, className }: SettingFieldProps) => {
524
516
  const selectedValues: string[] = Array.isArray(parsedValue)
525
517
  ? parsedValue
526
518
  : [];
527
- const isAdminLoginOAuthSetting =
528
- setting.slug === ADMIN_LOGIN_OAUTH_SETTING_SLUG;
529
519
 
530
520
  return (
531
521
  <div
@@ -535,25 +525,12 @@ export const SettingField = ({ setting, className }: SettingFieldProps) => {
535
525
  )}
536
526
  >
537
527
  {options.map((option) => {
538
- const enabledSettingSlug =
539
- ADMIN_LOGIN_PROVIDER_ENABLED_SLUG_BY_PROVIDER[option.value];
540
- const isProviderGloballyEnabled = enabledSettingSlug
541
- ? getSettingValue(enabledSettingSlug) === true
542
- : true;
543
- const isOptionDisabled =
544
- isAdminLoginOAuthSetting && !isProviderGloballyEnabled;
545
-
546
528
  return (
547
529
  <div key={option.id} className="flex items-center space-x-2">
548
530
  <Checkbox
549
531
  className="bg-background"
550
532
  checked={selectedValues.includes(option.value)}
551
- disabled={isOptionDisabled}
552
533
  onCheckedChange={(checked) => {
553
- if (isOptionDisabled) {
554
- return;
555
- }
556
-
557
534
  let newValues = [...selectedValues];
558
535
  if (checked) {
559
536
  newValues.push(option.value);
@@ -565,19 +542,10 @@ export const SettingField = ({ setting, className }: SettingFieldProps) => {
565
542
  handleChangeValue(formatValue(newValues), true);
566
543
  }}
567
544
  />
568
- <Label className={cn(isOptionDisabled && 'opacity-60')}>
569
- {option.value}
570
- </Label>
545
+ <Label>{option.value}</Label>
571
546
  </div>
572
547
  );
573
548
  })}
574
- {isAdminLoginOAuthSetting && (
575
- <p className="text-xs text-muted-foreground">
576
- {currentLocaleCode.startsWith('pt')
577
- ? 'Providers desabilitados globalmente (oauth-*-enabled = false) ficam indisponíveis nesta lista.'
578
- : 'Providers disabled globally (oauth-*-enabled = false) are unavailable in this list.'}
579
- </p>
580
- )}
581
549
  </div>
582
550
  );
583
551
  }
@@ -0,0 +1,9 @@
1
+ columns:
2
+ - name: scope
3
+ type: VARCHAR
4
+ length: 64
5
+ isPrimaryKey: true
6
+ - name: version
7
+ type: BIGINT
8
+ default: 0
9
+ - type: updated_at
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@hed-hog/core",
3
- "version": "0.0.360",
3
+ "version": "0.0.361",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
7
7
  "@aws-sdk/client-s3": "^3.1014.0",
8
+ "@aws-sdk/client-sts": "3.1014.0",
8
9
  "@aws-sdk/s3-request-presigner": "^3.1014.0",
9
10
  "@azure/storage-blob": "^12.27.0",
10
11
  "@google-cloud/storage": "^7.16.0",
@@ -35,9 +36,9 @@
35
36
  "@modelcontextprotocol/sdk": "^1.12.0",
36
37
  "@hed-hog/api-locale": "0.0.14",
37
38
  "@hed-hog/api-mail": "0.0.9",
38
- "@hed-hog/api-pagination": "0.0.7",
39
- "@hed-hog/api-prisma": "0.0.6",
40
39
  "@hed-hog/api": "0.0.8",
40
+ "@hed-hog/api-prisma": "0.0.6",
41
+ "@hed-hog/api-pagination": "0.0.7",
41
42
  "@hed-hog/api-types": "0.0.1"
42
43
  },
43
44
  "exports": {
@@ -1,3 +1,9 @@
1
+ import { HeadObjectCommand, S3Client } from '@aws-sdk/client-s3';
2
+ import {
3
+ AssumeRoleCommand,
4
+ GetSessionTokenCommand,
5
+ STSClient,
6
+ } from '@aws-sdk/client-sts';
1
7
  import { getLocaleText } from '@hed-hog/api-locale';
2
8
  import { PaginationDTO, PaginationService } from '@hed-hog/api-pagination';
3
9
  import { PrismaService } from '@hed-hog/api-prisma';
@@ -666,6 +672,88 @@ export class FileService implements OnModuleInit {
666
672
  return url;
667
673
  }
668
674
 
675
+ async getTemporaryCredentials(params: {
676
+ accessKeyId: string;
677
+ secretAccessKey: string;
678
+ sessionToken?: string;
679
+ region: string;
680
+ roleArn?: string;
681
+ externalId?: string;
682
+ durationSeconds: number;
683
+ sessionName: string;
684
+ }): Promise<{
685
+ AccessKeyId: string;
686
+ SecretAccessKey: string;
687
+ SessionToken: string;
688
+ Expiration?: Date;
689
+ }> {
690
+ const stsClient = new STSClient({
691
+ region: params.region,
692
+ credentials: {
693
+ accessKeyId: params.accessKeyId,
694
+ secretAccessKey: params.secretAccessKey,
695
+ ...(params.sessionToken ? { sessionToken: params.sessionToken } : {}),
696
+ },
697
+ });
698
+
699
+ let creds: { AccessKeyId?: string; SecretAccessKey?: string; SessionToken?: string; Expiration?: Date } | undefined;
700
+
701
+ if (params.roleArn) {
702
+ const result = await stsClient.send(
703
+ new AssumeRoleCommand({
704
+ RoleArn: params.roleArn,
705
+ RoleSessionName: params.sessionName,
706
+ DurationSeconds: params.durationSeconds,
707
+ ...(params.externalId ? { ExternalId: params.externalId } : {}),
708
+ }),
709
+ );
710
+ creds = result.Credentials;
711
+ } else {
712
+ const result = await stsClient.send(
713
+ new GetSessionTokenCommand({ DurationSeconds: params.durationSeconds }),
714
+ );
715
+ creds = result.Credentials;
716
+ }
717
+
718
+ if (!creds?.AccessKeyId || !creds.SecretAccessKey || !creds.SessionToken) {
719
+ throw new BadRequestException('Could not generate temporary AWS credentials.');
720
+ }
721
+
722
+ return {
723
+ AccessKeyId: creds.AccessKeyId,
724
+ SecretAccessKey: creds.SecretAccessKey,
725
+ SessionToken: creds.SessionToken,
726
+ Expiration: creds.Expiration,
727
+ };
728
+ }
729
+
730
+ async headS3Object(params: {
731
+ accessKeyId: string;
732
+ secretAccessKey: string;
733
+ sessionToken?: string;
734
+ region: string;
735
+ bucket: string;
736
+ key: string;
737
+ }): Promise<{ ContentLength?: number; ETag?: string }> {
738
+ const s3 = new S3Client({
739
+ region: params.region,
740
+ credentials: {
741
+ accessKeyId: params.accessKeyId,
742
+ secretAccessKey: params.secretAccessKey,
743
+ ...(params.sessionToken ? { sessionToken: params.sessionToken } : {}),
744
+ },
745
+ });
746
+
747
+ const result = await s3.send(
748
+ new HeadObjectCommand({ Bucket: params.bucket, Key: params.key }),
749
+ );
750
+
751
+ return {
752
+ ContentLength: result.ContentLength,
753
+ ETag: result.ETag,
754
+ };
755
+ }
756
+
669
757
  createDownloadToken(filepath: string, expires = 3600) {
670
758
  if (!filepath) {
671
759
  throw new BadRequestException(`No file path provided`);
@@ -471,7 +471,6 @@ export class SettingService implements OnModuleInit, OnModuleDestroy {
471
471
  'oauth-google-enabled',
472
472
  'oauth-microsoft-enabled',
473
473
  'oauth-microsoft-entra-id-enabled',
474
- 'admin-login-page-oauth-providers',
475
474
  'disable-authentication-with-email-and-password',
476
475
  'contact-allow-company-registration',
477
476
  'operations.comment-edit-window',