@orq-ai/node 3.1.6 → 3.2.0-rc.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.
Files changed (165) hide show
  1. package/README.md +0 -38
  2. package/docs/sdks/deployments/README.md +0 -81
  3. package/jsr.json +1 -2
  4. package/lib/config.d.ts +2 -2
  5. package/lib/config.js +2 -2
  6. package/lib/config.js.map +1 -1
  7. package/lib/matchers.d.ts.map +1 -1
  8. package/lib/matchers.js +1 -4
  9. package/lib/matchers.js.map +1 -1
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/fileget.js +2 -2
  12. package/models/operations/filelist.js +2 -2
  13. package/models/operations/fileupload.js +2 -2
  14. package/models/operations/index.d.ts +0 -1
  15. package/models/operations/index.d.ts.map +1 -1
  16. package/models/operations/index.js +0 -1
  17. package/models/operations/index.js.map +1 -1
  18. package/package.json +3 -2
  19. package/sdk/deployments.d.ts +0 -8
  20. package/sdk/deployments.d.ts.map +1 -1
  21. package/sdk/deployments.js +0 -10
  22. package/sdk/deployments.js.map +1 -1
  23. package/src/lib/config.ts +2 -2
  24. package/src/lib/matchers.ts +1 -4
  25. package/src/models/operations/createcontact.ts +2 -2
  26. package/src/models/operations/fileget.ts +2 -2
  27. package/src/models/operations/filelist.ts +2 -2
  28. package/src/models/operations/fileupload.ts +2 -2
  29. package/src/models/operations/index.ts +0 -1
  30. package/src/sdk/deployments.ts +0 -19
  31. package/funcs/deploymentsStream.d.ts +0 -16
  32. package/funcs/deploymentsStream.d.ts.map +0 -1
  33. package/funcs/deploymentsStream.js +0 -126
  34. package/funcs/deploymentsStream.js.map +0 -1
  35. package/lib/event-streams.d.ts +0 -17
  36. package/lib/event-streams.d.ts.map +0 -1
  37. package/lib/event-streams.js +0 -220
  38. package/lib/event-streams.js.map +0 -1
  39. package/models/operations/deploymentstream.d.ts +0 -1622
  40. package/models/operations/deploymentstream.d.ts.map +0 -1
  41. package/models/operations/deploymentstream.js +0 -1571
  42. package/models/operations/deploymentstream.js.map +0 -1
  43. package/packages/orq-rc/FUNCTIONS.md +0 -106
  44. package/packages/orq-rc/README.md +0 -559
  45. package/packages/orq-rc/RUNTIMES.md +0 -48
  46. package/packages/orq-rc/docs/sdks/contacts/README.md +0 -84
  47. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -316
  48. package/packages/orq-rc/docs/sdks/feedback/README.md +0 -92
  49. package/packages/orq-rc/docs/sdks/files/README.md +0 -305
  50. package/packages/orq-rc/docs/sdks/metrics/README.md +0 -86
  51. package/packages/orq-rc/docs/sdks/orq/README.md +0 -10
  52. package/packages/orq-rc/docs/sdks/prompts/README.md +0 -608
  53. package/packages/orq-rc/docs/sdks/promptsnippets/README.md +0 -534
  54. package/packages/orq-rc/docs/sdks/remoteconfig/README.md +0 -80
  55. package/packages/orq-rc/jsr.json +0 -28
  56. package/packages/orq-rc/package-lock.json +0 -1861
  57. package/packages/orq-rc/package.json +0 -31
  58. package/packages/orq-rc/src/core.ts +0 -13
  59. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -126
  60. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -134
  61. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -142
  62. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -141
  63. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -134
  64. package/packages/orq-rc/src/funcs/deploymentsStream.ts +0 -150
  65. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -126
  66. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -130
  67. package/packages/orq-rc/src/funcs/filesGet.ts +0 -129
  68. package/packages/orq-rc/src/funcs/filesList.ts +0 -131
  69. package/packages/orq-rc/src/funcs/filesUpload.ts +0 -149
  70. package/packages/orq-rc/src/funcs/promptSnippetsCreate.ts +0 -128
  71. package/packages/orq-rc/src/funcs/promptSnippetsDelete.ts +0 -131
  72. package/packages/orq-rc/src/funcs/promptSnippetsGet.ts +0 -130
  73. package/packages/orq-rc/src/funcs/promptSnippetsGetByKey.ts +0 -132
  74. package/packages/orq-rc/src/funcs/promptSnippetsList.ts +0 -132
  75. package/packages/orq-rc/src/funcs/promptSnippetsUpdate.ts +0 -139
  76. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -126
  77. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -130
  78. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -146
  79. package/packages/orq-rc/src/funcs/promptsList.ts +0 -133
  80. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -139
  81. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -132
  82. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -138
  83. package/packages/orq-rc/src/funcs/remoteconfigGetConfig.ts +0 -127
  84. package/packages/orq-rc/src/hooks/global.ts +0 -44
  85. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  86. package/packages/orq-rc/src/hooks/index.ts +0 -6
  87. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  88. package/packages/orq-rc/src/hooks/types.ts +0 -109
  89. package/packages/orq-rc/src/index.ts +0 -7
  90. package/packages/orq-rc/src/lib/base64.ts +0 -37
  91. package/packages/orq-rc/src/lib/config.ts +0 -70
  92. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  93. package/packages/orq-rc/src/lib/encodings.ts +0 -483
  94. package/packages/orq-rc/src/lib/env.ts +0 -73
  95. package/packages/orq-rc/src/lib/event-streams.ts +0 -264
  96. package/packages/orq-rc/src/lib/files.ts +0 -40
  97. package/packages/orq-rc/src/lib/http.ts +0 -323
  98. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  99. package/packages/orq-rc/src/lib/logger.ts +0 -9
  100. package/packages/orq-rc/src/lib/matchers.ts +0 -325
  101. package/packages/orq-rc/src/lib/primitives.ts +0 -136
  102. package/packages/orq-rc/src/lib/retries.ts +0 -218
  103. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  104. package/packages/orq-rc/src/lib/sdks.ts +0 -400
  105. package/packages/orq-rc/src/lib/security.ts +0 -254
  106. package/packages/orq-rc/src/lib/url.ts +0 -33
  107. package/packages/orq-rc/src/models/components/deployments.ts +0 -1666
  108. package/packages/orq-rc/src/models/components/index.ts +0 -6
  109. package/packages/orq-rc/src/models/components/security.ts +0 -71
  110. package/packages/orq-rc/src/models/errors/apierror.ts +0 -27
  111. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -71
  112. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -82
  113. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  114. package/packages/orq-rc/src/models/errors/index.ts +0 -11
  115. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -97
  116. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -71
  117. package/packages/orq-rc/src/models/errors/updatepromptsnippet.ts +0 -71
  118. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -256
  119. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -286
  120. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -3819
  121. package/packages/orq-rc/src/models/operations/createpromptsnippet.ts +0 -6239
  122. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -69
  123. package/packages/orq-rc/src/models/operations/deletepromptsnippet.ts +0 -69
  124. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -1790
  125. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -3527
  126. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -1144
  127. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2148
  128. package/packages/orq-rc/src/models/operations/deploymentstream.ts +0 -3062
  129. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -78
  130. package/packages/orq-rc/src/models/operations/fileget.ts +0 -222
  131. package/packages/orq-rc/src/models/operations/filelist.ts +0 -321
  132. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -322
  133. package/packages/orq-rc/src/models/operations/findonebykeypromptsnippet.ts +0 -4483
  134. package/packages/orq-rc/src/models/operations/findonepromptsnippet.ts +0 -4343
  135. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -2116
  136. package/packages/orq-rc/src/models/operations/getallpromptsnippets.ts +0 -4472
  137. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -1982
  138. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -2012
  139. package/packages/orq-rc/src/models/operations/index.ts +0 -29
  140. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -2146
  141. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -190
  142. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -3917
  143. package/packages/orq-rc/src/models/operations/updatepromptsnippet.ts +0 -6544
  144. package/packages/orq-rc/src/sdk/contacts.ts +0 -27
  145. package/packages/orq-rc/src/sdk/deployments.ts +0 -89
  146. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  147. package/packages/orq-rc/src/sdk/files.ts +0 -72
  148. package/packages/orq-rc/src/sdk/index.ts +0 -5
  149. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  150. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  151. package/packages/orq-rc/src/sdk/promptsnippets.ts +0 -99
  152. package/packages/orq-rc/src/sdk/remoteconfig.ts +0 -24
  153. package/packages/orq-rc/src/sdk/sdk.ts +0 -49
  154. package/packages/orq-rc/src/types/blobs.ts +0 -31
  155. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  156. package/packages/orq-rc/src/types/enums.ts +0 -16
  157. package/packages/orq-rc/src/types/fp.ts +0 -50
  158. package/packages/orq-rc/src/types/index.ts +0 -11
  159. package/packages/orq-rc/src/types/operations.ts +0 -105
  160. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  161. package/packages/orq-rc/src/types/streams.ts +0 -21
  162. package/packages/orq-rc/tsconfig.json +0 -41
  163. package/src/funcs/deploymentsStream.ts +0 -151
  164. package/src/lib/event-streams.ts +0 -264
  165. package/src/models/operations/deploymentstream.ts +0 -3062
@@ -1,6 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- export * from "./deployments.js";
6
- export * from "./security.js";
@@ -1,71 +0,0 @@
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 Security = {
12
- apiKey?: string | undefined;
13
- };
14
-
15
- /** @internal */
16
- export const Security$inboundSchema: z.ZodType<
17
- Security,
18
- z.ZodTypeDef,
19
- unknown
20
- > = z.object({
21
- ApiKey: z.string().optional(),
22
- }).transform((v) => {
23
- return remap$(v, {
24
- "ApiKey": "apiKey",
25
- });
26
- });
27
-
28
- /** @internal */
29
- export type Security$Outbound = {
30
- ApiKey?: string | undefined;
31
- };
32
-
33
- /** @internal */
34
- export const Security$outboundSchema: z.ZodType<
35
- Security$Outbound,
36
- z.ZodTypeDef,
37
- Security
38
- > = z.object({
39
- apiKey: z.string().optional(),
40
- }).transform((v) => {
41
- return remap$(v, {
42
- apiKey: "ApiKey",
43
- });
44
- });
45
-
46
- /**
47
- * @internal
48
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
49
- */
50
- export namespace Security$ {
51
- /** @deprecated use `Security$inboundSchema` instead. */
52
- export const inboundSchema = Security$inboundSchema;
53
- /** @deprecated use `Security$outboundSchema` instead. */
54
- export const outboundSchema = Security$outboundSchema;
55
- /** @deprecated use `Security$Outbound` instead. */
56
- export type Outbound = Security$Outbound;
57
- }
58
-
59
- export function securityToJSON(security: Security): string {
60
- return JSON.stringify(Security$outboundSchema.parse(security));
61
- }
62
-
63
- export function securityFromJSON(
64
- jsonString: string,
65
- ): SafeParseResult<Security, SDKValidationError> {
66
- return safeParse(
67
- jsonString,
68
- (x) => Security$inboundSchema.parse(JSON.parse(x)),
69
- `Failed to parse 'Security' from JSON`,
70
- );
71
- }
@@ -1,27 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- export class APIError extends Error {
6
- public readonly statusCode: number;
7
- public readonly contentType: string;
8
-
9
- constructor(
10
- message: string,
11
- public readonly rawResponse: Response,
12
- public readonly body: string = "",
13
- ) {
14
- const statusCode = rawResponse.status;
15
- const contentType = rawResponse.headers.get("content-type") || "";
16
- const bodyString = body.length > 0 ? `\n${body}` : "";
17
-
18
- super(
19
- `${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`,
20
- );
21
-
22
- this.statusCode = statusCode;
23
- this.contentType = contentType;
24
-
25
- this.name = "APIError";
26
- }
27
- }
@@ -1,71 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
-
7
- /**
8
- * Not Found - The prompt or prompt version does not exist.
9
- */
10
- export type GetPromptVersionResponseBodyData = {
11
- message: string;
12
- };
13
-
14
- /**
15
- * Not Found - The prompt or prompt version does not exist.
16
- */
17
- export class GetPromptVersionResponseBody extends Error {
18
- /** The original data that was passed to this error instance. */
19
- data$: GetPromptVersionResponseBodyData;
20
-
21
- constructor(err: GetPromptVersionResponseBodyData) {
22
- const message = "message" in err && typeof err.message === "string"
23
- ? err.message
24
- : `API error occurred: ${JSON.stringify(err)}`;
25
- super(message);
26
- this.data$ = err;
27
-
28
- this.name = "GetPromptVersionResponseBody";
29
- }
30
- }
31
-
32
- /** @internal */
33
- export const GetPromptVersionResponseBody$inboundSchema: z.ZodType<
34
- GetPromptVersionResponseBody,
35
- z.ZodTypeDef,
36
- unknown
37
- > = z.object({
38
- message: z.string(),
39
- })
40
- .transform((v) => {
41
- return new GetPromptVersionResponseBody(v);
42
- });
43
-
44
- /** @internal */
45
- export type GetPromptVersionResponseBody$Outbound = {
46
- message: string;
47
- };
48
-
49
- /** @internal */
50
- export const GetPromptVersionResponseBody$outboundSchema: z.ZodType<
51
- GetPromptVersionResponseBody$Outbound,
52
- z.ZodTypeDef,
53
- GetPromptVersionResponseBody
54
- > = z.instanceof(GetPromptVersionResponseBody)
55
- .transform(v => v.data$)
56
- .pipe(z.object({
57
- message: z.string(),
58
- }));
59
-
60
- /**
61
- * @internal
62
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
63
- */
64
- export namespace GetPromptVersionResponseBody$ {
65
- /** @deprecated use `GetPromptVersionResponseBody$inboundSchema` instead. */
66
- export const inboundSchema = GetPromptVersionResponseBody$inboundSchema;
67
- /** @deprecated use `GetPromptVersionResponseBody$outboundSchema` instead. */
68
- export const outboundSchema = GetPromptVersionResponseBody$outboundSchema;
69
- /** @deprecated use `GetPromptVersionResponseBody$Outbound` instead. */
70
- export type Outbound = GetPromptVersionResponseBody$Outbound;
71
- }
@@ -1,82 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
-
7
- export type HonoApiErrorData = {
8
- /**
9
- * HTTP status code
10
- */
11
- code?: string | undefined;
12
- /**
13
- * Error message
14
- */
15
- message: string;
16
- };
17
-
18
- export class HonoApiError extends Error {
19
- /**
20
- * HTTP status code
21
- */
22
- code?: string | undefined;
23
-
24
- /** The original data that was passed to this error instance. */
25
- data$: HonoApiErrorData;
26
-
27
- constructor(err: HonoApiErrorData) {
28
- const message = "message" in err && typeof err.message === "string"
29
- ? err.message
30
- : `API error occurred: ${JSON.stringify(err)}`;
31
- super(message);
32
- this.data$ = err;
33
-
34
- if (err.code != null) this.code = err.code;
35
-
36
- this.name = "HonoApiError";
37
- }
38
- }
39
-
40
- /** @internal */
41
- export const HonoApiError$inboundSchema: z.ZodType<
42
- HonoApiError,
43
- z.ZodTypeDef,
44
- unknown
45
- > = z.object({
46
- code: z.string().optional(),
47
- message: z.string(),
48
- })
49
- .transform((v) => {
50
- return new HonoApiError(v);
51
- });
52
-
53
- /** @internal */
54
- export type HonoApiError$Outbound = {
55
- code?: string | undefined;
56
- message: string;
57
- };
58
-
59
- /** @internal */
60
- export const HonoApiError$outboundSchema: z.ZodType<
61
- HonoApiError$Outbound,
62
- z.ZodTypeDef,
63
- HonoApiError
64
- > = z.instanceof(HonoApiError)
65
- .transform(v => v.data$)
66
- .pipe(z.object({
67
- code: z.string().optional(),
68
- message: z.string(),
69
- }));
70
-
71
- /**
72
- * @internal
73
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
74
- */
75
- export namespace HonoApiError$ {
76
- /** @deprecated use `HonoApiError$inboundSchema` instead. */
77
- export const inboundSchema = HonoApiError$inboundSchema;
78
- /** @deprecated use `HonoApiError$outboundSchema` instead. */
79
- export const outboundSchema = HonoApiError$outboundSchema;
80
- /** @deprecated use `HonoApiError$Outbound` instead. */
81
- export type Outbound = HonoApiError$Outbound;
82
- }
@@ -1,62 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- /**
6
- * Base class for all HTTP errors.
7
- */
8
- export class HTTPClientError extends Error {
9
- /** The underlying cause of the error. */
10
- override readonly cause: unknown;
11
- override name = "HTTPClientError";
12
- constructor(message: string, opts?: { cause?: unknown }) {
13
- let msg = message;
14
- if (opts?.cause) {
15
- msg += `: ${opts.cause}`;
16
- }
17
-
18
- super(msg, opts);
19
- // In older runtimes, the cause field would not have been assigned through
20
- // the super() call.
21
- if (typeof this.cause === "undefined") {
22
- this.cause = opts?.cause;
23
- }
24
- }
25
- }
26
-
27
- /**
28
- * An error to capture unrecognised or unexpected errors when making HTTP calls.
29
- */
30
- export class UnexpectedClientError extends HTTPClientError {
31
- override name = "UnexpectedClientError";
32
- }
33
-
34
- /**
35
- * An error that is raised when any inputs used to create a request are invalid.
36
- */
37
- export class InvalidRequestError extends HTTPClientError {
38
- override name = "InvalidRequestError";
39
- }
40
-
41
- /**
42
- * An error that is raised when a HTTP request was aborted by the client error.
43
- */
44
- export class RequestAbortedError extends HTTPClientError {
45
- override readonly name = "RequestAbortedError";
46
- }
47
-
48
- /**
49
- * An error that is raised when a HTTP request timed out due to an AbortSignal
50
- * signal timeout.
51
- */
52
- export class RequestTimeoutError extends HTTPClientError {
53
- override readonly name = "RequestTimeoutError";
54
- }
55
-
56
- /**
57
- * An error that is raised when a HTTP client is unable to make a request to
58
- * a server.
59
- */
60
- export class ConnectionError extends HTTPClientError {
61
- override readonly name = "ConnectionError";
62
- }
@@ -1,11 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- export * from "./apierror.js";
6
- export * from "./getpromptversion.js";
7
- export * from "./honoapierror.js";
8
- export * from "./httpclienterrors.js";
9
- export * from "./sdkvalidationerror.js";
10
- export * from "./updateprompt.js";
11
- export * from "./updatepromptsnippet.js";
@@ -1,97 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
-
7
- export class SDKValidationError extends Error {
8
- /**
9
- * The raw value that failed validation.
10
- */
11
- public readonly rawValue: unknown;
12
-
13
- /**
14
- * The raw message that failed validation.
15
- */
16
- public readonly rawMessage: unknown;
17
-
18
- constructor(message: string, cause: unknown, rawValue: unknown) {
19
- super(`${message}: ${cause}`);
20
- this.name = "SDKValidationError";
21
- this.cause = cause;
22
- this.rawValue = rawValue;
23
- this.rawMessage = message;
24
- }
25
-
26
- /**
27
- * Return a pretty-formatted error message if the underlying validation error
28
- * is a ZodError or some other recognized error type, otherwise return the
29
- * default error message.
30
- */
31
- public pretty(): string {
32
- if (this.cause instanceof z.ZodError) {
33
- return `${this.rawMessage}\n${formatZodError(this.cause)}`;
34
- } else {
35
- return this.toString();
36
- }
37
- }
38
- }
39
-
40
- export function formatZodError(err: z.ZodError, level = 0): string {
41
- let pre = " ".repeat(level);
42
- pre = level > 0 ? `│${pre}` : pre;
43
- pre += " ".repeat(level);
44
-
45
- let message = "";
46
- const append = (str: string) => (message += `\n${pre}${str}`);
47
-
48
- const len = err.issues.length;
49
- const headline = len === 1 ? `${len} issue found` : `${len} issues found`;
50
-
51
- if (len) {
52
- append(`┌ ${headline}:`);
53
- }
54
-
55
- for (const issue of err.issues) {
56
- let path = issue.path.join(".");
57
- path = path ? `<root>.${path}` : "<root>";
58
- append(`│ • [${path}]: ${issue.message} (${issue.code})`);
59
- switch (issue.code) {
60
- case "invalid_literal":
61
- case "invalid_type": {
62
- append(`│ Want: ${issue.expected}`);
63
- append(`│ Got: ${issue.received}`);
64
- break;
65
- }
66
- case "unrecognized_keys": {
67
- append(`│ Keys: ${issue.keys.join(", ")}`);
68
- break;
69
- }
70
- case "invalid_enum_value": {
71
- append(`│ Allowed: ${issue.options.join(", ")}`);
72
- append(`│ Got: ${issue.received}`);
73
- break;
74
- }
75
- case "invalid_union_discriminator": {
76
- append(`│ Allowed: ${issue.options.join(", ")}`);
77
- break;
78
- }
79
- case "invalid_union": {
80
- const len = issue.unionErrors.length;
81
- append(
82
- `│ ✖︎ Attemped to deserialize into one of ${len} union members:`,
83
- );
84
- issue.unionErrors.forEach((err, i) => {
85
- append(`│ ✖︎ Member ${i + 1} of ${len}`);
86
- append(`${formatZodError(err, level + 1)}`);
87
- });
88
- }
89
- }
90
- }
91
-
92
- if (err.issues.length) {
93
- append(`└─*`);
94
- }
95
-
96
- return message.slice(1);
97
- }
@@ -1,71 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
-
7
- /**
8
- * Prompt not found.
9
- */
10
- export type UpdatePromptResponseBodyData = {
11
- message: string;
12
- };
13
-
14
- /**
15
- * Prompt not found.
16
- */
17
- export class UpdatePromptResponseBody extends Error {
18
- /** The original data that was passed to this error instance. */
19
- data$: UpdatePromptResponseBodyData;
20
-
21
- constructor(err: UpdatePromptResponseBodyData) {
22
- const message = "message" in err && typeof err.message === "string"
23
- ? err.message
24
- : `API error occurred: ${JSON.stringify(err)}`;
25
- super(message);
26
- this.data$ = err;
27
-
28
- this.name = "UpdatePromptResponseBody";
29
- }
30
- }
31
-
32
- /** @internal */
33
- export const UpdatePromptResponseBody$inboundSchema: z.ZodType<
34
- UpdatePromptResponseBody,
35
- z.ZodTypeDef,
36
- unknown
37
- > = z.object({
38
- message: z.string(),
39
- })
40
- .transform((v) => {
41
- return new UpdatePromptResponseBody(v);
42
- });
43
-
44
- /** @internal */
45
- export type UpdatePromptResponseBody$Outbound = {
46
- message: string;
47
- };
48
-
49
- /** @internal */
50
- export const UpdatePromptResponseBody$outboundSchema: z.ZodType<
51
- UpdatePromptResponseBody$Outbound,
52
- z.ZodTypeDef,
53
- UpdatePromptResponseBody
54
- > = z.instanceof(UpdatePromptResponseBody)
55
- .transform(v => v.data$)
56
- .pipe(z.object({
57
- message: z.string(),
58
- }));
59
-
60
- /**
61
- * @internal
62
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
63
- */
64
- export namespace UpdatePromptResponseBody$ {
65
- /** @deprecated use `UpdatePromptResponseBody$inboundSchema` instead. */
66
- export const inboundSchema = UpdatePromptResponseBody$inboundSchema;
67
- /** @deprecated use `UpdatePromptResponseBody$outboundSchema` instead. */
68
- export const outboundSchema = UpdatePromptResponseBody$outboundSchema;
69
- /** @deprecated use `UpdatePromptResponseBody$Outbound` instead. */
70
- export type Outbound = UpdatePromptResponseBody$Outbound;
71
- }
@@ -1,71 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
-
7
- /**
8
- * Prompt snippet not found.
9
- */
10
- export type UpdatePromptSnippetResponseBodyData = {
11
- message: string;
12
- };
13
-
14
- /**
15
- * Prompt snippet not found.
16
- */
17
- export class UpdatePromptSnippetResponseBody extends Error {
18
- /** The original data that was passed to this error instance. */
19
- data$: UpdatePromptSnippetResponseBodyData;
20
-
21
- constructor(err: UpdatePromptSnippetResponseBodyData) {
22
- const message = "message" in err && typeof err.message === "string"
23
- ? err.message
24
- : `API error occurred: ${JSON.stringify(err)}`;
25
- super(message);
26
- this.data$ = err;
27
-
28
- this.name = "UpdatePromptSnippetResponseBody";
29
- }
30
- }
31
-
32
- /** @internal */
33
- export const UpdatePromptSnippetResponseBody$inboundSchema: z.ZodType<
34
- UpdatePromptSnippetResponseBody,
35
- z.ZodTypeDef,
36
- unknown
37
- > = z.object({
38
- message: z.string(),
39
- })
40
- .transform((v) => {
41
- return new UpdatePromptSnippetResponseBody(v);
42
- });
43
-
44
- /** @internal */
45
- export type UpdatePromptSnippetResponseBody$Outbound = {
46
- message: string;
47
- };
48
-
49
- /** @internal */
50
- export const UpdatePromptSnippetResponseBody$outboundSchema: z.ZodType<
51
- UpdatePromptSnippetResponseBody$Outbound,
52
- z.ZodTypeDef,
53
- UpdatePromptSnippetResponseBody
54
- > = z.instanceof(UpdatePromptSnippetResponseBody)
55
- .transform(v => v.data$)
56
- .pipe(z.object({
57
- message: z.string(),
58
- }));
59
-
60
- /**
61
- * @internal
62
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
63
- */
64
- export namespace UpdatePromptSnippetResponseBody$ {
65
- /** @deprecated use `UpdatePromptSnippetResponseBody$inboundSchema` instead. */
66
- export const inboundSchema = UpdatePromptSnippetResponseBody$inboundSchema;
67
- /** @deprecated use `UpdatePromptSnippetResponseBody$outboundSchema` instead. */
68
- export const outboundSchema = UpdatePromptSnippetResponseBody$outboundSchema;
69
- /** @deprecated use `UpdatePromptSnippetResponseBody$Outbound` instead. */
70
- export type Outbound = UpdatePromptSnippetResponseBody$Outbound;
71
- }