@fonoster/identity 0.26.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +25 -0
  2. package/dist/allowList.d.ts +4 -0
  3. package/dist/allowList.js +7 -1
  4. package/dist/apikeys/createCreateApiKey.js +16 -0
  5. package/dist/apikeys/createDeleteApiKey.js +22 -2
  6. package/dist/apikeys/createListApiKeys.js +14 -0
  7. package/dist/apikeys/createRegenerateApiKey.js +23 -2
  8. package/dist/config/index.d.ts +20 -0
  9. package/dist/config/index.js +36 -0
  10. package/dist/config/publishedKeys.d.ts +9 -0
  11. package/dist/config/publishedKeys.js +56 -0
  12. package/dist/config/schemas.d.ts +392 -0
  13. package/dist/config/schemas.js +163 -0
  14. package/dist/config/toIdentityConfig.d.ts +19 -0
  15. package/dist/config/toIdentityConfig.js +93 -0
  16. package/dist/constants.d.ts +28 -0
  17. package/dist/constants.js +29 -1
  18. package/dist/exchanges/createExchangeApiKey.js +4 -1
  19. package/dist/exchanges/createExchangeCredentials.d.ts +6 -1
  20. package/dist/exchanges/createExchangeCredentials.js +20 -2
  21. package/dist/exchanges/createExchangeOauth2Code.js +25 -2
  22. package/dist/exchanges/createExchangeRefreshToken.d.ts +9 -1
  23. package/dist/exchanges/createExchangeRefreshToken.js +57 -13
  24. package/dist/exchanges/createExchangeVerificationCode.d.ts +35 -0
  25. package/dist/exchanges/createExchangeVerificationCode.js +95 -0
  26. package/dist/exchanges/createRevokeToken.d.ts +33 -0
  27. package/dist/exchanges/createRevokeToken.js +64 -0
  28. package/dist/exchanges/exchangeTokens.d.ts +3 -1
  29. package/dist/exchanges/exchangeTokens.js +23 -5
  30. package/dist/exchanges/index.d.ts +2 -0
  31. package/dist/exchanges/index.js +2 -0
  32. package/dist/exchanges/payloads/users/createGetIdTokenPayload.js +3 -2
  33. package/dist/exchanges/refreshTokens.d.ts +30 -0
  34. package/dist/exchanges/refreshTokens.js +101 -0
  35. package/dist/exchanges/types.d.ts +53 -2
  36. package/dist/generated/@prisma/client/edge.js +32 -9
  37. package/dist/generated/@prisma/client/index-browser.js +24 -1
  38. package/dist/generated/@prisma/client/index.d.ts +3233 -417
  39. package/dist/generated/@prisma/client/index.js +34 -11
  40. package/dist/generated/@prisma/client/{libquery_engine-darwin-arm64.dylib.node → libquery_engine-debian-openssl-3.0.x.so.node} +0 -0
  41. package/dist/generated/@prisma/client/package.json +1 -1
  42. package/dist/generated/@prisma/client/schema.prisma +47 -7
  43. package/dist/generated/@prisma/client/wasm.js +32 -9
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.js +1 -0
  46. package/dist/server/config.d.ts +286 -55
  47. package/dist/server/config.js +74 -108
  48. package/dist/server/index.js +5 -3
  49. package/dist/service.d.ts +6 -0
  50. package/dist/service.js +11 -4
  51. package/dist/users/createCreateUser.d.ts +6 -1
  52. package/dist/users/createCreateUser.js +17 -9
  53. package/dist/users/createCreateUserWithOauth2Code.js +19 -15
  54. package/dist/users/createResetPassword.d.ts +5 -0
  55. package/dist/users/createResetPassword.js +33 -7
  56. package/dist/users/createSendResetPasswordCode.d.ts +6 -0
  57. package/dist/users/createSendResetPasswordCode.js +33 -1
  58. package/dist/users/createUpdateUser.d.ts +7 -0
  59. package/dist/users/createUpdateUser.js +41 -8
  60. package/dist/users/createUserFromGitHub.d.ts +40 -0
  61. package/dist/users/createUserFromGitHub.js +27 -0
  62. package/dist/users/index.d.ts +1 -0
  63. package/dist/users/index.js +1 -0
  64. package/dist/users/migratePasswordStorage.d.ts +7 -0
  65. package/dist/users/migratePasswordStorage.js +47 -0
  66. package/dist/users/types.d.ts +3 -1
  67. package/dist/users/upsertDefaultUser.js +6 -14
  68. package/dist/utils/authMethods.d.ts +31 -0
  69. package/dist/utils/authMethods.js +44 -0
  70. package/dist/utils/claimUnverifiedAccount.d.ts +35 -0
  71. package/dist/utils/claimUnverifiedAccount.js +43 -0
  72. package/dist/utils/clientAddress.d.ts +26 -0
  73. package/dist/utils/clientAddress.js +9 -0
  74. package/dist/utils/createGenerateVerificationCode.d.ts +4 -0
  75. package/dist/utils/createGenerateVerificationCode.js +12 -2
  76. package/dist/utils/createGenerateWorkspaceInviteToken.js +3 -0
  77. package/dist/utils/createGetApiKeyByAccessKeyId.d.ts +5 -1
  78. package/dist/utils/createGetApiKeyByAccessKeyId.js +5 -0
  79. package/dist/utils/createGetUserByAccessKeyId.d.ts +3 -1
  80. package/dist/utils/createGetUserByEmail.d.ts +3 -1
  81. package/dist/utils/createGetUserByGitHubEmails.d.ts +41 -0
  82. package/dist/utils/createGetUserByGitHubEmails.js +31 -0
  83. package/dist/utils/createGetUserByWorkspaceAccessKeyId.d.ts +3 -1
  84. package/dist/utils/createIsValidVerificationCode.d.ts +5 -0
  85. package/dist/utils/createIsValidVerificationCode.js +34 -7
  86. package/dist/utils/createSendEmail.d.ts +2 -1
  87. package/dist/utils/createSendEmail.js +17 -0
  88. package/dist/utils/createUpdateMembershipStatus.js +10 -3
  89. package/dist/utils/generateOneTimePassword.d.ts +3 -0
  90. package/dist/utils/generateOneTimePassword.js +25 -0
  91. package/dist/utils/getGitHubUserWithOauth2Code.d.ts +20 -2
  92. package/dist/utils/getGitHubUserWithOauth2Code.js +41 -9
  93. package/dist/utils/isWorkspaceAdminCall.d.ts +8 -0
  94. package/dist/utils/isWorkspaceAdminCall.js +47 -0
  95. package/dist/utils/normalizeContact.d.ts +22 -0
  96. package/dist/utils/normalizeContact.js +28 -0
  97. package/dist/utils/passwords.d.ts +11 -0
  98. package/dist/utils/passwords.js +84 -0
  99. package/dist/utils/rateLimiter.d.ts +20 -0
  100. package/dist/utils/rateLimiter.js +108 -0
  101. package/dist/utils/signInThrottle.d.ts +47 -0
  102. package/dist/utils/signInThrottle.js +90 -0
  103. package/dist/utils/userPasswords.d.ts +25 -0
  104. package/dist/utils/userPasswords.js +98 -0
  105. package/dist/verification/createSendVerificationCode.js +27 -1
  106. package/dist/verification/createVerifyCode.js +10 -0
  107. package/dist/workspaces/createCreateWorkspace.d.ts +7 -1
  108. package/dist/workspaces/createCreateWorkspace.js +41 -5
  109. package/dist/workspaces/createDeleteWorkspace.d.ts +2 -1
  110. package/dist/workspaces/createDeleteWorkspace.js +16 -2
  111. package/dist/workspaces/createInviteUserToWorkspace.js +19 -17
  112. package/dist/workspaces/createResendWorkspaceMembershipInvitation.js +17 -2
  113. package/dist/workspaces/createUpdateWorkspace.js +18 -4
  114. package/dist/workspaces/createWorkspaceDirectory.d.ts +29 -0
  115. package/dist/workspaces/createWorkspaceDirectory.js +42 -0
  116. package/dist/workspaces/index.d.ts +1 -0
  117. package/dist/workspaces/index.js +1 -0
  118. package/package.json +7 -6
  119. package/dist/generated/@prisma/client/runtime/wasm.js +0 -35
@@ -1,5 +1,12 @@
1
1
  import { z } from "zod";
2
- import { IdentityConfig } from "../exchanges/types";
2
+ /**
3
+ * Configuration for the standalone Identity service: identity.json (or
4
+ * .jsonc/.yaml), found via --config, /opt/fonoster or ./config. Fields sit at
5
+ * the root of the file, as they always have; the same settings live under
6
+ * fonoster.yaml's `identity:` section when Identity is embedded in the API
7
+ * server. No environment variables, except ${VAR} in the database URL shared
8
+ * with the Postgres container.
9
+ */
3
10
  declare const identityServiceConfigSchema: z.ZodObject<{
4
11
  server: z.ZodDefault<z.ZodObject<{
5
12
  bindAddr: z.ZodDefault<z.ZodString>;
@@ -11,6 +18,60 @@ declare const identityServiceConfigSchema: z.ZodObject<{
11
18
  bindAddr?: string;
12
19
  httpBridgePort?: number;
13
20
  }>>;
21
+ logs: z.ZodDefault<z.ZodEffects<z.ZodObject<{
22
+ level: z.ZodDefault<z.ZodEnum<["error", "warn", "info", "http", "verbose", "debug", "silly"]>>;
23
+ format: z.ZodDefault<z.ZodEnum<["json", "text"]>>;
24
+ transport: z.ZodDefault<z.ZodEnum<["console", "fluent"]>>;
25
+ fluent: z.ZodOptional<z.ZodObject<{
26
+ host: z.ZodString;
27
+ port: z.ZodDefault<z.ZodNumber>;
28
+ tagPrefix: z.ZodDefault<z.ZodString>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ host?: string;
31
+ port?: number;
32
+ tagPrefix?: string;
33
+ }, {
34
+ host?: string;
35
+ port?: number;
36
+ tagPrefix?: string;
37
+ }>>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ format?: "text" | "json";
40
+ level?: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
41
+ fluent?: {
42
+ host?: string;
43
+ port?: number;
44
+ tagPrefix?: string;
45
+ };
46
+ transport?: "console" | "fluent";
47
+ }, {
48
+ format?: "text" | "json";
49
+ level?: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
50
+ fluent?: {
51
+ host?: string;
52
+ port?: number;
53
+ tagPrefix?: string;
54
+ };
55
+ transport?: "console" | "fluent";
56
+ }>, {
57
+ format?: "text" | "json";
58
+ level?: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
59
+ fluent?: {
60
+ host?: string;
61
+ port?: number;
62
+ tagPrefix?: string;
63
+ };
64
+ transport?: "console" | "fluent";
65
+ }, {
66
+ format?: "text" | "json";
67
+ level?: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
68
+ fluent?: {
69
+ host?: string;
70
+ port?: number;
71
+ tagPrefix?: string;
72
+ };
73
+ transport?: "console" | "fluent";
74
+ }>>;
14
75
  database: z.ZodObject<{
15
76
  url: z.ZodString;
16
77
  }, "strip", z.ZodTypeAny, {
@@ -20,8 +81,10 @@ declare const identityServiceConfigSchema: z.ZodObject<{
20
81
  }>;
21
82
  encryptionKey: z.ZodString;
22
83
  issuer: z.ZodString;
23
- audience: z.ZodString;
24
- keys: z.ZodEffects<z.ZodObject<{
84
+ audience: z.ZodDefault<z.ZodString>;
85
+ /** Where the accept-invite bridge redirects. Defaults to the issuer. */
86
+ appUrl: z.ZodOptional<z.ZodString>;
87
+ keys: z.ZodEffects<z.ZodDefault<z.ZodObject<{
25
88
  privateKey: z.ZodOptional<z.ZodString>;
26
89
  publicKey: z.ZodOptional<z.ZodString>;
27
90
  privateKeyPath: z.ZodOptional<z.ZodString>;
@@ -36,11 +99,11 @@ declare const identityServiceConfigSchema: z.ZodObject<{
36
99
  publicKey?: string;
37
100
  privateKeyPath?: string;
38
101
  publicKeyPath?: string;
39
- }>, {
40
- privateKey?: string;
41
- publicKey?: string;
42
- privateKeyPath?: string;
43
- publicKeyPath?: string;
102
+ }>>, {
103
+ privateKey: string;
104
+ publicKey: string;
105
+ privateKeyPath: string;
106
+ publicKeyPath: string;
44
107
  }, {
45
108
  privateKey?: string;
46
109
  publicKey?: string;
@@ -49,15 +112,15 @@ declare const identityServiceConfigSchema: z.ZodObject<{
49
112
  }>;
50
113
  tokens: z.ZodDefault<z.ZodObject<{
51
114
  accessTokenExpiresIn: z.ZodDefault<z.ZodString>;
52
- refreshTokenExpiresIn: z.ZodDefault<z.ZodString>;
53
115
  idTokenExpiresIn: z.ZodDefault<z.ZodString>;
116
+ refreshTokenExpiresIn: z.ZodDefault<z.ZodString>;
54
117
  }, "strip", z.ZodTypeAny, {
55
- idTokenExpiresIn?: string;
56
118
  accessTokenExpiresIn?: string;
119
+ idTokenExpiresIn?: string;
57
120
  refreshTokenExpiresIn?: string;
58
121
  }, {
59
- idTokenExpiresIn?: string;
60
122
  accessTokenExpiresIn?: string;
123
+ idTokenExpiresIn?: string;
61
124
  refreshTokenExpiresIn?: string;
62
125
  }>>;
63
126
  security: z.ZodDefault<z.ZodObject<{
@@ -71,8 +134,8 @@ declare const identityServiceConfigSchema: z.ZodObject<{
71
134
  twoFactorAuthenticationRequired?: boolean;
72
135
  }>>;
73
136
  invite: z.ZodDefault<z.ZodObject<{
74
- url: z.ZodDefault<z.ZodString>;
75
- failUrl: z.ZodDefault<z.ZodString>;
137
+ url: z.ZodOptional<z.ZodString>;
138
+ failUrl: z.ZodOptional<z.ZodString>;
76
139
  expiration: z.ZodDefault<z.ZodString>;
77
140
  }, "strip", z.ZodTypeAny, {
78
141
  url?: string;
@@ -83,12 +146,14 @@ declare const identityServiceConfigSchema: z.ZodObject<{
83
146
  failUrl?: string;
84
147
  expiration?: string;
85
148
  }>>;
86
- appUrl: z.ZodDefault<z.ZodString>;
87
- smtp: z.ZodOptional<z.ZodObject<{
149
+ smtp: z.ZodOptional<z.ZodObject<Omit<{
88
150
  host: z.ZodString;
89
- port: z.ZodNumber;
151
+ port: z.ZodDefault<z.ZodNumber>;
90
152
  secure: z.ZodDefault<z.ZodBoolean>;
91
153
  sender: z.ZodString;
154
+ user: z.ZodDefault<z.ZodString>;
155
+ password: z.ZodDefault<z.ZodString>;
156
+ }, "user" | "password"> & {
92
157
  auth: z.ZodDefault<z.ZodObject<{
93
158
  user: z.ZodDefault<z.ZodString>;
94
159
  pass: z.ZodDefault<z.ZodString>;
@@ -118,30 +183,64 @@ declare const identityServiceConfigSchema: z.ZodObject<{
118
183
  pass?: string;
119
184
  };
120
185
  }>>;
186
+ twilio: z.ZodOptional<z.ZodObject<{
187
+ phoneNumber: z.ZodString;
188
+ accountSid: z.ZodString;
189
+ authToken: z.ZodString;
190
+ }, "strip", z.ZodTypeAny, {
191
+ phoneNumber?: string;
192
+ accountSid?: string;
193
+ authToken?: string;
194
+ }, {
195
+ phoneNumber?: string;
196
+ accountSid?: string;
197
+ authToken?: string;
198
+ }>>;
121
199
  oauth2: z.ZodOptional<z.ZodObject<{
122
200
  github: z.ZodObject<{
123
201
  clientId: z.ZodString;
124
202
  clientSecret: z.ZodString;
203
+ url: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string>;
204
+ apiUrl: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string>;
125
205
  }, "strip", z.ZodTypeAny, {
206
+ url?: string;
126
207
  clientId?: string;
127
208
  clientSecret?: string;
209
+ apiUrl?: string;
128
210
  }, {
211
+ url?: string;
129
212
  clientId?: string;
130
213
  clientSecret?: string;
214
+ apiUrl?: string;
131
215
  }>;
132
216
  }, "strip", z.ZodTypeAny, {
133
217
  github?: {
218
+ url?: string;
134
219
  clientId?: string;
135
220
  clientSecret?: string;
221
+ apiUrl?: string;
136
222
  };
137
223
  }, {
138
224
  github?: {
225
+ url?: string;
139
226
  clientId?: string;
140
227
  clientSecret?: string;
228
+ apiUrl?: string;
141
229
  };
142
230
  }>>;
231
+ /** Sign-in methods and sign-up policy (`features.auth` in fonoster.yaml). */
232
+ auth: z.ZodDefault<z.ZodObject<{
233
+ methods: z.ZodDefault<z.ZodArray<z.ZodEnum<["password", "email_code", "github"]>, "atleastone">>;
234
+ signup: z.ZodDefault<z.ZodEnum<["invite", "open"]>>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ methods?: ["password" | "email_code" | "github", ...("password" | "email_code" | "github")[]];
237
+ signup?: "invite" | "open";
238
+ }, {
239
+ methods?: ["password" | "email_code" | "github", ...("password" | "email_code" | "github")[]];
240
+ signup?: "invite" | "open";
241
+ }>>;
143
242
  defaultUser: z.ZodOptional<z.ZodObject<{
144
- name: z.ZodString;
243
+ name: z.ZodDefault<z.ZodString>;
145
244
  email: z.ZodString;
146
245
  password: z.ZodString;
147
246
  }, "strip", z.ZodTypeAny, {
@@ -155,36 +254,38 @@ declare const identityServiceConfigSchema: z.ZodObject<{
155
254
  }>>;
156
255
  }, "strip", z.ZodTypeAny, {
157
256
  keys?: {
158
- privateKey?: string;
159
- publicKey?: string;
160
- privateKeyPath?: string;
161
- publicKeyPath?: string;
257
+ privateKey: string;
258
+ publicKey: string;
259
+ privateKeyPath: string;
260
+ publicKeyPath: string;
162
261
  };
163
- issuer?: string;
164
- audience?: string;
165
- server?: {
166
- bindAddr?: string;
167
- httpBridgePort?: number;
262
+ invite?: {
263
+ url?: string;
264
+ failUrl?: string;
265
+ expiration?: string;
168
266
  };
169
267
  database?: {
170
268
  url?: string;
171
269
  };
172
- encryptionKey?: string;
270
+ issuer?: string;
271
+ audience?: string;
173
272
  tokens?: {
174
- idTokenExpiresIn?: string;
175
273
  accessTokenExpiresIn?: string;
274
+ idTokenExpiresIn?: string;
176
275
  refreshTokenExpiresIn?: string;
177
276
  };
178
277
  security?: {
179
278
  contactVerificationRequired?: boolean;
180
279
  twoFactorAuthenticationRequired?: boolean;
181
280
  };
182
- invite?: {
183
- url?: string;
184
- failUrl?: string;
185
- expiration?: string;
281
+ oauth2?: {
282
+ github?: {
283
+ url?: string;
284
+ clientId?: string;
285
+ clientSecret?: string;
286
+ apiUrl?: string;
287
+ };
186
288
  };
187
- appUrl?: string;
188
289
  smtp?: {
189
290
  host?: string;
190
291
  port?: number;
@@ -195,12 +296,31 @@ declare const identityServiceConfigSchema: z.ZodObject<{
195
296
  pass?: string;
196
297
  };
197
298
  };
198
- oauth2?: {
199
- github?: {
200
- clientId?: string;
201
- clientSecret?: string;
299
+ twilio?: {
300
+ phoneNumber?: string;
301
+ accountSid?: string;
302
+ authToken?: string;
303
+ };
304
+ auth?: {
305
+ methods?: ["password" | "email_code" | "github", ...("password" | "email_code" | "github")[]];
306
+ signup?: "invite" | "open";
307
+ };
308
+ server?: {
309
+ bindAddr?: string;
310
+ httpBridgePort?: number;
311
+ };
312
+ logs?: {
313
+ format?: "text" | "json";
314
+ level?: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
315
+ fluent?: {
316
+ host?: string;
317
+ port?: number;
318
+ tagPrefix?: string;
202
319
  };
320
+ transport?: "console" | "fluent";
203
321
  };
322
+ encryptionKey?: string;
323
+ appUrl?: string;
204
324
  defaultUser?: {
205
325
  name?: string;
206
326
  email?: string;
@@ -213,31 +333,33 @@ declare const identityServiceConfigSchema: z.ZodObject<{
213
333
  privateKeyPath?: string;
214
334
  publicKeyPath?: string;
215
335
  };
216
- issuer?: string;
217
- audience?: string;
218
- server?: {
219
- bindAddr?: string;
220
- httpBridgePort?: number;
336
+ invite?: {
337
+ url?: string;
338
+ failUrl?: string;
339
+ expiration?: string;
221
340
  };
222
341
  database?: {
223
342
  url?: string;
224
343
  };
225
- encryptionKey?: string;
344
+ issuer?: string;
345
+ audience?: string;
226
346
  tokens?: {
227
- idTokenExpiresIn?: string;
228
347
  accessTokenExpiresIn?: string;
348
+ idTokenExpiresIn?: string;
229
349
  refreshTokenExpiresIn?: string;
230
350
  };
231
351
  security?: {
232
352
  contactVerificationRequired?: boolean;
233
353
  twoFactorAuthenticationRequired?: boolean;
234
354
  };
235
- invite?: {
236
- url?: string;
237
- failUrl?: string;
238
- expiration?: string;
355
+ oauth2?: {
356
+ github?: {
357
+ url?: string;
358
+ clientId?: string;
359
+ clientSecret?: string;
360
+ apiUrl?: string;
361
+ };
239
362
  };
240
- appUrl?: string;
241
363
  smtp?: {
242
364
  host?: string;
243
365
  port?: number;
@@ -248,12 +370,31 @@ declare const identityServiceConfigSchema: z.ZodObject<{
248
370
  pass?: string;
249
371
  };
250
372
  };
251
- oauth2?: {
252
- github?: {
253
- clientId?: string;
254
- clientSecret?: string;
373
+ twilio?: {
374
+ phoneNumber?: string;
375
+ accountSid?: string;
376
+ authToken?: string;
377
+ };
378
+ auth?: {
379
+ methods?: ["password" | "email_code" | "github", ...("password" | "email_code" | "github")[]];
380
+ signup?: "invite" | "open";
381
+ };
382
+ server?: {
383
+ bindAddr?: string;
384
+ httpBridgePort?: number;
385
+ };
386
+ logs?: {
387
+ format?: "text" | "json";
388
+ level?: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
389
+ fluent?: {
390
+ host?: string;
391
+ port?: number;
392
+ tagPrefix?: string;
255
393
  };
394
+ transport?: "console" | "fluent";
256
395
  };
396
+ encryptionKey?: string;
397
+ appUrl?: string;
257
398
  defaultUser?: {
258
399
  name?: string;
259
400
  email?: string;
@@ -261,16 +402,106 @@ declare const identityServiceConfigSchema: z.ZodObject<{
261
402
  };
262
403
  }>;
263
404
  type IdentityServiceConfig = z.infer<typeof identityServiceConfigSchema>;
405
+ /** Reads and validates the file only (no keys read), e.g. for provisioning. */
406
+ declare function loadConfigFile(argv?: string[]): {
407
+ config: {
408
+ keys?: {
409
+ privateKey: string;
410
+ publicKey: string;
411
+ privateKeyPath: string;
412
+ publicKeyPath: string;
413
+ };
414
+ invite?: {
415
+ url?: string;
416
+ failUrl?: string;
417
+ expiration?: string;
418
+ };
419
+ database?: {
420
+ url?: string;
421
+ };
422
+ issuer?: string;
423
+ audience?: string;
424
+ tokens?: {
425
+ accessTokenExpiresIn?: string;
426
+ idTokenExpiresIn?: string;
427
+ refreshTokenExpiresIn?: string;
428
+ };
429
+ security?: {
430
+ contactVerificationRequired?: boolean;
431
+ twoFactorAuthenticationRequired?: boolean;
432
+ };
433
+ oauth2?: {
434
+ github?: {
435
+ url?: string;
436
+ clientId?: string;
437
+ clientSecret?: string;
438
+ apiUrl?: string;
439
+ };
440
+ };
441
+ smtp?: {
442
+ host?: string;
443
+ port?: number;
444
+ secure?: boolean;
445
+ sender?: string;
446
+ auth?: {
447
+ user?: string;
448
+ pass?: string;
449
+ };
450
+ };
451
+ twilio?: {
452
+ phoneNumber?: string;
453
+ accountSid?: string;
454
+ authToken?: string;
455
+ };
456
+ auth?: {
457
+ methods?: ["password" | "email_code" | "github", ...("password" | "email_code" | "github")[]];
458
+ signup?: "invite" | "open";
459
+ };
460
+ server?: {
461
+ bindAddr?: string;
462
+ httpBridgePort?: number;
463
+ };
464
+ logs?: {
465
+ format?: "text" | "json";
466
+ level?: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
467
+ fluent?: {
468
+ host?: string;
469
+ port?: number;
470
+ tagPrefix?: string;
471
+ };
472
+ transport?: "console" | "fluent";
473
+ };
474
+ encryptionKey?: string;
475
+ appUrl?: string;
476
+ defaultUser?: {
477
+ name?: string;
478
+ email?: string;
479
+ password?: string;
480
+ };
481
+ };
482
+ databaseUrl: string;
483
+ };
264
484
  /** Loads and validates the service configuration from the file, failing fast. */
265
485
  declare function loadConfig(argv?: string[]): {
266
486
  bindAddr: string;
267
487
  httpBridgePort: number;
268
488
  appUrl: string;
489
+ logs: {
490
+ format?: "text" | "json";
491
+ level?: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
492
+ fluent?: {
493
+ host?: string;
494
+ port?: number;
495
+ tagPrefix?: string;
496
+ };
497
+ transport?: "console" | "fluent";
498
+ };
499
+ databaseUrl: string;
269
500
  defaultUser: {
270
501
  name?: string;
271
502
  email?: string;
272
503
  password?: string;
273
504
  };
274
- identityConfig: IdentityConfig;
505
+ identityConfig: import("..").IdentityConfig;
275
506
  };
276
- export { identityServiceConfigSchema, IdentityServiceConfig, loadConfig };
507
+ export { identityServiceConfigSchema, IdentityServiceConfig, loadConfig, loadConfigFile };