@factorialco/api-client 3.0.0-beta.2027010100 → 4.0.0-beta.2027010101
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 +70 -28
- package/dist/cjs/errors.d.ts +96 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +155 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/generated/sdk.gen.d.ts +2 -2
- package/dist/cjs/generated/sdk.gen.js +2 -2
- package/dist/cjs/generated/types.gen.d.ts +20 -3
- package/dist/cjs/generated/types.gen.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/pagination.d.ts +5 -3
- package/dist/cjs/pagination.d.ts.map +1 -1
- package/dist/cjs/pagination.js +5 -6
- package/dist/cjs/pagination.js.map +1 -1
- package/dist/cjs/sdk.d.ts +976 -956
- package/dist/cjs/sdk.d.ts.map +1 -1
- package/dist/cjs/sdk.js +871 -347
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/errors.d.ts +96 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +149 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/generated/sdk.gen.d.ts +2 -2
- package/dist/esm/generated/sdk.gen.js +2 -2
- package/dist/esm/generated/types.gen.d.ts +20 -3
- package/dist/esm/generated/types.gen.d.ts.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pagination.d.ts +5 -3
- package/dist/esm/pagination.d.ts.map +1 -1
- package/dist/esm/pagination.js +5 -6
- package/dist/esm/pagination.js.map +1 -1
- package/dist/esm/sdk.d.ts +976 -956
- package/dist/esm/sdk.d.ts.map +1 -1
- package/dist/esm/sdk.js +864 -342
- package/dist/esm/sdk.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error types for the Factorial API client.
|
|
3
|
+
*
|
|
4
|
+
* Every non-2xx HTTP response is thrown as a {@link FactorialApiError} carrying
|
|
5
|
+
* the status, method, URL and parsed body. Transport failures (DNS, connection
|
|
6
|
+
* reset, aborted request) are *not* wrapped — they surface as the underlying
|
|
7
|
+
* error, typically a `TypeError` from `fetch`.
|
|
8
|
+
*/
|
|
9
|
+
/** Constructor payload for {@link FactorialApiError}. */
|
|
10
|
+
export interface FactorialApiErrorInit {
|
|
11
|
+
/** HTTP status code, e.g. `401`. */
|
|
12
|
+
status: number;
|
|
13
|
+
/** HTTP reason phrase, e.g. `"Unauthorized"`. Empty over HTTP/2. */
|
|
14
|
+
statusText: string;
|
|
15
|
+
/** HTTP method of the failed request, e.g. `"GET"`. */
|
|
16
|
+
method: string;
|
|
17
|
+
/** Full request URL, including the query string. */
|
|
18
|
+
url: string;
|
|
19
|
+
/**
|
|
20
|
+
* Response body: the parsed JSON when the body was valid JSON, the raw string
|
|
21
|
+
* for non-JSON bodies, `undefined` when the body was empty.
|
|
22
|
+
*/
|
|
23
|
+
body: unknown;
|
|
24
|
+
/** Response headers. Rate-limit and request-id headers live here. */
|
|
25
|
+
headers?: Headers;
|
|
26
|
+
/** The raw `Response`, when one was produced. */
|
|
27
|
+
response?: Response;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Thrown for every non-2xx response from the Factorial API.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* try {
|
|
35
|
+
* await client.employees.employees.get({ path: { id: "1" } });
|
|
36
|
+
* } catch (err) {
|
|
37
|
+
* if (err instanceof FactorialApiError) {
|
|
38
|
+
* console.error(err.status, err.method, err.url, err.body);
|
|
39
|
+
* } else {
|
|
40
|
+
* throw err; // transport failure (e.g. a fetch TypeError)
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare class FactorialApiError extends Error {
|
|
46
|
+
/** HTTP status code, e.g. `401`. */
|
|
47
|
+
readonly status: number;
|
|
48
|
+
/** HTTP reason phrase, e.g. `"Unauthorized"`. Empty over HTTP/2. */
|
|
49
|
+
readonly statusText: string;
|
|
50
|
+
/** HTTP method of the failed request, e.g. `"GET"`. */
|
|
51
|
+
readonly method: string;
|
|
52
|
+
/** Full request URL, including the query string. */
|
|
53
|
+
readonly url: string;
|
|
54
|
+
/**
|
|
55
|
+
* Response body: the parsed JSON when the body was valid JSON, the raw string
|
|
56
|
+
* for non-JSON bodies, `undefined` when the body was empty.
|
|
57
|
+
*/
|
|
58
|
+
readonly body: unknown;
|
|
59
|
+
/**
|
|
60
|
+
* Response headers. Rate-limit and request-id headers live here.
|
|
61
|
+
*
|
|
62
|
+
* Non-enumerable, so logging the error stays readable.
|
|
63
|
+
*/
|
|
64
|
+
readonly headers: Headers;
|
|
65
|
+
/**
|
|
66
|
+
* The raw `Response`. Its body stream has already been consumed to populate
|
|
67
|
+
* {@link FactorialApiError.body} — read that instead.
|
|
68
|
+
*
|
|
69
|
+
* Non-enumerable, so logging the error stays readable.
|
|
70
|
+
*/
|
|
71
|
+
readonly response?: Response;
|
|
72
|
+
constructor(init: FactorialApiErrorInit);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* `instanceof`-safe check for {@link FactorialApiError}.
|
|
76
|
+
*
|
|
77
|
+
* Prefer `err instanceof FactorialApiError`. Use this helper when two copies of
|
|
78
|
+
* the package may be loaded at once (the ESM + CJS dual-package hazard), where
|
|
79
|
+
* `instanceof` can fail across realm boundaries.
|
|
80
|
+
*/
|
|
81
|
+
export declare function isFactorialApiError(error: unknown): error is FactorialApiError;
|
|
82
|
+
/**
|
|
83
|
+
* Converts the raw value thrown by the underlying fetch client for a non-2xx
|
|
84
|
+
* response (the parsed JSON body, the raw text, or `""`) into a
|
|
85
|
+
* {@link FactorialApiError}.
|
|
86
|
+
*
|
|
87
|
+
* Registered as the client's error interceptor by `FactorialClient`. Values
|
|
88
|
+
* that do not describe an HTTP error response are returned untouched:
|
|
89
|
+
*
|
|
90
|
+
* - no `Response` — a transport failure such as a `fetch` `TypeError`
|
|
91
|
+
* - an ok `Response` — a failure while parsing a 2xx body
|
|
92
|
+
* - an `Error` instance — already a usable error, e.g. thrown by a user
|
|
93
|
+
* interceptor
|
|
94
|
+
*/
|
|
95
|
+
export declare function toFactorialApiError(error: unknown, response: Response | undefined, request: Request | undefined): unknown;
|
|
96
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,yDAAyD;AACzD,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,oCAAoC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAG,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;gBAEjB,IAAI,EAAE,qBAAqB;CAwBxC;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAO9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,OAAO,CAaT"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error types for the Factorial API client.
|
|
3
|
+
*
|
|
4
|
+
* Every non-2xx HTTP response is thrown as a {@link FactorialApiError} carrying
|
|
5
|
+
* the status, method, URL and parsed body. Transport failures (DNS, connection
|
|
6
|
+
* reset, aborted request) are *not* wrapped — they surface as the underlying
|
|
7
|
+
* error, typically a `TypeError` from `fetch`.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Thrown for every non-2xx response from the Factorial API.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* try {
|
|
15
|
+
* await client.employees.employees.get({ path: { id: "1" } });
|
|
16
|
+
* } catch (err) {
|
|
17
|
+
* if (err instanceof FactorialApiError) {
|
|
18
|
+
* console.error(err.status, err.method, err.url, err.body);
|
|
19
|
+
* } else {
|
|
20
|
+
* throw err; // transport failure (e.g. a fetch TypeError)
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class FactorialApiError extends Error {
|
|
26
|
+
/** HTTP status code, e.g. `401`. */
|
|
27
|
+
status;
|
|
28
|
+
/** HTTP reason phrase, e.g. `"Unauthorized"`. Empty over HTTP/2. */
|
|
29
|
+
statusText;
|
|
30
|
+
/** HTTP method of the failed request, e.g. `"GET"`. */
|
|
31
|
+
method;
|
|
32
|
+
/** Full request URL, including the query string. */
|
|
33
|
+
url;
|
|
34
|
+
/**
|
|
35
|
+
* Response body: the parsed JSON when the body was valid JSON, the raw string
|
|
36
|
+
* for non-JSON bodies, `undefined` when the body was empty.
|
|
37
|
+
*/
|
|
38
|
+
body;
|
|
39
|
+
/**
|
|
40
|
+
* Response headers. Rate-limit and request-id headers live here.
|
|
41
|
+
*
|
|
42
|
+
* Non-enumerable, so logging the error stays readable.
|
|
43
|
+
*/
|
|
44
|
+
headers;
|
|
45
|
+
/**
|
|
46
|
+
* The raw `Response`. Its body stream has already been consumed to populate
|
|
47
|
+
* {@link FactorialApiError.body} — read that instead.
|
|
48
|
+
*
|
|
49
|
+
* Non-enumerable, so logging the error stays readable.
|
|
50
|
+
*/
|
|
51
|
+
response;
|
|
52
|
+
constructor(init) {
|
|
53
|
+
super(formatMessage(init));
|
|
54
|
+
this.name = "FactorialApiError";
|
|
55
|
+
this.status = init.status;
|
|
56
|
+
this.statusText = init.statusText;
|
|
57
|
+
this.method = init.method;
|
|
58
|
+
this.url = init.url;
|
|
59
|
+
this.body = init.body;
|
|
60
|
+
// `headers` and `response` are hidden from enumeration: console.error(err)
|
|
61
|
+
// and JSON.stringify(err) would otherwise dump the whole Response object,
|
|
62
|
+
// burying the fields that identify the failure.
|
|
63
|
+
Object.defineProperty(this, "headers", {
|
|
64
|
+
value: init.headers ?? new Headers(),
|
|
65
|
+
enumerable: false,
|
|
66
|
+
writable: false,
|
|
67
|
+
configurable: true,
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(this, "response", {
|
|
70
|
+
value: init.response,
|
|
71
|
+
enumerable: false,
|
|
72
|
+
writable: false,
|
|
73
|
+
configurable: true,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* `instanceof`-safe check for {@link FactorialApiError}.
|
|
79
|
+
*
|
|
80
|
+
* Prefer `err instanceof FactorialApiError`. Use this helper when two copies of
|
|
81
|
+
* the package may be loaded at once (the ESM + CJS dual-package hazard), where
|
|
82
|
+
* `instanceof` can fail across realm boundaries.
|
|
83
|
+
*/
|
|
84
|
+
export function isFactorialApiError(error) {
|
|
85
|
+
return (error instanceof FactorialApiError ||
|
|
86
|
+
(typeof error === "object" &&
|
|
87
|
+
error !== null &&
|
|
88
|
+
error.name === "FactorialApiError"));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Converts the raw value thrown by the underlying fetch client for a non-2xx
|
|
92
|
+
* response (the parsed JSON body, the raw text, or `""`) into a
|
|
93
|
+
* {@link FactorialApiError}.
|
|
94
|
+
*
|
|
95
|
+
* Registered as the client's error interceptor by `FactorialClient`. Values
|
|
96
|
+
* that do not describe an HTTP error response are returned untouched:
|
|
97
|
+
*
|
|
98
|
+
* - no `Response` — a transport failure such as a `fetch` `TypeError`
|
|
99
|
+
* - an ok `Response` — a failure while parsing a 2xx body
|
|
100
|
+
* - an `Error` instance — already a usable error, e.g. thrown by a user
|
|
101
|
+
* interceptor
|
|
102
|
+
*/
|
|
103
|
+
export function toFactorialApiError(error, response, request) {
|
|
104
|
+
if (response === undefined || response.ok)
|
|
105
|
+
return error;
|
|
106
|
+
if (error instanceof Error)
|
|
107
|
+
return error;
|
|
108
|
+
return new FactorialApiError({
|
|
109
|
+
status: response.status,
|
|
110
|
+
statusText: response.statusText,
|
|
111
|
+
method: request?.method ?? "UNKNOWN",
|
|
112
|
+
url: request?.url ?? response.url,
|
|
113
|
+
// An empty body reaches us as "" because JSON.parse("") throws upstream.
|
|
114
|
+
body: error === "" ? undefined : error,
|
|
115
|
+
headers: response.headers,
|
|
116
|
+
response,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/** Longest body excerpt appended to the error message. */
|
|
120
|
+
const EXCERPT_MAX_LENGTH = 200;
|
|
121
|
+
function formatMessage({ status, statusText, method, url, body, }) {
|
|
122
|
+
const head = `Factorial API ${status}${statusText ? ` ${statusText}` : ""}: ${method} ${url}`;
|
|
123
|
+
const excerpt = bodyExcerpt(body);
|
|
124
|
+
return excerpt ? `${head} — ${excerpt}` : head;
|
|
125
|
+
}
|
|
126
|
+
function bodyExcerpt(body) {
|
|
127
|
+
if (body === undefined || body === null || body === "")
|
|
128
|
+
return undefined;
|
|
129
|
+
let text;
|
|
130
|
+
if (typeof body === "string") {
|
|
131
|
+
text = body;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
try {
|
|
135
|
+
text = JSON.stringify(body) ?? String(body);
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
// Circular structures and BigInt values make JSON.stringify throw.
|
|
139
|
+
text = String(body);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const oneLine = text.replace(/\s+/g, " ").trim();
|
|
143
|
+
if (!oneLine)
|
|
144
|
+
return undefined;
|
|
145
|
+
return oneLine.length > EXCERPT_MAX_LENGTH
|
|
146
|
+
? `${oneLine.slice(0, EXCERPT_MAX_LENGTH)}…`
|
|
147
|
+
: oneLine;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAuBH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,oCAAoC;IAC3B,MAAM,CAAS;IACxB,oEAAoE;IAC3D,UAAU,CAAS;IAC5B,uDAAuD;IAC9C,MAAM,CAAS;IACxB,oDAAoD;IAC3C,GAAG,CAAS;IACrB;;;OAGG;IACM,IAAI,CAAU;IACvB;;;;OAIG;IACM,OAAO,CAAW;IAC3B;;;;;OAKG;IACM,QAAQ,CAAY;IAE7B,YAAY,IAA2B;QACrC,KAAK,CAA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C9C,CAAC;QAAC,MAAM,CAAC;YACP,mEAAmE;YACnE,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACjD,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,OAAO,OAAO,CAAC,MAAM,GAAG,kBAAkB;QACxC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,GAAG;QAC5C,CAAC,CAAC,OAAO,CAAC;AACd,CAAC"}
|
|
@@ -1295,13 +1295,13 @@ export declare const getApi20270101ResourcesEmployeeUpdatesAbsencesById: <ThrowO
|
|
|
1295
1295
|
/**
|
|
1296
1296
|
* Reads all Contract changes
|
|
1297
1297
|
*
|
|
1298
|
-
* This endpoint can be used to retrieve a list of contract changes `employee updates` details.
|
|
1298
|
+
* This endpoint can be used to retrieve a list of contract changes `employee updates` details. It covers updates to the contract conditions as well as the activity changes of fixed-discontinuous contracts, told apart by `type`.
|
|
1299
1299
|
*/
|
|
1300
1300
|
export declare const getApi20270101ResourcesEmployeeUpdatesContractChanges: <ThrowOnError extends boolean = false>(options?: Options<GetApi20270101ResourcesEmployeeUpdatesContractChangesData, ThrowOnError>) => RequestResult<GetApi20270101ResourcesEmployeeUpdatesContractChangesResponses, unknown, ThrowOnError>;
|
|
1301
1301
|
/**
|
|
1302
1302
|
* Reads a single Contract change
|
|
1303
1303
|
*
|
|
1304
|
-
* This endpoint can be used to retrieve a list of contract changes `employee updates` details.
|
|
1304
|
+
* This endpoint can be used to retrieve a list of contract changes `employee updates` details. It covers updates to the contract conditions as well as the activity changes of fixed-discontinuous contracts, told apart by `type`.
|
|
1305
1305
|
*/
|
|
1306
1306
|
export declare const getApi20270101ResourcesEmployeeUpdatesContractChangesById: <ThrowOnError extends boolean = false>(options: Options<GetApi20270101ResourcesEmployeeUpdatesContractChangesByIdData, ThrowOnError>) => RequestResult<GetApi20270101ResourcesEmployeeUpdatesContractChangesByIdResponses, unknown, ThrowOnError>;
|
|
1307
1307
|
/**
|
|
@@ -2425,7 +2425,7 @@ export const getApi20270101ResourcesEmployeeUpdatesAbsencesById = (options) => (
|
|
|
2425
2425
|
/**
|
|
2426
2426
|
* Reads all Contract changes
|
|
2427
2427
|
*
|
|
2428
|
-
* This endpoint can be used to retrieve a list of contract changes `employee updates` details.
|
|
2428
|
+
* This endpoint can be used to retrieve a list of contract changes `employee updates` details. It covers updates to the contract conditions as well as the activity changes of fixed-discontinuous contracts, told apart by `type`.
|
|
2429
2429
|
*/
|
|
2430
2430
|
export const getApi20270101ResourcesEmployeeUpdatesContractChanges = (options) => (options?.client ?? client).get({
|
|
2431
2431
|
security: [{ scheme: 'bearer', type: 'http' }, { name: 'x-api-key', type: 'apiKey' }],
|
|
@@ -2435,7 +2435,7 @@ export const getApi20270101ResourcesEmployeeUpdatesContractChanges = (options) =
|
|
|
2435
2435
|
/**
|
|
2436
2436
|
* Reads a single Contract change
|
|
2437
2437
|
*
|
|
2438
|
-
* This endpoint can be used to retrieve a list of contract changes `employee updates` details.
|
|
2438
|
+
* This endpoint can be used to retrieve a list of contract changes `employee updates` details. It covers updates to the contract conditions as well as the activity changes of fixed-discontinuous contracts, told apart by `type`.
|
|
2439
2439
|
*/
|
|
2440
2440
|
export const getApi20270101ResourcesEmployeeUpdatesContractChangesById = (options) => (options.client ?? client).get({
|
|
2441
2441
|
security: [{ scheme: 'bearer', type: 'http' }, { name: 'x-api-key', type: 'apiKey' }],
|
|
@@ -3337,6 +3337,14 @@ export type EmployeeUpdatesContractChange = {
|
|
|
3337
3337
|
* The status of the contract change incidence
|
|
3338
3338
|
*/
|
|
3339
3339
|
status: string;
|
|
3340
|
+
/**
|
|
3341
|
+
* The kind of contract change. `contract` is an update to the contract conditions. `contract_deactivation` and `contract_reactivation` close and reopen an activity period of a fixed-discontinuous contract, and carry the conditions of the contract version in force on that date.
|
|
3342
|
+
*/
|
|
3343
|
+
type: string;
|
|
3344
|
+
/**
|
|
3345
|
+
* The date the activity period closed or reopened, for a `contract_deactivation` or `contract_reactivation`. Null for a plain `contract` change, whose date is `effective_on`. The other dates on this payload belong to the contract version in force on this date, not to the activity change itself.
|
|
3346
|
+
*/
|
|
3347
|
+
activity_changed_on?: string;
|
|
3340
3348
|
/**
|
|
3341
3349
|
* The effective date of the contract
|
|
3342
3350
|
*/
|
|
@@ -3489,6 +3497,9 @@ export type EmployeeUpdatesContractChange = {
|
|
|
3489
3497
|
* The work type name on the contract change
|
|
3490
3498
|
*/
|
|
3491
3499
|
fr_work_type_name?: string;
|
|
3500
|
+
/**
|
|
3501
|
+
* The ids of the additional compensations on the contract change
|
|
3502
|
+
*/
|
|
3492
3503
|
compensation_ids?: Array<string>;
|
|
3493
3504
|
/**
|
|
3494
3505
|
* The contract type id on the contract change
|
|
@@ -3514,7 +3525,13 @@ export type EmployeeUpdatesContractChange = {
|
|
|
3514
3525
|
* The contract type name on the contract change
|
|
3515
3526
|
*/
|
|
3516
3527
|
pt_contract_type_name?: string;
|
|
3528
|
+
/**
|
|
3529
|
+
* Time the contract change incidence was created
|
|
3530
|
+
*/
|
|
3517
3531
|
created_at: string;
|
|
3532
|
+
/**
|
|
3533
|
+
* Time the contract change incidence was last updated
|
|
3534
|
+
*/
|
|
3518
3535
|
updated_at: string;
|
|
3519
3536
|
};
|
|
3520
3537
|
export type EmployeeUpdatesNewHire = {
|
|
@@ -3990,7 +4007,7 @@ export type ExpensesExpense = {
|
|
|
3990
4007
|
*/
|
|
3991
4008
|
external_authorization_id?: string;
|
|
3992
4009
|
/**
|
|
3993
|
-
* The id of the card
|
|
4010
|
+
* The id of the Factorial card the expense was paid with. It is set on every expense raised from a Factorial card payment or dispute and null on every other expense, including one paid with a card from another provider, so it is how to tell Factorial card spend apart. GraphQL exposes it as the `factorialCard` relation and deprecates the raw id.
|
|
3994
4011
|
*/
|
|
3995
4012
|
expenses_card_id?: string;
|
|
3996
4013
|
/**
|
|
@@ -4046,11 +4063,11 @@ export type ExpensesExpense = {
|
|
|
4046
4063
|
*/
|
|
4047
4064
|
document_type?: string;
|
|
4048
4065
|
/**
|
|
4049
|
-
*
|
|
4066
|
+
* Who paid, one of 'reimbursable' (the employee paid with their own money and is owed it back) or 'not_reimbursable' (the company paid, with a Factorial card, another corporate card or company cash).
|
|
4050
4067
|
*/
|
|
4051
4068
|
payment?: 'reimbursable' | 'not_reimbursable';
|
|
4052
4069
|
/**
|
|
4053
|
-
*
|
|
4070
|
+
* How the expense was paid, as the id of an option in the company's payment-method list, or null when the employee left it empty. The built-in ids are 'personal_debit_card', 'personal_credit_card' and 'cash' under a reimbursable payment, and 'factorial_card', 'corporate_debit_card', 'corporate_credit_card' and 'company_cash' under a not-reimbursable one; a company can add options with ids of its own. A corporate card from another provider is one of the 'corporate_*' options, chosen by the employee. To tell Factorial card spend apart, use `expenses_card_id` — the `factorialCard` relation in GraphQL — rather than 'factorial_card'.
|
|
4054
4071
|
*/
|
|
4055
4072
|
payment_method?: string;
|
|
4056
4073
|
/**
|