@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.
@@ -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. Requires API key
10
- * authentication.
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(body: TokenCreateParams, options?: RequestOptions): APIPromise<CreateTokenResponse> {
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
- * Scope for managing MCP connections.
22
+ * Metadata filter facts. Each object is an OR condition; keys within are AND-ed.
38
23
  */
39
- connections?: ConnectionScope;
24
+ metadata?: { [key: string]: string } | Array<{ [key: string]: string }>;
40
25
 
41
26
  /**
42
- * Scope for deployment operations.
27
+ * Restrict token to specific namespaces.
43
28
  */
44
- deployments?: ResourceScope;
29
+ namespaces?: string | Array<string>;
45
30
 
46
31
  /**
47
- * Scope for MCP protocol operations on connections.
32
+ * Restrict token to specific operations.
48
33
  */
49
- mcp?: McpScope;
34
+ operations?: 'read' | 'write' | 'execute' | Array<'read' | 'write' | 'execute'>;
50
35
 
51
36
  /**
52
- * Scope for namespace management.
37
+ * Restrict token to specific resource types.
53
38
  */
54
- namespaces?: ResourceScope;
39
+ resources?:
40
+ | 'connections'
41
+ | 'servers'
42
+ | 'namespaces'
43
+ | 'skills'
44
+ | Array<'connections' | 'servers' | 'namespaces' | 'skills'>;
55
45
 
56
46
  /**
57
- * Scope for server metadata and configuration.
47
+ * TTL as seconds or duration string ("1h", "30m", "20s").
58
48
  */
59
- servers?: ResourceScope;
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
- * Per-resource permission grants. Format: { [resource]: { actions: [...],
91
- * namespaces: [...], metadata?: {...} } }
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
- allow: Allow;
58
+ policy?: Array<Constraint>;
94
59
 
95
60
  /**
96
- * Token TTL in seconds. Required. Max 86400 (24 hours).
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 (PASETO v4).
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
- * Per-resource permission grants. Format: { [resource]: { actions: [...],
157
- * namespaces: [...], metadata?: {...} } }
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
- ttlSeconds: number;
84
+ policy?: Array<Constraint>;
165
85
 
166
86
  /**
167
- * Profile to scope the token to. If not provided, uses the default 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 Action as Action,
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.33.0'; // x-release-please-version
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.33.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.33.0";
1
+ export declare const VERSION = "0.34.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.33.0'; // x-release-please-version
4
+ exports.VERSION = '0.34.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.33.0'; // x-release-please-version
1
+ export const VERSION = '0.34.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map