Skip to content

Commit 4d57031

Browse files
feat(api): api update
1 parent 50af0c2 commit 4d57031

File tree

50 files changed

+790
-432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+790
-432
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-03a89ccdf10add981e714ad74c145cd3a2408bd0223108bbfe01cef4256ef7ed.yml
3-
openapi_spec_hash: 4179c69ca2f55a9fcfab41710a2f452c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0105d239fcaf84750c886dfa6c2cfbf2b2087f89a48f8827c4cbe28479ebfb13.yml
3+
openapi_spec_hash: 34895c3d3c137fb9f5a019ac5370afbb
44
config_hash: 6d3585c0032e08d723d077d660fc8448

README.md

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const client = new Finch({
2626
accessToken: 'My Access Token',
2727
});
2828

29-
const page = await client.hris.directory.list({ entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] });
29+
const page = await client.hris.directory.list();
3030
const individualInDirectory = page.individuals[0];
3131

3232
console.log(individualInDirectory.id);
@@ -44,8 +44,7 @@ const client = new Finch({
4444
accessToken: 'My Access Token',
4545
});
4646

47-
const params: Finch.HRIS.DirectoryListParams = { entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] };
48-
const [individualInDirectory]: [Finch.HRIS.IndividualInDirectory] = await client.hris.directory.list(params);
47+
const [individualInDirectory]: [Finch.HRIS.IndividualInDirectory] = await client.hris.directory.list();
4948
```
5049

5150
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -58,17 +57,15 @@ a subclass of `APIError` will be thrown:
5857

5958
<!-- prettier-ignore -->
6059
```ts
61-
const company = await client.hris.company
62-
.retrieve({ entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] })
63-
.catch(async (err) => {
64-
if (err instanceof Finch.APIError) {
65-
console.log(err.status); // 400
66-
console.log(err.name); // BadRequestError
67-
console.log(err.headers); // {server: 'nginx', ...}
68-
} else {
69-
throw err;
70-
}
71-
});
60+
const company = await client.hris.company.retrieve().catch(async (err) => {
61+
if (err instanceof Finch.APIError) {
62+
console.log(err.status); // 400
63+
console.log(err.name); // BadRequestError
64+
console.log(err.headers); // {server: 'nginx', ...}
65+
} else {
66+
throw err;
67+
}
68+
});
7269
```
7370

7471
Error codes are as follows:
@@ -100,7 +97,7 @@ const client = new Finch({
10097
});
10198

10299
// Or, configure per-request:
103-
await client.hris.directory.list({ entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] }, {
100+
await client.hris.directory.list({
104101
maxRetries: 5,
105102
});
106103
```
@@ -117,7 +114,7 @@ const client = new Finch({
117114
});
118115

119116
// Override per-request:
120-
await client.hris.directory.list({ entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] }, {
117+
await client.hris.directory.list({
121118
timeout: 5 * 1000,
122119
});
123120
```
@@ -135,9 +132,7 @@ You can use the `for await … of` syntax to iterate through items across all pa
135132
async function fetchAllIndividualInDirectories(params) {
136133
const allIndividualInDirectories = [];
137134
// Automatically fetches more pages as needed.
138-
for await (const individualInDirectory of client.hris.directory.list({
139-
entity_ids: ['550e8400-e29b-41d4-a716-446655440000'],
140-
})) {
135+
for await (const individualInDirectory of client.hris.directory.list()) {
141136
allIndividualInDirectories.push(individualInDirectory);
142137
}
143138
return allIndividualInDirectories;
@@ -147,7 +142,7 @@ async function fetchAllIndividualInDirectories(params) {
147142
Alternatively, you can request a single page at a time:
148143

149144
```ts
150-
let page = await client.hris.directory.list({ entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] });
145+
let page = await client.hris.directory.list();
151146
for (const individualInDirectory of page.individuals) {
152147
console.log(individualInDirectory);
153148
}
@@ -172,10 +167,7 @@ import Finch from '@tryfinch/finch-api';
172167

173168
const client = new Finch();
174169

175-
const page = await client.hris.directory.list(
176-
{ entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] },
177-
{ headers: { 'Finch-API-Version': 'My-Custom-Value' } },
178-
);
170+
const page = await client.hris.directory.list({ headers: { 'Finch-API-Version': 'My-Custom-Value' } });
179171
const individualInDirectory = page.individuals[0];
180172
```
181173

@@ -220,15 +212,11 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
220212
```ts
221213
const client = new Finch();
222214

223-
const response = await client.hris.directory
224-
.list({ entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] })
225-
.asResponse();
215+
const response = await client.hris.directory.list().asResponse();
226216
console.log(response.headers.get('X-My-Header'));
227217
console.log(response.statusText); // access the underlying Response object
228218

229-
const { data: page, response: raw } = await client.hris.directory
230-
.list({ entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] })
231-
.withResponse();
219+
const { data: page, response: raw } = await client.hris.directory.list().withResponse();
232220
console.log(raw.headers.get('X-My-Header'));
233221
for await (const individualInDirectory of page) {
234222
console.log(individualInDirectory.id);
@@ -336,12 +324,9 @@ const client = new Finch({
336324
});
337325

338326
// Override per-request:
339-
await client.hris.directory.list(
340-
{ entity_ids: ['550e8400-e29b-41d4-a716-446655440000'] },
341-
{
342-
httpAgent: new http.Agent({ keepAlive: false }),
343-
},
344-
);
327+
await client.hris.directory.list({
328+
httpAgent: new http.Agent({ keepAlive: false }),
329+
});
345330
```
346331

347332
## Semantic versioning

packages/mcp-server/src/tools/hris/benefits/create-hris-benefits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const tool: Tool = {
7575
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
7676
},
7777
},
78-
required: ['entity_ids'],
78+
required: [],
7979
$defs: {
8080
benefit_frequency: {
8181
type: 'string',

packages/mcp-server/src/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export const tool: Tool = {
124124
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
125125
},
126126
},
127-
required: ['benefit_id', 'entity_ids'],
127+
required: ['benefit_id'],
128128
},
129129
annotations: {},
130130
};

packages/mcp-server/src/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const tool: Tool = {
3939
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
4040
},
4141
},
42-
required: ['benefit_id', 'entity_ids'],
42+
required: ['benefit_id'],
4343
},
4444
annotations: {
4545
readOnlyHint: true,

packages/mcp-server/src/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const tool: Tool = {
4444
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
4545
},
4646
},
47-
required: ['benefit_id', 'entity_ids'],
47+
required: ['benefit_id'],
4848
},
4949
annotations: {
5050
readOnlyHint: true,

packages/mcp-server/src/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const tool: Tool = {
4646
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
4747
},
4848
},
49-
required: ['benefit_id', 'entity_ids'],
49+
required: ['benefit_id'],
5050
},
5151
annotations: {
5252
idempotentHint: true,

packages/mcp-server/src/tools/hris/benefits/list-hris-benefits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const tool: Tool = {
3636
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
3737
},
3838
},
39-
required: ['entity_ids'],
39+
required: [],
4040
},
4141
annotations: {
4242
readOnlyHint: true,

packages/mcp-server/src/tools/hris/benefits/list-supported-benefits-hris-benefits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const tool: Tool = {
3636
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
3737
},
3838
},
39-
required: ['entity_ids'],
39+
required: [],
4040
},
4141
annotations: {
4242
readOnlyHint: true,

packages/mcp-server/src/tools/hris/benefits/retrieve-hris-benefits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const tool: Tool = {
3939
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
4040
},
4141
},
42-
required: ['benefit_id', 'entity_ids'],
42+
required: ['benefit_id'],
4343
},
4444
annotations: {
4545
readOnlyHint: true,

0 commit comments

Comments
 (0)