@openrouter/sdk 1.5.23 → 1.5.25
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/esm/funcs/alphaExtractionsCreate.d.ts +19 -0
- package/esm/funcs/alphaExtractionsCreate.js +105 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/classifierfiltersfilter.d.ts +10 -0
- package/esm/models/classifierfiltersfilter.js +16 -0
- package/esm/models/classifierscalarfilter.d.ts +35 -0
- package/esm/models/classifierscalarfilter.js +21 -0
- package/esm/models/classifierscalarfilteroperator.d.ts +16 -0
- package/esm/models/classifierscalarfilteroperator.js +15 -0
- package/esm/models/classifiersetfilter.d.ts +32 -0
- package/esm/models/classifiersetfilter.js +21 -0
- package/esm/models/classifiersetfilteroperator.d.ts +16 -0
- package/esm/models/classifiersetfilteroperator.js +15 -0
- package/esm/models/decisionsresponse.d.ts +3 -3
- package/esm/models/decisionsresponse.js +3 -3
- package/esm/models/extractiondateanswer.d.ts +46 -0
- package/esm/models/extractiondateanswer.js +37 -0
- package/esm/models/extractiondatefield.d.ts +22 -0
- package/esm/models/extractiondatefield.js +20 -0
- package/esm/models/extractiondatetimeanswer.d.ts +46 -0
- package/esm/models/extractiondatetimeanswer.js +37 -0
- package/esm/models/extractiondatetimefield.d.ts +22 -0
- package/esm/models/extractiondatetimefield.js +20 -0
- package/esm/models/extractiondurationanswer.d.ts +50 -0
- package/esm/models/extractiondurationanswer.js +38 -0
- package/esm/models/extractiondurationfield.d.ts +34 -0
- package/esm/models/extractiondurationfield.js +23 -0
- package/esm/models/extractionestimateanswer.d.ts +89 -0
- package/esm/models/extractionestimateanswer.js +80 -0
- package/esm/models/extractionestimatefield.d.ts +70 -0
- package/esm/models/extractionestimatefield.js +65 -0
- package/esm/models/extractionforecastanswer.d.ts +72 -0
- package/esm/models/extractionforecastanswer.js +72 -0
- package/esm/models/extractionforecastfield.d.ts +90 -0
- package/esm/models/extractionforecastfield.js +80 -0
- package/esm/models/extractionforecaststep.d.ts +50 -0
- package/esm/models/extractionforecaststep.js +57 -0
- package/esm/models/extractionlistanswer.d.ts +51 -0
- package/esm/models/extractionlistanswer.js +47 -0
- package/esm/models/extractionlistfield.d.ts +38 -0
- package/esm/models/extractionlistfield.js +31 -0
- package/esm/models/extractionnumberanswer.d.ts +46 -0
- package/esm/models/extractionnumberanswer.js +37 -0
- package/esm/models/extractionnumberfield.d.ts +31 -0
- package/esm/models/extractionnumberfield.js +23 -0
- package/esm/models/extractionsrequest.d.ts +75 -0
- package/esm/models/extractionsrequest.js +65 -0
- package/esm/models/extractionsresponse.d.ts +42 -0
- package/esm/models/extractionsresponse.js +61 -0
- package/esm/models/extractionsusage.d.ts +19 -0
- package/esm/models/extractionsusage.js +29 -0
- package/esm/models/extractiontextanswer.d.ts +46 -0
- package/esm/models/extractiontextanswer.js +37 -0
- package/esm/models/extractiontextfield.d.ts +22 -0
- package/esm/models/extractiontextfield.js +20 -0
- package/esm/models/extractiontimeanswer.d.ts +46 -0
- package/esm/models/extractiontimeanswer.js +37 -0
- package/esm/models/extractiontimefield.d.ts +22 -0
- package/esm/models/extractiontimefield.js +20 -0
- package/esm/models/filter.d.ts +10 -0
- package/esm/models/filter.js +14 -0
- package/esm/models/generationresponse.d.ts +1 -0
- package/esm/models/generationresponse.js +1 -0
- package/esm/models/imagegenerationrequest.d.ts +2 -2
- package/esm/models/index.d.ts +33 -0
- package/esm/models/index.js +33 -0
- package/esm/models/observabilityfilterrulegroup.d.ts +5 -5
- package/esm/models/observabilityfilterrulegroup.js +5 -7
- package/esm/models/operations/createapialphaextractions.d.ts +57 -0
- package/esm/models/operations/createapialphaextractions.js +26 -0
- package/esm/models/operations/deleteinternvaultsecret.d.ts +1 -1
- package/esm/models/operations/deletevaultsecret.d.ts +1 -1
- package/esm/models/operations/getanalyticsmeta.d.ts +6 -50
- package/esm/models/operations/getanalyticsmeta.js +6 -41
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/queryanalytics.d.ts +5 -85
- package/esm/models/operations/queryanalytics.js +3 -60
- package/esm/models/operator.d.ts +50 -0
- package/esm/models/operator.js +46 -0
- package/esm/models/scalarfilter.d.ts +35 -0
- package/esm/models/scalarfilter.js +21 -0
- package/esm/models/scalarfilteroperator.d.ts +20 -0
- package/esm/models/scalarfilteroperator.js +19 -0
- package/esm/models/setfilter.d.ts +37 -0
- package/esm/models/setfilter.js +27 -0
- package/esm/models/setfilteroperator.d.ts +16 -0
- package/esm/models/setfilteroperator.js +15 -0
- package/esm/models/vaultsecretwriterequest.d.ts +1 -1
- package/esm/sdk/alpha.d.ts +3 -0
- package/esm/sdk/alpha.js +4 -0
- package/esm/sdk/extractions.d.ts +13 -0
- package/esm/sdk/extractions.js +19 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
|
+
import * as models from "../index.js";
|
|
5
6
|
export type QueryAnalyticsGlobals = {
|
|
6
7
|
/**
|
|
7
8
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -37,25 +38,6 @@ export type ClassifierDimensions = {
|
|
|
37
38
|
*/
|
|
38
39
|
includeNulls?: boolean | undefined;
|
|
39
40
|
};
|
|
40
|
-
export type ValueClassifierFilters = string | number;
|
|
41
|
-
/**
|
|
42
|
-
* Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.
|
|
43
|
-
*/
|
|
44
|
-
export type ClassifierFiltersValue = string | number | Array<string | number>;
|
|
45
|
-
export type ClassifierFiltersFilter = {
|
|
46
|
-
/**
|
|
47
|
-
* Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type").
|
|
48
|
-
*/
|
|
49
|
-
field: string;
|
|
50
|
-
/**
|
|
51
|
-
* Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings.
|
|
52
|
-
*/
|
|
53
|
-
operator: string;
|
|
54
|
-
/**
|
|
55
|
-
* Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.
|
|
56
|
-
*/
|
|
57
|
-
value: string | number | Array<string | number>;
|
|
58
|
-
};
|
|
59
41
|
/**
|
|
60
42
|
* Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.
|
|
61
43
|
*/
|
|
@@ -64,30 +46,7 @@ export type ClassifierFilters = {
|
|
|
64
46
|
* UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.
|
|
65
47
|
*/
|
|
66
48
|
classifierId: string;
|
|
67
|
-
filters: Array<ClassifierFiltersFilter>;
|
|
68
|
-
};
|
|
69
|
-
export type Value2 = string | number;
|
|
70
|
-
/**
|
|
71
|
-
* Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
|
|
72
|
-
*/
|
|
73
|
-
export type Value1 = string | number | Array<string | number>;
|
|
74
|
-
export type Filter = {
|
|
75
|
-
/**
|
|
76
|
-
* Dimension to filter on. Use the /meta endpoint for available dimensions.
|
|
77
|
-
*/
|
|
78
|
-
field: string;
|
|
79
|
-
/**
|
|
80
|
-
* Include rows where the dimension has no value. Applies only to the `in` and `not_in` operators and dimensions that have an unset bucket.
|
|
81
|
-
*/
|
|
82
|
-
includeUnset?: boolean | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Filter operator
|
|
85
|
-
*/
|
|
86
|
-
operator: string;
|
|
87
|
-
/**
|
|
88
|
-
* Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
|
|
89
|
-
*/
|
|
90
|
-
value: string | number | Array<string | number>;
|
|
49
|
+
filters: Array<models.ClassifierFiltersFilter>;
|
|
91
50
|
};
|
|
92
51
|
export declare const Direction: {
|
|
93
52
|
readonly Asc: "asc";
|
|
@@ -121,7 +80,7 @@ export type QueryAnalyticsRequestBody = {
|
|
|
121
80
|
*/
|
|
122
81
|
classifierFilters?: ClassifierFilters | undefined;
|
|
123
82
|
dimensions?: Array<string> | undefined;
|
|
124
|
-
filters?: Array<Filter> | undefined;
|
|
83
|
+
filters?: Array<models.Filter> | undefined;
|
|
125
84
|
/**
|
|
126
85
|
* Time granularity
|
|
127
86
|
*/
|
|
@@ -194,53 +153,14 @@ export type ClassifierDimensions$Outbound = {
|
|
|
194
153
|
export declare const ClassifierDimensions$outboundSchema: z.ZodType<ClassifierDimensions$Outbound, ClassifierDimensions>;
|
|
195
154
|
export declare function classifierDimensionsToJSON(classifierDimensions: ClassifierDimensions): string;
|
|
196
155
|
/** @internal */
|
|
197
|
-
export type ValueClassifierFilters$Outbound = string | number;
|
|
198
|
-
/** @internal */
|
|
199
|
-
export declare const ValueClassifierFilters$outboundSchema: z.ZodType<ValueClassifierFilters$Outbound, ValueClassifierFilters>;
|
|
200
|
-
export declare function valueClassifierFiltersToJSON(valueClassifierFilters: ValueClassifierFilters): string;
|
|
201
|
-
/** @internal */
|
|
202
|
-
export type ClassifierFiltersValue$Outbound = string | number | Array<string | number>;
|
|
203
|
-
/** @internal */
|
|
204
|
-
export declare const ClassifierFiltersValue$outboundSchema: z.ZodType<ClassifierFiltersValue$Outbound, ClassifierFiltersValue>;
|
|
205
|
-
export declare function classifierFiltersValueToJSON(classifierFiltersValue: ClassifierFiltersValue): string;
|
|
206
|
-
/** @internal */
|
|
207
|
-
export type ClassifierFiltersFilter$Outbound = {
|
|
208
|
-
field: string;
|
|
209
|
-
operator: string;
|
|
210
|
-
value: string | number | Array<string | number>;
|
|
211
|
-
};
|
|
212
|
-
/** @internal */
|
|
213
|
-
export declare const ClassifierFiltersFilter$outboundSchema: z.ZodType<ClassifierFiltersFilter$Outbound, ClassifierFiltersFilter>;
|
|
214
|
-
export declare function classifierFiltersFilterToJSON(classifierFiltersFilter: ClassifierFiltersFilter): string;
|
|
215
|
-
/** @internal */
|
|
216
156
|
export type ClassifierFilters$Outbound = {
|
|
217
157
|
classifier_id: string;
|
|
218
|
-
filters: Array<ClassifierFiltersFilter$Outbound>;
|
|
158
|
+
filters: Array<models.ClassifierFiltersFilter$Outbound>;
|
|
219
159
|
};
|
|
220
160
|
/** @internal */
|
|
221
161
|
export declare const ClassifierFilters$outboundSchema: z.ZodType<ClassifierFilters$Outbound, ClassifierFilters>;
|
|
222
162
|
export declare function classifierFiltersToJSON(classifierFilters: ClassifierFilters): string;
|
|
223
163
|
/** @internal */
|
|
224
|
-
export type Value2$Outbound = string | number;
|
|
225
|
-
/** @internal */
|
|
226
|
-
export declare const Value2$outboundSchema: z.ZodType<Value2$Outbound, Value2>;
|
|
227
|
-
export declare function value2ToJSON(value2: Value2): string;
|
|
228
|
-
/** @internal */
|
|
229
|
-
export type Value1$Outbound = string | number | Array<string | number>;
|
|
230
|
-
/** @internal */
|
|
231
|
-
export declare const Value1$outboundSchema: z.ZodType<Value1$Outbound, Value1>;
|
|
232
|
-
export declare function value1ToJSON(value1: Value1): string;
|
|
233
|
-
/** @internal */
|
|
234
|
-
export type Filter$Outbound = {
|
|
235
|
-
field: string;
|
|
236
|
-
include_unset?: boolean | undefined;
|
|
237
|
-
operator: string;
|
|
238
|
-
value: string | number | Array<string | number>;
|
|
239
|
-
};
|
|
240
|
-
/** @internal */
|
|
241
|
-
export declare const Filter$outboundSchema: z.ZodType<Filter$Outbound, Filter>;
|
|
242
|
-
export declare function filterToJSON(filter: Filter): string;
|
|
243
|
-
/** @internal */
|
|
244
164
|
export declare const Direction$outboundSchema: z.ZodType<string, Direction>;
|
|
245
165
|
/** @internal */
|
|
246
166
|
export type OrderBy$Outbound = {
|
|
@@ -263,7 +183,7 @@ export type QueryAnalyticsRequestBody$Outbound = {
|
|
|
263
183
|
classifier_dimensions?: ClassifierDimensions$Outbound | undefined;
|
|
264
184
|
classifier_filters?: ClassifierFilters$Outbound | undefined;
|
|
265
185
|
dimensions?: Array<string> | undefined;
|
|
266
|
-
filters?: Array<Filter$Outbound> | undefined;
|
|
186
|
+
filters?: Array<models.Filter$Outbound> | undefined;
|
|
267
187
|
granularity?: string | undefined;
|
|
268
188
|
group_limit?: number | undefined;
|
|
269
189
|
limit?: number | undefined;
|
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../../types/enums.js";
|
|
9
|
+
import { ClassifierFiltersFilter$outboundSchema as models_ClassifierFiltersFilter$outboundSchema } from "../classifierfiltersfilter.js"; import { Filter$outboundSchema as models_Filter$outboundSchema } from "../filter.js";
|
|
9
10
|
export const Direction = {
|
|
10
11
|
Asc: "asc",
|
|
11
12
|
Desc: "desc",
|
|
@@ -26,36 +27,9 @@ export function classifierDimensionsToJSON(classifierDimensions) {
|
|
|
26
27
|
return JSON.stringify(ClassifierDimensions$outboundSchema.parse(classifierDimensions));
|
|
27
28
|
}
|
|
28
29
|
/** @internal */
|
|
29
|
-
export const ValueClassifierFilters$outboundSchema = z.union([z.string(), z.number()]);
|
|
30
|
-
export function valueClassifierFiltersToJSON(valueClassifierFilters) {
|
|
31
|
-
return JSON.stringify(ValueClassifierFilters$outboundSchema.parse(valueClassifierFilters));
|
|
32
|
-
}
|
|
33
|
-
/** @internal */
|
|
34
|
-
export const ClassifierFiltersValue$outboundSchema = z.union([
|
|
35
|
-
z.string(),
|
|
36
|
-
z.number(),
|
|
37
|
-
z.array(z.union([z.string(), z.number()])),
|
|
38
|
-
]);
|
|
39
|
-
export function classifierFiltersValueToJSON(classifierFiltersValue) {
|
|
40
|
-
return JSON.stringify(ClassifierFiltersValue$outboundSchema.parse(classifierFiltersValue));
|
|
41
|
-
}
|
|
42
|
-
/** @internal */
|
|
43
|
-
export const ClassifierFiltersFilter$outboundSchema = z.object({
|
|
44
|
-
field: z.string(),
|
|
45
|
-
operator: z.string(),
|
|
46
|
-
value: z.union([
|
|
47
|
-
z.string(),
|
|
48
|
-
z.number(),
|
|
49
|
-
z.array(z.union([z.string(), z.number()])),
|
|
50
|
-
]),
|
|
51
|
-
});
|
|
52
|
-
export function classifierFiltersFilterToJSON(classifierFiltersFilter) {
|
|
53
|
-
return JSON.stringify(ClassifierFiltersFilter$outboundSchema.parse(classifierFiltersFilter));
|
|
54
|
-
}
|
|
55
|
-
/** @internal */
|
|
56
30
|
export const ClassifierFilters$outboundSchema = z.object({
|
|
57
31
|
classifierId: z.string(),
|
|
58
|
-
filters: z.array(
|
|
32
|
+
filters: z.array(models_ClassifierFiltersFilter$outboundSchema),
|
|
59
33
|
}).transform((v) => {
|
|
60
34
|
return remap$(v, {
|
|
61
35
|
classifierId: "classifier_id",
|
|
@@ -65,37 +39,6 @@ export function classifierFiltersToJSON(classifierFilters) {
|
|
|
65
39
|
return JSON.stringify(ClassifierFilters$outboundSchema.parse(classifierFilters));
|
|
66
40
|
}
|
|
67
41
|
/** @internal */
|
|
68
|
-
export const Value2$outboundSchema = z
|
|
69
|
-
.union([z.string(), z.number()]);
|
|
70
|
-
export function value2ToJSON(value2) {
|
|
71
|
-
return JSON.stringify(Value2$outboundSchema.parse(value2));
|
|
72
|
-
}
|
|
73
|
-
/** @internal */
|
|
74
|
-
export const Value1$outboundSchema = z
|
|
75
|
-
.union([z.string(), z.number(), z.array(z.union([z.string(), z.number()]))]);
|
|
76
|
-
export function value1ToJSON(value1) {
|
|
77
|
-
return JSON.stringify(Value1$outboundSchema.parse(value1));
|
|
78
|
-
}
|
|
79
|
-
/** @internal */
|
|
80
|
-
export const Filter$outboundSchema = z
|
|
81
|
-
.object({
|
|
82
|
-
field: z.string(),
|
|
83
|
-
includeUnset: z.boolean().optional(),
|
|
84
|
-
operator: z.string(),
|
|
85
|
-
value: z.union([
|
|
86
|
-
z.string(),
|
|
87
|
-
z.number(),
|
|
88
|
-
z.array(z.union([z.string(), z.number()])),
|
|
89
|
-
]),
|
|
90
|
-
}).transform((v) => {
|
|
91
|
-
return remap$(v, {
|
|
92
|
-
includeUnset: "include_unset",
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
export function filterToJSON(filter) {
|
|
96
|
-
return JSON.stringify(Filter$outboundSchema.parse(filter));
|
|
97
|
-
}
|
|
98
|
-
/** @internal */
|
|
99
42
|
export const Direction$outboundSchema = openEnums
|
|
100
43
|
.outboundSchema(Direction);
|
|
101
44
|
/** @internal */
|
|
@@ -121,7 +64,7 @@ export const QueryAnalyticsRequestBody$outboundSchema = z.object({
|
|
|
121
64
|
.optional(),
|
|
122
65
|
classifierFilters: z.lazy(() => ClassifierFilters$outboundSchema).optional(),
|
|
123
66
|
dimensions: z.array(z.string()).optional(),
|
|
124
|
-
filters: z.array(
|
|
67
|
+
filters: z.array(models_Filter$outboundSchema).optional(),
|
|
125
68
|
granularity: z.string().optional(),
|
|
126
69
|
groupLimit: z.int().optional(),
|
|
127
70
|
limit: z.int().optional(),
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
/**
|
|
6
|
+
* Operator identifier used in filter definitions
|
|
7
|
+
*/
|
|
8
|
+
export declare const OperatorName: {
|
|
9
|
+
readonly Eq: "eq";
|
|
10
|
+
readonly Neq: "neq";
|
|
11
|
+
readonly In: "in";
|
|
12
|
+
readonly NotIn: "not_in";
|
|
13
|
+
readonly Gt: "gt";
|
|
14
|
+
readonly Gte: "gte";
|
|
15
|
+
readonly Lt: "lt";
|
|
16
|
+
readonly Lte: "lte";
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Operator identifier used in filter definitions
|
|
20
|
+
*/
|
|
21
|
+
export type OperatorName = OpenEnum<typeof OperatorName>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the operator expects a single value or an array
|
|
24
|
+
*/
|
|
25
|
+
export declare const ValueType: {
|
|
26
|
+
readonly Scalar: "scalar";
|
|
27
|
+
readonly Array: "array";
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Whether the operator expects a single value or an array
|
|
31
|
+
*/
|
|
32
|
+
export type ValueType = OpenEnum<typeof ValueType>;
|
|
33
|
+
export type Operator = {
|
|
34
|
+
/**
|
|
35
|
+
* Operator identifier used in filter definitions
|
|
36
|
+
*/
|
|
37
|
+
name: OperatorName;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the operator expects a single value or an array
|
|
40
|
+
*/
|
|
41
|
+
valueType: ValueType;
|
|
42
|
+
};
|
|
43
|
+
/** @internal */
|
|
44
|
+
export declare const OperatorName$inboundSchema: z.ZodType<OperatorName, unknown>;
|
|
45
|
+
/** @internal */
|
|
46
|
+
export declare const ValueType$inboundSchema: z.ZodType<ValueType, unknown>;
|
|
47
|
+
/** @internal */
|
|
48
|
+
export declare const Operator$inboundSchema: z.ZodType<Operator, unknown>;
|
|
49
|
+
export declare function operatorFromJSON(jsonString: string): SafeParseResult<Operator, SDKValidationError>;
|
|
50
|
+
//# sourceMappingURL=operator.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2c6d6b8bb46a
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
/**
|
|
10
|
+
* Operator identifier used in filter definitions
|
|
11
|
+
*/
|
|
12
|
+
export const OperatorName = {
|
|
13
|
+
Eq: "eq",
|
|
14
|
+
Neq: "neq",
|
|
15
|
+
In: "in",
|
|
16
|
+
NotIn: "not_in",
|
|
17
|
+
Gt: "gt",
|
|
18
|
+
Gte: "gte",
|
|
19
|
+
Lt: "lt",
|
|
20
|
+
Lte: "lte",
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Whether the operator expects a single value or an array
|
|
24
|
+
*/
|
|
25
|
+
export const ValueType = {
|
|
26
|
+
Scalar: "scalar",
|
|
27
|
+
Array: "array",
|
|
28
|
+
};
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const OperatorName$inboundSchema = openEnums.inboundSchema(OperatorName);
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const ValueType$inboundSchema = openEnums
|
|
33
|
+
.inboundSchema(ValueType);
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const Operator$inboundSchema = z.object({
|
|
36
|
+
name: OperatorName$inboundSchema,
|
|
37
|
+
value_type: ValueType$inboundSchema,
|
|
38
|
+
}).transform((v) => {
|
|
39
|
+
return remap$(v, {
|
|
40
|
+
"value_type": "valueType",
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
export function operatorFromJSON(jsonString) {
|
|
44
|
+
return safeParse(jsonString, (x) => Operator$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Operator' from JSON`);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=operator.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ScalarFilterOperator } from "./scalarfilteroperator.js";
|
|
3
|
+
/**
|
|
4
|
+
* Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
|
|
5
|
+
*/
|
|
6
|
+
export type ScalarFilterValue = string | number;
|
|
7
|
+
export type ScalarFilter = {
|
|
8
|
+
/**
|
|
9
|
+
* Dimension to filter on. Use the /meta endpoint for available dimensions.
|
|
10
|
+
*/
|
|
11
|
+
field: string;
|
|
12
|
+
/**
|
|
13
|
+
* Comparison operator taking a scalar filter value.
|
|
14
|
+
*/
|
|
15
|
+
operator: ScalarFilterOperator;
|
|
16
|
+
/**
|
|
17
|
+
* Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
|
|
18
|
+
*/
|
|
19
|
+
value: string | number;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export type ScalarFilterValue$Outbound = string | number;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const ScalarFilterValue$outboundSchema: z.ZodType<ScalarFilterValue$Outbound, ScalarFilterValue>;
|
|
25
|
+
export declare function scalarFilterValueToJSON(scalarFilterValue: ScalarFilterValue): string;
|
|
26
|
+
/** @internal */
|
|
27
|
+
export type ScalarFilter$Outbound = {
|
|
28
|
+
field: string;
|
|
29
|
+
operator: string;
|
|
30
|
+
value: string | number;
|
|
31
|
+
};
|
|
32
|
+
/** @internal */
|
|
33
|
+
export declare const ScalarFilter$outboundSchema: z.ZodType<ScalarFilter$Outbound, ScalarFilter>;
|
|
34
|
+
export declare function scalarFilterToJSON(scalarFilter: ScalarFilter): string;
|
|
35
|
+
//# sourceMappingURL=scalarfilter.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: a35bae1c804d
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { ScalarFilterOperator$outboundSchema, } from "./scalarfilteroperator.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ScalarFilterValue$outboundSchema = z.union([z.string(), z.number()]);
|
|
9
|
+
export function scalarFilterValueToJSON(scalarFilterValue) {
|
|
10
|
+
return JSON.stringify(ScalarFilterValue$outboundSchema.parse(scalarFilterValue));
|
|
11
|
+
}
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const ScalarFilter$outboundSchema = z.object({
|
|
14
|
+
field: z.string(),
|
|
15
|
+
operator: ScalarFilterOperator$outboundSchema,
|
|
16
|
+
value: z.union([z.string(), z.number()]),
|
|
17
|
+
});
|
|
18
|
+
export function scalarFilterToJSON(scalarFilter) {
|
|
19
|
+
return JSON.stringify(ScalarFilter$outboundSchema.parse(scalarFilter));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=scalarfilter.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* Comparison operator taking a scalar filter value.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ScalarFilterOperator: {
|
|
7
|
+
readonly Eq: "eq";
|
|
8
|
+
readonly Neq: "neq";
|
|
9
|
+
readonly Gt: "gt";
|
|
10
|
+
readonly Gte: "gte";
|
|
11
|
+
readonly Lt: "lt";
|
|
12
|
+
readonly Lte: "lte";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Comparison operator taking a scalar filter value.
|
|
16
|
+
*/
|
|
17
|
+
export type ScalarFilterOperator = OpenEnum<typeof ScalarFilterOperator>;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const ScalarFilterOperator$outboundSchema: z.ZodType<string, ScalarFilterOperator>;
|
|
20
|
+
//# sourceMappingURL=scalarfilteroperator.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 25c4ab8aa37c
|
|
4
|
+
*/
|
|
5
|
+
import * as openEnums from "../types/enums.js";
|
|
6
|
+
/**
|
|
7
|
+
* Comparison operator taking a scalar filter value.
|
|
8
|
+
*/
|
|
9
|
+
export const ScalarFilterOperator = {
|
|
10
|
+
Eq: "eq",
|
|
11
|
+
Neq: "neq",
|
|
12
|
+
Gt: "gt",
|
|
13
|
+
Gte: "gte",
|
|
14
|
+
Lt: "lt",
|
|
15
|
+
Lte: "lte",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ScalarFilterOperator$outboundSchema = openEnums.outboundSchema(ScalarFilterOperator);
|
|
19
|
+
//# sourceMappingURL=scalarfilteroperator.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { SetFilterOperator } from "./setfilteroperator.js";
|
|
3
|
+
/**
|
|
4
|
+
* Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.
|
|
5
|
+
*/
|
|
6
|
+
export type SetFilterValue = string | number;
|
|
7
|
+
export type SetFilter = {
|
|
8
|
+
/**
|
|
9
|
+
* Dimension to filter on. Use the /meta endpoint for available dimensions.
|
|
10
|
+
*/
|
|
11
|
+
field: string;
|
|
12
|
+
/**
|
|
13
|
+
* Include rows where the dimension has no value. Applies only to dimensions that have an unset bucket.
|
|
14
|
+
*/
|
|
15
|
+
includeUnset?: boolean | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Set-membership operator taking an array filter value.
|
|
18
|
+
*/
|
|
19
|
+
operator: SetFilterOperator;
|
|
20
|
+
value: Array<string | number>;
|
|
21
|
+
};
|
|
22
|
+
/** @internal */
|
|
23
|
+
export type SetFilterValue$Outbound = string | number;
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const SetFilterValue$outboundSchema: z.ZodType<SetFilterValue$Outbound, SetFilterValue>;
|
|
26
|
+
export declare function setFilterValueToJSON(setFilterValue: SetFilterValue): string;
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type SetFilter$Outbound = {
|
|
29
|
+
field: string;
|
|
30
|
+
include_unset?: boolean | undefined;
|
|
31
|
+
operator: string;
|
|
32
|
+
value: Array<string | number>;
|
|
33
|
+
};
|
|
34
|
+
/** @internal */
|
|
35
|
+
export declare const SetFilter$outboundSchema: z.ZodType<SetFilter$Outbound, SetFilter>;
|
|
36
|
+
export declare function setFilterToJSON(setFilter: SetFilter): string;
|
|
37
|
+
//# sourceMappingURL=setfilter.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 996a872ffcc5
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { SetFilterOperator$outboundSchema, } from "./setfilteroperator.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const SetFilterValue$outboundSchema = z.union([z.string(), z.number()]);
|
|
10
|
+
export function setFilterValueToJSON(setFilterValue) {
|
|
11
|
+
return JSON.stringify(SetFilterValue$outboundSchema.parse(setFilterValue));
|
|
12
|
+
}
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const SetFilter$outboundSchema = z.object({
|
|
15
|
+
field: z.string(),
|
|
16
|
+
includeUnset: z.boolean().optional(),
|
|
17
|
+
operator: SetFilterOperator$outboundSchema,
|
|
18
|
+
value: z.array(z.union([z.string(), z.number()])),
|
|
19
|
+
}).transform((v) => {
|
|
20
|
+
return remap$(v, {
|
|
21
|
+
includeUnset: "include_unset",
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
export function setFilterToJSON(setFilter) {
|
|
25
|
+
return JSON.stringify(SetFilter$outboundSchema.parse(setFilter));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=setfilter.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* Set-membership operator taking an array filter value.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SetFilterOperator: {
|
|
7
|
+
readonly In: "in";
|
|
8
|
+
readonly NotIn: "not_in";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Set-membership operator taking an array filter value.
|
|
12
|
+
*/
|
|
13
|
+
export type SetFilterOperator = OpenEnum<typeof SetFilterOperator>;
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const SetFilterOperator$outboundSchema: z.ZodType<string, SetFilterOperator>;
|
|
16
|
+
//# sourceMappingURL=setfilteroperator.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 96f1a2679754
|
|
4
|
+
*/
|
|
5
|
+
import * as openEnums from "../types/enums.js";
|
|
6
|
+
/**
|
|
7
|
+
* Set-membership operator taking an array filter value.
|
|
8
|
+
*/
|
|
9
|
+
export const SetFilterOperator = {
|
|
10
|
+
In: "in",
|
|
11
|
+
NotIn: "not_in",
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const SetFilterOperator$outboundSchema = openEnums.outboundSchema(SetFilterOperator);
|
|
15
|
+
//# sourceMappingURL=setfilteroperator.js.map
|
|
@@ -8,7 +8,7 @@ export type VaultSecretWriteRequest = {
|
|
|
8
8
|
*/
|
|
9
9
|
hosts: Array<string>;
|
|
10
10
|
/**
|
|
11
|
-
* Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.
|
|
11
|
+
* Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned.
|
|
12
12
|
*/
|
|
13
13
|
value: string;
|
|
14
14
|
};
|
package/esm/sdk/alpha.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ClientSDK } from "../lib/sdks.js";
|
|
2
2
|
import { Decisions } from "./decisions.js";
|
|
3
|
+
import { Extractions } from "./extractions.js";
|
|
3
4
|
export declare class Alpha extends ClientSDK {
|
|
4
5
|
private _decisions?;
|
|
5
6
|
get decisions(): Decisions;
|
|
7
|
+
private _extractions?;
|
|
8
|
+
get extractions(): Extractions;
|
|
6
9
|
}
|
|
7
10
|
//# sourceMappingURL=alpha.d.ts.map
|
package/esm/sdk/alpha.js
CHANGED
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
6
|
import { Decisions } from "./decisions.js";
|
|
7
|
+
import { Extractions } from "./extractions.js";
|
|
7
8
|
export class Alpha extends ClientSDK {
|
|
8
9
|
get decisions() {
|
|
9
10
|
return (this._decisions ?? (this._decisions = new Decisions(this._options)));
|
|
10
11
|
}
|
|
12
|
+
get extractions() {
|
|
13
|
+
return (this._extractions ?? (this._extractions = new Extractions(this._options)));
|
|
14
|
+
}
|
|
11
15
|
}
|
|
12
16
|
//# sourceMappingURL=alpha.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as models from "../models/index.js";
|
|
3
|
+
import * as operations from "../models/operations/index.js";
|
|
4
|
+
export declare class Extractions extends ClientSDK {
|
|
5
|
+
/**
|
|
6
|
+
* Submit an Extractions request
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Extracts, computes, estimates or forecasts typed fields from a state string and image assets using an extraction-style System One model. Alpha: the shape is not stable.
|
|
10
|
+
*/
|
|
11
|
+
create(request: operations.CreateApiAlphaExtractionsRequest, options?: RequestOptions): Promise<models.ExtractionsResponse>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=extractions.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 86201a09fb0f
|
|
4
|
+
*/
|
|
5
|
+
import { alphaExtractionsCreate } from "../funcs/alphaExtractionsCreate.js";
|
|
6
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
7
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
+
export class Extractions extends ClientSDK {
|
|
9
|
+
/**
|
|
10
|
+
* Submit an Extractions request
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Extracts, computes, estimates or forecasts typed fields from a state string and image assets using an extraction-style System One model. Alpha: the shape is not stable.
|
|
14
|
+
*/
|
|
15
|
+
async create(request, options) {
|
|
16
|
+
return unwrapAsync(alphaExtractionsCreate(this, request, options));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=extractions.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.25",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
76
77
|
"test:e2e": "vitest --run --project e2e",
|
|
77
|
-
"typecheck": "
|
|
78
|
+
"typecheck:transit": "exit 0",
|
|
78
79
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
80
|
+
"prepare": "npm run build",
|
|
79
81
|
"test": "vitest --run --project unit",
|
|
80
82
|
"test:transit": "exit 0",
|
|
81
83
|
"test:watch": "vitest --watch --project unit",
|
|
82
|
-
"typecheck
|
|
83
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
-
"prepare": "npm run build"
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|