@ttctl/core 0.0.0 → 0.1.0-rc.2

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.
Files changed (195) hide show
  1. package/README.md +49 -9
  2. package/dist/__generated__/gateway.d.ts +4546 -0
  3. package/dist/__generated__/gateway.d.ts.map +1 -0
  4. package/dist/__generated__/gateway.js +9 -0
  5. package/dist/__generated__/gateway.js.map +1 -0
  6. package/dist/__generated__/talent-profile-zod-schemas.d.ts +1187 -0
  7. package/dist/__generated__/talent-profile-zod-schemas.d.ts.map +1 -0
  8. package/dist/__generated__/talent-profile-zod-schemas.js +1136 -0
  9. package/dist/__generated__/talent-profile-zod-schemas.js.map +1 -0
  10. package/dist/__generated__/talent-profile.d.ts +1397 -0
  11. package/dist/__generated__/talent-profile.d.ts.map +1 -0
  12. package/dist/__generated__/talent-profile.js +9 -0
  13. package/dist/__generated__/talent-profile.js.map +1 -0
  14. package/dist/__generated__/zod-schemas.d.ts +2895 -0
  15. package/dist/__generated__/zod-schemas.d.ts.map +1 -0
  16. package/dist/__generated__/zod-schemas.js +3121 -0
  17. package/dist/__generated__/zod-schemas.js.map +1 -0
  18. package/dist/__tests__/fixtures/profile/builders.d.ts +74 -0
  19. package/dist/__tests__/fixtures/profile/builders.d.ts.map +1 -0
  20. package/dist/__tests__/fixtures/profile/builders.js +200 -0
  21. package/dist/__tests__/fixtures/profile/builders.js.map +1 -0
  22. package/dist/__tests__/fixtures/profile/data.d.ts +39 -0
  23. package/dist/__tests__/fixtures/profile/data.d.ts.map +1 -0
  24. package/dist/__tests__/fixtures/profile/data.js +238 -0
  25. package/dist/__tests__/fixtures/profile/data.js.map +1 -0
  26. package/dist/__tests__/fixtures/profile/index.d.ts +9 -0
  27. package/dist/__tests__/fixtures/profile/index.d.ts.map +1 -0
  28. package/dist/__tests__/fixtures/profile/index.js +10 -0
  29. package/dist/__tests__/fixtures/profile/index.js.map +1 -0
  30. package/dist/__tests__/fixtures/profile/types.d.ts +53 -0
  31. package/dist/__tests__/fixtures/profile/types.d.ts.map +1 -0
  32. package/dist/__tests__/fixtures/profile/types.js +4 -0
  33. package/dist/__tests__/fixtures/profile/types.js.map +1 -0
  34. package/dist/auth/errors.d.ts +82 -0
  35. package/dist/auth/errors.d.ts.map +1 -0
  36. package/dist/auth/errors.js +68 -0
  37. package/dist/auth/errors.js.map +1 -0
  38. package/dist/auth.d.ts +192 -0
  39. package/dist/auth.d.ts.map +1 -0
  40. package/dist/auth.js +294 -0
  41. package/dist/auth.js.map +1 -0
  42. package/dist/config.d.ts +214 -0
  43. package/dist/config.d.ts.map +1 -0
  44. package/dist/config.js +349 -0
  45. package/dist/config.js.map +1 -0
  46. package/dist/configLock.d.ts +52 -0
  47. package/dist/configLock.d.ts.map +1 -0
  48. package/dist/configLock.js +109 -0
  49. package/dist/configLock.js.map +1 -0
  50. package/dist/configWriter.d.ts +97 -0
  51. package/dist/configWriter.d.ts.map +1 -0
  52. package/dist/configWriter.js +688 -0
  53. package/dist/configWriter.js.map +1 -0
  54. package/dist/index.d.ts +37 -0
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/index.js +28 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/kill-switch.d.ts +161 -0
  59. package/dist/kill-switch.d.ts.map +1 -0
  60. package/dist/kill-switch.js +235 -0
  61. package/dist/kill-switch.js.map +1 -0
  62. package/dist/lib/date.d.ts +58 -0
  63. package/dist/lib/date.d.ts.map +1 -0
  64. package/dist/lib/date.js +104 -0
  65. package/dist/lib/date.js.map +1 -0
  66. package/dist/lib/diagnostic-log.d.ts +159 -0
  67. package/dist/lib/diagnostic-log.d.ts.map +1 -0
  68. package/dist/lib/diagnostic-log.js +186 -0
  69. package/dist/lib/diagnostic-log.js.map +1 -0
  70. package/dist/lib/package-version.d.ts +19 -0
  71. package/dist/lib/package-version.d.ts.map +1 -0
  72. package/dist/lib/package-version.js +38 -0
  73. package/dist/lib/package-version.js.map +1 -0
  74. package/dist/lib/redact.d.ts +153 -0
  75. package/dist/lib/redact.d.ts.map +1 -0
  76. package/dist/lib/redact.js +207 -0
  77. package/dist/lib/redact.js.map +1 -0
  78. package/dist/lib/text.d.ts +14 -0
  79. package/dist/lib/text.d.ts.map +1 -0
  80. package/dist/lib/text.js +21 -0
  81. package/dist/lib/text.js.map +1 -0
  82. package/dist/lib/wire-shape.d.ts +131 -0
  83. package/dist/lib/wire-shape.d.ts.map +1 -0
  84. package/dist/lib/wire-shape.js +376 -0
  85. package/dist/lib/wire-shape.js.map +1 -0
  86. package/dist/onepassword.d.ts +29 -0
  87. package/dist/onepassword.d.ts.map +1 -0
  88. package/dist/onepassword.js +112 -0
  89. package/dist/onepassword.js.map +1 -0
  90. package/dist/services/_shared/transport.d.ts +148 -0
  91. package/dist/services/_shared/transport.d.ts.map +1 -0
  92. package/dist/services/_shared/transport.js +102 -0
  93. package/dist/services/_shared/transport.js.map +1 -0
  94. package/dist/services/applications/index.d.ts +210 -0
  95. package/dist/services/applications/index.d.ts.map +1 -0
  96. package/dist/services/applications/index.js +240 -0
  97. package/dist/services/applications/index.js.map +1 -0
  98. package/dist/services/availability/index.d.ts +254 -0
  99. package/dist/services/availability/index.d.ts.map +1 -0
  100. package/dist/services/availability/index.js +310 -0
  101. package/dist/services/availability/index.js.map +1 -0
  102. package/dist/services/contracts/index.d.ts +132 -0
  103. package/dist/services/contracts/index.d.ts.map +1 -0
  104. package/dist/services/contracts/index.js +211 -0
  105. package/dist/services/contracts/index.js.map +1 -0
  106. package/dist/services/engagements/index.d.ts +504 -0
  107. package/dist/services/engagements/index.d.ts.map +1 -0
  108. package/dist/services/engagements/index.js +613 -0
  109. package/dist/services/engagements/index.js.map +1 -0
  110. package/dist/services/jobs/index.d.ts +490 -0
  111. package/dist/services/jobs/index.d.ts.map +1 -0
  112. package/dist/services/jobs/index.js +753 -0
  113. package/dist/services/jobs/index.js.map +1 -0
  114. package/dist/services/payments/index.d.ts +425 -0
  115. package/dist/services/payments/index.d.ts.map +1 -0
  116. package/dist/services/payments/index.js +636 -0
  117. package/dist/services/payments/index.js.map +1 -0
  118. package/dist/services/profile/__tests__/fixtures.d.ts +214 -0
  119. package/dist/services/profile/__tests__/fixtures.d.ts.map +1 -0
  120. package/dist/services/profile/__tests__/fixtures.js +176 -0
  121. package/dist/services/profile/__tests__/fixtures.js.map +1 -0
  122. package/dist/services/profile/basic/index.d.ts +390 -0
  123. package/dist/services/profile/basic/index.d.ts.map +1 -0
  124. package/dist/services/profile/basic/index.js +1007 -0
  125. package/dist/services/profile/basic/index.js.map +1 -0
  126. package/dist/services/profile/certifications/index.d.ts +74 -0
  127. package/dist/services/profile/certifications/index.d.ts.map +1 -0
  128. package/dist/services/profile/certifications/index.js +169 -0
  129. package/dist/services/profile/certifications/index.js.map +1 -0
  130. package/dist/services/profile/education/index.d.ts +73 -0
  131. package/dist/services/profile/education/index.d.ts.map +1 -0
  132. package/dist/services/profile/education/index.js +168 -0
  133. package/dist/services/profile/education/index.js.map +1 -0
  134. package/dist/services/profile/employment/index.d.ts +132 -0
  135. package/dist/services/profile/employment/index.d.ts.map +1 -0
  136. package/dist/services/profile/employment/index.js +262 -0
  137. package/dist/services/profile/employment/index.js.map +1 -0
  138. package/dist/services/profile/external/index.d.ts +278 -0
  139. package/dist/services/profile/external/index.d.ts.map +1 -0
  140. package/dist/services/profile/external/index.js +640 -0
  141. package/dist/services/profile/external/index.js.map +1 -0
  142. package/dist/services/profile/index.d.ts +24 -0
  143. package/dist/services/profile/index.d.ts.map +1 -0
  144. package/dist/services/profile/index.js +26 -0
  145. package/dist/services/profile/index.js.map +1 -0
  146. package/dist/services/profile/industries/index.d.ts +130 -0
  147. package/dist/services/profile/industries/index.d.ts.map +1 -0
  148. package/dist/services/profile/industries/index.js +292 -0
  149. package/dist/services/profile/industries/index.js.map +1 -0
  150. package/dist/services/profile/portfolio/index.d.ts +352 -0
  151. package/dist/services/profile/portfolio/index.d.ts.map +1 -0
  152. package/dist/services/profile/portfolio/index.js +833 -0
  153. package/dist/services/profile/portfolio/index.js.map +1 -0
  154. package/dist/services/profile/resume/index.d.ts +60 -0
  155. package/dist/services/profile/resume/index.d.ts.map +1 -0
  156. package/dist/services/profile/resume/index.js +212 -0
  157. package/dist/services/profile/resume/index.js.map +1 -0
  158. package/dist/services/profile/reviews/index.d.ts +137 -0
  159. package/dist/services/profile/reviews/index.d.ts.map +1 -0
  160. package/dist/services/profile/reviews/index.js +431 -0
  161. package/dist/services/profile/reviews/index.js.map +1 -0
  162. package/dist/services/profile/shared.d.ts +127 -0
  163. package/dist/services/profile/shared.d.ts.map +1 -0
  164. package/dist/services/profile/shared.js +155 -0
  165. package/dist/services/profile/shared.js.map +1 -0
  166. package/dist/services/profile/skills/index.d.ts +212 -0
  167. package/dist/services/profile/skills/index.d.ts.map +1 -0
  168. package/dist/services/profile/skills/index.js +461 -0
  169. package/dist/services/profile/skills/index.js.map +1 -0
  170. package/dist/services/profile/visas/index.d.ts +74 -0
  171. package/dist/services/profile/visas/index.d.ts.map +1 -0
  172. package/dist/services/profile/visas/index.js +306 -0
  173. package/dist/services/profile/visas/index.js.map +1 -0
  174. package/dist/services/timesheet/index.d.ts +337 -0
  175. package/dist/services/timesheet/index.d.ts.map +1 -0
  176. package/dist/services/timesheet/index.js +336 -0
  177. package/dist/services/timesheet/index.js.map +1 -0
  178. package/dist/services/translations.d.ts +79 -0
  179. package/dist/services/translations.d.ts.map +1 -0
  180. package/dist/services/translations.js +136 -0
  181. package/dist/services/translations.js.map +1 -0
  182. package/dist/transport-resilience.d.ts +136 -0
  183. package/dist/transport-resilience.d.ts.map +1 -0
  184. package/dist/transport-resilience.js +247 -0
  185. package/dist/transport-resilience.js.map +1 -0
  186. package/dist/transport.d.ts +408 -0
  187. package/dist/transport.d.ts.map +1 -0
  188. package/dist/transport.js +691 -0
  189. package/dist/transport.js.map +1 -0
  190. package/dist/types.d.ts +41 -0
  191. package/dist/types.d.ts.map +1 -0
  192. package/dist/types.js +18 -0
  193. package/dist/types.js.map +1 -0
  194. package/package.json +40 -12
  195. package/index.js +0 -7
@@ -0,0 +1,132 @@
1
+ /**
2
+ * `Employment` row as ttctl exposes it. Trimmed read-side projection of
3
+ * the `Employment` GraphQL fragment (see
4
+ * `research/graphql/talent_profile/fragments/Employment.graphql`). Years
5
+ * are integers (`startDate`, `endDate`) per the empirical capture
6
+ * `research/captures/web/inputs/UpdateEmploymentInput.json`. `endDate` is
7
+ * `null` for current positions.
8
+ *
9
+ * The last four fields close the #344 read/write asymmetry; see
10
+ * {@link mapEmploymentNode} for why the read shape uses nested
11
+ * `industries` / `primaryGeography` rather than the scalar write-input
12
+ * names.
13
+ */
14
+ export interface Employment {
15
+ id: string;
16
+ company: string;
17
+ position: string;
18
+ companyWebsite: string | null;
19
+ noWebsite: boolean;
20
+ startDate: number | null;
21
+ endDate: number | null;
22
+ experienceItems: string[] | null;
23
+ highlight: boolean;
24
+ showViaToptal: boolean;
25
+ toptalRelated: boolean;
26
+ /** Whether the talent permits this row to be shown publicly (#344). */
27
+ publicationPermit: boolean | null;
28
+ /** Free-text reporting-line description (#344). */
29
+ reportingTo: string | null;
30
+ /** Catalog industries assigned to this row (#344). */
31
+ industries: {
32
+ id: string;
33
+ name: string;
34
+ }[];
35
+ /** The role's primary geography; `null` when unset (#344). */
36
+ primaryGeography: {
37
+ id: string;
38
+ code: string | null;
39
+ name: string | null;
40
+ } | null;
41
+ }
42
+ /**
43
+ * Fields editable on an Employment row. Mirrors `EmploymentInput` per the
44
+ * inferred shape in `research/notes/10-mutation-input-patterns.md`
45
+ * (Pattern 1) and the live capture in
46
+ * `research/captures/web/inputs/UpdateEmploymentInput.json`.
47
+ *
48
+ * The CLI exposes a curated subset: `--company`, `--role` (→ position),
49
+ * `--from`, `--to`, `--current`, `--description` (→ experienceItems —
50
+ * single-paragraph today; multi-paragraph splits on blank lines). Other
51
+ * fields (employerId, engagementId, industryIds, managementExperience,
52
+ * primaryGeographyId, reportingTo, skills, …) are exposed at the type
53
+ * level so future leaves can grow without churning callers.
54
+ */
55
+ export interface EmploymentFields {
56
+ company?: string;
57
+ position?: string;
58
+ companyWebsite?: string | null;
59
+ noWebsite?: boolean;
60
+ startDate?: number;
61
+ endDate?: number | null;
62
+ experienceItems?: string[];
63
+ highlight?: boolean;
64
+ publicationPermit?: boolean;
65
+ showViaToptal?: boolean;
66
+ toptalRelated?: boolean;
67
+ industryIds?: string[];
68
+ primaryGeographyId?: string | null;
69
+ reportingTo?: string | null;
70
+ skills?: string[];
71
+ }
72
+ /**
73
+ * Lightweight `Employer` reference returned by
74
+ * `employer-autocomplete`. Mirrors the read-side `Employer` fragment
75
+ * trimmed to the fields that matter at the catalog layer.
76
+ */
77
+ export interface EmployerSuggestion {
78
+ id: string;
79
+ name: string;
80
+ city: string | null;
81
+ country: string | null;
82
+ logoUrl: string | null;
83
+ website: string | null;
84
+ }
85
+ /**
86
+ * List the signed-in user's employment rows.
87
+ *
88
+ * Issues `GET_WORK_EXPERIENCE` against the talent-profile surface; keyed
89
+ * by the user's `profileId`. The read-side query also returns `countries`
90
+ * — ttctl ignores it for now.
91
+ */
92
+ export declare function list(token: string): Promise<Employment[]>;
93
+ /**
94
+ * Look up a single employment row by id. Throws `VALIDATION_ERROR` when
95
+ * no matching row exists.
96
+ */
97
+ export declare function show(token: string, id: string): Promise<Employment>;
98
+ /**
99
+ * Create a new employment row. Wire format per Pattern 2: `{ profileId,
100
+ * employment: EmploymentInput }`. `company` and `position` are required.
101
+ */
102
+ export declare function add(token: string, fields: EmploymentFields): Promise<Employment>;
103
+ /**
104
+ * Update an existing employment row. Wire format per Pattern 1:
105
+ * `{ employmentId, employment: EmploymentInput }`.
106
+ */
107
+ export declare function update(token: string, id: string, fields: EmploymentFields): Promise<Employment>;
108
+ /**
109
+ * Remove an employment row. Wire format per Pattern 3: `{ employmentId }`.
110
+ */
111
+ export declare function remove(token: string, id: string): Promise<string>;
112
+ /**
113
+ * Toggle the `highlight` flag on an employment row. Wire format per
114
+ * Pattern 4: `{ employmentId, highlight: Boolean }`.
115
+ */
116
+ export declare function highlight(token: string, id: string, value?: boolean): Promise<{
117
+ id: string;
118
+ highlight: boolean;
119
+ }>;
120
+ /**
121
+ * Search the employer catalog for a known employer name (e.g. "Google").
122
+ *
123
+ * Issues `GET_EMPLOYERS_AUTOCOMPLETE($search, $limit)` against the
124
+ * talent-profile surface. The schema types the return as a single
125
+ * `Employer` but real responses are a list — accepting either shape
126
+ * keeps callers from crashing if Toptal swings the cardinality.
127
+ *
128
+ * The `limit` argument bounds the suggestion count; default `10` mirrors
129
+ * the React app.
130
+ */
131
+ export declare function employerAutocomplete(token: string, search: string, limit?: number): Promise<EmployerSuggestion[]>;
132
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/profile/employment/index.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,iBAAiB,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,mDAAmD;IACnD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,sDAAsD;IACtD,UAAU,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,8DAA8D;IAC9D,gBAAgB,EAAE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,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAOzE;AAED;;;GAGG;AACH,wBAAsB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAmCtF;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAoBrG;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAUvE;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,UAAO,GAAG,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAiBpH;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAgBnH"}
@@ -0,0 +1,262 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { ProfileError } from "../basic/index.js";
4
+ import { applyUserErrorsAndSuccess, callTalentProfile, ensureNoTopLevelErrors, extractProfileId } from "../shared.js";
5
+ const EMPLOYMENT_FRAGMENT = `fragment Employment on Employment {
6
+ id
7
+ company
8
+ position
9
+ companyWebsite
10
+ noWebsite
11
+ startDate
12
+ endDate
13
+ experienceItems
14
+ highlight
15
+ showViaToptal
16
+ toptalRelated
17
+ publicationPermit
18
+ reportingTo
19
+ industries { nodes { id name } }
20
+ primaryGeography { id code name }
21
+ }`;
22
+ const GET_WORK_EXPERIENCE_QUERY = `query GET_WORK_EXPERIENCE($profileId: ID!) {
23
+ profile(id: $profileId) {
24
+ id
25
+ employments { nodes { ...Employment } }
26
+ }
27
+ }
28
+ ${EMPLOYMENT_FRAGMENT}`;
29
+ const CREATE_EMPLOYMENT_MUTATION = `mutation CreateEmployment($input: CreateEmploymentInput!) {
30
+ createEmployment(input: $input) {
31
+ success
32
+ notice
33
+ errors { code key message }
34
+ profile { id employments { nodes { ...Employment } } }
35
+ }
36
+ }
37
+ ${EMPLOYMENT_FRAGMENT}`;
38
+ const UPDATE_EMPLOYMENT_MUTATION = `mutation UpdateEmployment($input: UpdateEmploymentInput!) {
39
+ updateEmployment(input: $input) {
40
+ success
41
+ notice
42
+ errors { code key message }
43
+ profile { id employments { nodes { ...Employment } } }
44
+ }
45
+ }
46
+ ${EMPLOYMENT_FRAGMENT}`;
47
+ const REMOVE_EMPLOYMENT_MUTATION = `mutation RemoveEmployment($input: RemoveEmploymentInput!) {
48
+ removeEmployment(input: $input) {
49
+ success
50
+ notice
51
+ errors { code key message }
52
+ profile { id employments { nodes { ...Employment } } }
53
+ }
54
+ }
55
+ ${EMPLOYMENT_FRAGMENT}`;
56
+ const HIGHLIGHT_EMPLOYMENT_MUTATION = `mutation highlightEmployment($id: ID!, $highlight: Boolean!) {
57
+ highlightEmployment(input: { employmentId: $id, highlight: $highlight }) {
58
+ success
59
+ notice
60
+ errors { code key message }
61
+ employment { id highlight }
62
+ }
63
+ }`;
64
+ const EMPLOYERS_AUTOCOMPLETE_QUERY = `query GET_EMPLOYERS_AUTOCOMPLETE($search: String!, $limit: Int!) {
65
+ employersAutocomplete(search: $search, limit: $limit) {
66
+ id
67
+ name
68
+ city
69
+ country
70
+ logoUrl
71
+ website
72
+ }
73
+ }`;
74
+ /**
75
+ * Map an Employment fragment node from the raw wire shape to the typed
76
+ * {@link Employment}. Mirrors `mapPortfolioNode` in the portfolio
77
+ * service — the wire surfaces `industries` / `primaryGeography` as a
78
+ * nested connection / object, NOT the scalar `industryIds` /
79
+ * `primaryGeographyId` of the write input, so a projection step (rather
80
+ * than a direct cast) is required. Introduced for #344.
81
+ */
82
+ function mapEmploymentNode(node) {
83
+ const industriesConn = node["industries"];
84
+ const industries = Array.isArray(industriesConn?.nodes)
85
+ ? industriesConn.nodes.flatMap((i) => typeof i.id === "string" && typeof i.name === "string" ? [{ id: i.id, name: i.name }] : [])
86
+ : [];
87
+ const geoRaw = node["primaryGeography"];
88
+ const primaryGeography = geoRaw && typeof geoRaw.id === "string"
89
+ ? {
90
+ id: geoRaw.id,
91
+ code: typeof geoRaw.code === "string" ? geoRaw.code : null,
92
+ name: typeof geoRaw.name === "string" ? geoRaw.name : null,
93
+ }
94
+ : null;
95
+ const rawItems = node["experienceItems"];
96
+ return {
97
+ id: typeof node["id"] === "string" ? node["id"] : "",
98
+ company: typeof node["company"] === "string" ? node["company"] : "",
99
+ position: typeof node["position"] === "string" ? node["position"] : "",
100
+ companyWebsite: node["companyWebsite"] ?? null,
101
+ noWebsite: Boolean(node["noWebsite"]),
102
+ startDate: node["startDate"] ?? null,
103
+ endDate: node["endDate"] ?? null,
104
+ experienceItems: Array.isArray(rawItems)
105
+ ? rawItems.filter((x) => typeof x === "string")
106
+ : null,
107
+ highlight: Boolean(node["highlight"]),
108
+ showViaToptal: Boolean(node["showViaToptal"]),
109
+ toptalRelated: Boolean(node["toptalRelated"]),
110
+ publicationPermit: node["publicationPermit"] ?? null,
111
+ reportingTo: node["reportingTo"] ?? null,
112
+ industries,
113
+ primaryGeography,
114
+ };
115
+ }
116
+ /**
117
+ * List the signed-in user's employment rows.
118
+ *
119
+ * Issues `GET_WORK_EXPERIENCE` against the talent-profile surface; keyed
120
+ * by the user's `profileId`. The read-side query also returns `countries`
121
+ * — ttctl ignores it for now.
122
+ */
123
+ export async function list(token) {
124
+ const profileId = await extractProfileId(token);
125
+ return listByProfileId(token, profileId);
126
+ }
127
+ /**
128
+ * Internal helper: list employment rows when the caller has already
129
+ * resolved `profileId` (used by `add()` to avoid double-round-tripping).
130
+ */
131
+ async function listByProfileId(token, profileId) {
132
+ const res = await callTalentProfile(token, "GET_WORK_EXPERIENCE", GET_WORK_EXPERIENCE_QUERY, { profileId }, "employment list");
133
+ const body = res.body;
134
+ ensureNoTopLevelErrors(body, "employment list");
135
+ const profile = body?.data?.profile;
136
+ if (!profile)
137
+ throw new ProfileError("UNKNOWN", "employment list response had no `data.profile` field");
138
+ return profile.employments.nodes.filter((n) => n !== null).map(mapEmploymentNode);
139
+ }
140
+ /**
141
+ * Look up a single employment row by id. Throws `VALIDATION_ERROR` when
142
+ * no matching row exists.
143
+ */
144
+ export async function show(token, id) {
145
+ const all = await list(token);
146
+ const found = all.find((e) => e.id === id);
147
+ if (!found) {
148
+ throw new ProfileError("VALIDATION_ERROR", `Employment with id "${id}" not found on this profile.`);
149
+ }
150
+ return found;
151
+ }
152
+ /**
153
+ * Create a new employment row. Wire format per Pattern 2: `{ profileId,
154
+ * employment: EmploymentInput }`. `company` and `position` are required.
155
+ */
156
+ export async function add(token, fields) {
157
+ if (!fields.company || !fields.position) {
158
+ throw new ProfileError("VALIDATION_ERROR", "employment add requires --company and --role.");
159
+ }
160
+ const profileId = await extractProfileId(token);
161
+ const before = await listByProfileId(token, profileId);
162
+ const beforeIds = new Set(before.map((e) => e.id));
163
+ // The wire requires `experienceItems`, `skills`, and `showViaToptal` to
164
+ // be non-null on `CreateEmployment` (live API rejects with
165
+ // "Expected value to not be null" otherwise). The synthesized SDL marks
166
+ // `CreateEmploymentInput` as `{ _placeholder: String }` — these defaults
167
+ // were established empirically via the #344 E2E. Callers may still
168
+ // override.
169
+ const employment = {
170
+ experienceItems: [],
171
+ skills: [],
172
+ showViaToptal: true,
173
+ ...fields,
174
+ };
175
+ const res = await callTalentProfile(token, "CreateEmployment", CREATE_EMPLOYMENT_MUTATION, { input: { profileId, employment } }, "employment add");
176
+ const payload = unwrapMutation(res, "createEmployment", "employment add");
177
+ const after = payload.profile?.employments.nodes.filter((n) => n !== null).map(mapEmploymentNode) ??
178
+ [];
179
+ const created = after.find((e) => !beforeIds.has(e.id));
180
+ if (!created) {
181
+ throw new ProfileError("UNKNOWN", "employment add returned success but no new row was found in the response.");
182
+ }
183
+ return created;
184
+ }
185
+ /**
186
+ * Update an existing employment row. Wire format per Pattern 1:
187
+ * `{ employmentId, employment: EmploymentInput }`.
188
+ */
189
+ export async function update(token, id, fields) {
190
+ if (Object.keys(fields).length === 0) {
191
+ throw new ProfileError("VALIDATION_ERROR", "employment update requires at least one field flag.");
192
+ }
193
+ const res = await callTalentProfile(token, "UpdateEmployment", UPDATE_EMPLOYMENT_MUTATION, { input: { employmentId: id, employment: fields } }, "employment update");
194
+ const payload = unwrapMutation(res, "updateEmployment", "employment update");
195
+ const updated = payload.profile?.employments.nodes
196
+ .filter((n) => n !== null)
197
+ .map(mapEmploymentNode)
198
+ .find((e) => e.id === id);
199
+ if (!updated) {
200
+ throw new ProfileError("UNKNOWN", `employment update returned success but row "${id}" was not in the response.`);
201
+ }
202
+ return updated;
203
+ }
204
+ /**
205
+ * Remove an employment row. Wire format per Pattern 3: `{ employmentId }`.
206
+ */
207
+ export async function remove(token, id) {
208
+ const res = await callTalentProfile(token, "RemoveEmployment", REMOVE_EMPLOYMENT_MUTATION, { input: { employmentId: id } }, "employment remove");
209
+ unwrapMutation(res, "removeEmployment", "employment remove");
210
+ return id;
211
+ }
212
+ /**
213
+ * Toggle the `highlight` flag on an employment row. Wire format per
214
+ * Pattern 4: `{ employmentId, highlight: Boolean }`.
215
+ */
216
+ export async function highlight(token, id, value = true) {
217
+ const res = await callTalentProfile(token, "highlightEmployment", HIGHLIGHT_EMPLOYMENT_MUTATION, { id, highlight: value }, "employment highlight");
218
+ const body = res.body;
219
+ ensureNoTopLevelErrors(body, "employment highlight");
220
+ const payload = body?.data?.highlightEmployment;
221
+ if (!payload)
222
+ throw new ProfileError("UNKNOWN", "employment highlight response had no payload.");
223
+ applyUserErrorsAndSuccess(payload, "employment highlight");
224
+ if (!payload.employment) {
225
+ throw new ProfileError("UNKNOWN", "employment highlight response had no `employment` field.");
226
+ }
227
+ return payload.employment;
228
+ }
229
+ /**
230
+ * Search the employer catalog for a known employer name (e.g. "Google").
231
+ *
232
+ * Issues `GET_EMPLOYERS_AUTOCOMPLETE($search, $limit)` against the
233
+ * talent-profile surface. The schema types the return as a single
234
+ * `Employer` but real responses are a list — accepting either shape
235
+ * keeps callers from crashing if Toptal swings the cardinality.
236
+ *
237
+ * The `limit` argument bounds the suggestion count; default `10` mirrors
238
+ * the React app.
239
+ */
240
+ export async function employerAutocomplete(token, search, limit = 10) {
241
+ if (!search) {
242
+ throw new ProfileError("VALIDATION_ERROR", "employer-autocomplete requires a non-empty search query.");
243
+ }
244
+ const res = await callTalentProfile(token, "GET_EMPLOYERS_AUTOCOMPLETE", EMPLOYERS_AUTOCOMPLETE_QUERY, { search, limit }, "employer-autocomplete");
245
+ const body = res.body;
246
+ ensureNoTopLevelErrors(body, "employer-autocomplete");
247
+ const raw = body?.data?.employersAutocomplete;
248
+ if (raw === null || raw === undefined)
249
+ return [];
250
+ return Array.isArray(raw) ? raw : [raw];
251
+ }
252
+ function unwrapMutation(res, payloadKey, verb) {
253
+ const body = res.body;
254
+ ensureNoTopLevelErrors(body, verb);
255
+ const payload = body?.data?.[payloadKey];
256
+ if (!payload) {
257
+ throw new ProfileError("UNKNOWN", `${verb} response had no \`data.${payloadKey}\` field`);
258
+ }
259
+ applyUserErrorsAndSuccess(payload, verb);
260
+ return payload;
261
+ }
262
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/profile/employment/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,M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