@nurama/types 1.4.0 → 1.4.2
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/device.d.ts +32 -0
- package/dist/join-link.d.ts +192 -1
- package/package.json +1 -1
- package/src/device.ts +35 -0
- package/src/join-link.ts +208 -1
package/dist/device.d.ts
CHANGED
|
@@ -98,3 +98,35 @@ export interface GetUserDevicesQuery {
|
|
|
98
98
|
/** Filter by device type */
|
|
99
99
|
deviceType?: DeviceType;
|
|
100
100
|
}
|
|
101
|
+
/** A file in an upload Live Activity's batch, as the app sees it (the API carries it on through processing). */
|
|
102
|
+
export interface LiveActivityFile {
|
|
103
|
+
/** The app's id for the file in its upload queue. */
|
|
104
|
+
key: string;
|
|
105
|
+
/** The asset, once the API has created it. */
|
|
106
|
+
assetId?: string | null;
|
|
107
|
+
kind: 'image' | 'video' | 'file';
|
|
108
|
+
size: number;
|
|
109
|
+
state: 'uploading' | 'processing' | 'ready' | 'failed';
|
|
110
|
+
/** 0–1 through the current state: bytes sent, or the processing percent. */
|
|
111
|
+
progress: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Register or refresh an upload Live Activity
|
|
115
|
+
*/
|
|
116
|
+
export interface RegisterLiveActivityBody {
|
|
117
|
+
/** The caller's registered iOS device the activity runs on (from `registerDevice`). */
|
|
118
|
+
deviceId: string;
|
|
119
|
+
/** The activity's own APNs push token (hex). */
|
|
120
|
+
pushToken: string;
|
|
121
|
+
/** App bundle id; the push topic is `<bundleId>.push-type.liveactivity`. */
|
|
122
|
+
bundleId: string;
|
|
123
|
+
/** The APNs environment the app's build receives pushes from. */
|
|
124
|
+
apnsEnvironment: 'production' | 'development';
|
|
125
|
+
/** Where the batch is going, as the activity shows it. */
|
|
126
|
+
destination?: string;
|
|
127
|
+
files: LiveActivityFile[];
|
|
128
|
+
}
|
|
129
|
+
export interface LiveActivityRegistration {
|
|
130
|
+
id: string;
|
|
131
|
+
stage: 'uploading' | 'processing' | 'done';
|
|
132
|
+
}
|
package/dist/join-link.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ export interface JoinLink {
|
|
|
16
16
|
id: ObjectId;
|
|
17
17
|
/** The opaque token embedded in the join URL (rotates when rolled). */
|
|
18
18
|
token: string;
|
|
19
|
+
/**
|
|
20
|
+
* Admin-chosen name for the link, so several on one project can be told apart
|
|
21
|
+
* and the approval queue can say which one a request came through. Null when
|
|
22
|
+
* unnamed; clients fall back to the mode plus a short id.
|
|
23
|
+
*/
|
|
24
|
+
label?: string | null;
|
|
19
25
|
/** Fully-qualified join URL, e.g. `https://app.nurama.com/join/<token>`. */
|
|
20
26
|
url: string;
|
|
21
27
|
/** @example project */
|
|
@@ -66,6 +72,8 @@ export interface JoinLinkPreview {
|
|
|
66
72
|
export interface CreateJoinLinkPayload {
|
|
67
73
|
/** @format uuid */
|
|
68
74
|
projectId: string;
|
|
75
|
+
/** Optional name for the link. Trimmed; empty is stored as null. */
|
|
76
|
+
label?: string | null;
|
|
69
77
|
mode?: 'auto' | 'approval';
|
|
70
78
|
role?: string;
|
|
71
79
|
additionalRoles?: string[];
|
|
@@ -76,6 +84,8 @@ export interface CreateJoinLinkPayload {
|
|
|
76
84
|
}
|
|
77
85
|
/** Payload to update a join link's settings (at least one field). */
|
|
78
86
|
export interface UpdateJoinLinkPayload {
|
|
87
|
+
/** Pass null or '' to clear the name. */
|
|
88
|
+
label?: string | null;
|
|
79
89
|
role?: string;
|
|
80
90
|
mode?: 'auto' | 'approval';
|
|
81
91
|
additionalRoles?: string[];
|
|
@@ -87,6 +97,187 @@ export interface UpdateJoinLinkPayload {
|
|
|
87
97
|
}
|
|
88
98
|
/** Result of redeeming a join link. */
|
|
89
99
|
export interface RedeemJoinLinkResult {
|
|
90
|
-
|
|
100
|
+
/**
|
|
101
|
+
* - `joined` → membership granted; the caller can go into the project.
|
|
102
|
+
* - `already-member` → nothing to do; they were in already.
|
|
103
|
+
* - `requested` → an APPROVAL-mode link. Nothing was granted: a request is
|
|
104
|
+
* queued for an admin. A caller that treats this like `joined` will walk the
|
|
105
|
+
* person through role onboarding and then fail to reach the project, because
|
|
106
|
+
* they have no membership — so handle it explicitly.
|
|
107
|
+
*/
|
|
108
|
+
status: 'joined' | 'already-member' | 'requested';
|
|
91
109
|
membership?: Membership;
|
|
110
|
+
/** Present only when `status` is `requested` — the queued request row. */
|
|
111
|
+
request?: ProjectJoinRequest;
|
|
112
|
+
}
|
|
113
|
+
/** Lifecycle of a request to join a project through an approval-mode link. */
|
|
114
|
+
export type JoinRequestStatus = 'pending' | 'approved' | 'rejected' | 'cancelled';
|
|
115
|
+
export interface ProjectJoinRequest {
|
|
116
|
+
id: string;
|
|
117
|
+
/** The link the request came through, not its token — rolling a token keeps requests intact. */
|
|
118
|
+
linkId: string;
|
|
119
|
+
projectId: string;
|
|
120
|
+
userId: string;
|
|
121
|
+
/**
|
|
122
|
+
* The terms the requester actually saw, snapshotted at request time. The link
|
|
123
|
+
* can be edited while a request waits; an admin approves what was asked for.
|
|
124
|
+
*/
|
|
125
|
+
role: string;
|
|
126
|
+
additionalRoles: string[];
|
|
127
|
+
requestedEmail?: string | null;
|
|
128
|
+
status: JoinRequestStatus;
|
|
129
|
+
decidedById?: string | null;
|
|
130
|
+
decidedAt?: string | null;
|
|
131
|
+
/**
|
|
132
|
+
* Set on a rejection that carried a cooldown — when this person may ask again.
|
|
133
|
+
* Null for an approval, and for a plain rejection with no cooldown.
|
|
134
|
+
*/
|
|
135
|
+
reapplyAfter?: string | null;
|
|
136
|
+
createdAt: string;
|
|
137
|
+
updatedAt: string;
|
|
138
|
+
/**
|
|
139
|
+
* The requester, populated for the admin queue so it can show a face and a
|
|
140
|
+
* name rather than a bare id. Null if the account has since been removed.
|
|
141
|
+
*/
|
|
142
|
+
user?: JoinRequestPerson | null;
|
|
143
|
+
/** Whoever decided it — part of the record a decided row is kept for. */
|
|
144
|
+
decidedBy?: JoinRequestPerson | null;
|
|
145
|
+
/**
|
|
146
|
+
* The link this request arrived through, populated for the admin queue. Null
|
|
147
|
+
* when the link has since been deleted — the request itself is kept either way.
|
|
148
|
+
*/
|
|
149
|
+
link?: JoinRequestLink | null;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The link a request came through, as the queue needs it. No `token`: the queue
|
|
153
|
+
* names and distinguishes links, it does not hand them out.
|
|
154
|
+
*/
|
|
155
|
+
export interface JoinRequestLink {
|
|
156
|
+
id: string;
|
|
157
|
+
label?: string | null;
|
|
158
|
+
mode: 'auto' | 'approval';
|
|
159
|
+
role: string;
|
|
160
|
+
status: 'active' | 'disabled';
|
|
161
|
+
/** When the link was minted. Names an unnamed link, so two can be told apart. */
|
|
162
|
+
createdAt: string;
|
|
163
|
+
}
|
|
164
|
+
/** The subset of a user the join-request queue renders. */
|
|
165
|
+
export interface JoinRequestPerson {
|
|
166
|
+
id: string;
|
|
167
|
+
displayName?: string | null;
|
|
168
|
+
firstName?: string | null;
|
|
169
|
+
lastName?: string | null;
|
|
170
|
+
color?: string | null;
|
|
171
|
+
avatarId?: string | null;
|
|
172
|
+
avatar?: unknown;
|
|
173
|
+
}
|
|
174
|
+
/** How far a ban reaches. A workspace ban covers every project inside it. */
|
|
175
|
+
export type BanScope = 'project' | 'workspace';
|
|
176
|
+
export interface ResourceBan {
|
|
177
|
+
id: string;
|
|
178
|
+
scope: BanScope;
|
|
179
|
+
/** The project or workspace the ban is set on, per `scope`. */
|
|
180
|
+
resourceId: string;
|
|
181
|
+
workspaceId: string;
|
|
182
|
+
userId: string;
|
|
183
|
+
/** Display only. Bans key on the account, so changing email does not lift one. */
|
|
184
|
+
email?: string | null;
|
|
185
|
+
reason?: string | null;
|
|
186
|
+
/** The rejected request this ban came from, when it came from one. */
|
|
187
|
+
sourceRequestId?: string | null;
|
|
188
|
+
createdById: string;
|
|
189
|
+
createdAt: string;
|
|
190
|
+
updatedAt: string;
|
|
191
|
+
}
|
|
192
|
+
export interface ListJoinRequestsResponse {
|
|
193
|
+
results: ProjectJoinRequest[];
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* A pending request as its own requester sees it.
|
|
197
|
+
*
|
|
198
|
+
* The same row as `ProjectJoinRequest`, carrying the project instead of the
|
|
199
|
+
* person: who asked is not news to the person who asked, and while they wait
|
|
200
|
+
* they are not a member, so what they learn about the project is limited to
|
|
201
|
+
* what the public link preview already showed them.
|
|
202
|
+
*/
|
|
203
|
+
export interface MyJoinRequest {
|
|
204
|
+
id: string;
|
|
205
|
+
projectId: string;
|
|
206
|
+
role: string;
|
|
207
|
+
additionalRoles: string[];
|
|
208
|
+
/** Always `pending` — a decided request is no longer outstanding. */
|
|
209
|
+
status: JoinRequestStatus;
|
|
210
|
+
createdAt: string;
|
|
211
|
+
/** Null if the project has since been deleted. */
|
|
212
|
+
project?: {
|
|
213
|
+
id: string;
|
|
214
|
+
name: string;
|
|
215
|
+
/** Brand colour, for the icon's fallback and border. */
|
|
216
|
+
color?: string | null;
|
|
217
|
+
/** Logo asset with parsed `files`, as the public link preview carries it. */
|
|
218
|
+
logo?: Asset | null;
|
|
219
|
+
} | null;
|
|
220
|
+
}
|
|
221
|
+
export interface ListMyJoinRequestsResponse {
|
|
222
|
+
results: MyJoinRequest[];
|
|
223
|
+
}
|
|
224
|
+
export interface ApproveJoinRequestResponse {
|
|
225
|
+
request: ProjectJoinRequest;
|
|
226
|
+
membership: unknown;
|
|
227
|
+
}
|
|
228
|
+
export interface RejectJoinRequestRequest {
|
|
229
|
+
projectId: string;
|
|
230
|
+
/**
|
|
231
|
+
* Present means "also bar this person". Deliberately explicit: a ban REMOVES
|
|
232
|
+
* an existing membership, so it can take away access they already had.
|
|
233
|
+
*
|
|
234
|
+
* Mutually exclusive with `reapplyAfter` — the server refuses both together,
|
|
235
|
+
* because a ban already blocks every path and a cooldown beside it would be
|
|
236
|
+
* dead config.
|
|
237
|
+
*/
|
|
238
|
+
ban?: {
|
|
239
|
+
scope: BanScope;
|
|
240
|
+
reason?: string;
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* The softer alternative: an ISO timestamp for when this person may ask again.
|
|
244
|
+
*
|
|
245
|
+
* Blocks self-service joining through any of the project's links until then,
|
|
246
|
+
* and unlike a ban it does not touch existing memberships or stop an admin
|
|
247
|
+
* from inviting them directly. Omit for an ordinary rejection, which they may
|
|
248
|
+
* follow with a fresh request immediately.
|
|
249
|
+
*/
|
|
250
|
+
reapplyAfter?: string | null;
|
|
251
|
+
}
|
|
252
|
+
/** The reapply-cooldown presets the admin UI offers on a rejection. */
|
|
253
|
+
export type ReapplyPreset = 'none' | '24h' | '1w' | '1m' | '1y' | 'custom';
|
|
254
|
+
export interface RejectJoinRequestResponse {
|
|
255
|
+
request: ProjectJoinRequest;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Amending the cooldown a rejection already set.
|
|
259
|
+
*
|
|
260
|
+
* `reapplyAfter` is required rather than optional: the value IS the call, and
|
|
261
|
+
* `null` — "they may ask again now" — is a decision worth stating rather than
|
|
262
|
+
* one that should fall out of an omitted field.
|
|
263
|
+
*/
|
|
264
|
+
export interface UpdateJoinRequestCooldownRequest {
|
|
265
|
+
projectId: string;
|
|
266
|
+
reapplyAfter: string | null;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Barring someone directly, rather than through rejecting their request.
|
|
270
|
+
*
|
|
271
|
+
* `userId`, not an email: the ban hangs off the account, and taking an address
|
|
272
|
+
* would make this a way to ask whether one has an account behind it.
|
|
273
|
+
*/
|
|
274
|
+
export interface CreateResourceBanRequest {
|
|
275
|
+
projectId: string;
|
|
276
|
+
userId: string;
|
|
277
|
+
scope: BanScope;
|
|
278
|
+
/** Admin-visible only. The person barred is never shown it, or told at all. */
|
|
279
|
+
reason?: string;
|
|
280
|
+
}
|
|
281
|
+
export interface ListBansResponse {
|
|
282
|
+
results: ResourceBan[];
|
|
92
283
|
}
|
package/package.json
CHANGED
package/src/device.ts
CHANGED
|
@@ -106,3 +106,38 @@ export interface GetUserDevicesQuery {
|
|
|
106
106
|
/** Filter by device type */
|
|
107
107
|
deviceType?: DeviceType;
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
/** A file in an upload Live Activity's batch, as the app sees it (the API carries it on through processing). */
|
|
111
|
+
export interface LiveActivityFile {
|
|
112
|
+
/** The app's id for the file in its upload queue. */
|
|
113
|
+
key: string;
|
|
114
|
+
/** The asset, once the API has created it. */
|
|
115
|
+
assetId?: string | null;
|
|
116
|
+
kind: 'image' | 'video' | 'file';
|
|
117
|
+
size: number;
|
|
118
|
+
state: 'uploading' | 'processing' | 'ready' | 'failed';
|
|
119
|
+
/** 0–1 through the current state: bytes sent, or the processing percent. */
|
|
120
|
+
progress: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Register or refresh an upload Live Activity
|
|
125
|
+
*/
|
|
126
|
+
export interface RegisterLiveActivityBody {
|
|
127
|
+
/** The caller's registered iOS device the activity runs on (from `registerDevice`). */
|
|
128
|
+
deviceId: string;
|
|
129
|
+
/** The activity's own APNs push token (hex). */
|
|
130
|
+
pushToken: string;
|
|
131
|
+
/** App bundle id; the push topic is `<bundleId>.push-type.liveactivity`. */
|
|
132
|
+
bundleId: string;
|
|
133
|
+
/** The APNs environment the app's build receives pushes from. */
|
|
134
|
+
apnsEnvironment: 'production' | 'development';
|
|
135
|
+
/** Where the batch is going, as the activity shows it. */
|
|
136
|
+
destination?: string;
|
|
137
|
+
files: LiveActivityFile[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface LiveActivityRegistration {
|
|
141
|
+
id: string;
|
|
142
|
+
stage: 'uploading' | 'processing' | 'done';
|
|
143
|
+
}
|
package/src/join-link.ts
CHANGED
|
@@ -17,6 +17,12 @@ export interface JoinLink {
|
|
|
17
17
|
id: ObjectId;
|
|
18
18
|
/** The opaque token embedded in the join URL (rotates when rolled). */
|
|
19
19
|
token: string;
|
|
20
|
+
/**
|
|
21
|
+
* Admin-chosen name for the link, so several on one project can be told apart
|
|
22
|
+
* and the approval queue can say which one a request came through. Null when
|
|
23
|
+
* unnamed; clients fall back to the mode plus a short id.
|
|
24
|
+
*/
|
|
25
|
+
label?: string | null;
|
|
20
26
|
/** Fully-qualified join URL, e.g. `https://app.nurama.com/join/<token>`. */
|
|
21
27
|
url: string;
|
|
22
28
|
/** @example project */
|
|
@@ -69,6 +75,8 @@ export interface JoinLinkPreview {
|
|
|
69
75
|
export interface CreateJoinLinkPayload {
|
|
70
76
|
/** @format uuid */
|
|
71
77
|
projectId: string;
|
|
78
|
+
/** Optional name for the link. Trimmed; empty is stored as null. */
|
|
79
|
+
label?: string | null;
|
|
72
80
|
mode?: 'auto' | 'approval';
|
|
73
81
|
role?: string;
|
|
74
82
|
additionalRoles?: string[];
|
|
@@ -80,6 +88,8 @@ export interface CreateJoinLinkPayload {
|
|
|
80
88
|
|
|
81
89
|
/** Payload to update a join link's settings (at least one field). */
|
|
82
90
|
export interface UpdateJoinLinkPayload {
|
|
91
|
+
/** Pass null or '' to clear the name. */
|
|
92
|
+
label?: string | null;
|
|
83
93
|
role?: string;
|
|
84
94
|
mode?: 'auto' | 'approval';
|
|
85
95
|
additionalRoles?: string[];
|
|
@@ -92,6 +102,203 @@ export interface UpdateJoinLinkPayload {
|
|
|
92
102
|
|
|
93
103
|
/** Result of redeeming a join link. */
|
|
94
104
|
export interface RedeemJoinLinkResult {
|
|
95
|
-
|
|
105
|
+
/**
|
|
106
|
+
* - `joined` → membership granted; the caller can go into the project.
|
|
107
|
+
* - `already-member` → nothing to do; they were in already.
|
|
108
|
+
* - `requested` → an APPROVAL-mode link. Nothing was granted: a request is
|
|
109
|
+
* queued for an admin. A caller that treats this like `joined` will walk the
|
|
110
|
+
* person through role onboarding and then fail to reach the project, because
|
|
111
|
+
* they have no membership — so handle it explicitly.
|
|
112
|
+
*/
|
|
113
|
+
status: 'joined' | 'already-member' | 'requested';
|
|
96
114
|
membership?: Membership;
|
|
115
|
+
/** Present only when `status` is `requested` — the queued request row. */
|
|
116
|
+
request?: ProjectJoinRequest;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Lifecycle of a request to join a project through an approval-mode link. */
|
|
120
|
+
export type JoinRequestStatus = 'pending' | 'approved' | 'rejected' | 'cancelled';
|
|
121
|
+
|
|
122
|
+
export interface ProjectJoinRequest {
|
|
123
|
+
id: string;
|
|
124
|
+
/** The link the request came through, not its token — rolling a token keeps requests intact. */
|
|
125
|
+
linkId: string;
|
|
126
|
+
projectId: string;
|
|
127
|
+
userId: string;
|
|
128
|
+
/**
|
|
129
|
+
* The terms the requester actually saw, snapshotted at request time. The link
|
|
130
|
+
* can be edited while a request waits; an admin approves what was asked for.
|
|
131
|
+
*/
|
|
132
|
+
role: string;
|
|
133
|
+
additionalRoles: string[];
|
|
134
|
+
requestedEmail?: string | null;
|
|
135
|
+
status: JoinRequestStatus;
|
|
136
|
+
decidedById?: string | null;
|
|
137
|
+
decidedAt?: string | null;
|
|
138
|
+
/**
|
|
139
|
+
* Set on a rejection that carried a cooldown — when this person may ask again.
|
|
140
|
+
* Null for an approval, and for a plain rejection with no cooldown.
|
|
141
|
+
*/
|
|
142
|
+
reapplyAfter?: string | null;
|
|
143
|
+
createdAt: string;
|
|
144
|
+
updatedAt: string;
|
|
145
|
+
/**
|
|
146
|
+
* The requester, populated for the admin queue so it can show a face and a
|
|
147
|
+
* name rather than a bare id. Null if the account has since been removed.
|
|
148
|
+
*/
|
|
149
|
+
user?: JoinRequestPerson | null;
|
|
150
|
+
/** Whoever decided it — part of the record a decided row is kept for. */
|
|
151
|
+
decidedBy?: JoinRequestPerson | null;
|
|
152
|
+
/**
|
|
153
|
+
* The link this request arrived through, populated for the admin queue. Null
|
|
154
|
+
* when the link has since been deleted — the request itself is kept either way.
|
|
155
|
+
*/
|
|
156
|
+
link?: JoinRequestLink | null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The link a request came through, as the queue needs it. No `token`: the queue
|
|
161
|
+
* names and distinguishes links, it does not hand them out.
|
|
162
|
+
*/
|
|
163
|
+
export interface JoinRequestLink {
|
|
164
|
+
id: string;
|
|
165
|
+
label?: string | null;
|
|
166
|
+
mode: 'auto' | 'approval';
|
|
167
|
+
role: string;
|
|
168
|
+
status: 'active' | 'disabled';
|
|
169
|
+
/** When the link was minted. Names an unnamed link, so two can be told apart. */
|
|
170
|
+
createdAt: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** The subset of a user the join-request queue renders. */
|
|
174
|
+
export interface JoinRequestPerson {
|
|
175
|
+
id: string;
|
|
176
|
+
displayName?: string | null;
|
|
177
|
+
firstName?: string | null;
|
|
178
|
+
lastName?: string | null;
|
|
179
|
+
color?: string | null;
|
|
180
|
+
avatarId?: string | null;
|
|
181
|
+
avatar?: unknown;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** How far a ban reaches. A workspace ban covers every project inside it. */
|
|
185
|
+
export type BanScope = 'project' | 'workspace';
|
|
186
|
+
|
|
187
|
+
export interface ResourceBan {
|
|
188
|
+
id: string;
|
|
189
|
+
scope: BanScope;
|
|
190
|
+
/** The project or workspace the ban is set on, per `scope`. */
|
|
191
|
+
resourceId: string;
|
|
192
|
+
workspaceId: string;
|
|
193
|
+
userId: string;
|
|
194
|
+
/** Display only. Bans key on the account, so changing email does not lift one. */
|
|
195
|
+
email?: string | null;
|
|
196
|
+
reason?: string | null;
|
|
197
|
+
/** The rejected request this ban came from, when it came from one. */
|
|
198
|
+
sourceRequestId?: string | null;
|
|
199
|
+
createdById: string;
|
|
200
|
+
createdAt: string;
|
|
201
|
+
updatedAt: string;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface ListJoinRequestsResponse {
|
|
205
|
+
results: ProjectJoinRequest[];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* A pending request as its own requester sees it.
|
|
210
|
+
*
|
|
211
|
+
* The same row as `ProjectJoinRequest`, carrying the project instead of the
|
|
212
|
+
* person: who asked is not news to the person who asked, and while they wait
|
|
213
|
+
* they are not a member, so what they learn about the project is limited to
|
|
214
|
+
* what the public link preview already showed them.
|
|
215
|
+
*/
|
|
216
|
+
export interface MyJoinRequest {
|
|
217
|
+
id: string;
|
|
218
|
+
projectId: string;
|
|
219
|
+
role: string;
|
|
220
|
+
additionalRoles: string[];
|
|
221
|
+
/** Always `pending` — a decided request is no longer outstanding. */
|
|
222
|
+
status: JoinRequestStatus;
|
|
223
|
+
createdAt: string;
|
|
224
|
+
/** Null if the project has since been deleted. */
|
|
225
|
+
project?: {
|
|
226
|
+
id: string;
|
|
227
|
+
name: string;
|
|
228
|
+
/** Brand colour, for the icon's fallback and border. */
|
|
229
|
+
color?: string | null;
|
|
230
|
+
/** Logo asset with parsed `files`, as the public link preview carries it. */
|
|
231
|
+
logo?: Asset | null;
|
|
232
|
+
} | null;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export interface ListMyJoinRequestsResponse {
|
|
236
|
+
results: MyJoinRequest[];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface ApproveJoinRequestResponse {
|
|
240
|
+
request: ProjectJoinRequest;
|
|
241
|
+
membership: unknown;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface RejectJoinRequestRequest {
|
|
245
|
+
projectId: string;
|
|
246
|
+
/**
|
|
247
|
+
* Present means "also bar this person". Deliberately explicit: a ban REMOVES
|
|
248
|
+
* an existing membership, so it can take away access they already had.
|
|
249
|
+
*
|
|
250
|
+
* Mutually exclusive with `reapplyAfter` — the server refuses both together,
|
|
251
|
+
* because a ban already blocks every path and a cooldown beside it would be
|
|
252
|
+
* dead config.
|
|
253
|
+
*/
|
|
254
|
+
ban?: {
|
|
255
|
+
scope: BanScope;
|
|
256
|
+
reason?: string;
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* The softer alternative: an ISO timestamp for when this person may ask again.
|
|
260
|
+
*
|
|
261
|
+
* Blocks self-service joining through any of the project's links until then,
|
|
262
|
+
* and unlike a ban it does not touch existing memberships or stop an admin
|
|
263
|
+
* from inviting them directly. Omit for an ordinary rejection, which they may
|
|
264
|
+
* follow with a fresh request immediately.
|
|
265
|
+
*/
|
|
266
|
+
reapplyAfter?: string | null;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** The reapply-cooldown presets the admin UI offers on a rejection. */
|
|
270
|
+
export type ReapplyPreset = 'none' | '24h' | '1w' | '1m' | '1y' | 'custom';
|
|
271
|
+
|
|
272
|
+
export interface RejectJoinRequestResponse {
|
|
273
|
+
request: ProjectJoinRequest;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Amending the cooldown a rejection already set.
|
|
278
|
+
*
|
|
279
|
+
* `reapplyAfter` is required rather than optional: the value IS the call, and
|
|
280
|
+
* `null` — "they may ask again now" — is a decision worth stating rather than
|
|
281
|
+
* one that should fall out of an omitted field.
|
|
282
|
+
*/
|
|
283
|
+
export interface UpdateJoinRequestCooldownRequest {
|
|
284
|
+
projectId: string;
|
|
285
|
+
reapplyAfter: string | null;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Barring someone directly, rather than through rejecting their request.
|
|
290
|
+
*
|
|
291
|
+
* `userId`, not an email: the ban hangs off the account, and taking an address
|
|
292
|
+
* would make this a way to ask whether one has an account behind it.
|
|
293
|
+
*/
|
|
294
|
+
export interface CreateResourceBanRequest {
|
|
295
|
+
projectId: string;
|
|
296
|
+
userId: string;
|
|
297
|
+
scope: BanScope;
|
|
298
|
+
/** Admin-visible only. The person barred is never shown it, or told at all. */
|
|
299
|
+
reason?: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface ListBansResponse {
|
|
303
|
+
results: ResourceBan[];
|
|
97
304
|
}
|