@ttctl/core 0.0.0 → 0.1.0-rc.1
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/README.md +49 -9
- package/dist/__generated__/gateway.d.ts +4546 -0
- package/dist/__generated__/gateway.d.ts.map +1 -0
- package/dist/__generated__/gateway.js +9 -0
- package/dist/__generated__/gateway.js.map +1 -0
- package/dist/__generated__/talent-profile-zod-schemas.d.ts +1187 -0
- package/dist/__generated__/talent-profile-zod-schemas.d.ts.map +1 -0
- package/dist/__generated__/talent-profile-zod-schemas.js +1136 -0
- package/dist/__generated__/talent-profile-zod-schemas.js.map +1 -0
- package/dist/__generated__/talent-profile.d.ts +1397 -0
- package/dist/__generated__/talent-profile.d.ts.map +1 -0
- package/dist/__generated__/talent-profile.js +9 -0
- package/dist/__generated__/talent-profile.js.map +1 -0
- package/dist/__generated__/zod-schemas.d.ts +2895 -0
- package/dist/__generated__/zod-schemas.d.ts.map +1 -0
- package/dist/__generated__/zod-schemas.js +3121 -0
- package/dist/__generated__/zod-schemas.js.map +1 -0
- package/dist/__tests__/fixtures/profile/builders.d.ts +74 -0
- package/dist/__tests__/fixtures/profile/builders.d.ts.map +1 -0
- package/dist/__tests__/fixtures/profile/builders.js +196 -0
- package/dist/__tests__/fixtures/profile/builders.js.map +1 -0
- package/dist/__tests__/fixtures/profile/data.d.ts +39 -0
- package/dist/__tests__/fixtures/profile/data.d.ts.map +1 -0
- package/dist/__tests__/fixtures/profile/data.js +230 -0
- package/dist/__tests__/fixtures/profile/data.js.map +1 -0
- package/dist/__tests__/fixtures/profile/index.d.ts +9 -0
- package/dist/__tests__/fixtures/profile/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/profile/index.js +10 -0
- package/dist/__tests__/fixtures/profile/index.js.map +1 -0
- package/dist/__tests__/fixtures/profile/types.d.ts +53 -0
- package/dist/__tests__/fixtures/profile/types.d.ts.map +1 -0
- package/dist/__tests__/fixtures/profile/types.js +4 -0
- package/dist/__tests__/fixtures/profile/types.js.map +1 -0
- package/dist/auth/errors.d.ts +82 -0
- package/dist/auth/errors.d.ts.map +1 -0
- package/dist/auth/errors.js +68 -0
- package/dist/auth/errors.js.map +1 -0
- package/dist/auth.d.ts +192 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +294 -0
- package/dist/auth.js.map +1 -0
- package/dist/config.d.ts +212 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +349 -0
- package/dist/config.js.map +1 -0
- package/dist/configLock.d.ts +50 -0
- package/dist/configLock.d.ts.map +1 -0
- package/dist/configLock.js +88 -0
- package/dist/configLock.js.map +1 -0
- package/dist/configWriter.d.ts +97 -0
- package/dist/configWriter.d.ts.map +1 -0
- package/dist/configWriter.js +687 -0
- package/dist/configWriter.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/kill-switch.d.ts +161 -0
- package/dist/kill-switch.d.ts.map +1 -0
- package/dist/kill-switch.js +235 -0
- package/dist/kill-switch.js.map +1 -0
- package/dist/lib/date.d.ts +58 -0
- package/dist/lib/date.d.ts.map +1 -0
- package/dist/lib/date.js +104 -0
- package/dist/lib/date.js.map +1 -0
- package/dist/lib/diagnostic-log.d.ts +159 -0
- package/dist/lib/diagnostic-log.d.ts.map +1 -0
- package/dist/lib/diagnostic-log.js +186 -0
- package/dist/lib/diagnostic-log.js.map +1 -0
- package/dist/lib/package-version.d.ts +19 -0
- package/dist/lib/package-version.d.ts.map +1 -0
- package/dist/lib/package-version.js +38 -0
- package/dist/lib/package-version.js.map +1 -0
- package/dist/lib/redact.d.ts +153 -0
- package/dist/lib/redact.d.ts.map +1 -0
- package/dist/lib/redact.js +207 -0
- package/dist/lib/redact.js.map +1 -0
- package/dist/lib/text.d.ts +14 -0
- package/dist/lib/text.d.ts.map +1 -0
- package/dist/lib/text.js +21 -0
- package/dist/lib/text.js.map +1 -0
- package/dist/lib/wire-shape.d.ts +131 -0
- package/dist/lib/wire-shape.d.ts.map +1 -0
- package/dist/lib/wire-shape.js +376 -0
- package/dist/lib/wire-shape.js.map +1 -0
- package/dist/onepassword.d.ts +29 -0
- package/dist/onepassword.d.ts.map +1 -0
- package/dist/onepassword.js +112 -0
- package/dist/onepassword.js.map +1 -0
- package/dist/services/_shared/transport.d.ts +148 -0
- package/dist/services/_shared/transport.d.ts.map +1 -0
- package/dist/services/_shared/transport.js +102 -0
- package/dist/services/_shared/transport.js.map +1 -0
- package/dist/services/applications/index.d.ts +210 -0
- package/dist/services/applications/index.d.ts.map +1 -0
- package/dist/services/applications/index.js +240 -0
- package/dist/services/applications/index.js.map +1 -0
- package/dist/services/availability/index.d.ts +254 -0
- package/dist/services/availability/index.d.ts.map +1 -0
- package/dist/services/availability/index.js +310 -0
- package/dist/services/availability/index.js.map +1 -0
- package/dist/services/contracts/index.d.ts +132 -0
- package/dist/services/contracts/index.d.ts.map +1 -0
- package/dist/services/contracts/index.js +211 -0
- package/dist/services/contracts/index.js.map +1 -0
- package/dist/services/engagements/index.d.ts +504 -0
- package/dist/services/engagements/index.d.ts.map +1 -0
- package/dist/services/engagements/index.js +613 -0
- package/dist/services/engagements/index.js.map +1 -0
- package/dist/services/jobs/index.d.ts +490 -0
- package/dist/services/jobs/index.d.ts.map +1 -0
- package/dist/services/jobs/index.js +753 -0
- package/dist/services/jobs/index.js.map +1 -0
- package/dist/services/payments/index.d.ts +415 -0
- package/dist/services/payments/index.d.ts.map +1 -0
- package/dist/services/payments/index.js +636 -0
- package/dist/services/payments/index.js.map +1 -0
- package/dist/services/profile/__tests__/fixtures.d.ts +214 -0
- package/dist/services/profile/__tests__/fixtures.d.ts.map +1 -0
- package/dist/services/profile/__tests__/fixtures.js +176 -0
- package/dist/services/profile/__tests__/fixtures.js.map +1 -0
- package/dist/services/profile/basic/index.d.ts +390 -0
- package/dist/services/profile/basic/index.d.ts.map +1 -0
- package/dist/services/profile/basic/index.js +1007 -0
- package/dist/services/profile/basic/index.js.map +1 -0
- package/dist/services/profile/certifications/index.d.ts +74 -0
- package/dist/services/profile/certifications/index.d.ts.map +1 -0
- package/dist/services/profile/certifications/index.js +169 -0
- package/dist/services/profile/certifications/index.js.map +1 -0
- package/dist/services/profile/education/index.d.ts +73 -0
- package/dist/services/profile/education/index.d.ts.map +1 -0
- package/dist/services/profile/education/index.js +168 -0
- package/dist/services/profile/education/index.js.map +1 -0
- package/dist/services/profile/employment/index.d.ts +111 -0
- package/dist/services/profile/employment/index.d.ts.map +1 -0
- package/dist/services/profile/employment/index.js +202 -0
- package/dist/services/profile/employment/index.js.map +1 -0
- package/dist/services/profile/external/index.d.ts +219 -0
- package/dist/services/profile/external/index.d.ts.map +1 -0
- package/dist/services/profile/external/index.js +560 -0
- package/dist/services/profile/external/index.js.map +1 -0
- package/dist/services/profile/index.d.ts +24 -0
- package/dist/services/profile/index.d.ts.map +1 -0
- package/dist/services/profile/index.js +26 -0
- package/dist/services/profile/index.js.map +1 -0
- package/dist/services/profile/industries/index.d.ts +130 -0
- package/dist/services/profile/industries/index.d.ts.map +1 -0
- package/dist/services/profile/industries/index.js +292 -0
- package/dist/services/profile/industries/index.js.map +1 -0
- package/dist/services/profile/portfolio/index.d.ts +352 -0
- package/dist/services/profile/portfolio/index.d.ts.map +1 -0
- package/dist/services/profile/portfolio/index.js +833 -0
- package/dist/services/profile/portfolio/index.js.map +1 -0
- package/dist/services/profile/resume/index.d.ts +60 -0
- package/dist/services/profile/resume/index.d.ts.map +1 -0
- package/dist/services/profile/resume/index.js +212 -0
- package/dist/services/profile/resume/index.js.map +1 -0
- package/dist/services/profile/reviews/index.d.ts +137 -0
- package/dist/services/profile/reviews/index.d.ts.map +1 -0
- package/dist/services/profile/reviews/index.js +431 -0
- package/dist/services/profile/reviews/index.js.map +1 -0
- package/dist/services/profile/shared.d.ts +127 -0
- package/dist/services/profile/shared.d.ts.map +1 -0
- package/dist/services/profile/shared.js +155 -0
- package/dist/services/profile/shared.js.map +1 -0
- package/dist/services/profile/skills/index.d.ts +212 -0
- package/dist/services/profile/skills/index.d.ts.map +1 -0
- package/dist/services/profile/skills/index.js +461 -0
- package/dist/services/profile/skills/index.js.map +1 -0
- package/dist/services/profile/visas/index.d.ts +74 -0
- package/dist/services/profile/visas/index.d.ts.map +1 -0
- package/dist/services/profile/visas/index.js +306 -0
- package/dist/services/profile/visas/index.js.map +1 -0
- package/dist/services/timesheet/index.d.ts +326 -0
- package/dist/services/timesheet/index.d.ts.map +1 -0
- package/dist/services/timesheet/index.js +324 -0
- package/dist/services/timesheet/index.js.map +1 -0
- package/dist/services/translations.d.ts +79 -0
- package/dist/services/translations.d.ts.map +1 -0
- package/dist/services/translations.js +136 -0
- package/dist/services/translations.js.map +1 -0
- package/dist/transport-resilience.d.ts +136 -0
- package/dist/transport-resilience.d.ts.map +1 -0
- package/dist/transport-resilience.js +247 -0
- package/dist/transport-resilience.js.map +1 -0
- package/dist/transport.d.ts +408 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +691 -0
- package/dist/transport.js.map +1 -0
- package/dist/types.d.ts +41 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +18 -0
- package/dist/types.js.map +1 -0
- package/package.json +40 -12
- package/index.js +0 -7
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { callGatewayShared } from "../_shared/transport.js";
|
|
4
|
+
export class ApplicationsError extends Error {
|
|
5
|
+
code;
|
|
6
|
+
name = "ApplicationsError";
|
|
7
|
+
constructor(code, message, options) {
|
|
8
|
+
super(message, options);
|
|
9
|
+
this.code = code;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The five known values of `JobActivityItemStatusGroupEnum` from the
|
|
14
|
+
* synthesized schema (`../research/graphql/gateway/schema.graphql`
|
|
15
|
+
* line 176). Re-declared here as a literal-typed tuple so consumers
|
|
16
|
+
* (CLI flag validation, MCP `z.enum`, `stats()` iteration) share one
|
|
17
|
+
* source of truth without depending on the codegen output.
|
|
18
|
+
*
|
|
19
|
+
* Order matches the schema declaration. `stats()` iterates this array
|
|
20
|
+
* to issue one count call per group.
|
|
21
|
+
*/
|
|
22
|
+
export const STATUS_GROUPS = [
|
|
23
|
+
"ACTIVE_ENGAGEMENT",
|
|
24
|
+
"ARCHIVED",
|
|
25
|
+
"CLOSED_ENGAGEMENT",
|
|
26
|
+
"ON_CLIENT_REVIEW",
|
|
27
|
+
"ON_RECRUITER_REVIEW",
|
|
28
|
+
];
|
|
29
|
+
// ---------------------------------------------------------------------
|
|
30
|
+
// GraphQL operation strings (full-document queries — no APQ pinning)
|
|
31
|
+
//
|
|
32
|
+
// Mirror `../research/graphql/gateway/operations/mobile/JobActivityItems.graphql`
|
|
33
|
+
// and `JobActivityItem.graphql`, but with selection sets trimmed to the
|
|
34
|
+
// shape this service surfaces. The operation NAMES are kept verbatim so
|
|
35
|
+
// any future server-side allowlisting that gates on operation name
|
|
36
|
+
// continues to recognize them.
|
|
37
|
+
//
|
|
38
|
+
// **Schema gap acknowledged**: the synthesized SDL at
|
|
39
|
+
// `../research/graphql/gateway/schema.graphql` declares
|
|
40
|
+
// `viewer.jobActivityList: JobActivityList!` and
|
|
41
|
+
// `viewer.jobActivityItem: TalentJobActivityItem!` with NO arguments.
|
|
42
|
+
// The captured operation passes `keywords`, `onlyStatusGroupFilter`,
|
|
43
|
+
// `id` — empirically these work (the mobile app sends them daily). The
|
|
44
|
+
// E2E tests are the authority on this contract.
|
|
45
|
+
// ---------------------------------------------------------------------
|
|
46
|
+
const JOB_ACTIVITY_LIST_QUERY = `query JobActivityItems($keywords: [String!], $onlyStatusGroupFilter: [JobActivityItemStatusGroupEnum!]) {
|
|
47
|
+
viewer {
|
|
48
|
+
__typename
|
|
49
|
+
id
|
|
50
|
+
jobActivityList(keywords: $keywords, statusGroupV2: { only: $onlyStatusGroupFilter }) {
|
|
51
|
+
__typename
|
|
52
|
+
entities {
|
|
53
|
+
__typename
|
|
54
|
+
id
|
|
55
|
+
statusV2 { __typename value verbose }
|
|
56
|
+
statusGroupV2 { __typename value verbose }
|
|
57
|
+
statusColor
|
|
58
|
+
lastUpdatedAt
|
|
59
|
+
job {
|
|
60
|
+
__typename
|
|
61
|
+
id
|
|
62
|
+
title
|
|
63
|
+
url
|
|
64
|
+
client { __typename id fullName }
|
|
65
|
+
}
|
|
66
|
+
jobApplication { __typename id }
|
|
67
|
+
engagement { __typename id }
|
|
68
|
+
availabilityRequest { __typename id }
|
|
69
|
+
interview { __typename id }
|
|
70
|
+
}
|
|
71
|
+
totalCount
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}`;
|
|
75
|
+
const JOB_ACTIVITY_ITEM_QUERY = `query JobActivityItem($id: ID!) {
|
|
76
|
+
viewer {
|
|
77
|
+
__typename
|
|
78
|
+
id
|
|
79
|
+
jobActivityItem(id: $id) {
|
|
80
|
+
__typename
|
|
81
|
+
id
|
|
82
|
+
statusV2 { __typename value verbose }
|
|
83
|
+
statusGroupV2 { __typename value verbose }
|
|
84
|
+
statusColor
|
|
85
|
+
lastUpdatedAt
|
|
86
|
+
job {
|
|
87
|
+
__typename
|
|
88
|
+
id
|
|
89
|
+
title
|
|
90
|
+
url
|
|
91
|
+
descriptionMd
|
|
92
|
+
expectedHours
|
|
93
|
+
startDate
|
|
94
|
+
postedWhen
|
|
95
|
+
commitment { __typename slug }
|
|
96
|
+
workType { __typename slug }
|
|
97
|
+
specialization { __typename title }
|
|
98
|
+
estimatedLength { __typename enumValue }
|
|
99
|
+
isCoaching
|
|
100
|
+
isToptalProject
|
|
101
|
+
client { __typename id fullName }
|
|
102
|
+
}
|
|
103
|
+
jobApplication {
|
|
104
|
+
__typename
|
|
105
|
+
id
|
|
106
|
+
requestedHourlyRate { __typename decimal }
|
|
107
|
+
}
|
|
108
|
+
engagement {
|
|
109
|
+
__typename
|
|
110
|
+
id
|
|
111
|
+
startDate
|
|
112
|
+
endDate
|
|
113
|
+
commitment { __typename slug }
|
|
114
|
+
expectedHours
|
|
115
|
+
}
|
|
116
|
+
availabilityRequest { __typename id }
|
|
117
|
+
interview { __typename id }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}`;
|
|
121
|
+
/**
|
|
122
|
+
* Thin per-service wrapper around {@link callGatewayShared} (issue
|
|
123
|
+
* #329). Pins the mobile-gateway surface, the {@link ApplicationsError}
|
|
124
|
+
* domain class, and the `requireViewer` flag — every `applications`
|
|
125
|
+
* response carries `viewer` and we surface a `NO_VIEWER` whenever
|
|
126
|
+
* the session is technically valid but no viewer is bound. The
|
|
127
|
+
* generic constraint mirrors the previous local helper so call sites
|
|
128
|
+
* stay type-checked.
|
|
129
|
+
*/
|
|
130
|
+
async function callGateway(token, operationName, query, variables, schema) {
|
|
131
|
+
return callGatewayShared("mobile-gateway", token, operationName, query, variables, ApplicationsError, { schema, requireViewer: true });
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* List the signed-in user's job activity items (applications,
|
|
135
|
+
* availability requests, interviews, engagements).
|
|
136
|
+
*
|
|
137
|
+
* Default scope is whatever the server returns when neither filter is
|
|
138
|
+
* supplied (empirically the full unpaginated set, capped at the
|
|
139
|
+
* server's default limit). The returned array preserves server order;
|
|
140
|
+
* the CLI / MCP do not re-sort.
|
|
141
|
+
*
|
|
142
|
+
* **AC scope adjustment** (per #15 user decision 2026-05-10): the
|
|
143
|
+
* operation accepts NO date filter and NO pagination args. `--from` /
|
|
144
|
+
* `--to` and `--page` / `--per-page` flags are deliberately not exposed
|
|
145
|
+
* by this leaf; the AC items that referenced them are deferred. See
|
|
146
|
+
* `.tmp/workitem-15.md` § Open Questions (RESOLVED) for the rationale.
|
|
147
|
+
*/
|
|
148
|
+
export async function list(token, opts = {}) {
|
|
149
|
+
const variables = {};
|
|
150
|
+
if (opts.keywords !== undefined && opts.keywords.length > 0) {
|
|
151
|
+
variables["keywords"] = opts.keywords;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
variables["keywords"] = null;
|
|
155
|
+
}
|
|
156
|
+
if (opts.statusGroups !== undefined && opts.statusGroups.length > 0) {
|
|
157
|
+
variables["onlyStatusGroupFilter"] = opts.statusGroups;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
variables["onlyStatusGroupFilter"] = null;
|
|
161
|
+
}
|
|
162
|
+
const data = await callGateway(token, "JobActivityItems", JOB_ACTIVITY_LIST_QUERY, variables);
|
|
163
|
+
// The cast above is the awkward part of dropping codegen here; the
|
|
164
|
+
// shape narrowing below is the single source of runtime truth.
|
|
165
|
+
if (data.viewer === null || data.viewer.jobActivityList === null) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
return data.viewer.jobActivityList.entities ?? [];
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Fetch a single activity item by id.
|
|
172
|
+
*
|
|
173
|
+
* Throws `ApplicationsError("NOT_FOUND")` for two distinct wire shapes
|
|
174
|
+
* — both meaning "id doesn't resolve to a viewable item":
|
|
175
|
+
*
|
|
176
|
+
* 1. **Top-level GraphQL error `Record not found`** (the empirical
|
|
177
|
+
* happy-sad path — verified live on 2026-05-10). The gateway
|
|
178
|
+
* short-circuits with a top-level `errors[]` carrying the literal
|
|
179
|
+
* message "Record not found" rather than returning `data: null`.
|
|
180
|
+
* `callGateway` raises `GRAPHQL_ERROR`; we catch and translate.
|
|
181
|
+
* 2. **Successful response with `viewer.jobActivityItem === null`** —
|
|
182
|
+
* not observed in practice but kept as defensive coverage in case
|
|
183
|
+
* the gateway ever switches to the data-shape sentinel.
|
|
184
|
+
*/
|
|
185
|
+
const NOT_FOUND_MESSAGE_PATTERN = /Record not found/i;
|
|
186
|
+
export async function show(token, id) {
|
|
187
|
+
let data;
|
|
188
|
+
try {
|
|
189
|
+
data = await callGateway(token, "JobActivityItem", JOB_ACTIVITY_ITEM_QUERY, { id });
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
if (err instanceof ApplicationsError &&
|
|
193
|
+
err.code === "GRAPHQL_ERROR" &&
|
|
194
|
+
NOT_FOUND_MESSAGE_PATTERN.test(err.message)) {
|
|
195
|
+
throw new ApplicationsError("NOT_FOUND", `No activity item found with id "${id}" (or you don't have access to it).`, { cause: err });
|
|
196
|
+
}
|
|
197
|
+
throw err;
|
|
198
|
+
}
|
|
199
|
+
if (data.viewer === null) {
|
|
200
|
+
// unreachable in practice — `callGateway` already threw — but the
|
|
201
|
+
// null check keeps the type narrowing clean.
|
|
202
|
+
throw new ApplicationsError("NO_VIEWER", "Session is valid but no viewer is bound to it.");
|
|
203
|
+
}
|
|
204
|
+
if (data.viewer.jobActivityItem === null) {
|
|
205
|
+
throw new ApplicationsError("NOT_FOUND", `No activity item found with id "${id}" (or you don't have access to it).`);
|
|
206
|
+
}
|
|
207
|
+
return data.viewer.jobActivityItem;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Aggregate per-status-group counts plus the overall total. Issues N+1
|
|
211
|
+
* `JobActivityItems` calls — one per `JobActivityItemStatusGroupEnum`
|
|
212
|
+
* value — in parallel via `Promise.all`. Each call's
|
|
213
|
+
* `data.viewer.jobActivityList.totalCount` is a server-provided
|
|
214
|
+
* scalar; the helper does NOT count the returned `entities` array
|
|
215
|
+
* (which would be the synthesis the AC forbids).
|
|
216
|
+
*
|
|
217
|
+
* `total` is the sum of per-group counts. The unfiltered call's
|
|
218
|
+
* `totalCount` would yield the same number; we don't issue an extra
|
|
219
|
+
* call to verify because the per-group sum is already authoritative.
|
|
220
|
+
*
|
|
221
|
+
* **Failure mode**: `Promise.all` rejects on the first failed call. A
|
|
222
|
+
* single GraphQL error on one of the 5 groups loses the 4 successful
|
|
223
|
+
* counts. This is intentional: `applications stats` is an aggregate;
|
|
224
|
+
* surfacing partial counts (e.g. "118 total" when one group's call
|
|
225
|
+
* failed) would be misleading because the user reads `total` as
|
|
226
|
+
* authoritative. The right behavior on partial failure is "show no
|
|
227
|
+
* stats and surface the error" — the caller (`runApplicationsStats`)
|
|
228
|
+
* routes the rejection through the structured error envelope so the
|
|
229
|
+
* user knows exactly what went wrong.
|
|
230
|
+
*/
|
|
231
|
+
export async function stats(token) {
|
|
232
|
+
const groupResults = await Promise.all(STATUS_GROUPS.map(async (group) => {
|
|
233
|
+
const data = await callGateway(token, "JobActivityItems", JOB_ACTIVITY_LIST_QUERY, { keywords: null, onlyStatusGroupFilter: [group] });
|
|
234
|
+
const count = data.viewer?.jobActivityList?.totalCount ?? 0;
|
|
235
|
+
return { name: group, count };
|
|
236
|
+
}));
|
|
237
|
+
const total = groupResults.reduce((sum, g) => sum + g.count, 0);
|
|
238
|
+
return { total, groups: groupResults };
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/applications/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAyDpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA0B5D,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAGxB;IAFA,IAAI,GAAG,mBAAmB,CAAC;IAC7C,YACkB,IAA2B,EAC3C,OAAe,EACf,OAA6B;QAE7B,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAJR,SAAI,GAAJ,IAAI,CAAuB;IAK7C,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,mBAAmB;IACnB,UAAU;IACV,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;CACb,CAAC;AAsHX,wEAAwE;AACxE,qEAAqE;AACrE,EAAE;AACF,kFAAkF;AAClF,wEAAwE;AACxE,wEAAwE;AACxE,mEAAmE;AACnE,+BAA+B;AAC/B,EAAE;AACF,sDAAsD;AACtD,wDAAw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,MAAM,CAAC,eAAe,CAAC;AACrC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,KAAa;IACvC,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CACpC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,MAAM,WAAW,CAC5B,KAAK,EACL,kBAAkB,EAClB,uBAAuB,EACvB,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,KAAK,CAAC,EAAE,CACnD,CAAC;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,IAAI,CAAC,CAAC;QAC5D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAChC,CAAC,CAAC,CACH,CAAC;IACF,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAChE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import type { DryRunPreview } from "../../transport.js";
|
|
2
|
+
/**
|
|
3
|
+
* Availability-domain error codes. Mirrors the `EngagementsError` /
|
|
4
|
+
* `ApplicationsError` shape per project convention.
|
|
5
|
+
*
|
|
6
|
+
* - `NO_VIEWER`: HTTP 200 + `data.viewer === null` (impossible in
|
|
7
|
+
* practice — auth-revoked is signalled differently — but kept for
|
|
8
|
+
* defensive coverage).
|
|
9
|
+
* - `NO_VIEWER_ROLE`: viewer is present but `viewerRole === null`
|
|
10
|
+
* (e.g., user is signed in but has no role assigned on the platform).
|
|
11
|
+
* - `GRAPHQL_ERROR`: top-level `errors[]` from the gateway, not an
|
|
12
|
+
* auth-revoked extension.
|
|
13
|
+
* - `MUTATION_ERROR`: the `MutationResult.errors[]` payload (operation
|
|
14
|
+
* succeeded at GraphQL level, but the mutation itself reports
|
|
15
|
+
* per-field errors — validation failures, etc.).
|
|
16
|
+
* - `NETWORK_ERROR`, `UNKNOWN`: standard transport failure modes.
|
|
17
|
+
*
|
|
18
|
+
* Auth-revoked failures throw `AuthRevokedError` (cross-cutting
|
|
19
|
+
* `TtctlError` subclass per #77), not a code on this enum.
|
|
20
|
+
*/
|
|
21
|
+
export type AvailabilityErrorCode = "NO_VIEWER" | "NO_VIEWER_ROLE" | "GRAPHQL_ERROR" | "MUTATION_ERROR" | "NETWORK_ERROR" | "WIRE_SHAPE_ERROR" | "UNKNOWN";
|
|
22
|
+
export declare class AvailabilityError extends Error {
|
|
23
|
+
readonly code: AvailabilityErrorCode;
|
|
24
|
+
readonly name = "AvailabilityError";
|
|
25
|
+
constructor(code: AvailabilityErrorCode, message: string, options?: {
|
|
26
|
+
cause?: unknown;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Time zone projection — matches the wire `TimeZone` type. `value` is the
|
|
31
|
+
* IANA zone identifier (e.g., `"Europe/Berlin"`) and the canonical input
|
|
32
|
+
* for `workingHours.set({ timeZone })`. `location` and the offsets are
|
|
33
|
+
* read-only metadata for human-facing rendering.
|
|
34
|
+
*/
|
|
35
|
+
export interface AvailabilityTimeZone {
|
|
36
|
+
name: string | null;
|
|
37
|
+
value: string;
|
|
38
|
+
location: string | null;
|
|
39
|
+
utcOffset: string | null;
|
|
40
|
+
stdOffset: string | null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Top-level availability snapshot returned by `show()`.
|
|
44
|
+
*
|
|
45
|
+
* Times are `"HH:MM:SS"` strings; null when the field is unset on the
|
|
46
|
+
* server. `allocatedHours` is a non-negative integer in [0, 80] per the
|
|
47
|
+
* platform's UI-enforced range (`SetAvailability` validator caps at 80),
|
|
48
|
+
* or null when unset.
|
|
49
|
+
*/
|
|
50
|
+
export interface AvailabilitySnapshot {
|
|
51
|
+
/** Viewer id (Viewer.id from the gateway). */
|
|
52
|
+
viewerId: string;
|
|
53
|
+
/** Profile id (viewer.viewerRole.profile.id) — needed as the `profileId` field on `UpdateWorkingHoursInput`. Null when the viewer has a role but no bound profile (unusual but defensively handled). */
|
|
54
|
+
profileId: string | null;
|
|
55
|
+
/** Time zone, IANA identifier in `.value`. */
|
|
56
|
+
timeZone: AvailabilityTimeZone | null;
|
|
57
|
+
/** Daily working hours window start, `"HH:MM:SS"`. */
|
|
58
|
+
workingTimeFrom: string | null;
|
|
59
|
+
/** Daily working hours window end, `"HH:MM:SS"`. */
|
|
60
|
+
workingTimeTo: string | null;
|
|
61
|
+
/** Flexible shift-range start (the "I could shift to these hours if needed" window). */
|
|
62
|
+
availableShiftRangeFrom: string | null;
|
|
63
|
+
/** Flexible shift-range end. */
|
|
64
|
+
availableShiftRangeTo: string | null;
|
|
65
|
+
/** Allocated hours (viewer-scoped, integer in [0, 80]). */
|
|
66
|
+
allocatedHours: number | null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Input for `workingHours.set()`. All fields optional — the mutation
|
|
70
|
+
* supports partial updates. The CLI/MCP surfaces require at least one
|
|
71
|
+
* field to be provided.
|
|
72
|
+
*/
|
|
73
|
+
export interface UpdateWorkingHoursInput {
|
|
74
|
+
/** IANA time-zone identifier (e.g., `"Europe/Berlin"`). */
|
|
75
|
+
timeZone?: string;
|
|
76
|
+
/** Daily working hours window start, `"HH:MM:SS"`. */
|
|
77
|
+
workingTimeFrom?: string;
|
|
78
|
+
/** Daily working hours window end, `"HH:MM:SS"`. */
|
|
79
|
+
workingTimeTo?: string;
|
|
80
|
+
/** Flexible shift-range start, `"HH:MM:SS"`. */
|
|
81
|
+
availableShiftRangeFrom?: string;
|
|
82
|
+
/** Flexible shift-range end, `"HH:MM:SS"`. */
|
|
83
|
+
availableShiftRangeTo?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Per-mutation option object for the dry-run short-circuit (issue #164,
|
|
87
|
+
* mirroring the #52 / #162 / #163 reference pattern). When `dryRun ===
|
|
88
|
+
* true`, the mutation builds a {@link DryRunPreview} and returns
|
|
89
|
+
* `{ kind: "preview", preview }` WITHOUT invoking the gateway transport
|
|
90
|
+
* — including any pre-fetch the apply path would normally issue (per the
|
|
91
|
+
* AC's "no GraphQL request is sent (mock transport assertion)"
|
|
92
|
+
* requirement). Default `false` — the apply path runs and a
|
|
93
|
+
* `{ kind: "applied", result }` outcome is returned.
|
|
94
|
+
*
|
|
95
|
+
* Stand-alone interface (not a discriminated-union option) so future
|
|
96
|
+
* per-mutation options (e.g. hypothetical idempotency-key parameter)
|
|
97
|
+
* can extend additively. Uniform across the 2 availability mutations.
|
|
98
|
+
*/
|
|
99
|
+
export interface DryRunOptions {
|
|
100
|
+
/**
|
|
101
|
+
* When `true`, short-circuit before any transport call and return a
|
|
102
|
+
* {@link DryRunPreview}-bearing outcome instead of executing the
|
|
103
|
+
* mutation. Default: `false` — normal apply path.
|
|
104
|
+
*/
|
|
105
|
+
dryRun?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Apply-path outcome for {@link workingHours.set}. Wraps the
|
|
109
|
+
* post-mutation working-hours fields in a discriminated union so
|
|
110
|
+
* callers can branch deterministically between apply
|
|
111
|
+
* (`kind: "applied"`) and dry-run (`kind: "preview"`,
|
|
112
|
+
* see {@link AvailabilityDryRunPreviewOutcome}).
|
|
113
|
+
*/
|
|
114
|
+
export interface WorkingHoursAppliedOutcome {
|
|
115
|
+
kind: "applied";
|
|
116
|
+
result: {
|
|
117
|
+
timeZone: AvailabilityTimeZone | null;
|
|
118
|
+
workingTimeFrom: string | null;
|
|
119
|
+
workingTimeTo: string | null;
|
|
120
|
+
availableShiftRangeFrom: string | null;
|
|
121
|
+
availableShiftRangeTo: string | null;
|
|
122
|
+
notice: string | null;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Dry-run outcome shared by every availability mutation. Carries a
|
|
127
|
+
* {@link DryRunPreview} (operation name, surface, transport, endpoint,
|
|
128
|
+
* variables payload, redacted headers) — emitted verbatim by the CLI's
|
|
129
|
+
* dry-run envelope (`emitDryRunSuccess` in
|
|
130
|
+
* `packages/cli/src/lib/envelopes.ts`).
|
|
131
|
+
*/
|
|
132
|
+
export interface AvailabilityDryRunPreviewOutcome {
|
|
133
|
+
kind: "preview";
|
|
134
|
+
preview: DryRunPreview;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Discriminated-union return type for {@link workingHours.set}. Pre-1.0
|
|
138
|
+
* breaking change vs the pre-#164 return type (the raw result object) —
|
|
139
|
+
* callers must branch on `outcome.kind` to access either
|
|
140
|
+
* `outcome.result` or `outcome.preview`.
|
|
141
|
+
*/
|
|
142
|
+
export type WorkingHoursSetOutcome = WorkingHoursAppliedOutcome | AvailabilityDryRunPreviewOutcome;
|
|
143
|
+
/**
|
|
144
|
+
* Apply-path outcome for {@link allocatedHours.set}.
|
|
145
|
+
*/
|
|
146
|
+
export interface AllocatedHoursAppliedOutcome {
|
|
147
|
+
kind: "applied";
|
|
148
|
+
result: {
|
|
149
|
+
allocatedHours: number;
|
|
150
|
+
hiredHours: number | null;
|
|
151
|
+
notice: string | null;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Discriminated-union return type for {@link allocatedHours.set}.
|
|
156
|
+
* Pre-1.0 breaking change vs the pre-#164 return type — callers must
|
|
157
|
+
* branch on `outcome.kind`.
|
|
158
|
+
*/
|
|
159
|
+
export type AllocatedHoursSetOutcome = AllocatedHoursAppliedOutcome | AvailabilityDryRunPreviewOutcome;
|
|
160
|
+
/**
|
|
161
|
+
* Read the signed-in user's full availability snapshot — time zone,
|
|
162
|
+
* working-hours window, flexible shift range, and allocated hours.
|
|
163
|
+
*
|
|
164
|
+
* Throws `AvailabilityError("NO_VIEWER")` when the server returns a
|
|
165
|
+
* null viewer (defensive — auth-revoked surfaces via `AuthRevokedError`
|
|
166
|
+
* instead).
|
|
167
|
+
*
|
|
168
|
+
* Throws `AvailabilityError("NO_VIEWER_ROLE")` when the viewer exists
|
|
169
|
+
* but has no role assigned (no role = no working-hours / allocated-hours
|
|
170
|
+
* shape).
|
|
171
|
+
*/
|
|
172
|
+
export declare function show(token: string): Promise<AvailabilitySnapshot>;
|
|
173
|
+
/**
|
|
174
|
+
* Working-hours sub-namespace under the service. Mirrors
|
|
175
|
+
* `engagements.breaks` so the public surface stays
|
|
176
|
+
* `availability.workingHours.{show, set}` — matches the CLI verb path
|
|
177
|
+
* `availability working-hours {show, set}`.
|
|
178
|
+
*/
|
|
179
|
+
export declare const workingHours: {
|
|
180
|
+
/**
|
|
181
|
+
* Read just the working-hours subset of the snapshot. Identical
|
|
182
|
+
* underlying query to `show()`; the projection here drops
|
|
183
|
+
* `allocatedHours` for callers that only care about the time-zone
|
|
184
|
+
* and working-hours fields.
|
|
185
|
+
*/
|
|
186
|
+
show(token: string): Promise<{
|
|
187
|
+
viewerId: string;
|
|
188
|
+
timeZone: AvailabilityTimeZone | null;
|
|
189
|
+
workingTimeFrom: string | null;
|
|
190
|
+
workingTimeTo: string | null;
|
|
191
|
+
availableShiftRangeFrom: string | null;
|
|
192
|
+
availableShiftRangeTo: string | null;
|
|
193
|
+
}>;
|
|
194
|
+
/**
|
|
195
|
+
* Update working-hours fields. All input fields are optional — only
|
|
196
|
+
* the provided keys are sent in the mutation payload, supporting
|
|
197
|
+
* partial updates (per portal bundle's call-site behavior).
|
|
198
|
+
*
|
|
199
|
+
* Throws `AvailabilityError("MUTATION_ERROR")` when the gateway
|
|
200
|
+
* returns `success: false` (validation failures, malformed time
|
|
201
|
+
* strings, unknown time-zone identifiers).
|
|
202
|
+
*
|
|
203
|
+
* Returns the post-update working-hours shape wrapped in
|
|
204
|
+
* {@link WorkingHoursAppliedOutcome}.
|
|
205
|
+
*
|
|
206
|
+
* Dry-run path (issue #164): when invoked with `options.dryRun ===
|
|
207
|
+
* true`, builds a {@link DryRunPreview} of the mutation WITHOUT
|
|
208
|
+
* invoking the gateway transport — including the `show()` pre-fetch
|
|
209
|
+
* the apply path uses to resolve `profileId` (per the AC's "no
|
|
210
|
+
* GraphQL request is sent" requirement). The preview's
|
|
211
|
+
* `variables.input.profileId` is populated with the placeholder
|
|
212
|
+
* string `"<resolved at apply time>"`; the wire SHAPE (field names,
|
|
213
|
+
* operation, surface, redacted headers) is verbatim. Mirrors the
|
|
214
|
+
* skipped-prefetch pattern from `engagements.breaks.add` (issue #163).
|
|
215
|
+
*/
|
|
216
|
+
set(token: string, input: UpdateWorkingHoursInput, options?: DryRunOptions): Promise<WorkingHoursSetOutcome>;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Allocated-hours sub-namespace. The wire mutation
|
|
220
|
+
* (`UpdateAllocatedHours`) operates on `viewerRole`, NOT on a specific
|
|
221
|
+
* engagement — `allocatedHours` is global across all of the viewer's
|
|
222
|
+
* active engagements. This is why the surface lives under
|
|
223
|
+
* `availability` rather than under `engagements` (per #147 scope
|
|
224
|
+
* amendment that absorbed it into #146).
|
|
225
|
+
*/
|
|
226
|
+
export declare const allocatedHours: {
|
|
227
|
+
/**
|
|
228
|
+
* Read just the allocated-hours value. `hiredHours` is NOT
|
|
229
|
+
* surfaced here — it's only returned by `set()` (where the
|
|
230
|
+
* post-update payload includes it for context).
|
|
231
|
+
*/
|
|
232
|
+
show(token: string): Promise<{
|
|
233
|
+
allocatedHours: number;
|
|
234
|
+
}>;
|
|
235
|
+
/**
|
|
236
|
+
* Set the viewer-scoped allocated-hours value. The platform UI caps
|
|
237
|
+
* this at 80 (`SetAvailability` validator); the server enforces the
|
|
238
|
+
* same range — pass an out-of-range value at your own risk (the
|
|
239
|
+
* mutation will return `success: false` with a validation error).
|
|
240
|
+
*
|
|
241
|
+
* Returns the post-update `{ allocatedHours, hiredHours, notice }`
|
|
242
|
+
* triple wrapped in {@link AllocatedHoursAppliedOutcome}.
|
|
243
|
+
*
|
|
244
|
+
* Dry-run path (issue #164): when invoked with `options.dryRun ===
|
|
245
|
+
* true`, builds a {@link DryRunPreview} of the mutation without
|
|
246
|
+
* invoking the gateway transport and returns it wrapped in
|
|
247
|
+
* {@link AvailabilityDryRunPreviewOutcome}. The integer-range
|
|
248
|
+
* validation runs BEFORE the dry-run short-circuit — invalid input
|
|
249
|
+
* still throws `AvailabilityError("MUTATION_ERROR")` rather than
|
|
250
|
+
* emitting a preview that would be rejected at apply time.
|
|
251
|
+
*/
|
|
252
|
+
set(token: string, hours: number, options?: DryRunOptions): Promise<AllocatedHoursSetOutcome>;
|
|
253
|
+
};
|
|
254
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/availability/index.ts"],"names":[],"mappings":"AA+EA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,SAAS,CAAC;AAEd,qBAAa,iBAAkB,SAAQ,KAAK;aAGxB,IAAI,EAAE,qBAAqB;IAF7C,SAAkB,IAAI,uBAAuB;gBAE3B,IAAI,EAAE,qBAAqB,EAC3C,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAIhC;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACz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