@smithery/api 0.33.0 → 0.34.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/CHANGELOG.md +21 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js +3 -2
- package/client.js.map +1 -1
- package/client.mjs +3 -2
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/tokens.d.mts +30 -106
- package/resources/tokens.d.mts.map +1 -1
- package/resources/tokens.d.ts +30 -106
- package/resources/tokens.d.ts.map +1 -1
- package/resources/tokens.js +3 -11
- package/resources/tokens.js.map +1 -1
- package/resources/tokens.mjs +3 -11
- package/resources/tokens.mjs.map +1 -1
- package/src/client.ts +5 -12
- package/src/internal/parse.ts +6 -0
- package/src/resources/index.ts +1 -5
- package/src/resources/tokens.ts +34 -118
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/tokens.d.mts
CHANGED
|
@@ -3,92 +3,52 @@ import { APIPromise } from "../core/api-promise.mjs";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
4
|
export declare class Tokens extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
* Create a service token for machine-to-machine authentication.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const createTokenResponse = await client.tokens.create({
|
|
12
|
-
* allow: {},
|
|
13
|
-
* ttlSeconds: 3600,
|
|
14
|
-
* });
|
|
15
|
-
* ```
|
|
6
|
+
* Create a service token for machine-to-machine authentication. Accepts API key or
|
|
7
|
+
* bearer token. Optionally apply restrictions.
|
|
16
8
|
*/
|
|
17
|
-
create(body
|
|
9
|
+
create(body?: TokenCreateParams | null | undefined, options?: RequestOptions): APIPromise<CreateTokenResponse>;
|
|
18
10
|
}
|
|
19
|
-
|
|
20
|
-
* Permission action. 'read' allows reading/listing. 'write' allows
|
|
21
|
-
* create/modify/delete.
|
|
22
|
-
*/
|
|
23
|
-
export type Action = 'read' | 'write';
|
|
24
|
-
/**
|
|
25
|
-
* Permission grants with per-resource scoping. Each resource defines its own
|
|
26
|
-
* namespaces and constraints.
|
|
27
|
-
*/
|
|
28
|
-
export interface Allow {
|
|
11
|
+
export interface Constraint {
|
|
29
12
|
/**
|
|
30
|
-
*
|
|
13
|
+
* Metadata filter facts. Each object is an OR condition; keys within are AND-ed.
|
|
31
14
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Scope for MCP protocol operations on connections.
|
|
39
|
-
*/
|
|
40
|
-
mcp?: McpScope;
|
|
41
|
-
/**
|
|
42
|
-
* Scope for namespace management.
|
|
43
|
-
*/
|
|
44
|
-
namespaces?: ResourceScope;
|
|
45
|
-
/**
|
|
46
|
-
* Scope for server metadata and configuration.
|
|
47
|
-
*/
|
|
48
|
-
servers?: ResourceScope;
|
|
15
|
+
metadata?: {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
} | Array<{
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
}>;
|
|
49
20
|
/**
|
|
50
|
-
*
|
|
21
|
+
* Restrict token to specific namespaces.
|
|
51
22
|
*/
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Scope for connection operations.
|
|
56
|
-
*/
|
|
57
|
-
export interface ConnectionScope {
|
|
23
|
+
namespaces?: string | Array<string>;
|
|
58
24
|
/**
|
|
59
|
-
*
|
|
25
|
+
* Restrict token to specific operations.
|
|
60
26
|
*/
|
|
61
|
-
|
|
27
|
+
operations?: 'read' | 'write' | 'execute' | Array<'read' | 'write' | 'execute'>;
|
|
62
28
|
/**
|
|
63
|
-
*
|
|
29
|
+
* Restrict token to specific resource types.
|
|
64
30
|
*/
|
|
65
|
-
namespaces
|
|
31
|
+
resources?: 'connections' | 'servers' | 'namespaces' | 'skills' | Array<'connections' | 'servers' | 'namespaces' | 'skills'>;
|
|
66
32
|
/**
|
|
67
|
-
*
|
|
68
|
-
* semantics).
|
|
33
|
+
* TTL as seconds or duration string ("1h", "30m", "20s").
|
|
69
34
|
*/
|
|
70
|
-
|
|
71
|
-
[key: string]: string;
|
|
72
|
-
};
|
|
35
|
+
ttl?: string | number;
|
|
73
36
|
}
|
|
74
37
|
export interface CreateTokenRequest {
|
|
75
38
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
|
|
79
|
-
allow: Allow;
|
|
80
|
-
/**
|
|
81
|
-
* Token TTL in seconds. Required. Max 86400 (24 hours).
|
|
39
|
+
* Constraint objects to restrict the token. Cannot be combined with profileSlug.
|
|
40
|
+
* Each constraint may include a `ttl` field (max 24 hours). Default TTL is 1 hour.
|
|
41
|
+
* Maximum is 24 hours.
|
|
82
42
|
*/
|
|
83
|
-
|
|
43
|
+
policy?: Array<Constraint>;
|
|
84
44
|
/**
|
|
85
|
-
* Profile
|
|
45
|
+
* Profile slug for legacy token minting. Cannot be combined with policy.
|
|
86
46
|
*/
|
|
87
47
|
profileSlug?: string;
|
|
88
48
|
}
|
|
89
49
|
export interface CreateTokenResponse {
|
|
90
50
|
/**
|
|
91
|
-
* The signed service token
|
|
51
|
+
* The signed service token.
|
|
92
52
|
*/
|
|
93
53
|
token: string;
|
|
94
54
|
/**
|
|
@@ -96,55 +56,19 @@ export interface CreateTokenResponse {
|
|
|
96
56
|
*/
|
|
97
57
|
expiresAt: string;
|
|
98
58
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Scope for MCP operations on connections.
|
|
101
|
-
*/
|
|
102
|
-
export interface McpScope {
|
|
103
|
-
/**
|
|
104
|
-
* Actions allowed for MCP calls.
|
|
105
|
-
*/
|
|
106
|
-
actions: Array<Action>;
|
|
107
|
-
/**
|
|
108
|
-
* Namespaces this scope applies to. Use '\*' for all namespaces.
|
|
109
|
-
*/
|
|
110
|
-
namespaces: Array<string>;
|
|
111
|
-
/**
|
|
112
|
-
* Filter access to connections with matching metadata. All keys must match (AND
|
|
113
|
-
* semantics).
|
|
114
|
-
*/
|
|
115
|
-
metadata?: {
|
|
116
|
-
[key: string]: string;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Scope for resource operations.
|
|
121
|
-
*/
|
|
122
|
-
export interface ResourceScope {
|
|
123
|
-
/**
|
|
124
|
-
* Actions allowed on this resource.
|
|
125
|
-
*/
|
|
126
|
-
actions: Array<Action>;
|
|
127
|
-
/**
|
|
128
|
-
* Namespaces this scope applies to. Use '\*' for all namespaces.
|
|
129
|
-
*/
|
|
130
|
-
namespaces: Array<string>;
|
|
131
|
-
}
|
|
132
59
|
export interface TokenCreateParams {
|
|
133
60
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
|
|
137
|
-
allow: Allow;
|
|
138
|
-
/**
|
|
139
|
-
* Token TTL in seconds. Required. Max 86400 (24 hours).
|
|
61
|
+
* Constraint objects to restrict the token. Cannot be combined with profileSlug.
|
|
62
|
+
* Each constraint may include a `ttl` field (max 24 hours). Default TTL is 1 hour.
|
|
63
|
+
* Maximum is 24 hours.
|
|
140
64
|
*/
|
|
141
|
-
|
|
65
|
+
policy?: Array<Constraint>;
|
|
142
66
|
/**
|
|
143
|
-
* Profile
|
|
67
|
+
* Profile slug for legacy token minting. Cannot be combined with policy.
|
|
144
68
|
*/
|
|
145
69
|
profileSlug?: string;
|
|
146
70
|
}
|
|
147
71
|
export declare namespace Tokens {
|
|
148
|
-
export { type
|
|
72
|
+
export { type Constraint as Constraint, type CreateTokenRequest as CreateTokenRequest, type CreateTokenResponse as CreateTokenResponse, type TokenCreateParams as TokenCreateParams, };
|
|
149
73
|
}
|
|
150
74
|
//# sourceMappingURL=tokens.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.mts","sourceRoot":"","sources":["../src/resources/tokens.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"tokens.d.mts","sourceRoot":"","sources":["../src/resources/tokens.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,MAAM,CACJ,IAAI,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;CAGnC;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;IAExE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAEhF;;OAEG;IACH,SAAS,CAAC,EACN,aAAa,GACb,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,KAAK,CAAC,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,CAAC,CAAC;IAE/D;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAE3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAE3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/tokens.d.ts
CHANGED
|
@@ -3,92 +3,52 @@ import { APIPromise } from "../core/api-promise.js";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
export declare class Tokens extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
* Create a service token for machine-to-machine authentication.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const createTokenResponse = await client.tokens.create({
|
|
12
|
-
* allow: {},
|
|
13
|
-
* ttlSeconds: 3600,
|
|
14
|
-
* });
|
|
15
|
-
* ```
|
|
6
|
+
* Create a service token for machine-to-machine authentication. Accepts API key or
|
|
7
|
+
* bearer token. Optionally apply restrictions.
|
|
16
8
|
*/
|
|
17
|
-
create(body
|
|
9
|
+
create(body?: TokenCreateParams | null | undefined, options?: RequestOptions): APIPromise<CreateTokenResponse>;
|
|
18
10
|
}
|
|
19
|
-
|
|
20
|
-
* Permission action. 'read' allows reading/listing. 'write' allows
|
|
21
|
-
* create/modify/delete.
|
|
22
|
-
*/
|
|
23
|
-
export type Action = 'read' | 'write';
|
|
24
|
-
/**
|
|
25
|
-
* Permission grants with per-resource scoping. Each resource defines its own
|
|
26
|
-
* namespaces and constraints.
|
|
27
|
-
*/
|
|
28
|
-
export interface Allow {
|
|
11
|
+
export interface Constraint {
|
|
29
12
|
/**
|
|
30
|
-
*
|
|
13
|
+
* Metadata filter facts. Each object is an OR condition; keys within are AND-ed.
|
|
31
14
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Scope for MCP protocol operations on connections.
|
|
39
|
-
*/
|
|
40
|
-
mcp?: McpScope;
|
|
41
|
-
/**
|
|
42
|
-
* Scope for namespace management.
|
|
43
|
-
*/
|
|
44
|
-
namespaces?: ResourceScope;
|
|
45
|
-
/**
|
|
46
|
-
* Scope for server metadata and configuration.
|
|
47
|
-
*/
|
|
48
|
-
servers?: ResourceScope;
|
|
15
|
+
metadata?: {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
} | Array<{
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
}>;
|
|
49
20
|
/**
|
|
50
|
-
*
|
|
21
|
+
* Restrict token to specific namespaces.
|
|
51
22
|
*/
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Scope for connection operations.
|
|
56
|
-
*/
|
|
57
|
-
export interface ConnectionScope {
|
|
23
|
+
namespaces?: string | Array<string>;
|
|
58
24
|
/**
|
|
59
|
-
*
|
|
25
|
+
* Restrict token to specific operations.
|
|
60
26
|
*/
|
|
61
|
-
|
|
27
|
+
operations?: 'read' | 'write' | 'execute' | Array<'read' | 'write' | 'execute'>;
|
|
62
28
|
/**
|
|
63
|
-
*
|
|
29
|
+
* Restrict token to specific resource types.
|
|
64
30
|
*/
|
|
65
|
-
namespaces
|
|
31
|
+
resources?: 'connections' | 'servers' | 'namespaces' | 'skills' | Array<'connections' | 'servers' | 'namespaces' | 'skills'>;
|
|
66
32
|
/**
|
|
67
|
-
*
|
|
68
|
-
* semantics).
|
|
33
|
+
* TTL as seconds or duration string ("1h", "30m", "20s").
|
|
69
34
|
*/
|
|
70
|
-
|
|
71
|
-
[key: string]: string;
|
|
72
|
-
};
|
|
35
|
+
ttl?: string | number;
|
|
73
36
|
}
|
|
74
37
|
export interface CreateTokenRequest {
|
|
75
38
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
|
|
79
|
-
allow: Allow;
|
|
80
|
-
/**
|
|
81
|
-
* Token TTL in seconds. Required. Max 86400 (24 hours).
|
|
39
|
+
* Constraint objects to restrict the token. Cannot be combined with profileSlug.
|
|
40
|
+
* Each constraint may include a `ttl` field (max 24 hours). Default TTL is 1 hour.
|
|
41
|
+
* Maximum is 24 hours.
|
|
82
42
|
*/
|
|
83
|
-
|
|
43
|
+
policy?: Array<Constraint>;
|
|
84
44
|
/**
|
|
85
|
-
* Profile
|
|
45
|
+
* Profile slug for legacy token minting. Cannot be combined with policy.
|
|
86
46
|
*/
|
|
87
47
|
profileSlug?: string;
|
|
88
48
|
}
|
|
89
49
|
export interface CreateTokenResponse {
|
|
90
50
|
/**
|
|
91
|
-
* The signed service token
|
|
51
|
+
* The signed service token.
|
|
92
52
|
*/
|
|
93
53
|
token: string;
|
|
94
54
|
/**
|
|
@@ -96,55 +56,19 @@ export interface CreateTokenResponse {
|
|
|
96
56
|
*/
|
|
97
57
|
expiresAt: string;
|
|
98
58
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Scope for MCP operations on connections.
|
|
101
|
-
*/
|
|
102
|
-
export interface McpScope {
|
|
103
|
-
/**
|
|
104
|
-
* Actions allowed for MCP calls.
|
|
105
|
-
*/
|
|
106
|
-
actions: Array<Action>;
|
|
107
|
-
/**
|
|
108
|
-
* Namespaces this scope applies to. Use '\*' for all namespaces.
|
|
109
|
-
*/
|
|
110
|
-
namespaces: Array<string>;
|
|
111
|
-
/**
|
|
112
|
-
* Filter access to connections with matching metadata. All keys must match (AND
|
|
113
|
-
* semantics).
|
|
114
|
-
*/
|
|
115
|
-
metadata?: {
|
|
116
|
-
[key: string]: string;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Scope for resource operations.
|
|
121
|
-
*/
|
|
122
|
-
export interface ResourceScope {
|
|
123
|
-
/**
|
|
124
|
-
* Actions allowed on this resource.
|
|
125
|
-
*/
|
|
126
|
-
actions: Array<Action>;
|
|
127
|
-
/**
|
|
128
|
-
* Namespaces this scope applies to. Use '\*' for all namespaces.
|
|
129
|
-
*/
|
|
130
|
-
namespaces: Array<string>;
|
|
131
|
-
}
|
|
132
59
|
export interface TokenCreateParams {
|
|
133
60
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
|
|
137
|
-
allow: Allow;
|
|
138
|
-
/**
|
|
139
|
-
* Token TTL in seconds. Required. Max 86400 (24 hours).
|
|
61
|
+
* Constraint objects to restrict the token. Cannot be combined with profileSlug.
|
|
62
|
+
* Each constraint may include a `ttl` field (max 24 hours). Default TTL is 1 hour.
|
|
63
|
+
* Maximum is 24 hours.
|
|
140
64
|
*/
|
|
141
|
-
|
|
65
|
+
policy?: Array<Constraint>;
|
|
142
66
|
/**
|
|
143
|
-
* Profile
|
|
67
|
+
* Profile slug for legacy token minting. Cannot be combined with policy.
|
|
144
68
|
*/
|
|
145
69
|
profileSlug?: string;
|
|
146
70
|
}
|
|
147
71
|
export declare namespace Tokens {
|
|
148
|
-
export { type
|
|
72
|
+
export { type Constraint as Constraint, type CreateTokenRequest as CreateTokenRequest, type CreateTokenResponse as CreateTokenResponse, type TokenCreateParams as TokenCreateParams, };
|
|
149
73
|
}
|
|
150
74
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/resources/tokens.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/resources/tokens.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,MAAM,CACJ,IAAI,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;CAGnC;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;IAExE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAEhF;;OAEG;IACH,SAAS,CAAC,EACN,aAAa,GACb,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,KAAK,CAAC,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,CAAC,CAAC;IAE/D;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAE3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAE3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/tokens.js
CHANGED
|
@@ -5,18 +5,10 @@ exports.Tokens = void 0;
|
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
class Tokens extends resource_1.APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Create a service token for machine-to-machine authentication.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const createTokenResponse = await client.tokens.create({
|
|
14
|
-
* allow: {},
|
|
15
|
-
* ttlSeconds: 3600,
|
|
16
|
-
* });
|
|
17
|
-
* ```
|
|
8
|
+
* Create a service token for machine-to-machine authentication. Accepts API key or
|
|
9
|
+
* bearer token. Optionally apply restrictions.
|
|
18
10
|
*/
|
|
19
|
-
create(body, options) {
|
|
11
|
+
create(body = {}, options) {
|
|
20
12
|
return this._client.post('/tokens', { body, ...options });
|
|
21
13
|
}
|
|
22
14
|
}
|
package/resources/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/resources/tokens.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,MAAO,SAAQ,sBAAW;IACrC
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/resources/tokens.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;OAGG;IACH,MAAM,CACJ,OAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF;AAXD,wBAWC"}
|
package/resources/tokens.mjs
CHANGED
|
@@ -2,18 +2,10 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
export class Tokens extends APIResource {
|
|
4
4
|
/**
|
|
5
|
-
* Create a service token for machine-to-machine authentication.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* const createTokenResponse = await client.tokens.create({
|
|
11
|
-
* allow: {},
|
|
12
|
-
* ttlSeconds: 3600,
|
|
13
|
-
* });
|
|
14
|
-
* ```
|
|
5
|
+
* Create a service token for machine-to-machine authentication. Accepts API key or
|
|
6
|
+
* bearer token. Optionally apply restrictions.
|
|
15
7
|
*/
|
|
16
|
-
create(body, options) {
|
|
8
|
+
create(body = {}, options) {
|
|
17
9
|
return this._client.post('/tokens', { body, ...options });
|
|
18
10
|
}
|
|
19
11
|
}
|
package/resources/tokens.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.mjs","sourceRoot":"","sources":["../src/resources/tokens.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"tokens.mjs","sourceRoot":"","sources":["../src/resources/tokens.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,MAAM,CACJ,OAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -28,13 +28,9 @@ import { APIPromise } from './core/api-promise';
|
|
|
28
28
|
import { Health, HealthCheckResponse } from './resources/health';
|
|
29
29
|
import { SkillListParams, SkillListResponse, SkillListResponsesSkillsPage, Skills } from './resources/skills';
|
|
30
30
|
import {
|
|
31
|
-
|
|
32
|
-
Allow,
|
|
33
|
-
ConnectionScope,
|
|
31
|
+
Constraint,
|
|
34
32
|
CreateTokenRequest,
|
|
35
33
|
CreateTokenResponse,
|
|
36
|
-
McpScope,
|
|
37
|
-
ResourceScope,
|
|
38
34
|
TokenCreateParams,
|
|
39
35
|
Tokens,
|
|
40
36
|
} from './resources/tokens';
|
|
@@ -536,9 +532,10 @@ export class Smithery {
|
|
|
536
532
|
controller: AbortController,
|
|
537
533
|
): Promise<Response> {
|
|
538
534
|
const { signal, method, ...options } = init || {};
|
|
539
|
-
|
|
535
|
+
const abort = controller.abort.bind(controller);
|
|
536
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
540
537
|
|
|
541
|
-
const timeout = setTimeout(
|
|
538
|
+
const timeout = setTimeout(abort, ms);
|
|
542
539
|
|
|
543
540
|
const isReadableBody =
|
|
544
541
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -823,13 +820,9 @@ export declare namespace Smithery {
|
|
|
823
820
|
|
|
824
821
|
export {
|
|
825
822
|
Tokens as Tokens,
|
|
826
|
-
type
|
|
827
|
-
type Allow as Allow,
|
|
828
|
-
type ConnectionScope as ConnectionScope,
|
|
823
|
+
type Constraint as Constraint,
|
|
829
824
|
type CreateTokenRequest as CreateTokenRequest,
|
|
830
825
|
type CreateTokenResponse as CreateTokenResponse,
|
|
831
|
-
type McpScope as McpScope,
|
|
832
|
-
type ResourceScope as ResourceScope,
|
|
833
826
|
type TokenCreateParams as TokenCreateParams,
|
|
834
827
|
};
|
|
835
828
|
|
package/src/internal/parse.ts
CHANGED
|
@@ -43,6 +43,12 @@ export async function defaultParseResponse<T>(client: Smithery, props: APIRespon
|
|
|
43
43
|
const mediaType = contentType?.split(';')[0]?.trim();
|
|
44
44
|
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
45
45
|
if (isJSON) {
|
|
46
|
+
const contentLength = response.headers.get('content-length');
|
|
47
|
+
if (contentLength === '0') {
|
|
48
|
+
// if there is no content we can't do anything
|
|
49
|
+
return undefined as T;
|
|
50
|
+
}
|
|
51
|
+
|
|
46
52
|
const json = await response.json();
|
|
47
53
|
return json as T;
|
|
48
54
|
}
|
package/src/resources/index.ts
CHANGED
|
@@ -31,13 +31,9 @@ export {
|
|
|
31
31
|
} from './skills';
|
|
32
32
|
export {
|
|
33
33
|
Tokens,
|
|
34
|
-
type
|
|
35
|
-
type Allow,
|
|
36
|
-
type ConnectionScope,
|
|
34
|
+
type Constraint,
|
|
37
35
|
type CreateTokenRequest,
|
|
38
36
|
type CreateTokenResponse,
|
|
39
|
-
type McpScope,
|
|
40
|
-
type ResourceScope,
|
|
41
37
|
type TokenCreateParams,
|
|
42
38
|
} from './tokens';
|
|
43
39
|
export { Uplink, type UplinkCreateTokenResponse } from './uplink';
|