@dakkitor/api-contracts 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abilities/abilities.contract.d.ts +8 -2
- package/dist/abilities/abilities.contract.d.ts.map +1 -1
- package/dist/abilities/abilities.contract.js +48 -1
- package/dist/abilities/abilities.contract.spec.js +98 -0
- package/dist/abilities/first-agent.abilities.json +9 -2
- package/dist/abilities/outreach-service.abilities.json +14 -0
- package/dist/abilities/outreach.abilities.json +25 -0
- package/dist/abilities/second-agent.abilities.json +5 -1
- package/dist/actives/actives.contract.d.ts +7160 -7021
- package/dist/actives/actives.contract.d.ts.map +1 -1
- package/dist/actives/actives.contract.js +2 -0
- package/dist/actives/actives.contract.spec.d.ts +2 -0
- package/dist/actives/actives.contract.spec.d.ts.map +1 -0
- package/dist/actives/actives.contract.spec.js +35 -0
- package/dist/agent-client-links/agent-client-links.contract.d.ts +1087 -1087
- package/dist/auth/auth.contract.d.ts +108 -108
- package/dist/bookings/bookings.contract.d.ts +10131 -9939
- package/dist/bookings/bookings.contract.d.ts.map +1 -1
- package/dist/call-history/call-history.contract.d.ts +718 -718
- package/dist/calls-feed/calls-feed.contract.d.ts +86 -86
- package/dist/client-contacts/client-contacts.contract.d.ts +469 -469
- package/dist/clients/clients.contract.d.ts +203 -203
- package/dist/collaboration-checkings/collaboration-checkings.contract.d.ts +2713 -2713
- package/dist/collaborations/collaborations.contract.d.ts +2270 -2270
- package/dist/common/common-schemas.d.ts +12 -12
- package/dist/companies/companies.contract.d.ts +74 -74
- package/dist/crews/crews.contract.d.ts +253 -253
- package/dist/cron-executions/cron-executions.contract.d.ts +182 -182
- package/dist/curated-worker-leads/candidate-coordination.contract.d.ts +3353 -3353
- package/dist/curated-worker-leads/candidate-edit-session.contract.d.ts +20 -20
- package/dist/curated-worker-leads/consent-queue.contract.d.ts +196 -166
- package/dist/curated-worker-leads/consent-queue.contract.d.ts.map +1 -1
- package/dist/curated-worker-leads/curated-worker-lead-config.contract.d.ts +16 -16
- package/dist/curated-worker-leads/curated-worker-leads.contract.d.ts +2 -2
- package/dist/curated-worker-leads/jobs-tab.contract.d.ts +1192 -564
- package/dist/curated-worker-leads/jobs-tab.contract.d.ts.map +1 -1
- package/dist/curated-worker-leads/jobs-tab.contract.js +65 -2
- package/dist/curated-worker-leads/lead-agent-area.contract.d.ts +4 -4
- package/dist/curated-worker-leads/outreach-pool-summary.contract.spec.d.ts +2 -0
- package/dist/curated-worker-leads/outreach-pool-summary.contract.spec.d.ts.map +1 -0
- package/dist/curated-worker-leads/outreach-pool-summary.contract.spec.js +39 -0
- package/dist/curated-worker-leads/owned-jobs-tab.contract.d.ts +46 -46
- package/dist/curated-workers/curated-workers.contract.d.ts +789 -789
- package/dist/dashboards/agent-daily-metrics.contract.d.ts +2 -2
- package/dist/dashboards/dashboard-widgets.contract.d.ts +292 -292
- package/dist/dashboards/dashboard.contract.d.ts +12 -12
- package/dist/document-intake/document-intake.contract.d.ts +601 -601
- package/dist/export-jobs/export-jobs.contract.d.ts +572 -562
- package/dist/export-jobs/export-jobs.contract.d.ts.map +1 -1
- package/dist/exports-events/exports-events.schemas.d.ts +6 -6
- package/dist/files/files.contract.d.ts +74 -74
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/interactions/interactions.contract.d.ts +6 -6
- package/dist/job-clusters/job-clusters.contract.d.ts +112 -112
- package/dist/jobs/job-moderation-fields.spec.d.ts +2 -0
- package/dist/jobs/job-moderation-fields.spec.d.ts.map +1 -0
- package/dist/jobs/job-moderation-fields.spec.js +72 -0
- package/dist/jobs/jobs.contract.d.ts +7734 -7474
- package/dist/jobs/jobs.contract.d.ts.map +1 -1
- package/dist/jobs/jobs.contract.js +57 -0
- package/dist/kpi-impersonation/kpi-impersonation.contract.d.ts +141 -141
- package/dist/lead-assignments/lead-assignments.contract.d.ts +911 -911
- package/dist/lead-distribution/agent-lead-distribution.contract.d.ts +209 -209
- package/dist/lead-distribution/lead-distribution-config.contract.d.ts +77 -77
- package/dist/leads/leads.contract.d.ts +283 -283
- package/dist/locations/locations.contract.d.ts +49 -49
- package/dist/notifications/notifications.contract.d.ts +49 -49
- package/dist/offices/offices.contract.d.ts +34 -34
- package/dist/outreach/__tests__/outreach-claim.test.js +1 -0
- package/dist/outreach/__tests__/outreach-contract-additions.spec.d.ts +2 -0
- package/dist/outreach/__tests__/outreach-contract-additions.spec.d.ts.map +1 -0
- package/dist/outreach/__tests__/outreach-contract-additions.spec.js +89 -0
- package/dist/outreach/__tests__/outreach-requests.contract.spec.d.ts +2 -0
- package/dist/outreach/__tests__/outreach-requests.contract.spec.d.ts.map +1 -0
- package/dist/outreach/__tests__/outreach-requests.contract.spec.js +77 -0
- package/dist/outreach/__tests__/outreach-routes.test.js +14 -3
- package/dist/outreach/__tests__/outreach.schemas.test.js +5 -1
- package/dist/outreach/outreach-requests.contract.d.ts +1753 -0
- package/dist/outreach/outreach-requests.contract.d.ts.map +1 -0
- package/dist/outreach/outreach-requests.contract.js +154 -0
- package/dist/outreach/outreach-requests.schemas.d.ts +95 -0
- package/dist/outreach/outreach-requests.schemas.d.ts.map +1 -0
- package/dist/outreach/outreach-requests.schemas.js +63 -0
- package/dist/outreach/outreach.contract.d.ts +373 -101
- package/dist/outreach/outreach.contract.d.ts.map +1 -1
- package/dist/outreach/outreach.contract.js +18 -0
- package/dist/outreach/outreach.contract.spec.d.ts +2 -0
- package/dist/outreach/outreach.contract.spec.d.ts.map +1 -0
- package/dist/outreach/outreach.contract.spec.js +54 -0
- package/dist/outreach/outreach.schemas.d.ts +15 -10
- package/dist/outreach/outreach.schemas.d.ts.map +1 -1
- package/dist/outreach/outreach.schemas.js +5 -2
- package/dist/own-research/own-research.contract.d.ts +775 -775
- package/dist/postcodes/postcodes.contract.d.ts +24 -24
- package/dist/proofs/proof-type.enum.d.ts +4 -4
- package/dist/proofs/proofs.contract.d.ts +363 -363
- package/dist/proofs/proofs.dtos.d.ts +124 -124
- package/dist/qualifications/qualifications.contract.d.ts +38 -38
- package/dist/relay-pods/relay-pod-sessions.contract.d.ts +680 -0
- package/dist/relay-pods/relay-pod-sessions.contract.d.ts.map +1 -0
- package/dist/relay-pods/relay-pod-sessions.contract.js +67 -0
- package/dist/relay-pods/relay-pod-sessions.contract.spec.d.ts +2 -0
- package/dist/relay-pods/relay-pod-sessions.contract.spec.d.ts.map +1 -0
- package/dist/relay-pods/relay-pod-sessions.contract.spec.js +129 -0
- package/dist/relay-pods/relay-pods.contract.d.ts +1569 -0
- package/dist/relay-pods/relay-pods.contract.d.ts.map +1 -0
- package/dist/relay-pods/relay-pods.contract.js +188 -0
- package/dist/relay-pods/relay-pods.contract.spec.d.ts +2 -0
- package/dist/relay-pods/relay-pods.contract.spec.d.ts.map +1 -0
- package/dist/relay-pods/relay-pods.contract.spec.js +141 -0
- package/dist/relay-pods/relay-pods.schemas.d.ts +415 -0
- package/dist/relay-pods/relay-pods.schemas.d.ts.map +1 -0
- package/dist/relay-pods/relay-pods.schemas.js +112 -0
- package/dist/shared/live-booking.schema.d.ts +4 -4
- package/dist/shared/summary-schemas.d.ts +6 -6
- package/dist/sheets-sync/sheets-sync.contract.d.ts +939 -939
- package/dist/telegram/telegram.contract.d.ts +22 -22
- package/dist/trades/trades.contract.d.ts +90 -90
- package/dist/user-access-grants/user-access-grants.contract.d.ts +165 -165
- package/dist/users/__tests__/assignable-roles.spec.d.ts +2 -0
- package/dist/users/__tests__/assignable-roles.spec.d.ts.map +1 -0
- package/dist/users/__tests__/assignable-roles.spec.js +41 -0
- package/dist/users/users.contract.d.ts +399 -393
- package/dist/users/users.contract.d.ts.map +1 -1
- package/dist/users/users.contract.js +11 -0
- package/dist/worker-identity-cases/worker-identity-cases.contract.d.ts +585 -527
- package/dist/worker-identity-cases/worker-identity-cases.contract.d.ts.map +1 -1
- package/dist/worker-merge-proposals/worker-merge-proposals.contract.d.ts +278 -236
- package/dist/worker-merge-proposals/worker-merge-proposals.contract.d.ts.map +1 -1
- package/dist/worker-merge-proposals/worker-merge-proposals.contract.js +1 -0
- package/dist/worker-source-identity-conflicts/worker-source-identity-conflicts.contract.d.ts +153 -153
- package/dist/worker-source-identity-conflicts/worker-source-identity-conflicts.schemas.d.ts +59 -59
- package/dist/workers/workers.contract.d.ts +2919 -2919
- package/package.json +1 -1
- package/dist/bookings/bookings.contract.spec.d.ts +0 -2
- package/dist/bookings/bookings.contract.spec.d.ts.map +0 -1
- package/dist/bookings/bookings.contract.spec.js +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outreach-requests.contract.d.ts","sourceRoot":"","sources":["../../contracts/outreach/outreach-requests.contract.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,cAAc,6BAA6B,CAAC;AAI5C,2EAA2E;AAC3E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEM,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;EASM,CAAC;AAEnD,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIM,CAAC;AAEtD,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GpC,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.outreachRequestsContract = exports.ListOutreachRequestsResponseSchema = exports.CreateOutreachRequestBodySchema = exports.OutreachRequestQueueItemSchema = void 0;
|
|
18
|
+
/**
|
|
19
|
+
* Project: Internal Recruitment Platform API
|
|
20
|
+
* File: outreach-requests.contract.ts
|
|
21
|
+
*
|
|
22
|
+
* Description: Agents mark jobs for outreach; the rack works the queue.
|
|
23
|
+
*
|
|
24
|
+
* Two lanes share one router because ts-rest does not model auth: `create` and
|
|
25
|
+
* `cancel` are the agent's JWT, `list` / `start` / `complete` are the service
|
|
26
|
+
* key. The server enforces the split with different guards per controller — see
|
|
27
|
+
* outreach-requests.v2.controller.ts and outreach.v2.controller.ts.
|
|
28
|
+
*/
|
|
29
|
+
const core_1 = require("@ts-rest/core");
|
|
30
|
+
const zod_1 = require("zod");
|
|
31
|
+
const error_schemas_1 = require("../common/error-schemas");
|
|
32
|
+
const outreach_schemas_1 = require("./outreach.schemas");
|
|
33
|
+
const outreach_requests_schemas_1 = require("./outreach-requests.schemas");
|
|
34
|
+
__exportStar(require("./outreach-requests.schemas"), exports);
|
|
35
|
+
const c = (0, core_1.initContract)();
|
|
36
|
+
/** A queue row plus enough of the job to label a campaign in Relay Lab. */
|
|
37
|
+
exports.OutreachRequestQueueItemSchema = outreach_requests_schemas_1.OutreachRequestSchema.extend({
|
|
38
|
+
job: outreach_schemas_1.OutreachJobSchema,
|
|
39
|
+
}).openapi({ title: 'OutreachRequestQueueItem' });
|
|
40
|
+
exports.CreateOutreachRequestBodySchema = zod_1.z
|
|
41
|
+
.object({
|
|
42
|
+
jobId: zod_1.z.string().uuid().describe('Job to mark for outreach'),
|
|
43
|
+
targetPodId: zod_1.z
|
|
44
|
+
.string()
|
|
45
|
+
.uuid()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe('Explicit Relay pod target when more than one can be managed'),
|
|
48
|
+
})
|
|
49
|
+
.openapi({ title: 'CreateOutreachRequestBody' });
|
|
50
|
+
exports.ListOutreachRequestsResponseSchema = zod_1.z
|
|
51
|
+
.object({
|
|
52
|
+
items: zod_1.z.array(exports.OutreachRequestQueueItemSchema),
|
|
53
|
+
})
|
|
54
|
+
.openapi({ title: 'ListOutreachRequestsResponse' });
|
|
55
|
+
exports.outreachRequestsContract = c.router({
|
|
56
|
+
create: {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
path: '/outreach/requests',
|
|
59
|
+
body: exports.CreateOutreachRequestBodySchema,
|
|
60
|
+
responses: {
|
|
61
|
+
// A second "Start outreach" click is NOT an error: the route returns
|
|
62
|
+
// the existing open request so the button can render its state. There
|
|
63
|
+
// is deliberately no 409 here.
|
|
64
|
+
200: outreach_requests_schemas_1.OutreachRequestSchema,
|
|
65
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
66
|
+
},
|
|
67
|
+
summary: 'Mark a job for outreach',
|
|
68
|
+
description: 'Idempotent per job: if an open (PENDING or RUNNING) request already ' +
|
|
69
|
+
'exists it is returned unchanged. Snapshots the eligible-candidate ' +
|
|
70
|
+
'count onto the row at creation. 404 when the job does not exist or ' +
|
|
71
|
+
'is not open (AVAILABLE with a free position).',
|
|
72
|
+
metadata: { tags: ['Outreach'] },
|
|
73
|
+
},
|
|
74
|
+
cancel: {
|
|
75
|
+
method: 'POST',
|
|
76
|
+
path: '/outreach/requests/:id/cancel',
|
|
77
|
+
pathParams: zod_1.z.object({ id: zod_1.z.string().uuid() }),
|
|
78
|
+
body: zod_1.z.object({}),
|
|
79
|
+
responses: {
|
|
80
|
+
200: outreach_requests_schemas_1.OutreachRequestSchema,
|
|
81
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
82
|
+
409: error_schemas_1.ErrorResponseSchema,
|
|
83
|
+
},
|
|
84
|
+
summary: 'Withdraw an outreach request',
|
|
85
|
+
description: 'PENDING only. Rejects non-PENDING requests with 409. A successful ' +
|
|
86
|
+
'cancellation is terminal and frees the job for a new request.',
|
|
87
|
+
metadata: { tags: ['Outreach'] },
|
|
88
|
+
},
|
|
89
|
+
reassign: {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
path: '/outreach/requests/:id/reassign',
|
|
92
|
+
pathParams: zod_1.z.object({ id: zod_1.z.string().uuid() }),
|
|
93
|
+
body: zod_1.z.object({ targetPodId: zod_1.z.string().uuid() }).strict(),
|
|
94
|
+
responses: {
|
|
95
|
+
200: outreach_requests_schemas_1.OutreachRequestSchema,
|
|
96
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
97
|
+
409: error_schemas_1.ErrorResponseSchema,
|
|
98
|
+
},
|
|
99
|
+
summary: 'Reassign a pending outreach request to another Relay pod',
|
|
100
|
+
description: 'PENDING only. Rejects non-PENDING requests with 409. Returns the request with its updated assigned pod snapshot.',
|
|
101
|
+
metadata: { tags: ['Outreach'] },
|
|
102
|
+
},
|
|
103
|
+
list: {
|
|
104
|
+
method: 'GET',
|
|
105
|
+
path: '/outreach/requests',
|
|
106
|
+
query: zod_1.z.object({
|
|
107
|
+
status: outreach_requests_schemas_1.OutreachRequestStatusSchema.optional().describe('Narrow to one state. Default: PENDING and RUNNING.'),
|
|
108
|
+
}),
|
|
109
|
+
responses: {
|
|
110
|
+
200: exports.ListOutreachRequestsResponseSchema,
|
|
111
|
+
},
|
|
112
|
+
summary: 'The open outreach queue',
|
|
113
|
+
description: 'PENDING and RUNNING requests, oldest first, with job facts for ' +
|
|
114
|
+
'labelling. Service lane only — the service account still cannot ' +
|
|
115
|
+
'read jobs generally.',
|
|
116
|
+
metadata: { tags: ['Outreach'] },
|
|
117
|
+
},
|
|
118
|
+
start: {
|
|
119
|
+
method: 'POST',
|
|
120
|
+
path: '/outreach/requests/:id/start',
|
|
121
|
+
pathParams: zod_1.z.object({ id: zod_1.z.string().uuid() }),
|
|
122
|
+
body: zod_1.z.object({}),
|
|
123
|
+
responses: {
|
|
124
|
+
200: outreach_requests_schemas_1.OutreachRequestSchema,
|
|
125
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
126
|
+
},
|
|
127
|
+
summary: 'Mark a request as being worked',
|
|
128
|
+
description: 'PENDING -> RUNNING. Idempotent: starting a RUNNING request returns ' +
|
|
129
|
+
'it unchanged. Starting a terminal request is a 404.',
|
|
130
|
+
metadata: { tags: ['Outreach'] },
|
|
131
|
+
},
|
|
132
|
+
complete: {
|
|
133
|
+
method: 'POST',
|
|
134
|
+
path: '/outreach/requests/:id/complete',
|
|
135
|
+
pathParams: zod_1.z.object({ id: zod_1.z.string().uuid() }),
|
|
136
|
+
body: zod_1.z.object({}),
|
|
137
|
+
responses: {
|
|
138
|
+
200: outreach_requests_schemas_1.OutreachRequestSchema,
|
|
139
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
140
|
+
},
|
|
141
|
+
summary: 'Mark a request as drained or ended',
|
|
142
|
+
description: 'RUNNING -> COMPLETED. Terminal; frees the job for a new ' +
|
|
143
|
+
'request. Completing an already COMPLETED request is a 200 no-op.',
|
|
144
|
+
metadata: { tags: ['Outreach'] },
|
|
145
|
+
},
|
|
146
|
+
}, {
|
|
147
|
+
pathPrefix: '/v2',
|
|
148
|
+
commonResponses: {
|
|
149
|
+
400: error_schemas_1.ErrorResponseSchema,
|
|
150
|
+
401: error_schemas_1.ErrorResponseSchema,
|
|
151
|
+
403: error_schemas_1.ErrorResponseSchema,
|
|
152
|
+
500: error_schemas_1.ErrorResponseSchema,
|
|
153
|
+
},
|
|
154
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* `COMPLETED` and `CANCELLED` are terminal and free the job for a new
|
|
4
|
+
* request. The invariant that at most one PENDING-or-RUNNING request exists
|
|
5
|
+
* per job is a partial unique index in the database, not an application
|
|
6
|
+
* check — mirroring uq_candidate_contact_sessions_active_canonical, which is
|
|
7
|
+
* the real guarantee behind the claim path.
|
|
8
|
+
*/
|
|
9
|
+
export declare const OutreachRequestStatusSchema: z.ZodEnum<["PENDING", "RUNNING", "COMPLETED", "CANCELLED"]>;
|
|
10
|
+
export type OutreachRequestStatus = z.infer<typeof OutreachRequestStatusSchema>;
|
|
11
|
+
/**
|
|
12
|
+
* `eligibleAtRequest` is a POINT-IN-TIME snapshot taken when the request was
|
|
13
|
+
* raised, not a live figure. The pool changes on every send, and refreshing it
|
|
14
|
+
* would reintroduce the per-job counting cost this design avoids on the feed.
|
|
15
|
+
* The live number is whatever claim-next finds. Label it as a snapshot.
|
|
16
|
+
*/
|
|
17
|
+
export declare const OutreachRequestSchema: z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
jobId: z.ZodString;
|
|
20
|
+
requestedByUserId: z.ZodString;
|
|
21
|
+
status: z.ZodEnum<["PENDING", "RUNNING", "COMPLETED", "CANCELLED"]>;
|
|
22
|
+
eligibleAtRequest: z.ZodNumber;
|
|
23
|
+
requestedByName: z.ZodNullable<z.ZodString>;
|
|
24
|
+
contactedCount: z.ZodNumber;
|
|
25
|
+
createdAt: z.ZodString;
|
|
26
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
27
|
+
completedAt: z.ZodNullable<z.ZodString>;
|
|
28
|
+
assignedPod: z.ZodNullable<z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
slug: z.ZodString;
|
|
31
|
+
displayName: z.ZodString;
|
|
32
|
+
ownerUserId: z.ZodString;
|
|
33
|
+
ownerName: z.ZodNullable<z.ZodString>;
|
|
34
|
+
publicBaseUrl: z.ZodEffects<z.ZodString, string, string>;
|
|
35
|
+
status: z.ZodEnum<["ACTIVE", "INACTIVE"]>;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
id: string;
|
|
38
|
+
status: "ACTIVE" | "INACTIVE";
|
|
39
|
+
slug: string;
|
|
40
|
+
displayName: string;
|
|
41
|
+
ownerUserId: string;
|
|
42
|
+
ownerName: string | null;
|
|
43
|
+
publicBaseUrl: string;
|
|
44
|
+
}, {
|
|
45
|
+
id: string;
|
|
46
|
+
status: "ACTIVE" | "INACTIVE";
|
|
47
|
+
slug: string;
|
|
48
|
+
displayName: string;
|
|
49
|
+
ownerUserId: string;
|
|
50
|
+
ownerName: string | null;
|
|
51
|
+
publicBaseUrl: string;
|
|
52
|
+
}>>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
id: string;
|
|
55
|
+
jobId: string;
|
|
56
|
+
requestedByUserId: string;
|
|
57
|
+
status: "PENDING" | "RUNNING" | "COMPLETED" | "CANCELLED";
|
|
58
|
+
eligibleAtRequest: number;
|
|
59
|
+
requestedByName: string | null;
|
|
60
|
+
contactedCount: number;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
startedAt: string | null;
|
|
63
|
+
completedAt: string | null;
|
|
64
|
+
assignedPod: {
|
|
65
|
+
id: string;
|
|
66
|
+
status: "ACTIVE" | "INACTIVE";
|
|
67
|
+
slug: string;
|
|
68
|
+
displayName: string;
|
|
69
|
+
ownerUserId: string;
|
|
70
|
+
ownerName: string | null;
|
|
71
|
+
publicBaseUrl: string;
|
|
72
|
+
} | null;
|
|
73
|
+
}, {
|
|
74
|
+
id: string;
|
|
75
|
+
jobId: string;
|
|
76
|
+
requestedByUserId: string;
|
|
77
|
+
status: "PENDING" | "RUNNING" | "COMPLETED" | "CANCELLED";
|
|
78
|
+
eligibleAtRequest: number;
|
|
79
|
+
requestedByName: string | null;
|
|
80
|
+
contactedCount: number;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
startedAt: string | null;
|
|
83
|
+
completedAt: string | null;
|
|
84
|
+
assignedPod: {
|
|
85
|
+
id: string;
|
|
86
|
+
status: "ACTIVE" | "INACTIVE";
|
|
87
|
+
slug: string;
|
|
88
|
+
displayName: string;
|
|
89
|
+
ownerUserId: string;
|
|
90
|
+
ownerName: string | null;
|
|
91
|
+
publicBaseUrl: string;
|
|
92
|
+
} | null;
|
|
93
|
+
}>;
|
|
94
|
+
export type OutreachRequest = z.infer<typeof OutreachRequestSchema>;
|
|
95
|
+
//# sourceMappingURL=outreach-requests.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outreach-requests.schemas.d.ts","sourceRoot":"","sources":["../../contracts/outreach/outreach-requests.schemas.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,6DAEM,CAAC;AAE/C,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBM,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutreachRequestSchema = exports.OutreachRequestStatusSchema = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Project: Internal Recruitment Platform API
|
|
6
|
+
* File: outreach-requests.schemas.ts
|
|
7
|
+
*
|
|
8
|
+
* Description: The outreach REQUEST queue — an agent marks a job for outreach,
|
|
9
|
+
* the rack polls the queue and launches a campaign against it.
|
|
10
|
+
*
|
|
11
|
+
* Split out of outreach-requests.contract.ts so jobs-tab.contract.ts can import
|
|
12
|
+
* the status enum for its feed-card payload without importing a ts-rest router.
|
|
13
|
+
*
|
|
14
|
+
* Auth: two lanes. Creating and cancelling is a human agent's JWT; listing,
|
|
15
|
+
* starting and completing is the service account's Bearer key — the same key
|
|
16
|
+
* the claim routes already accept.
|
|
17
|
+
*/
|
|
18
|
+
const zod_openapi_1 = require("@anatine/zod-openapi");
|
|
19
|
+
const zod_1 = require("zod");
|
|
20
|
+
const relay_pods_schemas_1 = require("../relay-pods/relay-pods.schemas");
|
|
21
|
+
(0, zod_openapi_1.extendZodWithOpenApi)(zod_1.z);
|
|
22
|
+
/**
|
|
23
|
+
* `COMPLETED` and `CANCELLED` are terminal and free the job for a new
|
|
24
|
+
* request. The invariant that at most one PENDING-or-RUNNING request exists
|
|
25
|
+
* per job is a partial unique index in the database, not an application
|
|
26
|
+
* check — mirroring uq_candidate_contact_sessions_active_canonical, which is
|
|
27
|
+
* the real guarantee behind the claim path.
|
|
28
|
+
*/
|
|
29
|
+
exports.OutreachRequestStatusSchema = zod_1.z
|
|
30
|
+
.enum(['PENDING', 'RUNNING', 'COMPLETED', 'CANCELLED'])
|
|
31
|
+
.openapi({ title: 'OutreachRequestStatus' });
|
|
32
|
+
/**
|
|
33
|
+
* `eligibleAtRequest` is a POINT-IN-TIME snapshot taken when the request was
|
|
34
|
+
* raised, not a live figure. The pool changes on every send, and refreshing it
|
|
35
|
+
* would reintroduce the per-job counting cost this design avoids on the feed.
|
|
36
|
+
* The live number is whatever claim-next finds. Label it as a snapshot.
|
|
37
|
+
*/
|
|
38
|
+
exports.OutreachRequestSchema = zod_1.z
|
|
39
|
+
.object({
|
|
40
|
+
id: zod_1.z.string().uuid(),
|
|
41
|
+
jobId: zod_1.z.string().uuid(),
|
|
42
|
+
requestedByUserId: zod_1.z.string().uuid(),
|
|
43
|
+
status: exports.OutreachRequestStatusSchema,
|
|
44
|
+
eligibleAtRequest: zod_1.z
|
|
45
|
+
.number()
|
|
46
|
+
.int()
|
|
47
|
+
.min(0)
|
|
48
|
+
.describe('Eligible candidates counted when the request was raised'),
|
|
49
|
+
requestedByName: zod_1.z
|
|
50
|
+
.string()
|
|
51
|
+
.nullable()
|
|
52
|
+
.describe('Agent who raised the request'),
|
|
53
|
+
contactedCount: zod_1.z
|
|
54
|
+
.number()
|
|
55
|
+
.int()
|
|
56
|
+
.min(0)
|
|
57
|
+
.describe('Sends confirmed against this job so far'),
|
|
58
|
+
createdAt: zod_1.z.string().datetime(),
|
|
59
|
+
startedAt: zod_1.z.string().datetime().nullable(),
|
|
60
|
+
completedAt: zod_1.z.string().datetime().nullable(),
|
|
61
|
+
assignedPod: relay_pods_schemas_1.RelayPodSummarySchema.nullable(),
|
|
62
|
+
})
|
|
63
|
+
.openapi({ title: 'OutreachRequest' });
|