@orq-ai/node 3.11.2 → 3.11.3
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/bin/mcp-server.js +103 -103
- package/bin/mcp-server.js.map +26 -26
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +2 -2
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +16 -16
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +2 -2
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +2 -2
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +2 -2
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +16 -16
- package/package.json +1 -1
- package/packages/orq-rc/README.md +99 -86
- package/packages/orq-rc/docs/sdks/budgets/README.md +401 -0
- package/packages/orq-rc/examples/package-lock.json +1 -1
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/budgetsCreate.ts +160 -0
- package/packages/orq-rc/src/funcs/budgetsDelete.ts +167 -0
- package/packages/orq-rc/src/funcs/budgetsGet.ts +166 -0
- package/packages/orq-rc/src/funcs/budgetsList.ts +170 -0
- package/packages/orq-rc/src/funcs/budgetsUpdate.ts +167 -0
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +11 -1
- package/packages/orq-rc/src/mcp-server/tools/budgetsCreate.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/budgetsDelete.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/budgetsGet.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/budgetsList.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/budgetsUpdate.ts +37 -0
- package/packages/orq-rc/src/models/operations/createbudget.ts +534 -0
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/deletebudget.ts +66 -0
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/getbudget.ts +437 -0
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/index.ts +5 -0
- package/packages/orq-rc/src/models/operations/listbudgets.ts +617 -0
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatebudget.ts +628 -0
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
- package/packages/orq-rc/src/sdk/budgets.ts +99 -0
- package/packages/orq-rc/src/sdk/sdk.ts +6 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +2 -2
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +2 -2
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +2 -2
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +16 -16
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type DeleteBudgetRequest = {
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const DeleteBudgetRequest$inboundSchema: z.ZodType<
|
|
16
|
+
DeleteBudgetRequest,
|
|
17
|
+
z.ZodTypeDef,
|
|
18
|
+
unknown
|
|
19
|
+
> = z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type DeleteBudgetRequest$Outbound = {
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const DeleteBudgetRequest$outboundSchema: z.ZodType<
|
|
30
|
+
DeleteBudgetRequest$Outbound,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
DeleteBudgetRequest
|
|
33
|
+
> = z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
40
|
+
*/
|
|
41
|
+
export namespace DeleteBudgetRequest$ {
|
|
42
|
+
/** @deprecated use `DeleteBudgetRequest$inboundSchema` instead. */
|
|
43
|
+
export const inboundSchema = DeleteBudgetRequest$inboundSchema;
|
|
44
|
+
/** @deprecated use `DeleteBudgetRequest$outboundSchema` instead. */
|
|
45
|
+
export const outboundSchema = DeleteBudgetRequest$outboundSchema;
|
|
46
|
+
/** @deprecated use `DeleteBudgetRequest$Outbound` instead. */
|
|
47
|
+
export type Outbound = DeleteBudgetRequest$Outbound;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function deleteBudgetRequestToJSON(
|
|
51
|
+
deleteBudgetRequest: DeleteBudgetRequest,
|
|
52
|
+
): string {
|
|
53
|
+
return JSON.stringify(
|
|
54
|
+
DeleteBudgetRequest$outboundSchema.parse(deleteBudgetRequest),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function deleteBudgetRequestFromJSON(
|
|
59
|
+
jsonString: string,
|
|
60
|
+
): SafeParseResult<DeleteBudgetRequest, SDKValidationError> {
|
|
61
|
+
return safeParse(
|
|
62
|
+
jsonString,
|
|
63
|
+
(x) => DeleteBudgetRequest$inboundSchema.parse(JSON.parse(x)),
|
|
64
|
+
`Failed to parse 'DeleteBudgetRequest' from JSON`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -146,7 +146,7 @@ export const FileGetResponseBody$inboundSchema: z.ZodType<
|
|
|
146
146
|
file_name: z.string(),
|
|
147
147
|
workspace_id: z.string(),
|
|
148
148
|
created: z.string().datetime({ offset: true }).default(
|
|
149
|
-
"2025-08-
|
|
149
|
+
"2025-08-20T07:46:00.613Z",
|
|
150
150
|
).transform(v => new Date(v)),
|
|
151
151
|
}).transform((v) => {
|
|
152
152
|
return remap$(v, {
|
|
@@ -180,7 +180,7 @@ export const FileGetResponseBody$outboundSchema: z.ZodType<
|
|
|
180
180
|
bytes: z.number(),
|
|
181
181
|
fileName: z.string(),
|
|
182
182
|
workspaceId: z.string(),
|
|
183
|
-
created: z.date().default(() => new Date("2025-08-
|
|
183
|
+
created: z.date().default(() => new Date("2025-08-20T07:46:00.613Z"))
|
|
184
184
|
.transform(v => v.toISOString()),
|
|
185
185
|
}).transform((v) => {
|
|
186
186
|
return remap$(v, {
|
|
@@ -196,7 +196,7 @@ export const FileListData$inboundSchema: z.ZodType<
|
|
|
196
196
|
file_name: z.string(),
|
|
197
197
|
workspace_id: z.string(),
|
|
198
198
|
created: z.string().datetime({ offset: true }).default(
|
|
199
|
-
"2025-08-
|
|
199
|
+
"2025-08-20T07:46:00.613Z",
|
|
200
200
|
).transform(v => new Date(v)),
|
|
201
201
|
}).transform((v) => {
|
|
202
202
|
return remap$(v, {
|
|
@@ -230,7 +230,7 @@ export const FileListData$outboundSchema: z.ZodType<
|
|
|
230
230
|
bytes: z.number(),
|
|
231
231
|
fileName: z.string(),
|
|
232
232
|
workspaceId: z.string(),
|
|
233
|
-
created: z.date().default(() => new Date("2025-08-
|
|
233
|
+
created: z.date().default(() => new Date("2025-08-20T07:46:00.613Z"))
|
|
234
234
|
.transform(v => v.toISOString()),
|
|
235
235
|
}).transform((v) => {
|
|
236
236
|
return remap$(v, {
|
|
@@ -250,7 +250,7 @@ export const FileUploadResponseBody$inboundSchema: z.ZodType<
|
|
|
250
250
|
file_name: z.string(),
|
|
251
251
|
workspace_id: z.string(),
|
|
252
252
|
created: z.string().datetime({ offset: true }).default(
|
|
253
|
-
"2025-08-
|
|
253
|
+
"2025-08-20T07:46:00.613Z",
|
|
254
254
|
).transform(v => new Date(v)),
|
|
255
255
|
}).transform((v) => {
|
|
256
256
|
return remap$(v, {
|
|
@@ -284,7 +284,7 @@ export const FileUploadResponseBody$outboundSchema: z.ZodType<
|
|
|
284
284
|
bytes: z.number(),
|
|
285
285
|
fileName: z.string(),
|
|
286
286
|
workspaceId: z.string(),
|
|
287
|
-
created: z.date().default(() => new Date("2025-08-
|
|
287
|
+
created: z.date().default(() => new Date("2025-08-20T07:46:00.613Z"))
|
|
288
288
|
.transform(v => v.toISOString()),
|
|
289
289
|
}).transform((v) => {
|
|
290
290
|
return remap$(v, {
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type GetBudgetRequest = {
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Budget entity type
|
|
18
|
+
*/
|
|
19
|
+
export const GetBudgetType = {
|
|
20
|
+
ApiKey: "api_key",
|
|
21
|
+
Contact: "contact",
|
|
22
|
+
Workspace: "workspace",
|
|
23
|
+
} as const;
|
|
24
|
+
/**
|
|
25
|
+
* Budget entity type
|
|
26
|
+
*/
|
|
27
|
+
export type GetBudgetType = ClosedEnum<typeof GetBudgetType>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Budget period type
|
|
31
|
+
*/
|
|
32
|
+
export const GetBudgetPeriod = {
|
|
33
|
+
Daily: "daily",
|
|
34
|
+
Weekly: "weekly",
|
|
35
|
+
Monthly: "monthly",
|
|
36
|
+
Yearly: "yearly",
|
|
37
|
+
} as const;
|
|
38
|
+
/**
|
|
39
|
+
* Budget period type
|
|
40
|
+
*/
|
|
41
|
+
export type GetBudgetPeriod = ClosedEnum<typeof GetBudgetPeriod>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Budget configuration
|
|
45
|
+
*/
|
|
46
|
+
export type GetBudgetBudget = {
|
|
47
|
+
/**
|
|
48
|
+
* Budget period type
|
|
49
|
+
*/
|
|
50
|
+
period: GetBudgetPeriod;
|
|
51
|
+
/**
|
|
52
|
+
* Budget amount in USD for the specified period
|
|
53
|
+
*/
|
|
54
|
+
amount: number;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type GetBudgetConsumption = {
|
|
58
|
+
/**
|
|
59
|
+
* Current period consumption in USD
|
|
60
|
+
*/
|
|
61
|
+
currentAmount: number;
|
|
62
|
+
/**
|
|
63
|
+
* Remaining budget (amount - current_amount)
|
|
64
|
+
*/
|
|
65
|
+
remainingAmount: number;
|
|
66
|
+
/**
|
|
67
|
+
* When the current period started
|
|
68
|
+
*/
|
|
69
|
+
periodStart: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* When the current period will reset
|
|
72
|
+
*/
|
|
73
|
+
periodEnd: string | null;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Budget configuration details
|
|
78
|
+
*/
|
|
79
|
+
export type GetBudgetResponseBody = {
|
|
80
|
+
/**
|
|
81
|
+
* Unique ULID for the budget configuration
|
|
82
|
+
*/
|
|
83
|
+
id: string;
|
|
84
|
+
/**
|
|
85
|
+
* Budget entity type
|
|
86
|
+
*/
|
|
87
|
+
type: GetBudgetType;
|
|
88
|
+
/**
|
|
89
|
+
* Contact external identifier (present when type is "contact")
|
|
90
|
+
*/
|
|
91
|
+
contactId?: string | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* API Key identifier (present when type is "api_key")
|
|
94
|
+
*/
|
|
95
|
+
apiKeyId?: string | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Budget configuration
|
|
98
|
+
*/
|
|
99
|
+
budget: GetBudgetBudget;
|
|
100
|
+
/**
|
|
101
|
+
* Whether this budget configuration is currently active
|
|
102
|
+
*/
|
|
103
|
+
isActive: boolean;
|
|
104
|
+
consumption?: GetBudgetConsumption | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* The date and time the resource was created
|
|
107
|
+
*/
|
|
108
|
+
created?: Date | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* The date and time the resource was last updated
|
|
111
|
+
*/
|
|
112
|
+
updated?: Date | undefined;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** @internal */
|
|
116
|
+
export const GetBudgetRequest$inboundSchema: z.ZodType<
|
|
117
|
+
GetBudgetRequest,
|
|
118
|
+
z.ZodTypeDef,
|
|
119
|
+
unknown
|
|
120
|
+
> = z.object({
|
|
121
|
+
id: z.string(),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
/** @internal */
|
|
125
|
+
export type GetBudgetRequest$Outbound = {
|
|
126
|
+
id: string;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** @internal */
|
|
130
|
+
export const GetBudgetRequest$outboundSchema: z.ZodType<
|
|
131
|
+
GetBudgetRequest$Outbound,
|
|
132
|
+
z.ZodTypeDef,
|
|
133
|
+
GetBudgetRequest
|
|
134
|
+
> = z.object({
|
|
135
|
+
id: z.string(),
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @internal
|
|
140
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
141
|
+
*/
|
|
142
|
+
export namespace GetBudgetRequest$ {
|
|
143
|
+
/** @deprecated use `GetBudgetRequest$inboundSchema` instead. */
|
|
144
|
+
export const inboundSchema = GetBudgetRequest$inboundSchema;
|
|
145
|
+
/** @deprecated use `GetBudgetRequest$outboundSchema` instead. */
|
|
146
|
+
export const outboundSchema = GetBudgetRequest$outboundSchema;
|
|
147
|
+
/** @deprecated use `GetBudgetRequest$Outbound` instead. */
|
|
148
|
+
export type Outbound = GetBudgetRequest$Outbound;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function getBudgetRequestToJSON(
|
|
152
|
+
getBudgetRequest: GetBudgetRequest,
|
|
153
|
+
): string {
|
|
154
|
+
return JSON.stringify(
|
|
155
|
+
GetBudgetRequest$outboundSchema.parse(getBudgetRequest),
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function getBudgetRequestFromJSON(
|
|
160
|
+
jsonString: string,
|
|
161
|
+
): SafeParseResult<GetBudgetRequest, SDKValidationError> {
|
|
162
|
+
return safeParse(
|
|
163
|
+
jsonString,
|
|
164
|
+
(x) => GetBudgetRequest$inboundSchema.parse(JSON.parse(x)),
|
|
165
|
+
`Failed to parse 'GetBudgetRequest' from JSON`,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** @internal */
|
|
170
|
+
export const GetBudgetType$inboundSchema: z.ZodNativeEnum<
|
|
171
|
+
typeof GetBudgetType
|
|
172
|
+
> = z.nativeEnum(GetBudgetType);
|
|
173
|
+
|
|
174
|
+
/** @internal */
|
|
175
|
+
export const GetBudgetType$outboundSchema: z.ZodNativeEnum<
|
|
176
|
+
typeof GetBudgetType
|
|
177
|
+
> = GetBudgetType$inboundSchema;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @internal
|
|
181
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
182
|
+
*/
|
|
183
|
+
export namespace GetBudgetType$ {
|
|
184
|
+
/** @deprecated use `GetBudgetType$inboundSchema` instead. */
|
|
185
|
+
export const inboundSchema = GetBudgetType$inboundSchema;
|
|
186
|
+
/** @deprecated use `GetBudgetType$outboundSchema` instead. */
|
|
187
|
+
export const outboundSchema = GetBudgetType$outboundSchema;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** @internal */
|
|
191
|
+
export const GetBudgetPeriod$inboundSchema: z.ZodNativeEnum<
|
|
192
|
+
typeof GetBudgetPeriod
|
|
193
|
+
> = z.nativeEnum(GetBudgetPeriod);
|
|
194
|
+
|
|
195
|
+
/** @internal */
|
|
196
|
+
export const GetBudgetPeriod$outboundSchema: z.ZodNativeEnum<
|
|
197
|
+
typeof GetBudgetPeriod
|
|
198
|
+
> = GetBudgetPeriod$inboundSchema;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @internal
|
|
202
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
203
|
+
*/
|
|
204
|
+
export namespace GetBudgetPeriod$ {
|
|
205
|
+
/** @deprecated use `GetBudgetPeriod$inboundSchema` instead. */
|
|
206
|
+
export const inboundSchema = GetBudgetPeriod$inboundSchema;
|
|
207
|
+
/** @deprecated use `GetBudgetPeriod$outboundSchema` instead. */
|
|
208
|
+
export const outboundSchema = GetBudgetPeriod$outboundSchema;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** @internal */
|
|
212
|
+
export const GetBudgetBudget$inboundSchema: z.ZodType<
|
|
213
|
+
GetBudgetBudget,
|
|
214
|
+
z.ZodTypeDef,
|
|
215
|
+
unknown
|
|
216
|
+
> = z.object({
|
|
217
|
+
period: GetBudgetPeriod$inboundSchema,
|
|
218
|
+
amount: z.number(),
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
/** @internal */
|
|
222
|
+
export type GetBudgetBudget$Outbound = {
|
|
223
|
+
period: string;
|
|
224
|
+
amount: number;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/** @internal */
|
|
228
|
+
export const GetBudgetBudget$outboundSchema: z.ZodType<
|
|
229
|
+
GetBudgetBudget$Outbound,
|
|
230
|
+
z.ZodTypeDef,
|
|
231
|
+
GetBudgetBudget
|
|
232
|
+
> = z.object({
|
|
233
|
+
period: GetBudgetPeriod$outboundSchema,
|
|
234
|
+
amount: z.number(),
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @internal
|
|
239
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
240
|
+
*/
|
|
241
|
+
export namespace GetBudgetBudget$ {
|
|
242
|
+
/** @deprecated use `GetBudgetBudget$inboundSchema` instead. */
|
|
243
|
+
export const inboundSchema = GetBudgetBudget$inboundSchema;
|
|
244
|
+
/** @deprecated use `GetBudgetBudget$outboundSchema` instead. */
|
|
245
|
+
export const outboundSchema = GetBudgetBudget$outboundSchema;
|
|
246
|
+
/** @deprecated use `GetBudgetBudget$Outbound` instead. */
|
|
247
|
+
export type Outbound = GetBudgetBudget$Outbound;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export function getBudgetBudgetToJSON(
|
|
251
|
+
getBudgetBudget: GetBudgetBudget,
|
|
252
|
+
): string {
|
|
253
|
+
return JSON.stringify(GetBudgetBudget$outboundSchema.parse(getBudgetBudget));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function getBudgetBudgetFromJSON(
|
|
257
|
+
jsonString: string,
|
|
258
|
+
): SafeParseResult<GetBudgetBudget, SDKValidationError> {
|
|
259
|
+
return safeParse(
|
|
260
|
+
jsonString,
|
|
261
|
+
(x) => GetBudgetBudget$inboundSchema.parse(JSON.parse(x)),
|
|
262
|
+
`Failed to parse 'GetBudgetBudget' from JSON`,
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/** @internal */
|
|
267
|
+
export const GetBudgetConsumption$inboundSchema: z.ZodType<
|
|
268
|
+
GetBudgetConsumption,
|
|
269
|
+
z.ZodTypeDef,
|
|
270
|
+
unknown
|
|
271
|
+
> = z.object({
|
|
272
|
+
current_amount: z.number(),
|
|
273
|
+
remaining_amount: z.number(),
|
|
274
|
+
period_start: z.nullable(z.string()),
|
|
275
|
+
period_end: z.nullable(z.string()),
|
|
276
|
+
}).transform((v) => {
|
|
277
|
+
return remap$(v, {
|
|
278
|
+
"current_amount": "currentAmount",
|
|
279
|
+
"remaining_amount": "remainingAmount",
|
|
280
|
+
"period_start": "periodStart",
|
|
281
|
+
"period_end": "periodEnd",
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
/** @internal */
|
|
286
|
+
export type GetBudgetConsumption$Outbound = {
|
|
287
|
+
current_amount: number;
|
|
288
|
+
remaining_amount: number;
|
|
289
|
+
period_start: string | null;
|
|
290
|
+
period_end: string | null;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
/** @internal */
|
|
294
|
+
export const GetBudgetConsumption$outboundSchema: z.ZodType<
|
|
295
|
+
GetBudgetConsumption$Outbound,
|
|
296
|
+
z.ZodTypeDef,
|
|
297
|
+
GetBudgetConsumption
|
|
298
|
+
> = z.object({
|
|
299
|
+
currentAmount: z.number(),
|
|
300
|
+
remainingAmount: z.number(),
|
|
301
|
+
periodStart: z.nullable(z.string()),
|
|
302
|
+
periodEnd: z.nullable(z.string()),
|
|
303
|
+
}).transform((v) => {
|
|
304
|
+
return remap$(v, {
|
|
305
|
+
currentAmount: "current_amount",
|
|
306
|
+
remainingAmount: "remaining_amount",
|
|
307
|
+
periodStart: "period_start",
|
|
308
|
+
periodEnd: "period_end",
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @internal
|
|
314
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
315
|
+
*/
|
|
316
|
+
export namespace GetBudgetConsumption$ {
|
|
317
|
+
/** @deprecated use `GetBudgetConsumption$inboundSchema` instead. */
|
|
318
|
+
export const inboundSchema = GetBudgetConsumption$inboundSchema;
|
|
319
|
+
/** @deprecated use `GetBudgetConsumption$outboundSchema` instead. */
|
|
320
|
+
export const outboundSchema = GetBudgetConsumption$outboundSchema;
|
|
321
|
+
/** @deprecated use `GetBudgetConsumption$Outbound` instead. */
|
|
322
|
+
export type Outbound = GetBudgetConsumption$Outbound;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export function getBudgetConsumptionToJSON(
|
|
326
|
+
getBudgetConsumption: GetBudgetConsumption,
|
|
327
|
+
): string {
|
|
328
|
+
return JSON.stringify(
|
|
329
|
+
GetBudgetConsumption$outboundSchema.parse(getBudgetConsumption),
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export function getBudgetConsumptionFromJSON(
|
|
334
|
+
jsonString: string,
|
|
335
|
+
): SafeParseResult<GetBudgetConsumption, SDKValidationError> {
|
|
336
|
+
return safeParse(
|
|
337
|
+
jsonString,
|
|
338
|
+
(x) => GetBudgetConsumption$inboundSchema.parse(JSON.parse(x)),
|
|
339
|
+
`Failed to parse 'GetBudgetConsumption' from JSON`,
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** @internal */
|
|
344
|
+
export const GetBudgetResponseBody$inboundSchema: z.ZodType<
|
|
345
|
+
GetBudgetResponseBody,
|
|
346
|
+
z.ZodTypeDef,
|
|
347
|
+
unknown
|
|
348
|
+
> = z.object({
|
|
349
|
+
_id: z.string(),
|
|
350
|
+
type: GetBudgetType$inboundSchema,
|
|
351
|
+
contact_id: z.string().optional(),
|
|
352
|
+
api_key_id: z.string().optional(),
|
|
353
|
+
budget: z.lazy(() => GetBudgetBudget$inboundSchema),
|
|
354
|
+
is_active: z.boolean(),
|
|
355
|
+
consumption: z.lazy(() => GetBudgetConsumption$inboundSchema).optional(),
|
|
356
|
+
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
357
|
+
.optional(),
|
|
358
|
+
updated: z.string().datetime({ offset: true }).default(
|
|
359
|
+
"2025-08-20T07:45:57.493Z",
|
|
360
|
+
).transform(v => new Date(v)),
|
|
361
|
+
}).transform((v) => {
|
|
362
|
+
return remap$(v, {
|
|
363
|
+
"_id": "id",
|
|
364
|
+
"contact_id": "contactId",
|
|
365
|
+
"api_key_id": "apiKeyId",
|
|
366
|
+
"is_active": "isActive",
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
/** @internal */
|
|
371
|
+
export type GetBudgetResponseBody$Outbound = {
|
|
372
|
+
_id: string;
|
|
373
|
+
type: string;
|
|
374
|
+
contact_id?: string | undefined;
|
|
375
|
+
api_key_id?: string | undefined;
|
|
376
|
+
budget: GetBudgetBudget$Outbound;
|
|
377
|
+
is_active: boolean;
|
|
378
|
+
consumption?: GetBudgetConsumption$Outbound | undefined;
|
|
379
|
+
created?: string | undefined;
|
|
380
|
+
updated: string;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
/** @internal */
|
|
384
|
+
export const GetBudgetResponseBody$outboundSchema: z.ZodType<
|
|
385
|
+
GetBudgetResponseBody$Outbound,
|
|
386
|
+
z.ZodTypeDef,
|
|
387
|
+
GetBudgetResponseBody
|
|
388
|
+
> = z.object({
|
|
389
|
+
id: z.string(),
|
|
390
|
+
type: GetBudgetType$outboundSchema,
|
|
391
|
+
contactId: z.string().optional(),
|
|
392
|
+
apiKeyId: z.string().optional(),
|
|
393
|
+
budget: z.lazy(() => GetBudgetBudget$outboundSchema),
|
|
394
|
+
isActive: z.boolean(),
|
|
395
|
+
consumption: z.lazy(() => GetBudgetConsumption$outboundSchema).optional(),
|
|
396
|
+
created: z.date().transform(v => v.toISOString()).optional(),
|
|
397
|
+
updated: z.date().default(() => new Date("2025-08-20T07:45:57.493Z"))
|
|
398
|
+
.transform(v => v.toISOString()),
|
|
399
|
+
}).transform((v) => {
|
|
400
|
+
return remap$(v, {
|
|
401
|
+
id: "_id",
|
|
402
|
+
contactId: "contact_id",
|
|
403
|
+
apiKeyId: "api_key_id",
|
|
404
|
+
isActive: "is_active",
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* @internal
|
|
410
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
411
|
+
*/
|
|
412
|
+
export namespace GetBudgetResponseBody$ {
|
|
413
|
+
/** @deprecated use `GetBudgetResponseBody$inboundSchema` instead. */
|
|
414
|
+
export const inboundSchema = GetBudgetResponseBody$inboundSchema;
|
|
415
|
+
/** @deprecated use `GetBudgetResponseBody$outboundSchema` instead. */
|
|
416
|
+
export const outboundSchema = GetBudgetResponseBody$outboundSchema;
|
|
417
|
+
/** @deprecated use `GetBudgetResponseBody$Outbound` instead. */
|
|
418
|
+
export type Outbound = GetBudgetResponseBody$Outbound;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export function getBudgetResponseBodyToJSON(
|
|
422
|
+
getBudgetResponseBody: GetBudgetResponseBody,
|
|
423
|
+
): string {
|
|
424
|
+
return JSON.stringify(
|
|
425
|
+
GetBudgetResponseBody$outboundSchema.parse(getBudgetResponseBody),
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export function getBudgetResponseBodyFromJSON(
|
|
430
|
+
jsonString: string,
|
|
431
|
+
): SafeParseResult<GetBudgetResponseBody, SDKValidationError> {
|
|
432
|
+
return safeParse(
|
|
433
|
+
jsonString,
|
|
434
|
+
(x) => GetBudgetResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
435
|
+
`Failed to parse 'GetBudgetResponseBody' from JSON`,
|
|
436
|
+
);
|
|
437
|
+
}
|