weave-typescript 0.31.0 → 0.33.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.js +1 -1
- package/dist/weaveapi/auth/v1/service.pb.d.ts +49 -0
- package/dist/weaveapi/auth/v1/service.pb.js +461 -3
- 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 +232 -1
- package/dist/weavesql/weavedb/auth_identity_sql.js +555 -8
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.7
|
|
5
5
|
// protoc unknown
|
|
6
6
|
// source: weaveapi/provider/v1/service.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.7
|
|
5
5
|
// protoc unknown
|
|
6
6
|
// source: weaveapi/retrieval/v1/retrieval.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.7
|
|
5
5
|
// protoc unknown
|
|
6
6
|
// source: weaveapi/retrieval/v1/service.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.7
|
|
5
5
|
// protoc unknown
|
|
6
6
|
// source: weaveapi/task/v1/service.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.7
|
|
5
5
|
// protoc unknown
|
|
6
6
|
// source: weaveapi/task/v1/task.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -24,6 +24,90 @@ export interface GetUserByIDRow {
|
|
|
24
24
|
updatedAt: Date;
|
|
25
25
|
}
|
|
26
26
|
export declare function getUserByID(client: Client, args: GetUserByIDArgs): Promise<GetUserByIDRow | null>;
|
|
27
|
+
export declare const setUserPrimaryOrganizationQuery = "-- name: SetUserPrimaryOrganization :one\nUPDATE weave.users\nSET\n primary_organization_id = $1,\n updated_at = now()\nWHERE id = $2\nRETURNING\n id,\n primary_organization_id,\n status,\n created_at,\n updated_at";
|
|
28
|
+
export interface SetUserPrimaryOrganizationArgs {
|
|
29
|
+
organizationId: string | null;
|
|
30
|
+
userId: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SetUserPrimaryOrganizationRow {
|
|
33
|
+
id: string;
|
|
34
|
+
primaryOrganizationId: string | null;
|
|
35
|
+
status: string;
|
|
36
|
+
createdAt: Date;
|
|
37
|
+
updatedAt: Date;
|
|
38
|
+
}
|
|
39
|
+
export declare function setUserPrimaryOrganization(client: Client, args: SetUserPrimaryOrganizationArgs): Promise<SetUserPrimaryOrganizationRow | null>;
|
|
40
|
+
export declare const getUserPrimaryOrganizationAuthLinkQuery = "-- name: GetUserPrimaryOrganizationAuthLink :one\nSELECT\n o.id AS organization_id,\n o.slug AS organization_slug,\n o.name AS organization_name,\n l.stytch_organization_id,\n l.stytch_organization_slug,\n l.stytch_organization_kind,\n l.allowed_domains,\n l.auth_policy_summary,\n l.created_at,\n l.updated_at\nFROM weave.users AS u\nJOIN weave.organizations AS o\n ON o.id = u.primary_organization_id\nJOIN weave.organization_auth_links AS l\n ON l.organization_id = o.id\nWHERE u.id = $1\n AND u.status = 'active'";
|
|
41
|
+
export interface GetUserPrimaryOrganizationAuthLinkArgs {
|
|
42
|
+
userId: string;
|
|
43
|
+
}
|
|
44
|
+
export interface GetUserPrimaryOrganizationAuthLinkRow {
|
|
45
|
+
organizationId: string;
|
|
46
|
+
organizationSlug: string;
|
|
47
|
+
organizationName: string;
|
|
48
|
+
stytchOrganizationId: string;
|
|
49
|
+
stytchOrganizationSlug: string;
|
|
50
|
+
stytchOrganizationKind: string;
|
|
51
|
+
allowedDomains: string[];
|
|
52
|
+
authPolicySummary: any;
|
|
53
|
+
createdAt: Date;
|
|
54
|
+
updatedAt: Date;
|
|
55
|
+
}
|
|
56
|
+
export declare function getUserPrimaryOrganizationAuthLink(client: Client, args: GetUserPrimaryOrganizationAuthLinkArgs): Promise<GetUserPrimaryOrganizationAuthLinkRow | null>;
|
|
57
|
+
export declare const resolvePrimaryOrganizationAuthLinkByDomainQuery = "-- name: ResolvePrimaryOrganizationAuthLinkByDomain :one\nSELECT\n o.id AS organization_id,\n o.slug AS organization_slug,\n o.name AS organization_name,\n l.stytch_organization_id,\n l.stytch_organization_slug,\n l.stytch_organization_kind,\n d.domain,\n l.allowed_domains,\n l.auth_policy_summary,\n l.created_at,\n l.updated_at\nFROM weave.organization_auth_domains AS d\nJOIN weave.organization_auth_links AS l\n ON l.organization_id = d.organization_id\nJOIN weave.organizations AS o\n ON o.id = d.organization_id\nWHERE d.domain = lower($1)\n AND d.is_primary_login\n AND d.status = 'active'";
|
|
58
|
+
export interface ResolvePrimaryOrganizationAuthLinkByDomainArgs {
|
|
59
|
+
domain: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ResolvePrimaryOrganizationAuthLinkByDomainRow {
|
|
62
|
+
organizationId: string;
|
|
63
|
+
organizationSlug: string;
|
|
64
|
+
organizationName: string;
|
|
65
|
+
stytchOrganizationId: string;
|
|
66
|
+
stytchOrganizationSlug: string;
|
|
67
|
+
stytchOrganizationKind: string;
|
|
68
|
+
domain: string;
|
|
69
|
+
allowedDomains: string[];
|
|
70
|
+
authPolicySummary: any;
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
updatedAt: Date;
|
|
73
|
+
}
|
|
74
|
+
export declare function resolvePrimaryOrganizationAuthLinkByDomain(client: Client, args: ResolvePrimaryOrganizationAuthLinkByDomainArgs): Promise<ResolvePrimaryOrganizationAuthLinkByDomainRow | null>;
|
|
75
|
+
export declare const upsertOrganizationAuthDomainQuery = "-- name: UpsertOrganizationAuthDomain :one\nINSERT INTO weave.organization_auth_domains (\n organization_id,\n domain,\n is_primary_login,\n status\n) VALUES (\n $1,\n lower($2),\n $3,\n $4\n)\nON CONFLICT (organization_id, domain) DO UPDATE\nSET\n is_primary_login = EXCLUDED.is_primary_login,\n status = EXCLUDED.status,\n updated_at = now()\nRETURNING\n id,\n organization_id,\n domain,\n is_primary_login,\n status,\n created_at,\n updated_at";
|
|
76
|
+
export interface UpsertOrganizationAuthDomainArgs {
|
|
77
|
+
organizationId: string;
|
|
78
|
+
domain: string;
|
|
79
|
+
isPrimaryLogin: boolean;
|
|
80
|
+
status: string;
|
|
81
|
+
}
|
|
82
|
+
export interface UpsertOrganizationAuthDomainRow {
|
|
83
|
+
id: string;
|
|
84
|
+
organizationId: string;
|
|
85
|
+
domain: string;
|
|
86
|
+
isPrimaryLogin: boolean;
|
|
87
|
+
status: string;
|
|
88
|
+
createdAt: Date;
|
|
89
|
+
updatedAt: Date;
|
|
90
|
+
}
|
|
91
|
+
export declare function upsertOrganizationAuthDomain(client: Client, args: UpsertOrganizationAuthDomainArgs): Promise<UpsertOrganizationAuthDomainRow | null>;
|
|
92
|
+
export declare const listOrganizationAuthDomainsQuery = "-- name: ListOrganizationAuthDomains :many\nSELECT\n id,\n organization_id,\n domain,\n is_primary_login,\n status,\n created_at,\n updated_at\nFROM weave.organization_auth_domains\nWHERE organization_id = $1\nORDER BY is_primary_login DESC, domain ASC";
|
|
93
|
+
export interface ListOrganizationAuthDomainsArgs {
|
|
94
|
+
organizationId: string;
|
|
95
|
+
}
|
|
96
|
+
export interface ListOrganizationAuthDomainsRow {
|
|
97
|
+
id: string;
|
|
98
|
+
organizationId: string;
|
|
99
|
+
domain: string;
|
|
100
|
+
isPrimaryLogin: boolean;
|
|
101
|
+
status: string;
|
|
102
|
+
createdAt: Date;
|
|
103
|
+
updatedAt: Date;
|
|
104
|
+
}
|
|
105
|
+
export declare function listOrganizationAuthDomains(client: Client, args: ListOrganizationAuthDomainsArgs): Promise<ListOrganizationAuthDomainsRow[]>;
|
|
106
|
+
export declare const deleteOrganizationAuthDomainQuery = "-- name: DeleteOrganizationAuthDomain :execrows\nDELETE FROM weave.organization_auth_domains\nWHERE organization_id = $1\n AND domain = lower($2)";
|
|
107
|
+
export interface DeleteOrganizationAuthDomainArgs {
|
|
108
|
+
organizationId: string;
|
|
109
|
+
domain: string;
|
|
110
|
+
}
|
|
27
111
|
export declare const upsertUserProfileQuery = "-- name: UpsertUserProfile :one\nINSERT INTO weave.user_profiles (\n user_id,\n display_name,\n job_title,\n email,\n avatar_url,\n theme\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6\n)\nON CONFLICT (user_id) DO UPDATE\nSET\n display_name = EXCLUDED.display_name,\n job_title = EXCLUDED.job_title,\n email = EXCLUDED.email,\n avatar_url = EXCLUDED.avatar_url,\n theme = EXCLUDED.theme,\n updated_at = now()\nRETURNING\n user_id,\n display_name,\n job_title,\n email,\n avatar_url,\n theme,\n created_at,\n updated_at";
|
|
28
112
|
export interface UpsertUserProfileArgs {
|
|
29
113
|
userId: string;
|
|
@@ -198,7 +282,7 @@ export interface ListOrganizationMembershipsForUserRow {
|
|
|
198
282
|
updatedAt: Date;
|
|
199
283
|
}
|
|
200
284
|
export declare function listOrganizationMembershipsForUser(client: Client, args: ListOrganizationMembershipsForUserArgs): Promise<ListOrganizationMembershipsForUserRow[]>;
|
|
201
|
-
export declare const listOrganizationMembersQuery = "-- name: ListOrganizationMembers :many\nSELECT\n m.id,\n m.user_id,\n m.organization_id,\n m.identity_link_id,\n m.status,\n m.role_ids,\n p.display_name,\n p.email,\n p.avatar_url,\n m.created_at,\n m.updated_at\nFROM weave.organization_memberships AS m\nJOIN weave.user_profiles AS p\n ON p.user_id = m.user_id\nWHERE m.organization_id = $1\nORDER BY p.display_name ASC, p.email ASC";
|
|
285
|
+
export declare const listOrganizationMembersQuery = "-- name: ListOrganizationMembers :many\nSELECT\n m.id,\n m.user_id,\n m.organization_id,\n m.identity_link_id,\n l.stytch_member_id,\n m.status,\n m.role_ids,\n p.display_name,\n p.email,\n p.avatar_url,\n m.created_at,\n m.updated_at\nFROM weave.organization_memberships AS m\nJOIN weave.user_profiles AS p\n ON p.user_id = m.user_id\nLEFT JOIN weave.identity_links AS l\n ON l.id = m.identity_link_id\nWHERE m.organization_id = $1\nORDER BY p.display_name ASC, p.email ASC";
|
|
202
286
|
export interface ListOrganizationMembersArgs {
|
|
203
287
|
organizationId: string;
|
|
204
288
|
}
|
|
@@ -207,6 +291,7 @@ export interface ListOrganizationMembersRow {
|
|
|
207
291
|
userId: string;
|
|
208
292
|
organizationId: string;
|
|
209
293
|
identityLinkId: string | null;
|
|
294
|
+
stytchMemberId: string | null;
|
|
210
295
|
status: string;
|
|
211
296
|
roleIds: string[];
|
|
212
297
|
displayName: string;
|
|
@@ -292,4 +377,150 @@ export interface InsertAuthAuditEventArgs {
|
|
|
292
377
|
metadata: any;
|
|
293
378
|
}
|
|
294
379
|
export declare function insertAuthAuditEvent(client: Client, args: InsertAuthAuditEventArgs): Promise<void>;
|
|
380
|
+
export declare const createApplicationSessionQuery = "-- name: CreateApplicationSession :one\nINSERT INTO weave.application_sessions (\n user_id,\n active_organization_id,\n expires_at\n) VALUES (\n $1,\n $2,\n $3\n)\nRETURNING\n id,\n user_id,\n active_organization_id,\n status,\n expires_at,\n revoked_at,\n created_at,\n updated_at";
|
|
381
|
+
export interface CreateApplicationSessionArgs {
|
|
382
|
+
userId: string;
|
|
383
|
+
activeOrganizationId: string | null;
|
|
384
|
+
expiresAt: Date;
|
|
385
|
+
}
|
|
386
|
+
export interface CreateApplicationSessionRow {
|
|
387
|
+
id: string;
|
|
388
|
+
userId: string;
|
|
389
|
+
activeOrganizationId: string | null;
|
|
390
|
+
status: string;
|
|
391
|
+
expiresAt: Date;
|
|
392
|
+
revokedAt: Date | null;
|
|
393
|
+
createdAt: Date;
|
|
394
|
+
updatedAt: Date;
|
|
395
|
+
}
|
|
396
|
+
export declare function createApplicationSession(client: Client, args: CreateApplicationSessionArgs): Promise<CreateApplicationSessionRow | null>;
|
|
397
|
+
export declare const getApplicationSessionQuery = "-- name: GetApplicationSession :one\nSELECT\n id,\n user_id,\n active_organization_id,\n status,\n expires_at,\n revoked_at,\n created_at,\n updated_at\nFROM weave.application_sessions\nWHERE id = $1";
|
|
398
|
+
export interface GetApplicationSessionArgs {
|
|
399
|
+
id: string;
|
|
400
|
+
}
|
|
401
|
+
export interface GetApplicationSessionRow {
|
|
402
|
+
id: string;
|
|
403
|
+
userId: string;
|
|
404
|
+
activeOrganizationId: string | null;
|
|
405
|
+
status: string;
|
|
406
|
+
expiresAt: Date;
|
|
407
|
+
revokedAt: Date | null;
|
|
408
|
+
createdAt: Date;
|
|
409
|
+
updatedAt: Date;
|
|
410
|
+
}
|
|
411
|
+
export declare function getApplicationSession(client: Client, args: GetApplicationSessionArgs): Promise<GetApplicationSessionRow | null>;
|
|
412
|
+
export declare const setApplicationSessionActiveOrganizationQuery = "-- name: SetApplicationSessionActiveOrganization :one\nUPDATE weave.application_sessions\nSET\n active_organization_id = $1,\n updated_at = now()\nWHERE id = $2\n AND status = 'active'\nRETURNING\n id,\n user_id,\n active_organization_id,\n status,\n expires_at,\n revoked_at,\n created_at,\n updated_at";
|
|
413
|
+
export interface SetApplicationSessionActiveOrganizationArgs {
|
|
414
|
+
organizationId: string | null;
|
|
415
|
+
id: string;
|
|
416
|
+
}
|
|
417
|
+
export interface SetApplicationSessionActiveOrganizationRow {
|
|
418
|
+
id: string;
|
|
419
|
+
userId: string;
|
|
420
|
+
activeOrganizationId: string | null;
|
|
421
|
+
status: string;
|
|
422
|
+
expiresAt: Date;
|
|
423
|
+
revokedAt: Date | null;
|
|
424
|
+
createdAt: Date;
|
|
425
|
+
updatedAt: Date;
|
|
426
|
+
}
|
|
427
|
+
export declare function setApplicationSessionActiveOrganization(client: Client, args: SetApplicationSessionActiveOrganizationArgs): Promise<SetApplicationSessionActiveOrganizationRow | null>;
|
|
428
|
+
export declare const revokeApplicationSessionQuery = "-- name: RevokeApplicationSession :execrows\nUPDATE weave.application_sessions\nSET\n status = 'revoked',\n revoked_at = now(),\n updated_at = now()\nWHERE id = $1\n AND status = 'active'";
|
|
429
|
+
export interface RevokeApplicationSessionArgs {
|
|
430
|
+
id: string;
|
|
431
|
+
}
|
|
432
|
+
export declare const upsertApplicationSessionOrganizationSessionQuery = "-- name: UpsertApplicationSessionOrganizationSession :one\nINSERT INTO weave.application_session_organization_sessions (\n application_session_id,\n organization_id,\n identity_link_id,\n stytch_organization_id,\n stytch_member_id,\n stytch_member_session_id,\n stytch_session_token_ciphertext,\n auth_state,\n expires_at,\n last_validated_at\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10\n)\nON CONFLICT (application_session_id, organization_id) DO UPDATE\nSET\n identity_link_id = EXCLUDED.identity_link_id,\n stytch_organization_id = EXCLUDED.stytch_organization_id,\n stytch_member_id = EXCLUDED.stytch_member_id,\n stytch_member_session_id = EXCLUDED.stytch_member_session_id,\n stytch_session_token_ciphertext = EXCLUDED.stytch_session_token_ciphertext,\n auth_state = EXCLUDED.auth_state,\n expires_at = EXCLUDED.expires_at,\n last_validated_at = EXCLUDED.last_validated_at,\n updated_at = now()\nRETURNING\n id,\n application_session_id,\n organization_id,\n identity_link_id,\n stytch_organization_id,\n stytch_member_id,\n stytch_member_session_id,\n stytch_session_token_ciphertext,\n auth_state,\n expires_at,\n last_validated_at,\n created_at,\n updated_at";
|
|
433
|
+
export interface UpsertApplicationSessionOrganizationSessionArgs {
|
|
434
|
+
applicationSessionId: string;
|
|
435
|
+
organizationId: string;
|
|
436
|
+
identityLinkId: string | null;
|
|
437
|
+
stytchOrganizationId: string;
|
|
438
|
+
stytchMemberId: string;
|
|
439
|
+
stytchMemberSessionId: string;
|
|
440
|
+
stytchSessionTokenCiphertext: Buffer | null;
|
|
441
|
+
authState: string;
|
|
442
|
+
expiresAt: Date;
|
|
443
|
+
lastValidatedAt: Date | null;
|
|
444
|
+
}
|
|
445
|
+
export interface UpsertApplicationSessionOrganizationSessionRow {
|
|
446
|
+
id: string;
|
|
447
|
+
applicationSessionId: string;
|
|
448
|
+
organizationId: string;
|
|
449
|
+
identityLinkId: string | null;
|
|
450
|
+
stytchOrganizationId: string;
|
|
451
|
+
stytchMemberId: string;
|
|
452
|
+
stytchMemberSessionId: string;
|
|
453
|
+
stytchSessionTokenCiphertext: Buffer | null;
|
|
454
|
+
authState: string;
|
|
455
|
+
expiresAt: Date;
|
|
456
|
+
lastValidatedAt: Date | null;
|
|
457
|
+
createdAt: Date;
|
|
458
|
+
updatedAt: Date;
|
|
459
|
+
}
|
|
460
|
+
export declare function upsertApplicationSessionOrganizationSession(client: Client, args: UpsertApplicationSessionOrganizationSessionArgs): Promise<UpsertApplicationSessionOrganizationSessionRow | null>;
|
|
461
|
+
export declare const getApplicationSessionOrganizationSessionQuery = "-- name: GetApplicationSessionOrganizationSession :one\nSELECT\n id,\n application_session_id,\n organization_id,\n identity_link_id,\n stytch_organization_id,\n stytch_member_id,\n stytch_member_session_id,\n stytch_session_token_ciphertext,\n auth_state,\n expires_at,\n last_validated_at,\n created_at,\n updated_at\nFROM weave.application_session_organization_sessions\nWHERE application_session_id = $1\n AND organization_id = $2";
|
|
462
|
+
export interface GetApplicationSessionOrganizationSessionArgs {
|
|
463
|
+
applicationSessionId: string;
|
|
464
|
+
organizationId: string;
|
|
465
|
+
}
|
|
466
|
+
export interface GetApplicationSessionOrganizationSessionRow {
|
|
467
|
+
id: string;
|
|
468
|
+
applicationSessionId: string;
|
|
469
|
+
organizationId: string;
|
|
470
|
+
identityLinkId: string | null;
|
|
471
|
+
stytchOrganizationId: string;
|
|
472
|
+
stytchMemberId: string;
|
|
473
|
+
stytchMemberSessionId: string;
|
|
474
|
+
stytchSessionTokenCiphertext: Buffer | null;
|
|
475
|
+
authState: string;
|
|
476
|
+
expiresAt: Date;
|
|
477
|
+
lastValidatedAt: Date | null;
|
|
478
|
+
createdAt: Date;
|
|
479
|
+
updatedAt: Date;
|
|
480
|
+
}
|
|
481
|
+
export declare function getApplicationSessionOrganizationSession(client: Client, args: GetApplicationSessionOrganizationSessionArgs): Promise<GetApplicationSessionOrganizationSessionRow | null>;
|
|
482
|
+
export declare const listApplicationSessionOrganizationSessionStatesQuery = "-- name: ListApplicationSessionOrganizationSessionStates :many\nSELECT\n s.id,\n s.application_session_id,\n s.organization_id,\n o.slug AS organization_slug,\n o.name AS organization_name,\n s.identity_link_id,\n s.stytch_organization_id,\n s.stytch_member_id,\n s.stytch_member_session_id,\n s.auth_state,\n s.expires_at,\n s.last_validated_at,\n s.created_at,\n s.updated_at\nFROM weave.application_session_organization_sessions AS s\nJOIN weave.organizations AS o\n ON o.id = s.organization_id\nWHERE s.application_session_id = $1\nORDER BY o.slug ASC";
|
|
483
|
+
export interface ListApplicationSessionOrganizationSessionStatesArgs {
|
|
484
|
+
applicationSessionId: string;
|
|
485
|
+
}
|
|
486
|
+
export interface ListApplicationSessionOrganizationSessionStatesRow {
|
|
487
|
+
id: string;
|
|
488
|
+
applicationSessionId: string;
|
|
489
|
+
organizationId: string;
|
|
490
|
+
organizationSlug: string;
|
|
491
|
+
organizationName: string;
|
|
492
|
+
identityLinkId: string | null;
|
|
493
|
+
stytchOrganizationId: string;
|
|
494
|
+
stytchMemberId: string;
|
|
495
|
+
stytchMemberSessionId: string;
|
|
496
|
+
authState: string;
|
|
497
|
+
expiresAt: Date;
|
|
498
|
+
lastValidatedAt: Date | null;
|
|
499
|
+
createdAt: Date;
|
|
500
|
+
updatedAt: Date;
|
|
501
|
+
}
|
|
502
|
+
export declare function listApplicationSessionOrganizationSessionStates(client: Client, args: ListApplicationSessionOrganizationSessionStatesArgs): Promise<ListApplicationSessionOrganizationSessionStatesRow[]>;
|
|
503
|
+
export declare const markApplicationSessionOrganizationSessionStateQuery = "-- name: MarkApplicationSessionOrganizationSessionState :one\nUPDATE weave.application_session_organization_sessions\nSET\n auth_state = $1,\n last_validated_at = now(),\n updated_at = now()\nWHERE application_session_id = $2\n AND organization_id = $3\nRETURNING\n id,\n application_session_id,\n organization_id,\n identity_link_id,\n stytch_organization_id,\n stytch_member_id,\n stytch_member_session_id,\n stytch_session_token_ciphertext,\n auth_state,\n expires_at,\n last_validated_at,\n created_at,\n updated_at";
|
|
504
|
+
export interface MarkApplicationSessionOrganizationSessionStateArgs {
|
|
505
|
+
authState: string;
|
|
506
|
+
applicationSessionId: string;
|
|
507
|
+
organizationId: string;
|
|
508
|
+
}
|
|
509
|
+
export interface MarkApplicationSessionOrganizationSessionStateRow {
|
|
510
|
+
id: string;
|
|
511
|
+
applicationSessionId: string;
|
|
512
|
+
organizationId: string;
|
|
513
|
+
identityLinkId: string | null;
|
|
514
|
+
stytchOrganizationId: string;
|
|
515
|
+
stytchMemberId: string;
|
|
516
|
+
stytchMemberSessionId: string;
|
|
517
|
+
stytchSessionTokenCiphertext: Buffer | null;
|
|
518
|
+
authState: string;
|
|
519
|
+
expiresAt: Date;
|
|
520
|
+
lastValidatedAt: Date | null;
|
|
521
|
+
createdAt: Date;
|
|
522
|
+
updatedAt: Date;
|
|
523
|
+
}
|
|
524
|
+
export declare function markApplicationSessionOrganizationSessionState(client: Client, args: MarkApplicationSessionOrganizationSessionStateArgs): Promise<MarkApplicationSessionOrganizationSessionStateRow | null>;
|
|
525
|
+
export declare const deleteExpiredApplicationSessionsQuery = "-- name: DeleteExpiredApplicationSessions :execrows\nDELETE FROM weave.application_sessions\nWHERE expires_at <= now()\n OR status IN ('revoked', 'expired')";
|
|
295
526
|
export {};
|