@iveri/contracts 0.138.0 → 0.140.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/README.md +4 -0
- package/dist/api/gym/gym-refusal.enum.d.ts +6 -1
- package/dist/api/gym/gym-refusal.enum.js +5 -0
- package/dist/api/gym/gym-trainer-note.type.d.ts +43 -0
- package/dist/api/gym/gym-trainer-note.type.js +1 -0
- package/dist/api/gym/index.d.ts +1 -0
- package/dist/api/gym/index.js +1 -0
- package/dist/api/identity/auth.type.d.ts +11 -0
- package/dist/api/identity/identity-refusal.enum.d.ts +17 -0
- package/dist/api/identity/identity-refusal.enum.js +18 -0
- package/dist/api/identity/index.d.ts +1 -0
- package/dist/api/identity/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -317,6 +317,10 @@ Conduit's outbox.
|
|
|
317
317
|
- Version `0.138.0` adds `profile:directory:read` and `profile:directory:read-any` with `ProfileDirectoryPage` under
|
|
318
318
|
`@iveri/contracts/identity` (the names of a company's members who hold a permission), and `UniboxAgent` /
|
|
319
319
|
`UniboxAgents` under `@iveri/contracts/unibox`, so the inbox picks agents by name.
|
|
320
|
+
- Version `0.139.0` adds a trainer's notes on a member: `GymTrainerNote`, `GymTrainerNotes`, `SaveGymTrainerNoteRequest`,
|
|
321
|
+
`GymMyTrainerNote` and the `GymRefusal` member `not-their-trainer` under `@iveri/contracts/gym`.
|
|
322
|
+
- Version `0.140.0` adds `DeleteOwnAccountBody` and the `IdentityRefusal` enum (`password-incorrect`,
|
|
323
|
+
`not-self-registered`) under `@iveri/contracts/identity`, for deleting one's own account at `DELETE /auth/me`.
|
|
320
324
|
- Version `0.134.0` adds `delivery:job:create-any`, `delivery:job:read-any` and `delivery:job:operate-any`, so a shop's
|
|
321
325
|
and a restaurant's operator-workspace keys ask for, confirm and follow a courier in the company a request names.
|
|
322
326
|
- Version `0.131.0` adds `mobility:dispatch:create-any`, `mobility:dispatch:read-any`, `mobility:dispatch:operate-any`,
|
|
@@ -51,5 +51,10 @@ export declare enum GymRefusal {
|
|
|
51
51
|
/** This month's free guest visits are used; `details.resetsOn` is the date the count starts again. */
|
|
52
52
|
GUEST_PASSES_USED = "guest-passes-used",
|
|
53
53
|
/** Guest visits ride on a membership that is current today, so not a frozen, ended, unpaid or future one. */
|
|
54
|
-
GUEST_PASS_NOT_CURRENT = "guest-pass-not-current"
|
|
54
|
+
GUEST_PASS_NOT_CURRENT = "guest-pass-not-current",
|
|
55
|
+
/**
|
|
56
|
+
* Only a trainer who has a personal session with the member (booked, attended or missed) writes notes about them;
|
|
57
|
+
* the screen was stale, for example the only session was called off.
|
|
58
|
+
*/
|
|
59
|
+
NOT_THEIR_TRAINER = "not-their-trainer"
|
|
55
60
|
}
|
|
@@ -53,4 +53,9 @@ export var GymRefusal;
|
|
|
53
53
|
GymRefusal["GUEST_PASSES_USED"] = "guest-passes-used";
|
|
54
54
|
/** Guest visits ride on a membership that is current today, so not a frozen, ended, unpaid or future one. */
|
|
55
55
|
GymRefusal["GUEST_PASS_NOT_CURRENT"] = "guest-pass-not-current";
|
|
56
|
+
/**
|
|
57
|
+
* Only a trainer who has a personal session with the member (booked, attended or missed) writes notes about them;
|
|
58
|
+
* the screen was stale, for example the only session was called off.
|
|
59
|
+
*/
|
|
60
|
+
GymRefusal["NOT_THEIR_TRAINER"] = "not-their-trainer";
|
|
56
61
|
})(GymRefusal || (GymRefusal = {}));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
/**
|
|
5
|
+
* A dated note a trainer wrote about a member's progress, as the gym's staff read it.
|
|
6
|
+
*
|
|
7
|
+
* Notes are not a secret file: the member reads every note written about them (`GymMyTrainerNote`), so nothing is
|
|
8
|
+
* kept about a person that they cannot see. Plain text, at most 2000 characters, line breaks kept.
|
|
9
|
+
*/
|
|
10
|
+
export interface GymTrainerNote {
|
|
11
|
+
id: UUID;
|
|
12
|
+
memberId: UUID;
|
|
13
|
+
/** The staff member who wrote it. */
|
|
14
|
+
trainerId: UUID;
|
|
15
|
+
trainerName: string;
|
|
16
|
+
body: string;
|
|
17
|
+
/** True when the caller wrote it, so may change or remove it. */
|
|
18
|
+
writtenByMe: boolean;
|
|
19
|
+
createdAt: IsoDateTime;
|
|
20
|
+
/** When the text was last changed, or null when it reads as first written. No earlier wording is kept. */
|
|
21
|
+
editedAt: Nullable<IsoDateTime>;
|
|
22
|
+
}
|
|
23
|
+
/** A member's notes, newest first, and whether the caller may add one. */
|
|
24
|
+
export interface GymTrainerNotes {
|
|
25
|
+
notes: GymTrainerNote[];
|
|
26
|
+
/**
|
|
27
|
+
* Whether the caller may write about this member: an active trainer of the gym who has a personal session with
|
|
28
|
+
* them (booked, attended or missed, past or upcoming).
|
|
29
|
+
*/
|
|
30
|
+
canWrite: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Writing or rewriting a note. Plain text, at most 2000 characters, not blank. */
|
|
33
|
+
export interface SaveGymTrainerNoteRequest {
|
|
34
|
+
body: string;
|
|
35
|
+
}
|
|
36
|
+
/** A note as the member it is about reads it, read-only. */
|
|
37
|
+
export interface GymMyTrainerNote {
|
|
38
|
+
id: UUID;
|
|
39
|
+
trainerName: string;
|
|
40
|
+
body: string;
|
|
41
|
+
createdAt: IsoDateTime;
|
|
42
|
+
editedAt: Nullable<IsoDateTime>;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/api/gym/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export * from './gym-session-kind.enum.js';
|
|
|
42
42
|
export * from './gym-session-status.enum.js';
|
|
43
43
|
export * from './gym-signature-method.enum.js';
|
|
44
44
|
export * from './gym-staff.type.js';
|
|
45
|
+
export * from './gym-trainer-note.type.js';
|
|
45
46
|
export * from './gym-trainer-time-off.type.js';
|
|
46
47
|
export * from './gym-training.type.js';
|
|
47
48
|
export * from './gym-waiver.type.js';
|
package/dist/api/gym/index.js
CHANGED
|
@@ -42,6 +42,7 @@ export * from './gym-session-kind.enum.js';
|
|
|
42
42
|
export * from './gym-session-status.enum.js';
|
|
43
43
|
export * from './gym-signature-method.enum.js';
|
|
44
44
|
export * from './gym-staff.type.js';
|
|
45
|
+
export * from './gym-trainer-note.type.js';
|
|
45
46
|
export * from './gym-trainer-time-off.type.js';
|
|
46
47
|
export * from './gym-training.type.js';
|
|
47
48
|
export * from './gym-waiver.type.js';
|
|
@@ -212,6 +212,17 @@ export interface UpdateProfileBody {
|
|
|
212
212
|
lastName?: string;
|
|
213
213
|
phone?: Nullable<string>;
|
|
214
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* `DELETE /auth/me` — a person deletes the account they made for themselves (a shopper, a diner, a gym member).
|
|
217
|
+
*
|
|
218
|
+
* The current password is asked again, so a stolen access token cannot delete an account. Answered 204: the person is
|
|
219
|
+
* removed from the company and everything identifying them is erased, exactly as when a company removes somebody. Only
|
|
220
|
+
* an account made through `POST /auth/register` that holds nothing beyond that may be deleted this way; anybody else is
|
|
221
|
+
* refused with `IdentityRefusal.NOT_SELF_REGISTERED` and is removed by their company.
|
|
222
|
+
*/
|
|
223
|
+
export interface DeleteOwnAccountBody {
|
|
224
|
+
password: string;
|
|
225
|
+
}
|
|
215
226
|
/**
|
|
216
227
|
* What one person may see about another. Returned by `GET /users/:userId/profile` behind
|
|
217
228
|
* {@link UserPermission.PROFILE_READ}.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An identity refusal a person can act on, sent as `details.reason` so an app says it in the reader's language rather
|
|
3
|
+
* than showing the API's English.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum IdentityRefusal {
|
|
6
|
+
/**
|
|
7
|
+
* `DELETE /auth/me`: the password given does not open this account, so nothing was deleted. Answered 403, never
|
|
8
|
+
* 401: a 401 tells a client its session has run out, and it would refresh and sign the person out for a typing
|
|
9
|
+
* mistake.
|
|
10
|
+
*/
|
|
11
|
+
PASSWORD_INCORRECT = "password-incorrect",
|
|
12
|
+
/**
|
|
13
|
+
* `DELETE /auth/me`: the account is more than one the person made for themselves (staff of the company, an owner, or
|
|
14
|
+
* a self-registered account the company has since given a role), so only the company can remove it.
|
|
15
|
+
*/
|
|
16
|
+
NOT_SELF_REGISTERED = "not-self-registered"
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An identity refusal a person can act on, sent as `details.reason` so an app says it in the reader's language rather
|
|
3
|
+
* than showing the API's English.
|
|
4
|
+
*/
|
|
5
|
+
export var IdentityRefusal;
|
|
6
|
+
(function (IdentityRefusal) {
|
|
7
|
+
/**
|
|
8
|
+
* `DELETE /auth/me`: the password given does not open this account, so nothing was deleted. Answered 403, never
|
|
9
|
+
* 401: a 401 tells a client its session has run out, and it would refresh and sign the person out for a typing
|
|
10
|
+
* mistake.
|
|
11
|
+
*/
|
|
12
|
+
IdentityRefusal["PASSWORD_INCORRECT"] = "password-incorrect";
|
|
13
|
+
/**
|
|
14
|
+
* `DELETE /auth/me`: the account is more than one the person made for themselves (staff of the company, an owner, or
|
|
15
|
+
* a self-registered account the company has since given a role), so only the company can remove it.
|
|
16
|
+
*/
|
|
17
|
+
IdentityRefusal["NOT_SELF_REGISTERED"] = "not-self-registered";
|
|
18
|
+
})(IdentityRefusal || (IdentityRefusal = {}));
|