feat: add assessment, privacy and support flows
This commit is contained in:
1 parent
ee3738ee73
commit
e4f24fa202
339 files changed
+56454
-1126
No files matched your search
@@ -138,6 +138,50 @@ describe("apiRequest", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("retains a valid Retry-After integer without retaining response headers", async () => {
|
||||
vi.stubGlobal(
|
||||
"fetch",
|
||||
vi.fn().mockResolvedValue(
|
||||
new Response(JSON.stringify({ code: "rate_limited" }), {
|
||||
status: 429,
|
||||
headers: {
|
||||
"content-type": "application/problem+json",
|
||||
"retry-after": "17",
|
||||
},
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const caught: unknown = await apiRequest("/healthz").catch((error: unknown) => error);
|
||||
|
||||
expect(caught).toBeInstanceOf(ApiRequestError);
|
||||
expect(caught).toMatchObject({ status: 429, retryAfterSeconds: 17 });
|
||||
expect(caught).not.toHaveProperty("headers");
|
||||
});
|
||||
|
||||
it.each([undefined, "", "1.5", "-1", "Wed, 21 Oct 2015 07:28:00 GMT", "9007199254740992"])(
|
||||
"omits invalid or missing Retry-After value %s",
|
||||
async (retryAfter) => {
|
||||
const headers: Record<string, string> = { "content-type": "application/problem+json" };
|
||||
if (retryAfter !== undefined) {
|
||||
headers["retry-after"] = retryAfter;
|
||||
}
|
||||
vi.stubGlobal(
|
||||
"fetch",
|
||||
vi
|
||||
.fn()
|
||||
.mockResolvedValue(
|
||||
new Response(JSON.stringify({ code: "rate_limited" }), { status: 429, headers }),
|
||||
),
|
||||
);
|
||||
|
||||
await expect(apiRequest("/healthz")).rejects.toMatchObject({
|
||||
status: 429,
|
||||
retryAfterSeconds: undefined,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
{
|
||||
name: "a JSON body that is not a problem",
|
||||
|
||||
@@ -27,6 +27,7 @@ type ApiRequestErrorInit = {
|
||||
detail?: string | undefined;
|
||||
traceId?: string | undefined;
|
||||
fieldErrors?: readonly ProblemFieldError[] | undefined;
|
||||
retryAfterSeconds?: number | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -40,6 +41,7 @@ export class ApiRequestError extends Error {
|
||||
readonly detail: string | undefined;
|
||||
readonly traceId: string | undefined;
|
||||
readonly fieldErrors: readonly ProblemFieldError[];
|
||||
readonly retryAfterSeconds: number | undefined;
|
||||
|
||||
constructor(init: ApiRequestErrorInit) {
|
||||
super(init.detail ?? init.title);
|
||||
@@ -50,6 +52,7 @@ export class ApiRequestError extends Error {
|
||||
this.detail = init.detail;
|
||||
this.traceId = init.traceId;
|
||||
this.fieldErrors = init.fieldErrors ?? [];
|
||||
this.retryAfterSeconds = init.retryAfterSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,8 +97,18 @@ function isProblemResponse(response: Response): boolean {
|
||||
return mediaType === problemMediaType;
|
||||
}
|
||||
|
||||
function retryAfterSeconds(response: Response): number | undefined {
|
||||
const value = response.headers.get("retry-after");
|
||||
if (value === null || !/^\d+$/.test(value)) {
|
||||
return undefined;
|
||||
}
|
||||
const seconds = Number(value);
|
||||
return Number.isSafeInteger(seconds) ? seconds : undefined;
|
||||
}
|
||||
|
||||
async function toApiError(response: Response): Promise<ApiRequestError> {
|
||||
const headerTraceId = response.headers.get(requestIdHeader) ?? undefined;
|
||||
const retryAfter = retryAfterSeconds(response);
|
||||
|
||||
if (isProblemResponse(response)) {
|
||||
const body: unknown = await response.json().catch(() => undefined);
|
||||
@@ -109,6 +122,7 @@ async function toApiError(response: Response): Promise<ApiRequestError> {
|
||||
detail: problem.detail,
|
||||
traceId: problem.trace_id ?? headerTraceId,
|
||||
fieldErrors: problem.errors,
|
||||
retryAfterSeconds: retryAfter,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -118,6 +132,7 @@ async function toApiError(response: Response): Promise<ApiRequestError> {
|
||||
code: unknownErrorCode,
|
||||
title: `Request failed with status ${response.status}.`,
|
||||
traceId: headerTraceId,
|
||||
retryAfterSeconds: retryAfter,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import type {
|
||||
AssessmentQualifiedResult,
|
||||
AssessmentResult,
|
||||
AssessmentSessions,
|
||||
AssessmentSignalReceipt,
|
||||
AssessmentUncertainty,
|
||||
BasicScore,
|
||||
ChoiceItemContent,
|
||||
@@ -131,6 +132,8 @@ export const getStartMyAssessmentAttemptSessionResponseAssessmentExpressAttemptM
|
||||
|
||||
export const getStartMyAssessmentAttemptSessionResponseMock = (): AssessmentAttempt => (faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponseAssessmentQualifiedAttemptMock()},{...getStartMyAssessmentAttemptSessionResponseAssessmentCorrectiveAttemptMock()},{...getStartMyAssessmentAttemptSessionResponseAssessmentExpressAttemptMock()},]))
|
||||
|
||||
export const getRecordMyAssessmentAttemptSignalsResponseMock = (overrideResponse: Partial<Extract<AssessmentSignalReceipt, object>> = {}): AssessmentSignalReceipt => ({status: faker.helpers.arrayElement(['accepted','saturated'] as const), accepted_events: faker.number.int({min: 0, max: 50}), received_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...overrideResponse})
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseAssessmentSessionsMock = (overrideResponse: Partial<AssessmentSessions> = {}): AssessmentSessions => ({...{used: faker.number.int({min: 1, max: 10}), max: faker.number.int({min: 1, max: 10}), idle_timeout_seconds: faker.number.int({min: 60, max: 86400})}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseChoiceItemContentMock = (overrideResponse: Partial<ChoiceItemContent> = {}): ChoiceItemContent => ({...{format: faker.helpers.arrayElement(['choice'] as const), options: Array.from({ length: faker.number.int({min: 2, max: 10}) }, (_, i) => i + 1).map(() => ({id: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 32}), text: faker.string.alpha({length: {min: 1, max: 2000}})})), multiple: faker.datatype.boolean()}, ...overrideResponse});
|
||||
@@ -248,6 +251,18 @@ export const getStartMyAssessmentAttemptSessionMockHandler = (overrideResponse?:
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getRecordMyAssessmentAttemptSignalsMockHandler = (overrideResponse?: AssessmentSignalReceipt | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<AssessmentSignalReceipt> | AssessmentSignalReceipt), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/assessment-attempts/:attemptId/signals', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getRecordMyAssessmentAttemptSignalsResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getSubmitMyAssessmentAnswerMockHandler = (overrideResponse?: AssessmentAttempt | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<AssessmentAttempt> | AssessmentAttempt), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/assessment-attempts/:attemptId/answers', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
@@ -288,6 +303,7 @@ export const getAssessmentMock = () => [
|
||||
getCreateMyAssessmentAttemptMockHandler(),
|
||||
getGetMyAssessmentAttemptMockHandler(),
|
||||
getStartMyAssessmentAttemptSessionMockHandler(),
|
||||
getRecordMyAssessmentAttemptSignalsMockHandler(),
|
||||
getSubmitMyAssessmentAnswerMockHandler(),
|
||||
getFinalizeMyAssessmentAttemptMockHandler(),
|
||||
getGetMyAssessmentResultMockHandler()
|
||||
|
||||
@@ -30,10 +30,14 @@ import type {
|
||||
AssessmentAttemptSessionStart,
|
||||
AssessmentAvailability,
|
||||
AssessmentFinalization,
|
||||
AssessmentFinalizeConflictProblem,
|
||||
AssessmentResult,
|
||||
AssessmentSignalBatch,
|
||||
AssessmentSignalReceipt,
|
||||
CreateMyAssessmentAttemptHeaders,
|
||||
FinalizeMyAssessmentAttemptHeaders,
|
||||
Problem,
|
||||
RecordMyAssessmentAttemptSignalsHeaders,
|
||||
StartMyAssessmentAttemptSessionHeaders,
|
||||
SubmitMyAssessmentAnswerHeaders
|
||||
} from '../../schemas';
|
||||
@@ -464,6 +468,100 @@ export const useStartMyAssessmentAttemptSession = <TError = ErrorType<Problem>,
|
||||
> => {
|
||||
return useMutation(getStartMyAssessmentAttemptSessionMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getRecordMyAssessmentAttemptSignalsUrl = (attemptId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/assessment-attempts/${attemptId}/signals`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires a candidate session, its CSRF token in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The attempt must belong to the candidate, be a real root or corrective attempt, remain active, and have a current C3 consent. The server locks C3 before locking the attempt, checks every item_instance_id against that attempt, and commits the receipt and any events in one transaction. A terminal, expired, or demo_express attempt accepts no new evidence; demo_express remains a separate training mode and receives no signal storage or grade effect.
|
||||
*
|
||||
* The contract accepts only focus-loss duration, copy/paste/cut byte counts, fullscreen exits, item identifiers, and untrusted client timestamps. It never accepts answer text, clipboard contents, arbitrary strings, camera, microphone, screen recordings, screenshots, or organization identifiers. Client timestamps must be within five minutes before attempt creation and five minutes after the database receipt clock. Server receipt time controls rolling rate limits. Signal events are removed with the assessment attempt or account; this release does not promise an independent expiry schedule. Signals do not change scores, categories, quotas, or candidate/employer result responses.
|
||||
*
|
||||
* A batch has at most 50 events and the raw request body is limited to 32 KiB before decoding. At most 30 new receipts per candidate and attempt are accepted in a rolling minute; an over-limit request answers 429 and does not consume its idempotency key. Storage is capped at 10,000 events per attempt. If the whole batch would exceed that cap, the server stores no events from it and replays a `saturated` receipt. Repeating the same key and body within 24 hours returns the original receipt without storing another batch; using that key with another body answers 422.
|
||||
* @summary Store a bounded batch of client-reported assessment signals.
|
||||
*/
|
||||
export const recordMyAssessmentAttemptSignals = async (attemptId: string,
|
||||
assessmentSignalBatch: AssessmentSignalBatch,
|
||||
headers: RecordMyAssessmentAttemptSignalsHeaders, options?: Parameters<typeof apiRequest>[1]): Promise<AssessmentSignalReceipt> => {
|
||||
|
||||
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<AssessmentSignalReceipt>(getRecordMyAssessmentAttemptSignalsUrl(attemptId),
|
||||
{
|
||||
...options,
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json',...headers, ...getHeaders(options?.headers) },
|
||||
body: JSON.stringify(assessmentSignalBatch)
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getRecordMyAssessmentAttemptSignalsMutationKey = () => ['recordMyAssessmentAttemptSignals'] as const;
|
||||
|
||||
export const getRecordMyAssessmentAttemptSignalsMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof recordMyAssessmentAttemptSignals>>, TError,RecordMyAssessmentAttemptSignalsMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof recordMyAssessmentAttemptSignals>>, TError,RecordMyAssessmentAttemptSignalsMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getRecordMyAssessmentAttemptSignalsMutationKey();
|
||||
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 recordMyAssessmentAttemptSignals>>, RecordMyAssessmentAttemptSignalsMutationVariables> = (props) => {
|
||||
const {attemptId,data,headers} = props ?? {};
|
||||
|
||||
return recordMyAssessmentAttemptSignals(attemptId,data,headers,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type RecordMyAssessmentAttemptSignalsMutationResult = NonNullable<Awaited<ReturnType<typeof recordMyAssessmentAttemptSignals>>>
|
||||
export type RecordMyAssessmentAttemptSignalsMutationBody = AssessmentSignalBatch
|
||||
export type RecordMyAssessmentAttemptSignalsMutationError = ErrorType<Problem>
|
||||
export type RecordMyAssessmentAttemptSignalsMutationVariables = {attemptId: string;data: AssessmentSignalBatch;headers: RecordMyAssessmentAttemptSignalsHeaders}
|
||||
|
||||
/**
|
||||
* @summary Store a bounded batch of client-reported assessment signals.
|
||||
*/
|
||||
export const useRecordMyAssessmentAttemptSignals = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof recordMyAssessmentAttemptSignals>>, TError,RecordMyAssessmentAttemptSignalsMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof recordMyAssessmentAttemptSignals>>,
|
||||
TError,
|
||||
RecordMyAssessmentAttemptSignalsMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getRecordMyAssessmentAttemptSignalsMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getSubmitMyAssessmentAnswerUrl = (attemptId: string,) => {
|
||||
|
||||
|
||||
@@ -590,7 +688,7 @@ export const useSubmitMyAssessmentAnswer = <TError = ErrorType<Problem>,
|
||||
*
|
||||
* A failed attempt never lowers a confirmed grade. Repeats return the same outcome: a retry with the same Idempotency-Key replays the stored response, and a finalize of a `completed` attempt answers 200 with that attempt even with a new key or an older `expected_version`; the result is computed once. When `expires_at` passes or the session limit is reached, a command or background transition finalizes `ready_to_finalize` without offering an additional practice. A finalize after this transition answers 200 with the stored `completed` attempt; a GET never commits it.
|
||||
*
|
||||
* An attempt in `in_progress` or `practice_pending`, one with a practice verdict `pending`, or one that ended as `expired` or `insufficient_bank` answers 409 state_conflict. The problem does not list what is unfinished; the attempt shows it in `state`, `progress`, `current_item`, and `practices`. A stale `expected_version` answers 412 version_conflict, the repository status for a stale version.
|
||||
* An attempt in `in_progress` or `practice_pending`, one with a practice verdict `pending`, or one that ended as `expired` or `insufficient_bank` answers 409 state_conflict. When required questions are unfinished, the problem includes their frozen IDs in `pending_item_ids`; other state conflicts omit that field. A stale `expected_version` answers 412 version_conflict, the repository status for a stale version.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden), the Idempotency-Key (422, 409 idempotency_in_progress, replay), the attempt (404 not_found; a due deadline transition may be committed, but this request never starts a work session), the repeat on a `completed` attempt (200), the version (412), then the state (409 state_conflict, including an ended idle session). 404 and 409 state_conflict are stored under the key; 400 and 412 are not.
|
||||
* @summary Ask for the grade decision of an assessment attempt.
|
||||
@@ -628,7 +726,7 @@ return apiRequest<AssessmentAttempt>(getFinalizeMyAssessmentAttemptUrl(attemptId
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptMutationKey = () => ['finalizeMyAssessmentAttempt'] as const;
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptMutationOptions = <TError = ErrorType<Problem>,
|
||||
export const getFinalizeMyAssessmentAttemptMutationOptions = <TError = ErrorType<Problem | AssessmentFinalizeConflictProblem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>, TError,FinalizeMyAssessmentAttemptMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>, TError,FinalizeMyAssessmentAttemptMutationVariables, TContext> => {
|
||||
|
||||
@@ -657,13 +755,13 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
|
||||
export type FinalizeMyAssessmentAttemptMutationResult = NonNullable<Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>>
|
||||
export type FinalizeMyAssessmentAttemptMutationBody = AssessmentFinalization
|
||||
export type FinalizeMyAssessmentAttemptMutationError = ErrorType<Problem>
|
||||
export type FinalizeMyAssessmentAttemptMutationError = ErrorType<Problem | AssessmentFinalizeConflictProblem>
|
||||
export type FinalizeMyAssessmentAttemptMutationVariables = {attemptId: string;data: AssessmentFinalization;headers: FinalizeMyAssessmentAttemptHeaders}
|
||||
|
||||
/**
|
||||
* @summary Ask for the grade decision of an assessment attempt.
|
||||
*/
|
||||
export const useFinalizeMyAssessmentAttempt = <TError = ErrorType<Problem>,
|
||||
export const useFinalizeMyAssessmentAttempt = <TError = ErrorType<Problem | AssessmentFinalizeConflictProblem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>, TError,FinalizeMyAssessmentAttemptMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>,
|
||||
|
||||
@@ -37,7 +37,7 @@ import type {
|
||||
|
||||
export const getListOrganizationInvitationsResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
export const getListOrganizationInvitationsResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitationList, object>> = {}): OrganizationInvitationList => ({items: Array.from({ length: faker.number.int({min: 1, max: 100}) }, (_, i) => i + 1).map(() => ({id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getListOrganizationInvitationsResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_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 getListOrganizationInvitationsResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitationList, object>> = {}): OrganizationInvitationList => ({items: Array.from({ length: faker.number.int({min: 1, max: 100}) }, (_, i) => i + 1).map(() => ({id: faker.string.uuid(), candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), need: faker.helpers.arrayElement([{...getListOrganizationInvitationsResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_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 getCreateOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
@@ -45,7 +45,7 @@ export const getCreateOrganizationInvitationResponseInvitationPackageItemProvide
|
||||
|
||||
export const getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getCreateOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
export const getCreateOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), need: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getGetOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
@@ -53,7 +53,7 @@ export const getGetOrganizationInvitationResponseInvitationPackageItemProvidedMo
|
||||
|
||||
export const getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getGetOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
export const getGetOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), need: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getUpdateOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
@@ -61,7 +61,7 @@ export const getUpdateOrganizationInvitationResponseInvitationPackageItemProvide
|
||||
|
||||
export const getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getUpdateOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
export const getUpdateOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), need: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getSendOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
@@ -69,7 +69,7 @@ export const getSendOrganizationInvitationResponseInvitationPackageItemProvidedM
|
||||
|
||||
export const getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getSendOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
export const getSendOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), need: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getRaiseOrganizationInvitationSalaryResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
@@ -77,7 +77,7 @@ export const getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemPr
|
||||
|
||||
export const getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getRaiseOrganizationInvitationSalaryResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
export const getRaiseOrganizationInvitationSalaryResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), need: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getWithdrawOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
@@ -85,7 +85,7 @@ export const getWithdrawOrganizationInvitationResponseInvitationPackageItemProvi
|
||||
|
||||
export const getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getWithdrawOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
export const getWithdrawOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), need: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), 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), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getGetOrganizationInvitationContactsResponseMock = (overrideResponse: Partial<Extract<ContactDisclosure, object>> = {}): ContactDisclosure => ({invitation_id: faker.string.uuid(), grant_id: faker.string.uuid(), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const), granted_at: faker.date.past().toISOString().slice(0, 19) + 'Z', full_name: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}),null,]), email: faker.helpers.arrayElement([faker.internet.email(),null,]), phone: faker.helpers.arrayElement([fakeFromPattern("^\\+[1-9][0-9]{6,14}$", {minLength: 8, maxLength: 16}),null,]), telegram: faker.helpers.arrayElement([fakeFromPattern("^@[A-Za-z0-9_]{5,32}$", {minLength: 6, maxLength: 33}),null,]), ...overrideResponse})
|
||||
|
||||
|
||||
@@ -34,13 +34,15 @@ import type {
|
||||
} 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 getGetOrganizationCandidateCardResponseMock = (overrideResponse: Partial<Extract<AnonymousCardContent, object>> = {}): AnonymousCardContent => ({pseudonym: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), 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), strength: faker.helpers.arrayElement(['standard','strong'] as const)})), null]), stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const), null]), self_assessment: 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), confirmation_status: faker.helpers.arrayElement(['confirmed','unconfirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,])})), null]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const), null]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,]), ...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 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','salary_compatibility','self_assessment','stack','experience','soft_skills','location','relocation','work_formats'] 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 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 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','salary_compatibility','self_assessment','stack','experience','soft_skills','location','relocation','work_formats'] 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 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 getGetMyCardPreviewResponseAnonymousCardContentMock = (overrideResponse: Partial<AnonymousCardContent> = {}): AnonymousCardContent => ({...{pseudonym: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), 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), strength: faker.helpers.arrayElement(['standard','strong'] as const)})), null]), stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const), null]), self_assessment: 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), confirmation_status: faker.helpers.arrayElement(['confirmed','unconfirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,])})), null]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const), null]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, ...overrideResponse});
|
||||
|
||||
export const getGetMyCardPreviewResponseMock = (overrideResponse: Partial<Extract<CardPreview, object>> = {}): CardPreview => ({state: faker.helpers.arrayElement(['closed','published'] as const), fields: faker.helpers.arrayElements(['categories','salary_compatibility','self_assessment','stack','experience','soft_skills','location','relocation','work_formats'] 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})
|
||||
|
||||
@@ -50,13 +52,25 @@ export const getHideOrganizationResponseMock = (overrideResponse: Partial<Extrac
|
||||
|
||||
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 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','salary_compatibility','self_assessment','stack','experience','soft_skills','location','relocation','work_formats'] 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 getGetOrganizationCandidateCardMockHandler = (overrideResponse?: AnonymousCardContent | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<AnonymousCardContent> | AnonymousCardContent), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/organizations/:orgId/candidate-cards/:candidateHandle', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetOrganizationCandidateCardResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
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]) => {
|
||||
|
||||
@@ -163,6 +177,7 @@ export const getListMyCardAccessHistoryMockHandler = (overrideResponse?: CardAcc
|
||||
}, options)
|
||||
}
|
||||
export const getPrivacyMock = () => [
|
||||
getGetOrganizationCandidateCardMockHandler(),
|
||||
getGetMyPrivacySettingsMockHandler(),
|
||||
getSetMyPublicationMockHandler(),
|
||||
getGetMyCardPreviewMockHandler(),
|
||||
|
||||
@@ -24,6 +24,7 @@ import type {
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
import type {
|
||||
AnonymousCardContent,
|
||||
CardAccessList,
|
||||
CardPreview,
|
||||
HiddenOrganization,
|
||||
@@ -63,6 +64,123 @@ const withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKe
|
||||
return result;
|
||||
};
|
||||
|
||||
export const getGetOrganizationCandidateCardUrl = (orgId: string,
|
||||
candidateHandle: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/organizations/${orgId}/candidate-cards/${candidateHandle}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of an employer account with an active membership in `org_id`. The organization and membership come from the current server-side session and path, never from cached search data.
|
||||
*
|
||||
* `candidate_handle` is the organization-scoped opaque alias issued by the current anonymous-card projection. The server resolves it against the current visible cohort, rechecks active membership, effective C2 publication, and the candidate's hiding settings on every request, and applies the cohort suppression rules again. It does not use a previously cached candidate ID. An unknown handle, a handle from another organization, a closed or revoked publication, a profile hidden from this organization, and a profile suppressed by the minimum cohort all answer the same 404 not_found.
|
||||
*
|
||||
* The response contains only the anonymous card allowlist. It has no contact values. Contacts, if ever available, are a separate operation and require the current explicit C4 grant and contact-access policy; a workflow status alone never grants contact access. Closing C2 or hiding the profile blocks this read immediately. Republishing does not reopen an earlier contact grant.
|
||||
*
|
||||
* Every allowed employer card read is recorded in the access history and consumes the organization's current product-policy card-view quota. A repeated view within the quota window is allowed by the existing distinct-card quota rule. When the quota is exhausted the operation answers 429 with Retry-After. The response is `Cache-Control: no-store`.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account answers 403 forbidden; an unknown organization or account without an active membership answers 404 not_found. An `org_id` that is not a UUID or a malformed candidate handle answers 400 validation_failed.
|
||||
* @summary Read one currently visible anonymous candidate card.
|
||||
*/
|
||||
export const getOrganizationCandidateCard = async (orgId: string,
|
||||
candidateHandle: string, options?: Parameters<typeof apiRequest>[1]): Promise<AnonymousCardContent> => {
|
||||
|
||||
return apiRequest<AnonymousCardContent>(getGetOrganizationCandidateCardUrl(orgId,candidateHandle),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetOrganizationCandidateCardQueryKey = (orgId: string,
|
||||
candidateHandle: string,) => {
|
||||
return [
|
||||
`/api/v1/organizations/${orgId}/candidate-cards/${candidateHandle}`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetOrganizationCandidateCardQueryOptions = <TData = Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError = ErrorType<Problem>>(orgId: string,
|
||||
candidateHandle: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetOrganizationCandidateCardQueryKey(orgId,candidateHandle);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganizationCandidateCard>>> = ({ signal }) => getOrganizationCandidateCard(orgId,candidateHandle, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: orgId !== null && orgId !== undefined && candidateHandle !== null && candidateHandle !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetOrganizationCandidateCardQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganizationCandidateCard>>>
|
||||
export type GetOrganizationCandidateCardQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useGetOrganizationCandidateCard<TData = Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError = ErrorType<Problem>>(
|
||||
orgId: string,
|
||||
candidateHandle: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getOrganizationCandidateCard>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getOrganizationCandidateCard>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetOrganizationCandidateCard<TData = Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError = ErrorType<Problem>>(
|
||||
orgId: string,
|
||||
candidateHandle: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getOrganizationCandidateCard>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getOrganizationCandidateCard>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetOrganizationCandidateCard<TData = Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError = ErrorType<Problem>>(
|
||||
orgId: string,
|
||||
candidateHandle: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary Read one currently visible anonymous candidate card.
|
||||
*/
|
||||
|
||||
export function useGetOrganizationCandidateCard<TData = Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError = ErrorType<Problem>>(
|
||||
orgId: string,
|
||||
candidateHandle: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateCard>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetOrganizationCandidateCardQueryOptions(orgId,candidateHandle,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetMyPrivacySettingsUrl = () => {
|
||||
|
||||
|
||||
@@ -273,9 +391,11 @@ export const useSetMyPublication = <TError = ErrorType<Problem>,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
* Requires the session cookie of a candidate account. Returns a private preview of the permitted anonymous-card fields from the current profile, publication, and 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.
|
||||
* The preview creates no view or access record and is never shown to an organization. While the profile is closed `card` is null. Its pseudonym uses a separate preview context and is not an organization's pseudonym. Organization-specific visibility filters and cohort checks can further generalize or suppress the card when an organization reads it.
|
||||
*
|
||||
* `card` is the closed `AnonymousCardContent` projection. It reaches no private profile or contact schema and contains no name, email, phone, Telegram name, employer, salary figure, account identifier, or profile identifier. Unpublished or unknown values are null. Only allowed canonical skills and generalized experience are exposed; arbitrary profile text and imported excerpts never appear. `categories` contains only confirmed assessment results. Self-assessed grades and work formats appear only through their separate explicit publication choices, and self-assessment never becomes a confirmed category. Salary compatibility is nullable and contains no salary amount.
|
||||
*
|
||||
* 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.
|
||||
@@ -590,7 +710,7 @@ export const getHideOrganizationUrl = (orgId: string,) => {
|
||||
*
|
||||
* 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.
|
||||
* 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 may name an organization in their own card-access history or an existing hidden-organization record. Invitation visibility will be added with the invitation workflow, and a candidate lookup remains planned. 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.
|
||||
*
|
||||
@@ -869,9 +989,9 @@ export const getListMyCardAccessHistoryUrl = (params?: ListMyCardAccessHistoryPa
|
||||
/**
|
||||
* 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.
|
||||
* 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 retained access record permits the candidate to see the organization's identifier and current name and to hide their profile from it. The nullable organization field is preserved for records whose organization cannot be presented. The entries carry no employee identity, search query, filter, or ranking of the organization. Hiding an organization prevents future reads; it does not erase earlier permitted accesses from the history.
|
||||
*
|
||||
* The storage of accesses is planned with the card and contact operations of the organization side (anonymous card reads and contact reads under the invitation contract); until then the operation answers 501 not_implemented after the session and request checks.
|
||||
* Successful organization card reads are recorded transactionally with the visibility and quota checks. Contact-read records require the invitation grant workflow, which is not implemented yet; an accepted workflow status alone never authorizes contact access.
|
||||
*
|
||||
* 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.
|
||||
|
||||
@@ -62,7 +62,7 @@ const terms = {
|
||||
} as const;
|
||||
|
||||
const draft = {
|
||||
candidate_handle: "cand_7Qm2xVb9Lr4Kp0Zt",
|
||||
candidate_handle: "cv1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
need: { need_id: "01928f7a-2b3c-7d4e-9f5a-6b7c8d9e0f12", requirements_version: 3 },
|
||||
response_period_days: 7,
|
||||
terms,
|
||||
@@ -294,7 +294,7 @@ it("parses an accepted invitation of the organization without contact values", (
|
||||
const parsed = OrganizationInvitation.parse({
|
||||
id: "01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
|
||||
organization_id: "01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01",
|
||||
candidate_handle: "cand_7Qm2xVb9Lr4Kp0Zt",
|
||||
candidate_handle: "cv1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
need: null,
|
||||
state: "accepted",
|
||||
expiry_reason: null,
|
||||
|
||||
@@ -135,7 +135,15 @@ describe("generated PublicationUpdate", () => {
|
||||
expected_version: number;
|
||||
state: "closed" | "published";
|
||||
fields: Array<
|
||||
"categories" | "stack" | "experience" | "soft_skills" | "location" | "relocation"
|
||||
| "categories"
|
||||
| "stack"
|
||||
| "experience"
|
||||
| "soft_skills"
|
||||
| "location"
|
||||
| "relocation"
|
||||
| "self_assessment"
|
||||
| "work_formats"
|
||||
| "salary_compatibility"
|
||||
>;
|
||||
}>();
|
||||
});
|
||||
@@ -205,23 +213,31 @@ describe("generated HiddenOrganization", () => {
|
||||
|
||||
describe("generated AnonymousCardContent", () => {
|
||||
const card = {
|
||||
categories: [{ specialization: "backend", grade: "middle" }],
|
||||
stack: ["PostgreSQL", "Kafka"],
|
||||
experience_months: null,
|
||||
soft_skills: null,
|
||||
location: null,
|
||||
relocation: null,
|
||||
pseudonym: `cv1_${"a".repeat(43)}`,
|
||||
categories: [{ specialization: "backend", grade: "middle", strength: "standard" }],
|
||||
stack: ["postgresql", "kafka"],
|
||||
self_assessment: [
|
||||
{
|
||||
specialization: "network_engineer",
|
||||
confirmation_status: "unconfirmed",
|
||||
declared_grade: "junior",
|
||||
},
|
||||
],
|
||||
experience_band: "1_3",
|
||||
work_formats: null,
|
||||
salary_compatibility: 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",
|
||||
"experience_band",
|
||||
"pseudonym",
|
||||
"salary_compatibility",
|
||||
"self_assessment",
|
||||
"stack",
|
||||
"work_formats",
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -251,7 +267,7 @@ describe("generated AnonymousCardContent", () => {
|
||||
expect(
|
||||
CardPreview.parse({ ...closed, state: "published", fields: ["stack"], card }),
|
||||
).toMatchObject({
|
||||
card: { stack: ["PostgreSQL", "Kafka"] },
|
||||
card: { stack: ["postgresql", "kafka"] },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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 assessmentClipboardSignalSizeBytesMin = 0;
|
||||
export const assessmentClipboardSignalSizeBytesMax = 2147483647;
|
||||
|
||||
|
||||
export const AssessmentClipboardSignal = zod.object({
|
||||
"kind": zod.enum(['copy', 'paste', 'cut']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.'),
|
||||
"size_bytes": zod.int().min(assessmentClipboardSignalSizeBytesMin).max(assessmentClipboardSignalSizeBytesMax).describe('Byte count only. Clipboard or selection contents are not transmitted or retained.')
|
||||
})
|
||||
|
||||
export type AssessmentClipboardSignal = zod.input<typeof AssessmentClipboardSignal>;
|
||||
export type AssessmentClipboardSignalOutput = zod.output<typeof AssessmentClipboardSignal>;
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentFinalizeConflictProblemTypeMax = 256;
|
||||
|
||||
export const assessmentFinalizeConflictProblemTitleMax = 200;
|
||||
|
||||
export const assessmentFinalizeConflictProblemDetailMax = 1000;
|
||||
|
||||
export const assessmentFinalizeConflictProblemInstanceMax = 2048;
|
||||
|
||||
export const assessmentFinalizeConflictProblemTraceIdMax = 128;
|
||||
|
||||
|
||||
export const assessmentFinalizeConflictProblemTraceIdRegExp = new RegExp('^[A-Za-z0-9._-]+$');
|
||||
export const assessmentFinalizeConflictProblemErrorsItemPointerMax = 1024;
|
||||
|
||||
|
||||
export const assessmentFinalizeConflictProblemErrorsItemPointerRegExp = new RegExp('^(/([^~/]|~[01])*)*$');
|
||||
export const assessmentFinalizeConflictProblemErrorsItemCodeMax = 64;
|
||||
|
||||
|
||||
export const assessmentFinalizeConflictProblemErrorsItemCodeRegExp = new RegExp('^[a-z][a-z0-9_]*$');
|
||||
export const assessmentFinalizeConflictProblemErrorsItemMessageMax = 500;
|
||||
|
||||
export const assessmentFinalizeConflictProblemErrorsMax = 100;
|
||||
|
||||
export const assessmentFinalizeConflictProblemPendingItemIdsMax = 220;
|
||||
|
||||
|
||||
export const AssessmentFinalizeConflictProblem = zod.object({
|
||||
"type": zod.string().max(assessmentFinalizeConflictProblemTypeMax),
|
||||
"title": zod.string().min(1).max(assessmentFinalizeConflictProblemTitleMax),
|
||||
"status": zod.literal(409),
|
||||
"code": zod.enum(['state_conflict', 'idempotency_in_progress']),
|
||||
"detail": zod.string().max(assessmentFinalizeConflictProblemDetailMax).exactOptional(),
|
||||
"instance": zod.string().max(assessmentFinalizeConflictProblemInstanceMax).exactOptional(),
|
||||
"trace_id": zod.string().min(1).max(assessmentFinalizeConflictProblemTraceIdMax).regex(assessmentFinalizeConflictProblemTraceIdRegExp).exactOptional(),
|
||||
"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(assessmentFinalizeConflictProblemErrorsItemPointerMax).regex(assessmentFinalizeConflictProblemErrorsItemPointerRegExp).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(assessmentFinalizeConflictProblemErrorsItemCodeMax).regex(assessmentFinalizeConflictProblemErrorsItemCodeRegExp).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(assessmentFinalizeConflictProblemErrorsItemMessageMax).describe('Fixed English message that never echoes the submitted value.')
|
||||
}).describe('One reason why a request field or parameter is invalid.')).max(assessmentFinalizeConflictProblemErrorsMax).exactOptional(),
|
||||
"pending_item_ids": zod.array(zod.uuid()).max(assessmentFinalizeConflictProblemPendingItemIdsMax).exactOptional().describe('Frozen item IDs still unanswered when finalize is rejected for an incomplete attempt. Omitted when the conflict is unrelated to unanswered items.')
|
||||
}).describe('A finalize state conflict. `pending_item_ids` is present only when the attempt still has required questions without answers; it is omitted for other state conflicts and idempotency conflicts.')
|
||||
|
||||
export type AssessmentFinalizeConflictProblem = zod.input<typeof AssessmentFinalizeConflictProblem>;
|
||||
export type AssessmentFinalizeConflictProblemOutput = zod.output<typeof AssessmentFinalizeConflictProblem>;
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentFocusLossSignalDurationMsMax = 259200000;
|
||||
|
||||
|
||||
export const AssessmentFocusLossSignal = zod.object({
|
||||
"kind": zod.enum(['focus_loss']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.'),
|
||||
"duration_ms": zod.int().min(1).max(assessmentFocusLossSignalDurationMsMax).describe('Client-measured duration away from the assessment tab or window, in milliseconds.')
|
||||
})
|
||||
|
||||
export type AssessmentFocusLossSignal = zod.input<typeof AssessmentFocusLossSignal>;
|
||||
export type AssessmentFocusLossSignalOutput = zod.output<typeof AssessmentFocusLossSignal>;
|
||||
@@ -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 AssessmentFullscreenExitSignal = zod.object({
|
||||
"kind": zod.enum(['fullscreen_exit']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.')
|
||||
})
|
||||
|
||||
export type AssessmentFullscreenExitSignal = zod.input<typeof AssessmentFullscreenExitSignal>;
|
||||
export type AssessmentFullscreenExitSignalOutput = zod.output<typeof AssessmentFullscreenExitSignal>;
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentSignalBatchEventsItemOneDurationMsMax = 259200000;
|
||||
|
||||
export const assessmentSignalBatchEventsItemTwoSizeBytesMin = 0;
|
||||
export const assessmentSignalBatchEventsItemTwoSizeBytesMax = 2147483647;
|
||||
|
||||
export const assessmentSignalBatchEventsMax = 50;
|
||||
|
||||
|
||||
export const AssessmentSignalBatch = zod.object({
|
||||
"events": zod.array(zod.union([zod.object({
|
||||
"kind": zod.enum(['focus_loss']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.'),
|
||||
"duration_ms": zod.int().min(1).max(assessmentSignalBatchEventsItemOneDurationMsMax).describe('Client-measured duration away from the assessment tab or window, in milliseconds.')
|
||||
}),zod.object({
|
||||
"kind": zod.enum(['copy', 'paste', 'cut']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.'),
|
||||
"size_bytes": zod.int().min(assessmentSignalBatchEventsItemTwoSizeBytesMin).max(assessmentSignalBatchEventsItemTwoSizeBytesMax).describe('Byte count only. Clipboard or selection contents are not transmitted or retained.')
|
||||
}),zod.object({
|
||||
"kind": zod.enum(['fullscreen_exit']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.')
|
||||
})]).describe('One client-reported event bound to an item instance of the attempt. The timestamp is untrusted input and is used only as event metadata; server receipt time is authoritative for limits and retention.')).min(1).max(assessmentSignalBatchEventsMax)
|
||||
}).describe('A bounded batch of client event metadata. The raw request body is limited to 32 KiB before decoding and the batch contains at most 50 events.')
|
||||
|
||||
export type AssessmentSignalBatch = zod.input<typeof AssessmentSignalBatch>;
|
||||
export type AssessmentSignalBatchOutput = zod.output<typeof AssessmentSignalBatch>;
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentSignalEventOneDurationMsMax = 259200000;
|
||||
|
||||
export const assessmentSignalEventTwoSizeBytesMin = 0;
|
||||
export const assessmentSignalEventTwoSizeBytesMax = 2147483647;
|
||||
|
||||
|
||||
export const AssessmentSignalEvent = zod.union([zod.object({
|
||||
"kind": zod.enum(['focus_loss']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.'),
|
||||
"duration_ms": zod.int().min(1).max(assessmentSignalEventOneDurationMsMax).describe('Client-measured duration away from the assessment tab or window, in milliseconds.')
|
||||
}),zod.object({
|
||||
"kind": zod.enum(['copy', 'paste', 'cut']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.'),
|
||||
"size_bytes": zod.int().min(assessmentSignalEventTwoSizeBytesMin).max(assessmentSignalEventTwoSizeBytesMax).describe('Byte count only. Clipboard or selection contents are not transmitted or retained.')
|
||||
}),zod.object({
|
||||
"kind": zod.enum(['fullscreen_exit']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.')
|
||||
})]).describe('One client-reported event bound to an item instance of the attempt. The timestamp is untrusted input and is used only as event metadata; server receipt time is authoritative for limits and retention.')
|
||||
|
||||
export type AssessmentSignalEvent = zod.input<typeof AssessmentSignalEvent>;
|
||||
export type AssessmentSignalEventOutput = zod.output<typeof AssessmentSignalEvent>;
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentSignalReceiptAcceptedEventsMin = 0;
|
||||
export const assessmentSignalReceiptAcceptedEventsMax = 50;
|
||||
|
||||
|
||||
export const AssessmentSignalReceipt = zod.object({
|
||||
"status": zod.enum(['accepted', 'saturated']).describe('`saturated` means no event from this batch was stored because the attempt\'s bounded evidence storage is full.'),
|
||||
"accepted_events": zod.int().min(assessmentSignalReceiptAcceptedEventsMin).max(assessmentSignalReceiptAcceptedEventsMax).describe('Number of events stored from this batch; zero when saturated.'),
|
||||
"received_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('Receipt for the submitted batch. It contains no signal details, score, review decision, threshold, or result band.')
|
||||
|
||||
export type AssessmentSignalReceipt = zod.input<typeof AssessmentSignalReceipt>;
|
||||
export type AssessmentSignalReceiptOutput = zod.output<typeof AssessmentSignalReceipt>;
|
||||
@@ -15,6 +15,7 @@ export * from './assessmentAttemptSessionStart.zod';
|
||||
export * from './assessmentAttemptState.zod';
|
||||
export * from './assessmentAttemptVersion.zod';
|
||||
export * from './assessmentAvailability.zod';
|
||||
export * from './assessmentClipboardSignal.zod';
|
||||
export * from './assessmentCorrectiveAttempt.zod';
|
||||
export * from './assessmentCorrectiveAttemptCreate.zod';
|
||||
export * from './assessmentCorrectiveResult.zod';
|
||||
@@ -23,6 +24,9 @@ export * from './assessmentExpressAttempt.zod';
|
||||
export * from './assessmentExpressAttemptCreate.zod';
|
||||
export * from './assessmentExpressResult.zod';
|
||||
export * from './assessmentFinalization.zod';
|
||||
export * from './assessmentFinalizeConflictProblem.zod';
|
||||
export * from './assessmentFocusLossSignal.zod';
|
||||
export * from './assessmentFullscreenExitSignal.zod';
|
||||
export * from './assessmentGap.zod';
|
||||
export * from './assessmentGradeAvailability.zod';
|
||||
export * from './assessmentGradeAvailabilityStatus.zod';
|
||||
@@ -47,6 +51,9 @@ export * from './assessmentRealMode.zod';
|
||||
export * from './assessmentRealResultCommon.zod';
|
||||
export * from './assessmentResult.zod';
|
||||
export * from './assessmentSessions.zod';
|
||||
export * from './assessmentSignalBatch.zod';
|
||||
export * from './assessmentSignalEvent.zod';
|
||||
export * from './assessmentSignalReceipt.zod';
|
||||
export * from './assessmentSpecializationAvailability.zod';
|
||||
export * from './assessmentStrength.zod';
|
||||
export * from './assessmentUncertainty.zod';
|
||||
@@ -78,6 +85,8 @@ export * from './practiceItemContent.zod';
|
||||
export * from './practiceKind.zod';
|
||||
export * from './practiceStatus.zod';
|
||||
export * from './practiceVerdict.zod';
|
||||
export * from './recordMyAssessmentAttemptSignalsBody.zod';
|
||||
export * from './recordMyAssessmentAttemptSignalsHeaders.zod';
|
||||
export * from './startMyAssessmentAttemptSessionBody.zod';
|
||||
export * from './startMyAssessmentAttemptSessionHeaders.zod';
|
||||
export * from './stringAnswer.zod';
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const recordMyAssessmentAttemptSignalsBodyEventsItemOneDurationMsMax = 259200000;
|
||||
|
||||
export const recordMyAssessmentAttemptSignalsBodyEventsItemTwoSizeBytesMin = 0;
|
||||
export const recordMyAssessmentAttemptSignalsBodyEventsItemTwoSizeBytesMax = 2147483647;
|
||||
|
||||
export const recordMyAssessmentAttemptSignalsBodyEventsMax = 50;
|
||||
|
||||
|
||||
export const RecordMyAssessmentAttemptSignalsBody = zod.object({
|
||||
"events": zod.array(zod.union([zod.object({
|
||||
"kind": zod.enum(['focus_loss']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.'),
|
||||
"duration_ms": zod.int().min(1).max(recordMyAssessmentAttemptSignalsBodyEventsItemOneDurationMsMax).describe('Client-measured duration away from the assessment tab or window, in milliseconds.')
|
||||
}),zod.object({
|
||||
"kind": zod.enum(['copy', 'paste', 'cut']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.'),
|
||||
"size_bytes": zod.int().min(recordMyAssessmentAttemptSignalsBodyEventsItemTwoSizeBytesMin).max(recordMyAssessmentAttemptSignalsBodyEventsItemTwoSizeBytesMax).describe('Byte count only. Clipboard or selection contents are not transmitted or retained.')
|
||||
}),zod.object({
|
||||
"kind": zod.enum(['fullscreen_exit']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"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.')
|
||||
})]).describe('One client-reported event bound to an item instance of the attempt. The timestamp is untrusted input and is used only as event metadata; server receipt time is authoritative for limits and retention.')).min(1).max(recordMyAssessmentAttemptSignalsBodyEventsMax)
|
||||
}).describe('A bounded batch of client event metadata. The raw request body is limited to 32 KiB before decoding and the batch contains at most 50 events.')
|
||||
|
||||
export type RecordMyAssessmentAttemptSignalsBody = zod.input<typeof RecordMyAssessmentAttemptSignalsBody>;
|
||||
export type RecordMyAssessmentAttemptSignalsBodyOutput = zod.output<typeof RecordMyAssessmentAttemptSignalsBody>;
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const recordMyAssessmentAttemptSignalsHeadersIdempotencyKeyMax = 255;
|
||||
|
||||
|
||||
export const recordMyAssessmentAttemptSignalsHeadersIdempotencyKeyRegExp = new RegExp('^[A-Za-z0-9._:-]+$');
|
||||
|
||||
export const RecordMyAssessmentAttemptSignalsHeaders = zod.object({
|
||||
"Idempotency-Key": zod.string().min(1).max(recordMyAssessmentAttemptSignalsHeadersIdempotencyKeyMax).regex(recordMyAssessmentAttemptSignalsHeadersIdempotencyKeyRegExp)
|
||||
})
|
||||
|
||||
export type RecordMyAssessmentAttemptSignalsHeaders = zod.input<typeof RecordMyAssessmentAttemptSignalsHeaders>;
|
||||
export type RecordMyAssessmentAttemptSignalsHeadersOutput = zod.output<typeof RecordMyAssessmentAttemptSignalsHeaders>;
|
||||
@@ -58,4 +58,5 @@ export * from './questionnaireSpecialization.zod';
|
||||
export * from './questionnaireVersion.zod';
|
||||
export * from './saveMyProfileBody.zod';
|
||||
export * from './saveMyQuestionnaireBody.zod';
|
||||
export * from './stackTag.zod';
|
||||
export * from './workContext.zod';
|
||||
File renamed without changes.
@@ -31,7 +31,6 @@ 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';
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const CandidateHandleMax = 128;
|
||||
export const CandidateHandleMin = 47;
|
||||
export const CandidateHandleMax = 47;
|
||||
|
||||
|
||||
export const CandidateHandleRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const CandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
|
||||
|
||||
export const CandidateHandle = zod.string().min(1).max(CandidateHandleMax).regex(CandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.')
|
||||
export const CandidateHandle = zod.string().min(CandidateHandleMin).max(CandidateHandleMax).regex(CandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.')
|
||||
|
||||
export type CandidateHandle = zod.input<typeof CandidateHandle>;
|
||||
export type CandidateHandleOutput = zod.output<typeof CandidateHandle>;
|
||||
@@ -6,10 +6,11 @@
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const createOrganizationInvitationBodyCandidateHandleMax = 128;
|
||||
export const createOrganizationInvitationBodyCandidateHandleMin = 47;
|
||||
export const createOrganizationInvitationBodyCandidateHandleMax = 47;
|
||||
|
||||
|
||||
export const createOrganizationInvitationBodyCandidateHandleRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const createOrganizationInvitationBodyCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
|
||||
|
||||
export const createOrganizationInvitationBodyTermsRoleTitleMax = 200;
|
||||
|
||||
@@ -67,7 +68,7 @@ export const createOrganizationInvitationBodyTermsPackageHealthInsuranceOneDescr
|
||||
export const createOrganizationInvitationBodyTermsPackageHealthInsuranceOneDescriptionRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
|
||||
export const CreateOrganizationInvitationBody = zod.object({
|
||||
"candidate_handle": zod.string().min(1).max(createOrganizationInvitationBodyCandidateHandleMax).regex(createOrganizationInvitationBodyCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
|
||||
"candidate_handle": zod.string().min(createOrganizationInvitationBodyCandidateHandleMin).max(createOrganizationInvitationBodyCandidateHandleMax).regex(createOrganizationInvitationBodyCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
|
||||
"need": zod.union([zod.object({
|
||||
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
|
||||
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const organizationInvitationCandidateHandleMax = 128;
|
||||
export const organizationInvitationCandidateHandleMin = 47;
|
||||
export const organizationInvitationCandidateHandleMax = 47;
|
||||
|
||||
|
||||
export const organizationInvitationCandidateHandleRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const organizationInvitationCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +74,7 @@ export const organizationInvitationContactAccessFieldsMax = 4;
|
||||
export const OrganizationInvitation = zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the invitation.'),
|
||||
"organization_id": zod.uuid().describe('Organization that owns the invitation, equal to `org_id` of the path. It never changes.'),
|
||||
"candidate_handle": zod.string().min(1).max(organizationInvitationCandidateHandleMax).regex(organizationInvitationCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
|
||||
"candidate_handle": zod.string().min(organizationInvitationCandidateHandleMin).max(organizationInvitationCandidateHandleMax).regex(organizationInvitationCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
|
||||
"need": zod.union([zod.object({
|
||||
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
|
||||
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const organizationInvitationCreateCandidateHandleMax = 128;
|
||||
export const organizationInvitationCreateCandidateHandleMin = 47;
|
||||
export const organizationInvitationCreateCandidateHandleMax = 47;
|
||||
|
||||
|
||||
export const organizationInvitationCreateCandidateHandleRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const organizationInvitationCreateCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
|
||||
|
||||
export const organizationInvitationCreateTermsRoleTitleMax = 200;
|
||||
|
||||
@@ -67,7 +68,7 @@ export const organizationInvitationCreateTermsPackageHealthInsuranceOneDescripti
|
||||
export const organizationInvitationCreateTermsPackageHealthInsuranceOneDescriptionRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
|
||||
export const OrganizationInvitationCreate = zod.object({
|
||||
"candidate_handle": zod.string().min(1).max(organizationInvitationCreateCandidateHandleMax).regex(organizationInvitationCreateCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
|
||||
"candidate_handle": zod.string().min(organizationInvitationCreateCandidateHandleMin).max(organizationInvitationCreateCandidateHandleMax).regex(organizationInvitationCreateCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
|
||||
"need": zod.union([zod.object({
|
||||
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
|
||||
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const organizationInvitationListItemsItemCandidateHandleMax = 128;
|
||||
export const organizationInvitationListItemsItemCandidateHandleMin = 47;
|
||||
export const organizationInvitationListItemsItemCandidateHandleMax = 47;
|
||||
|
||||
|
||||
export const organizationInvitationListItemsItemCandidateHandleRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const organizationInvitationListItemsItemCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +38,7 @@ export const organizationInvitationListPageNextCursorRegExp = new RegExp('^[A-Za
|
||||
export const OrganizationInvitationList = zod.object({
|
||||
"items": zod.array(zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the invitation.'),
|
||||
"candidate_handle": zod.string().min(1).max(organizationInvitationListItemsItemCandidateHandleMax).regex(organizationInvitationListItemsItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
|
||||
"candidate_handle": zod.string().min(organizationInvitationListItemsItemCandidateHandleMin).max(organizationInvitationListItemsItemCandidateHandleMax).regex(organizationInvitationListItemsItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
|
||||
"need": zod.union([zod.object({
|
||||
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
|
||||
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const organizationInvitationSummaryCandidateHandleMax = 128;
|
||||
export const organizationInvitationSummaryCandidateHandleMin = 47;
|
||||
export const organizationInvitationSummaryCandidateHandleMax = 47;
|
||||
|
||||
|
||||
export const organizationInvitationSummaryCandidateHandleRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const organizationInvitationSummaryCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +31,7 @@ export const organizationInvitationSummaryContactAccessFieldsMax = 4;
|
||||
|
||||
export const OrganizationInvitationSummary = zod.object({
|
||||
"id": zod.uuid().describe('Identifier of the invitation.'),
|
||||
"candidate_handle": zod.string().min(1).max(organizationInvitationSummaryCandidateHandleMax).regex(organizationInvitationSummaryCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
|
||||
"candidate_handle": zod.string().min(organizationInvitationSummaryCandidateHandleMin).max(organizationInvitationSummaryCandidateHandleMax).regex(organizationInvitationSummaryCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
|
||||
"need": zod.union([zod.object({
|
||||
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
|
||||
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
|
||||
|
||||
@@ -6,39 +6,37 @@
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const anonymousCardContentPseudonymMin = 47;
|
||||
export const anonymousCardContentPseudonymMax = 47;
|
||||
|
||||
|
||||
export const anonymousCardContentPseudonymRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
|
||||
export const anonymousCardContentCategoriesMax = 9;
|
||||
|
||||
export const anonymousCardContentStackItemMax = 50;
|
||||
export const anonymousCardContentStackMax = 4;
|
||||
|
||||
export const anonymousCardContentSelfAssessmentMax = 9;
|
||||
|
||||
export const anonymousCardContentStackItemRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
export const anonymousCardContentStackMax = 30;
|
||||
export const anonymousCardContentWorkFormatsMax = 3;
|
||||
|
||||
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({
|
||||
"pseudonym": zod.string().min(anonymousCardContentPseudonymMin).max(anonymousCardContentPseudonymMax).regex(anonymousCardContentPseudonymRegExp).describe('Stable opaque alias scoped to the reading organization. It is not an account or profile identifier and changes across organizations.'),
|
||||
"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.')
|
||||
"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.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of the authoritative confirmation.')
|
||||
}).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 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, which reuses this content.')
|
||||
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker'])).max(anonymousCardContentStackMax).nullable().describe('Recognized confirmed technology codes only, or null.'),
|
||||
"self_assessment": 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.'),
|
||||
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']),
|
||||
"declared_grade": zod.union([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.'),zod.null()]).exactOptional()
|
||||
}).describe('Candidate-declared specialization and optional grade. This is never an assessment result.')).max(anonymousCardContentSelfAssessmentMax).nullable().describe('Candidate-declared specialization and grade, separate from categories.'),
|
||||
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]).describe('Coarse total work-experience bucket, or null.'),
|
||||
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid'])).max(anonymousCardContentWorkFormatsMax).nullable().describe('Explicitly opted-in work formats, or null.'),
|
||||
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()]).describe('Nullable compatibility result with no salary values.')
|
||||
}).describe('The anonymous candidate card as an organization reads it. Only explicitly published values reach it; unconfirmed stack suggestions and unknown values never do. Stack output uses a closed taxonomy. 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, which reuses this content.')
|
||||
|
||||
export type AnonymousCardContent = zod.input<typeof AnonymousCardContent>;
|
||||
export type AnonymousCardContentOutput = zod.output<typeof AnonymousCardContent>;
|
||||
@@ -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 CandidateExperienceBand = zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.')
|
||||
|
||||
export type CandidateExperienceBand = zod.input<typeof CandidateExperienceBand>;
|
||||
export type CandidateExperienceBandOutput = zod.output<typeof CandidateExperienceBand>;
|
||||
@@ -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 CandidateSalaryCompatibility = zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.')
|
||||
|
||||
export type CandidateSalaryCompatibility = zod.input<typeof CandidateSalaryCompatibility>;
|
||||
export type CandidateSalaryCompatibilityOutput = zod.output<typeof CandidateSalaryCompatibility>;
|
||||
@@ -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 CandidateWorkFormat = zod.enum(['remote', 'office', 'hybrid'])
|
||||
|
||||
export type CandidateWorkFormat = zod.input<typeof CandidateWorkFormat>;
|
||||
export type CandidateWorkFormatOutput = zod.output<typeof CandidateWorkFormat>;
|
||||
@@ -11,13 +11,13 @@ 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.'),
|
||||
"kind": zod.enum(['card_viewed', 'contact_read']).describe('How an organization reached the candidate.\n\n- card_viewed: an organization read the permitted anonymous card.\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.')
|
||||
}).describe('One access of an organization to the card or the contacts of the current candidate. A retained access permits the candidate to see the organization\'s identifier and current name and to hide their profile from it. `organization` is null when the organization cannot be presented. Earlier permitted accesses remain after hiding. The record carries no employee identity, query, ranking, or search filter of the organization.')
|
||||
|
||||
export type CardAccess = zod.input<typeof CardAccess>;
|
||||
export type CardAccessOutput = zod.output<typeof CardAccess>;
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
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 const CardAccessKind = zod.enum(['card_viewed', 'contact_read']).describe('How an organization reached the candidate.\n\n- card_viewed: an organization read the permitted anonymous card.\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>;
|
||||
@@ -18,13 +18,13 @@ 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.'),
|
||||
"kind": zod.enum(['card_viewed', 'contact_read']).describe('How an organization reached the candidate.\n\n- card_viewed: an organization read the permitted anonymous card.\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.'),
|
||||
}).describe('One access of an organization to the card or the contacts of the current candidate. A retained access permits the candidate to see the organization\'s identifier and current name and to hide their profile from it. `organization` is null when the organization cannot be presented. Earlier permitted accesses remain after hiding. The record carries no employee identity, 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.')
|
||||
|
||||
@@ -8,7 +8,8 @@ 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.')
|
||||
"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.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of the authoritative confirmation.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it.')
|
||||
|
||||
export type CardCategory = zod.input<typeof CardCategory>;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
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 const CardField = zod.enum(['categories', 'salary_compatibility', 'self_assessment', 'stack', 'experience', 'soft_skills', 'location', 'relocation', 'work_formats']).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: specialization and grade confirmed by an authoritative assessment result.\n- self_assessment: the candidate\'s declared specialization and grade, separate from confirmed categories.\n- stack: only recognized technology codes from the server\'s closed taxonomy.\n- experience: a coarse total-experience band, without employers, periods, or descriptions.\n- work_formats: explicitly selected work formats from the private questionnaire.\n- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.\n- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.\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>;
|
||||
@@ -7,10 +7,10 @@
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const CardFieldSetMin = 0;
|
||||
export const CardFieldSetMax = 6;
|
||||
export const CardFieldSetMax = 9;
|
||||
|
||||
|
||||
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 const CardFieldSet = zod.array(zod.enum(['categories', 'salary_compatibility', 'self_assessment', 'stack', 'experience', 'soft_skills', 'location', 'relocation', 'work_formats']).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: specialization and grade confirmed by an authoritative assessment result.\n- self_assessment: the candidate\'s declared specialization and grade, separate from confirmed categories.\n- stack: only recognized technology codes from the server\'s closed taxonomy.\n- experience: a coarse total-experience band, without employers, periods, or descriptions.\n- work_formats: explicitly selected work formats from the private questionnaire.\n- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.\n- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.\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>;
|
||||
@@ -7,46 +7,44 @@
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const cardPreviewFieldsMin = 0;
|
||||
export const cardPreviewFieldsMax = 6;
|
||||
export const cardPreviewFieldsMax = 9;
|
||||
|
||||
export const cardPreviewCardOnePseudonymMin = 47;
|
||||
export const cardPreviewCardOnePseudonymMax = 47;
|
||||
|
||||
|
||||
export const cardPreviewCardOnePseudonymRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
|
||||
export const cardPreviewCardOneCategoriesMax = 9;
|
||||
|
||||
export const cardPreviewCardOneStackItemMax = 50;
|
||||
export const cardPreviewCardOneStackMax = 4;
|
||||
|
||||
export const cardPreviewCardOneSelfAssessmentMax = 9;
|
||||
|
||||
export const cardPreviewCardOneStackItemRegExp = new RegExp('^\\S(?:.*\\S)?$');
|
||||
export const cardPreviewCardOneStackMax = 30;
|
||||
export const cardPreviewCardOneWorkFormatsMax = 3;
|
||||
|
||||
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.'),
|
||||
"fields": zod.array(zod.enum(['categories', 'salary_compatibility', 'self_assessment', 'stack', 'experience', 'soft_skills', 'location', 'relocation', 'work_formats']).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: specialization and grade confirmed by an authoritative assessment result.\n- self_assessment: the candidate\'s declared specialization and grade, separate from confirmed categories.\n- stack: only recognized technology codes from the server\'s closed taxonomy.\n- experience: a coarse total-experience band, without employers, periods, or descriptions.\n- work_formats: explicitly selected work formats from the private questionnaire.\n- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.\n- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.\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({
|
||||
"pseudonym": zod.string().min(cardPreviewCardOnePseudonymMin).max(cardPreviewCardOnePseudonymMax).regex(cardPreviewCardOnePseudonymRegExp).describe('Stable opaque alias scoped to the reading organization. It is not an account or profile identifier and changes across organizations.'),
|
||||
"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.')
|
||||
"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.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of the authoritative confirmation.')
|
||||
}).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 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, which reuses this content.'),zod.null()]),
|
||||
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker'])).max(cardPreviewCardOneStackMax).nullable().describe('Recognized confirmed technology codes only, or null.'),
|
||||
"self_assessment": 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.'),
|
||||
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']),
|
||||
"declared_grade": zod.union([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.'),zod.null()]).exactOptional()
|
||||
}).describe('Candidate-declared specialization and optional grade. This is never an assessment result.')).max(cardPreviewCardOneSelfAssessmentMax).nullable().describe('Candidate-declared specialization and grade, separate from categories.'),
|
||||
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]).describe('Coarse total work-experience bucket, or null.'),
|
||||
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid'])).max(cardPreviewCardOneWorkFormatsMax).nullable().describe('Explicitly opted-in work formats, or null.'),
|
||||
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()]).describe('Nullable compatibility result with no salary values.')
|
||||
}).describe('The anonymous candidate card as an organization reads it. Only explicitly published values reach it; unconfirmed stack suggestions and unknown values never do. Stack output uses a closed taxonomy. 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, 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.')
|
||||
}).describe('A private candidate preview computed from the current profile, publication, and consent ledger. Its pseudonym uses a separate preview context and is not an organization\'s alias. Organization-specific visibility filters and cohort checks can further generalize or suppress the organization-facing card. This read creates no view or history record and 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,16 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const CardSelfAssessment = 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.'),
|
||||
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']),
|
||||
"declared_grade": zod.union([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.'),zod.null()]).exactOptional()
|
||||
}).describe('Candidate-declared specialization and optional grade. This is never an assessment result.')
|
||||
|
||||
export type CardSelfAssessment = zod.input<typeof CardSelfAssessment>;
|
||||
export type CardSelfAssessmentOutput = zod.output<typeof CardSelfAssessment>;
|
||||
@@ -6,6 +6,9 @@
|
||||
*/
|
||||
|
||||
export * from './anonymousCardContent.zod';
|
||||
export * from './candidateExperienceBand.zod';
|
||||
export * from './candidateSalaryCompatibility.zod';
|
||||
export * from './candidateWorkFormat.zod';
|
||||
export * from './cardAccess.zod';
|
||||
export * from './cardAccessKind.zod';
|
||||
export * from './cardAccessList.zod';
|
||||
@@ -13,6 +16,7 @@ export * from './cardCategory.zod';
|
||||
export * from './cardField.zod';
|
||||
export * from './cardFieldSet.zod';
|
||||
export * from './cardPreview.zod';
|
||||
export * from './cardSelfAssessment.zod';
|
||||
export * from './hiddenOrganization.zod';
|
||||
export * from './hiddenOrganizationList.zod';
|
||||
export * from './listMyCardAccessHistoryParams.zod';
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const privacyEventFieldsOneMin = 0;
|
||||
export const privacyEventFieldsOneMax = 6;
|
||||
export const privacyEventFieldsOneMax = 9;
|
||||
|
||||
export const privacyEventOrganizationOneNameMax = 200;
|
||||
|
||||
@@ -16,7 +16,7 @@ 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.'),
|
||||
"fields": zod.union([zod.array(zod.enum(['categories', 'salary_compatibility', 'self_assessment', 'stack', 'experience', 'soft_skills', 'location', 'relocation', 'work_formats']).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: specialization and grade confirmed by an authoritative assessment result.\n- self_assessment: the candidate\'s declared specialization and grade, separate from confirmed categories.\n- stack: only recognized technology codes from the server\'s closed taxonomy.\n- experience: a coarse total-experience band, without employers, periods, or descriptions.\n- work_formats: explicitly selected work formats from the private questionnaire.\n- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.\n- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.\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.'),
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const privacyEventListItemsItemFieldsOneMin = 0;
|
||||
export const privacyEventListItemsItemFieldsOneMax = 6;
|
||||
export const privacyEventListItemsItemFieldsOneMax = 9;
|
||||
|
||||
export const privacyEventListItemsItemOrganizationOneNameMax = 200;
|
||||
|
||||
@@ -23,7 +23,7 @@ export const PrivacyEventList = 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.'),
|
||||
"fields": zod.union([zod.array(zod.enum(['categories', 'salary_compatibility', 'self_assessment', 'stack', 'experience', 'soft_skills', 'location', 'relocation', 'work_formats']).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: specialization and grade confirmed by an authoritative assessment result.\n- self_assessment: the candidate\'s declared specialization and grade, separate from confirmed categories.\n- stack: only recognized technology codes from the server\'s closed taxonomy.\n- experience: a coarse total-experience band, without employers, periods, or descriptions.\n- work_formats: explicitly selected work formats from the private questionnaire.\n- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.\n- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.\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.'),
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const privacySettingsPublicationFieldsOneMin = 0;
|
||||
export const privacySettingsPublicationFieldsOneMax = 6;
|
||||
export const privacySettingsPublicationFieldsOneMax = 9;
|
||||
|
||||
export const privacySettingsPublicationVersionMin = 0;
|
||||
|
||||
@@ -21,7 +21,7 @@ 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`.'),
|
||||
"fields": zod.array(zod.enum(['categories', 'salary_compatibility', 'self_assessment', 'stack', 'experience', 'soft_skills', 'location', 'relocation', 'work_formats']).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: specialization and grade confirmed by an authoritative assessment result.\n- self_assessment: the candidate\'s declared specialization and grade, separate from confirmed categories.\n- stack: only recognized technology codes from the server\'s closed taxonomy.\n- experience: a coarse total-experience band, without employers, periods, or descriptions.\n- work_formats: explicitly selected work formats from the private questionnaire.\n- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.\n- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.\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.')
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const publicationFieldsOneMin = 0;
|
||||
export const publicationFieldsOneMax = 6;
|
||||
export const publicationFieldsOneMax = 9;
|
||||
|
||||
export const publicationVersionMin = 0;
|
||||
|
||||
@@ -15,7 +15,7 @@ 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`.'),
|
||||
"fields": zod.array(zod.enum(['categories', 'salary_compatibility', 'self_assessment', 'stack', 'experience', 'soft_skills', 'location', 'relocation', 'work_formats']).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: specialization and grade confirmed by an authoritative assessment result.\n- self_assessment: the candidate\'s declared specialization and grade, separate from confirmed categories.\n- stack: only recognized technology codes from the server\'s closed taxonomy.\n- experience: a coarse total-experience band, without employers, periods, or descriptions.\n- work_formats: explicitly selected work formats from the private questionnaire.\n- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.\n- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.\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.')
|
||||
|
||||
@@ -9,13 +9,13 @@ import * as zod from 'zod';
|
||||
export const publicationUpdateExpectedVersionMin = 0;
|
||||
|
||||
export const publicationUpdateFieldsMin = 0;
|
||||
export const publicationUpdateFieldsMax = 6;
|
||||
export const publicationUpdateFieldsMax = 9;
|
||||
|
||||
|
||||
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.')
|
||||
"fields": zod.array(zod.enum(['categories', 'salary_compatibility', 'self_assessment', 'stack', 'experience', 'soft_skills', 'location', 'relocation', 'work_formats']).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: specialization and grade confirmed by an authoritative assessment result.\n- self_assessment: the candidate\'s declared specialization and grade, separate from confirmed categories.\n- stack: only recognized technology codes from the server\'s closed taxonomy.\n- experience: a coarse total-experience band, without employers, periods, or descriptions.\n- work_formats: explicitly selected work formats from the private questionnaire.\n- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.\n- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.\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>;
|
||||
|
||||
@@ -9,13 +9,13 @@ import * as zod from 'zod';
|
||||
export const setMyPublicationBodyExpectedVersionMin = 0;
|
||||
|
||||
export const setMyPublicationBodyFieldsMin = 0;
|
||||
export const setMyPublicationBodyFieldsMax = 6;
|
||||
export const setMyPublicationBodyFieldsMax = 9;
|
||||
|
||||
|
||||
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.')
|
||||
"fields": zod.array(zod.enum(['categories', 'salary_compatibility', 'self_assessment', 'stack', 'experience', 'soft_skills', 'location', 'relocation', 'work_formats']).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: specialization and grade confirmed by an authoritative assessment result.\n- self_assessment: the candidate\'s declared specialization and grade, separate from confirmed categories.\n- stack: only recognized technology codes from the server\'s closed taxonomy.\n- experience: a coarse total-experience band, without employers, periods, or descriptions.\n- work_formats: explicitly selected work formats from the private questionnaire.\n- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.\n- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.\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>;
|
||||
|
||||
@@ -42,7 +42,7 @@ export const SupportCase = zod.object({
|
||||
"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('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.'),zod.null()]).describe('Category of a manual assessment, the optional category of a support case, or null.'),
|
||||
"complaint_reason": zod.union([zod.enum(['organization_conduct', 'offer_content', 'salary_terms_violation', 'data_disclosure', 'other']).describe('Ground of a complaint (PRD FR18).\n\n- organization_conduct: conduct of the organization, for example fraudulent or abusive messages.\n- offer_content: misleading or discriminatory content of an offer. Requires an invitation reference.\n- salary_terms_violation: a breach of the salary terms of an offer. Requires an invitation reference.\n- data_disclosure: a disclosure of the caller\'s personal data beyond what the caller granted.\n- other: another ground, explained in the description.'),zod.null()]).describe('Ground of a complaint, or null for other types.'),
|
||||
"rubric_version": zod.int().min(1).nullable().describe('For a manual assessment, the version of the published rubric of the category that the server fixed on creation; the expert assesses with it, the same rubric as the automated assessment. Null for other types, and null for a manual assessment whose category has no published rubric yet: the case then waits in `waiting_expert` and the client says so instead of promising a date.'),
|
||||
"rubric_version": zod.int().min(1).nullable().describe('For a manual assessment, the version of the grading policy pinned by the server at creation. The exact reviewed category opening and rubric manifest are retained privately so the expert can use the same rubric as automated assessment. Null for other types and for a manual assessment without one unique current reviewed category; the case still waits in `waiting_expert`.'),
|
||||
"response_target": zod.object({
|
||||
"kind": zod.enum(['operational_goal']).describe('Nature of the target. `operational_goal` is a goal of the team that clients label as such, never as a legal deadline.'),
|
||||
"business_days": zod.int().min(1).max(supportCaseResponseTargetBusinessDaysMax).describe('Length of the target in business days of the policy version, for example 5 for a manual assessment and 10 for an appeal.'),
|
||||
|
||||
@@ -15,15 +15,30 @@ export const paths = {
|
||||
profile: "/candidate/profile",
|
||||
questionnaire: "/candidate/questionnaire",
|
||||
assessment: "/candidate/assessment",
|
||||
assessmentAttempt: (attemptId: string) =>
|
||||
`/candidate/assessment/${encodeURIComponent(attemptId)}`,
|
||||
results: "/candidate/results",
|
||||
invitations: "/candidate/invitations",
|
||||
privacy: "/candidate/privacy",
|
||||
supportCases: "/candidate/support/cases",
|
||||
supportNew: "/candidate/support/cases/new",
|
||||
supportManual: "/candidate/support/cases/manual-assessment",
|
||||
supportCase: (caseId: string) => `/candidate/support/cases/${encodeURIComponent(caseId)}`,
|
||||
},
|
||||
employer: {
|
||||
root: "/employer",
|
||||
company: "/employer/company",
|
||||
needs: "/employer/needs",
|
||||
needNew: (organizationId?: string) =>
|
||||
organizationId
|
||||
? `/employer/needs/new?organization_id=${encodeURIComponent(organizationId)}`
|
||||
: "/employer/needs/new",
|
||||
need: (needId: string, organizationId: string) =>
|
||||
`/employer/needs/${encodeURIComponent(needId)}?organization_id=${encodeURIComponent(organizationId)}`,
|
||||
candidates: "/employer/candidates",
|
||||
invitations: "/employer/invitations",
|
||||
supportCases: "/employer/support/cases",
|
||||
supportNew: "/employer/support/cases/new",
|
||||
supportCase: (caseId: string) => `/employer/support/cases/${encodeURIComponent(caseId)}`,
|
||||
},
|
||||
} as const;
|
||||
Reference in new issue
Block a user