@fleetless/contracts 5.3.0-next.1 → 6.0.0-next.1
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/CHANGELOG.md +96 -33
- package/artifacts/openapi.json +2049 -773
- package/artifacts/routes.json +1665 -314
- package/artifacts/schema/accept-team-invite-request.schema.json +13 -7
- package/artifacts/schema/app-auth-config.schema.json +108 -4
- package/artifacts/schema/app-hosted-pages.schema.json +33 -0
- package/artifacts/schema/app-invitation.schema.json +2 -2
- package/artifacts/schema/app-mail-template-list-response.schema.json +4 -3
- package/artifacts/schema/app-mail-template.schema.json +3 -2
- package/artifacts/schema/app-sign-in-methods.schema.json +19 -0
- package/artifacts/schema/app-user-list-response.schema.json +36 -0
- package/artifacts/schema/app-user.schema.json +36 -0
- package/artifacts/schema/audit-query.schema.json +0 -6
- package/artifacts/schema/auth-me-response.schema.json +27 -0
- package/artifacts/schema/auth-ok.schema.json +13 -1
- package/artifacts/schema/client-accept-invitation-request.schema.json +3 -4
- package/artifacts/schema/client-identity.schema.json +13 -1
- package/artifacts/schema/client-login-code-request.schema.json +24 -0
- package/artifacts/schema/client-login-code-verify-request.schema.json +30 -0
- package/artifacts/schema/client-provider-list-response.schema.json +22 -2
- package/artifacts/schema/client-register-request.schema.json +3 -4
- package/artifacts/schema/client-sign-in-result.schema.json +55 -0
- package/artifacts/schema/client-two-factor-disable-request.schema.json +15 -0
- package/artifacts/schema/client-two-factor-setup-confirm-request.schema.json +20 -0
- package/artifacts/schema/client-two-factor-setup-confirm-response.schema.json +49 -0
- package/artifacts/schema/client-two-factor-setup-request.schema.json +12 -0
- package/artifacts/schema/client-two-factor-verify-request.schema.json +25 -0
- package/artifacts/schema/create-app-invitation-request.schema.json +1 -1
- package/artifacts/schema/create-passkey-request.schema.json +25 -0
- package/artifacts/schema/create-passkey-response.schema.json +84 -0
- package/artifacts/schema/developer-passkey.schema.json +56 -0
- package/artifacts/schema/developer-two-factor.schema.json +105 -0
- package/artifacts/schema/fleetless-user-list-response.schema.json +22 -0
- package/artifacts/schema/fleetless-user.schema.json +22 -0
- package/artifacts/schema/invalid-code-details.schema.json +16 -0
- package/artifacts/schema/job-actor.schema.json +1 -15
- package/artifacts/schema/job-run-list-response.schema.json +1 -15
- package/artifacts/schema/job-run.schema.json +1 -15
- package/artifacts/schema/org.schema.json +5 -0
- package/artifacts/schema/patch-org-request.schema.json +5 -3
- package/artifacts/schema/patch-org-response.schema.json +5 -0
- package/artifacts/schema/put-app-auth-look-request.schema.json +22 -0
- package/artifacts/schema/put-app-auth-mcp-request.schema.json +1 -14
- package/artifacts/schema/put-app-auth-sign-in-request.schema.json +39 -0
- package/artifacts/schema/put-app-auth-urls-request.schema.json +31 -4
- package/artifacts/schema/recovery-codes-response.schema.json +20 -0
- package/artifacts/schema/{role-rename-request.schema.json → rename-passkey-request.schema.json} +2 -2
- package/artifacts/schema/role-list-response.schema.json +1 -1
- package/artifacts/schema/role.schema.json +1 -1
- package/artifacts/schema/totp-confirm-request.schema.json +15 -0
- package/artifacts/schema/totp-confirm-response.schema.json +27 -0
- package/artifacts/schema/two-factor-challenge.schema.json +24 -0
- package/artifacts/schema/two-factor-setup-response.schema.json +21 -0
- package/artifacts/schema/webauthn-options-response.schema.json +18 -0
- package/dist/app-users.d.ts +154 -34
- package/dist/app-users.js +177 -45
- package/dist/apps.d.ts +2 -38
- package/dist/apps.js +3 -46
- package/dist/audit.d.ts +0 -1
- package/dist/audit.js +0 -13
- package/dist/client-auth.d.ts +133 -24
- package/dist/client-auth.js +139 -28
- package/dist/config.d.ts +2 -2
- package/dist/errors.d.ts +10 -1
- package/dist/errors.js +34 -34
- package/dist/identity.d.ts +172 -123
- package/dist/identity.js +189 -101
- package/dist/index.d.ts +11 -13
- package/dist/index.js +12 -10
- package/dist/jobs.d.ts +0 -3
- package/dist/jobs.js +0 -16
- package/dist/protocol.d.ts +1 -1
- package/dist/realtime.d.ts +1 -0
- package/dist/rest.d.ts +2 -2
- package/dist/rest.js +17 -28
- package/dist/routes.d.ts +19 -0
- package/dist/routes.js +499 -223
- package/package.json +1 -1
- package/artifacts/schema/developer-login-request.schema.json +0 -19
- package/artifacts/schema/feedback-request.schema.json +0 -34
- package/artifacts/schema/feedback-response.schema.json +0 -27
- package/artifacts/schema/password-reset-confirm.schema.json +0 -19
- package/artifacts/schema/password-reset-request.schema.json +0 -14
- package/artifacts/schema/role-delete-query.schema.json +0 -13
- package/artifacts/schema/role-in-use-details.schema.json +0 -28
- package/artifacts/schema/sign-up-request.schema.json +0 -26
- package/artifacts/schema/sign-up-response.schema.json +0 -127
- package/dist/feedback.d.ts +0 -42
- package/dist/feedback.js +0 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetless/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-next.1",
|
|
4
4
|
"description": "Fleetless wire contracts: the bridge-cloud protocol, the REST API schemas and the error codes, as zod schemas with generated JSON Schema and OpenAPI artifacts.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Dehne Robotik GmbH",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"email": {
|
|
6
|
-
"type": "string",
|
|
7
|
-
"format": "email",
|
|
8
|
-
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
|
|
9
|
-
},
|
|
10
|
-
"password": {
|
|
11
|
-
"type": "string",
|
|
12
|
-
"minLength": 1
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"required": [
|
|
16
|
-
"email",
|
|
17
|
-
"password"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"kind": {
|
|
6
|
-
"type": "string",
|
|
7
|
-
"enum": [
|
|
8
|
-
"idea",
|
|
9
|
-
"problem",
|
|
10
|
-
"question",
|
|
11
|
-
"other"
|
|
12
|
-
],
|
|
13
|
-
"description": "What the message is: an `idea`, a `problem`, a `question` or `other`. It only sorts the inbox; it changes nothing about how the message is handled."
|
|
14
|
-
},
|
|
15
|
-
"message": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"minLength": 1,
|
|
18
|
-
"maxLength": 5000,
|
|
19
|
-
"description": "What the developer wrote, trimmed. At most 5000 characters; a message that is only whitespace is refused."
|
|
20
|
-
},
|
|
21
|
-
"page": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"maxLength": 512,
|
|
24
|
-
"pattern": "^\\/.*",
|
|
25
|
-
"description": "The console path the message was sent from, e.g. `/robots/:id/jobs` with its real id. A path, never a full URL, so no host and no query string reach the inbox by accident."
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"required": [
|
|
29
|
-
"kind",
|
|
30
|
-
"message",
|
|
31
|
-
"page"
|
|
32
|
-
],
|
|
33
|
-
"additionalProperties": false
|
|
34
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"id": {
|
|
6
|
-
"type": "string",
|
|
7
|
-
"format": "uuid",
|
|
8
|
-
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
9
|
-
"description": "The stored message. It exists whatever `mail` says."
|
|
10
|
-
},
|
|
11
|
-
"mail": {
|
|
12
|
-
"type": "string",
|
|
13
|
-
"enum": [
|
|
14
|
-
"sent",
|
|
15
|
-
"not_requested",
|
|
16
|
-
"not_configured",
|
|
17
|
-
"failed"
|
|
18
|
-
],
|
|
19
|
-
"description": "What happened to the notification mail: `sent`, `failed`, or `not_configured` when this cloud has no feedback address. The message is stored in every case, so a client shows success for all three."
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"required": [
|
|
23
|
-
"id",
|
|
24
|
-
"mail"
|
|
25
|
-
],
|
|
26
|
-
"additionalProperties": false
|
|
27
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"token": {
|
|
6
|
-
"type": "string",
|
|
7
|
-
"minLength": 1
|
|
8
|
-
},
|
|
9
|
-
"new_password": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"minLength": 12,
|
|
12
|
-
"maxLength": 256
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"required": [
|
|
16
|
-
"token",
|
|
17
|
-
"new_password"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"email": {
|
|
6
|
-
"type": "string",
|
|
7
|
-
"format": "email",
|
|
8
|
-
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"required": [
|
|
12
|
-
"email"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"move_to": {
|
|
6
|
-
"description": "Another role of the same app that takes over the deleted role's app users, pending invitations and, when it applies, the app's default. The role itself or a role of another app answers `400 validation_error`.",
|
|
7
|
-
"type": "string",
|
|
8
|
-
"format": "uuid",
|
|
9
|
-
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"additionalProperties": false
|
|
13
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"users": {
|
|
6
|
-
"type": "integer",
|
|
7
|
-
"minimum": 0,
|
|
8
|
-
"maximum": 9007199254740991,
|
|
9
|
-
"description": "App users whose role this is."
|
|
10
|
-
},
|
|
11
|
-
"invitations": {
|
|
12
|
-
"type": "integer",
|
|
13
|
-
"minimum": 0,
|
|
14
|
-
"maximum": 9007199254740991,
|
|
15
|
-
"description": "Pending invitations that would grant this role when accepted."
|
|
16
|
-
},
|
|
17
|
-
"is_default": {
|
|
18
|
-
"type": "boolean",
|
|
19
|
-
"description": "`true` when this is the app's `default_role_id`; the default then moves with the users to `move_to`."
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"required": [
|
|
23
|
-
"users",
|
|
24
|
-
"invitations",
|
|
25
|
-
"is_default"
|
|
26
|
-
],
|
|
27
|
-
"additionalProperties": false
|
|
28
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"org_name": {
|
|
6
|
-
"type": "string",
|
|
7
|
-
"minLength": 1,
|
|
8
|
-
"maxLength": 120
|
|
9
|
-
},
|
|
10
|
-
"email": {
|
|
11
|
-
"type": "string",
|
|
12
|
-
"format": "email",
|
|
13
|
-
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
|
|
14
|
-
},
|
|
15
|
-
"password": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"minLength": 12,
|
|
18
|
-
"maxLength": 256
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"required": [
|
|
22
|
-
"org_name",
|
|
23
|
-
"email",
|
|
24
|
-
"password"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"org": {
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"id": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"format": "uuid",
|
|
11
|
-
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
12
|
-
"description": "The organisation. Every developer route is scoped to the caller's org already, so a client rarely has to send this anywhere."
|
|
13
|
-
},
|
|
14
|
-
"name": {
|
|
15
|
-
"type": "string",
|
|
16
|
-
"minLength": 1,
|
|
17
|
-
"maxLength": 120,
|
|
18
|
-
"description": "The organisation's display name. Free text, changed through `PATCH /api/org`."
|
|
19
|
-
},
|
|
20
|
-
"created_at": {
|
|
21
|
-
"type": "string",
|
|
22
|
-
"format": "date-time",
|
|
23
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
|
|
24
|
-
"description": "When the organisation was created, as an ISO 8601 timestamp."
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"required": [
|
|
28
|
-
"id",
|
|
29
|
-
"name",
|
|
30
|
-
"created_at"
|
|
31
|
-
],
|
|
32
|
-
"additionalProperties": false
|
|
33
|
-
},
|
|
34
|
-
"user": {
|
|
35
|
-
"type": "object",
|
|
36
|
-
"properties": {
|
|
37
|
-
"id": {
|
|
38
|
-
"type": "string",
|
|
39
|
-
"format": "uuid",
|
|
40
|
-
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
41
|
-
"description": "The Fleetless user in the API, assigned by the cloud and stable for the life of the account."
|
|
42
|
-
},
|
|
43
|
-
"org_id": {
|
|
44
|
-
"type": "string",
|
|
45
|
-
"format": "uuid",
|
|
46
|
-
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
47
|
-
"description": "The organisation this person belongs to. Every developer route is already scoped to the caller's org, so this confirms what a client is looking at, not a filter it applies."
|
|
48
|
-
},
|
|
49
|
-
"email": {
|
|
50
|
-
"type": "string",
|
|
51
|
-
"format": "email",
|
|
52
|
-
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
|
|
53
|
-
"description": "The address the account is identified by, **globally unique** across every organisation. Immutable after creation: it is what every invitation, reset link and audit line names."
|
|
54
|
-
},
|
|
55
|
-
"display_name": {
|
|
56
|
-
"anyOf": [
|
|
57
|
-
{
|
|
58
|
-
"type": "string",
|
|
59
|
-
"minLength": 1,
|
|
60
|
-
"maxLength": 120
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"type": "null"
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
"description": "Optional human name, shown by the console instead of the address where present. Self-service through `PATCH /api/auth/me`; never used for authentication. `null` when the person never supplied one."
|
|
67
|
-
},
|
|
68
|
-
"tier": {
|
|
69
|
-
"type": "string",
|
|
70
|
-
"enum": [
|
|
71
|
-
"owner",
|
|
72
|
-
"developer"
|
|
73
|
-
],
|
|
74
|
-
"description": "The console powers this person holds. **Required** — every Fleetless user has a tier; it was optional only while the org also held people with no console powers to grade, and that pool is gone."
|
|
75
|
-
},
|
|
76
|
-
"created_at": {
|
|
77
|
-
"type": "string",
|
|
78
|
-
"format": "date-time",
|
|
79
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
|
|
80
|
-
"description": "When the account was created, as an ISO 8601 timestamp."
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"required": [
|
|
84
|
-
"id",
|
|
85
|
-
"org_id",
|
|
86
|
-
"email",
|
|
87
|
-
"display_name",
|
|
88
|
-
"tier",
|
|
89
|
-
"created_at"
|
|
90
|
-
],
|
|
91
|
-
"additionalProperties": false
|
|
92
|
-
},
|
|
93
|
-
"tokens": {
|
|
94
|
-
"type": "object",
|
|
95
|
-
"properties": {
|
|
96
|
-
"access_token": {
|
|
97
|
-
"type": "string",
|
|
98
|
-
"minLength": 1,
|
|
99
|
-
"description": "The token to send as `Authorization: Bearer <token>` on every call. Short-lived: read `expires_in` rather than assuming a lifetime."
|
|
100
|
-
},
|
|
101
|
-
"refresh_token": {
|
|
102
|
-
"type": "string",
|
|
103
|
-
"minLength": 1,
|
|
104
|
-
"description": "The token that buys the next access token. It rotates on every use, so a value presented twice is detectable theft and ends the whole family."
|
|
105
|
-
},
|
|
106
|
-
"expires_in": {
|
|
107
|
-
"type": "integer",
|
|
108
|
-
"exclusiveMinimum": 0,
|
|
109
|
-
"maximum": 9007199254740991,
|
|
110
|
-
"description": "How long the access token stays valid, in **seconds** from now. Not a timestamp, and not milliseconds."
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"required": [
|
|
114
|
-
"access_token",
|
|
115
|
-
"refresh_token",
|
|
116
|
-
"expires_in"
|
|
117
|
-
],
|
|
118
|
-
"additionalProperties": false
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"required": [
|
|
122
|
-
"org",
|
|
123
|
-
"user",
|
|
124
|
-
"tokens"
|
|
125
|
-
],
|
|
126
|
-
"additionalProperties": false
|
|
127
|
-
}
|
package/dist/feedback.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
/**
|
|
4
|
-
* **Feedback: a message from a developer to the people who build Fleetless.**
|
|
5
|
-
*
|
|
6
|
-
* The console's feedback modal sends it; the cloud stores it first and mails
|
|
7
|
-
* it afterwards, so a message is never lost to a mail failure. Who sent it and
|
|
8
|
-
* from which org is the caller's session, never the body: the body carries
|
|
9
|
-
* only what the developer chose to say and the page they said it on.
|
|
10
|
-
*/
|
|
11
|
-
/** The four kinds the console's modal offers. */
|
|
12
|
-
export declare const FEEDBACK_KINDS: readonly ["idea", "problem", "question", "other"];
|
|
13
|
-
export declare const feedbackKind: z.ZodEnum<{
|
|
14
|
-
idea: "idea";
|
|
15
|
-
problem: "problem";
|
|
16
|
-
question: "question";
|
|
17
|
-
other: "other";
|
|
18
|
-
}>;
|
|
19
|
-
/** Longest message the cloud stores; the console's counter starts at 4 500. */
|
|
20
|
-
export declare const FEEDBACK_MESSAGE_MAX = 5000;
|
|
21
|
-
export declare const feedbackRequest: z.ZodObject<{
|
|
22
|
-
kind: z.ZodEnum<{
|
|
23
|
-
idea: "idea";
|
|
24
|
-
problem: "problem";
|
|
25
|
-
question: "question";
|
|
26
|
-
other: "other";
|
|
27
|
-
}>;
|
|
28
|
-
message: z.ZodString;
|
|
29
|
-
page: z.ZodString;
|
|
30
|
-
}, z.core.$strict>;
|
|
31
|
-
export declare const feedbackResponse: z.ZodObject<{
|
|
32
|
-
id: z.ZodUUID;
|
|
33
|
-
mail: z.ZodEnum<{
|
|
34
|
-
sent: "sent";
|
|
35
|
-
not_requested: "not_requested";
|
|
36
|
-
not_configured: "not_configured";
|
|
37
|
-
failed: "failed";
|
|
38
|
-
}>;
|
|
39
|
-
}, z.core.$strict>;
|
|
40
|
-
export type FeedbackKind = z.infer<typeof feedbackKind>;
|
|
41
|
-
export type FeedbackRequest = z.infer<typeof feedbackRequest>;
|
|
42
|
-
export type FeedbackResponse = z.infer<typeof feedbackResponse>;
|
package/dist/feedback.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { mailStatus } from './identity.js';
|
|
4
|
-
/**
|
|
5
|
-
* **Feedback: a message from a developer to the people who build Fleetless.**
|
|
6
|
-
*
|
|
7
|
-
* The console's feedback modal sends it; the cloud stores it first and mails
|
|
8
|
-
* it afterwards, so a message is never lost to a mail failure. Who sent it and
|
|
9
|
-
* from which org is the caller's session, never the body: the body carries
|
|
10
|
-
* only what the developer chose to say and the page they said it on.
|
|
11
|
-
*/
|
|
12
|
-
/** The four kinds the console's modal offers. */
|
|
13
|
-
export const FEEDBACK_KINDS = ['idea', 'problem', 'question', 'other'];
|
|
14
|
-
export const feedbackKind = z.enum(FEEDBACK_KINDS);
|
|
15
|
-
/** Longest message the cloud stores; the console's counter starts at 4 500. */
|
|
16
|
-
export const FEEDBACK_MESSAGE_MAX = 5000;
|
|
17
|
-
export const feedbackRequest = z.object({
|
|
18
|
-
kind: feedbackKind.meta({
|
|
19
|
-
description: 'What the message is: an `idea`, a `problem`, a `question` or `other`. It only sorts the inbox; it changes nothing about how the message is handled.',
|
|
20
|
-
}),
|
|
21
|
-
message: z.string().trim().min(1).max(FEEDBACK_MESSAGE_MAX).meta({
|
|
22
|
-
description: 'What the developer wrote, trimmed. At most 5000 characters; a message that is only whitespace is refused.',
|
|
23
|
-
}),
|
|
24
|
-
page: z.string().startsWith('/').max(512).meta({
|
|
25
|
-
description: 'The console path the message was sent from, e.g. `/robots/:id/jobs` with its real id. A path, never a full URL, so no host and no query string reach the inbox by accident.',
|
|
26
|
-
}),
|
|
27
|
-
}).strict();
|
|
28
|
-
export const feedbackResponse = z.object({
|
|
29
|
-
id: z.uuid().meta({
|
|
30
|
-
description: 'The stored message. It exists whatever `mail` says.',
|
|
31
|
-
}),
|
|
32
|
-
mail: mailStatus.meta({
|
|
33
|
-
description: 'What happened to the notification mail: `sent`, `failed`, or `not_configured` when this cloud has no feedback address. The message is stored in every case, so a client shows success for all three.',
|
|
34
|
-
}),
|
|
35
|
-
}).strict();
|