Skip to content

Commit b6892f5

Browse files
feat(api): api update
1 parent 54ad7ca commit b6892f5

File tree

5 files changed

+67
-88
lines changed

5 files changed

+67
-88
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-0105d239fcaf84750c886dfa6c2cfbf2b2087f89a48f8827c4cbe28479ebfb13.yml
3-
openapi_spec_hash: 34895c3d3c137fb9f5a019ac5370afbb
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-b817e7a30a6366c063a8c9a334d5be281eb8d93e21acc8c8219d3bdc95043deb.yml
3+
openapi_spec_hash: d4cc4a5cba9f13986e38d148d330aa00
44
config_hash: 5c64f384746e7570c10f19fe241062a7

packages/mcp-server/src/tools/connect/sessions/new-connect-sessions.ts

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ export const tool: Tool = {
2222
inputSchema: {
2323
type: 'object',
2424
properties: {
25-
customer_email: {
26-
type: 'string',
27-
description: 'Email address of the customer',
28-
},
2925
customer_id: {
3026
type: 'string',
3127
description: 'Unique identifier for the customer',
@@ -34,31 +30,6 @@ export const tool: Tool = {
3430
type: 'string',
3531
description: 'Name of the customer',
3632
},
37-
integration: {
38-
type: 'object',
39-
description: 'Integration configuration for the connect session',
40-
properties: {
41-
auth_method: {
42-
type: 'string',
43-
description: 'The authentication method to use',
44-
enum: ['assisted', 'credential', 'oauth', 'api_token'],
45-
},
46-
provider: {
47-
type: 'string',
48-
description: 'The provider to integrate with',
49-
},
50-
},
51-
required: ['auth_method', 'provider'],
52-
},
53-
manual: {
54-
type: 'boolean',
55-
description: 'Enable manual authentication mode',
56-
},
57-
minutes_to_expire: {
58-
type: 'number',
59-
description:
60-
'The number of minutes until the session expires (defaults to 129,600, which is 90 days)',
61-
},
6233
products: {
6334
type: 'array',
6435
description: 'The Finch products to request access to',
@@ -79,6 +50,35 @@ export const tool: Tool = {
7950
],
8051
},
8152
},
53+
customer_email: {
54+
type: 'string',
55+
description: 'Email address of the customer',
56+
},
57+
integration: {
58+
type: 'object',
59+
description: 'Integration configuration for the connect session',
60+
properties: {
61+
provider: {
62+
type: 'string',
63+
description: 'The provider to integrate with',
64+
},
65+
auth_method: {
66+
type: 'string',
67+
description: 'The authentication method to use',
68+
enum: ['assisted', 'credential', 'oauth', 'api_token'],
69+
},
70+
},
71+
required: ['provider'],
72+
},
73+
manual: {
74+
type: 'boolean',
75+
description: 'Enable manual authentication mode',
76+
},
77+
minutes_to_expire: {
78+
type: 'number',
79+
description:
80+
'The number of minutes until the session expires (defaults to 129,600, which is 90 days)',
81+
},
8282
redirect_uri: {
8383
type: 'string',
8484
description: 'The URI to redirect to after the Connect flow is completed',
@@ -95,17 +95,7 @@ export const tool: Tool = {
9595
'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/).',
9696
},
9797
},
98-
required: [
99-
'customer_email',
100-
'customer_id',
101-
'customer_name',
102-
'integration',
103-
'manual',
104-
'minutes_to_expire',
105-
'products',
106-
'redirect_uri',
107-
'sandbox',
108-
],
98+
required: ['customer_id', 'customer_name', 'products'],
10999
},
110100
annotations: {},
111101
};

packages/mcp-server/src/tools/connect/sessions/reauthenticate-connect-sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const tool: Tool = {
6161
'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/).',
6262
},
6363
},
64-
required: ['connection_id', 'minutes_to_expire', 'products', 'redirect_uri'],
64+
required: ['connection_id'],
6565
},
6666
annotations: {},
6767
};

src/resources/connect/sessions.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ export interface SessionReauthenticateResponse {
4747
}
4848

4949
export interface SessionNewParams {
50-
/**
51-
* Email address of the customer
52-
*/
53-
customer_email: string | null;
54-
5550
/**
5651
* Unique identifier for the customer
5752
*/
@@ -62,22 +57,6 @@ export interface SessionNewParams {
6257
*/
6358
customer_name: string;
6459

65-
/**
66-
* Integration configuration for the connect session
67-
*/
68-
integration: SessionNewParams.Integration | null;
69-
70-
/**
71-
* Enable manual authentication mode
72-
*/
73-
manual: boolean | null;
74-
75-
/**
76-
* The number of minutes until the session expires (defaults to 129,600, which is
77-
* 90 days)
78-
*/
79-
minutes_to_expire: number | null;
80-
8160
/**
8261
* The Finch products to request access to
8362
*/
@@ -94,15 +73,36 @@ export interface SessionNewParams {
9473
| 'ssn'
9574
>;
9675

76+
/**
77+
* Email address of the customer
78+
*/
79+
customer_email?: string | null;
80+
81+
/**
82+
* Integration configuration for the connect session
83+
*/
84+
integration?: SessionNewParams.Integration | null;
85+
86+
/**
87+
* Enable manual authentication mode
88+
*/
89+
manual?: boolean | null;
90+
91+
/**
92+
* The number of minutes until the session expires (defaults to 129,600, which is
93+
* 90 days)
94+
*/
95+
minutes_to_expire?: number | null;
96+
9797
/**
9898
* The URI to redirect to after the Connect flow is completed
9999
*/
100-
redirect_uri: string | null;
100+
redirect_uri?: string | null;
101101

102102
/**
103103
* Sandbox mode for testing
104104
*/
105-
sandbox: 'finch' | 'provider' | null;
105+
sandbox?: 'finch' | 'provider' | null;
106106
}
107107

108108
export namespace SessionNewParams {
@@ -111,14 +111,14 @@ export namespace SessionNewParams {
111111
*/
112112
export interface Integration {
113113
/**
114-
* The authentication method to use
114+
* The provider to integrate with
115115
*/
116-
auth_method: 'assisted' | 'credential' | 'oauth' | 'api_token' | null;
116+
provider: string;
117117

118118
/**
119-
* The provider to integrate with
119+
* The authentication method to use
120120
*/
121-
provider: string | null;
121+
auth_method?: 'assisted' | 'credential' | 'oauth' | 'api_token' | null;
122122
}
123123
}
124124

@@ -132,12 +132,12 @@ export interface SessionReauthenticateParams {
132132
* The number of minutes until the session expires (defaults to 43,200, which is 30
133133
* days)
134134
*/
135-
minutes_to_expire: number;
135+
minutes_to_expire?: number;
136136

137137
/**
138138
* The products to request access to (optional for reauthentication)
139139
*/
140-
products: Array<
140+
products?: Array<
141141
| 'benefits'
142142
| 'company'
143143
| 'deduction'
@@ -153,7 +153,7 @@ export interface SessionReauthenticateParams {
153153
/**
154154
* The URI to redirect to after the Connect flow is completed
155155
*/
156-
redirect_uri: string | null;
156+
redirect_uri?: string | null;
157157
}
158158

159159
export declare namespace Sessions {

tests/api-resources/connect/sessions.test.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ describe('resource sessions', () => {
1212
// prism tests are broken
1313
test.skip('new: only required params', async () => {
1414
const responsePromise = client.connect.sessions.new({
15-
customer_email: 'dev@stainless.com',
1615
customer_id: 'x',
1716
customer_name: 'x',
18-
integration: { auth_method: 'assisted', provider: 'provider' },
19-
manual: true,
20-
minutes_to_expire: 1,
2117
products: ['benefits'],
22-
redirect_uri: 'redirect_uri',
23-
sandbox: 'finch',
2418
});
2519
const rawResponse = await responsePromise.asResponse();
2620
expect(rawResponse).toBeInstanceOf(Response);
@@ -34,26 +28,21 @@ describe('resource sessions', () => {
3428
// prism tests are broken
3529
test.skip('new: required and optional params', async () => {
3630
const response = await client.connect.sessions.new({
37-
customer_email: 'dev@stainless.com',
3831
customer_id: 'x',
3932
customer_name: 'x',
40-
integration: { auth_method: 'assisted', provider: 'provider' },
33+
products: ['benefits'],
34+
customer_email: 'dev@stainless.com',
35+
integration: { provider: 'provider', auth_method: 'assisted' },
4136
manual: true,
4237
minutes_to_expire: 1,
43-
products: ['benefits'],
4438
redirect_uri: 'redirect_uri',
4539
sandbox: 'finch',
4640
});
4741
});
4842

4943
// prism tests are broken
5044
test.skip('reauthenticate: only required params', async () => {
51-
const responsePromise = client.connect.sessions.reauthenticate({
52-
connection_id: 'connection_id',
53-
minutes_to_expire: 0,
54-
products: ['benefits'],
55-
redirect_uri: 'https://example.com',
56-
});
45+
const responsePromise = client.connect.sessions.reauthenticate({ connection_id: 'connection_id' });
5746
const rawResponse = await responsePromise.asResponse();
5847
expect(rawResponse).toBeInstanceOf(Response);
5948
const response = await responsePromise;

0 commit comments

Comments
 (0)