feat(visibility): add the candidate publication, hiding and search status contract
This commit is contained in:
1 parent
4436f626a3
commit
0529601021
87 files changed
+21456
-83
No files matched your search
@@ -7,4 +7,5 @@ export { getIdentityMock } from './identity/identity.msw'
|
||||
export { getInvitationMock } from './invitation/invitation.msw'
|
||||
export { getNeedMock } from './need/need.msw'
|
||||
export { getOrganizationMock } from './organization/organization.msw'
|
||||
export { getPrivacyMock } from './privacy/privacy.msw'
|
||||
export { getSupportMock } from './support/support.msw'
|
||||
@@ -7,4 +7,5 @@ export * from './identity/identity';
|
||||
export * from './invitation/invitation';
|
||||
export * from './need/need';
|
||||
export * from './organization/organization';
|
||||
export * from './privacy/privacy';
|
||||
export * from './support/support';
|
||||
@@ -0,0 +1,175 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
faker
|
||||
} from '@faker-js/faker';
|
||||
|
||||
import {
|
||||
fakeFromPattern
|
||||
} from '../../mock-pattern';
|
||||
|
||||
import {
|
||||
HttpResponse,
|
||||
http
|
||||
} from 'msw';
|
||||
import type {
|
||||
RequestHandlerOptions
|
||||
} from 'msw';
|
||||
|
||||
import type {
|
||||
AnonymousCardContent,
|
||||
CardAccessList,
|
||||
CardPreview,
|
||||
HiddenOrganization,
|
||||
HiddenOrganizationList,
|
||||
PrivacyEventList,
|
||||
PrivacyOrganization,
|
||||
PrivacySettings,
|
||||
Publication,
|
||||
SearchStatus
|
||||
} from '../../schemas';
|
||||
|
||||
|
||||
export const getGetMyPrivacySettingsResponseMock = (overrideResponse: Partial<Extract<PrivacySettings, object>> = {}): PrivacySettings => ({publication: {state: faker.helpers.arrayElement(['closed','published'] as const), closed_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['never_published','closed_by_candidate','consent_revoked'] as const),null,]), fields: faker.helpers.arrayElements(['categories','stack','experience','soft_skills','location','relocation'] as const), consent_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), version: faker.number.int({min: 0})}, search_status: {value: faker.helpers.arrayElement(['looking','not_looking'] as const), lapsed: faker.datatype.boolean(), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), lapses_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), version: faker.number.int({min: 0})}, hidden_organizations_total: faker.number.int({min: 0, max: 1000}), ...overrideResponse})
|
||||
|
||||
export const getSetMyPublicationResponseMock = (overrideResponse: Partial<Extract<Publication, object>> = {}): Publication => ({state: faker.helpers.arrayElement(['closed','published'] as const), closed_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['never_published','closed_by_candidate','consent_revoked'] as const),null,]), fields: faker.helpers.arrayElements(['categories','stack','experience','soft_skills','location','relocation'] as const), consent_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), version: faker.number.int({min: 0}), ...overrideResponse})
|
||||
|
||||
export const getGetMyCardPreviewResponseAnonymousCardContentMock = (overrideResponse: Partial<AnonymousCardContent> = {}): AnonymousCardContent => ({...{categories: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const)})), null]), stack: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}))), null]), experience_months: faker.helpers.arrayElement([faker.number.int({min: 0, max: 1200}), null]), soft_skills: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}))), null]), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}), null]), relocation: faker.helpers.arrayElement([faker.datatype.boolean(), null])}, ...overrideResponse});
|
||||
|
||||
export const getGetMyCardPreviewResponseMock = (overrideResponse: Partial<Extract<CardPreview, object>> = {}): CardPreview => ({state: faker.helpers.arrayElement(['closed','published'] as const), fields: faker.helpers.arrayElements(['categories','stack','experience','soft_skills','location','relocation'] as const), card: faker.helpers.arrayElement([{...getGetMyCardPreviewResponseAnonymousCardContentMock()},null,]), generated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...overrideResponse})
|
||||
|
||||
export const getSetMySearchStatusResponseMock = (overrideResponse: Partial<Extract<SearchStatus, object>> = {}): SearchStatus => ({value: faker.helpers.arrayElement(['looking','not_looking'] as const), lapsed: faker.datatype.boolean(), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), lapses_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), version: faker.number.int({min: 0}), ...overrideResponse})
|
||||
|
||||
export const getListMyHiddenOrganizationsResponseMock = (overrideResponse: Partial<Extract<HiddenOrganizationList, object>> = {}): HiddenOrganizationList => ({items: Array.from({ length: faker.number.int({min: 1, max: 100}) }, (_, i) => i + 1).map(() => ({organization: {id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, hidden_at: faker.date.past().toISOString().slice(0, 19) + 'Z'})), page: {has_more: faker.datatype.boolean(), next_cursor: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 512}), null])}, ...overrideResponse})
|
||||
|
||||
export const getHideOrganizationResponseMock = (overrideResponse: Partial<Extract<HiddenOrganization, object>> = {}): HiddenOrganization => ({organization: {id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, hidden_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...overrideResponse})
|
||||
|
||||
export const getListMyPrivacyHistoryResponsePrivacyOrganizationMock = (overrideResponse: Partial<PrivacyOrganization> = {}): PrivacyOrganization => ({...{id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, ...overrideResponse});
|
||||
|
||||
export const getListMyPrivacyHistoryResponseMock = (overrideResponse: Partial<Extract<PrivacyEventList, object>> = {}): PrivacyEventList => ({items: Array.from({ length: faker.number.int({min: 1, max: 100}) }, (_, i) => i + 1).map(() => ({id: faker.string.uuid(), kind: faker.helpers.arrayElement(['publication_opened','publication_changed','publication_closed','search_status_confirmed','search_status_cleared','organization_hidden','organization_unhidden'] as const), occurred_at: faker.date.past().toISOString().slice(0, 19) + 'Z', fields: faker.helpers.arrayElement([faker.helpers.arrayElements(['categories','stack','experience','soft_skills','location','relocation'] as const),null,]), consent_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), organization: faker.helpers.arrayElement([{...getListMyPrivacyHistoryResponsePrivacyOrganizationMock()},null,])})), page: {has_more: faker.datatype.boolean(), next_cursor: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 512}), null])}, ...overrideResponse})
|
||||
|
||||
export const getListMyCardAccessHistoryResponsePrivacyOrganizationMock = (overrideResponse: Partial<PrivacyOrganization> = {}): PrivacyOrganization => ({...{id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, ...overrideResponse});
|
||||
|
||||
export const getListMyCardAccessHistoryResponseMock = (overrideResponse: Partial<Extract<CardAccessList, object>> = {}): CardAccessList => ({items: Array.from({ length: faker.number.int({min: 1, max: 100}) }, (_, i) => i + 1).map(() => ({id: faker.string.uuid(), kind: faker.helpers.arrayElement(['card_viewed','contact_read'] as const), occurred_at: faker.date.past().toISOString().slice(0, 19) + 'Z', organization: faker.helpers.arrayElement([{...getListMyCardAccessHistoryResponsePrivacyOrganizationMock()},null,])})), page: {has_more: faker.datatype.boolean(), next_cursor: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 512}), null])}, ...overrideResponse})
|
||||
|
||||
|
||||
export const getGetMyPrivacySettingsMockHandler = (overrideResponse?: PrivacySettings | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<PrivacySettings> | PrivacySettings), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/privacy', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetMyPrivacySettingsResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getSetMyPublicationMockHandler = (overrideResponse?: Publication | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Promise<Publication> | Publication), options?: RequestHandlerOptions) => {
|
||||
return http.put('*/api/v1/me/privacy/publication', async (info: Parameters<Parameters<typeof http.put>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getSetMyPublicationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getGetMyCardPreviewMockHandler = (overrideResponse?: CardPreview | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<CardPreview> | CardPreview), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/privacy/preview', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetMyCardPreviewResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getSetMySearchStatusMockHandler = (overrideResponse?: SearchStatus | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Promise<SearchStatus> | SearchStatus), options?: RequestHandlerOptions) => {
|
||||
return http.put('*/api/v1/me/privacy/search-status', async (info: Parameters<Parameters<typeof http.put>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getSetMySearchStatusResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getListMyHiddenOrganizationsMockHandler = (overrideResponse?: HiddenOrganizationList | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<HiddenOrganizationList> | HiddenOrganizationList), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/privacy/hidden-organizations', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getListMyHiddenOrganizationsResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getHideOrganizationMockHandler = (overrideResponse?: HiddenOrganization | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Promise<HiddenOrganization> | HiddenOrganization), options?: RequestHandlerOptions) => {
|
||||
return http.put('*/api/v1/me/privacy/hidden-organizations/:orgId', async (info: Parameters<Parameters<typeof http.put>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getHideOrganizationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getUnhideOrganizationMockHandler = (overrideResponse?: void | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Promise<void> | void), options?: RequestHandlerOptions) => {
|
||||
return http.delete('*/api/v1/me/privacy/hidden-organizations/:orgId', async (info: Parameters<Parameters<typeof http.delete>[1]>[0]) => {
|
||||
if (typeof overrideResponse === 'function') {await overrideResponse(info); }
|
||||
|
||||
return new HttpResponse(null,
|
||||
{ status: 204
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getListMyPrivacyHistoryMockHandler = (overrideResponse?: PrivacyEventList | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<PrivacyEventList> | PrivacyEventList), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/privacy/history', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getListMyPrivacyHistoryResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getListMyCardAccessHistoryMockHandler = (overrideResponse?: CardAccessList | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<CardAccessList> | CardAccessList), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/privacy/access-history', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getListMyCardAccessHistoryResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
export const getPrivacyMock = () => [
|
||||
getGetMyPrivacySettingsMockHandler(),
|
||||
getSetMyPublicationMockHandler(),
|
||||
getGetMyCardPreviewMockHandler(),
|
||||
getSetMySearchStatusMockHandler(),
|
||||
getListMyHiddenOrganizationsMockHandler(),
|
||||
getHideOrganizationMockHandler(),
|
||||
getUnhideOrganizationMockHandler(),
|
||||
getListMyPrivacyHistoryMockHandler(),
|
||||
getListMyCardAccessHistoryMockHandler()
|
||||
]
|
||||
@@ -0,0 +1,967 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
useMutation,
|
||||
useQuery
|
||||
} from '@tanstack/react-query';
|
||||
import type {
|
||||
DataTag,
|
||||
DefinedInitialDataOptions,
|
||||
DefinedUseQueryResult,
|
||||
MutationFunction,
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UndefinedInitialDataOptions,
|
||||
UseMutationOptions,
|
||||
UseMutationResult,
|
||||
UseQueryOptions,
|
||||
UseQueryResult
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
import type {
|
||||
CardAccessList,
|
||||
CardPreview,
|
||||
HiddenOrganization,
|
||||
HiddenOrganizationList,
|
||||
ListMyCardAccessHistoryParams,
|
||||
ListMyHiddenOrganizationsParams,
|
||||
ListMyPrivacyHistoryParams,
|
||||
PrivacyEventList,
|
||||
PrivacySettings,
|
||||
Problem,
|
||||
Publication,
|
||||
PublicationUpdate,
|
||||
SearchStatus,
|
||||
SearchStatusUpdate
|
||||
} from '../../schemas';
|
||||
|
||||
import { apiRequest } from '../../client';
|
||||
import type { ErrorType } from '../../client';
|
||||
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
|
||||
|
||||
const withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {
|
||||
const result = { queryKey } as T & { queryKey: K };
|
||||
for (const key of Object.keys(query)) {
|
||||
// The explicit queryKey always wins, matching the previous
|
||||
// `{ ...query, queryKey }` spread where it was set last.
|
||||
if (key === 'queryKey') continue;
|
||||
Object.defineProperty(result, key, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: () => (query as Record<string, unknown>)[key],
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export const getGetMyPrivacySettingsUrl = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/privacy`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account. The candidate comes from the session, never from a request parameter. Returns the publication of the candidate card, the search status, and the number of hidden organizations in one read. The response is `Cache-Control: no-store`.
|
||||
*
|
||||
* A profile is closed by default. A candidate who never published reads `publication.state` `closed` with `closed_reason` `never_published`, an empty field set, and version 0; creating or saving the profile (`SaveMyProfile`) never publishes it, and no operation of the profile, the questionnaire, or an assessment changes these settings. The C2 consent, the search status, and the hidden organizations are three independent settings: the C2 record in the consent ledger proves that the candidate accepted the publication text, the publication records which fields are published, and the search status is a statement of the candidate that is not a consent. A change of one never changes another, and none of them ever makes the candidate more visible by itself: the search status lapses to the non-public `not_looking`, a revoked C2 closes the card, and a new C2 grant publishes nothing.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
|
||||
* @summary Read the visibility settings of the current candidate.
|
||||
*/
|
||||
export const getMyPrivacySettings = async ( options?: Parameters<typeof apiRequest>[1]): Promise<PrivacySettings> => {
|
||||
|
||||
return apiRequest<PrivacySettings>(getGetMyPrivacySettingsUrl(),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetMyPrivacySettingsQueryKey = () => {
|
||||
return [
|
||||
`/api/v1/me/privacy`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetMyPrivacySettingsQueryOptions = <TData = Awaited<ReturnType<typeof getMyPrivacySettings>>, TError = ErrorType<Problem>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyPrivacySettings>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetMyPrivacySettingsQueryKey();
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMyPrivacySettings>>> = ({ signal }) => getMyPrivacySettings({ signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMyPrivacySettings>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetMyPrivacySettingsQueryResult = NonNullable<Awaited<ReturnType<typeof getMyPrivacySettings>>>
|
||||
export type GetMyPrivacySettingsQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useGetMyPrivacySettings<TData = Awaited<ReturnType<typeof getMyPrivacySettings>>, TError = ErrorType<Problem>>(
|
||||
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyPrivacySettings>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyPrivacySettings>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyPrivacySettings>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyPrivacySettings<TData = Awaited<ReturnType<typeof getMyPrivacySettings>>, TError = ErrorType<Problem>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyPrivacySettings>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyPrivacySettings>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyPrivacySettings>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyPrivacySettings<TData = Awaited<ReturnType<typeof getMyPrivacySettings>>, TError = ErrorType<Problem>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyPrivacySettings>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary Read the visibility settings of the current candidate.
|
||||
*/
|
||||
|
||||
export function useGetMyPrivacySettings<TData = Awaited<ReturnType<typeof getMyPrivacySettings>>, TError = ErrorType<Problem>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyPrivacySettings>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetMyPrivacySettingsQueryOptions(options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getSetMyPublicationUrl = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/privacy/publication`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body is the complete new publication setting: `state` `published` with the non-empty set of card fields, or `closed` with an empty set. It changes only the publication; the search status and the hidden organizations stay as they were.
|
||||
*
|
||||
* Publication is not a consent and does not duplicate one. The consent C2 lives in the consent ledger (`ListMyConsents`); this setting refers to it. Publishing requires an active, unrevoked C2 record of the account and binds the publication to that record, so a client sends no consent identifier and cannot forge one. Without one the server answers 409 state_conflict with the entry `{in: body, pointer: /state, code: consent_required}` in `errors`, which tells it apart from every other conflict, and changes nothing: the client gives C2 first (planned in the consent settings, TASK-063) and then publishes. The server takes the C2 record under a share lock in the transaction that writes the publication, so a revocation that races with a publication either commits first (the publication is refused) or closes the card right after. A revocation of C2 closes the card at once, because `state` is computed from the unrevoked record; a later C2 grant never reopens it, and the candidate publishes again under the new record. The revocation path itself (TASK-064) closes the stored publication and revokes the contact grants in its own transaction. A closing sent over a stored publication whose C2 was revoked is a real change: it stores the closing, records `publication_closed`, and revokes the grants as any closing does. Publishing, like every visibility change, needs a verified email (a usecase requirement; the unverified account cleanup deletes only accounts without such records). Publishing never adds a field that the body did not name, and a new `CardField` value is never published for a candidate who did not choose it.
|
||||
*
|
||||
* The field set contains only the groups of `CardField`. The full name, contacts, and the lowest salary have no value there, so no body can publish them. Only values that the candidate confirmed ever reach the card. Contacts reach an organization only through the contact grant (C4), and a profile that is published or closed changes none of the grants that exist; closing the publication, and hiding an organization that holds a grant, revoke the contact grants concerned with the reason `visibility_closed` in the same transaction as the change (planned together with the operations, see the invitation contract).
|
||||
*
|
||||
* Optimistic concurrency uses `expected_version` in the body: the client sends the `version` it read, 0 for the first publication. If it is not the current version the server answers 412 version_conflict and changes nothing. The version travels in the body rather than in If-Match because the generated client cannot read the ETag header yet. A body that equals the stored setting changes nothing, keeps the version, and answers 200 even when `expected_version` is older, so a retry after a lost response succeeds without an Idempotency-Key. A version above the current one never existed and always answers 412. Every change is recorded in the settings history with its time, the fields, and the C2 record.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), rules that depend on the body alone (400), an unchanged body (200), a stale version (412), then the active C2 for a publication (409 state_conflict). The schema rejects an unknown field, a repeated or unknown card field, and more fields than there are groups; a published state with no field, and a closed state with a field, answer 400 validation_failed with the pointer `/fields`. Error bodies never repeat a submitted value.
|
||||
* @summary Publish or close the anonymous candidate card.
|
||||
*/
|
||||
export const setMyPublication = async (publicationUpdate: PublicationUpdate, options?: Parameters<typeof apiRequest>[1]): Promise<Publication> => {
|
||||
|
||||
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
||||
if (!h) return {};
|
||||
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
||||
if (Symbol.iterator in h) {
|
||||
return Object.fromEntries(
|
||||
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
||||
);
|
||||
}
|
||||
const headers: Record<string, string | readonly string[]> = {};
|
||||
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
||||
if (value !== undefined) headers[name] = value;
|
||||
}
|
||||
return headers;
|
||||
};
|
||||
return apiRequest<Publication>(getSetMyPublicationUrl(),
|
||||
{
|
||||
...options,
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
|
||||
body: JSON.stringify(publicationUpdate)
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getSetMyPublicationMutationKey = () => ['setMyPublication'] as const;
|
||||
|
||||
export const getSetMyPublicationMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setMyPublication>>, TError,SetMyPublicationMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof setMyPublication>>, TError,SetMyPublicationMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getSetMyPublicationMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof setMyPublication>>, SetMyPublicationMutationVariables> = (props) => {
|
||||
const {data} = props ?? {};
|
||||
|
||||
return setMyPublication(data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type SetMyPublicationMutationResult = NonNullable<Awaited<ReturnType<typeof setMyPublication>>>
|
||||
export type SetMyPublicationMutationBody = PublicationUpdate
|
||||
export type SetMyPublicationMutationError = ErrorType<Problem>
|
||||
export type SetMyPublicationMutationVariables = {data: PublicationUpdate}
|
||||
|
||||
/**
|
||||
* @summary Publish or close the anonymous candidate card.
|
||||
*/
|
||||
export const useSetMyPublication = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setMyPublication>>, TError,SetMyPublicationMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof setMyPublication>>,
|
||||
TError,
|
||||
SetMyPublicationMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getSetMyPublicationMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getGetMyCardPreviewUrl = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/privacy/preview`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account. Returns the card exactly as an organization that the candidate does not hide the profile from would read it now, built from the current profile, the current publication, and the consent ledger. The response is `Cache-Control: no-store`.
|
||||
*
|
||||
* The preview is a private read for the candidate: it creates no view, leaves no access record, and is never shown to an organization. While the profile is closed `card` is null. `card` is `AnonymousCardContent`, whose schema reaches no private profile schema, no contact, and no identifier of the candidate: it has no name, email, phone, Telegram name, employer, salary figure, or account or profile identifier, and each property is null when it is not published or has no value, so a reader cannot tell the two apart. Only the fields in `fields` are filled, and only with values that the candidate confirmed: an unconfirmed suggestion and an unknown value never appear. A free text value that looks like a contact (an email address, a phone number, a URL, a Telegram link, an @handle) is dropped from the card, so the preview shows exactly what an organization would read. The self-assessed grade is not a category and never appears; categories come only from assessment results.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
|
||||
* @summary Preview the anonymous card that organizations would read.
|
||||
*/
|
||||
export const getMyCardPreview = async ( options?: Parameters<typeof apiRequest>[1]): Promise<CardPreview> => {
|
||||
|
||||
return apiRequest<CardPreview>(getGetMyCardPreviewUrl(),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetMyCardPreviewQueryKey = () => {
|
||||
return [
|
||||
`/api/v1/me/privacy/preview`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetMyCardPreviewQueryOptions = <TData = Awaited<ReturnType<typeof getMyCardPreview>>, TError = ErrorType<Problem>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyCardPreview>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetMyCardPreviewQueryKey();
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMyCardPreview>>> = ({ signal }) => getMyCardPreview({ signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMyCardPreview>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetMyCardPreviewQueryResult = NonNullable<Awaited<ReturnType<typeof getMyCardPreview>>>
|
||||
export type GetMyCardPreviewQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useGetMyCardPreview<TData = Awaited<ReturnType<typeof getMyCardPreview>>, TError = ErrorType<Problem>>(
|
||||
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyCardPreview>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyCardPreview>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyCardPreview>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyCardPreview<TData = Awaited<ReturnType<typeof getMyCardPreview>>, TError = ErrorType<Problem>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyCardPreview>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyCardPreview>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyCardPreview>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyCardPreview<TData = Awaited<ReturnType<typeof getMyCardPreview>>, TError = ErrorType<Problem>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyCardPreview>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary Preview the anonymous card that organizations would read.
|
||||
*/
|
||||
|
||||
export function useGetMyCardPreview<TData = Awaited<ReturnType<typeof getMyCardPreview>>, TError = ErrorType<Problem>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyCardPreview>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetMyCardPreviewQueryOptions(options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getSetMySearchStatusUrl = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/privacy/search-status`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body is the complete new status: `looking` ("Ищу") or `not_looking`. The status is a statement of the candidate and never a consent. It changes neither the C2 consent, nor the publication, nor the hidden organizations, and it does not close or open any contact grant; a candidate whose profile is closed who sets `looking` becomes visible to no one.
|
||||
*
|
||||
* `looking` stores the moment of the confirmation and a lapse time. The server takes the interval from the `search_status` section of the effective product policy (30 days in the demo policy, `searching_confirmation_interval_days`), stores the policy version it used, and fixes the lapse time then, so a later policy change moves no stored time. Setting `looking` again is the confirmation: it replaces the confirmation time with now and advances the version, also after a lapse. The body carries no time, interval, or policy version.
|
||||
*
|
||||
* After the lapse time the status holds as `not_looking` with `lapsed` true on the next read. The lapse is computed and written nowhere, so it needs no job, it can never make the candidate more visible, and it never touches the publication or the hidden organizations. A reminder before the lapse is a planned notification, not a part of this operation.
|
||||
*
|
||||
* Optimistic concurrency uses `expected_version` in the body, 0 for a candidate who never set the status; a stale or non-existent version answers 412 version_conflict and changes nothing. `not_looking` over a stored `not_looking` changes nothing and answers 200 even with a stale version. `looking` always changes the stored confirmation, so a retry of a confirmation whose response was lost with the old version answers 412 and the client reads the status again.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), an unchanged `not_looking` (200), then a stale version (412).
|
||||
* @summary Set or confirm the search status of the current candidate.
|
||||
*/
|
||||
export const setMySearchStatus = async (searchStatusUpdate: SearchStatusUpdate, options?: Parameters<typeof apiRequest>[1]): Promise<SearchStatus> => {
|
||||
|
||||
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
||||
if (!h) return {};
|
||||
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
||||
if (Symbol.iterator in h) {
|
||||
return Object.fromEntries(
|
||||
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
||||
);
|
||||
}
|
||||
const headers: Record<string, string | readonly string[]> = {};
|
||||
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
||||
if (value !== undefined) headers[name] = value;
|
||||
}
|
||||
return headers;
|
||||
};
|
||||
return apiRequest<SearchStatus>(getSetMySearchStatusUrl(),
|
||||
{
|
||||
...options,
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
|
||||
body: JSON.stringify(searchStatusUpdate)
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getSetMySearchStatusMutationKey = () => ['setMySearchStatus'] as const;
|
||||
|
||||
export const getSetMySearchStatusMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setMySearchStatus>>, TError,SetMySearchStatusMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof setMySearchStatus>>, TError,SetMySearchStatusMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getSetMySearchStatusMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof setMySearchStatus>>, SetMySearchStatusMutationVariables> = (props) => {
|
||||
const {data} = props ?? {};
|
||||
|
||||
return setMySearchStatus(data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type SetMySearchStatusMutationResult = NonNullable<Awaited<ReturnType<typeof setMySearchStatus>>>
|
||||
export type SetMySearchStatusMutationBody = SearchStatusUpdate
|
||||
export type SetMySearchStatusMutationError = ErrorType<Problem>
|
||||
export type SetMySearchStatusMutationVariables = {data: SearchStatusUpdate}
|
||||
|
||||
/**
|
||||
* @summary Set or confirm the search status of the current candidate.
|
||||
*/
|
||||
export const useSetMySearchStatus = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setMySearchStatus>>, TError,SetMySearchStatusMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof setMySearchStatus>>,
|
||||
TError,
|
||||
SetMySearchStatusMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getSetMySearchStatusMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getListMyHiddenOrganizationsUrl = (params?: ListMyHiddenOrganizationsParams,) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? 'null' : String(value))
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0 ? `/api/v1/me/privacy/hidden-organizations?${stringifiedParams}` : `/api/v1/me/privacy/hidden-organizations`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only the caller's own records and no request can name another account. Returns a page of the hidden organizations, newest first with the organization identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
|
||||
*
|
||||
* The records belong to the candidate. An organization never reads them, never learns that it is hidden, and sees a hidden candidate exactly as it sees one who is not published: no search result, no card, no contact read.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden. A malformed `limit` or `cursor` answers 400 validation_failed.
|
||||
* @summary List the organizations that the candidate hides the profile from.
|
||||
*/
|
||||
export const listMyHiddenOrganizations = async (params?: ListMyHiddenOrganizationsParams, options?: Parameters<typeof apiRequest>[1]): Promise<HiddenOrganizationList> => {
|
||||
|
||||
return apiRequest<HiddenOrganizationList>(getListMyHiddenOrganizationsUrl(params),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListMyHiddenOrganizationsQueryKey = (params?: ListMyHiddenOrganizationsParams,) => {
|
||||
return [
|
||||
`/api/v1/me/privacy/hidden-organizations`, ...(params ? [params] : [])
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getListMyHiddenOrganizationsQueryOptions = <TData = Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError = ErrorType<Problem>>(params?: ListMyHiddenOrganizationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getListMyHiddenOrganizationsQueryKey(params);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof listMyHiddenOrganizations>>> = ({ signal }) => listMyHiddenOrganizations(params, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type ListMyHiddenOrganizationsQueryResult = NonNullable<Awaited<ReturnType<typeof listMyHiddenOrganizations>>>
|
||||
export type ListMyHiddenOrganizationsQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useListMyHiddenOrganizations<TData = Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError = ErrorType<Problem>>(
|
||||
params: undefined | ListMyHiddenOrganizationsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMyHiddenOrganizations>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMyHiddenOrganizations>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMyHiddenOrganizations<TData = Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyHiddenOrganizationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMyHiddenOrganizations>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMyHiddenOrganizations>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMyHiddenOrganizations<TData = Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyHiddenOrganizationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary List the organizations that the candidate hides the profile from.
|
||||
*/
|
||||
|
||||
export function useListMyHiddenOrganizations<TData = Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyHiddenOrganizationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyHiddenOrganizations>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getListMyHiddenOrganizationsQueryOptions(params,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getHideOrganizationUrl = (orgId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/privacy/hidden-organizations/${orgId}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The request has no body: the path names the organization and the candidate comes from the session. The hiding is a record that belongs to the candidate and references the organization; it changes neither the C2 consent, nor the publication, nor the search status.
|
||||
*
|
||||
* The operation sets a state, so it is idempotent and needs no Idempotency-Key: hiding an organization that is already hidden answers 200 with the existing record and its original `hidden_at`, changes nothing, and writes no history record. There is one record per candidate and organization.
|
||||
*
|
||||
* Anti-enumeration: an organization that does not exist and an organization that the candidate cannot see answer the same 404 not_found, with the same body and without a timing or an error code that tells them apart, so the operation is not a way to ask whether an identifier belongs to an organization. The candidate can see an organization that has sent them an invitation, and the organizations that a candidate lookup will list (planned; see the open questions of the contract). The response names the organization only after that check, with its current name. The identifiers are random, the general rate limit applies and can answer 429 with Retry-After before any check, and the record never reveals to an organization that a candidate hides it.
|
||||
*
|
||||
* A candidate hides at most 1000 organizations; hiding one more answers 409 state_conflict with the entry `{in: path, pointer: /org_id, code: limit_reached}` in `errors`, which tells it apart from other conflicts, and changes nothing, and a repeat of an existing hiding is never refused for the limit.
|
||||
*
|
||||
* Hiding an organization that holds an active contact grant of the candidate revokes that grant with the reason `visibility_closed` in the same transaction (planned together with the invitation operations). Lifting the hiding never reopens a grant.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation of the path (400), account scenario (403 forbidden for an employer), the organization and its visibility to the candidate (404 not_found), then the repeat (200), then the limit (409 state_conflict). Like every visibility change, hiding needs a verified email (a usecase requirement).
|
||||
* @summary Hide the candidate profile from one organization.
|
||||
*/
|
||||
export const hideOrganization = async (orgId: string, options?: Parameters<typeof apiRequest>[1]): Promise<HiddenOrganization> => {
|
||||
|
||||
return apiRequest<HiddenOrganization>(getHideOrganizationUrl(orgId),
|
||||
{
|
||||
...options,
|
||||
method: 'PUT'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getHideOrganizationMutationKey = () => ['hideOrganization'] as const;
|
||||
|
||||
export const getHideOrganizationMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof hideOrganization>>, TError,HideOrganizationMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof hideOrganization>>, TError,HideOrganizationMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getHideOrganizationMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof hideOrganization>>, HideOrganizationMutationVariables> = (props) => {
|
||||
const {orgId} = props ?? {};
|
||||
|
||||
return hideOrganization(orgId,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type HideOrganizationMutationResult = NonNullable<Awaited<ReturnType<typeof hideOrganization>>>
|
||||
|
||||
export type HideOrganizationMutationError = ErrorType<Problem>
|
||||
export type HideOrganizationMutationVariables = {orgId: string}
|
||||
|
||||
/**
|
||||
* @summary Hide the candidate profile from one organization.
|
||||
*/
|
||||
export const useHideOrganization = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof hideOrganization>>, TError,HideOrganizationMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof hideOrganization>>,
|
||||
TError,
|
||||
HideOrganizationMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getHideOrganizationMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getUnhideOrganizationUrl = (orgId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/privacy/hidden-organizations/${orgId}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. Deletes the hiding record of the candidate for the organization in the path. The request is idempotent: it answers 204 whether the organization was hidden, was not hidden, or does not exist, so the operation reveals nothing about the organization, and a repeat after a lost response succeeds. The record is deleted, the settings history keeps the event `organization_unhidden` only when a record was deleted.
|
||||
*
|
||||
* Lifting the hiding makes the candidate readable by that organization again only if the profile is published and the organization otherwise may read it. It changes neither the C2 consent, nor the publication, nor the search status, and it never reopens a contact grant that the hiding closed.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation of the path (400), account scenario (403 forbidden for an employer), then the deletion (204).
|
||||
* @summary Lift the hiding of the candidate profile from one organization.
|
||||
*/
|
||||
export const unhideOrganization = async (orgId: string, options?: Parameters<typeof apiRequest>[1]): Promise<void> => {
|
||||
|
||||
return apiRequest<void>(getUnhideOrganizationUrl(orgId),
|
||||
{
|
||||
...options,
|
||||
method: 'DELETE'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getUnhideOrganizationMutationKey = () => ['unhideOrganization'] as const;
|
||||
|
||||
export const getUnhideOrganizationMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof unhideOrganization>>, TError,UnhideOrganizationMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof unhideOrganization>>, TError,UnhideOrganizationMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getUnhideOrganizationMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof unhideOrganization>>, UnhideOrganizationMutationVariables> = (props) => {
|
||||
const {orgId} = props ?? {};
|
||||
|
||||
return unhideOrganization(orgId,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type UnhideOrganizationMutationResult = NonNullable<Awaited<ReturnType<typeof unhideOrganization>>>
|
||||
|
||||
export type UnhideOrganizationMutationError = ErrorType<Problem>
|
||||
export type UnhideOrganizationMutationVariables = {orgId: string}
|
||||
|
||||
/**
|
||||
* @summary Lift the hiding of the candidate profile from one organization.
|
||||
*/
|
||||
export const useUnhideOrganization = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof unhideOrganization>>, TError,UnhideOrganizationMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof unhideOrganization>>,
|
||||
TError,
|
||||
UnhideOrganizationMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getUnhideOrganizationMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getListMyPrivacyHistoryUrl = (params?: ListMyPrivacyHistoryParams,) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? 'null' : String(value))
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0 ? `/api/v1/me/privacy/history?${stringifiedParams}` : `/api/v1/me/privacy/history`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only the caller's own records. Returns a page of the settings history, newest first with the event identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
|
||||
*
|
||||
* The history is append-only evidence of what the candidate published, hid, and announced, and when. A publication event keeps the published fields and the C2 record behind them, which is what the consent ledger deliberately does not carry (the C2 record proves the consent to the text, not the field set). A revocation of C2 and a lapse of the search status are computed and are not events here; the consent history shows the revocation. The history never contains a profile value.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden. A malformed `limit` or `cursor` answers 400 validation_failed.
|
||||
* @summary List the changes of the visibility settings of the current candidate.
|
||||
*/
|
||||
export const listMyPrivacyHistory = async (params?: ListMyPrivacyHistoryParams, options?: Parameters<typeof apiRequest>[1]): Promise<PrivacyEventList> => {
|
||||
|
||||
return apiRequest<PrivacyEventList>(getListMyPrivacyHistoryUrl(params),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListMyPrivacyHistoryQueryKey = (params?: ListMyPrivacyHistoryParams,) => {
|
||||
return [
|
||||
`/api/v1/me/privacy/history`, ...(params ? [params] : [])
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getListMyPrivacyHistoryQueryOptions = <TData = Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError = ErrorType<Problem>>(params?: ListMyPrivacyHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getListMyPrivacyHistoryQueryKey(params);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof listMyPrivacyHistory>>> = ({ signal }) => listMyPrivacyHistory(params, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type ListMyPrivacyHistoryQueryResult = NonNullable<Awaited<ReturnType<typeof listMyPrivacyHistory>>>
|
||||
export type ListMyPrivacyHistoryQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useListMyPrivacyHistory<TData = Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError = ErrorType<Problem>>(
|
||||
params: undefined | ListMyPrivacyHistoryParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMyPrivacyHistory>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMyPrivacyHistory>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMyPrivacyHistory<TData = Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyPrivacyHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMyPrivacyHistory>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMyPrivacyHistory>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMyPrivacyHistory<TData = Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyPrivacyHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary List the changes of the visibility settings of the current candidate.
|
||||
*/
|
||||
|
||||
export function useListMyPrivacyHistory<TData = Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyPrivacyHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyPrivacyHistory>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getListMyPrivacyHistoryQueryOptions(params,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListMyCardAccessHistoryUrl = (params?: ListMyCardAccessHistoryParams,) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? 'null' : String(value))
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0 ? `/api/v1/me/privacy/access-history?${stringifiedParams}` : `/api/v1/me/privacy/access-history`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only accesses to the caller's own card. Returns a page, newest first with the record identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
|
||||
*
|
||||
* An access is a view of the anonymous card by an organization (`card_viewed`) or a read of the contacts through an active contact grant (`contact_read`). Reading the history is not an access and writes nothing. A view of the card by an organization that has no invitation relation with the candidate carries `organization` null, so the candidate sees that the card was viewed without learning a company that they cannot otherwise see; a contact read always names the organization, because the candidate accepted its invitation. The entries carry no search query, filter, or ranking of the organization, and no organization the candidate hides ever appears as a viewer, because a hidden organization cannot read the card.
|
||||
*
|
||||
* The storage of accesses is planned with the card and contact operations of the organization side (TASK-185 and the contact read of the invitation contract); until then the operation answers 501 not_implemented after the session and request checks.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden. A malformed `limit` or `cursor` answers 400 validation_failed.
|
||||
* @summary List the accesses of organizations to the card of the current candidate.
|
||||
*/
|
||||
export const listMyCardAccessHistory = async (params?: ListMyCardAccessHistoryParams, options?: Parameters<typeof apiRequest>[1]): Promise<CardAccessList> => {
|
||||
|
||||
return apiRequest<CardAccessList>(getListMyCardAccessHistoryUrl(params),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListMyCardAccessHistoryQueryKey = (params?: ListMyCardAccessHistoryParams,) => {
|
||||
return [
|
||||
`/api/v1/me/privacy/access-history`, ...(params ? [params] : [])
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getListMyCardAccessHistoryQueryOptions = <TData = Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError = ErrorType<Problem>>(params?: ListMyCardAccessHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getListMyCardAccessHistoryQueryKey(params);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof listMyCardAccessHistory>>> = ({ signal }) => listMyCardAccessHistory(params, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type ListMyCardAccessHistoryQueryResult = NonNullable<Awaited<ReturnType<typeof listMyCardAccessHistory>>>
|
||||
export type ListMyCardAccessHistoryQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useListMyCardAccessHistory<TData = Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError = ErrorType<Problem>>(
|
||||
params: undefined | ListMyCardAccessHistoryParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMyCardAccessHistory>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMyCardAccessHistory>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMyCardAccessHistory<TData = Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyCardAccessHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMyCardAccessHistory>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMyCardAccessHistory>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMyCardAccessHistory<TData = Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyCardAccessHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary List the accesses of organizations to the card of the current candidate.
|
||||
*/
|
||||
|
||||
export function useListMyCardAccessHistory<TData = Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyCardAccessHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyCardAccessHistory>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getListMyCardAccessHistoryQueryOptions(params,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
import { readFileSync, readdirSync } from "node:fs";
|
||||
import { dirname, join, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { describe, expect, expectTypeOf, it } from "vitest";
|
||||
import { setMyPublication, setMySearchStatus } from "./endpoints/privacy/privacy";
|
||||
import {
|
||||
AnonymousCardContent,
|
||||
CardField,
|
||||
CardPreview,
|
||||
HiddenOrganization,
|
||||
PrivacySettings,
|
||||
Publication,
|
||||
PublicationUpdate,
|
||||
SearchStatus,
|
||||
SearchStatusUpdate,
|
||||
} from "./schemas";
|
||||
|
||||
// These tests pin the generated visibility contract (TASK-088) that the
|
||||
// privacy settings screen consumes. They fail when regeneration lets a
|
||||
// request name a consent or a time, lets a card field name a name, a contact,
|
||||
// or the salary, lets the anonymous card gain a contact, mixes the search
|
||||
// status with a consent, or leaks a setting into an organization DTO.
|
||||
|
||||
const consentId = "01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e60";
|
||||
|
||||
const closedPublication = {
|
||||
state: "closed",
|
||||
closed_reason: "never_published",
|
||||
fields: [],
|
||||
consent_id: null,
|
||||
published_at: null,
|
||||
version: 0,
|
||||
} as const;
|
||||
|
||||
const publishedPublication = {
|
||||
state: "published",
|
||||
closed_reason: null,
|
||||
fields: ["categories", "stack"],
|
||||
consent_id: consentId,
|
||||
published_at: "2026-10-06T09:10:00Z",
|
||||
version: 1,
|
||||
} as const;
|
||||
|
||||
const notLooking = {
|
||||
value: "not_looking",
|
||||
lapsed: false,
|
||||
confirmed_at: null,
|
||||
lapses_at: null,
|
||||
version: 0,
|
||||
} as const;
|
||||
|
||||
const lookingStatus = {
|
||||
value: "looking",
|
||||
lapsed: false,
|
||||
confirmed_at: "2026-10-06T09:12:00Z",
|
||||
lapses_at: "2026-11-05T09:12:00Z",
|
||||
version: 1,
|
||||
} as const;
|
||||
|
||||
describe("generated PrivacySettings", () => {
|
||||
it("reads a new candidate as closed, not looking, and hiding nobody, all at version 0", () => {
|
||||
const parsed = PrivacySettings.parse({
|
||||
publication: closedPublication,
|
||||
search_status: notLooking,
|
||||
hidden_organizations_total: 0,
|
||||
});
|
||||
|
||||
expect(parsed.publication).toMatchObject({ state: "closed", fields: [], version: 0 });
|
||||
expect(parsed.publication.consent_id).toBeNull();
|
||||
expect(parsed.search_status.value).toBe("not_looking");
|
||||
});
|
||||
|
||||
it("reads a published profile with its fields, its C2 record, and a confirmed status", () => {
|
||||
const settings = {
|
||||
publication: publishedPublication,
|
||||
search_status: lookingStatus,
|
||||
hidden_organizations_total: 1,
|
||||
};
|
||||
|
||||
expect(PrivacySettings.parse(settings)).toEqual(settings);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["a state outside closed and published", { ...publishedPublication, state: "draft" }],
|
||||
["a closing reason outside the enum", { ...closedPublication, closed_reason: "expired" }],
|
||||
["a consent identifier that is not a UUID", { ...publishedPublication, consent_id: "c2" }],
|
||||
["a negative version", { ...publishedPublication, version: -1 }],
|
||||
])("rejects a publication with %s", (_case, publication) => {
|
||||
expect(Publication.safeParse(publication).success).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("generated PublicationUpdate", () => {
|
||||
const update = { expected_version: 0, state: "published", fields: ["categories", "stack"] };
|
||||
|
||||
it("accepts a publication and a closing", () => {
|
||||
expect(PublicationUpdate.parse(update)).toEqual(update);
|
||||
expect(PublicationUpdate.parse({ expected_version: 1, state: "closed", fields: [] })).toEqual({
|
||||
expected_version: 1,
|
||||
state: "closed",
|
||||
fields: [],
|
||||
});
|
||||
});
|
||||
|
||||
it.each(["full_name", "email", "phone", "telegram", "contacts", "salary_minimum", "user_id"])(
|
||||
"has no card field %s, so no request can publish it",
|
||||
(field) => {
|
||||
expect(CardField.safeParse(field).success).toBe(false);
|
||||
expect(PublicationUpdate.safeParse({ ...update, fields: [field] }).success).toBe(false);
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
["a missing version", { state: "closed", fields: [] }],
|
||||
["a negative version", { ...update, expected_version: -1 }],
|
||||
["a fractional version", { ...update, expected_version: 1.5 }],
|
||||
["a missing field set", { expected_version: 0, state: "closed" }],
|
||||
["more fields than there are groups", { ...update, fields: [...CardField.options, "stack"] }],
|
||||
["an unknown state", { ...update, state: "hidden" }],
|
||||
])("rejects a body with %s", (_case, body) => {
|
||||
expect(PublicationUpdate.safeParse(body).success).toBe(false);
|
||||
});
|
||||
|
||||
it("never carries a consent, a time, or a version of the result in the parsed body", () => {
|
||||
const parsed = PublicationUpdate.parse({
|
||||
...update,
|
||||
consent_id: consentId,
|
||||
published_at: "2026-10-06T09:10:00Z",
|
||||
version: 5,
|
||||
});
|
||||
|
||||
// Generated Zod strips unknown keys; the server rejects them with 400.
|
||||
expect(Object.keys(parsed).sort()).toEqual(["expected_version", "fields", "state"]);
|
||||
expectTypeOf<PublicationUpdate>().toEqualTypeOf<{
|
||||
expected_version: number;
|
||||
state: "closed" | "published";
|
||||
fields: Array<
|
||||
"categories" | "stack" | "experience" | "soft_skills" | "location" | "relocation"
|
||||
>;
|
||||
}>();
|
||||
});
|
||||
|
||||
it("takes the update as the only argument of the generated call", () => {
|
||||
expectTypeOf(setMyPublication).parameter(0).toEqualTypeOf<PublicationUpdate>();
|
||||
});
|
||||
});
|
||||
|
||||
describe("generated SearchStatus", () => {
|
||||
it("is not a consent: it names no consent, publication, or organization", () => {
|
||||
expect(Object.keys(SearchStatus.shape).sort()).toEqual([
|
||||
"confirmed_at",
|
||||
"lapsed",
|
||||
"lapses_at",
|
||||
"value",
|
||||
"version",
|
||||
]);
|
||||
expect(Object.keys(SearchStatusUpdate.shape).sort()).toEqual(["expected_version", "value"]);
|
||||
});
|
||||
|
||||
it("stores the confirmation of looking and a lapse that falls to the non-public status", () => {
|
||||
expect(SearchStatus.parse(lookingStatus)).toEqual(lookingStatus);
|
||||
// A lapsed status holds as not_looking and still shows when it was confirmed.
|
||||
const lapsed = { ...lookingStatus, value: "not_looking", lapsed: true };
|
||||
|
||||
expect(SearchStatus.parse(lapsed)).toEqual(lapsed);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["a value outside looking and not_looking", { expected_version: 0, value: "open" }],
|
||||
["a missing version", { value: "looking" }],
|
||||
["a negative version", { expected_version: -1, value: "looking" }],
|
||||
])("rejects an update with %s", (_case, body) => {
|
||||
expect(SearchStatusUpdate.safeParse(body).success).toBe(false);
|
||||
});
|
||||
|
||||
it("never carries a time, an interval, or a policy version in the parsed update", () => {
|
||||
const parsed = SearchStatusUpdate.parse({
|
||||
expected_version: 0,
|
||||
value: "looking",
|
||||
confirmed_at: "2026-10-06T09:12:00Z",
|
||||
lapses_at: "2030-01-01T00:00:00Z",
|
||||
interval_days: 3650,
|
||||
policy_version_id: consentId,
|
||||
});
|
||||
|
||||
expect(Object.keys(parsed).sort()).toEqual(["expected_version", "value"]);
|
||||
expectTypeOf(setMySearchStatus).parameter(0).toEqualTypeOf<SearchStatusUpdate>();
|
||||
});
|
||||
});
|
||||
|
||||
describe("generated HiddenOrganization", () => {
|
||||
it("belongs to the candidate and names the organization and the time", () => {
|
||||
const hidden = {
|
||||
organization: { id: "01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01", name: "ООО Пример Платежи" },
|
||||
hidden_at: "2026-10-06T09:20:00Z",
|
||||
};
|
||||
|
||||
expect(HiddenOrganization.parse(hidden)).toEqual(hidden);
|
||||
expect(
|
||||
HiddenOrganization.safeParse({ ...hidden, organization: { ...hidden.organization, id: "x" } })
|
||||
.success,
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("generated AnonymousCardContent", () => {
|
||||
const card = {
|
||||
categories: [{ specialization: "backend", grade: "middle" }],
|
||||
stack: ["PostgreSQL", "Kafka"],
|
||||
experience_months: null,
|
||||
soft_skills: null,
|
||||
location: null,
|
||||
relocation: null,
|
||||
};
|
||||
|
||||
it("holds only the closed set of card properties and reads an unpublished one as null", () => {
|
||||
expect(AnonymousCardContent.parse(card)).toEqual(card);
|
||||
expect(Object.keys(AnonymousCardContent.shape).sort()).toEqual([
|
||||
"categories",
|
||||
"experience_months",
|
||||
"location",
|
||||
"relocation",
|
||||
"soft_skills",
|
||||
"stack",
|
||||
]);
|
||||
});
|
||||
|
||||
it("never keeps a name, a contact, a salary, or an identifier of the candidate", () => {
|
||||
const parsed = AnonymousCardContent.parse({
|
||||
...card,
|
||||
full_name: "Anna Sokolova",
|
||||
email: "anna@example.com",
|
||||
phone: "+79000000000",
|
||||
telegram: "@anna",
|
||||
salary_minimum: 180000,
|
||||
user_id: consentId,
|
||||
});
|
||||
|
||||
expect(Object.keys(parsed).sort()).toEqual(Object.keys(card).sort());
|
||||
});
|
||||
|
||||
it("is the card of a preview that is null while the profile is closed", () => {
|
||||
const closed = {
|
||||
state: "closed",
|
||||
fields: [],
|
||||
card: null,
|
||||
generated_at: "2026-10-06T09:30:00Z",
|
||||
};
|
||||
|
||||
expect(CardPreview.parse(closed)).toEqual(closed);
|
||||
expect(CardPreview.parse({ ...closed, state: "published", fields: ["stack"], card })).toMatchObject({
|
||||
card: { stack: ["PostgreSQL", "Kafka"] },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// A setting of a candidate is private. The check reads the generated files:
|
||||
// the privacy schemas carry no profile, contact, or consent field, and the
|
||||
// organization, invitation, need, and profile sides carry no setting.
|
||||
describe("privacy schemas", () => {
|
||||
const apiDirectory = resolve(dirname(fileURLToPath(import.meta.url)));
|
||||
const sourcesIn = (directory: string) =>
|
||||
readdirSync(join(apiDirectory, directory), { recursive: true, encoding: "utf8" })
|
||||
.filter((name) => name.endsWith(".ts"))
|
||||
.map((name) => ({
|
||||
name: join(directory, name),
|
||||
source: readFileSync(join(apiDirectory, directory, name), "utf8"),
|
||||
}));
|
||||
|
||||
const privacySide = [...sourcesIn(join("schemas", "privacy"))];
|
||||
const otherSide = ["organization", "invitation", "need", "candidate", "consent"].flatMap((tag) => [
|
||||
...sourcesIn(join("schemas", tag)),
|
||||
...sourcesIn(join("endpoints", tag)),
|
||||
]);
|
||||
|
||||
// Generated object keys that only the visibility settings have, matched as
|
||||
// quoted keys because endpoint comments quote contract prose.
|
||||
const privacyOnly = [
|
||||
'"hidden_organizations_total":',
|
||||
'"lapses_at":',
|
||||
'"closed_reason":',
|
||||
'"experience_months":',
|
||||
'"hidden_at":',
|
||||
];
|
||||
// Generated object keys that the private profile, a contact disclosure, or
|
||||
// a consent record has and no visibility schema may.
|
||||
const forbiddenOnPrivacySide = [
|
||||
'"full_name":',
|
||||
'"email":',
|
||||
'"phone":',
|
||||
'"telegram":',
|
||||
'"salary_minimum":',
|
||||
'"confirmed_categories":',
|
||||
'"text_version":',
|
||||
'"invitation_id":',
|
||||
'"fields": zod.array(zod.enum([\'email\'',
|
||||
];
|
||||
|
||||
it("finds the generated files of both sides", () => {
|
||||
expect(privacySide.length).toBeGreaterThan(20);
|
||||
expect(otherSide.length).toBeGreaterThan(50);
|
||||
});
|
||||
|
||||
it("is not reachable from an organization, invitation, need, profile, or consent schema or endpoint", () => {
|
||||
const leaks = otherSide.flatMap((file) =>
|
||||
privacyOnly
|
||||
.filter((marker) => file.source.includes(marker))
|
||||
.map((marker) => `${file.name}: ${marker}`),
|
||||
);
|
||||
|
||||
expect(leaks).toEqual([]);
|
||||
});
|
||||
|
||||
it("carries no name, contact, salary, profile claim, or consent field", () => {
|
||||
const leaks = privacySide.flatMap((file) =>
|
||||
forbiddenOnPrivacySide
|
||||
.filter((marker) => file.source.includes(marker))
|
||||
.map((marker) => `${file.name}: ${marker}`),
|
||||
);
|
||||
|
||||
expect(leaks).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -54,5 +54,4 @@ export * from './questionnaireSpecialization.zod';
|
||||
export * from './questionnaireVersion.zod';
|
||||
export * from './saveMyProfileBody.zod';
|
||||
export * from './saveMyQuestionnaireBody.zod';
|
||||
export * from './stackTag.zod';
|
||||
export * from './workContext.zod';
|
||||
@@ -29,6 +29,7 @@ export * from './salaryRange.zod';
|
||||
export * from './salaryTaxBasis.zod';
|
||||
export * from './skillName.zod';
|
||||
export * from './specializationCode.zod';
|
||||
export * from './stackTag.zod';
|
||||
export * from './taskLanguage.zod';
|
||||
export * from './timestamp.zod';
|
||||
export * from './workFormat.zod';
|
||||
@@ -41,4 +42,5 @@ export * from './identity';
|
||||
export * from './invitation';
|
||||
export * from './need';
|
||||
export * from './organization';
|
||||
export * from './privacy';
|
||||
export * from './support';
|
||||
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const anonymousCardContentCategoriesMax = 9;
|
||||
|
||||
export const anonymousCardContentStackItemMax = 50;
|
||||
|
||||
|
||||
export const anonymousCardContentStackItemRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
export const anonymousCardContentStackMax = 30;
|
||||
|
||||
export const anonymousCardContentExperienceMonthsMin = 0;
|
||||
export const anonymousCardContentExperienceMonthsMax = 1200;
|
||||
|
||||
export const anonymousCardContentSoftSkillsItemMax = 50;
|
||||
|
||||
|
||||
export const anonymousCardContentSoftSkillsItemRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
export const anonymousCardContentSoftSkillsMax = 10;
|
||||
|
||||
export const anonymousCardContentLocationMax = 100;
|
||||
|
||||
|
||||
export const anonymousCardContentLocationRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
|
||||
export const AnonymousCardContent = zod.object({
|
||||
"categories": zod.array(zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it.')).max(anonymousCardContentCategoriesMax).nullable().describe('Categories confirmed by assessment results, or null.'),
|
||||
"stack": zod.array(zod.string().min(1).max(anonymousCardContentStackItemMax).regex(anonymousCardContentStackItemRegExp).describe('Free technology tag of the candidate\'s stack, for example PostgreSQL, Kubernetes, or Django. A tag is a descriptive attribute: it never forms a category, never selects the task language, and never changes a grade, so a tag such as "Senior" has no effect on any category. It has no leading or trailing whitespace and no line breaks. The server compares tags without regard to letter case. Clients show tags as text, never as HTML.')).max(anonymousCardContentStackMax).nullable().describe('Technology tags of the candidate, or null.'),
|
||||
"experience_months": zod.int().min(anonymousCardContentExperienceMonthsMin).max(anonymousCardContentExperienceMonthsMax).nullable().describe('Total months of work experience, summed by the server without the employers, periods, or descriptions, or null.'),
|
||||
"soft_skills": zod.array(zod.string().min(1).max(anonymousCardContentSoftSkillsItemMax).regex(anonymousCardContentSoftSkillsItemRegExp).describe('Plain text; clients show it as text, never as HTML.')).max(anonymousCardContentSoftSkillsMax).nullable().describe('Soft skills of the candidate, or null.'),
|
||||
"location": zod.string().min(1).max(anonymousCardContentLocationMax).regex(anonymousCardContentLocationRegExp).nullable().describe('City or region as free text, never a street address, or null. Plain text; clients show it as text, never as HTML.'),
|
||||
"relocation": zod.boolean().nullable().describe('Whether the candidate is ready to relocate, or null.')
|
||||
}).describe('The anonymous candidate card as an organization reads it. Only values that the candidate confirmed reach it; an unconfirmed suggestion and an unknown value never do. A free text value (a stack tag, a soft skill, the location) that looks like a contact (an email address, a phone number, a URL or domain, a Telegram link, an @handle) is dropped by the builder (TASK-089) and never published. It carries no name, contact, resume text, employer, salary figure, account or profile identifier, and no schema of the private profile or of a contact disclosure is reachable from it; a contact reaches an organization only through the contact grant of an accepted invitation. Each property is null when its field is not published or the candidate has no value for it, so the card does not tell the two apart. The set of properties is closed, and an organization-visible card must never gain a property that identifies the candidate. The search ranking and the full card of an organization\'s search result are defined by the search contract (TASK-185), which reuses this content.')
|
||||
|
||||
export type AnonymousCardContent = zod.input<typeof AnonymousCardContent>;
|
||||
export type AnonymousCardContentOutput = zod.output<typeof AnonymousCardContent>;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const cardAccessOrganizationOneNameMax = 200;
|
||||
|
||||
|
||||
export const CardAccess = zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the access record.'),
|
||||
"kind": zod.enum(['card_viewed', 'contact_read']).describe('How an organization reached the candidate.\n\n- card_viewed: an organization read the anonymous card in a search result.\n- contact_read: an organization read the contacts through the contact grant of an accepted invitation.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"organization": zod.union([zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the organization.'),
|
||||
"name": zod.string().min(1).max(cardAccessOrganizationOneNameMax).describe('Current name of the organization. Plain text; clients show it as text, never as HTML.')
|
||||
}).describe('Organization as the candidate who hid it reads it. The name is the current name of the organization. The candidate must already have been able to see the organization to hide it, so the reference tells them nothing that they could not read before.'),zod.null()])
|
||||
}).describe('One access of an organization to the card or the contacts of the current candidate. `organization` is null for a view by an organization that has no invitation relation with the candidate, so the history shows that the card was viewed without naming a company that the candidate cannot otherwise see; whether the candidate should learn the name is an open product question. The record carries no query, ranking, or search filter of the organization.')
|
||||
|
||||
export type CardAccess = zod.input<typeof CardAccess>;
|
||||
export type CardAccessOutput = zod.output<typeof CardAccess>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const CardAccessKind = zod.enum(['card_viewed', 'contact_read']).describe('How an organization reached the candidate.\n\n- card_viewed: an organization read the anonymous card in a search result.\n- contact_read: an organization read the contacts through the contact grant of an accepted invitation.')
|
||||
|
||||
export type CardAccessKind = zod.input<typeof CardAccessKind>;
|
||||
export type CardAccessKindOutput = zod.output<typeof CardAccessKind>;
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const cardAccessListItemsItemOrganizationOneNameMax = 200;
|
||||
|
||||
export const cardAccessListItemsMax = 100;
|
||||
|
||||
export const cardAccessListPageNextCursorMax = 512;
|
||||
|
||||
|
||||
export const cardAccessListPageNextCursorRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const CardAccessList = zod.object({
|
||||
"items": zod.array(zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the access record.'),
|
||||
"kind": zod.enum(['card_viewed', 'contact_read']).describe('How an organization reached the candidate.\n\n- card_viewed: an organization read the anonymous card in a search result.\n- contact_read: an organization read the contacts through the contact grant of an accepted invitation.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"organization": zod.union([zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the organization.'),
|
||||
"name": zod.string().min(1).max(cardAccessListItemsItemOrganizationOneNameMax).describe('Current name of the organization. Plain text; clients show it as text, never as HTML.')
|
||||
}).describe('Organization as the candidate who hid it reads it. The name is the current name of the organization. The candidate must already have been able to see the organization to hide it, so the reference tells them nothing that they could not read before.'),zod.null()])
|
||||
}).describe('One access of an organization to the card or the contacts of the current candidate. `organization` is null for a view by an organization that has no invitation relation with the candidate, so the history shows that the card was viewed without naming a company that the candidate cannot otherwise see; whether the candidate should learn the name is an open product question. The record carries no query, ranking, or search filter of the organization.')).max(cardAccessListItemsMax).describe('Accesses of the page.'),
|
||||
"page": zod.object({
|
||||
"has_more": zod.boolean().describe('Whether another page follows this one.'),
|
||||
"next_cursor": zod.string().min(1).max(cardAccessListPageNextCursorMax).regex(cardAccessListPageNextCursorRegExp).nullable().describe('Opaque cursor of the next page, or null on the last page. Clients must not parse, build, or store it beyond the current listing.')
|
||||
}).describe('Cursor pagination state of a list response. Lists are ordered by a stable server-defined key. To read the next page, repeat the request with the same filters and `cursor` set to `next_cursor`.')
|
||||
}).describe('One page of the accesses to the card of the current candidate, newest first.')
|
||||
|
||||
export type CardAccessList = zod.input<typeof CardAccessList>;
|
||||
export type CardAccessListOutput = zod.output<typeof CardAccessList>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const CardCategory = zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it.')
|
||||
|
||||
export type CardCategory = zod.input<typeof CardCategory>;
|
||||
export type CardCategoryOutput = zod.output<typeof CardCategory>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const CardField = zod.enum(['categories', 'stack', 'experience', 'soft_skills', 'location', 'relocation']).describe('A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.\n\n- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.\n- stack: the technology tags of the profile.\n- experience: the total months of work experience, without employers, periods, or descriptions.\n- soft_skills: the soft skills of the profile.\n- location: the city or region of the profile.\n- relocation: whether the candidate is ready to relocate.\n\nOnly values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.\n\nAdding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.')
|
||||
|
||||
export type CardField = zod.input<typeof CardField>;
|
||||
export type CardFieldOutput = zod.output<typeof CardField>;
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const CardFieldSetMin = 0;
|
||||
export const CardFieldSetMax = 6;
|
||||
|
||||
|
||||
export const CardFieldSet = zod.array(zod.enum(['categories', 'stack', 'experience', 'soft_skills', 'location', 'relocation']).describe('A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.\n\n- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.\n- stack: the technology tags of the profile.\n- experience: the total months of work experience, without employers, periods, or descriptions.\n- soft_skills: the soft skills of the profile.\n- location: the city or region of the profile.\n- relocation: whether the candidate is ready to relocate.\n\nOnly values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.\n\nAdding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.')).min(CardFieldSetMin).max(CardFieldSetMax).describe('Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.')
|
||||
|
||||
export type CardFieldSet = zod.input<typeof CardFieldSet>;
|
||||
export type CardFieldSetOutput = zod.output<typeof CardFieldSet>;
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const cardPreviewFieldsMin = 0;
|
||||
export const cardPreviewFieldsMax = 6;
|
||||
|
||||
export const cardPreviewCardOneCategoriesMax = 9;
|
||||
|
||||
export const cardPreviewCardOneStackItemMax = 50;
|
||||
|
||||
|
||||
export const cardPreviewCardOneStackItemRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
export const cardPreviewCardOneStackMax = 30;
|
||||
|
||||
export const cardPreviewCardOneExperienceMonthsMin = 0;
|
||||
export const cardPreviewCardOneExperienceMonthsMax = 1200;
|
||||
|
||||
export const cardPreviewCardOneSoftSkillsItemMax = 50;
|
||||
|
||||
|
||||
export const cardPreviewCardOneSoftSkillsItemRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
export const cardPreviewCardOneSoftSkillsMax = 10;
|
||||
|
||||
export const cardPreviewCardOneLocationMax = 100;
|
||||
|
||||
|
||||
export const cardPreviewCardOneLocationRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
|
||||
export const CardPreview = zod.object({
|
||||
"state": zod.enum(['closed', 'published']).describe('Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.\n\n- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.\n- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.'),
|
||||
"fields": zod.array(zod.enum(['categories', 'stack', 'experience', 'soft_skills', 'location', 'relocation']).describe('A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.\n\n- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.\n- stack: the technology tags of the profile.\n- experience: the total months of work experience, without employers, periods, or descriptions.\n- soft_skills: the soft skills of the profile.\n- location: the city or region of the profile.\n- relocation: whether the candidate is ready to relocate.\n\nOnly values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.\n\nAdding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.')).min(cardPreviewFieldsMin).max(cardPreviewFieldsMax).describe('Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.'),
|
||||
"card": zod.union([zod.object({
|
||||
"categories": zod.array(zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it.')).max(cardPreviewCardOneCategoriesMax).nullable().describe('Categories confirmed by assessment results, or null.'),
|
||||
"stack": zod.array(zod.string().min(1).max(cardPreviewCardOneStackItemMax).regex(cardPreviewCardOneStackItemRegExp).describe('Free technology tag of the candidate\'s stack, for example PostgreSQL, Kubernetes, or Django. A tag is a descriptive attribute: it never forms a category, never selects the task language, and never changes a grade, so a tag such as "Senior" has no effect on any category. It has no leading or trailing whitespace and no line breaks. The server compares tags without regard to letter case. Clients show tags as text, never as HTML.')).max(cardPreviewCardOneStackMax).nullable().describe('Technology tags of the candidate, or null.'),
|
||||
"experience_months": zod.int().min(cardPreviewCardOneExperienceMonthsMin).max(cardPreviewCardOneExperienceMonthsMax).nullable().describe('Total months of work experience, summed by the server without the employers, periods, or descriptions, or null.'),
|
||||
"soft_skills": zod.array(zod.string().min(1).max(cardPreviewCardOneSoftSkillsItemMax).regex(cardPreviewCardOneSoftSkillsItemRegExp).describe('Plain text; clients show it as text, never as HTML.')).max(cardPreviewCardOneSoftSkillsMax).nullable().describe('Soft skills of the candidate, or null.'),
|
||||
"location": zod.string().min(1).max(cardPreviewCardOneLocationMax).regex(cardPreviewCardOneLocationRegExp).nullable().describe('City or region as free text, never a street address, or null. Plain text; clients show it as text, never as HTML.'),
|
||||
"relocation": zod.boolean().nullable().describe('Whether the candidate is ready to relocate, or null.')
|
||||
}).describe('The anonymous candidate card as an organization reads it. Only values that the candidate confirmed reach it; an unconfirmed suggestion and an unknown value never do. A free text value (a stack tag, a soft skill, the location) that looks like a contact (an email address, a phone number, a URL or domain, a Telegram link, an @handle) is dropped by the builder (TASK-089) and never published. It carries no name, contact, resume text, employer, salary figure, account or profile identifier, and no schema of the private profile or of a contact disclosure is reachable from it; a contact reaches an organization only through the contact grant of an accepted invitation. Each property is null when its field is not published or the candidate has no value for it, so the card does not tell the two apart. The set of properties is closed, and an organization-visible card must never gain a property that identifies the candidate. The search ranking and the full card of an organization\'s search result are defined by the search contract (TASK-185), which reuses this content.'),zod.null()]),
|
||||
"generated_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('What an organization that the candidate does not hide the profile from would read now, computed from the current profile, the current publication, and the consent ledger. It is a read for the candidate: it creates no view and no history record, and it never reaches an organization. `card` is null while the profile is closed.')
|
||||
|
||||
export type CardPreview = zod.input<typeof CardPreview>;
|
||||
export type CardPreviewOutput = zod.output<typeof CardPreview>;
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const hiddenOrganizationOrganizationNameMax = 200;
|
||||
|
||||
|
||||
export const HiddenOrganization = zod.object({
|
||||
"organization": zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the organization.'),
|
||||
"name": zod.string().min(1).max(hiddenOrganizationOrganizationNameMax).describe('Current name of the organization. Plain text; clients show it as text, never as HTML.')
|
||||
}).describe('Organization as the candidate who hid it reads it. The name is the current name of the organization. The candidate must already have been able to see the organization to hide it, so the reference tells them nothing that they could not read before.'),
|
||||
"hidden_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('One organization that the candidate hides the profile from. The record belongs to the candidate: no organization reads it, learns that it was hidden, or can tell a hidden candidate from one who is not published.')
|
||||
|
||||
export type HiddenOrganization = zod.input<typeof HiddenOrganization>;
|
||||
export type HiddenOrganizationOutput = zod.output<typeof HiddenOrganization>;
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const hiddenOrganizationListItemsItemOrganizationNameMax = 200;
|
||||
|
||||
export const hiddenOrganizationListItemsMax = 100;
|
||||
|
||||
export const hiddenOrganizationListPageNextCursorMax = 512;
|
||||
|
||||
|
||||
export const hiddenOrganizationListPageNextCursorRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const HiddenOrganizationList = zod.object({
|
||||
"items": zod.array(zod.object({
|
||||
"organization": zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the organization.'),
|
||||
"name": zod.string().min(1).max(hiddenOrganizationListItemsItemOrganizationNameMax).describe('Current name of the organization. Plain text; clients show it as text, never as HTML.')
|
||||
}).describe('Organization as the candidate who hid it reads it. The name is the current name of the organization. The candidate must already have been able to see the organization to hide it, so the reference tells them nothing that they could not read before.'),
|
||||
"hidden_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('One organization that the candidate hides the profile from. The record belongs to the candidate: no organization reads it, learns that it was hidden, or can tell a hidden candidate from one who is not published.')).max(hiddenOrganizationListItemsMax).describe('Hidden organizations of the page.'),
|
||||
"page": zod.object({
|
||||
"has_more": zod.boolean().describe('Whether another page follows this one.'),
|
||||
"next_cursor": zod.string().min(1).max(hiddenOrganizationListPageNextCursorMax).regex(hiddenOrganizationListPageNextCursorRegExp).nullable().describe('Opaque cursor of the next page, or null on the last page. Clients must not parse, build, or store it beyond the current listing.')
|
||||
}).describe('Cursor pagination state of a list response. Lists are ordered by a stable server-defined key. To read the next page, repeat the request with the same filters and `cursor` set to `next_cursor`.')
|
||||
}).describe('One page of the organizations that the candidate hides the profile from, newest first with the organization identifier as the tie-breaker.')
|
||||
|
||||
export type HiddenOrganizationList = zod.input<typeof HiddenOrganizationList>;
|
||||
export type HiddenOrganizationListOutput = zod.output<typeof HiddenOrganizationList>;
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export * from './anonymousCardContent.zod';
|
||||
export * from './cardAccess.zod';
|
||||
export * from './cardAccessKind.zod';
|
||||
export * from './cardAccessList.zod';
|
||||
export * from './cardCategory.zod';
|
||||
export * from './cardField.zod';
|
||||
export * from './cardFieldSet.zod';
|
||||
export * from './cardPreview.zod';
|
||||
export * from './hiddenOrganization.zod';
|
||||
export * from './hiddenOrganizationList.zod';
|
||||
export * from './listMyCardAccessHistoryParams.zod';
|
||||
export * from './listMyHiddenOrganizationsParams.zod';
|
||||
export * from './listMyPrivacyHistoryParams.zod';
|
||||
export * from './privacyEvent.zod';
|
||||
export * from './privacyEventKind.zod';
|
||||
export * from './privacyEventList.zod';
|
||||
export * from './privacyOrganization.zod';
|
||||
export * from './privacySettings.zod';
|
||||
export * from './publication.zod';
|
||||
export * from './publicationClosedReason.zod';
|
||||
export * from './publicationState.zod';
|
||||
export * from './publicationUpdate.zod';
|
||||
export * from './publicationVersion.zod';
|
||||
export * from './searchStatus.zod';
|
||||
export * from './searchStatusUpdate.zod';
|
||||
export * from './searchStatusValue.zod';
|
||||
export * from './searchStatusVersion.zod';
|
||||
export * from './setMyPublicationBody.zod';
|
||||
export * from './setMySearchStatusBody.zod';
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const listMyCardAccessHistoryParamsLimitDefault = 20;
|
||||
export const listMyCardAccessHistoryParamsLimitMax = 100;
|
||||
|
||||
export const listMyCardAccessHistoryParamsCursorMax = 512;
|
||||
|
||||
|
||||
export const listMyCardAccessHistoryParamsCursorRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const ListMyCardAccessHistoryParams = zod.object({
|
||||
"limit": zod.int().min(1).max(listMyCardAccessHistoryParamsLimitMax).default(listMyCardAccessHistoryParamsLimitDefault),
|
||||
"cursor": zod.string().min(1).max(listMyCardAccessHistoryParamsCursorMax).regex(listMyCardAccessHistoryParamsCursorRegExp).exactOptional()
|
||||
})
|
||||
|
||||
export type ListMyCardAccessHistoryParams = zod.input<typeof ListMyCardAccessHistoryParams>;
|
||||
export type ListMyCardAccessHistoryParamsOutput = zod.output<typeof ListMyCardAccessHistoryParams>;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const listMyHiddenOrganizationsParamsLimitDefault = 20;
|
||||
export const listMyHiddenOrganizationsParamsLimitMax = 100;
|
||||
|
||||
export const listMyHiddenOrganizationsParamsCursorMax = 512;
|
||||
|
||||
|
||||
export const listMyHiddenOrganizationsParamsCursorRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const ListMyHiddenOrganizationsParams = zod.object({
|
||||
"limit": zod.int().min(1).max(listMyHiddenOrganizationsParamsLimitMax).default(listMyHiddenOrganizationsParamsLimitDefault),
|
||||
"cursor": zod.string().min(1).max(listMyHiddenOrganizationsParamsCursorMax).regex(listMyHiddenOrganizationsParamsCursorRegExp).exactOptional()
|
||||
})
|
||||
|
||||
export type ListMyHiddenOrganizationsParams = zod.input<typeof ListMyHiddenOrganizationsParams>;
|
||||
export type ListMyHiddenOrganizationsParamsOutput = zod.output<typeof ListMyHiddenOrganizationsParams>;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const listMyPrivacyHistoryParamsLimitDefault = 20;
|
||||
export const listMyPrivacyHistoryParamsLimitMax = 100;
|
||||
|
||||
export const listMyPrivacyHistoryParamsCursorMax = 512;
|
||||
|
||||
|
||||
export const listMyPrivacyHistoryParamsCursorRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const ListMyPrivacyHistoryParams = zod.object({
|
||||
"limit": zod.int().min(1).max(listMyPrivacyHistoryParamsLimitMax).default(listMyPrivacyHistoryParamsLimitDefault),
|
||||
"cursor": zod.string().min(1).max(listMyPrivacyHistoryParamsCursorMax).regex(listMyPrivacyHistoryParamsCursorRegExp).exactOptional()
|
||||
})
|
||||
|
||||
export type ListMyPrivacyHistoryParams = zod.input<typeof ListMyPrivacyHistoryParams>;
|
||||
export type ListMyPrivacyHistoryParamsOutput = zod.output<typeof ListMyPrivacyHistoryParams>;
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const privacyEventFieldsOneMin = 0;
|
||||
export const privacyEventFieldsOneMax = 6;
|
||||
|
||||
export const privacyEventOrganizationOneNameMax = 200;
|
||||
|
||||
|
||||
export const PrivacyEvent = zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the event.'),
|
||||
"kind": zod.enum(['publication_opened', 'publication_changed', 'publication_closed', 'search_status_confirmed', 'search_status_cleared', 'organization_hidden', 'organization_unhidden']).describe('Kind of a change of the visibility settings that the history records.\n\n- publication_opened: the candidate published a closed profile.\n- publication_changed: the candidate changed the published fields of a published profile, or published it again under a new C2 record.\n- publication_closed: the candidate closed the publication. A revocation of C2 closes the card by the ledger and is read from the consent history, not recorded here.\n- search_status_confirmed: the candidate set or confirmed `looking`.\n- search_status_cleared: the candidate set `not_looking`. A lapse is not an event: it is computed.\n- organization_hidden: the candidate hid the profile from an organization.\n- organization_unhidden: the candidate lifted the hiding for an organization.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"fields": zod.union([zod.array(zod.enum(['categories', 'stack', 'experience', 'soft_skills', 'location', 'relocation']).describe('A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.\n\n- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.\n- stack: the technology tags of the profile.\n- experience: the total months of work experience, without employers, periods, or descriptions.\n- soft_skills: the soft skills of the profile.\n- location: the city or region of the profile.\n- relocation: whether the candidate is ready to relocate.\n\nOnly values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.\n\nAdding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.')).min(privacyEventFieldsOneMin).max(privacyEventFieldsOneMax).describe('Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.'),zod.null()]).describe('Published fields after the change for `publication_opened` and `publication_changed`, an empty set for `publication_closed`, and null for every other kind.'),
|
||||
"consent_id": zod.union([zod.uuid(),zod.null()]).describe('C2 record that backs the publication, for `publication_opened` and `publication_changed`, or null.'),
|
||||
"organization": zod.union([zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the organization.'),
|
||||
"name": zod.string().min(1).max(privacyEventOrganizationOneNameMax).describe('Current name of the organization. Plain text; clients show it as text, never as HTML.')
|
||||
}).describe('Organization as the candidate who hid it reads it. The name is the current name of the organization. The candidate must already have been able to see the organization to hide it, so the reference tells them nothing that they could not read before.'),zod.null()]).describe('Organization of `organization_hidden` and `organization_unhidden` with its current name, resolved when the history is read (the event stores only the identifier), or null.')
|
||||
}).describe('One recorded change of the visibility settings of the current candidate, as evidence of what was published, hidden, or announced and when. The history is append-only and returns only the caller\'s own records. A publication event carries the published fields and the C2 record behind them; an organization event names the organization; the other properties are null.')
|
||||
|
||||
export type PrivacyEvent = zod.input<typeof PrivacyEvent>;
|
||||
export type PrivacyEventOutput = zod.output<typeof PrivacyEvent>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const PrivacyEventKind = zod.enum(['publication_opened', 'publication_changed', 'publication_closed', 'search_status_confirmed', 'search_status_cleared', 'organization_hidden', 'organization_unhidden']).describe('Kind of a change of the visibility settings that the history records.\n\n- publication_opened: the candidate published a closed profile.\n- publication_changed: the candidate changed the published fields of a published profile, or published it again under a new C2 record.\n- publication_closed: the candidate closed the publication. A revocation of C2 closes the card by the ledger and is read from the consent history, not recorded here.\n- search_status_confirmed: the candidate set or confirmed `looking`.\n- search_status_cleared: the candidate set `not_looking`. A lapse is not an event: it is computed.\n- organization_hidden: the candidate hid the profile from an organization.\n- organization_unhidden: the candidate lifted the hiding for an organization.')
|
||||
|
||||
export type PrivacyEventKind = zod.input<typeof PrivacyEventKind>;
|
||||
export type PrivacyEventKindOutput = zod.output<typeof PrivacyEventKind>;
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const privacyEventListItemsItemFieldsOneMin = 0;
|
||||
export const privacyEventListItemsItemFieldsOneMax = 6;
|
||||
|
||||
export const privacyEventListItemsItemOrganizationOneNameMax = 200;
|
||||
|
||||
export const privacyEventListItemsMax = 100;
|
||||
|
||||
export const privacyEventListPageNextCursorMax = 512;
|
||||
|
||||
|
||||
export const privacyEventListPageNextCursorRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const PrivacyEventList = zod.object({
|
||||
"items": zod.array(zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the event.'),
|
||||
"kind": zod.enum(['publication_opened', 'publication_changed', 'publication_closed', 'search_status_confirmed', 'search_status_cleared', 'organization_hidden', 'organization_unhidden']).describe('Kind of a change of the visibility settings that the history records.\n\n- publication_opened: the candidate published a closed profile.\n- publication_changed: the candidate changed the published fields of a published profile, or published it again under a new C2 record.\n- publication_closed: the candidate closed the publication. A revocation of C2 closes the card by the ledger and is read from the consent history, not recorded here.\n- search_status_confirmed: the candidate set or confirmed `looking`.\n- search_status_cleared: the candidate set `not_looking`. A lapse is not an event: it is computed.\n- organization_hidden: the candidate hid the profile from an organization.\n- organization_unhidden: the candidate lifted the hiding for an organization.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"fields": zod.union([zod.array(zod.enum(['categories', 'stack', 'experience', 'soft_skills', 'location', 'relocation']).describe('A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.\n\n- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.\n- stack: the technology tags of the profile.\n- experience: the total months of work experience, without employers, periods, or descriptions.\n- soft_skills: the soft skills of the profile.\n- location: the city or region of the profile.\n- relocation: whether the candidate is ready to relocate.\n\nOnly values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.\n\nAdding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.')).min(privacyEventListItemsItemFieldsOneMin).max(privacyEventListItemsItemFieldsOneMax).describe('Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.'),zod.null()]).describe('Published fields after the change for `publication_opened` and `publication_changed`, an empty set for `publication_closed`, and null for every other kind.'),
|
||||
"consent_id": zod.union([zod.uuid(),zod.null()]).describe('C2 record that backs the publication, for `publication_opened` and `publication_changed`, or null.'),
|
||||
"organization": zod.union([zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the organization.'),
|
||||
"name": zod.string().min(1).max(privacyEventListItemsItemOrganizationOneNameMax).describe('Current name of the organization. Plain text; clients show it as text, never as HTML.')
|
||||
}).describe('Organization as the candidate who hid it reads it. The name is the current name of the organization. The candidate must already have been able to see the organization to hide it, so the reference tells them nothing that they could not read before.'),zod.null()]).describe('Organization of `organization_hidden` and `organization_unhidden` with its current name, resolved when the history is read (the event stores only the identifier), or null.')
|
||||
}).describe('One recorded change of the visibility settings of the current candidate, as evidence of what was published, hidden, or announced and when. The history is append-only and returns only the caller\'s own records. A publication event carries the published fields and the C2 record behind them; an organization event names the organization; the other properties are null.')).max(privacyEventListItemsMax).describe('Events of the page.'),
|
||||
"page": zod.object({
|
||||
"has_more": zod.boolean().describe('Whether another page follows this one.'),
|
||||
"next_cursor": zod.string().min(1).max(privacyEventListPageNextCursorMax).regex(privacyEventListPageNextCursorRegExp).nullable().describe('Opaque cursor of the next page, or null on the last page. Clients must not parse, build, or store it beyond the current listing.')
|
||||
}).describe('Cursor pagination state of a list response. Lists are ordered by a stable server-defined key. To read the next page, repeat the request with the same filters and `cursor` set to `next_cursor`.')
|
||||
}).describe('One page of the settings history of the current candidate, newest first.')
|
||||
|
||||
export type PrivacyEventList = zod.input<typeof PrivacyEventList>;
|
||||
export type PrivacyEventListOutput = zod.output<typeof PrivacyEventList>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const privacyOrganizationNameMax = 200;
|
||||
|
||||
|
||||
export const PrivacyOrganization = zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the organization.'),
|
||||
"name": zod.string().min(1).max(privacyOrganizationNameMax).describe('Current name of the organization. Plain text; clients show it as text, never as HTML.')
|
||||
}).describe('Organization as the candidate who hid it reads it. The name is the current name of the organization. The candidate must already have been able to see the organization to hide it, so the reference tells them nothing that they could not read before.')
|
||||
|
||||
export type PrivacyOrganization = zod.input<typeof PrivacyOrganization>;
|
||||
export type PrivacyOrganizationOutput = zod.output<typeof PrivacyOrganization>;
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const privacySettingsPublicationFieldsOneMin = 0;
|
||||
export const privacySettingsPublicationFieldsOneMax = 6;
|
||||
|
||||
export const privacySettingsPublicationVersionMin = 0;
|
||||
|
||||
export const privacySettingsSearchStatusVersionMin = 0;
|
||||
|
||||
export const privacySettingsHiddenOrganizationsTotalMin = 0;
|
||||
export const privacySettingsHiddenOrganizationsTotalMax = 1000;
|
||||
|
||||
|
||||
export const PrivacySettings = zod.object({
|
||||
"publication": zod.object({
|
||||
"state": zod.enum(['closed', 'published']).describe('Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.\n\n- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.\n- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.'),
|
||||
"closed_reason": zod.union([zod.enum(['never_published', 'closed_by_candidate', 'consent_revoked']).describe('Why a closed profile is closed, shown only to the candidate.\n\n- never_published: the candidate has never published the profile.\n- closed_by_candidate: the candidate closed the publication.\n- consent_revoked: the C2 consent that backed the publication was revoked. A later C2 grant never reopens the publication; the candidate publishes again explicitly and the new publication refers to the new consent record.'),zod.null()]).describe('Why the profile is closed, or null while it is published.'),
|
||||
"fields": zod.array(zod.enum(['categories', 'stack', 'experience', 'soft_skills', 'location', 'relocation']).describe('A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.\n\n- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.\n- stack: the technology tags of the profile.\n- experience: the total months of work experience, without employers, periods, or descriptions.\n- soft_skills: the soft skills of the profile.\n- location: the city or region of the profile.\n- relocation: whether the candidate is ready to relocate.\n\nOnly values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.\n\nAdding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.')).min(privacySettingsPublicationFieldsOneMin).max(privacySettingsPublicationFieldsOneMax).describe('Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.').describe('Card fields that organizations may read. Empty exactly when `state` is `closed`.'),
|
||||
"consent_id": zod.union([zod.uuid(),zod.null()]).describe('Identifier of the C2 record of the consent ledger that backs the current or the last publication, the `id` of a `ConsentRecord` of this account, or null when the profile was never published.'),
|
||||
"published_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Moment of the latest change that published or republished the card, or null while the profile was never published. It stays after a closing, as the time of the last publication.'),
|
||||
"version": zod.int().min(privacySettingsPublicationVersionMin).describe('Version of the publication setting of the candidate. A candidate who has never published has version 0 and the profile is closed; every change that alters the setting advances it by one. The client sends the version it read as `expected_version`. It is independent of the versions of the profile and of the search status, so a change of one never makes another stale.')
|
||||
}).describe('Publication setting of the candidate card. It is separate from the consent: the C2 consent in the ledger proves that the candidate accepted the publication text, and this setting records whether and which fields are published. `state` is `published` only while the referenced C2 record is unrevoked, whatever the stored setting says, so a revocation closes the card at once. The state, the fields, and the times belong to the history that the C2 consent record does not carry.'),
|
||||
"search_status": zod.object({
|
||||
"value": zod.enum(['looking', 'not_looking']).describe('Whether the candidate says they are searching for work. The status is a statement, never a consent: it publishes nothing, hides nothing, and grants nothing, and no value of it changes the C2 consent, the publication, or the hidden organizations.\n\n- looking: the candidate is searching ("Ищу"). It holds only while it is confirmed in time; see `SearchStatus.lapsed`.\n- not_looking: the candidate is not announcing a search. It is the state of every new account and the state to which a lapsed status falls.').describe('The status that holds now: `looking` only while the confirmation has not lapsed.'),
|
||||
"lapsed": zod.boolean().describe('True when the candidate set `looking`, did not confirm it again, and the interval ended, so `value` is `not_looking`. False otherwise, including a status the candidate cleared.'),
|
||||
"confirmed_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Moment of the latest confirmation of `looking`, or null when the candidate never set it or cleared it.'),
|
||||
"lapses_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Moment at which the confirmed status lapses, fixed when it was confirmed from the `search_status` section of the product policy version in force then, or null when `confirmed_at` is null. A later policy change does not move it; it stays in the past for a lapsed status.'),
|
||||
"version": zod.int().min(privacySettingsSearchStatusVersionMin).describe('Version of the search status of the candidate. A candidate who never set the status has version 0 and the status `not_looking`; every confirmation or change advances it by one. The client sends the version it read as `expected_version`.')
|
||||
}).describe('Search status of the candidate as it holds now. The status `looking` stores the moment of its confirmation and lapses when the confirmation interval of the product policy passes without a new confirmation. A lapse only ever narrows: the status falls to `not_looking`, which is the non-public state, and a lapse never changes the publication or the hidden organizations. It needs no stored change, so no process can make a candidate more visible by expiry, and a lapsed candidate confirms again explicitly.'),
|
||||
"hidden_organizations_total": zod.int().min(privacySettingsHiddenOrganizationsTotalMin).max(privacySettingsHiddenOrganizationsTotalMax).describe('Number of organizations that the candidate hides the profile from. The list is read with `ListMyHiddenOrganizations`.')
|
||||
}).describe('The visibility settings of the current candidate in one read: the publication, the search status, and the number of hidden organizations. The three are independent: each has its own version and its own operation, and a change of one leaves the others as they were. A new account reads a closed profile, `not_looking`, and no hidden organization.')
|
||||
|
||||
export type PrivacySettings = zod.input<typeof PrivacySettings>;
|
||||
export type PrivacySettingsOutput = zod.output<typeof PrivacySettings>;
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const publicationFieldsOneMin = 0;
|
||||
export const publicationFieldsOneMax = 6;
|
||||
|
||||
export const publicationVersionMin = 0;
|
||||
|
||||
|
||||
export const Publication = zod.object({
|
||||
"state": zod.enum(['closed', 'published']).describe('Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.\n\n- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.\n- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.'),
|
||||
"closed_reason": zod.union([zod.enum(['never_published', 'closed_by_candidate', 'consent_revoked']).describe('Why a closed profile is closed, shown only to the candidate.\n\n- never_published: the candidate has never published the profile.\n- closed_by_candidate: the candidate closed the publication.\n- consent_revoked: the C2 consent that backed the publication was revoked. A later C2 grant never reopens the publication; the candidate publishes again explicitly and the new publication refers to the new consent record.'),zod.null()]).describe('Why the profile is closed, or null while it is published.'),
|
||||
"fields": zod.array(zod.enum(['categories', 'stack', 'experience', 'soft_skills', 'location', 'relocation']).describe('A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.\n\n- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.\n- stack: the technology tags of the profile.\n- experience: the total months of work experience, without employers, periods, or descriptions.\n- soft_skills: the soft skills of the profile.\n- location: the city or region of the profile.\n- relocation: whether the candidate is ready to relocate.\n\nOnly values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.\n\nAdding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.')).min(publicationFieldsOneMin).max(publicationFieldsOneMax).describe('Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.').describe('Card fields that organizations may read. Empty exactly when `state` is `closed`.'),
|
||||
"consent_id": zod.union([zod.uuid(),zod.null()]).describe('Identifier of the C2 record of the consent ledger that backs the current or the last publication, the `id` of a `ConsentRecord` of this account, or null when the profile was never published.'),
|
||||
"published_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Moment of the latest change that published or republished the card, or null while the profile was never published. It stays after a closing, as the time of the last publication.'),
|
||||
"version": zod.int().min(publicationVersionMin).describe('Version of the publication setting of the candidate. A candidate who has never published has version 0 and the profile is closed; every change that alters the setting advances it by one. The client sends the version it read as `expected_version`. It is independent of the versions of the profile and of the search status, so a change of one never makes another stale.')
|
||||
}).describe('Publication setting of the candidate card. It is separate from the consent: the C2 consent in the ledger proves that the candidate accepted the publication text, and this setting records whether and which fields are published. `state` is `published` only while the referenced C2 record is unrevoked, whatever the stored setting says, so a revocation closes the card at once. The state, the fields, and the times belong to the history that the C2 consent record does not carry.')
|
||||
|
||||
export type Publication = zod.input<typeof Publication>;
|
||||
export type PublicationOutput = zod.output<typeof Publication>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const PublicationClosedReason = zod.enum(['never_published', 'closed_by_candidate', 'consent_revoked']).describe('Why a closed profile is closed, shown only to the candidate.\n\n- never_published: the candidate has never published the profile.\n- closed_by_candidate: the candidate closed the publication.\n- consent_revoked: the C2 consent that backed the publication was revoked. A later C2 grant never reopens the publication; the candidate publishes again explicitly and the new publication refers to the new consent record.')
|
||||
|
||||
export type PublicationClosedReason = zod.input<typeof PublicationClosedReason>;
|
||||
export type PublicationClosedReasonOutput = zod.output<typeof PublicationClosedReason>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const PublicationState = zod.enum(['closed', 'published']).describe('Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.\n\n- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.\n- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.')
|
||||
|
||||
export type PublicationState = zod.input<typeof PublicationState>;
|
||||
export type PublicationStateOutput = zod.output<typeof PublicationState>;
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const publicationUpdateExpectedVersionMin = 0;
|
||||
|
||||
export const publicationUpdateFieldsMin = 0;
|
||||
export const publicationUpdateFieldsMax = 6;
|
||||
|
||||
|
||||
export const PublicationUpdate = zod.object({
|
||||
"expected_version": zod.int().min(publicationUpdateExpectedVersionMin).describe('Version of the publication setting of the candidate. A candidate who has never published has version 0 and the profile is closed; every change that alters the setting advances it by one. The client sends the version it read as `expected_version`. It is independent of the versions of the profile and of the search status, so a change of one never makes another stale.'),
|
||||
"state": zod.enum(['closed', 'published']).describe('Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.\n\n- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.\n- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.'),
|
||||
"fields": zod.array(zod.enum(['categories', 'stack', 'experience', 'soft_skills', 'location', 'relocation']).describe('A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.\n\n- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.\n- stack: the technology tags of the profile.\n- experience: the total months of work experience, without employers, periods, or descriptions.\n- soft_skills: the soft skills of the profile.\n- location: the city or region of the profile.\n- relocation: whether the candidate is ready to relocate.\n\nOnly values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.\n\nAdding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.')).min(publicationUpdateFieldsMin).max(publicationUpdateFieldsMax).describe('Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.')
|
||||
}).describe('The complete new publication setting. `published` needs a non-empty set of fields and an active C2 consent of the account; `closed` needs an empty set and never fails for a missing consent. The body names no consent: the server binds the publication to the account\'s current unrevoked C2 record, and a client can neither supply nor forge one.')
|
||||
|
||||
export type PublicationUpdate = zod.input<typeof PublicationUpdate>;
|
||||
export type PublicationUpdateOutput = zod.output<typeof PublicationUpdate>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const PublicationVersionMin = 0;
|
||||
|
||||
|
||||
export const PublicationVersion = zod.int().min(PublicationVersionMin).describe('Version of the publication setting of the candidate. A candidate who has never published has version 0 and the profile is closed; every change that alters the setting advances it by one. The client sends the version it read as `expected_version`. It is independent of the versions of the profile and of the search status, so a change of one never makes another stale.')
|
||||
|
||||
export type PublicationVersion = zod.input<typeof PublicationVersion>;
|
||||
export type PublicationVersionOutput = zod.output<typeof PublicationVersion>;
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const searchStatusVersionMin = 0;
|
||||
|
||||
|
||||
export const SearchStatus = zod.object({
|
||||
"value": zod.enum(['looking', 'not_looking']).describe('Whether the candidate says they are searching for work. The status is a statement, never a consent: it publishes nothing, hides nothing, and grants nothing, and no value of it changes the C2 consent, the publication, or the hidden organizations.\n\n- looking: the candidate is searching ("Ищу"). It holds only while it is confirmed in time; see `SearchStatus.lapsed`.\n- not_looking: the candidate is not announcing a search. It is the state of every new account and the state to which a lapsed status falls.').describe('The status that holds now: `looking` only while the confirmation has not lapsed.'),
|
||||
"lapsed": zod.boolean().describe('True when the candidate set `looking`, did not confirm it again, and the interval ended, so `value` is `not_looking`. False otherwise, including a status the candidate cleared.'),
|
||||
"confirmed_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Moment of the latest confirmation of `looking`, or null when the candidate never set it or cleared it.'),
|
||||
"lapses_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Moment at which the confirmed status lapses, fixed when it was confirmed from the `search_status` section of the product policy version in force then, or null when `confirmed_at` is null. A later policy change does not move it; it stays in the past for a lapsed status.'),
|
||||
"version": zod.int().min(searchStatusVersionMin).describe('Version of the search status of the candidate. A candidate who never set the status has version 0 and the status `not_looking`; every confirmation or change advances it by one. The client sends the version it read as `expected_version`.')
|
||||
}).describe('Search status of the candidate as it holds now. The status `looking` stores the moment of its confirmation and lapses when the confirmation interval of the product policy passes without a new confirmation. A lapse only ever narrows: the status falls to `not_looking`, which is the non-public state, and a lapse never changes the publication or the hidden organizations. It needs no stored change, so no process can make a candidate more visible by expiry, and a lapsed candidate confirms again explicitly.')
|
||||
|
||||
export type SearchStatus = zod.input<typeof SearchStatus>;
|
||||
export type SearchStatusOutput = zod.output<typeof SearchStatus>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const searchStatusUpdateExpectedVersionMin = 0;
|
||||
|
||||
|
||||
export const SearchStatusUpdate = zod.object({
|
||||
"expected_version": zod.int().min(searchStatusUpdateExpectedVersionMin).describe('Version of the search status of the candidate. A candidate who never set the status has version 0 and the status `not_looking`; every confirmation or change advances it by one. The client sends the version it read as `expected_version`.'),
|
||||
"value": zod.enum(['looking', 'not_looking']).describe('Whether the candidate says they are searching for work. The status is a statement, never a consent: it publishes nothing, hides nothing, and grants nothing, and no value of it changes the C2 consent, the publication, or the hidden organizations.\n\n- looking: the candidate is searching ("Ищу"). It holds only while it is confirmed in time; see `SearchStatus.lapsed`.\n- not_looking: the candidate is not announcing a search. It is the state of every new account and the state to which a lapsed status falls.')
|
||||
}).describe('The complete new search status. `looking` is also the confirmation of a status that still holds or has lapsed: it sets the confirmation time to now. The body carries no time, interval, or policy version; the server takes them from the effective product policy.')
|
||||
|
||||
export type SearchStatusUpdate = zod.input<typeof SearchStatusUpdate>;
|
||||
export type SearchStatusUpdateOutput = zod.output<typeof SearchStatusUpdate>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SearchStatusValue = zod.enum(['looking', 'not_looking']).describe('Whether the candidate says they are searching for work. The status is a statement, never a consent: it publishes nothing, hides nothing, and grants nothing, and no value of it changes the C2 consent, the publication, or the hidden organizations.\n\n- looking: the candidate is searching ("Ищу"). It holds only while it is confirmed in time; see `SearchStatus.lapsed`.\n- not_looking: the candidate is not announcing a search. It is the state of every new account and the state to which a lapsed status falls.')
|
||||
|
||||
export type SearchStatusValue = zod.input<typeof SearchStatusValue>;
|
||||
export type SearchStatusValueOutput = zod.output<typeof SearchStatusValue>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SearchStatusVersionMin = 0;
|
||||
|
||||
|
||||
export const SearchStatusVersion = zod.int().min(SearchStatusVersionMin).describe('Version of the search status of the candidate. A candidate who never set the status has version 0 and the status `not_looking`; every confirmation or change advances it by one. The client sends the version it read as `expected_version`.')
|
||||
|
||||
export type SearchStatusVersion = zod.input<typeof SearchStatusVersion>;
|
||||
export type SearchStatusVersionOutput = zod.output<typeof SearchStatusVersion>;
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const setMyPublicationBodyExpectedVersionMin = 0;
|
||||
|
||||
export const setMyPublicationBodyFieldsMin = 0;
|
||||
export const setMyPublicationBodyFieldsMax = 6;
|
||||
|
||||
|
||||
export const SetMyPublicationBody = zod.object({
|
||||
"expected_version": zod.int().min(setMyPublicationBodyExpectedVersionMin).describe('Version of the publication setting of the candidate. A candidate who has never published has version 0 and the profile is closed; every change that alters the setting advances it by one. The client sends the version it read as `expected_version`. It is independent of the versions of the profile and of the search status, so a change of one never makes another stale.'),
|
||||
"state": zod.enum(['closed', 'published']).describe('Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.\n\n- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.\n- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.'),
|
||||
"fields": zod.array(zod.enum(['categories', 'stack', 'experience', 'soft_skills', 'location', 'relocation']).describe('A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.\n\n- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.\n- stack: the technology tags of the profile.\n- experience: the total months of work experience, without employers, periods, or descriptions.\n- soft_skills: the soft skills of the profile.\n- location: the city or region of the profile.\n- relocation: whether the candidate is ready to relocate.\n\nOnly values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.\n\nAdding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.')).min(setMyPublicationBodyFieldsMin).max(setMyPublicationBodyFieldsMax).describe('Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.')
|
||||
}).describe('The complete new publication setting. `published` needs a non-empty set of fields and an active C2 consent of the account; `closed` needs an empty set and never fails for a missing consent. The body names no consent: the server binds the publication to the account\'s current unrevoked C2 record, and a client can neither supply nor forge one.')
|
||||
|
||||
export type SetMyPublicationBody = zod.input<typeof SetMyPublicationBody>;
|
||||
export type SetMyPublicationBodyOutput = zod.output<typeof SetMyPublicationBody>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const setMySearchStatusBodyExpectedVersionMin = 0;
|
||||
|
||||
|
||||
export const SetMySearchStatusBody = zod.object({
|
||||
"expected_version": zod.int().min(setMySearchStatusBodyExpectedVersionMin).describe('Version of the search status of the candidate. A candidate who never set the status has version 0 and the status `not_looking`; every confirmation or change advances it by one. The client sends the version it read as `expected_version`.'),
|
||||
"value": zod.enum(['looking', 'not_looking']).describe('Whether the candidate says they are searching for work. The status is a statement, never a consent: it publishes nothing, hides nothing, and grants nothing, and no value of it changes the C2 consent, the publication, or the hidden organizations.\n\n- looking: the candidate is searching ("Ищу"). It holds only while it is confirmed in time; see `SearchStatus.lapsed`.\n- not_looking: the candidate is not announcing a search. It is the state of every new account and the state to which a lapsed status falls.')
|
||||
}).describe('The complete new search status. `looking` is also the confirmation of a status that still holds or has lapsed: it sets the confirmation time to now. The body carries no time, interval, or policy version; the server takes them from the effective product policy.')
|
||||
|
||||
export type SetMySearchStatusBody = zod.input<typeof SetMySearchStatusBody>;
|
||||
export type SetMySearchStatusBodyOutput = zod.output<typeof SetMySearchStatusBody>;
|
||||
@@ -45,9 +45,9 @@ export const Problem = zod.object({
|
||||
"errors": zod.array(zod.object({
|
||||
"in": zod.enum(['body', 'query', 'path', 'header', 'cookie']).describe('Part of the request that contains the invalid field.'),
|
||||
"pointer": zod.string().max(problemErrorsItemPointerMax).regex(problemErrorsItemPointerRegExp).describe('JSON Pointer (RFC 6901). For `body` it points into the request body document, for example `/salary_from`; an empty string means the whole body. For a parameter it is `/` followed by the parameter name, for example `/limit` or `/Idempotency-Key`.'),
|
||||
"code": zod.string().min(1).max(problemErrorsItemCodeMax).regex(problemErrorsItemCodeRegExp).describe('Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema). Clients must tolerate new values.'),
|
||||
"code": zod.string().min(1).max(problemErrorsItemCodeMax).regex(problemErrorsItemCodeRegExp).describe('Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema), and, on a state_conflict, `consent_required` (the operation needs a consent that is not active) and `limit_reached` (a per-account bound is reached). Clients must tolerate new values.'),
|
||||
"message": zod.string().min(1).max(problemErrorsItemMessageMax).describe('Fixed English message that never echoes the submitted value.')
|
||||
}).describe('One reason why a request field or parameter is invalid.')).max(problemErrorsMax).exactOptional().describe('Field-level reasons for validation_failed. Other codes omit it.')
|
||||
}).describe('One reason why a request field or parameter is invalid.')).max(problemErrorsMax).exactOptional().describe('Field-level reasons. validation_failed always carries them; state_conflict may carry one as a disambiguator when one code covers several conflicts (for example consent_required and limit_reached). Other codes omit it. A problem writer must not strip errors from a non-validation response.')
|
||||
}).describe('Problem details (RFC 9457) returned with the application/problem+json media type for every error response. `code` is the stable, machine-readable reason; clients branch on it rather than on `title`, `detail`, or the HTTP status alone. The body never contains internal error text, stack traces, SQL, file paths, credentials, contact data, or echoed request values.')
|
||||
|
||||
export type Problem = zod.input<typeof Problem>;
|
||||
|
||||
@@ -20,7 +20,7 @@ export const problemFieldErrorMessageMax = 500;
|
||||
export const ProblemFieldError = zod.object({
|
||||
"in": zod.enum(['body', 'query', 'path', 'header', 'cookie']).describe('Part of the request that contains the invalid field.'),
|
||||
"pointer": zod.string().max(problemFieldErrorPointerMax).regex(problemFieldErrorPointerRegExp).describe('JSON Pointer (RFC 6901). For `body` it points into the request body document, for example `/salary_from`; an empty string means the whole body. For a parameter it is `/` followed by the parameter name, for example `/limit` or `/Idempotency-Key`.'),
|
||||
"code": zod.string().min(1).max(problemFieldErrorCodeMax).regex(problemFieldErrorCodeRegExp).describe('Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema). Clients must tolerate new values.'),
|
||||
"code": zod.string().min(1).max(problemFieldErrorCodeMax).regex(problemFieldErrorCodeRegExp).describe('Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema), and, on a state_conflict, `consent_required` (the operation needs a consent that is not active) and `limit_reached` (a per-account bound is reached). Clients must tolerate new values.'),
|
||||
"message": zod.string().min(1).max(problemFieldErrorMessageMax).describe('Fixed English message that never echoes the submitted value.')
|
||||
}).describe('One reason why a request field or parameter is invalid.')
|
||||
|
||||
|
||||
File renamed without changes.
Reference in new issue
Block a user