📐 Invitation schemas
Invitation schemas validate invitation objects and the inputs accepted by the four public Invitation routes.
Inventory
| Export | Request location | Contract |
|---|---|---|
invitationSchema | N/A | Strict reusable invitation object. |
createInvitationSchema | Body | Required JSON invitation creation body. |
getInvitationSchema | Path | Required invitation ID. |
deleteInvitationSchema | Path | Required invitation ID. |
findInvitationsSchema | Query | Optional filters and pagination. |
Details
invitationSchema
Definition
Reusable strict invitation input shape, not a complete stored-entity schema. It has additionalProperties: false; only the fields below are accepted when it is spread by createInvitationSchema. createInvitation adds the configured pending status and base-entity fields such as id, createdAt, and updatedAt after validation; the read terminators later remove database _id. Used by route: none directly. Used by feature: none directly.
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| N/A | email | string | No | email format. |
| N/A | fromIdentityId | string | No | Inviter identity ID. |
| N/A | orgId | string | No | Organization ID. |
| N/A | role | string | No | Invitation role. |
View complete source
export const invitationSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
email: {format: 'email', type: 'string'},
fromIdentityId: {type: 'string'},
orgId: {type: 'string'},
role: {type: 'string'},
},
type: 'object',
};
createInvitationSchema
Definition
The required OpenAPI application/json body spreads invitationSchema, preserving additionalProperties: false, then requires email and fromIdentityId. The current body validator selects this schema directly and does not inspect the incoming HTTP Content-Type; it validates the parsed body and reports 400 Validation Error on a schema failure. Used by route: createInvitationRoute. Used by feature: createInvitationFeature.
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Body | email | string | Yes | email format. |
| Body | fromIdentityId | string | Yes | Inviter identity ID. |
| Body | orgId | string | No | Organization ID. |
| Body | role | string | No | Invitation role. |
View complete source
export const createInvitationSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...invitationSchema,
required: ['email', 'fromIdentityId'],
},
},
},
required: true,
},
});
getInvitationSchema
Definition
Validates the invitationId path parameter. Used by route: getInvitationByIdRoute. Used by feature: getInvitationFeature.
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Path | invitationId | string | Yes | No format or pattern is imposed. |
View complete source
export const getInvitationSchema = withSchema({
parameters: [{...invitationIdPathParameter}],
});
deleteInvitationSchema
Definition
Validates the invitationId path parameter. Used by route: deleteInvitationRoute. Used by feature: deleteInvitationFeature.
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Path | invitationId | string | Yes | No format or pattern is imposed. |
View complete source
export const deleteInvitationSchema = withSchema({
parameters: [{...invitationIdPathParameter}],
});
findInvitationsSchema
Definition
Validates optional invitation filters and spreads the shared pagination parameters. Used by route: findInvitationsRoute. Used by feature: findInvitationsFeature.
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Query | email | string | No | email format. |
| Query | fromIdentityId | string | No | Inviter identity filter. |
| Query | orgId | string | No | Organization filter. |
| Query | role | string | No | Role filter. |
| Query | page | integer | No | Shared pagination, 1–1000. |
| Query | limit | integer | No | Shared pagination, 1–50. |
page and limit come from paginationQueryParametersSchema; the route’s pagination wrapper consumes them and the list terminator exposes pagination metadata.View complete source