weave-typescript 0.37.0 → 0.38.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.
|
@@ -143,6 +143,11 @@ export interface AuthOrganization {
|
|
|
143
143
|
slug: string;
|
|
144
144
|
name: string;
|
|
145
145
|
kind: OrganizationKind;
|
|
146
|
+
/**
|
|
147
|
+
* Deprecated: provider identifiers are backend-only; use id.
|
|
148
|
+
*
|
|
149
|
+
* @deprecated
|
|
150
|
+
*/
|
|
146
151
|
stytchOrganizationId: string;
|
|
147
152
|
roleIds: string[];
|
|
148
153
|
membershipStatus: MembershipStatus;
|
|
@@ -151,7 +156,17 @@ export interface DiscoveryOrganization {
|
|
|
151
156
|
organizationId: string;
|
|
152
157
|
organizationSlug: string;
|
|
153
158
|
organizationName: string;
|
|
159
|
+
/**
|
|
160
|
+
* Deprecated: provider identifiers are backend-only; use organization_id.
|
|
161
|
+
*
|
|
162
|
+
* @deprecated
|
|
163
|
+
*/
|
|
154
164
|
stytchOrganizationId: string;
|
|
165
|
+
/**
|
|
166
|
+
* Deprecated: provider identifiers are backend-only; use organization_slug.
|
|
167
|
+
*
|
|
168
|
+
* @deprecated
|
|
169
|
+
*/
|
|
155
170
|
stytchOrganizationSlug: string;
|
|
156
171
|
organizationKind: OrganizationKind;
|
|
157
172
|
status: DiscoveryOrganizationStatus;
|
|
@@ -165,7 +180,17 @@ export interface InviteOnboardingState {
|
|
|
165
180
|
organizationSlug: string;
|
|
166
181
|
organizationName: string;
|
|
167
182
|
organizationKind: OrganizationKind;
|
|
183
|
+
/**
|
|
184
|
+
* Deprecated: provider identifiers are backend-only; use organization_id.
|
|
185
|
+
*
|
|
186
|
+
* @deprecated
|
|
187
|
+
*/
|
|
168
188
|
stytchOrganizationId: string;
|
|
189
|
+
/**
|
|
190
|
+
* Deprecated: provider identifiers are backend-only; use invite_session_id.
|
|
191
|
+
*
|
|
192
|
+
* @deprecated
|
|
193
|
+
*/
|
|
169
194
|
stytchMemberId: string;
|
|
170
195
|
email: string;
|
|
171
196
|
displayName: string;
|
|
@@ -212,7 +237,17 @@ export interface UserPreferences_OrganizationPagePositionsEntry {
|
|
|
212
237
|
export interface OrganizationAuthSettings {
|
|
213
238
|
organizationId: string;
|
|
214
239
|
organizationSlug: string;
|
|
240
|
+
/**
|
|
241
|
+
* Deprecated: provider identifiers are backend-only; use organization_id.
|
|
242
|
+
*
|
|
243
|
+
* @deprecated
|
|
244
|
+
*/
|
|
215
245
|
stytchOrganizationId: string;
|
|
246
|
+
/**
|
|
247
|
+
* Deprecated: provider identifiers are backend-only; use organization_slug.
|
|
248
|
+
*
|
|
249
|
+
* @deprecated
|
|
250
|
+
*/
|
|
216
251
|
stytchOrganizationSlug: string;
|
|
217
252
|
organizationKind: OrganizationKind;
|
|
218
253
|
allowedAuthMethods: AuthMethod[];
|
|
@@ -229,9 +264,16 @@ export interface OrganizationAuthSettings {
|
|
|
229
264
|
} | undefined;
|
|
230
265
|
}
|
|
231
266
|
export interface OrganizationMember {
|
|
267
|
+
/** Weave organization_memberships.id. */
|
|
232
268
|
id: string;
|
|
269
|
+
/** Weave users.id. */
|
|
233
270
|
userId: string;
|
|
234
271
|
organizationId: string;
|
|
272
|
+
/**
|
|
273
|
+
* Deprecated: provider identifiers are backend-only; use id.
|
|
274
|
+
*
|
|
275
|
+
* @deprecated
|
|
276
|
+
*/
|
|
235
277
|
stytchMemberId: string;
|
|
236
278
|
email: string;
|
|
237
279
|
displayName: string;
|
|
@@ -92,9 +92,20 @@ export interface CompleteInviteOAuthResponse {
|
|
|
92
92
|
export interface RequestInviteRecoveryRequest {
|
|
93
93
|
email: string;
|
|
94
94
|
organizationSlug: string;
|
|
95
|
+
/**
|
|
96
|
+
* Deprecated: provider identifiers are backend-only; use invite_session_id.
|
|
97
|
+
*
|
|
98
|
+
* @deprecated
|
|
99
|
+
*/
|
|
95
100
|
stytchOrganizationId: string;
|
|
101
|
+
/**
|
|
102
|
+
* Deprecated: provider identifiers are backend-only; use invite_session_id.
|
|
103
|
+
*
|
|
104
|
+
* @deprecated
|
|
105
|
+
*/
|
|
96
106
|
stytchMemberId: string;
|
|
97
107
|
reason: InviteRecoveryReason;
|
|
108
|
+
inviteSessionId: string;
|
|
98
109
|
}
|
|
99
110
|
export interface RequestInviteRecoveryResponse {
|
|
100
111
|
accepted: boolean;
|
|
@@ -104,6 +115,11 @@ export interface RequestInviteRecoveryResponse {
|
|
|
104
115
|
export interface ExchangeDiscoveryOrganizationRequest {
|
|
105
116
|
discoverySessionId: string;
|
|
106
117
|
organizationId: string;
|
|
118
|
+
/**
|
|
119
|
+
* Deprecated: provider identifiers are backend-only; use organization_id.
|
|
120
|
+
*
|
|
121
|
+
* @deprecated
|
|
122
|
+
*/
|
|
107
123
|
stytchOrganizationId: string;
|
|
108
124
|
}
|
|
109
125
|
export interface ExchangeDiscoveryOrganizationResponse {
|
|
@@ -190,6 +206,7 @@ export interface CreateOrganizationMemberResponse {
|
|
|
190
206
|
}
|
|
191
207
|
export interface UpdateOrganizationMemberRequest {
|
|
192
208
|
organizationSlug: string;
|
|
209
|
+
/** Weave organization_memberships.id. */
|
|
193
210
|
memberId: string;
|
|
194
211
|
status: MembershipStatus;
|
|
195
212
|
roleIds: string[];
|
|
@@ -199,6 +216,7 @@ export interface UpdateOrganizationMemberResponse {
|
|
|
199
216
|
}
|
|
200
217
|
export interface RemoveOrganizationMemberRequest {
|
|
201
218
|
organizationSlug: string;
|
|
219
|
+
/** Weave organization_memberships.id. */
|
|
202
220
|
memberId: string;
|
|
203
221
|
}
|
|
204
222
|
export interface RemoveOrganizationMemberResponse {
|
|
@@ -206,6 +224,7 @@ export interface RemoveOrganizationMemberResponse {
|
|
|
206
224
|
}
|
|
207
225
|
export interface ResendOrganizationMemberInviteRequest {
|
|
208
226
|
organizationSlug: string;
|
|
227
|
+
/** Weave organization_memberships.id. */
|
|
209
228
|
memberId: string;
|
|
210
229
|
}
|
|
211
230
|
export interface ResendOrganizationMemberInviteResponse {
|
|
@@ -213,6 +232,7 @@ export interface ResendOrganizationMemberInviteResponse {
|
|
|
213
232
|
}
|
|
214
233
|
export interface RevokeOrganizationMemberInviteRequest {
|
|
215
234
|
organizationSlug: string;
|
|
235
|
+
/** Weave organization_memberships.id. */
|
|
216
236
|
memberId: string;
|
|
217
237
|
}
|
|
218
238
|
export interface RevokeOrganizationMemberInviteResponse {
|
|
@@ -230,6 +250,7 @@ export interface CreateOrganizationTeamRequest {
|
|
|
230
250
|
slug: string;
|
|
231
251
|
description: string;
|
|
232
252
|
roleIds: string[];
|
|
253
|
+
/** Weave organization_memberships.id values. */
|
|
233
254
|
memberIds: string[];
|
|
234
255
|
}
|
|
235
256
|
export interface CreateOrganizationTeamResponse {
|
|
@@ -249,6 +270,7 @@ export interface UpdateOrganizationTeamRequest {
|
|
|
249
270
|
slug: string;
|
|
250
271
|
description: string;
|
|
251
272
|
roleIds: string[];
|
|
273
|
+
/** Weave organization_memberships.id values. */
|
|
252
274
|
memberIds: string[];
|
|
253
275
|
}
|
|
254
276
|
export interface UpdateOrganizationTeamResponse {
|
|
@@ -1612,7 +1612,14 @@ exports.CompleteInviteOAuthResponse = {
|
|
|
1612
1612
|
},
|
|
1613
1613
|
};
|
|
1614
1614
|
function createBaseRequestInviteRecoveryRequest() {
|
|
1615
|
-
return {
|
|
1615
|
+
return {
|
|
1616
|
+
email: "",
|
|
1617
|
+
organizationSlug: "",
|
|
1618
|
+
stytchOrganizationId: "",
|
|
1619
|
+
stytchMemberId: "",
|
|
1620
|
+
reason: 0,
|
|
1621
|
+
inviteSessionId: "",
|
|
1622
|
+
};
|
|
1616
1623
|
}
|
|
1617
1624
|
exports.RequestInviteRecoveryRequest = {
|
|
1618
1625
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -1631,6 +1638,9 @@ exports.RequestInviteRecoveryRequest = {
|
|
|
1631
1638
|
if (message.reason !== 0) {
|
|
1632
1639
|
writer.uint32(40).int32(message.reason);
|
|
1633
1640
|
}
|
|
1641
|
+
if (message.inviteSessionId !== "") {
|
|
1642
|
+
writer.uint32(50).string(message.inviteSessionId);
|
|
1643
|
+
}
|
|
1634
1644
|
return writer;
|
|
1635
1645
|
},
|
|
1636
1646
|
decode(input, length) {
|
|
@@ -1675,6 +1685,13 @@ exports.RequestInviteRecoveryRequest = {
|
|
|
1675
1685
|
message.reason = reader.int32();
|
|
1676
1686
|
continue;
|
|
1677
1687
|
}
|
|
1688
|
+
case 6: {
|
|
1689
|
+
if (tag !== 50) {
|
|
1690
|
+
break;
|
|
1691
|
+
}
|
|
1692
|
+
message.inviteSessionId = reader.string();
|
|
1693
|
+
continue;
|
|
1694
|
+
}
|
|
1678
1695
|
}
|
|
1679
1696
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1680
1697
|
break;
|
|
@@ -1702,6 +1719,11 @@ exports.RequestInviteRecoveryRequest = {
|
|
|
1702
1719
|
? globalThis.String(object.stytch_member_id)
|
|
1703
1720
|
: "",
|
|
1704
1721
|
reason: isSet(object.reason) ? (0, auth_pb_1.inviteRecoveryReasonFromJSON)(object.reason) : 0,
|
|
1722
|
+
inviteSessionId: isSet(object.inviteSessionId)
|
|
1723
|
+
? globalThis.String(object.inviteSessionId)
|
|
1724
|
+
: isSet(object.invite_session_id)
|
|
1725
|
+
? globalThis.String(object.invite_session_id)
|
|
1726
|
+
: "",
|
|
1705
1727
|
};
|
|
1706
1728
|
},
|
|
1707
1729
|
toJSON(message) {
|
|
@@ -1721,19 +1743,23 @@ exports.RequestInviteRecoveryRequest = {
|
|
|
1721
1743
|
if (message.reason !== 0) {
|
|
1722
1744
|
obj.reason = (0, auth_pb_1.inviteRecoveryReasonToJSON)(message.reason);
|
|
1723
1745
|
}
|
|
1746
|
+
if (message.inviteSessionId !== "") {
|
|
1747
|
+
obj.inviteSessionId = message.inviteSessionId;
|
|
1748
|
+
}
|
|
1724
1749
|
return obj;
|
|
1725
1750
|
},
|
|
1726
1751
|
create(base) {
|
|
1727
1752
|
return exports.RequestInviteRecoveryRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1728
1753
|
},
|
|
1729
1754
|
fromPartial(object) {
|
|
1730
|
-
var _a, _b, _c, _d, _e;
|
|
1755
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1731
1756
|
const message = createBaseRequestInviteRecoveryRequest();
|
|
1732
1757
|
message.email = (_a = object.email) !== null && _a !== void 0 ? _a : "";
|
|
1733
1758
|
message.organizationSlug = (_b = object.organizationSlug) !== null && _b !== void 0 ? _b : "";
|
|
1734
1759
|
message.stytchOrganizationId = (_c = object.stytchOrganizationId) !== null && _c !== void 0 ? _c : "";
|
|
1735
1760
|
message.stytchMemberId = (_d = object.stytchMemberId) !== null && _d !== void 0 ? _d : "";
|
|
1736
1761
|
message.reason = (_e = object.reason) !== null && _e !== void 0 ? _e : 0;
|
|
1762
|
+
message.inviteSessionId = (_f = object.inviteSessionId) !== null && _f !== void 0 ? _f : "";
|
|
1737
1763
|
return message;
|
|
1738
1764
|
},
|
|
1739
1765
|
};
|
|
@@ -339,7 +339,7 @@ export interface ListOrganizationMembershipsForUserRow {
|
|
|
339
339
|
updatedAt: Date;
|
|
340
340
|
}
|
|
341
341
|
export declare function listOrganizationMembershipsForUser(client: Client, args: ListOrganizationMembershipsForUserArgs): Promise<ListOrganizationMembershipsForUserRow[]>;
|
|
342
|
-
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
|
|
342
|
+
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\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";
|
|
343
343
|
export interface ListOrganizationMembersArgs {
|
|
344
344
|
organizationId: string;
|
|
345
345
|
}
|
|
@@ -348,7 +348,6 @@ export interface ListOrganizationMembersRow {
|
|
|
348
348
|
userId: string;
|
|
349
349
|
organizationId: string;
|
|
350
350
|
identityLinkId: string | null;
|
|
351
|
-
stytchMemberId: string | null;
|
|
352
351
|
status: string;
|
|
353
352
|
roleIds: string[];
|
|
354
353
|
displayName: string;
|
|
@@ -358,6 +357,28 @@ export interface ListOrganizationMembersRow {
|
|
|
358
357
|
updatedAt: Date;
|
|
359
358
|
}
|
|
360
359
|
export declare function listOrganizationMembers(client: Client, args: ListOrganizationMembersArgs): Promise<ListOrganizationMembersRow[]>;
|
|
360
|
+
export declare const getOrganizationMemberAdminRecordQuery = "-- name: GetOrganizationMemberAdminRecord :one\nSELECT\n m.id AS organization_membership_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 l.stytch_organization_id,\n l.stytch_member_id,\n l.stytch_member_email,\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\n AND m.id = $2";
|
|
361
|
+
export interface GetOrganizationMemberAdminRecordArgs {
|
|
362
|
+
organizationId: string;
|
|
363
|
+
organizationMembershipId: string;
|
|
364
|
+
}
|
|
365
|
+
export interface GetOrganizationMemberAdminRecordRow {
|
|
366
|
+
organizationMembershipId: string;
|
|
367
|
+
userId: string;
|
|
368
|
+
organizationId: string;
|
|
369
|
+
identityLinkId: string | null;
|
|
370
|
+
status: string;
|
|
371
|
+
roleIds: string[];
|
|
372
|
+
displayName: string;
|
|
373
|
+
email: string;
|
|
374
|
+
avatarUrl: string;
|
|
375
|
+
stytchOrganizationId: string | null;
|
|
376
|
+
stytchMemberId: string | null;
|
|
377
|
+
stytchMemberEmail: string | null;
|
|
378
|
+
createdAt: Date;
|
|
379
|
+
updatedAt: Date;
|
|
380
|
+
}
|
|
381
|
+
export declare function getOrganizationMemberAdminRecord(client: Client, args: GetOrganizationMemberAdminRecordArgs): Promise<GetOrganizationMemberAdminRecordRow | null>;
|
|
361
382
|
export declare const listActivePlatformAdminGrantsForUserQuery = "-- name: ListActivePlatformAdminGrantsForUser :many\nSELECT\n id,\n user_id,\n platform_role,\n organization_id,\n all_organizations,\n allowed_actions,\n expires_at,\n status,\n created_at,\n updated_at\nFROM weave.platform_admin_grants\nWHERE user_id = $1\n AND status = 'active'\n AND (expires_at IS NULL OR expires_at > now())";
|
|
362
383
|
export interface ListActivePlatformAdminGrantsForUserArgs {
|
|
363
384
|
userId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.deleteOrgTeamMembershipsForOrganizationMemberQuery = exports.listEffectiveOrganizationRoleIDsQuery = exports.listOrgTeamRoleGrantsQuery = exports.listOrgTeamMembersQuery = exports.addOrgTeamRoleGrantQuery = exports.deleteOrgTeamRoleGrantsQuery = exports.addOrgTeamMembershipQuery = void 0;
|
|
3
|
+
exports.deleteOrgTeamQuery = exports.updateOrgTeamQuery = exports.listOrgTeamsQuery = exports.getOrgTeamQuery = exports.createOrgTeamQuery = 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.getOrganizationMemberAdminRecordQuery = 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.updateUserProfileThemeQuery = exports.setUserOrganizationPagePositionQuery = exports.setUserLastOrganizationQuery = exports.getUserAuthPreferencesQuery = exports.getUserPrimaryOrganizationAuthLinkQuery = exports.setUserPrimaryOrganizationQuery = exports.getUserByIDQuery = exports.createUserQuery = void 0;
|
|
4
|
+
exports.deleteOrgTeamMembershipsForOrganizationMemberQuery = exports.listEffectiveOrganizationRoleIDsQuery = exports.listOrgTeamRoleGrantsQuery = exports.listOrgTeamMembersQuery = exports.addOrgTeamRoleGrantQuery = exports.deleteOrgTeamRoleGrantsQuery = exports.addOrgTeamMembershipQuery = exports.deleteOrgTeamMembershipsQuery = void 0;
|
|
5
5
|
exports.createUser = createUser;
|
|
6
6
|
exports.getUserByID = getUserByID;
|
|
7
7
|
exports.setUserPrimaryOrganization = setUserPrimaryOrganization;
|
|
@@ -24,6 +24,7 @@ exports.upsertOrganizationMembership = upsertOrganizationMembership;
|
|
|
24
24
|
exports.getOrganizationMembership = getOrganizationMembership;
|
|
25
25
|
exports.listOrganizationMembershipsForUser = listOrganizationMembershipsForUser;
|
|
26
26
|
exports.listOrganizationMembers = listOrganizationMembers;
|
|
27
|
+
exports.getOrganizationMemberAdminRecord = getOrganizationMemberAdminRecord;
|
|
27
28
|
exports.listActivePlatformAdminGrantsForUser = listActivePlatformAdminGrantsForUser;
|
|
28
29
|
exports.createPlatformAdminGrant = createPlatformAdminGrant;
|
|
29
30
|
exports.createSupportAccessSession = createSupportAccessSession;
|
|
@@ -863,7 +864,6 @@ SELECT
|
|
|
863
864
|
m.user_id,
|
|
864
865
|
m.organization_id,
|
|
865
866
|
m.identity_link_id,
|
|
866
|
-
l.stytch_member_id,
|
|
867
867
|
m.status,
|
|
868
868
|
m.role_ids,
|
|
869
869
|
p.display_name,
|
|
@@ -890,17 +890,66 @@ async function listOrganizationMembers(client, args) {
|
|
|
890
890
|
userId: row[1],
|
|
891
891
|
organizationId: row[2],
|
|
892
892
|
identityLinkId: row[3],
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
updatedAt: row[11]
|
|
893
|
+
status: row[4],
|
|
894
|
+
roleIds: row[5],
|
|
895
|
+
displayName: row[6],
|
|
896
|
+
email: row[7],
|
|
897
|
+
avatarUrl: row[8],
|
|
898
|
+
createdAt: row[9],
|
|
899
|
+
updatedAt: row[10]
|
|
901
900
|
};
|
|
902
901
|
});
|
|
903
902
|
}
|
|
903
|
+
exports.getOrganizationMemberAdminRecordQuery = `-- name: GetOrganizationMemberAdminRecord :one
|
|
904
|
+
SELECT
|
|
905
|
+
m.id AS organization_membership_id,
|
|
906
|
+
m.user_id,
|
|
907
|
+
m.organization_id,
|
|
908
|
+
m.identity_link_id,
|
|
909
|
+
m.status,
|
|
910
|
+
m.role_ids,
|
|
911
|
+
p.display_name,
|
|
912
|
+
p.email,
|
|
913
|
+
p.avatar_url,
|
|
914
|
+
l.stytch_organization_id,
|
|
915
|
+
l.stytch_member_id,
|
|
916
|
+
l.stytch_member_email,
|
|
917
|
+
m.created_at,
|
|
918
|
+
m.updated_at
|
|
919
|
+
FROM weave.organization_memberships AS m
|
|
920
|
+
JOIN weave.user_profiles AS p
|
|
921
|
+
ON p.user_id = m.user_id
|
|
922
|
+
LEFT JOIN weave.identity_links AS l
|
|
923
|
+
ON l.id = m.identity_link_id
|
|
924
|
+
WHERE m.organization_id = $1
|
|
925
|
+
AND m.id = $2`;
|
|
926
|
+
async function getOrganizationMemberAdminRecord(client, args) {
|
|
927
|
+
const result = await client.query({
|
|
928
|
+
text: exports.getOrganizationMemberAdminRecordQuery,
|
|
929
|
+
values: [args.organizationId, args.organizationMembershipId],
|
|
930
|
+
rowMode: "array"
|
|
931
|
+
});
|
|
932
|
+
if (result.rows.length !== 1) {
|
|
933
|
+
return null;
|
|
934
|
+
}
|
|
935
|
+
const row = result.rows[0];
|
|
936
|
+
return {
|
|
937
|
+
organizationMembershipId: row[0],
|
|
938
|
+
userId: row[1],
|
|
939
|
+
organizationId: row[2],
|
|
940
|
+
identityLinkId: row[3],
|
|
941
|
+
status: row[4],
|
|
942
|
+
roleIds: row[5],
|
|
943
|
+
displayName: row[6],
|
|
944
|
+
email: row[7],
|
|
945
|
+
avatarUrl: row[8],
|
|
946
|
+
stytchOrganizationId: row[9],
|
|
947
|
+
stytchMemberId: row[10],
|
|
948
|
+
stytchMemberEmail: row[11],
|
|
949
|
+
createdAt: row[12],
|
|
950
|
+
updatedAt: row[13]
|
|
951
|
+
};
|
|
952
|
+
}
|
|
904
953
|
exports.listActivePlatformAdminGrantsForUserQuery = `-- name: ListActivePlatformAdminGrantsForUser :many
|
|
905
954
|
SELECT
|
|
906
955
|
id,
|