Skip to main content
Version: 🚧 Canary

📐 Profile schemas

Profile schemas define the stored profile fragments and the HTTP request contracts used by Profile features and routes.

Inventory

ExportRequest locationContract
ProfileFollowN/AStored { followProfileId: string }.
OrganizationFollowN/AStored { followOrganizationId: string }.
ProductLikeN/AStored { likeProductId: string }.
profileSchemaN/AStored profile object: identityId, name, optional avatar/null.
createProfileSchemaBodyRequired JSON identityId, name; optional avatar/null.
updateProfileSchemaPath, bodyRequired path ID; JSON may contain name and avatar/null.
getProfileSchemaPathRequired profileId.
deleteProfileSchemaPathRequired profileId.
findProfilesSchemaQueryOptional identityId, name, shared pagination.
createProfileFollowSchemaPathRequired profile and followed-profile IDs.
deleteProfileFollowSchemaPathRequired profile and followed-profile IDs.
getProfileFollowersSchemaPathRequired profile ID.
createOrganizationFollowSchemaPathRequired profile and organization IDs.
deleteOrganizationFollowSchemaPathRequired profile and organization IDs.
createProductLikeSchemaPathRequired profile and product IDs.
deleteProductLikeSchemaPathRequired profile and product IDs.

Details

ProfileFollow

Definition

Stored relation shape: followProfileId: string. Used by Profile block follow operations.

View complete source
export type ProfileFollow = {
followProfileId: string;
};

OrganizationFollow

Definition

Stored relation shape: followOrganizationId: string. Used by Profile block organization-follow operations.

View complete source
export type OrganizationFollow = {
followOrganizationId: string;
};

ProductLike

Definition

Stored relation shape: likeProductId: string. Used by Profile block product-like operations.

View complete source
export type ProductLike = {
likeProductId: string;
};

profileSchema

Definition

The reusable stored profile shape has additionalProperties: false.

LocationFieldTypeRequiredConstraints
N/AavatarAvatar or nullNooneOf shared avatarSchema and null
N/AidentityIdstringNoRequired by creation schema
N/AnamestringNoRequired by creation schema

Used by route: createProfileRoute. Used by feature: createProfileFeature.

View complete source
export const profileSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
avatar: {
oneOf: [avatarSchema, { type: 'null' }],
},
identityId: { type: 'string' },
name: { type: 'string' },
},
type: 'object',
};

createProfileSchema

Definition

Requires application/json body and spreads profileSchema with required identityId and name; extra fields are rejected.

LocationFieldTypeRequiredConstraints
BodyidentityIdstringYes
BodynamestringYes
BodyavatarAvatar or nullNoshared avatar schema

Used by route: createProfileRoute. Used by feature: createProfileFeature.

View complete source
export const createProfileSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...profileSchema,
required: ['identityId', 'name'],
},
},
},
required: true,
},
});

updateProfileSchema

Definition

Requires the path profile ID and an application/json body. The body permits no extra fields and may be empty because its source required field list is empty; the legacy handler separately rejects an empty body.

LocationFieldTypeRequiredConstraints
PathprofileIdstringYes
BodynamestringNo
BodyavatarAvatar or nullNoshared avatar schema

Used by route: updateProfileRoute. Used by feature: editProfileFeature.

View complete source
export const updateProfileSchema = withSchema({
parameters: [{ ...profileIdPathParameter }],
requestBody: {
content: {
'application/json': {
schema: {
additionalProperties: false,
properties: {
avatar: {
oneOf: [avatarSchema, { type: 'null' }],
},
name: { type: 'string' },
},
required: [],
type: 'object',
},
},
},
required: true,
},
});

getProfileSchema

Definition
LocationFieldTypeRequiredConstraints
PathprofileIdstringYes

Used by route: getProfileRoute. Used by feature: getProfileFeature.

View complete source
export const getProfileSchema = withSchema({
parameters: [{ ...profileIdPathParameter }],
});

deleteProfileSchema

Definition
LocationFieldTypeRequiredConstraints
PathprofileIdstringYes

Used by route: deleteProfileRoute. Used by feature: deleteProfileFeature.

View complete source
export const deleteProfileSchema = withSchema({
parameters: [{ ...profileIdPathParameter }],
});

findProfilesSchema

Definition
LocationFieldTypeRequiredConstraints
QueryidentityIdstringNo
QuerynamestringNo
Querypagination fieldssharedNopaginationQueryParametersSchema

Used by route: findProfilesRoute. Used by feature: findProfilesFeature.

View complete source
export const findProfilesSchema = withSchema({
parameters: [
{
in: 'query',
name: 'identityId',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'name',
required: false,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});

createProfileFollowSchema

Definition
LocationFieldTypeRequiredConstraints
PathprofileIdstringYes
PathfollowProfileIdstringYes

Used by route: createProfileFollowRoute. Used by feature: createProfileFollowFeature.

View complete source
export const createProfileFollowSchema = withSchema({
parameters: [profileIdPathParameter, followProfileIdPathParameter],
});

deleteProfileFollowSchema

Definition
LocationFieldTypeRequiredConstraints
PathprofileIdstringYes
PathfollowProfileIdstringYes

Used by route: deleteProfileFollowRoute. Used by feature: deleteProfileFollowFeature.

View complete source
export const deleteProfileFollowSchema = withSchema({
parameters: [profileIdPathParameter, followProfileIdPathParameter],
});

getProfileFollowersSchema

Definition
LocationFieldTypeRequiredConstraints
PathprofileIdstringYes

Used by route: getProfileFollowersRoute. Used by feature: getProfileFollowersFeature.

View complete source
export const getProfileFollowersSchema = withSchema({
parameters: [profileIdPathParameter],
});

createOrganizationFollowSchema

Definition
LocationFieldTypeRequiredConstraints
PathprofileIdstringYes
PathfollowOrganizationIdstringYes

Used by route: createOrganizationFollowRoute. Used by feature: createOrganizationFollowFeature.

View complete source
export const createOrganizationFollowSchema = withSchema({
parameters: [profileIdPathParameter, followOrganizationIdPathParameter],
});

deleteOrganizationFollowSchema

Definition
LocationFieldTypeRequiredConstraints
PathprofileIdstringYes
PathfollowOrganizationIdstringYes

Used by route: deleteOrganizationFollowRoute. Used by feature: deleteOrganizationFollowFeature.

View complete source
export const deleteOrganizationFollowSchema = withSchema({
parameters: [profileIdPathParameter, followOrganizationIdPathParameter],
});

createProductLikeSchema

Definition
LocationFieldTypeRequiredConstraints
PathprofileIdstringYes
PathlikeProductIdstringYes

Used by route: createProductLikeRoute. Used by feature: createProductLikeFeature.

View complete source
export const createProductLikeSchema = withSchema({
parameters: [profileIdPathParameter, likeProductIdPathParameter],
});

deleteProductLikeSchema

Definition
LocationFieldTypeRequiredConstraints
PathprofileIdstringYes
PathlikeProductIdstringYes

Used by route: deleteProductLikeRoute. Used by feature: deleteProductLikeFeature.

View complete source
export const deleteProductLikeSchema = withSchema({
parameters: [profileIdPathParameter, likeProductIdPathParameter],
});