@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/src/resources/tokens.ts
CHANGED
|
@@ -6,106 +6,66 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
6
6
|
|
|
7
7
|
export class Tokens extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Create a service token for machine-to-machine authentication.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const createTokenResponse = await client.tokens.create({
|
|
15
|
-
* allow: {},
|
|
16
|
-
* ttlSeconds: 3600,
|
|
17
|
-
* });
|
|
18
|
-
* ```
|
|
9
|
+
* Create a service token for machine-to-machine authentication. Accepts API key or
|
|
10
|
+
* bearer token. Optionally apply restrictions.
|
|
19
11
|
*/
|
|
20
|
-
create(
|
|
12
|
+
create(
|
|
13
|
+
body: TokenCreateParams | null | undefined = {},
|
|
14
|
+
options?: RequestOptions,
|
|
15
|
+
): APIPromise<CreateTokenResponse> {
|
|
21
16
|
return this._client.post('/tokens', { body, ...options });
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
* Permission action. 'read' allows reading/listing. 'write' allows
|
|
27
|
-
* create/modify/delete.
|
|
28
|
-
*/
|
|
29
|
-
export type Action = 'read' | 'write';
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Permission grants with per-resource scoping. Each resource defines its own
|
|
33
|
-
* namespaces and constraints.
|
|
34
|
-
*/
|
|
35
|
-
export interface Allow {
|
|
20
|
+
export interface Constraint {
|
|
36
21
|
/**
|
|
37
|
-
*
|
|
22
|
+
* Metadata filter facts. Each object is an OR condition; keys within are AND-ed.
|
|
38
23
|
*/
|
|
39
|
-
|
|
24
|
+
metadata?: { [key: string]: string } | Array<{ [key: string]: string }>;
|
|
40
25
|
|
|
41
26
|
/**
|
|
42
|
-
*
|
|
27
|
+
* Restrict token to specific namespaces.
|
|
43
28
|
*/
|
|
44
|
-
|
|
29
|
+
namespaces?: string | Array<string>;
|
|
45
30
|
|
|
46
31
|
/**
|
|
47
|
-
*
|
|
32
|
+
* Restrict token to specific operations.
|
|
48
33
|
*/
|
|
49
|
-
|
|
34
|
+
operations?: 'read' | 'write' | 'execute' | Array<'read' | 'write' | 'execute'>;
|
|
50
35
|
|
|
51
36
|
/**
|
|
52
|
-
*
|
|
37
|
+
* Restrict token to specific resource types.
|
|
53
38
|
*/
|
|
54
|
-
|
|
39
|
+
resources?:
|
|
40
|
+
| 'connections'
|
|
41
|
+
| 'servers'
|
|
42
|
+
| 'namespaces'
|
|
43
|
+
| 'skills'
|
|
44
|
+
| Array<'connections' | 'servers' | 'namespaces' | 'skills'>;
|
|
55
45
|
|
|
56
46
|
/**
|
|
57
|
-
*
|
|
47
|
+
* TTL as seconds or duration string ("1h", "30m", "20s").
|
|
58
48
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Scope for token creation.
|
|
63
|
-
*/
|
|
64
|
-
tokens?: ResourceScope;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Scope for connection operations.
|
|
69
|
-
*/
|
|
70
|
-
export interface ConnectionScope {
|
|
71
|
-
/**
|
|
72
|
-
* Actions allowed on connections.
|
|
73
|
-
*/
|
|
74
|
-
actions: Array<Action>;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Namespaces this scope applies to. Use '\*' for all namespaces.
|
|
78
|
-
*/
|
|
79
|
-
namespaces: Array<string>;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Filter access to connections with matching metadata. All keys must match (AND
|
|
83
|
-
* semantics).
|
|
84
|
-
*/
|
|
85
|
-
metadata?: { [key: string]: string };
|
|
49
|
+
ttl?: string | number;
|
|
86
50
|
}
|
|
87
51
|
|
|
88
52
|
export interface CreateTokenRequest {
|
|
89
53
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
54
|
+
* Constraint objects to restrict the token. Cannot be combined with profileSlug.
|
|
55
|
+
* Each constraint may include a `ttl` field (max 24 hours). Default TTL is 1 hour.
|
|
56
|
+
* Maximum is 24 hours.
|
|
92
57
|
*/
|
|
93
|
-
|
|
58
|
+
policy?: Array<Constraint>;
|
|
94
59
|
|
|
95
60
|
/**
|
|
96
|
-
*
|
|
97
|
-
*/
|
|
98
|
-
ttlSeconds: number;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Profile to scope the token to. If not provided, uses the default profile.
|
|
61
|
+
* Profile slug for legacy token minting. Cannot be combined with policy.
|
|
102
62
|
*/
|
|
103
63
|
profileSlug?: string;
|
|
104
64
|
}
|
|
105
65
|
|
|
106
66
|
export interface CreateTokenResponse {
|
|
107
67
|
/**
|
|
108
|
-
* The signed service token
|
|
68
|
+
* The signed service token.
|
|
109
69
|
*/
|
|
110
70
|
token: string;
|
|
111
71
|
|
|
@@ -115,69 +75,25 @@ export interface CreateTokenResponse {
|
|
|
115
75
|
expiresAt: string;
|
|
116
76
|
}
|
|
117
77
|
|
|
118
|
-
/**
|
|
119
|
-
* Scope for MCP operations on connections.
|
|
120
|
-
*/
|
|
121
|
-
export interface McpScope {
|
|
122
|
-
/**
|
|
123
|
-
* Actions allowed for MCP calls.
|
|
124
|
-
*/
|
|
125
|
-
actions: Array<Action>;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Namespaces this scope applies to. Use '\*' for all namespaces.
|
|
129
|
-
*/
|
|
130
|
-
namespaces: Array<string>;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Filter access to connections with matching metadata. All keys must match (AND
|
|
134
|
-
* semantics).
|
|
135
|
-
*/
|
|
136
|
-
metadata?: { [key: string]: string };
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Scope for resource operations.
|
|
141
|
-
*/
|
|
142
|
-
export interface ResourceScope {
|
|
143
|
-
/**
|
|
144
|
-
* Actions allowed on this resource.
|
|
145
|
-
*/
|
|
146
|
-
actions: Array<Action>;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Namespaces this scope applies to. Use '\*' for all namespaces.
|
|
150
|
-
*/
|
|
151
|
-
namespaces: Array<string>;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
78
|
export interface TokenCreateParams {
|
|
155
79
|
/**
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
|
|
159
|
-
allow: Allow;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Token TTL in seconds. Required. Max 86400 (24 hours).
|
|
80
|
+
* Constraint objects to restrict the token. Cannot be combined with profileSlug.
|
|
81
|
+
* Each constraint may include a `ttl` field (max 24 hours). Default TTL is 1 hour.
|
|
82
|
+
* Maximum is 24 hours.
|
|
163
83
|
*/
|
|
164
|
-
|
|
84
|
+
policy?: Array<Constraint>;
|
|
165
85
|
|
|
166
86
|
/**
|
|
167
|
-
* Profile
|
|
87
|
+
* Profile slug for legacy token minting. Cannot be combined with policy.
|
|
168
88
|
*/
|
|
169
89
|
profileSlug?: string;
|
|
170
90
|
}
|
|
171
91
|
|
|
172
92
|
export declare namespace Tokens {
|
|
173
93
|
export {
|
|
174
|
-
type
|
|
175
|
-
type Allow as Allow,
|
|
176
|
-
type ConnectionScope as ConnectionScope,
|
|
94
|
+
type Constraint as Constraint,
|
|
177
95
|
type CreateTokenRequest as CreateTokenRequest,
|
|
178
96
|
type CreateTokenResponse as CreateTokenResponse,
|
|
179
|
-
type McpScope as McpScope,
|
|
180
|
-
type ResourceScope as ResourceScope,
|
|
181
97
|
type TokenCreateParams as TokenCreateParams,
|
|
182
98
|
};
|
|
183
99
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.34.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.34.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.34.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.34.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|