@fonoster/identity 0.27.0 → 0.31.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.
- package/README.md +25 -0
- package/dist/allowList.d.ts +4 -0
- package/dist/allowList.js +7 -1
- package/dist/apikeys/createCreateApiKey.js +16 -0
- package/dist/apikeys/createDeleteApiKey.js +22 -2
- package/dist/apikeys/createListApiKeys.js +14 -0
- package/dist/apikeys/createRegenerateApiKey.js +23 -2
- package/dist/config/index.d.ts +20 -0
- package/dist/config/index.js +36 -0
- package/dist/config/publishedKeys.d.ts +9 -0
- package/dist/config/publishedKeys.js +56 -0
- package/dist/config/schemas.d.ts +392 -0
- package/dist/config/schemas.js +163 -0
- package/dist/config/toIdentityConfig.d.ts +19 -0
- package/dist/config/toIdentityConfig.js +93 -0
- package/dist/constants.d.ts +28 -0
- package/dist/constants.js +29 -1
- package/dist/exchanges/createExchangeApiKey.js +4 -1
- package/dist/exchanges/createExchangeCredentials.d.ts +6 -1
- package/dist/exchanges/createExchangeCredentials.js +20 -2
- package/dist/exchanges/createExchangeOauth2Code.js +25 -2
- package/dist/exchanges/createExchangeRefreshToken.d.ts +9 -1
- package/dist/exchanges/createExchangeRefreshToken.js +57 -13
- package/dist/exchanges/createExchangeVerificationCode.d.ts +35 -0
- package/dist/exchanges/createExchangeVerificationCode.js +95 -0
- package/dist/exchanges/createRevokeToken.d.ts +33 -0
- package/dist/exchanges/createRevokeToken.js +64 -0
- package/dist/exchanges/exchangeTokens.d.ts +3 -1
- package/dist/exchanges/exchangeTokens.js +23 -5
- package/dist/exchanges/index.d.ts +2 -0
- package/dist/exchanges/index.js +2 -0
- package/dist/exchanges/payloads/users/createGetIdTokenPayload.js +3 -2
- package/dist/exchanges/refreshTokens.d.ts +30 -0
- package/dist/exchanges/refreshTokens.js +101 -0
- package/dist/exchanges/types.d.ts +53 -2
- package/dist/generated/@prisma/client/edge.js +27 -4
- package/dist/generated/@prisma/client/index-browser.js +24 -1
- package/dist/generated/@prisma/client/index.d.ts +3233 -417
- package/dist/generated/@prisma/client/index.js +31 -8
- package/dist/generated/@prisma/client/package.json +1 -1
- package/dist/generated/@prisma/client/runtime/edge-esm.js +2 -2
- package/dist/generated/@prisma/client/runtime/edge.js +2 -2
- package/dist/generated/@prisma/client/runtime/library.js +2 -2
- package/dist/generated/@prisma/client/runtime/react-native.js +2 -2
- package/dist/generated/@prisma/client/runtime/wasm-compiler-edge.js +2 -2
- package/dist/generated/@prisma/client/runtime/wasm-engine-edge.js +2 -2
- package/dist/generated/@prisma/client/schema.prisma +47 -7
- package/dist/generated/@prisma/client/wasm.js +27 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/server/config.d.ts +286 -55
- package/dist/server/config.js +73 -108
- package/dist/server/index.js +5 -3
- package/dist/service.d.ts +6 -0
- package/dist/service.js +11 -4
- package/dist/users/createCreateUser.d.ts +6 -1
- package/dist/users/createCreateUser.js +17 -9
- package/dist/users/createCreateUserWithOauth2Code.js +19 -15
- package/dist/users/createResetPassword.d.ts +5 -0
- package/dist/users/createResetPassword.js +33 -7
- package/dist/users/createSendResetPasswordCode.d.ts +6 -0
- package/dist/users/createSendResetPasswordCode.js +33 -1
- package/dist/users/createUpdateUser.d.ts +7 -0
- package/dist/users/createUpdateUser.js +41 -8
- package/dist/users/createUserFromGitHub.d.ts +40 -0
- package/dist/users/createUserFromGitHub.js +27 -0
- package/dist/users/index.d.ts +1 -0
- package/dist/users/index.js +1 -0
- package/dist/users/migratePasswordStorage.d.ts +7 -0
- package/dist/users/migratePasswordStorage.js +47 -0
- package/dist/users/types.d.ts +3 -1
- package/dist/users/upsertDefaultUser.js +6 -14
- package/dist/utils/authMethods.d.ts +31 -0
- package/dist/utils/authMethods.js +44 -0
- package/dist/utils/claimUnverifiedAccount.d.ts +35 -0
- package/dist/utils/claimUnverifiedAccount.js +43 -0
- package/dist/utils/clientAddress.d.ts +26 -0
- package/dist/utils/clientAddress.js +9 -0
- package/dist/utils/createGenerateVerificationCode.d.ts +4 -0
- package/dist/utils/createGenerateVerificationCode.js +12 -2
- package/dist/utils/createGenerateWorkspaceInviteToken.js +3 -0
- package/dist/utils/createGetApiKeyByAccessKeyId.d.ts +5 -1
- package/dist/utils/createGetApiKeyByAccessKeyId.js +5 -0
- package/dist/utils/createGetUserByAccessKeyId.d.ts +3 -1
- package/dist/utils/createGetUserByEmail.d.ts +3 -1
- package/dist/utils/createGetUserByGitHubEmails.d.ts +41 -0
- package/dist/utils/createGetUserByGitHubEmails.js +31 -0
- package/dist/utils/createGetUserByWorkspaceAccessKeyId.d.ts +3 -1
- package/dist/utils/createIsValidVerificationCode.d.ts +5 -0
- package/dist/utils/createIsValidVerificationCode.js +34 -7
- package/dist/utils/createSendEmail.d.ts +2 -1
- package/dist/utils/createSendEmail.js +17 -0
- package/dist/utils/createUpdateMembershipStatus.js +10 -3
- package/dist/utils/generateOneTimePassword.d.ts +3 -0
- package/dist/utils/generateOneTimePassword.js +25 -0
- package/dist/utils/getGitHubUserWithOauth2Code.d.ts +20 -2
- package/dist/utils/getGitHubUserWithOauth2Code.js +41 -9
- package/dist/utils/hasAccessToResource.js +4 -5
- package/dist/utils/isWorkspaceAdminCall.d.ts +8 -0
- package/dist/utils/isWorkspaceAdminCall.js +47 -0
- package/dist/utils/normalizeContact.d.ts +22 -0
- package/dist/utils/normalizeContact.js +28 -0
- package/dist/utils/passwords.d.ts +11 -0
- package/dist/utils/passwords.js +84 -0
- package/dist/utils/rateLimiter.d.ts +20 -0
- package/dist/utils/rateLimiter.js +108 -0
- package/dist/utils/signInThrottle.d.ts +47 -0
- package/dist/utils/signInThrottle.js +90 -0
- package/dist/utils/userPasswords.d.ts +25 -0
- package/dist/utils/userPasswords.js +98 -0
- package/dist/utils/withAccess.js +3 -2
- package/dist/verification/createSendVerificationCode.js +27 -1
- package/dist/verification/createVerifyCode.js +10 -0
- package/dist/workspaces/createCreateWorkspace.d.ts +7 -1
- package/dist/workspaces/createCreateWorkspace.js +41 -5
- package/dist/workspaces/createDeleteWorkspace.d.ts +2 -1
- package/dist/workspaces/createDeleteWorkspace.js +16 -2
- package/dist/workspaces/createInviteUserToWorkspace.js +19 -17
- package/dist/workspaces/createResendWorkspaceMembershipInvitation.js +17 -2
- package/dist/workspaces/createUpdateWorkspace.js +18 -4
- package/dist/workspaces/createWorkspaceDirectory.d.ts +29 -0
- package/dist/workspaces/createWorkspaceDirectory.js +42 -0
- package/dist/workspaces/index.d.ts +1 -0
- package/dist/workspaces/index.js +1 -0
- package/package.json +11 -8
- package/dist/generated/@prisma/client/libquery_engine-darwin-arm64.dylib.node +0 -0
- package/dist/generated/@prisma/client/runtime/wasm.js +0 -35
|
@@ -100,6 +100,8 @@ exports.Prisma.UserScalarFieldEnum = {
|
|
|
100
100
|
email: 'email',
|
|
101
101
|
emailVerified: 'emailVerified',
|
|
102
102
|
password: 'password',
|
|
103
|
+
passwordDigest: 'passwordDigest',
|
|
104
|
+
mustChangePassword: 'mustChangePassword',
|
|
103
105
|
phoneNumber: 'phoneNumber',
|
|
104
106
|
phoneNumberVerified: 'phoneNumberVerified',
|
|
105
107
|
avatar: 'avatar',
|
|
@@ -112,6 +114,7 @@ exports.Prisma.WorkspaceScalarFieldEnum = {
|
|
|
112
114
|
ref: 'ref',
|
|
113
115
|
accessKeyId: 'accessKeyId',
|
|
114
116
|
name: 'name',
|
|
117
|
+
region: 'region',
|
|
115
118
|
createdAt: 'createdAt',
|
|
116
119
|
updatedAt: 'updatedAt',
|
|
117
120
|
ownerRef: 'ownerRef'
|
|
@@ -138,12 +141,30 @@ exports.Prisma.ApiKeyScalarFieldEnum = {
|
|
|
138
141
|
workspaceRef: 'workspaceRef'
|
|
139
142
|
};
|
|
140
143
|
|
|
144
|
+
exports.Prisma.RateLimitWindowScalarFieldEnum = {
|
|
145
|
+
key: 'key',
|
|
146
|
+
startedAt: 'startedAt',
|
|
147
|
+
count: 'count'
|
|
148
|
+
};
|
|
149
|
+
|
|
141
150
|
exports.Prisma.VerificationCodeScalarFieldEnum = {
|
|
142
151
|
ref: 'ref',
|
|
143
152
|
type: 'type',
|
|
144
153
|
code: 'code',
|
|
145
154
|
value: 'value',
|
|
146
155
|
expiresAt: 'expiresAt',
|
|
156
|
+
attempts: 'attempts',
|
|
157
|
+
consumedAt: 'consumedAt',
|
|
158
|
+
createdAt: 'createdAt'
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
exports.Prisma.RefreshTokenScalarFieldEnum = {
|
|
162
|
+
jti: 'jti',
|
|
163
|
+
familyId: 'familyId',
|
|
164
|
+
accessKeyId: 'accessKeyId',
|
|
165
|
+
expiresAt: 'expiresAt',
|
|
166
|
+
usedAt: 'usedAt',
|
|
167
|
+
revokedAt: 'revokedAt',
|
|
147
168
|
createdAt: 'createdAt'
|
|
148
169
|
};
|
|
149
170
|
|
|
@@ -194,7 +215,9 @@ exports.Prisma.ModelName = {
|
|
|
194
215
|
Workspace: 'Workspace',
|
|
195
216
|
WorkspaceMember: 'WorkspaceMember',
|
|
196
217
|
ApiKey: 'ApiKey',
|
|
197
|
-
|
|
218
|
+
RateLimitWindow: 'RateLimitWindow',
|
|
219
|
+
VerificationCode: 'VerificationCode',
|
|
220
|
+
RefreshToken: 'RefreshToken'
|
|
198
221
|
};
|
|
199
222
|
/**
|
|
200
223
|
* Create the Client
|
|
@@ -244,13 +267,13 @@ const config = {
|
|
|
244
267
|
}
|
|
245
268
|
}
|
|
246
269
|
},
|
|
247
|
-
"inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"src/generated/@prisma/client\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"APISERVER_IDENTITY_DATABASE_URL\")\n}\n\nmodel User {\n ref String @id @default(uuid())\n accessKeyId String @unique @map(\"access_key_id\") @db.VarChar(255)\n name String @db.VarChar(60)\n email String @unique @db.VarChar(255)\n emailVerified Boolean @default(false) @map(\"email_verified\")\n password String
|
|
248
|
-
"inlineSchemaHash": "
|
|
270
|
+
"inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"src/generated/@prisma/client\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"APISERVER_IDENTITY_DATABASE_URL\")\n}\n\nmodel User {\n ref String @id @default(uuid())\n accessKeyId String @unique @map(\"access_key_id\") @db.VarChar(255)\n name String @db.VarChar(60)\n email String @unique @db.VarChar(255)\n emailVerified Boolean @default(false) @map(\"email_verified\")\n /// Legacy reversible storage, cleared once password_digest is written.\n password String? @map(\"password_hash\") /// @encrypted\n /// scrypt digest: scrypt$N$r$p$salt$hash\n passwordDigest String? @map(\"password_digest\") @db.VarChar(255)\n /// Set for invitees holding a one-time password; cleared when they set their own.\n mustChangePassword Boolean @default(false) @map(\"must_change_password\")\n phoneNumber String? @map(\"phone_number\") @db.VarChar(20)\n phoneNumberVerified Boolean @default(false) @map(\"phone_number_verified\")\n avatar String? @db.VarChar(255)\n createdAt DateTime @default(now()) @map(\"created_at\") @db.Timestamptz(3)\n updatedAt DateTime @default(now()) @map(\"updated_at\") @db.Timestamptz(3)\n extended Json?\n\n // Relations\n ownedWorkspaces Workspace[] // Workspaces owned by the user\n memberships WorkspaceMember[] // Workspaces the user is a member of\n\n // Indexes and maps\n @@index([email], type: Hash)\n @@index([accessKeyId], type: Hash)\n @@map(\"users\")\n}\n\nmodel Workspace {\n ref String @id @default(uuid())\n accessKeyId String @unique @map(\"access_key_id\") @db.VarChar(255)\n name String @db.VarChar(60)\n /// A public region id (`default`, `us-east-1`) or a private region ref (rg_…). Immutable.\n region String @default(\"default\") @db.VarChar(64)\n createdAt DateTime @default(now()) @map(\"created_at\") @db.Timestamptz(3)\n updatedAt DateTime @default(now()) @map(\"updated_at\") @db.Timestamptz(3)\n\n // Relations\n owner User @relation(fields: [ownerRef], references: [ref], onDelete: Cascade)\n ownerRef String @map(\"owner_ref\")\n members WorkspaceMember[]\n apiKeys ApiKey[]\n\n // Indexes and maps\n @@index([accessKeyId], type: Hash)\n @@index([ownerRef], type: Hash)\n @@map(\"workspaces\")\n}\n\nmodel WorkspaceMember {\n ref String @id @default(uuid())\n status WorkspaceMemberStatus @default(PENDING)\n role Role @default(WORKSPACE_MEMBER)\n createdAt DateTime @default(now()) @map(\"created_at\") @db.Timestamptz(3)\n updatedAt DateTime @default(now()) @map(\"updated_at\") @db.Timestamptz(3)\n\n // Relations\n user User @relation(fields: [userRef], references: [ref], onDelete: Cascade)\n userRef String @map(\"user_ref\")\n workspace Workspace @relation(fields: [workspaceRef], references: [ref], onDelete: Cascade)\n workspaceRef String @map(\"workspace_ref\")\n\n @@unique([userRef, workspaceRef])\n @@map(\"workspace_members\")\n}\n\nmodel ApiKey {\n ref String @id @default(uuid())\n accessKeyId String @unique @map(\"access_key_id\") @db.VarChar(255)\n accessKeySecret String @map(\"access_key_secret\") @db.VarChar(255) /// @encrypted\n role Role @default(WORKSPACE_MEMBER)\n createdAt DateTime @default(now()) @map(\"created_at\") @db.Timestamptz(3)\n updatedAt DateTime @default(now()) @map(\"updated_at\") @db.Timestamptz(3)\n expiresAt DateTime? @map(\"expires_at\") @db.Timestamptz(3)\n\n // Relations\n workspace Workspace @relation(fields: [workspaceRef], references: [ref], onDelete: Cascade)\n workspaceRef String @map(\"workspace_ref\")\n\n // Indexes and maps\n @@index([accessKeyId], type: Hash)\n @@index([workspaceRef], type: Hash)\n @@map(\"api_keys\")\n}\n\n/// Fixed-window counters of the send and reset limits (verification codes, password resets),\n/// shared by every Identity replica (ST-4). Rows of past windows are pruned.\nmodel RateLimitWindow {\n key String @id @db.VarChar(255)\n startedAt DateTime @map(\"started_at\") @db.Timestamptz(3)\n count Int\n\n @@index([startedAt])\n @@map(\"rate_limit_windows\")\n}\n\nmodel VerificationCode {\n ref String @id @default(uuid())\n type VerificationType\n code String @db.VarChar(6)\n value String @db.VarChar(255)\n expiresAt DateTime @map(\"expires_at\") @db.Timestamptz(3)\n attempts Int @default(0)\n consumedAt DateTime? @map(\"consumed_at\") @db.Timestamptz(3)\n createdAt DateTime @default(now()) @map(\"created_at\") @db.Timestamptz(3)\n\n // Indexes and maps\n @@index([code], type: Hash)\n @@index([type, value])\n @@map(\"verification_codes\")\n}\n\n/// One issued refresh token. Each is good for a single exchange (rotation); a\n/// second use of the same token revokes its whole family (reuse detection).\nmodel RefreshToken {\n jti String @id @db.VarChar(64)\n /// Every token rotated from the same sign-in shares a family.\n familyId String @map(\"family_id\") @db.VarChar(64)\n /// The user or API key the token was issued to.\n accessKeyId String @map(\"access_key_id\") @db.VarChar(255)\n expiresAt DateTime @map(\"expires_at\") @db.Timestamptz(3)\n usedAt DateTime? @map(\"used_at\") @db.Timestamptz(3)\n revokedAt DateTime? @map(\"revoked_at\") @db.Timestamptz(3)\n createdAt DateTime @default(now()) @map(\"created_at\") @db.Timestamptz(3)\n\n // Indexes and maps\n @@index([familyId])\n @@index([accessKeyId])\n @@map(\"refresh_tokens\")\n}\n\nenum VerificationType {\n EMAIL\n PHONE\n}\n\nenum WorkspaceMemberStatus {\n PENDING\n ACTIVE\n\n @@map(\"workspace_member_status\")\n}\n\nenum Role {\n USER\n WORKSPACE_ADMIN\n WORKSPACE_OWNER\n WORKSPACE_MEMBER\n\n @@map(\"role\")\n}\n",
|
|
271
|
+
"inlineSchemaHash": "3a64b21aca7defddf14d44df5a93bd8aaabe3640888a650ecbd3f16df4ddd4d2",
|
|
249
272
|
"copyEngine": true
|
|
250
273
|
}
|
|
251
274
|
config.dirname = '/'
|
|
252
275
|
|
|
253
|
-
config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessKeyId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"access_key_id\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"emailVerified\",\"kind\":\"scalar\",\"type\":\"Boolean\",\"dbName\":\"email_verified\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"password_hash\"},{\"name\":\"phoneNumber\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"phone_number\"},{\"name\":\"phoneNumberVerified\",\"kind\":\"scalar\",\"type\":\"Boolean\",\"dbName\":\"phone_number_verified\"},{\"name\":\"avatar\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"extended\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"ownedWorkspaces\",\"kind\":\"object\",\"type\":\"Workspace\",\"relationName\":\"UserToWorkspace\"},{\"name\":\"memberships\",\"kind\":\"object\",\"type\":\"WorkspaceMember\",\"relationName\":\"UserToWorkspaceMember\"}],\"dbName\":\"users\"},\"Workspace\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessKeyId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"access_key_id\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"owner\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToWorkspace\"},{\"name\":\"ownerRef\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"owner_ref\"},{\"name\":\"members\",\"kind\":\"object\",\"type\":\"WorkspaceMember\",\"relationName\":\"WorkspaceToWorkspaceMember\"},{\"name\":\"apiKeys\",\"kind\":\"object\",\"type\":\"ApiKey\",\"relationName\":\"ApiKeyToWorkspace\"}],\"dbName\":\"workspaces\"},\"WorkspaceMember\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"WorkspaceMemberStatus\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"Role\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToWorkspaceMember\"},{\"name\":\"userRef\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"user_ref\"},{\"name\":\"workspace\",\"kind\":\"object\",\"type\":\"Workspace\",\"relationName\":\"WorkspaceToWorkspaceMember\"},{\"name\":\"workspaceRef\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"workspace_ref\"}],\"dbName\":\"workspace_members\"},\"ApiKey\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessKeyId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"access_key_id\"},{\"name\":\"accessKeySecret\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"access_key_secret\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"Role\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"expires_at\"},{\"name\":\"workspace\",\"kind\":\"object\",\"type\":\"Workspace\",\"relationName\":\"ApiKeyToWorkspace\"},{\"name\":\"workspaceRef\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"workspace_ref\"}],\"dbName\":\"api_keys\"},\"VerificationCode\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"VerificationType\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"expires_at\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"}],\"dbName\":\"verification_codes\"}},\"enums\":{},\"types\":{}}")
|
|
276
|
+
config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessKeyId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"access_key_id\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"emailVerified\",\"kind\":\"scalar\",\"type\":\"Boolean\",\"dbName\":\"email_verified\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"password_hash\"},{\"name\":\"passwordDigest\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"password_digest\"},{\"name\":\"mustChangePassword\",\"kind\":\"scalar\",\"type\":\"Boolean\",\"dbName\":\"must_change_password\"},{\"name\":\"phoneNumber\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"phone_number\"},{\"name\":\"phoneNumberVerified\",\"kind\":\"scalar\",\"type\":\"Boolean\",\"dbName\":\"phone_number_verified\"},{\"name\":\"avatar\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"extended\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"ownedWorkspaces\",\"kind\":\"object\",\"type\":\"Workspace\",\"relationName\":\"UserToWorkspace\"},{\"name\":\"memberships\",\"kind\":\"object\",\"type\":\"WorkspaceMember\",\"relationName\":\"UserToWorkspaceMember\"}],\"dbName\":\"users\"},\"Workspace\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessKeyId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"access_key_id\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"region\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"owner\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToWorkspace\"},{\"name\":\"ownerRef\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"owner_ref\"},{\"name\":\"members\",\"kind\":\"object\",\"type\":\"WorkspaceMember\",\"relationName\":\"WorkspaceToWorkspaceMember\"},{\"name\":\"apiKeys\",\"kind\":\"object\",\"type\":\"ApiKey\",\"relationName\":\"ApiKeyToWorkspace\"}],\"dbName\":\"workspaces\"},\"WorkspaceMember\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"WorkspaceMemberStatus\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"Role\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToWorkspaceMember\"},{\"name\":\"userRef\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"user_ref\"},{\"name\":\"workspace\",\"kind\":\"object\",\"type\":\"Workspace\",\"relationName\":\"WorkspaceToWorkspaceMember\"},{\"name\":\"workspaceRef\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"workspace_ref\"}],\"dbName\":\"workspace_members\"},\"ApiKey\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessKeyId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"access_key_id\"},{\"name\":\"accessKeySecret\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"access_key_secret\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"Role\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"expires_at\"},{\"name\":\"workspace\",\"kind\":\"object\",\"type\":\"Workspace\",\"relationName\":\"ApiKeyToWorkspace\"},{\"name\":\"workspaceRef\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"workspace_ref\"}],\"dbName\":\"api_keys\"},\"RateLimitWindow\":{\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"startedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"started_at\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":\"rate_limit_windows\"},\"VerificationCode\":{\"fields\":[{\"name\":\"ref\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"VerificationType\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"expires_at\"},{\"name\":\"attempts\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"consumed_at\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"}],\"dbName\":\"verification_codes\"},\"RefreshToken\":{\"fields\":[{\"name\":\"jti\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"familyId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"family_id\"},{\"name\":\"accessKeyId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"access_key_id\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"expires_at\"},{\"name\":\"usedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"used_at\"},{\"name\":\"revokedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"revoked_at\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"}],\"dbName\":\"refresh_tokens\"}},\"enums\":{},\"types\":{}}")
|
|
254
277
|
defineDmmfProperty(exports.Prisma, config.runtimeDataModel)
|
|
255
278
|
config.engineWasm = {
|
|
256
279
|
getRuntime: async () => require('./query_engine_bg.js'),
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
34
34
|
*/
|
|
35
35
|
__exportStar(require("./allowList"), exports);
|
|
36
36
|
__exportStar(require("./apikeys"), exports);
|
|
37
|
+
__exportStar(require("./config"), exports);
|
|
37
38
|
__exportStar(require("./exchanges"), exports);
|
|
38
39
|
__exportStar(require("./invites"), exports);
|
|
39
40
|
__exportStar(require("./service"), exports);
|
package/dist/server/config.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
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
|
-
|
|
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
|
|
41
|
-
publicKey
|
|
42
|
-
privateKeyPath
|
|
43
|
-
publicKeyPath
|
|
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.
|
|
75
|
-
failUrl: z.
|
|
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
|
-
|
|
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
|
|
159
|
-
publicKey
|
|
160
|
-
privateKeyPath
|
|
161
|
-
publicKeyPath
|
|
257
|
+
privateKey: string;
|
|
258
|
+
publicKey: string;
|
|
259
|
+
privateKeyPath: string;
|
|
260
|
+
publicKeyPath: string;
|
|
162
261
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
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
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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 };
|