@orq-ai/node 3.1.0-rc.64 → 3.1.0

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 (145) hide show
  1. package/docs/sdks/promptsnippets/README.md +2 -48
  2. package/jsr.json +1 -1
  3. package/lib/config.d.ts +2 -2
  4. package/lib/config.js +2 -2
  5. package/lib/config.js.map +1 -1
  6. package/models/operations/createcontact.js +2 -2
  7. package/models/operations/createpromptsnippet.js +2 -2
  8. package/models/operations/fileget.js +2 -2
  9. package/models/operations/filelist.js +2 -2
  10. package/models/operations/fileupload.js +2 -2
  11. package/models/operations/findonebykeypromptsnippet.js +2 -2
  12. package/models/operations/findonepromptsnippet.js +2 -2
  13. package/models/operations/getallpromptsnippets.js +2 -2
  14. package/models/operations/updatepromptsnippet.js +2 -2
  15. package/package.json +2 -3
  16. package/packages/orq-rc/FUNCTIONS.md +106 -0
  17. package/packages/orq-rc/README.md +559 -0
  18. package/packages/orq-rc/RUNTIMES.md +48 -0
  19. package/packages/orq-rc/docs/sdks/contacts/README.md +84 -0
  20. package/packages/orq-rc/docs/sdks/deployments/README.md +316 -0
  21. package/packages/orq-rc/docs/sdks/feedback/README.md +92 -0
  22. package/packages/orq-rc/docs/sdks/files/README.md +305 -0
  23. package/packages/orq-rc/docs/sdks/metrics/README.md +86 -0
  24. package/packages/orq-rc/docs/sdks/orq/README.md +10 -0
  25. package/packages/orq-rc/docs/sdks/prompts/README.md +608 -0
  26. package/packages/orq-rc/docs/sdks/promptsnippets/README.md +534 -0
  27. package/packages/orq-rc/docs/sdks/remoteconfig/README.md +80 -0
  28. package/packages/orq-rc/jsr.json +28 -0
  29. package/packages/orq-rc/package-lock.json +1861 -0
  30. package/packages/orq-rc/package.json +31 -0
  31. package/packages/orq-rc/src/core.ts +13 -0
  32. package/packages/orq-rc/src/funcs/contactsCreate.ts +126 -0
  33. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +134 -0
  34. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +142 -0
  35. package/packages/orq-rc/src/funcs/deploymentsList.ts +141 -0
  36. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +134 -0
  37. package/packages/orq-rc/src/funcs/deploymentsStream.ts +150 -0
  38. package/packages/orq-rc/src/funcs/feedbackCreate.ts +126 -0
  39. package/packages/orq-rc/src/funcs/filesDelete.ts +130 -0
  40. package/packages/orq-rc/src/funcs/filesGet.ts +129 -0
  41. package/packages/orq-rc/src/funcs/filesList.ts +131 -0
  42. package/packages/orq-rc/src/funcs/filesUpload.ts +149 -0
  43. package/packages/orq-rc/src/funcs/promptSnippetsCreate.ts +128 -0
  44. package/packages/orq-rc/src/funcs/promptSnippetsDelete.ts +131 -0
  45. package/packages/orq-rc/src/funcs/promptSnippetsGet.ts +130 -0
  46. package/packages/orq-rc/src/funcs/promptSnippetsGetByKey.ts +132 -0
  47. package/packages/orq-rc/src/funcs/promptSnippetsList.ts +132 -0
  48. package/packages/orq-rc/src/funcs/promptSnippetsUpdate.ts +139 -0
  49. package/packages/orq-rc/src/funcs/promptsCreate.ts +126 -0
  50. package/packages/orq-rc/src/funcs/promptsDelete.ts +130 -0
  51. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +146 -0
  52. package/packages/orq-rc/src/funcs/promptsList.ts +133 -0
  53. package/packages/orq-rc/src/funcs/promptsListVersions.ts +139 -0
  54. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +132 -0
  55. package/packages/orq-rc/src/funcs/promptsUpdate.ts +138 -0
  56. package/packages/orq-rc/src/funcs/remoteconfigGetConfig.ts +127 -0
  57. package/packages/orq-rc/src/hooks/global.ts +44 -0
  58. package/packages/orq-rc/src/hooks/hooks.ts +132 -0
  59. package/packages/orq-rc/src/hooks/index.ts +6 -0
  60. package/packages/orq-rc/src/hooks/registration.ts +15 -0
  61. package/packages/orq-rc/src/hooks/types.ts +109 -0
  62. package/packages/orq-rc/src/index.ts +7 -0
  63. package/packages/orq-rc/src/lib/base64.ts +37 -0
  64. package/packages/orq-rc/src/lib/config.ts +70 -0
  65. package/packages/orq-rc/src/lib/dlv.ts +53 -0
  66. package/packages/orq-rc/src/lib/encodings.ts +483 -0
  67. package/packages/orq-rc/src/lib/env.ts +73 -0
  68. package/packages/orq-rc/src/lib/event-streams.ts +264 -0
  69. package/packages/orq-rc/src/lib/files.ts +40 -0
  70. package/packages/orq-rc/src/lib/http.ts +323 -0
  71. package/packages/orq-rc/src/lib/is-plain-object.ts +43 -0
  72. package/packages/orq-rc/src/lib/logger.ts +9 -0
  73. package/packages/orq-rc/src/lib/matchers.ts +325 -0
  74. package/packages/orq-rc/src/lib/primitives.ts +136 -0
  75. package/packages/orq-rc/src/lib/retries.ts +218 -0
  76. package/packages/orq-rc/src/lib/schemas.ts +91 -0
  77. package/packages/orq-rc/src/lib/sdks.ts +400 -0
  78. package/packages/orq-rc/src/lib/security.ts +254 -0
  79. package/packages/orq-rc/src/lib/url.ts +33 -0
  80. package/packages/orq-rc/src/models/components/deployments.ts +1666 -0
  81. package/packages/orq-rc/src/models/components/index.ts +6 -0
  82. package/packages/orq-rc/src/models/components/security.ts +71 -0
  83. package/packages/orq-rc/src/models/errors/apierror.ts +27 -0
  84. package/packages/orq-rc/src/models/errors/getpromptversion.ts +71 -0
  85. package/packages/orq-rc/src/models/errors/honoapierror.ts +82 -0
  86. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +62 -0
  87. package/packages/orq-rc/src/models/errors/index.ts +11 -0
  88. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +97 -0
  89. package/packages/orq-rc/src/models/errors/updateprompt.ts +71 -0
  90. package/packages/orq-rc/src/models/errors/updatepromptsnippet.ts +71 -0
  91. package/packages/orq-rc/src/models/operations/createcontact.ts +256 -0
  92. package/packages/orq-rc/src/models/operations/createfeedback.ts +286 -0
  93. package/packages/orq-rc/src/models/operations/createprompt.ts +3819 -0
  94. package/packages/orq-rc/src/models/operations/createpromptsnippet.ts +6239 -0
  95. package/packages/orq-rc/src/models/operations/deleteprompt.ts +69 -0
  96. package/packages/orq-rc/src/models/operations/deletepromptsnippet.ts +69 -0
  97. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +1790 -0
  98. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +3527 -0
  99. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +1144 -0
  100. package/packages/orq-rc/src/models/operations/deployments.ts +2148 -0
  101. package/packages/orq-rc/src/models/operations/deploymentstream.ts +3062 -0
  102. package/packages/orq-rc/src/models/operations/filedelete.ts +78 -0
  103. package/packages/orq-rc/src/models/operations/fileget.ts +222 -0
  104. package/packages/orq-rc/src/models/operations/filelist.ts +321 -0
  105. package/packages/orq-rc/src/models/operations/fileupload.ts +322 -0
  106. package/packages/orq-rc/src/models/operations/findonebykeypromptsnippet.ts +4483 -0
  107. package/packages/orq-rc/src/models/operations/findonepromptsnippet.ts +4343 -0
  108. package/packages/orq-rc/src/models/operations/getallprompts.ts +2116 -0
  109. package/packages/orq-rc/src/models/operations/getallpromptsnippets.ts +4472 -0
  110. package/packages/orq-rc/src/models/operations/getoneprompt.ts +1982 -0
  111. package/packages/orq-rc/src/models/operations/getpromptversion.ts +2012 -0
  112. package/packages/orq-rc/src/models/operations/index.ts +29 -0
  113. package/packages/orq-rc/src/models/operations/listpromptversions.ts +2146 -0
  114. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +190 -0
  115. package/packages/orq-rc/src/models/operations/updateprompt.ts +3917 -0
  116. package/packages/orq-rc/src/models/operations/updatepromptsnippet.ts +6544 -0
  117. package/packages/orq-rc/src/sdk/contacts.ts +27 -0
  118. package/packages/orq-rc/src/sdk/deployments.ts +89 -0
  119. package/packages/orq-rc/src/sdk/feedback.ts +27 -0
  120. package/packages/orq-rc/src/sdk/files.ts +72 -0
  121. package/packages/orq-rc/src/sdk/index.ts +5 -0
  122. package/packages/orq-rc/src/sdk/metrics.ts +27 -0
  123. package/packages/orq-rc/src/sdk/prompts.ts +126 -0
  124. package/packages/orq-rc/src/sdk/promptsnippets.ts +99 -0
  125. package/packages/orq-rc/src/sdk/remoteconfig.ts +24 -0
  126. package/packages/orq-rc/src/sdk/sdk.ts +49 -0
  127. package/packages/orq-rc/src/types/blobs.ts +31 -0
  128. package/packages/orq-rc/src/types/constdatetime.ts +15 -0
  129. package/packages/orq-rc/src/types/enums.ts +16 -0
  130. package/packages/orq-rc/src/types/fp.ts +50 -0
  131. package/packages/orq-rc/src/types/index.ts +11 -0
  132. package/packages/orq-rc/src/types/operations.ts +105 -0
  133. package/packages/orq-rc/src/types/rfcdate.ts +54 -0
  134. package/packages/orq-rc/src/types/streams.ts +21 -0
  135. package/packages/orq-rc/tsconfig.json +41 -0
  136. package/src/lib/config.ts +2 -2
  137. package/src/models/operations/createcontact.ts +2 -2
  138. package/src/models/operations/createpromptsnippet.ts +2 -2
  139. package/src/models/operations/fileget.ts +2 -2
  140. package/src/models/operations/filelist.ts +2 -2
  141. package/src/models/operations/fileupload.ts +2 -2
  142. package/src/models/operations/findonebykeypromptsnippet.ts +2 -2
  143. package/src/models/operations/findonepromptsnippet.ts +2 -2
  144. package/src/models/operations/getallpromptsnippets.ts +2 -2
  145. package/src/models/operations/updatepromptsnippet.ts +2 -2
@@ -0,0 +1,78 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type FileDeleteRequest = {
12
+ /**
13
+ * The ID of the file
14
+ */
15
+ fileId: string;
16
+ };
17
+
18
+ /** @internal */
19
+ export const FileDeleteRequest$inboundSchema: z.ZodType<
20
+ FileDeleteRequest,
21
+ z.ZodTypeDef,
22
+ unknown
23
+ > = z.object({
24
+ file_id: z.string(),
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "file_id": "fileId",
28
+ });
29
+ });
30
+
31
+ /** @internal */
32
+ export type FileDeleteRequest$Outbound = {
33
+ file_id: string;
34
+ };
35
+
36
+ /** @internal */
37
+ export const FileDeleteRequest$outboundSchema: z.ZodType<
38
+ FileDeleteRequest$Outbound,
39
+ z.ZodTypeDef,
40
+ FileDeleteRequest
41
+ > = z.object({
42
+ fileId: z.string(),
43
+ }).transform((v) => {
44
+ return remap$(v, {
45
+ fileId: "file_id",
46
+ });
47
+ });
48
+
49
+ /**
50
+ * @internal
51
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
52
+ */
53
+ export namespace FileDeleteRequest$ {
54
+ /** @deprecated use `FileDeleteRequest$inboundSchema` instead. */
55
+ export const inboundSchema = FileDeleteRequest$inboundSchema;
56
+ /** @deprecated use `FileDeleteRequest$outboundSchema` instead. */
57
+ export const outboundSchema = FileDeleteRequest$outboundSchema;
58
+ /** @deprecated use `FileDeleteRequest$Outbound` instead. */
59
+ export type Outbound = FileDeleteRequest$Outbound;
60
+ }
61
+
62
+ export function fileDeleteRequestToJSON(
63
+ fileDeleteRequest: FileDeleteRequest,
64
+ ): string {
65
+ return JSON.stringify(
66
+ FileDeleteRequest$outboundSchema.parse(fileDeleteRequest),
67
+ );
68
+ }
69
+
70
+ export function fileDeleteRequestFromJSON(
71
+ jsonString: string,
72
+ ): SafeParseResult<FileDeleteRequest, SDKValidationError> {
73
+ return safeParse(
74
+ jsonString,
75
+ (x) => FileDeleteRequest$inboundSchema.parse(JSON.parse(x)),
76
+ `Failed to parse 'FileDeleteRequest' from JSON`,
77
+ );
78
+ }
@@ -0,0 +1,222 @@
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 FileGetRequest = {
13
+ /**
14
+ * The ID of the file
15
+ */
16
+ fileId: string;
17
+ };
18
+
19
+ /**
20
+ * The intended purpose of the uploaded file.
21
+ */
22
+ export const FileGetPurpose = {
23
+ Retrieval: "retrieval",
24
+ KnowledgeDatasource: "knowledge_datasource",
25
+ } as const;
26
+ /**
27
+ * The intended purpose of the uploaded file.
28
+ */
29
+ export type FileGetPurpose = ClosedEnum<typeof FileGetPurpose>;
30
+
31
+ /**
32
+ * File details retrieved successfully
33
+ */
34
+ export type FileGetResponseBody = {
35
+ id: string;
36
+ /**
37
+ * path to the file in the storage
38
+ */
39
+ objectName: string;
40
+ /**
41
+ * The intended purpose of the uploaded file.
42
+ */
43
+ purpose: FileGetPurpose;
44
+ bytes: number;
45
+ fileName: string;
46
+ /**
47
+ * The id of the resource
48
+ */
49
+ workspaceId: string;
50
+ /**
51
+ * The date and time the resource was created
52
+ */
53
+ created?: Date | undefined;
54
+ };
55
+
56
+ /** @internal */
57
+ export const FileGetRequest$inboundSchema: z.ZodType<
58
+ FileGetRequest,
59
+ z.ZodTypeDef,
60
+ unknown
61
+ > = z.object({
62
+ file_id: z.string(),
63
+ }).transform((v) => {
64
+ return remap$(v, {
65
+ "file_id": "fileId",
66
+ });
67
+ });
68
+
69
+ /** @internal */
70
+ export type FileGetRequest$Outbound = {
71
+ file_id: string;
72
+ };
73
+
74
+ /** @internal */
75
+ export const FileGetRequest$outboundSchema: z.ZodType<
76
+ FileGetRequest$Outbound,
77
+ z.ZodTypeDef,
78
+ FileGetRequest
79
+ > = z.object({
80
+ fileId: z.string(),
81
+ }).transform((v) => {
82
+ return remap$(v, {
83
+ fileId: "file_id",
84
+ });
85
+ });
86
+
87
+ /**
88
+ * @internal
89
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
90
+ */
91
+ export namespace FileGetRequest$ {
92
+ /** @deprecated use `FileGetRequest$inboundSchema` instead. */
93
+ export const inboundSchema = FileGetRequest$inboundSchema;
94
+ /** @deprecated use `FileGetRequest$outboundSchema` instead. */
95
+ export const outboundSchema = FileGetRequest$outboundSchema;
96
+ /** @deprecated use `FileGetRequest$Outbound` instead. */
97
+ export type Outbound = FileGetRequest$Outbound;
98
+ }
99
+
100
+ export function fileGetRequestToJSON(fileGetRequest: FileGetRequest): string {
101
+ return JSON.stringify(FileGetRequest$outboundSchema.parse(fileGetRequest));
102
+ }
103
+
104
+ export function fileGetRequestFromJSON(
105
+ jsonString: string,
106
+ ): SafeParseResult<FileGetRequest, SDKValidationError> {
107
+ return safeParse(
108
+ jsonString,
109
+ (x) => FileGetRequest$inboundSchema.parse(JSON.parse(x)),
110
+ `Failed to parse 'FileGetRequest' from JSON`,
111
+ );
112
+ }
113
+
114
+ /** @internal */
115
+ export const FileGetPurpose$inboundSchema: z.ZodNativeEnum<
116
+ typeof FileGetPurpose
117
+ > = z.nativeEnum(FileGetPurpose);
118
+
119
+ /** @internal */
120
+ export const FileGetPurpose$outboundSchema: z.ZodNativeEnum<
121
+ typeof FileGetPurpose
122
+ > = FileGetPurpose$inboundSchema;
123
+
124
+ /**
125
+ * @internal
126
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
127
+ */
128
+ export namespace FileGetPurpose$ {
129
+ /** @deprecated use `FileGetPurpose$inboundSchema` instead. */
130
+ export const inboundSchema = FileGetPurpose$inboundSchema;
131
+ /** @deprecated use `FileGetPurpose$outboundSchema` instead. */
132
+ export const outboundSchema = FileGetPurpose$outboundSchema;
133
+ }
134
+
135
+ /** @internal */
136
+ export const FileGetResponseBody$inboundSchema: z.ZodType<
137
+ FileGetResponseBody,
138
+ z.ZodTypeDef,
139
+ unknown
140
+ > = z.object({
141
+ _id: z.string(),
142
+ object_name: z.string(),
143
+ purpose: FileGetPurpose$inboundSchema,
144
+ bytes: z.number(),
145
+ file_name: z.string(),
146
+ workspace_id: z.string(),
147
+ created: z.string().datetime({ offset: true }).default(
148
+ "2025-02-11T15:58:00.983Z",
149
+ ).transform(v => new Date(v)),
150
+ }).transform((v) => {
151
+ return remap$(v, {
152
+ "_id": "id",
153
+ "object_name": "objectName",
154
+ "file_name": "fileName",
155
+ "workspace_id": "workspaceId",
156
+ });
157
+ });
158
+
159
+ /** @internal */
160
+ export type FileGetResponseBody$Outbound = {
161
+ _id: string;
162
+ object_name: string;
163
+ purpose: string;
164
+ bytes: number;
165
+ file_name: string;
166
+ workspace_id: string;
167
+ created: string;
168
+ };
169
+
170
+ /** @internal */
171
+ export const FileGetResponseBody$outboundSchema: z.ZodType<
172
+ FileGetResponseBody$Outbound,
173
+ z.ZodTypeDef,
174
+ FileGetResponseBody
175
+ > = z.object({
176
+ id: z.string(),
177
+ objectName: z.string(),
178
+ purpose: FileGetPurpose$outboundSchema,
179
+ bytes: z.number(),
180
+ fileName: z.string(),
181
+ workspaceId: z.string(),
182
+ created: z.date().default(() => new Date("2025-02-11T15:58:00.983Z"))
183
+ .transform(v => v.toISOString()),
184
+ }).transform((v) => {
185
+ return remap$(v, {
186
+ id: "_id",
187
+ objectName: "object_name",
188
+ fileName: "file_name",
189
+ workspaceId: "workspace_id",
190
+ });
191
+ });
192
+
193
+ /**
194
+ * @internal
195
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
196
+ */
197
+ export namespace FileGetResponseBody$ {
198
+ /** @deprecated use `FileGetResponseBody$inboundSchema` instead. */
199
+ export const inboundSchema = FileGetResponseBody$inboundSchema;
200
+ /** @deprecated use `FileGetResponseBody$outboundSchema` instead. */
201
+ export const outboundSchema = FileGetResponseBody$outboundSchema;
202
+ /** @deprecated use `FileGetResponseBody$Outbound` instead. */
203
+ export type Outbound = FileGetResponseBody$Outbound;
204
+ }
205
+
206
+ export function fileGetResponseBodyToJSON(
207
+ fileGetResponseBody: FileGetResponseBody,
208
+ ): string {
209
+ return JSON.stringify(
210
+ FileGetResponseBody$outboundSchema.parse(fileGetResponseBody),
211
+ );
212
+ }
213
+
214
+ export function fileGetResponseBodyFromJSON(
215
+ jsonString: string,
216
+ ): SafeParseResult<FileGetResponseBody, SDKValidationError> {
217
+ return safeParse(
218
+ jsonString,
219
+ (x) => FileGetResponseBody$inboundSchema.parse(JSON.parse(x)),
220
+ `Failed to parse 'FileGetResponseBody' from JSON`,
221
+ );
222
+ }
@@ -0,0 +1,321 @@
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 FileListRequest = {
13
+ page?: number | undefined;
14
+ limit?: number | undefined;
15
+ lastId?: string | null | undefined;
16
+ firstId?: string | null | undefined;
17
+ };
18
+
19
+ export const FileListObject = {
20
+ List: "list",
21
+ } as const;
22
+ export type FileListObject = ClosedEnum<typeof FileListObject>;
23
+
24
+ /**
25
+ * The intended purpose of the uploaded file.
26
+ */
27
+ export const FileListPurpose = {
28
+ Retrieval: "retrieval",
29
+ KnowledgeDatasource: "knowledge_datasource",
30
+ } as const;
31
+ /**
32
+ * The intended purpose of the uploaded file.
33
+ */
34
+ export type FileListPurpose = ClosedEnum<typeof FileListPurpose>;
35
+
36
+ export type FileListData = {
37
+ id: string;
38
+ /**
39
+ * path to the file in the storage
40
+ */
41
+ objectName: string;
42
+ /**
43
+ * The intended purpose of the uploaded file.
44
+ */
45
+ purpose: FileListPurpose;
46
+ bytes: number;
47
+ fileName: string;
48
+ /**
49
+ * The id of the resource
50
+ */
51
+ workspaceId: string;
52
+ /**
53
+ * The date and time the resource was created
54
+ */
55
+ created?: Date | undefined;
56
+ };
57
+
58
+ /**
59
+ * Files retrieved successfully
60
+ */
61
+ export type FileListResponseBody = {
62
+ object: FileListObject;
63
+ data: Array<FileListData>;
64
+ hasMore: boolean;
65
+ };
66
+
67
+ /** @internal */
68
+ export const FileListRequest$inboundSchema: z.ZodType<
69
+ FileListRequest,
70
+ z.ZodTypeDef,
71
+ unknown
72
+ > = z.object({
73
+ page: z.number().optional(),
74
+ limit: z.number().default(50),
75
+ lastId: z.nullable(z.string()).optional(),
76
+ firstId: z.nullable(z.string()).optional(),
77
+ });
78
+
79
+ /** @internal */
80
+ export type FileListRequest$Outbound = {
81
+ page?: number | undefined;
82
+ limit: number;
83
+ lastId?: string | null | undefined;
84
+ firstId?: string | null | undefined;
85
+ };
86
+
87
+ /** @internal */
88
+ export const FileListRequest$outboundSchema: z.ZodType<
89
+ FileListRequest$Outbound,
90
+ z.ZodTypeDef,
91
+ FileListRequest
92
+ > = z.object({
93
+ page: z.number().optional(),
94
+ limit: z.number().default(50),
95
+ lastId: z.nullable(z.string()).optional(),
96
+ firstId: z.nullable(z.string()).optional(),
97
+ });
98
+
99
+ /**
100
+ * @internal
101
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
102
+ */
103
+ export namespace FileListRequest$ {
104
+ /** @deprecated use `FileListRequest$inboundSchema` instead. */
105
+ export const inboundSchema = FileListRequest$inboundSchema;
106
+ /** @deprecated use `FileListRequest$outboundSchema` instead. */
107
+ export const outboundSchema = FileListRequest$outboundSchema;
108
+ /** @deprecated use `FileListRequest$Outbound` instead. */
109
+ export type Outbound = FileListRequest$Outbound;
110
+ }
111
+
112
+ export function fileListRequestToJSON(
113
+ fileListRequest: FileListRequest,
114
+ ): string {
115
+ return JSON.stringify(FileListRequest$outboundSchema.parse(fileListRequest));
116
+ }
117
+
118
+ export function fileListRequestFromJSON(
119
+ jsonString: string,
120
+ ): SafeParseResult<FileListRequest, SDKValidationError> {
121
+ return safeParse(
122
+ jsonString,
123
+ (x) => FileListRequest$inboundSchema.parse(JSON.parse(x)),
124
+ `Failed to parse 'FileListRequest' from JSON`,
125
+ );
126
+ }
127
+
128
+ /** @internal */
129
+ export const FileListObject$inboundSchema: z.ZodNativeEnum<
130
+ typeof FileListObject
131
+ > = z.nativeEnum(FileListObject);
132
+
133
+ /** @internal */
134
+ export const FileListObject$outboundSchema: z.ZodNativeEnum<
135
+ typeof FileListObject
136
+ > = FileListObject$inboundSchema;
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 FileListObject$ {
143
+ /** @deprecated use `FileListObject$inboundSchema` instead. */
144
+ export const inboundSchema = FileListObject$inboundSchema;
145
+ /** @deprecated use `FileListObject$outboundSchema` instead. */
146
+ export const outboundSchema = FileListObject$outboundSchema;
147
+ }
148
+
149
+ /** @internal */
150
+ export const FileListPurpose$inboundSchema: z.ZodNativeEnum<
151
+ typeof FileListPurpose
152
+ > = z.nativeEnum(FileListPurpose);
153
+
154
+ /** @internal */
155
+ export const FileListPurpose$outboundSchema: z.ZodNativeEnum<
156
+ typeof FileListPurpose
157
+ > = FileListPurpose$inboundSchema;
158
+
159
+ /**
160
+ * @internal
161
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
162
+ */
163
+ export namespace FileListPurpose$ {
164
+ /** @deprecated use `FileListPurpose$inboundSchema` instead. */
165
+ export const inboundSchema = FileListPurpose$inboundSchema;
166
+ /** @deprecated use `FileListPurpose$outboundSchema` instead. */
167
+ export const outboundSchema = FileListPurpose$outboundSchema;
168
+ }
169
+
170
+ /** @internal */
171
+ export const FileListData$inboundSchema: z.ZodType<
172
+ FileListData,
173
+ z.ZodTypeDef,
174
+ unknown
175
+ > = z.object({
176
+ _id: z.string(),
177
+ object_name: z.string(),
178
+ purpose: FileListPurpose$inboundSchema,
179
+ bytes: z.number(),
180
+ file_name: z.string(),
181
+ workspace_id: z.string(),
182
+ created: z.string().datetime({ offset: true }).default(
183
+ "2025-02-11T15:58:00.983Z",
184
+ ).transform(v => new Date(v)),
185
+ }).transform((v) => {
186
+ return remap$(v, {
187
+ "_id": "id",
188
+ "object_name": "objectName",
189
+ "file_name": "fileName",
190
+ "workspace_id": "workspaceId",
191
+ });
192
+ });
193
+
194
+ /** @internal */
195
+ export type FileListData$Outbound = {
196
+ _id: string;
197
+ object_name: string;
198
+ purpose: string;
199
+ bytes: number;
200
+ file_name: string;
201
+ workspace_id: string;
202
+ created: string;
203
+ };
204
+
205
+ /** @internal */
206
+ export const FileListData$outboundSchema: z.ZodType<
207
+ FileListData$Outbound,
208
+ z.ZodTypeDef,
209
+ FileListData
210
+ > = z.object({
211
+ id: z.string(),
212
+ objectName: z.string(),
213
+ purpose: FileListPurpose$outboundSchema,
214
+ bytes: z.number(),
215
+ fileName: z.string(),
216
+ workspaceId: z.string(),
217
+ created: z.date().default(() => new Date("2025-02-11T15:58:00.983Z"))
218
+ .transform(v => v.toISOString()),
219
+ }).transform((v) => {
220
+ return remap$(v, {
221
+ id: "_id",
222
+ objectName: "object_name",
223
+ fileName: "file_name",
224
+ workspaceId: "workspace_id",
225
+ });
226
+ });
227
+
228
+ /**
229
+ * @internal
230
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
231
+ */
232
+ export namespace FileListData$ {
233
+ /** @deprecated use `FileListData$inboundSchema` instead. */
234
+ export const inboundSchema = FileListData$inboundSchema;
235
+ /** @deprecated use `FileListData$outboundSchema` instead. */
236
+ export const outboundSchema = FileListData$outboundSchema;
237
+ /** @deprecated use `FileListData$Outbound` instead. */
238
+ export type Outbound = FileListData$Outbound;
239
+ }
240
+
241
+ export function fileListDataToJSON(fileListData: FileListData): string {
242
+ return JSON.stringify(FileListData$outboundSchema.parse(fileListData));
243
+ }
244
+
245
+ export function fileListDataFromJSON(
246
+ jsonString: string,
247
+ ): SafeParseResult<FileListData, SDKValidationError> {
248
+ return safeParse(
249
+ jsonString,
250
+ (x) => FileListData$inboundSchema.parse(JSON.parse(x)),
251
+ `Failed to parse 'FileListData' from JSON`,
252
+ );
253
+ }
254
+
255
+ /** @internal */
256
+ export const FileListResponseBody$inboundSchema: z.ZodType<
257
+ FileListResponseBody,
258
+ z.ZodTypeDef,
259
+ unknown
260
+ > = z.object({
261
+ object: FileListObject$inboundSchema,
262
+ data: z.array(z.lazy(() => FileListData$inboundSchema)),
263
+ has_more: z.boolean(),
264
+ }).transform((v) => {
265
+ return remap$(v, {
266
+ "has_more": "hasMore",
267
+ });
268
+ });
269
+
270
+ /** @internal */
271
+ export type FileListResponseBody$Outbound = {
272
+ object: string;
273
+ data: Array<FileListData$Outbound>;
274
+ has_more: boolean;
275
+ };
276
+
277
+ /** @internal */
278
+ export const FileListResponseBody$outboundSchema: z.ZodType<
279
+ FileListResponseBody$Outbound,
280
+ z.ZodTypeDef,
281
+ FileListResponseBody
282
+ > = z.object({
283
+ object: FileListObject$outboundSchema,
284
+ data: z.array(z.lazy(() => FileListData$outboundSchema)),
285
+ hasMore: z.boolean(),
286
+ }).transform((v) => {
287
+ return remap$(v, {
288
+ hasMore: "has_more",
289
+ });
290
+ });
291
+
292
+ /**
293
+ * @internal
294
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
295
+ */
296
+ export namespace FileListResponseBody$ {
297
+ /** @deprecated use `FileListResponseBody$inboundSchema` instead. */
298
+ export const inboundSchema = FileListResponseBody$inboundSchema;
299
+ /** @deprecated use `FileListResponseBody$outboundSchema` instead. */
300
+ export const outboundSchema = FileListResponseBody$outboundSchema;
301
+ /** @deprecated use `FileListResponseBody$Outbound` instead. */
302
+ export type Outbound = FileListResponseBody$Outbound;
303
+ }
304
+
305
+ export function fileListResponseBodyToJSON(
306
+ fileListResponseBody: FileListResponseBody,
307
+ ): string {
308
+ return JSON.stringify(
309
+ FileListResponseBody$outboundSchema.parse(fileListResponseBody),
310
+ );
311
+ }
312
+
313
+ export function fileListResponseBodyFromJSON(
314
+ jsonString: string,
315
+ ): SafeParseResult<FileListResponseBody, SDKValidationError> {
316
+ return safeParse(
317
+ jsonString,
318
+ (x) => FileListResponseBody$inboundSchema.parse(JSON.parse(x)),
319
+ `Failed to parse 'FileListResponseBody' from JSON`,
320
+ );
321
+ }