scorecard-ai 1.2.0 → 2.0.0-alpha.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/package.json +1 -1
  7. package/resources/index.d.mts +1 -1
  8. package/resources/index.d.mts.map +1 -1
  9. package/resources/index.d.ts +1 -1
  10. package/resources/index.d.ts.map +1 -1
  11. package/resources/records.d.mts +7 -18
  12. package/resources/records.d.mts.map +1 -1
  13. package/resources/records.d.ts +7 -18
  14. package/resources/records.d.ts.map +1 -1
  15. package/resources/records.js.map +1 -1
  16. package/resources/records.mjs.map +1 -1
  17. package/resources/scores.d.mts +2 -6
  18. package/resources/scores.d.mts.map +1 -1
  19. package/resources/scores.d.ts +2 -6
  20. package/resources/scores.d.ts.map +1 -1
  21. package/resources/shared.d.mts +1 -3
  22. package/resources/shared.d.mts.map +1 -1
  23. package/resources/shared.d.ts +1 -3
  24. package/resources/shared.d.ts.map +1 -1
  25. package/resources/systems/index.d.mts +2 -2
  26. package/resources/systems/index.d.mts.map +1 -1
  27. package/resources/systems/index.d.ts +2 -2
  28. package/resources/systems/index.d.ts.map +1 -1
  29. package/resources/systems/index.js.map +1 -1
  30. package/resources/systems/index.mjs +1 -1
  31. package/resources/systems/index.mjs.map +1 -1
  32. package/resources/systems/systems.d.mts +63 -143
  33. package/resources/systems/systems.d.mts.map +1 -1
  34. package/resources/systems/systems.d.ts +63 -143
  35. package/resources/systems/systems.d.ts.map +1 -1
  36. package/resources/systems/systems.js +21 -74
  37. package/resources/systems/systems.js.map +1 -1
  38. package/resources/systems/systems.mjs +22 -75
  39. package/resources/systems/systems.mjs.map +1 -1
  40. package/resources/systems/versions.d.mts +25 -80
  41. package/resources/systems/versions.d.mts.map +1 -1
  42. package/resources/systems/versions.d.ts +25 -80
  43. package/resources/systems/versions.d.ts.map +1 -1
  44. package/resources/systems/versions.js +20 -54
  45. package/resources/systems/versions.js.map +1 -1
  46. package/resources/systems/versions.mjs +20 -54
  47. package/resources/systems/versions.mjs.map +1 -1
  48. package/resources/testcases.d.mts +5 -15
  49. package/resources/testcases.d.mts.map +1 -1
  50. package/resources/testcases.d.ts +5 -15
  51. package/resources/testcases.d.ts.map +1 -1
  52. package/resources/testsets.d.mts +3 -9
  53. package/resources/testsets.d.mts.map +1 -1
  54. package/resources/testsets.d.ts +3 -9
  55. package/resources/testsets.d.ts.map +1 -1
  56. package/src/client.ts +2 -2
  57. package/src/resources/index.ts +1 -1
  58. package/src/resources/records.ts +7 -6
  59. package/src/resources/scores.ts +2 -2
  60. package/src/resources/shared.ts +1 -1
  61. package/src/resources/systems/index.ts +2 -8
  62. package/src/resources/systems/systems.ts +68 -141
  63. package/src/resources/systems/versions.ts +27 -97
  64. package/src/resources/testcases.ts +5 -5
  65. package/src/resources/testsets.ts +3 -3
  66. package/src/version.ts +1 -1
  67. package/version.d.mts +1 -1
  68. package/version.d.mts.map +1 -1
  69. package/version.d.ts +1 -1
  70. package/version.d.ts.map +1 -1
  71. package/version.js +1 -1
  72. package/version.js.map +1 -1
  73. package/version.mjs +1 -1
  74. package/version.mjs.map +1 -1
@@ -1,90 +1,23 @@
1
1
  import { APIResource } from "../../core/resource.mjs";
2
2
  import * as VersionsAPI from "./versions.mjs";
3
- import { SystemVersion, SystemVersionsPaginatedResponse, VersionCreateParams, VersionListParams, Versions } from "./versions.mjs";
3
+ import { SystemVersion, VersionUpsertParams, Versions } from "./versions.mjs";
4
4
  import { APIPromise } from "../../core/api-promise.mjs";
5
5
  import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.mjs";
6
6
  import { RequestOptions } from "../../internal/request-options.mjs";
7
7
  export declare class Systems extends APIResource {
8
8
  versions: VersionsAPI.Versions;
9
9
  /**
10
- * Create a new system definition that specifies the interface contracts for a
11
- * component you want to evaluate.
12
- *
13
- * A system acts as a template that defines three key contracts through JSON
14
- * Schemas:
15
- *
16
- * 1. Input Schema: What data your system accepts (e.g., user queries, context
17
- * documents)
18
- * 2. Output Schema: What data your system produces (e.g., responses, confidence
19
- * scores)
20
- * 3. Config Schema: What parameters can be adjusted (e.g., model selection,
21
- * temperature)
22
- *
23
- * This separation lets you evaluate any system as a black box, focusing on its
24
- * interface rather than implementation details.
25
- *
26
- * @example
27
- * ```ts
28
- * const system = await client.systems.create('314', {
29
- * configSchema: {
30
- * type: 'object',
31
- * properties: {
32
- * temperature: { type: 'number' },
33
- * maxTokens: { type: 'integer' },
34
- * model: { type: 'string', enum: ['gpt-4', 'gpt-4-turbo'] },
35
- * },
36
- * required: ['model'],
37
- * },
38
- * description: 'Production chatbot powered by GPT-4',
39
- * inputSchema: {
40
- * type: 'object',
41
- * properties: {
42
- * messages: {
43
- * type: 'array',
44
- * items: {
45
- * type: 'object',
46
- * properties: {
47
- * role: { type: 'string', enum: ['system', 'user', 'assistant'] },
48
- * content: { type: 'string' },
49
- * },
50
- * required: ['role', 'content'],
51
- * },
52
- * },
53
- * },
54
- * required: ['messages'],
55
- * },
56
- * name: 'GPT-4 Chatbot',
57
- * outputSchema: {
58
- * type: 'object',
59
- * properties: { response: { type: 'string' } },
60
- * required: ['response'],
61
- * },
62
- * });
63
- * ```
64
- */
65
- create(projectID: string, body: SystemCreateParams, options?: RequestOptions): APIPromise<System>;
66
- /**
67
- * Update an existing system definition. Only the fields provided in the request
68
- * body will be updated. If a field is provided, the new content will replace the
69
- * existing content. If a field is not provided, the existing content will remain
70
- * unchanged.
71
- *
72
- * When updating schemas:
73
- *
74
- * - The system will accept your changes regardless of compatibility with existing
75
- * configurations
76
- * - Schema updates won't invalidate existing evaluations or configurations
77
- * - For significant redesigns, creating a new system definition provides a cleaner
78
- * separation
10
+ * Update an existing system. Only the fields provided in the request body will be
11
+ * updated. If a field is provided, the new content will replace the existing
12
+ * content. If a field is not provided, the existing content will remain unchanged.
79
13
  *
80
14
  * @example
81
15
  * ```ts
82
16
  * const system = await client.systems.update(
83
17
  * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
84
18
  * {
85
- * description:
86
- * 'Updated production chatbot powered by GPT-4 Turbo',
87
- * name: 'GPT-4 Turbo Chatbot',
19
+ * productionVersionId:
20
+ * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf3',
88
21
  * },
89
22
  * );
90
23
  * ```
@@ -125,21 +58,24 @@ export declare class Systems extends APIResource {
125
58
  * ```
126
59
  */
127
60
  get(systemID: string, options?: RequestOptions): APIPromise<System>;
61
+ /**
62
+ * Create a new system. If one with the same name in the project exists, it updates
63
+ * it instead.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const system = await client.systems.upsert('314', {
68
+ * config: { temperature: 0.1, maxTokens: 1024 },
69
+ * description: 'Production chatbot powered by GPT-4',
70
+ * name: 'GPT-4 Chatbot',
71
+ * });
72
+ * ```
73
+ */
74
+ upsert(projectID: string, body: SystemUpsertParams, options?: RequestOptions): APIPromise<System>;
128
75
  }
129
76
  export type SystemsPaginatedResponse = PaginatedResponse<System>;
130
77
  /**
131
- * A System Under Test (SUT) defines the interface to a component or service you
132
- * want to evaluate.
133
- *
134
- * It specifies three contracts through schemas:
135
- *
136
- * - inputSchema: The structure of data the system accepts.
137
- * - outputSchema: The structure of data the system produces.
138
- * - configSchema: The parameters that modify system behavior.
139
- *
140
- * This abstraction lets you evaluate any system as a black box, focusing on its
141
- * interface rather than implementation details. It's particularly useful for
142
- * systems with variable outputs or complex internal state.
78
+ * A System Under Test (SUT).
143
79
  *
144
80
  * Systems are templates - to run evaluations, pair them with a SystemVersion that
145
81
  * provides specific parameter values.
@@ -149,32 +85,43 @@ export interface System {
149
85
  * The ID of the system.
150
86
  */
151
87
  id: string;
152
- /**
153
- * The schema of the system's configuration.
154
- */
155
- configSchema: {
156
- [key: string]: unknown;
157
- };
158
88
  /**
159
89
  * The description of the system.
160
90
  */
161
91
  description: string;
162
92
  /**
163
- * The schema of the system's inputs.
93
+ * The name of the system. Unique within the project.
164
94
  */
165
- inputSchema: {
166
- [key: string]: unknown;
167
- };
95
+ name: string;
168
96
  /**
169
- * The name of the system.
97
+ * The production version of the system.
170
98
  */
171
- name: string;
99
+ productionVersion: VersionsAPI.SystemVersion;
172
100
  /**
173
- * The schema of the system's outputs.
101
+ * The versions of the system.
174
102
  */
175
- outputSchema: {
176
- [key: string]: unknown;
177
- };
103
+ versions: Array<System.Version>;
104
+ }
105
+ export declare namespace System {
106
+ /**
107
+ * A SystemVersion defines the specific settings for a System Under Test.
108
+ *
109
+ * System versions contain parameter values that determine system behavior during
110
+ * evaluation. They are immutable snapshots - once created, they never change.
111
+ *
112
+ * When running evaluations, you reference a specific systemVersionId to establish
113
+ * which system version to test.
114
+ */
115
+ interface Version {
116
+ /**
117
+ * The ID of the system version.
118
+ */
119
+ id: string;
120
+ /**
121
+ * The name of the system version.
122
+ */
123
+ name: string;
124
+ }
178
125
  }
179
126
  export interface SystemDeleteResponse {
180
127
  /**
@@ -182,66 +129,39 @@ export interface SystemDeleteResponse {
182
129
  */
183
130
  success: boolean;
184
131
  }
185
- export interface SystemCreateParams {
186
- /**
187
- * The schema of the system's configuration.
188
- */
189
- configSchema: {
190
- [key: string]: unknown;
191
- };
132
+ export interface SystemUpdateParams {
192
133
  /**
193
134
  * The description of the system.
194
135
  */
195
- description: string;
196
- /**
197
- * The schema of the system's inputs.
198
- */
199
- inputSchema: {
200
- [key: string]: unknown;
201
- };
136
+ description?: string;
202
137
  /**
203
- * The name of the system.
138
+ * The name of the system. Unique within the project.
204
139
  */
205
- name: string;
140
+ name?: string;
206
141
  /**
207
- * The schema of the system's outputs.
142
+ * The ID of the production version of the system.
208
143
  */
209
- outputSchema: {
210
- [key: string]: unknown;
211
- };
144
+ productionVersionId?: string;
212
145
  }
213
- export interface SystemUpdateParams {
146
+ export interface SystemListParams extends PaginatedResponseParams {
147
+ }
148
+ export interface SystemUpsertParams {
214
149
  /**
215
- * The schema of the system's configuration.
150
+ * The configuration of the system.
216
151
  */
217
- configSchema?: {
218
- [key: string]: unknown;
219
- };
152
+ config: Record<string, unknown>;
220
153
  /**
221
154
  * The description of the system.
222
155
  */
223
156
  description?: string;
224
157
  /**
225
- * The schema of the system's inputs.
226
- */
227
- inputSchema?: {
228
- [key: string]: unknown;
229
- };
230
- /**
231
- * The name of the system.
158
+ * The name of the system. Should be unique within the project. Default is "Default
159
+ * system"
232
160
  */
233
161
  name?: string;
234
- /**
235
- * The schema of the system's outputs.
236
- */
237
- outputSchema?: {
238
- [key: string]: unknown;
239
- };
240
- }
241
- export interface SystemListParams extends PaginatedResponseParams {
242
162
  }
243
163
  export declare namespace Systems {
244
- export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type SystemCreateParams as SystemCreateParams, type SystemUpdateParams as SystemUpdateParams, type SystemListParams as SystemListParams, };
245
- export { Versions as Versions, type SystemVersion as SystemVersion, type SystemVersionsPaginatedResponse as SystemVersionsPaginatedResponse, type VersionCreateParams as VersionCreateParams, type VersionListParams as VersionListParams, };
164
+ export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type SystemUpdateParams as SystemUpdateParams, type SystemListParams as SystemListParams, type SystemUpsertParams as SystemUpsertParams, };
165
+ export { Versions as Versions, type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams, };
246
166
  }
247
167
  //# sourceMappingURL=systems.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"systems.d.mts","sourceRoot":"","sources":["../../src/resources/systems/systems.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EACL,aAAa,EACb,+BAA+B,EAC/B,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACT;OACM,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAA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AAM,CAAC;IAErB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAID,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -1,90 +1,23 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
2
  import * as VersionsAPI from "./versions.js";
3
- import { SystemVersion, SystemVersionsPaginatedResponse, VersionCreateParams, VersionListParams, Versions } from "./versions.js";
3
+ import { SystemVersion, VersionUpsertParams, Versions } from "./versions.js";
4
4
  import { APIPromise } from "../../core/api-promise.js";
5
5
  import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.js";
6
6
  import { RequestOptions } from "../../internal/request-options.js";
7
7
  export declare class Systems extends APIResource {
8
8
  versions: VersionsAPI.Versions;
9
9
  /**
10
- * Create a new system definition that specifies the interface contracts for a
11
- * component you want to evaluate.
12
- *
13
- * A system acts as a template that defines three key contracts through JSON
14
- * Schemas:
15
- *
16
- * 1. Input Schema: What data your system accepts (e.g., user queries, context
17
- * documents)
18
- * 2. Output Schema: What data your system produces (e.g., responses, confidence
19
- * scores)
20
- * 3. Config Schema: What parameters can be adjusted (e.g., model selection,
21
- * temperature)
22
- *
23
- * This separation lets you evaluate any system as a black box, focusing on its
24
- * interface rather than implementation details.
25
- *
26
- * @example
27
- * ```ts
28
- * const system = await client.systems.create('314', {
29
- * configSchema: {
30
- * type: 'object',
31
- * properties: {
32
- * temperature: { type: 'number' },
33
- * maxTokens: { type: 'integer' },
34
- * model: { type: 'string', enum: ['gpt-4', 'gpt-4-turbo'] },
35
- * },
36
- * required: ['model'],
37
- * },
38
- * description: 'Production chatbot powered by GPT-4',
39
- * inputSchema: {
40
- * type: 'object',
41
- * properties: {
42
- * messages: {
43
- * type: 'array',
44
- * items: {
45
- * type: 'object',
46
- * properties: {
47
- * role: { type: 'string', enum: ['system', 'user', 'assistant'] },
48
- * content: { type: 'string' },
49
- * },
50
- * required: ['role', 'content'],
51
- * },
52
- * },
53
- * },
54
- * required: ['messages'],
55
- * },
56
- * name: 'GPT-4 Chatbot',
57
- * outputSchema: {
58
- * type: 'object',
59
- * properties: { response: { type: 'string' } },
60
- * required: ['response'],
61
- * },
62
- * });
63
- * ```
64
- */
65
- create(projectID: string, body: SystemCreateParams, options?: RequestOptions): APIPromise<System>;
66
- /**
67
- * Update an existing system definition. Only the fields provided in the request
68
- * body will be updated. If a field is provided, the new content will replace the
69
- * existing content. If a field is not provided, the existing content will remain
70
- * unchanged.
71
- *
72
- * When updating schemas:
73
- *
74
- * - The system will accept your changes regardless of compatibility with existing
75
- * configurations
76
- * - Schema updates won't invalidate existing evaluations or configurations
77
- * - For significant redesigns, creating a new system definition provides a cleaner
78
- * separation
10
+ * Update an existing system. Only the fields provided in the request body will be
11
+ * updated. If a field is provided, the new content will replace the existing
12
+ * content. If a field is not provided, the existing content will remain unchanged.
79
13
  *
80
14
  * @example
81
15
  * ```ts
82
16
  * const system = await client.systems.update(
83
17
  * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
84
18
  * {
85
- * description:
86
- * 'Updated production chatbot powered by GPT-4 Turbo',
87
- * name: 'GPT-4 Turbo Chatbot',
19
+ * productionVersionId:
20
+ * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf3',
88
21
  * },
89
22
  * );
90
23
  * ```
@@ -125,21 +58,24 @@ export declare class Systems extends APIResource {
125
58
  * ```
126
59
  */
127
60
  get(systemID: string, options?: RequestOptions): APIPromise<System>;
61
+ /**
62
+ * Create a new system. If one with the same name in the project exists, it updates
63
+ * it instead.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const system = await client.systems.upsert('314', {
68
+ * config: { temperature: 0.1, maxTokens: 1024 },
69
+ * description: 'Production chatbot powered by GPT-4',
70
+ * name: 'GPT-4 Chatbot',
71
+ * });
72
+ * ```
73
+ */
74
+ upsert(projectID: string, body: SystemUpsertParams, options?: RequestOptions): APIPromise<System>;
128
75
  }
129
76
  export type SystemsPaginatedResponse = PaginatedResponse<System>;
130
77
  /**
131
- * A System Under Test (SUT) defines the interface to a component or service you
132
- * want to evaluate.
133
- *
134
- * It specifies three contracts through schemas:
135
- *
136
- * - inputSchema: The structure of data the system accepts.
137
- * - outputSchema: The structure of data the system produces.
138
- * - configSchema: The parameters that modify system behavior.
139
- *
140
- * This abstraction lets you evaluate any system as a black box, focusing on its
141
- * interface rather than implementation details. It's particularly useful for
142
- * systems with variable outputs or complex internal state.
78
+ * A System Under Test (SUT).
143
79
  *
144
80
  * Systems are templates - to run evaluations, pair them with a SystemVersion that
145
81
  * provides specific parameter values.
@@ -149,32 +85,43 @@ export interface System {
149
85
  * The ID of the system.
150
86
  */
151
87
  id: string;
152
- /**
153
- * The schema of the system's configuration.
154
- */
155
- configSchema: {
156
- [key: string]: unknown;
157
- };
158
88
  /**
159
89
  * The description of the system.
160
90
  */
161
91
  description: string;
162
92
  /**
163
- * The schema of the system's inputs.
93
+ * The name of the system. Unique within the project.
164
94
  */
165
- inputSchema: {
166
- [key: string]: unknown;
167
- };
95
+ name: string;
168
96
  /**
169
- * The name of the system.
97
+ * The production version of the system.
170
98
  */
171
- name: string;
99
+ productionVersion: VersionsAPI.SystemVersion;
172
100
  /**
173
- * The schema of the system's outputs.
101
+ * The versions of the system.
174
102
  */
175
- outputSchema: {
176
- [key: string]: unknown;
177
- };
103
+ versions: Array<System.Version>;
104
+ }
105
+ export declare namespace System {
106
+ /**
107
+ * A SystemVersion defines the specific settings for a System Under Test.
108
+ *
109
+ * System versions contain parameter values that determine system behavior during
110
+ * evaluation. They are immutable snapshots - once created, they never change.
111
+ *
112
+ * When running evaluations, you reference a specific systemVersionId to establish
113
+ * which system version to test.
114
+ */
115
+ interface Version {
116
+ /**
117
+ * The ID of the system version.
118
+ */
119
+ id: string;
120
+ /**
121
+ * The name of the system version.
122
+ */
123
+ name: string;
124
+ }
178
125
  }
179
126
  export interface SystemDeleteResponse {
180
127
  /**
@@ -182,66 +129,39 @@ export interface SystemDeleteResponse {
182
129
  */
183
130
  success: boolean;
184
131
  }
185
- export interface SystemCreateParams {
186
- /**
187
- * The schema of the system's configuration.
188
- */
189
- configSchema: {
190
- [key: string]: unknown;
191
- };
132
+ export interface SystemUpdateParams {
192
133
  /**
193
134
  * The description of the system.
194
135
  */
195
- description: string;
196
- /**
197
- * The schema of the system's inputs.
198
- */
199
- inputSchema: {
200
- [key: string]: unknown;
201
- };
136
+ description?: string;
202
137
  /**
203
- * The name of the system.
138
+ * The name of the system. Unique within the project.
204
139
  */
205
- name: string;
140
+ name?: string;
206
141
  /**
207
- * The schema of the system's outputs.
142
+ * The ID of the production version of the system.
208
143
  */
209
- outputSchema: {
210
- [key: string]: unknown;
211
- };
144
+ productionVersionId?: string;
212
145
  }
213
- export interface SystemUpdateParams {
146
+ export interface SystemListParams extends PaginatedResponseParams {
147
+ }
148
+ export interface SystemUpsertParams {
214
149
  /**
215
- * The schema of the system's configuration.
150
+ * The configuration of the system.
216
151
  */
217
- configSchema?: {
218
- [key: string]: unknown;
219
- };
152
+ config: Record<string, unknown>;
220
153
  /**
221
154
  * The description of the system.
222
155
  */
223
156
  description?: string;
224
157
  /**
225
- * The schema of the system's inputs.
226
- */
227
- inputSchema?: {
228
- [key: string]: unknown;
229
- };
230
- /**
231
- * The name of the system.
158
+ * The name of the system. Should be unique within the project. Default is "Default
159
+ * system"
232
160
  */
233
161
  name?: string;
234
- /**
235
- * The schema of the system's outputs.
236
- */
237
- outputSchema?: {
238
- [key: string]: unknown;
239
- };
240
- }
241
- export interface SystemListParams extends PaginatedResponseParams {
242
162
  }
243
163
  export declare namespace Systems {
244
- export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type SystemCreateParams as SystemCreateParams, type SystemUpdateParams as SystemUpdateParams, type SystemListParams as SystemListParams, };
245
- export { Versions as Versions, type SystemVersion as SystemVersion, type SystemVersionsPaginatedResponse as SystemVersionsPaginatedResponse, type VersionCreateParams as VersionCreateParams, type VersionListParams as VersionListParams, };
164
+ export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type SystemUpdateParams as SystemUpdateParams, type SystemListParams as SystemListParams, type SystemUpsertParams as SystemUpsertParams, };
165
+ export { Versions as Versions, type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams, };
246
166
  }
247
167
  //# sourceMappingURL=systems.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../../src/resources/systems/systems.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EACL,aAAa,EACb,+BAA+B,EAC/B,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACT;OACM,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE;OAChE,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIjG;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CACJ,Q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