weave-typescript 0.33.0 → 0.35.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/dist/google/api/annotations.pb.js +1 -1
- package/dist/google/api/http.pb.js +1 -1
- package/dist/google/protobuf/descriptor.pb.js +1 -1
- package/dist/google/protobuf/struct.pb.js +1 -1
- package/dist/google/protobuf/timestamp.pb.js +1 -1
- package/dist/weaveapi/atc/v1/event.pb.js +1 -1
- package/dist/weaveapi/atc/v1/message.pb.js +1 -1
- package/dist/weaveapi/atc/v1/process.pb.js +1 -1
- package/dist/weaveapi/atc/v1/run.pb.js +1 -1
- package/dist/weaveapi/atc/v1/service.pb.js +1 -1
- package/dist/weaveapi/auth/v1/auth.pb.d.ts +56 -0
- package/dist/weaveapi/auth/v1/auth.pb.js +625 -2
- package/dist/weaveapi/auth/v1/service.pb.d.ts +173 -1
- package/dist/weaveapi/auth/v1/service.pb.js +1613 -65
- package/dist/weaveapi/chat/v1/chat.pb.js +1 -1
- package/dist/weaveapi/chat/v1/service.pb.js +1 -1
- package/dist/weaveapi/consolidation/v1/consolidation.pb.js +1 -1
- package/dist/weaveapi/consolidation/v1/service.pb.js +1 -1
- package/dist/weaveapi/inference/v1/inference.pb.js +1 -1
- package/dist/weaveapi/inference/v1/service.pb.js +1 -1
- package/dist/weaveapi/ingestion/v1/ingestion.pb.js +1 -1
- package/dist/weaveapi/ingestion/v1/service.pb.js +1 -1
- package/dist/weaveapi/model/v1/model.pb.js +1 -1
- package/dist/weaveapi/model/v1/service.pb.js +1 -1
- package/dist/weaveapi/organization/v1/organization.pb.js +1 -1
- package/dist/weaveapi/organization/v1/service.pb.js +1 -1
- package/dist/weaveapi/project/v1/project.pb.js +1 -1
- package/dist/weaveapi/project/v1/service.pb.js +1 -1
- package/dist/weaveapi/provider/v1/provider.pb.js +1 -1
- package/dist/weaveapi/provider/v1/service.pb.js +1 -1
- package/dist/weaveapi/retrieval/v1/retrieval.pb.js +1 -1
- package/dist/weaveapi/retrieval/v1/service.pb.js +1 -1
- package/dist/weaveapi/task/v1/service.pb.js +1 -1
- package/dist/weaveapi/task/v1/task.pb.js +1 -1
- package/dist/weavesql/weavedb/auth_identity_sql.d.ts +166 -0
- package/dist/weavesql/weavedb/auth_identity_sql.js +367 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteExpiredApplicationSessionsQuery = exports.markApplicationSessionOrganizationSessionStateQuery = exports.listApplicationSessionOrganizationSessionStatesQuery = exports.getApplicationSessionOrganizationSessionQuery = exports.upsertApplicationSessionOrganizationSessionQuery = exports.revokeApplicationSessionQuery = exports.setApplicationSessionActiveOrganizationQuery = exports.getApplicationSessionQuery = exports.createApplicationSessionQuery = exports.insertAuthAuditEventQuery = exports.endSupportAccessSessionQuery = exports.createSupportAccessSessionQuery = exports.createPlatformAdminGrantQuery = exports.listActivePlatformAdminGrantsForUserQuery = exports.listOrganizationMembersQuery = exports.listOrganizationMembershipsForUserQuery = exports.getOrganizationMembershipQuery = exports.upsertOrganizationMembershipQuery = exports.upsertOrganizationAuthLinkQuery = exports.getOrganizationAuthLinkByOrganizationIDQuery = exports.getOrganizationAuthLinkByStytchIDQuery = exports.upsertIdentityLinkQuery = exports.getIdentityLinkByStytchMemberQuery = exports.getUserProfileQuery = exports.upsertUserProfileQuery = exports.deleteOrganizationAuthDomainQuery = exports.listOrganizationAuthDomainsQuery = exports.upsertOrganizationAuthDomainQuery = exports.resolvePrimaryOrganizationAuthLinkByDomainQuery = exports.getUserPrimaryOrganizationAuthLinkQuery = exports.setUserPrimaryOrganizationQuery = exports.getUserByIDQuery = exports.createUserQuery = void 0;
|
|
3
|
+
exports.deleteExpiredAuthInviteSessionsQuery = exports.revokeAuthInviteSessionsByMemberQuery = exports.markAuthInviteSessionRecoveryRequiredQuery = exports.markAuthInviteSessionCompletedQuery = exports.setAuthInviteSessionOAuthStateQuery = exports.getAuthInviteSessionQuery = exports.createAuthInviteSessionQuery = exports.deleteExpiredApplicationSessionsQuery = exports.markApplicationSessionOrganizationSessionStateQuery = exports.listApplicationSessionOrganizationSessionStatesQuery = exports.getApplicationSessionOrganizationSessionQuery = exports.upsertApplicationSessionOrganizationSessionQuery = exports.revokeApplicationSessionQuery = exports.setApplicationSessionActiveOrganizationQuery = exports.getApplicationSessionQuery = exports.createApplicationSessionQuery = exports.insertAuthAuditEventQuery = exports.endSupportAccessSessionQuery = exports.createSupportAccessSessionQuery = exports.createPlatformAdminGrantQuery = exports.listActivePlatformAdminGrantsForUserQuery = exports.listOrganizationMembersQuery = exports.listOrganizationMembershipsForUserQuery = exports.getOrganizationMembershipQuery = exports.upsertOrganizationMembershipQuery = exports.upsertOrganizationAuthLinkQuery = exports.getOrganizationAuthLinkByOrganizationIDQuery = exports.getOrganizationAuthLinkByStytchIDQuery = exports.upsertIdentityLinkQuery = exports.getIdentityLinkByStytchMemberQuery = exports.getUserProfileQuery = exports.upsertUserProfileQuery = exports.deleteOrganizationAuthDomainQuery = exports.listOrganizationAuthDomainsQuery = exports.upsertOrganizationAuthDomainQuery = exports.resolvePrimaryOrganizationAuthLinkByDomainQuery = exports.getUserPrimaryOrganizationAuthLinkQuery = exports.setUserPrimaryOrganizationQuery = exports.getUserByIDQuery = exports.createUserQuery = void 0;
|
|
4
4
|
exports.createUser = createUser;
|
|
5
5
|
exports.getUserByID = getUserByID;
|
|
6
6
|
exports.setUserPrimaryOrganization = setUserPrimaryOrganization;
|
|
@@ -30,6 +30,11 @@ exports.upsertApplicationSessionOrganizationSession = upsertApplicationSessionOr
|
|
|
30
30
|
exports.getApplicationSessionOrganizationSession = getApplicationSessionOrganizationSession;
|
|
31
31
|
exports.listApplicationSessionOrganizationSessionStates = listApplicationSessionOrganizationSessionStates;
|
|
32
32
|
exports.markApplicationSessionOrganizationSessionState = markApplicationSessionOrganizationSessionState;
|
|
33
|
+
exports.createAuthInviteSession = createAuthInviteSession;
|
|
34
|
+
exports.getAuthInviteSession = getAuthInviteSession;
|
|
35
|
+
exports.setAuthInviteSessionOAuthState = setAuthInviteSessionOAuthState;
|
|
36
|
+
exports.markAuthInviteSessionCompleted = markAuthInviteSessionCompleted;
|
|
37
|
+
exports.markAuthInviteSessionRecoveryRequired = markAuthInviteSessionRecoveryRequired;
|
|
33
38
|
exports.createUserQuery = `-- name: CreateUser :one
|
|
34
39
|
INSERT INTO weave.users (status)
|
|
35
40
|
VALUES ($1)
|
|
@@ -1235,3 +1240,364 @@ exports.deleteExpiredApplicationSessionsQuery = `-- name: DeleteExpiredApplicati
|
|
|
1235
1240
|
DELETE FROM weave.application_sessions
|
|
1236
1241
|
WHERE expires_at <= now()
|
|
1237
1242
|
OR status IN ('revoked', 'expired')`;
|
|
1243
|
+
exports.createAuthInviteSessionQuery = `-- name: CreateAuthInviteSession :one
|
|
1244
|
+
INSERT INTO weave.auth_invite_sessions (
|
|
1245
|
+
organization_id,
|
|
1246
|
+
user_id,
|
|
1247
|
+
identity_link_id,
|
|
1248
|
+
stytch_organization_id,
|
|
1249
|
+
stytch_member_id,
|
|
1250
|
+
stytch_member_session_id,
|
|
1251
|
+
stytch_session_token_ciphertext,
|
|
1252
|
+
email,
|
|
1253
|
+
display_name,
|
|
1254
|
+
role_ids,
|
|
1255
|
+
return_url,
|
|
1256
|
+
expires_at
|
|
1257
|
+
) VALUES (
|
|
1258
|
+
$1,
|
|
1259
|
+
$2,
|
|
1260
|
+
$3,
|
|
1261
|
+
$4,
|
|
1262
|
+
$5,
|
|
1263
|
+
$6,
|
|
1264
|
+
$7,
|
|
1265
|
+
$8,
|
|
1266
|
+
$9,
|
|
1267
|
+
$10,
|
|
1268
|
+
$11,
|
|
1269
|
+
$12
|
|
1270
|
+
)
|
|
1271
|
+
RETURNING
|
|
1272
|
+
id,
|
|
1273
|
+
organization_id,
|
|
1274
|
+
user_id,
|
|
1275
|
+
identity_link_id,
|
|
1276
|
+
stytch_organization_id,
|
|
1277
|
+
stytch_member_id,
|
|
1278
|
+
stytch_member_session_id,
|
|
1279
|
+
stytch_session_token_ciphertext,
|
|
1280
|
+
email,
|
|
1281
|
+
display_name,
|
|
1282
|
+
role_ids,
|
|
1283
|
+
status,
|
|
1284
|
+
recovery_reason,
|
|
1285
|
+
return_url,
|
|
1286
|
+
oauth_provider,
|
|
1287
|
+
oauth_state,
|
|
1288
|
+
oauth_return_url,
|
|
1289
|
+
expires_at,
|
|
1290
|
+
completed_at,
|
|
1291
|
+
revoked_at,
|
|
1292
|
+
created_at,
|
|
1293
|
+
updated_at`;
|
|
1294
|
+
async function createAuthInviteSession(client, args) {
|
|
1295
|
+
const result = await client.query({
|
|
1296
|
+
text: exports.createAuthInviteSessionQuery,
|
|
1297
|
+
values: [args.organizationId, args.userId, args.identityLinkId, args.stytchOrganizationId, args.stytchMemberId, args.stytchMemberSessionId, args.stytchSessionTokenCiphertext, args.email, args.displayName, args.roleIds, args.returnUrl, args.expiresAt],
|
|
1298
|
+
rowMode: "array"
|
|
1299
|
+
});
|
|
1300
|
+
if (result.rows.length !== 1) {
|
|
1301
|
+
return null;
|
|
1302
|
+
}
|
|
1303
|
+
const row = result.rows[0];
|
|
1304
|
+
return {
|
|
1305
|
+
id: row[0],
|
|
1306
|
+
organizationId: row[1],
|
|
1307
|
+
userId: row[2],
|
|
1308
|
+
identityLinkId: row[3],
|
|
1309
|
+
stytchOrganizationId: row[4],
|
|
1310
|
+
stytchMemberId: row[5],
|
|
1311
|
+
stytchMemberSessionId: row[6],
|
|
1312
|
+
stytchSessionTokenCiphertext: row[7],
|
|
1313
|
+
email: row[8],
|
|
1314
|
+
displayName: row[9],
|
|
1315
|
+
roleIds: row[10],
|
|
1316
|
+
status: row[11],
|
|
1317
|
+
recoveryReason: row[12],
|
|
1318
|
+
returnUrl: row[13],
|
|
1319
|
+
oauthProvider: row[14],
|
|
1320
|
+
oauthState: row[15],
|
|
1321
|
+
oauthReturnUrl: row[16],
|
|
1322
|
+
expiresAt: row[17],
|
|
1323
|
+
completedAt: row[18],
|
|
1324
|
+
revokedAt: row[19],
|
|
1325
|
+
createdAt: row[20],
|
|
1326
|
+
updatedAt: row[21]
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1329
|
+
exports.getAuthInviteSessionQuery = `-- name: GetAuthInviteSession :one
|
|
1330
|
+
SELECT
|
|
1331
|
+
id,
|
|
1332
|
+
organization_id,
|
|
1333
|
+
user_id,
|
|
1334
|
+
identity_link_id,
|
|
1335
|
+
stytch_organization_id,
|
|
1336
|
+
stytch_member_id,
|
|
1337
|
+
stytch_member_session_id,
|
|
1338
|
+
stytch_session_token_ciphertext,
|
|
1339
|
+
email,
|
|
1340
|
+
display_name,
|
|
1341
|
+
role_ids,
|
|
1342
|
+
status,
|
|
1343
|
+
recovery_reason,
|
|
1344
|
+
return_url,
|
|
1345
|
+
oauth_provider,
|
|
1346
|
+
oauth_state,
|
|
1347
|
+
oauth_return_url,
|
|
1348
|
+
expires_at,
|
|
1349
|
+
completed_at,
|
|
1350
|
+
revoked_at,
|
|
1351
|
+
created_at,
|
|
1352
|
+
updated_at
|
|
1353
|
+
FROM weave.auth_invite_sessions
|
|
1354
|
+
WHERE id = $1`;
|
|
1355
|
+
async function getAuthInviteSession(client, args) {
|
|
1356
|
+
const result = await client.query({
|
|
1357
|
+
text: exports.getAuthInviteSessionQuery,
|
|
1358
|
+
values: [args.id],
|
|
1359
|
+
rowMode: "array"
|
|
1360
|
+
});
|
|
1361
|
+
if (result.rows.length !== 1) {
|
|
1362
|
+
return null;
|
|
1363
|
+
}
|
|
1364
|
+
const row = result.rows[0];
|
|
1365
|
+
return {
|
|
1366
|
+
id: row[0],
|
|
1367
|
+
organizationId: row[1],
|
|
1368
|
+
userId: row[2],
|
|
1369
|
+
identityLinkId: row[3],
|
|
1370
|
+
stytchOrganizationId: row[4],
|
|
1371
|
+
stytchMemberId: row[5],
|
|
1372
|
+
stytchMemberSessionId: row[6],
|
|
1373
|
+
stytchSessionTokenCiphertext: row[7],
|
|
1374
|
+
email: row[8],
|
|
1375
|
+
displayName: row[9],
|
|
1376
|
+
roleIds: row[10],
|
|
1377
|
+
status: row[11],
|
|
1378
|
+
recoveryReason: row[12],
|
|
1379
|
+
returnUrl: row[13],
|
|
1380
|
+
oauthProvider: row[14],
|
|
1381
|
+
oauthState: row[15],
|
|
1382
|
+
oauthReturnUrl: row[16],
|
|
1383
|
+
expiresAt: row[17],
|
|
1384
|
+
completedAt: row[18],
|
|
1385
|
+
revokedAt: row[19],
|
|
1386
|
+
createdAt: row[20],
|
|
1387
|
+
updatedAt: row[21]
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
exports.setAuthInviteSessionOAuthStateQuery = `-- name: SetAuthInviteSessionOAuthState :one
|
|
1391
|
+
UPDATE weave.auth_invite_sessions
|
|
1392
|
+
SET
|
|
1393
|
+
oauth_provider = $1,
|
|
1394
|
+
oauth_state = $2,
|
|
1395
|
+
oauth_return_url = $3,
|
|
1396
|
+
updated_at = now()
|
|
1397
|
+
WHERE id = $4
|
|
1398
|
+
AND status = 'ready'
|
|
1399
|
+
AND expires_at > now()
|
|
1400
|
+
RETURNING
|
|
1401
|
+
id,
|
|
1402
|
+
organization_id,
|
|
1403
|
+
user_id,
|
|
1404
|
+
identity_link_id,
|
|
1405
|
+
stytch_organization_id,
|
|
1406
|
+
stytch_member_id,
|
|
1407
|
+
stytch_member_session_id,
|
|
1408
|
+
stytch_session_token_ciphertext,
|
|
1409
|
+
email,
|
|
1410
|
+
display_name,
|
|
1411
|
+
role_ids,
|
|
1412
|
+
status,
|
|
1413
|
+
recovery_reason,
|
|
1414
|
+
return_url,
|
|
1415
|
+
oauth_provider,
|
|
1416
|
+
oauth_state,
|
|
1417
|
+
oauth_return_url,
|
|
1418
|
+
expires_at,
|
|
1419
|
+
completed_at,
|
|
1420
|
+
revoked_at,
|
|
1421
|
+
created_at,
|
|
1422
|
+
updated_at`;
|
|
1423
|
+
async function setAuthInviteSessionOAuthState(client, args) {
|
|
1424
|
+
const result = await client.query({
|
|
1425
|
+
text: exports.setAuthInviteSessionOAuthStateQuery,
|
|
1426
|
+
values: [args.oauthProvider, args.oauthState, args.oauthReturnUrl, args.id],
|
|
1427
|
+
rowMode: "array"
|
|
1428
|
+
});
|
|
1429
|
+
if (result.rows.length !== 1) {
|
|
1430
|
+
return null;
|
|
1431
|
+
}
|
|
1432
|
+
const row = result.rows[0];
|
|
1433
|
+
return {
|
|
1434
|
+
id: row[0],
|
|
1435
|
+
organizationId: row[1],
|
|
1436
|
+
userId: row[2],
|
|
1437
|
+
identityLinkId: row[3],
|
|
1438
|
+
stytchOrganizationId: row[4],
|
|
1439
|
+
stytchMemberId: row[5],
|
|
1440
|
+
stytchMemberSessionId: row[6],
|
|
1441
|
+
stytchSessionTokenCiphertext: row[7],
|
|
1442
|
+
email: row[8],
|
|
1443
|
+
displayName: row[9],
|
|
1444
|
+
roleIds: row[10],
|
|
1445
|
+
status: row[11],
|
|
1446
|
+
recoveryReason: row[12],
|
|
1447
|
+
returnUrl: row[13],
|
|
1448
|
+
oauthProvider: row[14],
|
|
1449
|
+
oauthState: row[15],
|
|
1450
|
+
oauthReturnUrl: row[16],
|
|
1451
|
+
expiresAt: row[17],
|
|
1452
|
+
completedAt: row[18],
|
|
1453
|
+
revokedAt: row[19],
|
|
1454
|
+
createdAt: row[20],
|
|
1455
|
+
updatedAt: row[21]
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
exports.markAuthInviteSessionCompletedQuery = `-- name: MarkAuthInviteSessionCompleted :one
|
|
1459
|
+
UPDATE weave.auth_invite_sessions
|
|
1460
|
+
SET
|
|
1461
|
+
status = 'completed',
|
|
1462
|
+
completed_at = now(),
|
|
1463
|
+
updated_at = now()
|
|
1464
|
+
WHERE id = $1
|
|
1465
|
+
AND status = 'ready'
|
|
1466
|
+
AND expires_at > now()
|
|
1467
|
+
RETURNING
|
|
1468
|
+
id,
|
|
1469
|
+
organization_id,
|
|
1470
|
+
user_id,
|
|
1471
|
+
identity_link_id,
|
|
1472
|
+
stytch_organization_id,
|
|
1473
|
+
stytch_member_id,
|
|
1474
|
+
stytch_member_session_id,
|
|
1475
|
+
stytch_session_token_ciphertext,
|
|
1476
|
+
email,
|
|
1477
|
+
display_name,
|
|
1478
|
+
role_ids,
|
|
1479
|
+
status,
|
|
1480
|
+
recovery_reason,
|
|
1481
|
+
return_url,
|
|
1482
|
+
oauth_provider,
|
|
1483
|
+
oauth_state,
|
|
1484
|
+
oauth_return_url,
|
|
1485
|
+
expires_at,
|
|
1486
|
+
completed_at,
|
|
1487
|
+
revoked_at,
|
|
1488
|
+
created_at,
|
|
1489
|
+
updated_at`;
|
|
1490
|
+
async function markAuthInviteSessionCompleted(client, args) {
|
|
1491
|
+
const result = await client.query({
|
|
1492
|
+
text: exports.markAuthInviteSessionCompletedQuery,
|
|
1493
|
+
values: [args.id],
|
|
1494
|
+
rowMode: "array"
|
|
1495
|
+
});
|
|
1496
|
+
if (result.rows.length !== 1) {
|
|
1497
|
+
return null;
|
|
1498
|
+
}
|
|
1499
|
+
const row = result.rows[0];
|
|
1500
|
+
return {
|
|
1501
|
+
id: row[0],
|
|
1502
|
+
organizationId: row[1],
|
|
1503
|
+
userId: row[2],
|
|
1504
|
+
identityLinkId: row[3],
|
|
1505
|
+
stytchOrganizationId: row[4],
|
|
1506
|
+
stytchMemberId: row[5],
|
|
1507
|
+
stytchMemberSessionId: row[6],
|
|
1508
|
+
stytchSessionTokenCiphertext: row[7],
|
|
1509
|
+
email: row[8],
|
|
1510
|
+
displayName: row[9],
|
|
1511
|
+
roleIds: row[10],
|
|
1512
|
+
status: row[11],
|
|
1513
|
+
recoveryReason: row[12],
|
|
1514
|
+
returnUrl: row[13],
|
|
1515
|
+
oauthProvider: row[14],
|
|
1516
|
+
oauthState: row[15],
|
|
1517
|
+
oauthReturnUrl: row[16],
|
|
1518
|
+
expiresAt: row[17],
|
|
1519
|
+
completedAt: row[18],
|
|
1520
|
+
revokedAt: row[19],
|
|
1521
|
+
createdAt: row[20],
|
|
1522
|
+
updatedAt: row[21]
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
exports.markAuthInviteSessionRecoveryRequiredQuery = `-- name: MarkAuthInviteSessionRecoveryRequired :one
|
|
1526
|
+
UPDATE weave.auth_invite_sessions
|
|
1527
|
+
SET
|
|
1528
|
+
status = 'recovery_required',
|
|
1529
|
+
recovery_reason = $1,
|
|
1530
|
+
updated_at = now()
|
|
1531
|
+
WHERE id = $2
|
|
1532
|
+
AND status IN ('ready', 'expired', 'recovery_required')
|
|
1533
|
+
RETURNING
|
|
1534
|
+
id,
|
|
1535
|
+
organization_id,
|
|
1536
|
+
user_id,
|
|
1537
|
+
identity_link_id,
|
|
1538
|
+
stytch_organization_id,
|
|
1539
|
+
stytch_member_id,
|
|
1540
|
+
stytch_member_session_id,
|
|
1541
|
+
stytch_session_token_ciphertext,
|
|
1542
|
+
email,
|
|
1543
|
+
display_name,
|
|
1544
|
+
role_ids,
|
|
1545
|
+
status,
|
|
1546
|
+
recovery_reason,
|
|
1547
|
+
return_url,
|
|
1548
|
+
oauth_provider,
|
|
1549
|
+
oauth_state,
|
|
1550
|
+
oauth_return_url,
|
|
1551
|
+
expires_at,
|
|
1552
|
+
completed_at,
|
|
1553
|
+
revoked_at,
|
|
1554
|
+
created_at,
|
|
1555
|
+
updated_at`;
|
|
1556
|
+
async function markAuthInviteSessionRecoveryRequired(client, args) {
|
|
1557
|
+
const result = await client.query({
|
|
1558
|
+
text: exports.markAuthInviteSessionRecoveryRequiredQuery,
|
|
1559
|
+
values: [args.recoveryReason, args.id],
|
|
1560
|
+
rowMode: "array"
|
|
1561
|
+
});
|
|
1562
|
+
if (result.rows.length !== 1) {
|
|
1563
|
+
return null;
|
|
1564
|
+
}
|
|
1565
|
+
const row = result.rows[0];
|
|
1566
|
+
return {
|
|
1567
|
+
id: row[0],
|
|
1568
|
+
organizationId: row[1],
|
|
1569
|
+
userId: row[2],
|
|
1570
|
+
identityLinkId: row[3],
|
|
1571
|
+
stytchOrganizationId: row[4],
|
|
1572
|
+
stytchMemberId: row[5],
|
|
1573
|
+
stytchMemberSessionId: row[6],
|
|
1574
|
+
stytchSessionTokenCiphertext: row[7],
|
|
1575
|
+
email: row[8],
|
|
1576
|
+
displayName: row[9],
|
|
1577
|
+
roleIds: row[10],
|
|
1578
|
+
status: row[11],
|
|
1579
|
+
recoveryReason: row[12],
|
|
1580
|
+
returnUrl: row[13],
|
|
1581
|
+
oauthProvider: row[14],
|
|
1582
|
+
oauthState: row[15],
|
|
1583
|
+
oauthReturnUrl: row[16],
|
|
1584
|
+
expiresAt: row[17],
|
|
1585
|
+
completedAt: row[18],
|
|
1586
|
+
revokedAt: row[19],
|
|
1587
|
+
createdAt: row[20],
|
|
1588
|
+
updatedAt: row[21]
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
exports.revokeAuthInviteSessionsByMemberQuery = `-- name: RevokeAuthInviteSessionsByMember :execrows
|
|
1592
|
+
UPDATE weave.auth_invite_sessions
|
|
1593
|
+
SET
|
|
1594
|
+
status = 'revoked',
|
|
1595
|
+
revoked_at = now(),
|
|
1596
|
+
updated_at = now()
|
|
1597
|
+
WHERE stytch_organization_id = $1
|
|
1598
|
+
AND stytch_member_id = $2
|
|
1599
|
+
AND status = 'ready'`;
|
|
1600
|
+
exports.deleteExpiredAuthInviteSessionsQuery = `-- name: DeleteExpiredAuthInviteSessions :execrows
|
|
1601
|
+
DELETE FROM weave.auth_invite_sessions
|
|
1602
|
+
WHERE expires_at <= now()
|
|
1603
|
+
OR status IN ('completed', 'expired', 'revoked')`;
|