vellum-ai 0.14.3 → 0.14.5

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 (167) hide show
  1. package/Client.js +11 -11
  2. package/api/resources/adHoc/client/Client.js +1 -1
  3. package/api/resources/containerImages/client/Client.js +4 -4
  4. package/api/resources/deployments/client/Client.js +7 -7
  5. package/api/resources/documentIndexes/client/Client.js +8 -8
  6. package/api/resources/documentIndexes/client/requests/DocumentIndexesListRequest.d.ts +2 -2
  7. package/api/resources/documents/client/Client.d.ts +0 -1
  8. package/api/resources/documents/client/Client.js +5 -6
  9. package/api/resources/folderEntities/client/Client.d.ts +0 -1
  10. package/api/resources/folderEntities/client/Client.js +2 -3
  11. package/api/resources/folderEntities/client/requests/FolderEntitiesListRequest.d.ts +2 -3
  12. package/api/resources/metricDefinitions/client/Client.js +2 -2
  13. package/api/resources/mlModels/client/Client.js +1 -1
  14. package/api/resources/organizations/client/Client.js +1 -1
  15. package/api/resources/sandboxes/client/Client.js +3 -3
  16. package/api/resources/testSuiteRuns/client/Client.js +3 -3
  17. package/api/resources/testSuiteRuns/client/requests/TestSuiteRunsListExecutionsRequest.d.ts +0 -1
  18. package/api/resources/testSuites/client/Client.js +4 -4
  19. package/api/resources/workflowDeployments/client/Client.js +6 -6
  20. package/api/resources/workflowSandboxes/client/Client.js +1 -1
  21. package/api/resources/workflows/client/Client.js +4 -3
  22. package/api/resources/workspaceSecrets/client/Client.js +2 -2
  23. package/api/resources/workspaces/client/Client.js +1 -1
  24. package/api/types/AddOpenaiApiKeyEnum.d.ts +1 -1
  25. package/api/types/ChatMessageRole.d.ts +4 -4
  26. package/api/types/CodeExecutionRuntime.d.ts +2 -2
  27. package/api/types/ConditionCombinator.d.ts +2 -2
  28. package/api/types/DeploymentRead.d.ts +5 -5
  29. package/api/types/DeploymentReleaseTagRead.d.ts +2 -2
  30. package/api/types/DocumentDocumentToDocumentIndex.d.ts +5 -5
  31. package/api/types/DocumentIndexRead.d.ts +5 -5
  32. package/api/types/DocumentProcessingState.d.ts +5 -5
  33. package/api/types/DocumentRead.d.ts +1 -1
  34. package/api/types/DocumentStatus.d.ts +1 -1
  35. package/api/types/EnrichedNormalizedCompletion.d.ts +3 -3
  36. package/api/types/EntityStatus.d.ts +2 -2
  37. package/api/types/EntityVisibility.d.ts +4 -4
  38. package/api/types/EnvironmentEnum.d.ts +3 -3
  39. package/api/types/EphemeralPromptCacheConfigTypeEnum.d.ts +1 -1
  40. package/api/types/FinishReasonEnum.d.ts +3 -3
  41. package/api/types/GenerateOptionsRequest.d.ts +2 -2
  42. package/api/types/IndexingStateEnum.d.ts +5 -5
  43. package/api/types/IterationStateEnum.d.ts +3 -3
  44. package/api/types/LogicalOperator.d.ts +24 -24
  45. package/api/types/LogprobsEnum.d.ts +2 -2
  46. package/api/types/MetadataFilterRuleCombinator.d.ts +2 -2
  47. package/api/types/MethodEnum.d.ts +5 -5
  48. package/api/types/NewMemberJoinBehaviorEnum.d.ts +3 -3
  49. package/api/types/ProcessingFailureReasonEnum.d.ts +2 -2
  50. package/api/types/PromptBlockState.d.ts +2 -2
  51. package/api/types/ReleaseTagSource.d.ts +2 -2
  52. package/api/types/SecretTypeEnum.d.ts +3 -3
  53. package/api/types/SlimDeploymentRead.d.ts +5 -5
  54. package/api/types/SlimDocument.d.ts +3 -3
  55. package/api/types/SlimDocumentDocumentToDocumentIndex.d.ts +5 -5
  56. package/api/types/SlimWorkflowDeployment.d.ts +5 -5
  57. package/api/types/TestSuiteRunRead.d.ts +5 -5
  58. package/api/types/TestSuiteRunState.d.ts +5 -5
  59. package/api/types/UnitEnum.d.ts +1 -1
  60. package/api/types/VellumErrorCodeEnum.d.ts +6 -6
  61. package/api/types/VellumVariableType.d.ts +11 -11
  62. package/api/types/WorkflowDeploymentRead.d.ts +5 -5
  63. package/api/types/WorkflowExecutionEventErrorCode.d.ts +8 -8
  64. package/api/types/WorkflowExecutionEventType.d.ts +2 -2
  65. package/api/types/WorkflowNodeResultEventState.d.ts +4 -4
  66. package/api/types/WorkflowReleaseTagRead.d.ts +2 -2
  67. package/core/fetcher/Fetcher.js +4 -3
  68. package/core/fetcher/getRequestBody.js +2 -1
  69. package/core/fetcher/requestWithRetries.js +1 -1
  70. package/core/form-data-utils/FormDataWrapper.js +6 -2
  71. package/core/json.d.ts +15 -0
  72. package/core/json.js +24 -0
  73. package/core/schemas/Schema.d.ts +1 -0
  74. package/core/schemas/Schema.js +1 -0
  75. package/core/schemas/builders/bigint/bigint.d.ts +1 -1
  76. package/core/schemas/builders/bigint/bigint.js +21 -17
  77. package/core/schemas/builders/object/object.js +1 -0
  78. package/core/schemas/builders/record/record.js +1 -2
  79. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -0
  80. package/core/schemas/builders/schema-utils/getSchemaUtils.js +38 -0
  81. package/dist/Client.js +11 -11
  82. package/dist/api/resources/adHoc/client/Client.js +1 -1
  83. package/dist/api/resources/containerImages/client/Client.js +4 -4
  84. package/dist/api/resources/deployments/client/Client.js +7 -7
  85. package/dist/api/resources/documentIndexes/client/Client.js +8 -8
  86. package/dist/api/resources/documentIndexes/client/requests/DocumentIndexesListRequest.d.ts +2 -2
  87. package/dist/api/resources/documents/client/Client.d.ts +0 -1
  88. package/dist/api/resources/documents/client/Client.js +5 -6
  89. package/dist/api/resources/folderEntities/client/Client.d.ts +0 -1
  90. package/dist/api/resources/folderEntities/client/Client.js +2 -3
  91. package/dist/api/resources/folderEntities/client/requests/FolderEntitiesListRequest.d.ts +2 -3
  92. package/dist/api/resources/metricDefinitions/client/Client.js +2 -2
  93. package/dist/api/resources/mlModels/client/Client.js +1 -1
  94. package/dist/api/resources/organizations/client/Client.js +1 -1
  95. package/dist/api/resources/sandboxes/client/Client.js +3 -3
  96. package/dist/api/resources/testSuiteRuns/client/Client.js +3 -3
  97. package/dist/api/resources/testSuiteRuns/client/requests/TestSuiteRunsListExecutionsRequest.d.ts +0 -1
  98. package/dist/api/resources/testSuites/client/Client.js +4 -4
  99. package/dist/api/resources/workflowDeployments/client/Client.js +6 -6
  100. package/dist/api/resources/workflowSandboxes/client/Client.js +1 -1
  101. package/dist/api/resources/workflows/client/Client.js +4 -3
  102. package/dist/api/resources/workspaceSecrets/client/Client.js +2 -2
  103. package/dist/api/resources/workspaces/client/Client.js +1 -1
  104. package/dist/api/types/AddOpenaiApiKeyEnum.d.ts +1 -1
  105. package/dist/api/types/ChatMessageRole.d.ts +4 -4
  106. package/dist/api/types/CodeExecutionRuntime.d.ts +2 -2
  107. package/dist/api/types/ConditionCombinator.d.ts +2 -2
  108. package/dist/api/types/DeploymentRead.d.ts +5 -5
  109. package/dist/api/types/DeploymentReleaseTagRead.d.ts +2 -2
  110. package/dist/api/types/DocumentDocumentToDocumentIndex.d.ts +5 -5
  111. package/dist/api/types/DocumentIndexRead.d.ts +5 -5
  112. package/dist/api/types/DocumentProcessingState.d.ts +5 -5
  113. package/dist/api/types/DocumentRead.d.ts +1 -1
  114. package/dist/api/types/DocumentStatus.d.ts +1 -1
  115. package/dist/api/types/EnrichedNormalizedCompletion.d.ts +3 -3
  116. package/dist/api/types/EntityStatus.d.ts +2 -2
  117. package/dist/api/types/EntityVisibility.d.ts +4 -4
  118. package/dist/api/types/EnvironmentEnum.d.ts +3 -3
  119. package/dist/api/types/EphemeralPromptCacheConfigTypeEnum.d.ts +1 -1
  120. package/dist/api/types/FinishReasonEnum.d.ts +3 -3
  121. package/dist/api/types/GenerateOptionsRequest.d.ts +2 -2
  122. package/dist/api/types/IndexingStateEnum.d.ts +5 -5
  123. package/dist/api/types/IterationStateEnum.d.ts +3 -3
  124. package/dist/api/types/LogicalOperator.d.ts +24 -24
  125. package/dist/api/types/LogprobsEnum.d.ts +2 -2
  126. package/dist/api/types/MetadataFilterRuleCombinator.d.ts +2 -2
  127. package/dist/api/types/MethodEnum.d.ts +5 -5
  128. package/dist/api/types/NewMemberJoinBehaviorEnum.d.ts +3 -3
  129. package/dist/api/types/ProcessingFailureReasonEnum.d.ts +2 -2
  130. package/dist/api/types/PromptBlockState.d.ts +2 -2
  131. package/dist/api/types/ReleaseTagSource.d.ts +2 -2
  132. package/dist/api/types/SecretTypeEnum.d.ts +3 -3
  133. package/dist/api/types/SlimDeploymentRead.d.ts +5 -5
  134. package/dist/api/types/SlimDocument.d.ts +3 -3
  135. package/dist/api/types/SlimDocumentDocumentToDocumentIndex.d.ts +5 -5
  136. package/dist/api/types/SlimWorkflowDeployment.d.ts +5 -5
  137. package/dist/api/types/TestSuiteRunRead.d.ts +5 -5
  138. package/dist/api/types/TestSuiteRunState.d.ts +5 -5
  139. package/dist/api/types/UnitEnum.d.ts +1 -1
  140. package/dist/api/types/VellumErrorCodeEnum.d.ts +6 -6
  141. package/dist/api/types/VellumVariableType.d.ts +11 -11
  142. package/dist/api/types/WorkflowDeploymentRead.d.ts +5 -5
  143. package/dist/api/types/WorkflowExecutionEventErrorCode.d.ts +8 -8
  144. package/dist/api/types/WorkflowExecutionEventType.d.ts +2 -2
  145. package/dist/api/types/WorkflowNodeResultEventState.d.ts +4 -4
  146. package/dist/api/types/WorkflowReleaseTagRead.d.ts +2 -2
  147. package/dist/core/fetcher/Fetcher.js +4 -3
  148. package/dist/core/fetcher/getRequestBody.js +2 -1
  149. package/dist/core/fetcher/requestWithRetries.js +1 -1
  150. package/dist/core/form-data-utils/FormDataWrapper.js +6 -2
  151. package/dist/core/json.d.ts +15 -0
  152. package/dist/core/json.js +24 -0
  153. package/dist/core/schemas/Schema.d.ts +1 -0
  154. package/dist/core/schemas/Schema.js +1 -0
  155. package/dist/core/schemas/builders/bigint/bigint.d.ts +1 -1
  156. package/dist/core/schemas/builders/bigint/bigint.js +21 -17
  157. package/dist/core/schemas/builders/object/object.js +1 -0
  158. package/dist/core/schemas/builders/record/record.js +1 -2
  159. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -0
  160. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +38 -0
  161. package/dist/errors/VellumError.js +2 -1
  162. package/dist/version.d.ts +1 -1
  163. package/dist/version.js +1 -1
  164. package/errors/VellumError.js +2 -1
  165. package/package.json +1 -1
  166. package/version.d.ts +1 -1
  167. package/version.js +1 -1
@@ -2,8 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * - `SYSTEM` - System
6
- * - `USER` - User
5
+ * * `SYSTEM` - System
6
+ * * `USER` - User
7
7
  */
8
8
  export type ReleaseTagSource = "SYSTEM" | "USER";
9
9
  export declare const ReleaseTagSource: {
@@ -2,9 +2,9 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * - `USER_DEFINED` - User Defined
6
- * - `HMAC` - Hmac
7
- * - `INTERNAL_API_KEY` - Internal Api Key
5
+ * * `USER_DEFINED` - User Defined
6
+ * * `HMAC` - Hmac
7
+ * * `INTERNAL_API_KEY` - Internal Api Key
8
8
  */
9
9
  export type SecretTypeEnum = "USER_DEFINED" | "HMAC" | "INTERNAL_API_KEY";
10
10
  export declare const SecretTypeEnum: {
@@ -12,16 +12,16 @@ export interface SlimDeploymentRead {
12
12
  /**
13
13
  * The current status of the deployment
14
14
  *
15
- * - `ACTIVE` - Active
16
- * - `ARCHIVED` - Archived
15
+ * * `ACTIVE` - Active
16
+ * * `ARCHIVED` - Archived
17
17
  */
18
18
  status?: Vellum.EntityStatus;
19
19
  /**
20
20
  * The environment this deployment is used in
21
21
  *
22
- * - `DEVELOPMENT` - Development
23
- * - `STAGING` - Staging
24
- * - `PRODUCTION` - Production
22
+ * * `DEVELOPMENT` - Development
23
+ * * `STAGING` - Staging
24
+ * * `PRODUCTION` - Production
25
25
  */
26
26
  environment?: Vellum.EnvironmentEnum;
27
27
  lastDeployedOn: Date;
@@ -15,14 +15,14 @@ export interface SlimDocument {
15
15
  /**
16
16
  * An enum value representing why the document could not be processed. Is null unless processing_state is FAILED.
17
17
  *
18
- * - `EXCEEDED_CHARACTER_LIMIT` - Exceeded Character Limit
19
- * - `INVALID_FILE` - Invalid File
18
+ * * `EXCEEDED_CHARACTER_LIMIT` - Exceeded Character Limit
19
+ * * `INVALID_FILE` - Invalid File
20
20
  */
21
21
  processingFailureReason?: Vellum.ProcessingFailureReasonEnum;
22
22
  /**
23
23
  * The document's current status.
24
24
  *
25
- * - `ACTIVE` - Active
25
+ * * `ACTIVE` - Active
26
26
  */
27
27
  status?: Vellum.DocumentStatus;
28
28
  /** A list of keywords associated with this document. Originally provided when uploading the document. */
@@ -13,11 +13,11 @@ export interface SlimDocumentDocumentToDocumentIndex {
13
13
  /**
14
14
  * An enum value representing where this document is along its indexing lifecycle for this index.
15
15
  *
16
- * - `AWAITING_PROCESSING` - Awaiting Processing
17
- * - `QUEUED` - Queued
18
- * - `INDEXING` - Indexing
19
- * - `INDEXED` - Indexed
20
- * - `FAILED` - Failed
16
+ * * `AWAITING_PROCESSING` - Awaiting Processing
17
+ * * `QUEUED` - Queued
18
+ * * `INDEXING` - Indexing
19
+ * * `INDEXED` - Indexed
20
+ * * `FAILED` - Failed
21
21
  */
22
22
  indexingState?: Vellum.IndexingStateEnum;
23
23
  }
@@ -11,16 +11,16 @@ export interface SlimWorkflowDeployment {
11
11
  /**
12
12
  * The current status of the workflow deployment
13
13
  *
14
- * - `ACTIVE` - Active
15
- * - `ARCHIVED` - Archived
14
+ * * `ACTIVE` - Active
15
+ * * `ARCHIVED` - Archived
16
16
  */
17
17
  status?: Vellum.EntityStatus;
18
18
  /**
19
19
  * The environment this workflow deployment is used in
20
20
  *
21
- * - `DEVELOPMENT` - Development
22
- * - `STAGING` - Staging
23
- * - `PRODUCTION` - Production
21
+ * * `DEVELOPMENT` - Development
22
+ * * `STAGING` - Staging
23
+ * * `PRODUCTION` - Production
24
24
  */
25
25
  environment?: Vellum.EnvironmentEnum;
26
26
  created: Date;
@@ -9,11 +9,11 @@ export interface TestSuiteRunRead {
9
9
  /**
10
10
  * The current state of this run
11
11
  *
12
- * - `QUEUED` - Queued
13
- * - `RUNNING` - Running
14
- * - `COMPLETE` - Complete
15
- * - `FAILED` - Failed
16
- * - `CANCELLED` - Cancelled
12
+ * * `QUEUED` - Queued
13
+ * * `RUNNING` - Running
14
+ * * `COMPLETE` - Complete
15
+ * * `FAILED` - Failed
16
+ * * `CANCELLED` - Cancelled
17
17
  */
18
18
  state: Vellum.TestSuiteRunState;
19
19
  /** Configuration that defines how the Test Suite should be run */
@@ -2,11 +2,11 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * - `QUEUED` - Queued
6
- * - `RUNNING` - Running
7
- * - `COMPLETE` - Complete
8
- * - `FAILED` - Failed
9
- * - `CANCELLED` - Cancelled
5
+ * * `QUEUED` - Queued
6
+ * * `RUNNING` - Running
7
+ * * `COMPLETE` - Complete
8
+ * * `FAILED` - Failed
9
+ * * `CANCELLED` - Cancelled
10
10
  */
11
11
  export type TestSuiteRunState = "QUEUED" | "RUNNING" | "COMPLETE" | "FAILED" | "CANCELLED";
12
12
  export declare const TestSuiteRunState: {
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * - `USD` - USD
5
+ * * `USD` - USD
6
6
  */
7
7
  export type UnitEnum = "USD";
@@ -2,12 +2,12 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * - `INVALID_REQUEST` - INVALID_REQUEST
6
- * - `INVALID_INPUTS` - INVALID_INPUTS
7
- * - `PROVIDER_ERROR` - PROVIDER_ERROR
8
- * - `REQUEST_TIMEOUT` - REQUEST_TIMEOUT
9
- * - `INTERNAL_SERVER_ERROR` - INTERNAL_SERVER_ERROR
10
- * - `USER_DEFINED_ERROR` - USER_DEFINED_ERROR
5
+ * * `INVALID_REQUEST` - INVALID_REQUEST
6
+ * * `INVALID_INPUTS` - INVALID_INPUTS
7
+ * * `PROVIDER_ERROR` - PROVIDER_ERROR
8
+ * * `REQUEST_TIMEOUT` - REQUEST_TIMEOUT
9
+ * * `INTERNAL_SERVER_ERROR` - INTERNAL_SERVER_ERROR
10
+ * * `USER_DEFINED_ERROR` - USER_DEFINED_ERROR
11
11
  */
12
12
  export type VellumErrorCodeEnum = "INVALID_REQUEST" | "INVALID_INPUTS" | "PROVIDER_ERROR" | "REQUEST_TIMEOUT" | "INTERNAL_SERVER_ERROR" | "USER_DEFINED_ERROR";
13
13
  export declare const VellumErrorCodeEnum: {
@@ -2,17 +2,17 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * - `STRING` - STRING
6
- * - `NUMBER` - NUMBER
7
- * - `JSON` - JSON
8
- * - `CHAT_HISTORY` - CHAT_HISTORY
9
- * - `SEARCH_RESULTS` - SEARCH_RESULTS
10
- * - `ERROR` - ERROR
11
- * - `ARRAY` - ARRAY
12
- * - `FUNCTION_CALL` - FUNCTION_CALL
13
- * - `IMAGE` - IMAGE
14
- * - `AUDIO` - AUDIO
15
- * - `NULL` - NULL
5
+ * * `STRING` - STRING
6
+ * * `NUMBER` - NUMBER
7
+ * * `JSON` - JSON
8
+ * * `CHAT_HISTORY` - CHAT_HISTORY
9
+ * * `SEARCH_RESULTS` - SEARCH_RESULTS
10
+ * * `ERROR` - ERROR
11
+ * * `ARRAY` - ARRAY
12
+ * * `FUNCTION_CALL` - FUNCTION_CALL
13
+ * * `IMAGE` - IMAGE
14
+ * * `AUDIO` - AUDIO
15
+ * * `NULL` - NULL
16
16
  */
17
17
  export type VellumVariableType = "STRING" | "NUMBER" | "JSON" | "CHAT_HISTORY" | "SEARCH_RESULTS" | "ERROR" | "ARRAY" | "FUNCTION_CALL" | "IMAGE" | "AUDIO" | "NULL";
18
18
  export declare const VellumVariableType: {
@@ -11,16 +11,16 @@ export interface WorkflowDeploymentRead {
11
11
  /**
12
12
  * The current status of the workflow deployment
13
13
  *
14
- * - `ACTIVE` - Active
15
- * - `ARCHIVED` - Archived
14
+ * * `ACTIVE` - Active
15
+ * * `ARCHIVED` - Archived
16
16
  */
17
17
  status?: Vellum.EntityStatus;
18
18
  /**
19
19
  * The environment this workflow deployment is used in
20
20
  *
21
- * - `DEVELOPMENT` - Development
22
- * - `STAGING` - Staging
23
- * - `PRODUCTION` - Production
21
+ * * `DEVELOPMENT` - Development
22
+ * * `STAGING` - Staging
23
+ * * `PRODUCTION` - Production
24
24
  */
25
25
  environment?: Vellum.EnvironmentEnum;
26
26
  created: Date;
@@ -2,14 +2,14 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * - `WORKFLOW_INITIALIZATION` - WORKFLOW_INITIALIZATION
6
- * - `WORKFLOW_CANCELLED` - WORKFLOW_CANCELLED
7
- * - `NODE_EXECUTION_COUNT_LIMIT_REACHED` - NODE_EXECUTION_COUNT_LIMIT_REACHED
8
- * - `INTERNAL_SERVER_ERROR` - INTERNAL_SERVER_ERROR
9
- * - `NODE_EXECUTION` - NODE_EXECUTION
10
- * - `LLM_PROVIDER` - LLM_PROVIDER
11
- * - `INVALID_TEMPLATE` - INVALID_TEMPLATE
12
- * - `USER_DEFINED_ERROR` - USER_DEFINED_ERROR
5
+ * * `WORKFLOW_INITIALIZATION` - WORKFLOW_INITIALIZATION
6
+ * * `WORKFLOW_CANCELLED` - WORKFLOW_CANCELLED
7
+ * * `NODE_EXECUTION_COUNT_LIMIT_REACHED` - NODE_EXECUTION_COUNT_LIMIT_REACHED
8
+ * * `INTERNAL_SERVER_ERROR` - INTERNAL_SERVER_ERROR
9
+ * * `NODE_EXECUTION` - NODE_EXECUTION
10
+ * * `LLM_PROVIDER` - LLM_PROVIDER
11
+ * * `INVALID_TEMPLATE` - INVALID_TEMPLATE
12
+ * * `USER_DEFINED_ERROR` - USER_DEFINED_ERROR
13
13
  */
14
14
  export type WorkflowExecutionEventErrorCode = "WORKFLOW_INITIALIZATION" | "WORKFLOW_CANCELLED" | "NODE_EXECUTION_COUNT_LIMIT_REACHED" | "INTERNAL_SERVER_ERROR" | "NODE_EXECUTION" | "LLM_PROVIDER" | "INVALID_TEMPLATE" | "USER_DEFINED_ERROR";
15
15
  export declare const WorkflowExecutionEventErrorCode: {
@@ -2,8 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * - `NODE` - NODE
6
- * - `WORKFLOW` - WORKFLOW
5
+ * * `NODE` - NODE
6
+ * * `WORKFLOW` - WORKFLOW
7
7
  */
8
8
  export type WorkflowExecutionEventType = "NODE" | "WORKFLOW";
9
9
  export declare const WorkflowExecutionEventType: {
@@ -2,10 +2,10 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * - `INITIATED` - INITIATED
6
- * - `STREAMING` - STREAMING
7
- * - `FULFILLED` - FULFILLED
8
- * - `REJECTED` - REJECTED
5
+ * * `INITIATED` - INITIATED
6
+ * * `STREAMING` - STREAMING
7
+ * * `FULFILLED` - FULFILLED
8
+ * * `REJECTED` - REJECTED
9
9
  */
10
10
  export type WorkflowNodeResultEventState = "INITIATED" | "STREAMING" | "FULFILLED" | "REJECTED";
11
11
  export declare const WorkflowNodeResultEventState: {
@@ -8,8 +8,8 @@ export interface WorkflowReleaseTagRead {
8
8
  /**
9
9
  * The source of how the Release Tag was originally created
10
10
  *
11
- * - `SYSTEM` - System
12
- * - `USER` - User
11
+ * * `SYSTEM` - System
12
+ * * `USER` - User
13
13
  */
14
14
  source: Vellum.ReleaseTagSource;
15
15
  /** The Workflow Deployment History Item that this Release Tag is associated with */
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.fetcher = void 0;
13
13
  exports.fetcherImpl = fetcherImpl;
14
+ const json_1 = require("../json");
14
15
  const createRequestUrl_1 = require("./createRequestUrl");
15
16
  const getFetchFn_1 = require("./getFetchFn");
16
17
  const getRequestBody_1 = require("./getRequestBody");
@@ -31,7 +32,7 @@ function fetcherImpl(args) {
31
32
  }
32
33
  }
33
34
  const url = (0, createRequestUrl_1.createRequestUrl)(args.url, args.queryParameters);
34
- let requestBody = yield (0, getRequestBody_1.getRequestBody)({
35
+ const requestBody = yield (0, getRequestBody_1.getRequestBody)({
35
36
  body: args.body,
36
37
  type: args.requestType === "json" ? "json" : "other",
37
38
  });
@@ -40,7 +41,7 @@ function fetcherImpl(args) {
40
41
  const response = yield (0, requestWithRetries_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
41
42
  return (0, makeRequest_1.makeRequest)(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex);
42
43
  }), args.maxRetries);
43
- let responseBody = yield (0, getResponseBody_1.getResponseBody)(response, args.responseType);
44
+ const responseBody = yield (0, getResponseBody_1.getResponseBody)(response, args.responseType);
44
45
  if (response.status >= 200 && response.status < 400) {
45
46
  return {
46
47
  ok: true,
@@ -90,7 +91,7 @@ function fetcherImpl(args) {
90
91
  ok: false,
91
92
  error: {
92
93
  reason: "unknown",
93
- errorMessage: JSON.stringify(error),
94
+ errorMessage: (0, json_1.toJson)(error),
94
95
  },
95
96
  };
96
97
  }
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getRequestBody = getRequestBody;
13
+ const json_1 = require("../json");
13
14
  function getRequestBody(_a) {
14
15
  return __awaiter(this, arguments, void 0, function* ({ body, type }) {
15
16
  if (type.includes("json")) {
16
- return JSON.stringify(body);
17
+ return (0, json_1.toJson)(body);
17
18
  }
18
19
  else {
19
20
  return body;
@@ -23,7 +23,7 @@ function requestWithRetries(requestFn_1) {
23
23
  return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
24
24
  let response = yield requestFn();
25
25
  for (let i = 0; i < maxRetries; ++i) {
26
- if ([408, 409, 429].includes(response.status) || response.status >= 500) {
26
+ if ([408, 429].includes(response.status) || response.status >= 500) {
27
27
  // Calculate base delay using exponential backoff (in milliseconds)
28
28
  const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY);
29
29
  // Add jitter to the delay
@@ -167,11 +167,15 @@ class WebFormData {
167
167
  }
168
168
  appendFile(key, value, fileName) {
169
169
  return __awaiter(this, void 0, void 0, function* () {
170
- var _a;
170
+ var _a, _b;
171
171
  if (fileName == null && isNamedValue(value)) {
172
172
  fileName = value.name;
173
173
  }
174
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, new Blob([value]), fileName);
174
+ if (value instanceof Blob) {
175
+ (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value, fileName);
176
+ return;
177
+ }
178
+ (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, new Blob([value]), fileName);
175
179
  });
176
180
  }
177
181
  getRequest() {
package/core/json.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Serialize a value to JSON
3
+ * @param value A JavaScript value, usually an object or array, to be converted.
4
+ * @param replacer A function that transforms the results.
5
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
6
+ * @returns JSON string
7
+ */
8
+ export declare const toJson: (value: unknown, replacer?: (this: unknown, key: string, value: unknown) => unknown, space?: string | number) => string;
9
+ /**
10
+ * Parse JSON string to object, array, or other type
11
+ * @param text A valid JSON string.
12
+ * @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.
13
+ * @returns Parsed object, array, or other type
14
+ */
15
+ export declare function fromJson<T = unknown>(text: string, reviver?: (this: unknown, key: string, value: unknown) => unknown): T;
package/core/json.js ADDED
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toJson = void 0;
4
+ exports.fromJson = fromJson;
5
+ /**
6
+ * Serialize a value to JSON
7
+ * @param value A JavaScript value, usually an object or array, to be converted.
8
+ * @param replacer A function that transforms the results.
9
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
10
+ * @returns JSON string
11
+ */
12
+ const toJson = (value, replacer, space) => {
13
+ return JSON.stringify(value, replacer, space);
14
+ };
15
+ exports.toJson = toJson;
16
+ /**
17
+ * Parse JSON string to object, array, or other type
18
+ * @param text A valid JSON string.
19
+ * @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.
20
+ * @returns Parsed object, array, or other type
21
+ */
22
+ function fromJson(text, reviver) {
23
+ return JSON.parse(text, reviver);
24
+ }
@@ -26,6 +26,7 @@ export declare const SchemaType: {
26
26
  readonly UNDISCRIMINATED_UNION: "undiscriminatedUnion";
27
27
  readonly NULLABLE: "nullable";
28
28
  readonly OPTIONAL: "optional";
29
+ readonly OPTIONAL_NULLABLE: "optionalNullable";
29
30
  };
30
31
  export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType];
31
32
  export type MaybeValid<T> = Valid<T> | Invalid;
@@ -20,4 +20,5 @@ exports.SchemaType = {
20
20
  UNDISCRIMINATED_UNION: "undiscriminatedUnion",
21
21
  NULLABLE: "nullable",
22
22
  OPTIONAL: "optional",
23
+ OPTIONAL_NULLABLE: "optionalNullable",
23
24
  };
@@ -1,2 +1,2 @@
1
1
  import { Schema } from "../../Schema";
2
- export declare function bigint(): Schema<string, bigint>;
2
+ export declare function bigint(): Schema<bigint | number, bigint>;
@@ -8,30 +8,30 @@ const schema_utils_1 = require("../schema-utils");
8
8
  function bigint() {
9
9
  const baseSchema = {
10
10
  parse: (raw, { breadcrumbsPrefix = [] } = {}) => {
11
- if (typeof raw !== "string") {
11
+ if (typeof raw === "bigint") {
12
12
  return {
13
- ok: false,
14
- errors: [
15
- {
16
- path: breadcrumbsPrefix,
17
- message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(raw, "string"),
18
- },
19
- ],
13
+ ok: true,
14
+ value: raw,
20
15
  };
21
16
  }
22
- return {
23
- ok: true,
24
- value: BigInt(raw),
25
- };
26
- },
27
- json: (bigint, { breadcrumbsPrefix = [] } = {}) => {
28
- if (typeof bigint === "bigint") {
17
+ if (typeof raw === "number") {
29
18
  return {
30
19
  ok: true,
31
- value: bigint.toString(),
20
+ value: BigInt(raw),
32
21
  };
33
22
  }
34
- else {
23
+ return {
24
+ ok: false,
25
+ errors: [
26
+ {
27
+ path: breadcrumbsPrefix,
28
+ message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(raw, "bigint | number"),
29
+ },
30
+ ],
31
+ };
32
+ },
33
+ json: (bigint, { breadcrumbsPrefix = [] } = {}) => {
34
+ if (typeof bigint !== "bigint") {
35
35
  return {
36
36
  ok: false,
37
37
  errors: [
@@ -42,6 +42,10 @@ function bigint() {
42
42
  ],
43
43
  };
44
44
  }
45
+ return {
46
+ ok: true,
47
+ value: bigint,
48
+ };
45
49
  },
46
50
  getType: () => Schema_1.SchemaType.BIGINT,
47
51
  };
@@ -253,6 +253,7 @@ function isSchemaOptional(schema) {
253
253
  case Schema_1.SchemaType.ANY:
254
254
  case Schema_1.SchemaType.UNKNOWN:
255
255
  case Schema_1.SchemaType.OPTIONAL:
256
+ case Schema_1.SchemaType.OPTIONAL_NULLABLE:
256
257
  return true;
257
258
  default:
258
259
  return false;
@@ -56,8 +56,7 @@ function validateAndTransformRecord({ value, isKeyNumeric, transformKey, transfo
56
56
  };
57
57
  }
58
58
  return (0, entries_1.entries)(value).reduce((accPromise, [stringKey, value]) => {
59
- // skip nullish keys
60
- if (value == null) {
59
+ if (value === undefined) {
61
60
  return accPromise;
62
61
  }
63
62
  const acc = accPromise;
@@ -2,6 +2,7 @@ import { BaseSchema, Schema, SchemaOptions } from "../../Schema";
2
2
  export interface SchemaUtils<Raw, Parsed> {
3
3
  nullable: () => Schema<Raw | null, Parsed | null>;
4
4
  optional: () => Schema<Raw | null | undefined, Parsed | undefined>;
5
+ optionalNullable: () => Schema<Raw | null | undefined, Parsed | null | undefined>;
5
6
  transform: <Transformed>(transformer: SchemaTransformer<Parsed, Transformed>) => Schema<Raw, Transformed>;
6
7
  parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Parsed;
7
8
  jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Raw;
@@ -16,4 +17,5 @@ export declare function getSchemaUtils<Raw, Parsed>(schema: BaseSchema<Raw, Pars
16
17
  */
17
18
  export declare function nullable<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): Schema<Raw | null, Parsed | null>;
18
19
  export declare function optional<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): Schema<Raw | null | undefined, Parsed | undefined>;
20
+ export declare function optionalNullable<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): Schema<Raw | null | undefined, Parsed | null | undefined>;
19
21
  export declare function transform<Raw, Parsed, Transformed>(schema: BaseSchema<Raw, Parsed>, transformer: SchemaTransformer<Parsed, Transformed>): Schema<Raw, Transformed>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSchemaUtils = getSchemaUtils;
4
4
  exports.nullable = nullable;
5
5
  exports.optional = optional;
6
+ exports.optionalNullable = optionalNullable;
6
7
  exports.transform = transform;
7
8
  const Schema_1 = require("../../Schema");
8
9
  const JsonError_1 = require("./JsonError");
@@ -11,6 +12,7 @@ function getSchemaUtils(schema) {
11
12
  return {
12
13
  nullable: () => nullable(schema),
13
14
  optional: () => optional(schema),
15
+ optionalNullable: () => optionalNullable(schema),
14
16
  transform: (transformer) => transform(schema, transformer),
15
17
  parseOrThrow: (raw, opts) => {
16
18
  const parsed = schema.parse(raw, opts);
@@ -85,6 +87,42 @@ function optional(schema) {
85
87
  };
86
88
  return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
87
89
  }
90
+ function optionalNullable(schema) {
91
+ const baseSchema = {
92
+ parse: (raw, opts) => {
93
+ if (raw === undefined) {
94
+ return {
95
+ ok: true,
96
+ value: undefined,
97
+ };
98
+ }
99
+ if (raw === null) {
100
+ return {
101
+ ok: true,
102
+ value: null,
103
+ };
104
+ }
105
+ return schema.parse(raw, opts);
106
+ },
107
+ json: (parsed, opts) => {
108
+ if (parsed === undefined) {
109
+ return {
110
+ ok: true,
111
+ value: undefined,
112
+ };
113
+ }
114
+ if (parsed === null) {
115
+ return {
116
+ ok: true,
117
+ value: null,
118
+ };
119
+ }
120
+ return schema.json(parsed, opts);
121
+ },
122
+ getType: () => Schema_1.SchemaType.OPTIONAL_NULLABLE,
123
+ };
124
+ return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
125
+ }
88
126
  function transform(schema, transformer) {
89
127
  const baseSchema = {
90
128
  parse: (raw, opts) => {