@deadair/sdk 0.59.0 → 0.60.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.
@@ -0,0 +1,40 @@
1
+ import type { Invitation, InvitationAccept, InvitationAcceptStart, InvitationAcceptStartResponse, InvitationAccepted, InvitationCreate, InvitationDetails, InvitationList, InvitationToken } from './types/invitations.types.js';
2
+ import type { SdkFetch } from '../sdk-options.js';
3
+ /**
4
+ * generated from [invitations.ck](../../../../apps/api/data/contracts/users/invitations.ck)
5
+ */
6
+ export declare class UsersInvitationsClient {
7
+ private fetch;
8
+ constructor(fetch: SdkFetch);
9
+ /**
10
+ * @name List invitations
11
+ * @description Every invitation, newest first, with the link of each one still open
12
+ */
13
+ listInvitations(): Promise<InvitationList>;
14
+ /**
15
+ * @name Create invitation
16
+ * @description Invite somebody into a role. An open invitation to the same address is withdrawn first, so this is also how one is sent again. Refused for an address that already has an account
17
+ */
18
+ createInvitation(body: InvitationCreate): Promise<Invitation>;
19
+ /**
20
+ * @name Revoke invitation
21
+ * @description Withdraw an invitation. Its link stops working at once. Nothing is deleted: it stays in the list as withdrawn
22
+ */
23
+ revokeInvitation(id: string): Promise<Invitation>;
24
+ /**
25
+ * @name Read invitation
26
+ * @description What an open invitation is for: the address, the role and the station. Changes nothing
27
+ */
28
+ readInvitation(body: InvitationToken): Promise<InvitationDetails>;
29
+ /**
30
+ * @name Start accepting invitation
31
+ * @description Check the password and start setting up the second step. Nothing is saved, and starting again replaces the setup
32
+ */
33
+ startAcceptingInvitation(body: InvitationAcceptStart): Promise<InvitationAcceptStartResponse>;
34
+ /**
35
+ * @name Accept invitation
36
+ * @description Accept: make the account with its password, its second step and its role, all at once, and spend the invitation
37
+ */
38
+ acceptInvitation(body: InvitationAccept): Promise<InvitationAccepted>;
39
+ }
40
+ //# sourceMappingURL=invitations.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitations.client.d.ts","sourceRoot":"","sources":["../../src/users/invitations.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,6BAA6B,EAC7B,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAClB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;GAEG;AACH,qBAAa,sBAAsB;IACnB,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,cAAc,CAAC;IAKhD;;;OAGG;IACG,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IASnE;;;OAGG;IACG,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAKvD;;;OAGG;IACG,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IASvE;;;OAGG;IACG,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,6BAA6B,CAAC;IASnG;;;OAGG;IACG,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAQ9E"}
@@ -0,0 +1,3 @@
1
+ export * from './invitations.types.js';
2
+ export * from './users.types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/users/types/index.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,178 @@
1
+ import { DateTime } from 'luxon';
2
+ import type { FidoFactorAttestation } from '../../authentication/types/registration.types.js';
3
+ import type { PlatformRole } from '../../authentication/types/authentication.types.js';
4
+ import type { PublicKeyCredentialWithAttestation } from '../../authentication/types/authentication.types.js';
5
+ /**
6
+ * Where an invitation stands. `expired` is a pending invitation whose time ran out
7
+ * generated from [InvitationState](../../../../../apps/api/data/contracts/users/invitations.types.ck)
8
+ */
9
+ export type InvitationState = 'pending' | 'accepted' | 'revoked' | 'expired';
10
+ /**
11
+ * Invite somebody by their address
12
+ * generated from [InvitationCreate](../../../../../apps/api/data/contracts/users/invitations.types.ck)
13
+ */
14
+ export interface InvitationCreate {
15
+ /** The address the account will have */
16
+ email: string;
17
+ /** The role the account will hold */
18
+ role: PlatformRole;
19
+ /** Email the link to the address too. Refused with a 503, and nothing made, when the station has no mail server */
20
+ send?: boolean;
21
+ }
22
+ /**
23
+ * An invitation's link token, as it appears after `#` on the invite page
24
+ * generated from [InvitationToken](../../../../../apps/api/data/contracts/users/invitations.types.ck)
25
+ */
26
+ export interface InvitationToken {
27
+ /** The token */
28
+ token: string;
29
+ }
30
+ /**
31
+ * What an open invitation is for, shown to the person before they accept
32
+ * generated from [InvitationDetails](../../../../../apps/api/data/contracts/users/invitations.types.ck)
33
+ */
34
+ export interface InvitationDetails {
35
+ /** The address the account will have */
36
+ email: string;
37
+ /** The role it will hold */
38
+ role: PlatformRole;
39
+ /** What the station calls itself */
40
+ stationName: string;
41
+ /** When the link stops working */
42
+ expiresAt: DateTime;
43
+ }
44
+ /** Rehydrates every wire-encoded scalar in a InvitationDetails into its runtime type. Mutates and returns `raw`. */
45
+ export declare function reviveInvitationDetails(raw: InvitationDetails): InvitationDetails;
46
+ /**
47
+ * How the person will prove it is them after their password: an authenticator app, or a passkey
48
+ * generated from [InvitationSecondStep](../../../../../apps/api/data/contracts/users/invitations.types.ck)
49
+ */
50
+ export type InvitationSecondStep = 'authenticator' | 'fido';
51
+ /**
52
+ * An authenticator app to scan, for an invitation being accepted
53
+ * generated from [InvitationAuthenticatorSetup](../../../../../apps/api/data/contracts/users/invitations.types.ck)
54
+ */
55
+ export interface InvitationAuthenticatorSetup {
56
+ /** Discriminator */
57
+ method: 'authenticator';
58
+ /** Send this back with the first code */
59
+ registrationId: string;
60
+ /** The key, for an app that cannot scan */
61
+ secret: string;
62
+ /** The `otpauth://` address the QR code holds */
63
+ uri: string;
64
+ /** The QR code, as a data URL */
65
+ qrCode: string;
66
+ }
67
+ /**
68
+ * A passkey to make, for an invitation being accepted
69
+ * generated from [InvitationPasskeySetup](../../../../../apps/api/data/contracts/users/invitations.types.ck)
70
+ */
71
+ export interface InvitationPasskeySetup {
72
+ /** Discriminator */
73
+ method: 'fido';
74
+ /** Send this back with the credential */
75
+ registrationId: string;
76
+ /** What to hand `navigator.credentials.create` */
77
+ attestation: FidoFactorAttestation;
78
+ }
79
+ /**
80
+ * Accept with the first code from the authenticator app
81
+ * generated from [InvitationAcceptWithAuthenticator](../../../../../apps/api/data/contracts/users/invitations.types.ck)
82
+ */
83
+ export interface InvitationAcceptWithAuthenticator {
84
+ /** Discriminator */
85
+ method: 'authenticator';
86
+ /** The invitation's token */
87
+ token: string;
88
+ /** The same password as at the start */
89
+ password: string;
90
+ /** From the start */
91
+ registrationId: string;
92
+ /** The first code the app shows */
93
+ code: string;
94
+ }
95
+ /**
96
+ * Accept with the passkey the browser just made
97
+ * generated from [InvitationAcceptWithPasskey](../../../../../apps/api/data/contracts/users/invitations.types.ck)
98
+ */
99
+ export interface InvitationAcceptWithPasskey {
100
+ /** Discriminator */
101
+ method: 'fido';
102
+ /** The invitation's token */
103
+ token: string;
104
+ /** The same password as at the start */
105
+ password: string;
106
+ /** From the start */
107
+ registrationId: string;
108
+ /** What `navigator.credentials.create` answered */
109
+ credential: PublicKeyCredentialWithAttestation;
110
+ }
111
+ /**
112
+ * The account made from an invitation. Sign in with it as usual
113
+ * generated from [InvitationAccepted](../../../../../apps/api/data/contracts/users/invitations.types.ck)
114
+ */
115
+ export interface InvitationAccepted {
116
+ /** The address to sign in with */
117
+ email: string;
118
+ /** The role it holds */
119
+ role: PlatformRole;
120
+ }
121
+ /**
122
+ * An invitation for somebody to take an account on the station
123
+ * generated from [Invitation](../../../../../apps/api/data/contracts/users/invitations.types.ck)
124
+ */
125
+ export interface Invitation {
126
+ /** The invitation's id */
127
+ id: string;
128
+ /** The address the account will have. The person cannot change it while accepting */
129
+ email: string;
130
+ /** The role the account will hold */
131
+ role: PlatformRole;
132
+ /** Where it stands */
133
+ state: InvitationState;
134
+ /** When it was made */
135
+ createdAt: DateTime;
136
+ /** When the link stops working, if nobody has used it */
137
+ expiresAt: DateTime;
138
+ /** The address of the admin who made it. Absent once their account is gone */
139
+ invitedBy?: string;
140
+ /** When somebody accepted it */
141
+ acceptedAt?: DateTime;
142
+ /** When it was withdrawn, by an admin or by a newer invitation to the same address */
143
+ revokedAt?: DateTime;
144
+ /** The invitation itself, only while it is pending. Put it after `#` on the station's `/invite` page, as `/invite#<token>`. Anyone holding it can claim the account, so show it only to the person invited */
145
+ token?: string;
146
+ }
147
+ /** Rehydrates every wire-encoded scalar in a Invitation into its runtime type. Mutates and returns `raw`. */
148
+ export declare function reviveInvitation(raw: Invitation): Invitation;
149
+ /**
150
+ * Choose a password and a second step. Nothing is saved yet
151
+ * generated from [InvitationAcceptStart](../../../../../apps/api/data/contracts/users/invitations.types.ck)
152
+ */
153
+ export interface InvitationAcceptStart {
154
+ /** The invitation's token */
155
+ token: string;
156
+ /** The password the account will have. Refused here if it is too weak, so the person learns before setting anything else up */
157
+ password: string;
158
+ /** The second step to set up */
159
+ method: InvitationSecondStep;
160
+ }
161
+ /**
162
+ * generated from [InvitationAcceptStartResponse](../../../../../apps/api/data/contracts/users/invitations.types.ck)
163
+ */
164
+ export type InvitationAcceptStartResponse = InvitationAuthenticatorSetup | InvitationPasskeySetup;
165
+ /**
166
+ * generated from [InvitationAccept](../../../../../apps/api/data/contracts/users/invitations.types.ck)
167
+ */
168
+ export type InvitationAccept = InvitationAcceptWithAuthenticator | InvitationAcceptWithPasskey;
169
+ /**
170
+ * The station's invitations, newest first
171
+ * generated from [InvitationList](../../../../../apps/api/data/contracts/users/invitations.types.ck)
172
+ */
173
+ export interface InvitationList {
174
+ data: Invitation[];
175
+ }
176
+ /** Rehydrates every wire-encoded scalar in a InvitationList into its runtime type. Mutates and returns `raw`. */
177
+ export declare function reviveInvitationList(raw: InvitationList): InvitationList;
178
+ //# sourceMappingURL=invitations.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitations.types.d.ts","sourceRoot":"","sources":["../../../src/users/types/invitations.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kDAAkD,CAAC;AAC9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,oDAAoD,CAAC;AAW7G;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7E;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,IAAI,EAAE,YAAY,CAAC;IACnB,mHAAmH;IACnH,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,SAAS,EAAE,QAAQ,CAAC;CACvB;AAED,oHAAoH;AACpH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,iBAAiB,GAAG,iBAAiB,CAIjF;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG,MAAM,CAAC;AAE5D;;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CAAC;IACd,qCAAqC;IACrC,IAAI,EAAE,YAAY,CAAC;IACnB,sBAAsB;IACtB,KAAK,EAAE,eAAe,CAAC;IACvB,uBAAuB;IACvB,SAAS,EAAE,QAAQ,CAAC;IACpB,yDAAyD;IACzD,SAAS,EAAE,QAAQ,CAAC;IACpB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,sFAAsF;IACtF,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,8MAA8M;IAC9M,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,6GAA6G;AAC7G,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAW5D;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,+HAA+H;IAC/H,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,MAAM,EAAE,oBAAoB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,4BAA4B,GAAG,sBAAsB,CAAC;AAElG;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,iCAAiC,GAAG,2BAA2B,CAAC;AAE/F;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,iHAAiH;AACjH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CASxE"}
@@ -0,0 +1,123 @@
1
+ import { DateTime } from 'luxon';
2
+ import type { Pagination } from '../../shared/types/pagination.js';
3
+ import type { PaginationInput } from '../../shared/types/pagination.js';
4
+ import type { PaginationWithActive } from '../../shared/types/pagination.js';
5
+ import type { PaginationWithActiveInput } from '../../shared/types/pagination.js';
6
+ import type { PlatformRole } from '../../authentication/types/authentication.types.js';
7
+ import type { Session } from '../../authentication/types/authentication.types.js';
8
+ import type { SessionInput } from '../../authentication/types/authentication.types.js';
9
+ /**
10
+ * Which people to list
11
+ * generated from [UserQuery](../../../../../apps/api/data/contracts/users/users.types.ck)
12
+ */
13
+ export interface UserQuery extends PaginationWithActive {
14
+ /** Part of an email address */
15
+ search?: string;
16
+ /** Only people holding this role */
17
+ role?: PlatformRole;
18
+ }
19
+ export interface UserQueryInput extends PaginationWithActiveInput {
20
+ /** Part of an email address */
21
+ search?: string;
22
+ /** Only people holding this role */
23
+ role?: PlatformRole;
24
+ }
25
+ /**
26
+ * A person with an account on the station
27
+ * generated from [UserSummary](../../../../../apps/api/data/contracts/users/users.types.ck)
28
+ */
29
+ export interface UserSummary {
30
+ /** The person's account id */
31
+ id: string;
32
+ /** The address they sign in with. Absent for an account that has none, such as one made through a provider that shared no address */
33
+ email?: string;
34
+ /** The one role they hold. Absent for an account nobody has granted one */
35
+ role?: PlatformRole;
36
+ /** False once the account has been switched off. A switched-off person cannot sign in, and every session they held has ended */
37
+ active: boolean;
38
+ /** When the account was made */
39
+ createdAt: DateTime;
40
+ /** When they last signed in. Absent if they never have */
41
+ lastSignInAt?: DateTime;
42
+ /** Whether they have an authenticator app or a passkey, which the phone apps need to sign in with */
43
+ hasStrongFactor: boolean;
44
+ }
45
+ /** Rehydrates every wire-encoded scalar in a UserSummary into its runtime type. Mutates and returns `raw`. */
46
+ export declare function reviveUserSummary(raw: UserSummary): UserSummary;
47
+ /**
48
+ * One way a person signs in. Never the secret itself
49
+ * generated from [UserFactor](../../../../../apps/api/data/contracts/users/users.types.ck)
50
+ */
51
+ export interface UserFactor {
52
+ /** What kind of factor it is */
53
+ method: 'email' | 'password' | 'authenticator' | 'fido' | 'oidc' | 'phone';
54
+ /** Which factor of that kind */
55
+ methodId: string;
56
+ /** What it proves */
57
+ kind: 'knowledge' | 'possession' | 'biometric';
58
+ /** How it is shown, such as a masked address or the authenticator's name */
59
+ label?: string;
60
+ }
61
+ /**
62
+ * One time a person signed in
63
+ * generated from [UserSignIn](../../../../../apps/api/data/contracts/users/users.types.ck)
64
+ */
65
+ export interface UserSignIn {
66
+ /** When */
67
+ occurredAt: DateTime;
68
+ /** The factor they signed in with */
69
+ method: string;
70
+ /** Whether a second factor was proved */
71
+ mfaSatisfied: boolean;
72
+ /** The address the request came from */
73
+ ip?: string;
74
+ /** The app or browser that asked */
75
+ userAgent?: string;
76
+ }
77
+ /** Rehydrates every wire-encoded scalar in a UserSignIn into its runtime type. Mutates and returns `raw`. */
78
+ export declare function reviveUserSignIn(raw: UserSignIn): UserSignIn;
79
+ /**
80
+ * The role a person should hold
81
+ * generated from [UserRoleChange](../../../../../apps/api/data/contracts/users/users.types.ck)
82
+ */
83
+ export interface UserRoleChange {
84
+ /** Replaces whatever role they held */
85
+ role: PlatformRole;
86
+ }
87
+ /**
88
+ * One page of people
89
+ * generated from [UserPage](../../../../../apps/api/data/contracts/users/users.types.ck)
90
+ */
91
+ export interface UserPage {
92
+ meta: Pagination;
93
+ data: UserSummary[];
94
+ }
95
+ export interface UserPageInput {
96
+ meta: PaginationInput;
97
+ data: UserSummary[];
98
+ }
99
+ /** Rehydrates every wire-encoded scalar in a UserPage into its runtime type. Mutates and returns `raw`. */
100
+ export declare function reviveUserPage(raw: UserPage): UserPage;
101
+ /**
102
+ * A person, with how they sign in and where they are signed in
103
+ * generated from [UserDetail](../../../../../apps/api/data/contracts/users/users.types.ck)
104
+ */
105
+ export interface UserDetail extends UserSummary {
106
+ /** Every way they can sign in */
107
+ factors: UserFactor[];
108
+ /** Where they are signed in now */
109
+ sessions: Session[];
110
+ /** Their most recent sign-ins, newest first */
111
+ signIns: UserSignIn[];
112
+ }
113
+ export interface UserDetailInput extends UserSummary {
114
+ /** Every way they can sign in */
115
+ factors: UserFactor[];
116
+ /** Where they are signed in now */
117
+ sessions: SessionInput[];
118
+ /** Their most recent sign-ins, newest first */
119
+ signIns: UserSignIn[];
120
+ }
121
+ /** Rehydrates every wire-encoded scalar in a UserDetail into its runtime type. Mutates and returns `raw`. */
122
+ export declare function reviveUserDetail(raw: UserDetail): UserDetail;
123
+ //# sourceMappingURL=users.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.types.d.ts","sourceRoot":"","sources":["../../../src/users/types/users.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oDAAoD,CAAC;AAElF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAWvF;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,oBAAoB;IACnD,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,cAAe,SAAQ,yBAAyB;IAC7D,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,qIAAqI;IACrI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,gIAAgI;IAChI,MAAM,EAAE,OAAO,CAAC;IAChB,gCAAgC;IAChC,SAAS,EAAE,QAAQ,CAAC;IACpB,0DAA0D;IAC1D,YAAY,C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W,SAAQ,WAAW;IAC3C,iCAAiC;IACjC,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,mCAAmC;IACnC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,+CAA+C;IAC/C,OAAO,EAAE,UAAU,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAChD,iCAAiC;IACjC,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,mCAAmC;IACnC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,+CAA+C;IAC/C,OAAO,EAAE,UAAU,EAAE,CAAC;CACzB;AAED,6GAA6G;AAC7G,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAgB5D"}
@@ -0,0 +1,44 @@
1
+ import type { SdkFetch } from '../sdk-options.js';
2
+ import type { UserDetail, UserPage, UserQueryInput, UserRoleChange, UserSummary } from './types/users.types.js';
3
+ import { UsersInvitationsClient } from './invitations.client.js';
4
+ export declare class UsersClient {
5
+ private fetch;
6
+ readonly invitations: UsersInvitationsClient;
7
+ constructor(fetch: SdkFetch);
8
+ /**
9
+ * @name List users
10
+ * @description The station's people, one page at a time, ordered by when their account was made
11
+ */
12
+ listUsers(query?: UserQueryInput): Promise<UserPage>;
13
+ /**
14
+ * @name Get user
15
+ * @description One person, with every way they sign in, where they are signed in and their recent sign-ins
16
+ */
17
+ getUser(id: string): Promise<UserDetail>;
18
+ /**
19
+ * @name Change user role
20
+ * @description Give a person a different role. They hold exactly one, so the role they had is taken away. Refused for your own account, and for the last admin
21
+ */
22
+ changeUserRole(id: string, body: UserRoleChange): Promise<UserSummary>;
23
+ /**
24
+ * @name Deactivate user
25
+ * @description Switch a person off. They are signed out everywhere and cannot sign in, and their API keys, connected apps and chat links stop working, until they are switched back on. Nothing is deleted. Refused for your own account, and for the last admin
26
+ */
27
+ deactivateUser(id: string): Promise<UserSummary>;
28
+ /**
29
+ * @name Reactivate user
30
+ * @description Switch a person back on. They sign in as they did before, and their API keys, connected apps and chat links work again
31
+ */
32
+ reactivateUser(id: string): Promise<UserSummary>;
33
+ /**
34
+ * @name Sign out user
35
+ * @description Sign a person out everywhere. They can sign straight back in
36
+ */
37
+ signOutUser(id: string): Promise<void>;
38
+ /**
39
+ * @name Reset user MFA
40
+ * @description Remove a person's authenticator apps and passkeys and sign them out everywhere, for when they have lost the device. They sign in with their password and set a new one up
41
+ */
42
+ resetUserMFA(id: string): Promise<void>;
43
+ }
44
+ //# sourceMappingURL=users.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.client.d.ts","sourceRoot":"","sources":["../../src/users/users.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEhH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,qBAAa,WAAW;IAGR,OAAO,CAAC,KAAK;IAFzB,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC;gBAEzB,KAAK,EAAE,QAAQ;IAInC;;;OAGG;IACG,SAAS,CAAC,KAAK,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAQ1D;;;OAGG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAK9C;;;OAGG;IACG,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC;IAS5E;;;OAGG;IACG,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAKtD;;;OAGG;IACG,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAKtD;;;OAGG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5C;;;OAGG;IACG,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGhD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deadair/sdk",
3
- "version": "0.59.0",
3
+ "version": "0.60.0",
4
4
  "description": "A typed client for the deadair station's HTTP API, generated from the same contracts the station serves.",
5
5
  "keywords": [
6
6
  "deadair",