From 72c4e5d0bbaa1f612583725e274da8b6ba7b8043 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 18:08:41 +0000 Subject: [PATCH] SDK regeneration --- README.md | 2 +- src/Client.ts | 6 +- src/api/resources/accounts/client/Client.ts | 62 +-- .../client/requests/AccountsListRequest.ts | 8 +- .../requests/AccountsRetrieveRequest.ts | 2 +- .../client/requests/CreateAccountOpts.ts | 18 +- src/api/resources/actions/client/Client.ts | 108 ++---- .../requests/ActionsConfigurePropRequest.ts | 20 + .../requests/ActionsReloadPropsRequest.ts | 19 + .../actions/client/requests/RunActionOpts.ts | 12 +- .../actions/client/requests/index.ts | 2 + .../resources/appCategories/client/Client.ts | 23 +- src/api/resources/apps/client/Client.ts | 49 +-- .../apps/client/requests/AppsListRequest.ts | 6 +- src/api/resources/components/client/Client.ts | 88 ++--- .../ComponentsConfigurePropRequest.ts | 20 + .../requests/ComponentsReloadPropsRequest.ts | 19 + .../components/client/requests/index.ts | 2 + .../deployedTriggers/client/Client.ts | 141 ++----- .../requests/DeployedTriggersDeleteRequest.ts | 6 +- .../DeployedTriggersListEventsRequest.ts | 4 +- .../requests/DeployedTriggersListRequest.ts | 4 +- .../DeployedTriggersListWebhooksRequest.ts | 4 +- .../DeployedTriggersListWorkflowsRequest.ts | 4 +- .../DeployedTriggersRetrieveRequest.ts | 4 +- .../client/requests/UpdateTriggerOpts.ts | 6 +- .../requests/UpdateTriggerWebhooksOpts.ts | 8 +- .../requests/UpdateTriggerWorkflowsOpts.ts | 8 +- .../resources/oauthTokens/client/Client.ts | 24 +- .../client/requests/CreateOAuthTokenOpts.ts | 8 +- src/api/resources/projects/client/Client.ts | 12 +- src/api/resources/tokens/client/Client.ts | 55 +-- .../tokens/client/requests/CreateTokenOpts.ts | 12 +- .../client/requests/TokensValidateRequest.ts | 15 +- src/api/resources/triggers/client/Client.ts | 106 ++--- .../client/requests/DeployTriggerOpts.ts | 10 +- .../requests/TriggersConfigurePropRequest.ts | 20 + .../requests/TriggersReloadPropsRequest.ts | 19 + .../triggers/client/requests/index.ts | 2 + src/api/types/Account.ts | 12 +- src/api/types/App.ts | 25 +- src/api/types/AppAuthType.ts | 13 - src/api/types/BackendClientOpts.ts | 6 +- src/api/types/ClientOpts.ts | 6 +- src/api/types/Component.ts | 18 +- src/api/types/ComponentStash.ts | 12 - src/api/types/ConfigurableProp.ts | 2 +- .../types/ConfigurablePropAirtableBaseId.ts | 29 -- .../types/ConfigurablePropAirtableFieldId.ts | 29 -- .../types/ConfigurablePropAirtableTableId.ts | 29 -- .../types/ConfigurablePropAirtableViewId.ts | 29 -- src/api/types/ConfigurablePropAlert.ts | 20 +- src/api/types/ConfigurablePropAlertType.ts | 14 - src/api/types/ConfigurablePropAny.ts | 2 +- src/api/types/ConfigurablePropApp.ts | 2 +- src/api/types/ConfigurablePropApphook.ts | 35 -- src/api/types/ConfigurablePropBoolean.ts | 2 +- src/api/types/ConfigurablePropDb.ts | 27 -- src/api/types/ConfigurablePropDiscord.ts | 2 +- .../types/ConfigurablePropDiscordChannel.ts | 29 -- .../ConfigurablePropDiscordChannelArray.ts | 29 -- src/api/types/ConfigurablePropHttp.ts | 29 -- src/api/types/ConfigurablePropInteger.ts | 6 +- src/api/types/ConfigurablePropIntegerArray.ts | 35 -- src/api/types/ConfigurablePropObject.ts | 2 +- src/api/types/ConfigurablePropSql.ts | 32 -- src/api/types/ConfigurablePropSqlAuth.ts | 8 - src/api/types/ConfigurablePropString.ts | 2 +- src/api/types/ConfigurablePropStringArray.ts | 2 +- src/api/types/ConfigurablePropTimer.ts | 33 -- src/api/types/ConfigurablePropTimerDefault.ts | 10 - src/api/types/ConfigurablePropTimerOption.ts | 10 - src/api/types/ConfigurablePropTimerStatic.ts | 10 - src/api/types/ConfigurePropOpts.ts | 12 +- src/api/types/ConfigurePropResponse.ts | 10 +- src/api/types/ConnectToken.ts | 8 - src/api/types/ConnectTokenCreateOpts.ts | 19 + src/api/types/ConnectTokenResponse.ts | 15 + src/api/types/CreateBrowserClientOpts.ts | 11 + src/api/types/CreateOAuthTokenResponse.ts | 6 +- src/api/types/CreateTokenResponse.ts | 9 +- src/api/types/DeleteTriggerOpts.ts | 2 +- src/api/types/DeployedComponent.ts | 16 +- src/api/types/GetAccountsResponse.ts | 2 +- src/api/types/GetAppsResponse.ts | 2 +- src/api/types/GetComponentsResponse.ts | 2 +- src/api/types/GetTriggerWebhooksResponse.ts | 2 +- src/api/types/GetTriggerWorkflowsResponse.ts | 2 +- src/api/types/GetTriggersResponse.ts | 2 +- src/api/types/ListAccountsResponse.ts | 2 +- src/api/types/ListAppsResponse.ts | 2 +- src/api/types/PageInfo.ts | 6 +- src/api/types/ProjectInfoResponse.ts | 17 +- src/api/types/ProjectInfoResponseApp.ts | 10 - src/api/types/ReloadPropsOpts.ts | 8 +- src/api/types/ReloadPropsResponse.ts | 2 +- src/api/types/RunActionOptsStashId.ts | 10 - src/api/types/RunActionResponse.ts | 5 +- src/api/types/StashId.ts | 8 - src/api/types/TimerCron.ts | 11 - src/api/types/TimerInterval.ts | 11 - src/api/types/ValidateTokenParams.ts | 13 + src/api/types/ValidateTokenResponse.ts | 14 +- src/core/auth/OAuthTokenProvider.ts | 8 +- src/core/index.ts | 1 - src/core/schemas/Schema.ts | 101 ----- src/core/schemas/builders/bigint/bigint.ts | 55 --- src/core/schemas/builders/bigint/index.ts | 1 - src/core/schemas/builders/date/date.ts | 65 ---- src/core/schemas/builders/date/index.ts | 1 - src/core/schemas/builders/enum/enum.ts | 43 -- src/core/schemas/builders/enum/index.ts | 1 - src/core/schemas/builders/index.ts | 14 - src/core/schemas/builders/lazy/index.ts | 3 - src/core/schemas/builders/lazy/lazy.ts | 32 -- src/core/schemas/builders/lazy/lazyObject.ts | 20 - src/core/schemas/builders/list/index.ts | 1 - src/core/schemas/builders/list/list.ts | 73 ---- .../builders/literals/booleanLiteral.ts | 29 -- src/core/schemas/builders/literals/index.ts | 2 - .../builders/literals/stringLiteral.ts | 29 -- .../object-like/getObjectLikeUtils.ts | 79 ---- .../schemas/builders/object-like/index.ts | 2 - .../schemas/builders/object-like/types.ts | 11 - src/core/schemas/builders/object/index.ts | 22 -- src/core/schemas/builders/object/object.ts | 366 ------------------ .../object/objectWithoutOptionalProperties.ts | 23 -- src/core/schemas/builders/object/property.ts | 23 -- src/core/schemas/builders/object/types.ts | 58 --- src/core/schemas/builders/primitives/any.ts | 4 - .../schemas/builders/primitives/boolean.ts | 25 -- src/core/schemas/builders/primitives/index.ts | 5 - .../schemas/builders/primitives/number.ts | 25 -- .../schemas/builders/primitives/string.ts | 25 -- .../schemas/builders/primitives/unknown.ts | 4 - src/core/schemas/builders/record/index.ts | 2 - src/core/schemas/builders/record/record.ts | 129 ------ src/core/schemas/builders/record/types.ts | 17 - .../builders/schema-utils/JsonError.ts | 9 - .../builders/schema-utils/ParseError.ts | 9 - .../builders/schema-utils/getSchemaUtils.ts | 181 --------- .../schemas/builders/schema-utils/index.ts | 4 - .../schema-utils/stringifyValidationErrors.ts | 8 - src/core/schemas/builders/set/index.ts | 1 - src/core/schemas/builders/set/set.ts | 43 -- .../builders/undiscriminated-union/index.ts | 6 - .../builders/undiscriminated-union/types.ts | 10 - .../undiscriminatedUnion.ts | 60 --- .../schemas/builders/union/discriminant.ts | 14 - src/core/schemas/builders/union/index.ts | 10 - src/core/schemas/builders/union/types.ts | 26 -- src/core/schemas/builders/union/union.ts | 176 --------- src/core/schemas/index.ts | 2 - src/core/schemas/utils/MaybePromise.ts | 1 - .../addQuestionMarksToNullableProperties.ts | 9 - .../utils/createIdentitySchemaCreator.ts | 21 - src/core/schemas/utils/entries.ts | 3 - src/core/schemas/utils/filterObject.ts | 13 - .../utils/getErrorMessageForIncorrectType.ts | 25 -- src/core/schemas/utils/isPlainObject.ts | 17 - src/core/schemas/utils/keys.ts | 3 - src/core/schemas/utils/maybeSkipValidation.ts | 38 -- src/core/schemas/utils/partition.ts | 12 - src/serialization/index.ts | 2 - .../resources/accounts/client/index.ts | 1 - .../client/requests/CreateAccountOpts.ts | 26 -- .../accounts/client/requests/index.ts | 1 - src/serialization/resources/accounts/index.ts | 1 - .../resources/actions/client/index.ts | 1 - .../actions/client/requests/RunActionOpts.ts | 30 -- .../actions/client/requests/index.ts | 1 - src/serialization/resources/actions/index.ts | 1 - src/serialization/resources/apps/index.ts | 1 - .../types/AppsListRequestSortDirection.ts | 16 - .../apps/types/AppsListRequestSortKey.ts | 16 - .../resources/apps/types/index.ts | 2 - .../deployedTriggers/client/index.ts | 1 - .../client/requests/UpdateTriggerOpts.ts | 27 -- .../requests/UpdateTriggerWebhooksOpts.ts | 20 - .../requests/UpdateTriggerWorkflowsOpts.ts | 20 - .../deployedTriggers/client/requests/index.ts | 3 - .../resources/deployedTriggers/index.ts | 1 - src/serialization/resources/index.ts | 15 - .../resources/oauthTokens/client/index.ts | 1 - .../client/requests/CreateOAuthTokenOpts.ts | 22 -- .../oauthTokens/client/requests/index.ts | 1 - .../resources/oauthTokens/index.ts | 1 - .../resources/proxy/client/index.ts | 3 - .../resources/proxy/client/patch.ts | 15 - .../resources/proxy/client/post.ts | 15 - .../resources/proxy/client/put.ts | 15 - src/serialization/resources/proxy/index.ts | 1 - .../resources/tokens/client/index.ts | 1 - .../tokens/client/requests/CreateTokenOpts.ts | 29 -- .../resources/tokens/client/requests/index.ts | 1 - src/serialization/resources/tokens/index.ts | 1 - .../resources/triggers/client/index.ts | 1 - .../client/requests/DeployTriggerOpts.ts | 31 -- .../triggers/client/requests/index.ts | 1 - src/serialization/resources/triggers/index.ts | 1 - src/serialization/types/Account.ts | 43 -- src/serialization/types/App.ts | 34 -- src/serialization/types/AppAuthType.ts | 14 - src/serialization/types/AppCategory.ts | 22 -- src/serialization/types/BackendClientOpts.ts | 24 -- src/serialization/types/ClientOpts.ts | 22 -- src/serialization/types/Component.ts | 32 -- src/serialization/types/ComponentStash.ts | 14 - src/serialization/types/ConfigurableProp.ts | 40 -- .../types/ConfigurablePropAirtableBaseId.ts | 42 -- .../types/ConfigurablePropAirtableFieldId.ts | 42 -- .../types/ConfigurablePropAirtableTableId.ts | 42 -- .../types/ConfigurablePropAirtableViewId.ts | 42 -- .../types/ConfigurablePropAlert.ts | 45 --- .../types/ConfigurablePropAlertType.ts | 16 - .../types/ConfigurablePropAny.ts | 40 -- .../types/ConfigurablePropApp.ts | 42 -- .../types/ConfigurablePropApphook.ts | 48 --- .../types/ConfigurablePropBoolean.ts | 40 -- src/serialization/types/ConfigurablePropDb.ts | 40 -- .../types/ConfigurablePropDiscord.ts | 40 -- .../types/ConfigurablePropDiscordChannel.ts | 42 -- .../ConfigurablePropDiscordChannelArray.ts | 42 -- .../types/ConfigurablePropHttp.ts | 42 -- .../types/ConfigurablePropInteger.ts | 48 --- .../types/ConfigurablePropIntegerArray.ts | 48 --- .../types/ConfigurablePropObject.ts | 40 -- .../types/ConfigurablePropSql.ts | 45 --- .../types/ConfigurablePropSqlAuth.ts | 20 - .../types/ConfigurablePropString.ts | 42 -- .../types/ConfigurablePropStringArray.ts | 42 -- .../types/ConfigurablePropTimer.ts | 49 --- .../types/ConfigurablePropTimerDefault.ts | 18 - .../types/ConfigurablePropTimerOption.ts | 18 - .../types/ConfigurablePropTimerStatic.ts | 18 - src/serialization/types/ConfigurePropOpts.ts | 44 --- .../types/ConfigurePropResponse.ts | 34 -- src/serialization/types/ConnectToken.ts | 14 - .../types/CreateOAuthTokenResponse.ts | 24 -- .../types/CreateTokenResponse.ts | 25 -- src/serialization/types/DeleteTriggerOpts.ts | 20 - .../types/DeployTriggerResponse.ts | 21 - src/serialization/types/DeployedComponent.ts | 44 --- src/serialization/types/EmittedEvent.ts | 24 -- src/serialization/types/ErrorResponse.ts | 22 -- .../types/GetAccountsResponse.ts | 24 -- .../types/GetAppCategoryResponse.ts | 17 - src/serialization/types/GetAppResponse.ts | 19 - src/serialization/types/GetAppsResponse.ts | 24 -- .../types/GetComponentResponse.ts | 21 - .../types/GetComponentsResponse.ts | 24 -- .../types/GetTriggerEventsResponse.ts | 21 - src/serialization/types/GetTriggerResponse.ts | 21 - .../types/GetTriggerWebhooksResponse.ts | 20 - .../types/GetTriggerWorkflowsResponse.ts | 20 - .../types/GetTriggersResponse.ts | 24 -- .../types/ListAccountsResponse.ts | 24 -- .../types/ListAppCategoriesResponse.ts | 17 - src/serialization/types/ListAppsResponse.ts | 24 -- src/serialization/types/PageInfo.ts | 24 -- src/serialization/types/ProjectEnvironment.ts | 16 - .../types/ProjectInfoResponse.ts | 21 - .../types/ProjectInfoResponseApp.ts | 22 -- src/serialization/types/PropOption.ts | 20 - src/serialization/types/ProxyResponse.ts | 14 - src/serialization/types/ReloadPropsOpts.ts | 33 -- .../types/ReloadPropsResponse.ts | 24 -- .../types/RunActionOptsStashId.ts | 21 - src/serialization/types/RunActionResponse.ts | 27 -- src/serialization/types/StartConnectOpts.ts | 20 - src/serialization/types/StashId.ts | 15 - src/serialization/types/TimerCron.ts | 18 - src/serialization/types/TimerInterval.ts | 18 - .../types/ValidateTokenResponse.ts | 39 -- src/serialization/types/index.ts | 74 ---- src/version.ts | 2 +- tests/unit/schemas/bigint/bigint.test.ts | 46 --- tests/unit/schemas/date/date.test.ts | 31 -- tests/unit/schemas/enum/enum.test.ts | 30 -- tests/unit/schemas/lazy/lazy.test.ts | 57 --- tests/unit/schemas/lazy/lazyObject.test.ts | 18 - tests/unit/schemas/lazy/recursive/a.ts | 7 - tests/unit/schemas/lazy/recursive/b.ts | 8 - tests/unit/schemas/list/list.test.ts | 41 -- .../schemas/literals/stringLiteral.test.ts | 21 - .../object-like/withParsedProperties.test.ts | 57 --- tests/unit/schemas/object/extend.test.ts | 89 ----- tests/unit/schemas/object/object.test.ts | 255 ------------ .../objectWithoutOptionalProperties.test.ts | 21 - tests/unit/schemas/object/passthrough.test.ts | 87 ----- tests/unit/schemas/primitives/any.test.ts | 6 - tests/unit/schemas/primitives/boolean.test.ts | 14 - tests/unit/schemas/primitives/number.test.ts | 14 - tests/unit/schemas/primitives/string.test.ts | 14 - tests/unit/schemas/primitives/unknown.test.ts | 6 - tests/unit/schemas/record/record.test.ts | 34 -- .../schema-utils/getSchemaUtils.test.ts | 83 ---- tests/unit/schemas/schema.test.ts | 78 ---- tests/unit/schemas/set/set.test.ts | 48 --- tests/unit/schemas/skipValidation.test.ts | 44 --- .../undiscriminatedUnion.test.ts | 44 --- tests/unit/schemas/union/union.test.ts | 113 ------ tests/unit/schemas/utils/itSchema.ts | 78 ---- tests/unit/schemas/utils/itValidate.ts | 56 --- yarn.lock | 6 +- 305 files changed, 575 insertions(+), 7103 deletions(-) create mode 100644 src/api/resources/actions/client/requests/ActionsConfigurePropRequest.ts create mode 100644 src/api/resources/actions/client/requests/ActionsReloadPropsRequest.ts create mode 100644 src/api/resources/components/client/requests/ComponentsConfigurePropRequest.ts create mode 100644 src/api/resources/components/client/requests/ComponentsReloadPropsRequest.ts create mode 100644 src/api/resources/triggers/client/requests/TriggersConfigurePropRequest.ts create mode 100644 src/api/resources/triggers/client/requests/TriggersReloadPropsRequest.ts delete mode 100644 src/api/types/AppAuthType.ts delete mode 100644 src/api/types/ComponentStash.ts delete mode 100644 src/api/types/ConfigurablePropAirtableBaseId.ts delete mode 100644 src/api/types/ConfigurablePropAirtableFieldId.ts delete mode 100644 src/api/types/ConfigurablePropAirtableTableId.ts delete mode 100644 src/api/types/ConfigurablePropAirtableViewId.ts delete mode 100644 src/api/types/ConfigurablePropAlertType.ts delete mode 100644 src/api/types/ConfigurablePropApphook.ts delete mode 100644 src/api/types/ConfigurablePropDb.ts delete mode 100644 src/api/types/ConfigurablePropDiscordChannel.ts delete mode 100644 src/api/types/ConfigurablePropDiscordChannelArray.ts delete mode 100644 src/api/types/ConfigurablePropHttp.ts delete mode 100644 src/api/types/ConfigurablePropIntegerArray.ts delete mode 100644 src/api/types/ConfigurablePropSql.ts delete mode 100644 src/api/types/ConfigurablePropSqlAuth.ts delete mode 100644 src/api/types/ConfigurablePropTimer.ts delete mode 100644 src/api/types/ConfigurablePropTimerDefault.ts delete mode 100644 src/api/types/ConfigurablePropTimerOption.ts delete mode 100644 src/api/types/ConfigurablePropTimerStatic.ts delete mode 100644 src/api/types/ConnectToken.ts create mode 100644 src/api/types/ConnectTokenCreateOpts.ts create mode 100644 src/api/types/ConnectTokenResponse.ts create mode 100644 src/api/types/CreateBrowserClientOpts.ts delete mode 100644 src/api/types/ProjectInfoResponseApp.ts delete mode 100644 src/api/types/RunActionOptsStashId.ts delete mode 100644 src/api/types/StashId.ts delete mode 100644 src/api/types/TimerCron.ts delete mode 100644 src/api/types/TimerInterval.ts create mode 100644 src/api/types/ValidateTokenParams.ts delete mode 100644 src/core/schemas/Schema.ts delete mode 100644 src/core/schemas/builders/bigint/bigint.ts delete mode 100644 src/core/schemas/builders/bigint/index.ts delete mode 100644 src/core/schemas/builders/date/date.ts delete mode 100644 src/core/schemas/builders/date/index.ts delete mode 100644 src/core/schemas/builders/enum/enum.ts delete mode 100644 src/core/schemas/builders/enum/index.ts delete mode 100644 src/core/schemas/builders/index.ts delete mode 100644 src/core/schemas/builders/lazy/index.ts delete mode 100644 src/core/schemas/builders/lazy/lazy.ts delete mode 100644 src/core/schemas/builders/lazy/lazyObject.ts delete mode 100644 src/core/schemas/builders/list/index.ts delete mode 100644 src/core/schemas/builders/list/list.ts delete mode 100644 src/core/schemas/builders/literals/booleanLiteral.ts delete mode 100644 src/core/schemas/builders/literals/index.ts delete mode 100644 src/core/schemas/builders/literals/stringLiteral.ts delete mode 100644 src/core/schemas/builders/object-like/getObjectLikeUtils.ts delete mode 100644 src/core/schemas/builders/object-like/index.ts delete mode 100644 src/core/schemas/builders/object-like/types.ts delete mode 100644 src/core/schemas/builders/object/index.ts delete mode 100644 src/core/schemas/builders/object/object.ts delete mode 100644 src/core/schemas/builders/object/objectWithoutOptionalProperties.ts delete mode 100644 src/core/schemas/builders/object/property.ts delete mode 100644 src/core/schemas/builders/object/types.ts delete mode 100644 src/core/schemas/builders/primitives/any.ts delete mode 100644 src/core/schemas/builders/primitives/boolean.ts delete mode 100644 src/core/schemas/builders/primitives/index.ts delete mode 100644 src/core/schemas/builders/primitives/number.ts delete mode 100644 src/core/schemas/builders/primitives/string.ts delete mode 100644 src/core/schemas/builders/primitives/unknown.ts delete mode 100644 src/core/schemas/builders/record/index.ts delete mode 100644 src/core/schemas/builders/record/record.ts delete mode 100644 src/core/schemas/builders/record/types.ts delete mode 100644 src/core/schemas/builders/schema-utils/JsonError.ts delete mode 100644 src/core/schemas/builders/schema-utils/ParseError.ts delete mode 100644 src/core/schemas/builders/schema-utils/getSchemaUtils.ts delete mode 100644 src/core/schemas/builders/schema-utils/index.ts delete mode 100644 src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts delete mode 100644 src/core/schemas/builders/set/index.ts delete mode 100644 src/core/schemas/builders/set/set.ts delete mode 100644 src/core/schemas/builders/undiscriminated-union/index.ts delete mode 100644 src/core/schemas/builders/undiscriminated-union/types.ts delete mode 100644 src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts delete mode 100644 src/core/schemas/builders/union/discriminant.ts delete mode 100644 src/core/schemas/builders/union/index.ts delete mode 100644 src/core/schemas/builders/union/types.ts delete mode 100644 src/core/schemas/builders/union/union.ts delete mode 100644 src/core/schemas/index.ts delete mode 100644 src/core/schemas/utils/MaybePromise.ts delete mode 100644 src/core/schemas/utils/addQuestionMarksToNullableProperties.ts delete mode 100644 src/core/schemas/utils/createIdentitySchemaCreator.ts delete mode 100644 src/core/schemas/utils/entries.ts delete mode 100644 src/core/schemas/utils/filterObject.ts delete mode 100644 src/core/schemas/utils/getErrorMessageForIncorrectType.ts delete mode 100644 src/core/schemas/utils/isPlainObject.ts delete mode 100644 src/core/schemas/utils/keys.ts delete mode 100644 src/core/schemas/utils/maybeSkipValidation.ts delete mode 100644 src/core/schemas/utils/partition.ts delete mode 100644 src/serialization/index.ts delete mode 100644 src/serialization/resources/accounts/client/index.ts delete mode 100644 src/serialization/resources/accounts/client/requests/CreateAccountOpts.ts delete mode 100644 src/serialization/resources/accounts/client/requests/index.ts delete mode 100644 src/serialization/resources/accounts/index.ts delete mode 100644 src/serialization/resources/actions/client/index.ts delete mode 100644 src/serialization/resources/actions/client/requests/RunActionOpts.ts delete mode 100644 src/serialization/resources/actions/client/requests/index.ts delete mode 100644 src/serialization/resources/actions/index.ts delete mode 100644 src/serialization/resources/apps/index.ts delete mode 100644 src/serialization/resources/apps/types/AppsListRequestSortDirection.ts delete mode 100644 src/serialization/resources/apps/types/AppsListRequestSortKey.ts delete mode 100644 src/serialization/resources/apps/types/index.ts delete mode 100644 src/serialization/resources/deployedTriggers/client/index.ts delete mode 100644 src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerOpts.ts delete mode 100644 src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerWebhooksOpts.ts delete mode 100644 src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerWorkflowsOpts.ts delete mode 100644 src/serialization/resources/deployedTriggers/client/requests/index.ts delete mode 100644 src/serialization/resources/deployedTriggers/index.ts delete mode 100644 src/serialization/resources/index.ts delete mode 100644 src/serialization/resources/oauthTokens/client/index.ts delete mode 100644 src/serialization/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts delete mode 100644 src/serialization/resources/oauthTokens/client/requests/index.ts delete mode 100644 src/serialization/resources/oauthTokens/index.ts delete mode 100644 src/serialization/resources/proxy/client/index.ts delete mode 100644 src/serialization/resources/proxy/client/patch.ts delete mode 100644 src/serialization/resources/proxy/client/post.ts delete mode 100644 src/serialization/resources/proxy/client/put.ts delete mode 100644 src/serialization/resources/proxy/index.ts delete mode 100644 src/serialization/resources/tokens/client/index.ts delete mode 100644 src/serialization/resources/tokens/client/requests/CreateTokenOpts.ts delete mode 100644 src/serialization/resources/tokens/client/requests/index.ts delete mode 100644 src/serialization/resources/tokens/index.ts delete mode 100644 src/serialization/resources/triggers/client/index.ts delete mode 100644 src/serialization/resources/triggers/client/requests/DeployTriggerOpts.ts delete mode 100644 src/serialization/resources/triggers/client/requests/index.ts delete mode 100644 src/serialization/resources/triggers/index.ts delete mode 100644 src/serialization/types/Account.ts delete mode 100644 src/serialization/types/App.ts delete mode 100644 src/serialization/types/AppAuthType.ts delete mode 100644 src/serialization/types/AppCategory.ts delete mode 100644 src/serialization/types/BackendClientOpts.ts delete mode 100644 src/serialization/types/ClientOpts.ts delete mode 100644 src/serialization/types/Component.ts delete mode 100644 src/serialization/types/ComponentStash.ts delete mode 100644 src/serialization/types/ConfigurableProp.ts delete mode 100644 src/serialization/types/ConfigurablePropAirtableBaseId.ts delete mode 100644 src/serialization/types/ConfigurablePropAirtableFieldId.ts delete mode 100644 src/serialization/types/ConfigurablePropAirtableTableId.ts delete mode 100644 src/serialization/types/ConfigurablePropAirtableViewId.ts delete mode 100644 src/serialization/types/ConfigurablePropAlert.ts delete mode 100644 src/serialization/types/ConfigurablePropAlertType.ts delete mode 100644 src/serialization/types/ConfigurablePropAny.ts delete mode 100644 src/serialization/types/ConfigurablePropApp.ts delete mode 100644 src/serialization/types/ConfigurablePropApphook.ts delete mode 100644 src/serialization/types/ConfigurablePropBoolean.ts delete mode 100644 src/serialization/types/ConfigurablePropDb.ts delete mode 100644 src/serialization/types/ConfigurablePropDiscord.ts delete mode 100644 src/serialization/types/ConfigurablePropDiscordChannel.ts delete mode 100644 src/serialization/types/ConfigurablePropDiscordChannelArray.ts delete mode 100644 src/serialization/types/ConfigurablePropHttp.ts delete mode 100644 src/serialization/types/ConfigurablePropInteger.ts delete mode 100644 src/serialization/types/ConfigurablePropIntegerArray.ts delete mode 100644 src/serialization/types/ConfigurablePropObject.ts delete mode 100644 src/serialization/types/ConfigurablePropSql.ts delete mode 100644 src/serialization/types/ConfigurablePropSqlAuth.ts delete mode 100644 src/serialization/types/ConfigurablePropString.ts delete mode 100644 src/serialization/types/ConfigurablePropStringArray.ts delete mode 100644 src/serialization/types/ConfigurablePropTimer.ts delete mode 100644 src/serialization/types/ConfigurablePropTimerDefault.ts delete mode 100644 src/serialization/types/ConfigurablePropTimerOption.ts delete mode 100644 src/serialization/types/ConfigurablePropTimerStatic.ts delete mode 100644 src/serialization/types/ConfigurePropOpts.ts delete mode 100644 src/serialization/types/ConfigurePropResponse.ts delete mode 100644 src/serialization/types/ConnectToken.ts delete mode 100644 src/serialization/types/CreateOAuthTokenResponse.ts delete mode 100644 src/serialization/types/CreateTokenResponse.ts delete mode 100644 src/serialization/types/DeleteTriggerOpts.ts delete mode 100644 src/serialization/types/DeployTriggerResponse.ts delete mode 100644 src/serialization/types/DeployedComponent.ts delete mode 100644 src/serialization/types/EmittedEvent.ts delete mode 100644 src/serialization/types/ErrorResponse.ts delete mode 100644 src/serialization/types/GetAccountsResponse.ts delete mode 100644 src/serialization/types/GetAppCategoryResponse.ts delete mode 100644 src/serialization/types/GetAppResponse.ts delete mode 100644 src/serialization/types/GetAppsResponse.ts delete mode 100644 src/serialization/types/GetComponentResponse.ts delete mode 100644 src/serialization/types/GetComponentsResponse.ts delete mode 100644 src/serialization/types/GetTriggerEventsResponse.ts delete mode 100644 src/serialization/types/GetTriggerResponse.ts delete mode 100644 src/serialization/types/GetTriggerWebhooksResponse.ts delete mode 100644 src/serialization/types/GetTriggerWorkflowsResponse.ts delete mode 100644 src/serialization/types/GetTriggersResponse.ts delete mode 100644 src/serialization/types/ListAccountsResponse.ts delete mode 100644 src/serialization/types/ListAppCategoriesResponse.ts delete mode 100644 src/serialization/types/ListAppsResponse.ts delete mode 100644 src/serialization/types/PageInfo.ts delete mode 100644 src/serialization/types/ProjectEnvironment.ts delete mode 100644 src/serialization/types/ProjectInfoResponse.ts delete mode 100644 src/serialization/types/ProjectInfoResponseApp.ts delete mode 100644 src/serialization/types/PropOption.ts delete mode 100644 src/serialization/types/ProxyResponse.ts delete mode 100644 src/serialization/types/ReloadPropsOpts.ts delete mode 100644 src/serialization/types/ReloadPropsResponse.ts delete mode 100644 src/serialization/types/RunActionOptsStashId.ts delete mode 100644 src/serialization/types/RunActionResponse.ts delete mode 100644 src/serialization/types/StartConnectOpts.ts delete mode 100644 src/serialization/types/StashId.ts delete mode 100644 src/serialization/types/TimerCron.ts delete mode 100644 src/serialization/types/TimerInterval.ts delete mode 100644 src/serialization/types/ValidateTokenResponse.ts delete mode 100644 src/serialization/types/index.ts delete mode 100644 tests/unit/schemas/bigint/bigint.test.ts delete mode 100644 tests/unit/schemas/date/date.test.ts delete mode 100644 tests/unit/schemas/enum/enum.test.ts delete mode 100644 tests/unit/schemas/lazy/lazy.test.ts delete mode 100644 tests/unit/schemas/lazy/lazyObject.test.ts delete mode 100644 tests/unit/schemas/lazy/recursive/a.ts delete mode 100644 tests/unit/schemas/lazy/recursive/b.ts delete mode 100644 tests/unit/schemas/list/list.test.ts delete mode 100644 tests/unit/schemas/literals/stringLiteral.test.ts delete mode 100644 tests/unit/schemas/object-like/withParsedProperties.test.ts delete mode 100644 tests/unit/schemas/object/extend.test.ts delete mode 100644 tests/unit/schemas/object/object.test.ts delete mode 100644 tests/unit/schemas/object/objectWithoutOptionalProperties.test.ts delete mode 100644 tests/unit/schemas/object/passthrough.test.ts delete mode 100644 tests/unit/schemas/primitives/any.test.ts delete mode 100644 tests/unit/schemas/primitives/boolean.test.ts delete mode 100644 tests/unit/schemas/primitives/number.test.ts delete mode 100644 tests/unit/schemas/primitives/string.test.ts delete mode 100644 tests/unit/schemas/primitives/unknown.test.ts delete mode 100644 tests/unit/schemas/record/record.test.ts delete mode 100644 tests/unit/schemas/schema-utils/getSchemaUtils.test.ts delete mode 100644 tests/unit/schemas/schema.test.ts delete mode 100644 tests/unit/schemas/set/set.test.ts delete mode 100644 tests/unit/schemas/skipValidation.test.ts delete mode 100644 tests/unit/schemas/undiscriminated-union/undiscriminatedUnion.test.ts delete mode 100644 tests/unit/schemas/union/union.test.ts delete mode 100644 tests/unit/schemas/utils/itSchema.ts delete mode 100644 tests/unit/schemas/utils/itValidate.ts diff --git a/README.md b/README.md index ab873b5..bde45ae 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ const client = new PipedreamClient({ }); await client.actions.run({ id: "id", - externalUserId: "external_user_id", + external_user_id: "external_user_id", }); ``` diff --git a/src/Client.ts b/src/Client.ts index d82f66e..1381475 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -51,7 +51,7 @@ export declare namespace PipedreamClient { export class PipedreamClient { protected readonly _options: PipedreamClient.Options; - protected readonly _oauthTokenProvider: core.OAuthTokenProvider; + private readonly _oauthTokenProvider: core.OAuthTokenProvider; protected _appCategories: AppCategories | undefined; protected _apps: Apps | undefined; protected _accounts: Accounts | undefined; @@ -73,8 +73,8 @@ export class PipedreamClient { "x-pd-environment": _options?.projectEnvironment, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@pipedream/sdk", - "X-Fern-SDK-Version": "2.0.0-rc.8", - "User-Agent": "@pipedream/sdk/2.0.0-rc.8", + "X-Fern-SDK-Version": "2.0.0", + "User-Agent": "@pipedream/sdk/2.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/accounts/client/Client.ts b/src/api/resources/accounts/client/Client.ts index e0297e9..965a0d2 100644 --- a/src/api/resources/accounts/client/Client.ts +++ b/src/api/resources/accounts/client/Client.ts @@ -6,7 +6,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; export declare namespace Accounts { @@ -60,7 +59,15 @@ export class Accounts { async ( request: Pipedream.AccountsListRequest, ): Promise> => { - const { appId, externalUserId, oauthAppId, after, before, limit, includeCredentials } = request; + const { + app_id: appId, + external_user_id: externalUserId, + oauth_app_id: oauthAppId, + after, + before, + limit, + include_credentials: includeCredentials, + } = request; const _queryParams: Record = {}; if (appId != null) { _queryParams["app_id"] = appId; @@ -107,13 +114,7 @@ export class Accounts { }); if (_response.ok) { return { - data: serializers.ListAccountsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), + data: _response.body as Pipedream.ListAccountsResponse, rawResponse: _response.rawResponse, }; } @@ -148,11 +149,11 @@ export class Accounts { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.page_info?.end_cursor != null && + !(typeof response?.page_info?.end_cursor === "string" && response?.page_info?.end_cursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.page_info?.end_cursor)); }, }); } @@ -163,9 +164,9 @@ export class Accounts { * * @example * await client.accounts.create({ - * appSlug: "app_slug", - * cfmapJson: "cfmap_json", - * connectToken: "connect_token" + * app_slug: "app_slug", + * cfmap_json: "cfmap_json", + * connect_token: "connect_token" * }) */ public create( @@ -179,7 +180,7 @@ export class Accounts { request: Pipedream.CreateAccountOpts, requestOptions?: Accounts.RequestOptions, ): Promise> { - const { appId, externalUserId, oauthAppId, ..._body } = request; + const { app_id: appId, external_user_id: externalUserId, oauth_app_id: oauthAppId, ..._body } = request; const _queryParams: Record = {}; if (appId != null) { _queryParams["app_id"] = appId; @@ -212,25 +213,13 @@ export class Accounts { contentType: "application/json", queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", - body: serializers.CreateAccountOpts.jsonOrThrow(_body, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.Account.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.Account, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -281,7 +270,7 @@ export class Accounts { request: Pipedream.AccountsRetrieveRequest = {}, requestOptions?: Accounts.RequestOptions, ): Promise> { - const { includeCredentials } = request; + const { include_credentials: includeCredentials } = request; const _queryParams: Record = {}; if (includeCredentials != null) { _queryParams["include_credentials"] = includeCredentials.toString(); @@ -309,16 +298,7 @@ export class Accounts { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.Account.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.Account, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/accounts/client/requests/AccountsListRequest.ts b/src/api/resources/accounts/client/requests/AccountsListRequest.ts index c34a809..972da44 100644 --- a/src/api/resources/accounts/client/requests/AccountsListRequest.ts +++ b/src/api/resources/accounts/client/requests/AccountsListRequest.ts @@ -10,12 +10,12 @@ export interface AccountsListRequest { /** * The app slug or ID to filter accounts by. */ - appId?: string; - externalUserId?: string; + app_id?: string; + external_user_id?: string; /** * The OAuth app ID to filter by, if applicable */ - oauthAppId?: string; + oauth_app_id?: string; /** * The cursor to start from for pagination */ @@ -31,5 +31,5 @@ export interface AccountsListRequest { /** * Whether to retrieve the account's credentials or not */ - includeCredentials?: boolean; + include_credentials?: boolean; } diff --git a/src/api/resources/accounts/client/requests/AccountsRetrieveRequest.ts b/src/api/resources/accounts/client/requests/AccountsRetrieveRequest.ts index 76f6d52..a00013a 100644 --- a/src/api/resources/accounts/client/requests/AccountsRetrieveRequest.ts +++ b/src/api/resources/accounts/client/requests/AccountsRetrieveRequest.ts @@ -10,5 +10,5 @@ export interface AccountsRetrieveRequest { /** * Whether to retrieve the account's credentials or not */ - includeCredentials?: boolean; + include_credentials?: boolean; } diff --git a/src/api/resources/accounts/client/requests/CreateAccountOpts.ts b/src/api/resources/accounts/client/requests/CreateAccountOpts.ts index abfd33e..96f35e7 100644 --- a/src/api/resources/accounts/client/requests/CreateAccountOpts.ts +++ b/src/api/resources/accounts/client/requests/CreateAccountOpts.ts @@ -5,27 +5,27 @@ /** * @example * { - * appSlug: "app_slug", - * cfmapJson: "cfmap_json", - * connectToken: "connect_token" + * app_slug: "app_slug", + * cfmap_json: "cfmap_json", + * connect_token: "connect_token" * } */ export interface CreateAccountOpts { /** * The app slug or ID to filter accounts by. */ - appId?: string; - externalUserId?: string; + app_id?: string; + external_user_id?: string; /** * The OAuth app ID to filter by, if applicable */ - oauthAppId?: string; + oauth_app_id?: string; /** The app slug for the account */ - appSlug: string; + app_slug: string; /** JSON string containing the custom fields mapping */ - cfmapJson: string; + cfmap_json: string; /** The connect token for authentication */ - connectToken: string; + connect_token: string; /** Optional name for the account */ name?: string; } diff --git a/src/api/resources/actions/client/Client.ts b/src/api/resources/actions/client/Client.ts index d45bca5..4497520 100644 --- a/src/api/resources/actions/client/Client.ts +++ b/src/api/resources/actions/client/Client.ts @@ -6,7 +6,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; export declare namespace Actions { @@ -101,13 +100,7 @@ export class Actions { }); if (_response.ok) { return { - data: serializers.GetComponentsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), + data: _response.body as Pipedream.GetComponentsResponse, rawResponse: _response.rawResponse, }; } @@ -142,11 +135,11 @@ export class Actions { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.page_info?.end_cursor != null && + !(typeof response?.page_info?.end_cursor === "string" && response?.page_info?.end_cursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.page_info?.end_cursor)); }, }); } @@ -191,16 +184,7 @@ export class Actions { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetComponentResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetComponentResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -231,27 +215,30 @@ export class Actions { } /** - * @param {Pipedream.ConfigurePropOpts} request + * @param {Pipedream.ActionsConfigurePropRequest} request * @param {Actions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.actions.configureProp({ - * id: "id", - * externalUserId: "external_user_id", - * propName: "prop_name" + * body: { + * id: "id", + * external_user_id: "external_user_id", + * prop_name: "prop_name" + * } * }) */ public configureProp( - request: Pipedream.ConfigurePropOpts, + request: Pipedream.ActionsConfigurePropRequest, requestOptions?: Actions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__configureProp(request, requestOptions)); } private async __configureProp( - request: Pipedream.ConfigurePropOpts, + request: Pipedream.ActionsConfigurePropRequest, requestOptions?: Actions.RequestOptions, ): Promise> { + const { "x-async-handle": asyncHandle, body: _body } = request; const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -264,6 +251,7 @@ export class Actions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), + "x-async-handle": asyncHandle != null ? asyncHandle : undefined, "x-pd-environment": requestOptions?.projectEnvironment, }), requestOptions?.headers, @@ -271,25 +259,13 @@ export class Actions { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.ConfigurePropOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ConfigurePropResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ConfigurePropResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -320,26 +296,29 @@ export class Actions { } /** - * @param {Pipedream.ReloadPropsOpts} request + * @param {Pipedream.ActionsReloadPropsRequest} request * @param {Actions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.actions.reloadProps({ - * id: "id", - * externalUserId: "external_user_id" + * body: { + * id: "id", + * external_user_id: "external_user_id" + * } * }) */ public reloadProps( - request: Pipedream.ReloadPropsOpts, + request: Pipedream.ActionsReloadPropsRequest, requestOptions?: Actions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__reloadProps(request, requestOptions)); } private async __reloadProps( - request: Pipedream.ReloadPropsOpts, + request: Pipedream.ActionsReloadPropsRequest, requestOptions?: Actions.RequestOptions, ): Promise> { + const { "x-async-handle": asyncHandle, body: _body } = request; const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -352,6 +331,7 @@ export class Actions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), + "x-async-handle": asyncHandle != null ? asyncHandle : undefined, "x-pd-environment": requestOptions?.projectEnvironment, }), requestOptions?.headers, @@ -359,25 +339,13 @@ export class Actions { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.ReloadPropsOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ReloadPropsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ReloadPropsResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -414,7 +382,7 @@ export class Actions { * @example * await client.actions.run({ * id: "id", - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public run( @@ -428,6 +396,7 @@ export class Actions { request: Pipedream.RunActionOpts, requestOptions?: Actions.RequestOptions, ): Promise> { + const { "x-async-handle": asyncHandle, ..._body } = request; const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -440,6 +409,7 @@ export class Actions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), + "x-async-handle": asyncHandle != null ? asyncHandle : undefined, "x-pd-environment": requestOptions?.projectEnvironment, }), requestOptions?.headers, @@ -447,25 +417,13 @@ export class Actions { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.RunActionOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.RunActionResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.RunActionResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/actions/client/requests/ActionsConfigurePropRequest.ts b/src/api/resources/actions/client/requests/ActionsConfigurePropRequest.ts new file mode 100644 index 0000000..7f1ccbf --- /dev/null +++ b/src/api/resources/actions/client/requests/ActionsConfigurePropRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../../../../index.js"; + +/** + * @example + * { + * body: { + * id: "id", + * external_user_id: "external_user_id", + * prop_name: "prop_name" + * } + * } + */ +export interface ActionsConfigurePropRequest { + "x-async-handle"?: string; + body: Pipedream.ConfigurePropOpts; +} diff --git a/src/api/resources/actions/client/requests/ActionsReloadPropsRequest.ts b/src/api/resources/actions/client/requests/ActionsReloadPropsRequest.ts new file mode 100644 index 0000000..dedfc84 --- /dev/null +++ b/src/api/resources/actions/client/requests/ActionsReloadPropsRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../../../../index.js"; + +/** + * @example + * { + * body: { + * id: "id", + * external_user_id: "external_user_id" + * } + * } + */ +export interface ActionsReloadPropsRequest { + "x-async-handle"?: string; + body: Pipedream.ReloadPropsOpts; +} diff --git a/src/api/resources/actions/client/requests/RunActionOpts.ts b/src/api/resources/actions/client/requests/RunActionOpts.ts index 65a0256..7f8a051 100644 --- a/src/api/resources/actions/client/requests/RunActionOpts.ts +++ b/src/api/resources/actions/client/requests/RunActionOpts.ts @@ -2,23 +2,21 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Pipedream from "../../../../index.js"; - /** * @example * { * id: "id", - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface RunActionOpts { + "x-async-handle"?: string; /** The action component ID */ id: string; /** The external user ID */ - externalUserId: string; + external_user_id: string; /** The configured properties for the action */ - configuredProps?: Record; + configured_props?: Record; /** The ID for dynamic props */ - dynamicPropsId?: string; - stashId?: Pipedream.RunActionOptsStashId; + dynamic_props_id?: string; } diff --git a/src/api/resources/actions/client/requests/index.ts b/src/api/resources/actions/client/requests/index.ts index f313388..3383535 100644 --- a/src/api/resources/actions/client/requests/index.ts +++ b/src/api/resources/actions/client/requests/index.ts @@ -1,2 +1,4 @@ export { type ActionsListRequest } from "./ActionsListRequest.js"; +export { type ActionsConfigurePropRequest } from "./ActionsConfigurePropRequest.js"; +export { type ActionsReloadPropsRequest } from "./ActionsReloadPropsRequest.js"; export { type RunActionOpts } from "./RunActionOpts.js"; diff --git a/src/api/resources/appCategories/client/Client.ts b/src/api/resources/appCategories/client/Client.ts index fa48e49..ee1e5a7 100644 --- a/src/api/resources/appCategories/client/Client.ts +++ b/src/api/resources/appCategories/client/Client.ts @@ -6,7 +6,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; export declare namespace AppCategories { @@ -82,16 +81,7 @@ export class AppCategories { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ListAppCategoriesResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ListAppCategoriesResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -159,16 +149,7 @@ export class AppCategories { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetAppCategoryResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetAppCategoryResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/apps/client/Client.ts b/src/api/resources/apps/client/Client.ts index e83fcc3..b04f5df 100644 --- a/src/api/resources/apps/client/Client.ts +++ b/src/api/resources/apps/client/Client.ts @@ -5,7 +5,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; -import * as serializers from "../../../../serialization/index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as errors from "../../../../errors/index.js"; @@ -58,7 +57,15 @@ export class Apps { ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async (request: Pipedream.AppsListRequest): Promise> => { - const { after, before, limit, q, sortKey, sortDirection, categoryIds } = request; + const { + after, + before, + limit, + q, + sort_key: sortKey, + sort_direction: sortDirection, + category_ids: categoryIds, + } = request; const _queryParams: Record = {}; if (after != null) { _queryParams["after"] = after; @@ -73,16 +80,10 @@ export class Apps { _queryParams["q"] = q; } if (sortKey != null) { - _queryParams["sort_key"] = serializers.AppsListRequestSortKey.jsonOrThrow(sortKey, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }); + _queryParams["sort_key"] = sortKey; } if (sortDirection != null) { - _queryParams["sort_direction"] = serializers.AppsListRequestSortDirection.jsonOrThrow( - sortDirection, - { unrecognizedObjectKeys: "strip", omitUndefined: true }, - ); + _queryParams["sort_direction"] = sortDirection; } if (categoryIds != null) { if (Array.isArray(categoryIds)) { @@ -114,16 +115,7 @@ export class Apps { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ListAppsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ListAppsResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { throw new errors.PipedreamError({ @@ -154,11 +146,11 @@ export class Apps { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.page_info?.end_cursor != null && + !(typeof response?.page_info?.end_cursor === "string" && response?.page_info?.end_cursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.page_info?.end_cursor)); }, }); } @@ -203,16 +195,7 @@ export class Apps { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetAppResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetAppResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/apps/client/requests/AppsListRequest.ts b/src/api/resources/apps/client/requests/AppsListRequest.ts index 72a715b..c2cc008 100644 --- a/src/api/resources/apps/client/requests/AppsListRequest.ts +++ b/src/api/resources/apps/client/requests/AppsListRequest.ts @@ -28,13 +28,13 @@ export interface AppsListRequest { /** * The key to sort the apps by */ - sortKey?: Pipedream.AppsListRequestSortKey; + sort_key?: Pipedream.AppsListRequestSortKey; /** * The direction to sort the apps */ - sortDirection?: Pipedream.AppsListRequestSortDirection; + sort_direction?: Pipedream.AppsListRequestSortDirection; /** * Only return apps in these categories */ - categoryIds?: string | string[]; + category_ids?: string | string[]; } diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts index 7cdd615..cbe5f52 100644 --- a/src/api/resources/components/client/Client.ts +++ b/src/api/resources/components/client/Client.ts @@ -6,7 +6,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; export declare namespace Components { @@ -101,13 +100,7 @@ export class Components { }); if (_response.ok) { return { - data: serializers.GetComponentsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), + data: _response.body as Pipedream.GetComponentsResponse, rawResponse: _response.rawResponse, }; } @@ -142,11 +135,11 @@ export class Components { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.page_info?.end_cursor != null && + !(typeof response?.page_info?.end_cursor === "string" && response?.page_info?.end_cursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.page_info?.end_cursor)); }, }); } @@ -191,16 +184,7 @@ export class Components { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetComponentResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetComponentResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -231,27 +215,30 @@ export class Components { } /** - * @param {Pipedream.ConfigurePropOpts} request + * @param {Pipedream.ComponentsConfigurePropRequest} request * @param {Components.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.components.configureProp({ - * id: "id", - * externalUserId: "external_user_id", - * propName: "prop_name" + * body: { + * id: "id", + * external_user_id: "external_user_id", + * prop_name: "prop_name" + * } * }) */ public configureProp( - request: Pipedream.ConfigurePropOpts, + request: Pipedream.ComponentsConfigurePropRequest, requestOptions?: Components.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__configureProp(request, requestOptions)); } private async __configureProp( - request: Pipedream.ConfigurePropOpts, + request: Pipedream.ComponentsConfigurePropRequest, requestOptions?: Components.RequestOptions, ): Promise> { + const { "x-async-handle": asyncHandle, body: _body } = request; const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -264,6 +251,7 @@ export class Components { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), + "x-async-handle": asyncHandle != null ? asyncHandle : undefined, "x-pd-environment": requestOptions?.projectEnvironment, }), requestOptions?.headers, @@ -271,25 +259,13 @@ export class Components { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.ConfigurePropOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ConfigurePropResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ConfigurePropResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -320,26 +296,29 @@ export class Components { } /** - * @param {Pipedream.ReloadPropsOpts} request + * @param {Pipedream.ComponentsReloadPropsRequest} request * @param {Components.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.components.reloadProps({ - * id: "id", - * externalUserId: "external_user_id" + * body: { + * id: "id", + * external_user_id: "external_user_id" + * } * }) */ public reloadProps( - request: Pipedream.ReloadPropsOpts, + request: Pipedream.ComponentsReloadPropsRequest, requestOptions?: Components.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__reloadProps(request, requestOptions)); } private async __reloadProps( - request: Pipedream.ReloadPropsOpts, + request: Pipedream.ComponentsReloadPropsRequest, requestOptions?: Components.RequestOptions, ): Promise> { + const { "x-async-handle": asyncHandle, body: _body } = request; const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -352,6 +331,7 @@ export class Components { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), + "x-async-handle": asyncHandle != null ? asyncHandle : undefined, "x-pd-environment": requestOptions?.projectEnvironment, }), requestOptions?.headers, @@ -359,25 +339,13 @@ export class Components { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.ReloadPropsOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ReloadPropsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ReloadPropsResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/components/client/requests/ComponentsConfigurePropRequest.ts b/src/api/resources/components/client/requests/ComponentsConfigurePropRequest.ts new file mode 100644 index 0000000..eb628ae --- /dev/null +++ b/src/api/resources/components/client/requests/ComponentsConfigurePropRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../../../../index.js"; + +/** + * @example + * { + * body: { + * id: "id", + * external_user_id: "external_user_id", + * prop_name: "prop_name" + * } + * } + */ +export interface ComponentsConfigurePropRequest { + "x-async-handle"?: string; + body: Pipedream.ConfigurePropOpts; +} diff --git a/src/api/resources/components/client/requests/ComponentsReloadPropsRequest.ts b/src/api/resources/components/client/requests/ComponentsReloadPropsRequest.ts new file mode 100644 index 0000000..293a138 --- /dev/null +++ b/src/api/resources/components/client/requests/ComponentsReloadPropsRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../../../../index.js"; + +/** + * @example + * { + * body: { + * id: "id", + * external_user_id: "external_user_id" + * } + * } + */ +export interface ComponentsReloadPropsRequest { + "x-async-handle"?: string; + body: Pipedream.ReloadPropsOpts; +} diff --git a/src/api/resources/components/client/requests/index.ts b/src/api/resources/components/client/requests/index.ts index eca4b1b..97a9657 100644 --- a/src/api/resources/components/client/requests/index.ts +++ b/src/api/resources/components/client/requests/index.ts @@ -1 +1,3 @@ export { type ComponentsListRequest } from "./ComponentsListRequest.js"; +export { type ComponentsConfigurePropRequest } from "./ComponentsConfigurePropRequest.js"; +export { type ComponentsReloadPropsRequest } from "./ComponentsReloadPropsRequest.js"; diff --git a/src/api/resources/deployedTriggers/client/Client.ts b/src/api/resources/deployedTriggers/client/Client.ts index 3f6fd2f..fddfcee 100644 --- a/src/api/resources/deployedTriggers/client/Client.ts +++ b/src/api/resources/deployedTriggers/client/Client.ts @@ -6,7 +6,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; export declare namespace DeployedTriggers { @@ -51,7 +50,7 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.list({ - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public async list( @@ -62,7 +61,7 @@ export class DeployedTriggers { async ( request: Pipedream.DeployedTriggersListRequest, ): Promise> => { - const { after, before, limit, externalUserId } = request; + const { after, before, limit, external_user_id: externalUserId } = request; const _queryParams: Record = {}; if (after != null) { _queryParams["after"] = after; @@ -98,13 +97,7 @@ export class DeployedTriggers { }); if (_response.ok) { return { - data: serializers.GetTriggersResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), + data: _response.body as Pipedream.GetTriggersResponse, rawResponse: _response.rawResponse, }; } @@ -139,11 +132,11 @@ export class DeployedTriggers { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.page_info?.end_cursor != null && + !(typeof response?.page_info?.end_cursor === "string" && response?.page_info?.end_cursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.page_info?.end_cursor)); }, }); } @@ -155,7 +148,7 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.retrieve("trigger_id", { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public retrieve( @@ -171,7 +164,7 @@ export class DeployedTriggers { request: Pipedream.DeployedTriggersRetrieveRequest, requestOptions?: DeployedTriggers.RequestOptions, ): Promise> { - const { externalUserId } = request; + const { external_user_id: externalUserId } = request; const _queryParams: Record = {}; _queryParams["external_user_id"] = externalUserId; const _response = await core.fetcher({ @@ -196,16 +189,7 @@ export class DeployedTriggers { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetTriggerResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetTriggerResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -242,7 +226,7 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.update("trigger_id", { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public update( @@ -258,7 +242,7 @@ export class DeployedTriggers { request: Pipedream.UpdateTriggerOpts, requestOptions?: DeployedTriggers.RequestOptions, ): Promise> { - const { externalUserId, ..._body } = request; + const { external_user_id: externalUserId, ..._body } = request; const _queryParams: Record = {}; _queryParams["external_user_id"] = externalUserId; const _response = await core.fetcher({ @@ -280,25 +264,13 @@ export class DeployedTriggers { contentType: "application/json", queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", - body: serializers.UpdateTriggerOpts.jsonOrThrow(_body, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetTriggerResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetTriggerResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -335,7 +307,7 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.delete("trigger_id", { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public delete( @@ -351,7 +323,7 @@ export class DeployedTriggers { request: Pipedream.DeployedTriggersDeleteRequest, requestOptions?: DeployedTriggers.RequestOptions, ): Promise> { - const { externalUserId, ignoreHookErrors } = request; + const { external_user_id: externalUserId, ignore_hook_errors: ignoreHookErrors } = request; const _queryParams: Record = {}; _queryParams["external_user_id"] = externalUserId; if (ignoreHookErrors != null) { @@ -417,7 +389,7 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.listEvents("trigger_id", { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public listEvents( @@ -433,7 +405,7 @@ export class DeployedTriggers { request: Pipedream.DeployedTriggersListEventsRequest, requestOptions?: DeployedTriggers.RequestOptions, ): Promise> { - const { externalUserId, n } = request; + const { external_user_id: externalUserId, n } = request; const _queryParams: Record = {}; _queryParams["external_user_id"] = externalUserId; if (n != null) { @@ -462,16 +434,7 @@ export class DeployedTriggers { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetTriggerEventsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetTriggerEventsResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -508,7 +471,7 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.listWorkflows("trigger_id", { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public listWorkflows( @@ -524,7 +487,7 @@ export class DeployedTriggers { request: Pipedream.DeployedTriggersListWorkflowsRequest, requestOptions?: DeployedTriggers.RequestOptions, ): Promise> { - const { externalUserId } = request; + const { external_user_id: externalUserId } = request; const _queryParams: Record = {}; _queryParams["external_user_id"] = externalUserId; const _response = await core.fetcher({ @@ -550,13 +513,7 @@ export class DeployedTriggers { }); if (_response.ok) { return { - data: serializers.GetTriggerWorkflowsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), + data: _response.body as Pipedream.GetTriggerWorkflowsResponse, rawResponse: _response.rawResponse, }; } @@ -595,8 +552,8 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.updateWorkflows("trigger_id", { - * externalUserId: "external_user_id", - * workflowIds: ["workflow_ids"] + * external_user_id: "external_user_id", + * workflow_ids: ["workflow_ids"] * }) */ public updateWorkflows( @@ -612,7 +569,7 @@ export class DeployedTriggers { request: Pipedream.UpdateTriggerWorkflowsOpts, requestOptions?: DeployedTriggers.RequestOptions, ): Promise> { - const { externalUserId, ..._body } = request; + const { external_user_id: externalUserId, ..._body } = request; const _queryParams: Record = {}; _queryParams["external_user_id"] = externalUserId; const _response = await core.fetcher({ @@ -634,23 +591,14 @@ export class DeployedTriggers { contentType: "application/json", queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", - body: serializers.UpdateTriggerWorkflowsOpts.jsonOrThrow(_body, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return { - data: serializers.GetTriggerWorkflowsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), + data: _response.body as Pipedream.GetTriggerWorkflowsResponse, rawResponse: _response.rawResponse, }; } @@ -689,7 +637,7 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.listWebhooks("trigger_id", { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public listWebhooks( @@ -705,7 +653,7 @@ export class DeployedTriggers { request: Pipedream.DeployedTriggersListWebhooksRequest, requestOptions?: DeployedTriggers.RequestOptions, ): Promise> { - const { externalUserId } = request; + const { external_user_id: externalUserId } = request; const _queryParams: Record = {}; _queryParams["external_user_id"] = externalUserId; const _response = await core.fetcher({ @@ -730,16 +678,7 @@ export class DeployedTriggers { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetTriggerWebhooksResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetTriggerWebhooksResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -776,8 +715,8 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.updateWebhooks("trigger_id", { - * externalUserId: "external_user_id", - * webhookUrls: ["webhook_urls"] + * external_user_id: "external_user_id", + * webhook_urls: ["webhook_urls"] * }) */ public updateWebhooks( @@ -793,7 +732,7 @@ export class DeployedTriggers { request: Pipedream.UpdateTriggerWebhooksOpts, requestOptions?: DeployedTriggers.RequestOptions, ): Promise> { - const { externalUserId, ..._body } = request; + const { external_user_id: externalUserId, ..._body } = request; const _queryParams: Record = {}; _queryParams["external_user_id"] = externalUserId; const _response = await core.fetcher({ @@ -815,25 +754,13 @@ export class DeployedTriggers { contentType: "application/json", queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", - body: serializers.UpdateTriggerWebhooksOpts.jsonOrThrow(_body, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetTriggerWebhooksResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetTriggerWebhooksResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersDeleteRequest.ts b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersDeleteRequest.ts index 7816bdf..55dd932 100644 --- a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersDeleteRequest.ts +++ b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersDeleteRequest.ts @@ -5,16 +5,16 @@ /** * @example * { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface DeployedTriggersDeleteRequest { /** * The external user ID who owns the trigger */ - externalUserId: string; + external_user_id: string; /** * Whether to ignore errors during deactivation hook */ - ignoreHookErrors?: boolean; + ignore_hook_errors?: boolean; } diff --git a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListEventsRequest.ts b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListEventsRequest.ts index 1f90f4c..60ead97 100644 --- a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListEventsRequest.ts +++ b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListEventsRequest.ts @@ -5,14 +5,14 @@ /** * @example * { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface DeployedTriggersListEventsRequest { /** * Your end user ID, for whom you deployed the trigger */ - externalUserId: string; + external_user_id: string; /** * The number of events to retrieve (defaults to 20 if not provided) */ diff --git a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListRequest.ts b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListRequest.ts index 0977a01..63c3859 100644 --- a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListRequest.ts +++ b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListRequest.ts @@ -5,7 +5,7 @@ /** * @example * { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface DeployedTriggersListRequest { @@ -24,5 +24,5 @@ export interface DeployedTriggersListRequest { /** * Your end user ID, for whom you deployed the trigger */ - externalUserId: string; + external_user_id: string; } diff --git a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListWebhooksRequest.ts b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListWebhooksRequest.ts index e98e1c8..0372905 100644 --- a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListWebhooksRequest.ts +++ b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListWebhooksRequest.ts @@ -5,12 +5,12 @@ /** * @example * { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface DeployedTriggersListWebhooksRequest { /** * The external user ID who owns the trigger */ - externalUserId: string; + external_user_id: string; } diff --git a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListWorkflowsRequest.ts b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListWorkflowsRequest.ts index 7f88623..3070129 100644 --- a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListWorkflowsRequest.ts +++ b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListWorkflowsRequest.ts @@ -5,12 +5,12 @@ /** * @example * { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface DeployedTriggersListWorkflowsRequest { /** * The external user ID who owns the trigger */ - externalUserId: string; + external_user_id: string; } diff --git a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersRetrieveRequest.ts b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersRetrieveRequest.ts index 8dc7653..e00cb00 100644 --- a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersRetrieveRequest.ts +++ b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersRetrieveRequest.ts @@ -5,12 +5,12 @@ /** * @example * { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface DeployedTriggersRetrieveRequest { /** * Your end user ID, for whom you deployed the trigger */ - externalUserId: string; + external_user_id: string; } diff --git a/src/api/resources/deployedTriggers/client/requests/UpdateTriggerOpts.ts b/src/api/resources/deployedTriggers/client/requests/UpdateTriggerOpts.ts index ebcce55..c40881b 100644 --- a/src/api/resources/deployedTriggers/client/requests/UpdateTriggerOpts.ts +++ b/src/api/resources/deployedTriggers/client/requests/UpdateTriggerOpts.ts @@ -5,18 +5,18 @@ /** * @example * { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface UpdateTriggerOpts { /** * The external user ID who owns the trigger */ - externalUserId: string; + external_user_id: string; /** Whether the trigger should be active */ active?: boolean; /** The configured properties for the trigger */ - configuredProps?: Record; + configured_props?: Record; /** The name of the trigger */ name?: string; } diff --git a/src/api/resources/deployedTriggers/client/requests/UpdateTriggerWebhooksOpts.ts b/src/api/resources/deployedTriggers/client/requests/UpdateTriggerWebhooksOpts.ts index c35755b..bd6421b 100644 --- a/src/api/resources/deployedTriggers/client/requests/UpdateTriggerWebhooksOpts.ts +++ b/src/api/resources/deployedTriggers/client/requests/UpdateTriggerWebhooksOpts.ts @@ -5,15 +5,15 @@ /** * @example * { - * externalUserId: "external_user_id", - * webhookUrls: ["webhook_urls"] + * external_user_id: "external_user_id", + * webhook_urls: ["webhook_urls"] * } */ export interface UpdateTriggerWebhooksOpts { /** * The external user ID who owns the trigger */ - externalUserId: string; + external_user_id: string; /** Array of webhook URLs to set */ - webhookUrls: string[]; + webhook_urls: string[]; } diff --git a/src/api/resources/deployedTriggers/client/requests/UpdateTriggerWorkflowsOpts.ts b/src/api/resources/deployedTriggers/client/requests/UpdateTriggerWorkflowsOpts.ts index 4f006b1..7f05647 100644 --- a/src/api/resources/deployedTriggers/client/requests/UpdateTriggerWorkflowsOpts.ts +++ b/src/api/resources/deployedTriggers/client/requests/UpdateTriggerWorkflowsOpts.ts @@ -5,15 +5,15 @@ /** * @example * { - * externalUserId: "external_user_id", - * workflowIds: ["workflow_ids"] + * external_user_id: "external_user_id", + * workflow_ids: ["workflow_ids"] * } */ export interface UpdateTriggerWorkflowsOpts { /** * The external user ID who owns the trigger */ - externalUserId: string; + external_user_id: string; /** Array of workflow IDs to set */ - workflowIds: string[]; + workflow_ids: string[]; } diff --git a/src/api/resources/oauthTokens/client/Client.ts b/src/api/resources/oauthTokens/client/Client.ts index 93a0169..845dcf7 100644 --- a/src/api/resources/oauthTokens/client/Client.ts +++ b/src/api/resources/oauthTokens/client/Client.ts @@ -6,7 +6,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; export declare namespace OauthTokens { @@ -51,8 +50,8 @@ export class OauthTokens { * * @example * await client.oauthTokens.create({ - * clientId: "client_id", - * clientSecret: "client_secret" + * client_id: "client_id", + * client_secret: "client_secret" * }) */ public create( @@ -85,28 +84,13 @@ export class OauthTokens { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: { - ...serializers.CreateOAuthTokenOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - grant_type: "client_credentials", - }, + body: { ...request, grant_type: "client_credentials" }, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.CreateOAuthTokenResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.CreateOAuthTokenResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts b/src/api/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts index 722d50b..ff4b32f 100644 --- a/src/api/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts +++ b/src/api/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts @@ -5,11 +5,11 @@ /** * @example * { - * clientId: "client_id", - * clientSecret: "client_secret" + * client_id: "client_id", + * client_secret: "client_secret" * } */ export interface CreateOAuthTokenOpts { - clientId: string; - clientSecret: string; + client_id: string; + client_secret: string; } diff --git a/src/api/resources/projects/client/Client.ts b/src/api/resources/projects/client/Client.ts index f13df58..e8946f5 100644 --- a/src/api/resources/projects/client/Client.ts +++ b/src/api/resources/projects/client/Client.ts @@ -6,7 +6,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; export declare namespace Projects { @@ -82,16 +81,7 @@ export class Projects { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ProjectInfoResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ProjectInfoResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/tokens/client/Client.ts b/src/api/resources/tokens/client/Client.ts index 5a841ac..ffa987a 100644 --- a/src/api/resources/tokens/client/Client.ts +++ b/src/api/resources/tokens/client/Client.ts @@ -6,7 +6,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; export declare namespace Tokens { @@ -51,7 +50,7 @@ export class Tokens { * * @example * await client.tokens.create({ - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public create( @@ -84,25 +83,13 @@ export class Tokens { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.CreateTokenOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.CreateTokenResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.CreateTokenResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -133,33 +120,30 @@ export class Tokens { } /** - * @param {Pipedream.ConnectToken} ctok + * @param {string} ctok * @param {Pipedream.TokensValidateRequest} request * @param {Tokens.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.tokens.validate("ctok", { - * appId: "app_id" - * }) + * await client.tokens.validate("ctok") */ public validate( - ctok: Pipedream.ConnectToken, - request: Pipedream.TokensValidateRequest, + ctok: string, + request: Pipedream.TokensValidateRequest = {}, requestOptions?: Tokens.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__validate(ctok, request, requestOptions)); } private async __validate( - ctok: Pipedream.ConnectToken, - request: Pipedream.TokensValidateRequest, + ctok: string, + request: Pipedream.TokensValidateRequest = {}, requestOptions?: Tokens.RequestOptions, ): Promise> { - const { appId, oauthAppId } = request; + const { params } = request; const _queryParams: Record = {}; - _queryParams["app_id"] = appId; - if (oauthAppId != null) { - _queryParams["oauth_app_id"] = oauthAppId; + if (params != null) { + _queryParams["params"] = params; } const _response = await core.fetcher({ @@ -167,7 +151,7 @@ export class Tokens { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.PipedreamEnvironment.Prod, - `v1/connect/tokens/${encodeURIComponent(serializers.ConnectToken.jsonOrThrow(ctok, { omitUndefined: true }))}/validate`, + `v1/connect/${encodeURIComponent(this._options.projectId)}/tokens/${encodeURIComponent(ctok)}/validate`, ), method: "GET", headers: mergeHeaders( @@ -184,16 +168,7 @@ export class Tokens { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ValidateTokenResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ValidateTokenResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -213,7 +188,7 @@ export class Tokens { }); case "timeout": throw new errors.PipedreamTimeoutError( - "Timeout exceeded when calling GET /v1/connect/tokens/{ctok}/validate.", + "Timeout exceeded when calling GET /v1/connect/{project_id}/tokens/{ctok}/validate.", ); case "unknown": throw new errors.PipedreamError({ diff --git a/src/api/resources/tokens/client/requests/CreateTokenOpts.ts b/src/api/resources/tokens/client/requests/CreateTokenOpts.ts index aea48f8..72807f6 100644 --- a/src/api/resources/tokens/client/requests/CreateTokenOpts.ts +++ b/src/api/resources/tokens/client/requests/CreateTokenOpts.ts @@ -5,18 +5,18 @@ /** * @example * { - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface CreateTokenOpts { /** List of allowed origins for CORS */ - allowedOrigins?: string[]; + allowed_origins?: string[]; /** URI to redirect to on error */ - errorRedirectUri?: string; + error_redirect_uri?: string; /** Your end user ID, for whom you're creating the token */ - externalUserId: string; + external_user_id: string; /** URI to redirect to on success */ - successRedirectUri?: string; + success_redirect_uri?: string; /** Webhook URI for notifications */ - webhookUri?: string; + webhook_uri?: string; } diff --git a/src/api/resources/tokens/client/requests/TokensValidateRequest.ts b/src/api/resources/tokens/client/requests/TokensValidateRequest.ts index d1c0cd8..b43cc0d 100644 --- a/src/api/resources/tokens/client/requests/TokensValidateRequest.ts +++ b/src/api/resources/tokens/client/requests/TokensValidateRequest.ts @@ -2,19 +2,12 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Pipedream from "../../../../index.js"; + /** * @example - * { - * appId: "app_id" - * } + * {} */ export interface TokensValidateRequest { - /** - * The app ID to validate against - */ - appId: string; - /** - * The OAuth app ID to validate against (if the token is for an OAuth app) - */ - oauthAppId?: string; + params?: Pipedream.ValidateTokenParams; } diff --git a/src/api/resources/triggers/client/Client.ts b/src/api/resources/triggers/client/Client.ts index 59a4d9a..8872395 100644 --- a/src/api/resources/triggers/client/Client.ts +++ b/src/api/resources/triggers/client/Client.ts @@ -6,7 +6,6 @@ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Pipedream from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; export declare namespace Triggers { @@ -101,13 +100,7 @@ export class Triggers { }); if (_response.ok) { return { - data: serializers.GetComponentsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), + data: _response.body as Pipedream.GetComponentsResponse, rawResponse: _response.rawResponse, }; } @@ -142,11 +135,11 @@ export class Triggers { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.page_info?.end_cursor != null && + !(typeof response?.page_info?.end_cursor === "string" && response?.page_info?.end_cursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.page_info?.end_cursor)); }, }); } @@ -191,16 +184,7 @@ export class Triggers { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.GetComponentResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.GetComponentResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -231,27 +215,30 @@ export class Triggers { } /** - * @param {Pipedream.ConfigurePropOpts} request + * @param {Pipedream.TriggersConfigurePropRequest} request * @param {Triggers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.triggers.configureProp({ - * id: "id", - * externalUserId: "external_user_id", - * propName: "prop_name" + * body: { + * id: "id", + * external_user_id: "external_user_id", + * prop_name: "prop_name" + * } * }) */ public configureProp( - request: Pipedream.ConfigurePropOpts, + request: Pipedream.TriggersConfigurePropRequest, requestOptions?: Triggers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__configureProp(request, requestOptions)); } private async __configureProp( - request: Pipedream.ConfigurePropOpts, + request: Pipedream.TriggersConfigurePropRequest, requestOptions?: Triggers.RequestOptions, ): Promise> { + const { "x-async-handle": asyncHandle, body: _body } = request; const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -264,6 +251,7 @@ export class Triggers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), + "x-async-handle": asyncHandle != null ? asyncHandle : undefined, "x-pd-environment": requestOptions?.projectEnvironment, }), requestOptions?.headers, @@ -271,25 +259,13 @@ export class Triggers { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.ConfigurePropOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ConfigurePropResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ConfigurePropResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -320,26 +296,29 @@ export class Triggers { } /** - * @param {Pipedream.ReloadPropsOpts} request + * @param {Pipedream.TriggersReloadPropsRequest} request * @param {Triggers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.triggers.reloadProps({ - * id: "id", - * externalUserId: "external_user_id" + * body: { + * id: "id", + * external_user_id: "external_user_id" + * } * }) */ public reloadProps( - request: Pipedream.ReloadPropsOpts, + request: Pipedream.TriggersReloadPropsRequest, requestOptions?: Triggers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__reloadProps(request, requestOptions)); } private async __reloadProps( - request: Pipedream.ReloadPropsOpts, + request: Pipedream.TriggersReloadPropsRequest, requestOptions?: Triggers.RequestOptions, ): Promise> { + const { "x-async-handle": asyncHandle, body: _body } = request; const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -352,6 +331,7 @@ export class Triggers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), + "x-async-handle": asyncHandle != null ? asyncHandle : undefined, "x-pd-environment": requestOptions?.projectEnvironment, }), requestOptions?.headers, @@ -359,25 +339,13 @@ export class Triggers { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.ReloadPropsOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ReloadPropsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.ReloadPropsResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -414,7 +382,7 @@ export class Triggers { * @example * await client.triggers.deploy({ * id: "id", - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * }) */ public deploy( @@ -447,25 +415,13 @@ export class Triggers { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.DeployTriggerOpts.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.DeployTriggerResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body as Pipedream.DeployTriggerResponse, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/triggers/client/requests/DeployTriggerOpts.ts b/src/api/resources/triggers/client/requests/DeployTriggerOpts.ts index 9c53e19..2240d28 100644 --- a/src/api/resources/triggers/client/requests/DeployTriggerOpts.ts +++ b/src/api/resources/triggers/client/requests/DeployTriggerOpts.ts @@ -6,18 +6,18 @@ * @example * { * id: "id", - * externalUserId: "external_user_id" + * external_user_id: "external_user_id" * } */ export interface DeployTriggerOpts { /** The trigger component ID */ id: string; /** The external user ID */ - externalUserId: string; + external_user_id: string; /** The configured properties for the trigger */ - configuredProps?: Record; + configured_props?: Record; /** The ID for dynamic props */ - dynamicPropsId?: string; + dynamic_props_id?: string; /** Optional webhook URL to receive trigger events */ - webhookUrl?: string; + webhook_url?: string; } diff --git a/src/api/resources/triggers/client/requests/TriggersConfigurePropRequest.ts b/src/api/resources/triggers/client/requests/TriggersConfigurePropRequest.ts new file mode 100644 index 0000000..5ae1df0 --- /dev/null +++ b/src/api/resources/triggers/client/requests/TriggersConfigurePropRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../../../../index.js"; + +/** + * @example + * { + * body: { + * id: "id", + * external_user_id: "external_user_id", + * prop_name: "prop_name" + * } + * } + */ +export interface TriggersConfigurePropRequest { + "x-async-handle"?: string; + body: Pipedream.ConfigurePropOpts; +} diff --git a/src/api/resources/triggers/client/requests/TriggersReloadPropsRequest.ts b/src/api/resources/triggers/client/requests/TriggersReloadPropsRequest.ts new file mode 100644 index 0000000..cf747de --- /dev/null +++ b/src/api/resources/triggers/client/requests/TriggersReloadPropsRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../../../../index.js"; + +/** + * @example + * { + * body: { + * id: "id", + * external_user_id: "external_user_id" + * } + * } + */ +export interface TriggersReloadPropsRequest { + "x-async-handle"?: string; + body: Pipedream.ReloadPropsOpts; +} diff --git a/src/api/resources/triggers/client/requests/index.ts b/src/api/resources/triggers/client/requests/index.ts index b57789a..2859cb5 100644 --- a/src/api/resources/triggers/client/requests/index.ts +++ b/src/api/resources/triggers/client/requests/index.ts @@ -1,2 +1,4 @@ export { type TriggersListRequest } from "./TriggersListRequest.js"; +export { type TriggersConfigurePropRequest } from "./TriggersConfigurePropRequest.js"; +export { type TriggersReloadPropsRequest } from "./TriggersReloadPropsRequest.js"; export { type DeployTriggerOpts } from "./DeployTriggerOpts.js"; diff --git a/src/api/types/Account.ts b/src/api/types/Account.ts index 567b14a..6716144 100644 --- a/src/api/types/Account.ts +++ b/src/api/types/Account.ts @@ -13,24 +13,24 @@ export interface Account { /** The custom name of the account if set. */ name?: string; /** The external ID associated with the account. */ - externalId?: string; + external_id?: string; /** Indicates if the account is healthy. Pipedream will periodically retry token refresh and test requests for unhealthy accounts */ healthy?: boolean; /** Indicates if the account is no longer active */ dead?: boolean; app?: Pipedream.App; /** The date and time the account was created, an ISO 8601 formatted string */ - createdAt?: Date; + created_at?: string; /** The date and time the account was last updated, an ISO 8601 formatted string */ - updatedAt?: Date; + updated_at?: string; /** The credentials associated with the account, if the `include_credentials` parameter was set to true in the request */ credentials?: Record; /** The date and time the account's credentials expiration, an ISO 8601 formatted string */ - expiresAt?: Date; + expires_at?: string; /** The error message if the account is unhealthy or dead, null otherwise */ error?: string; /** The date and time the account was last refreshed, an ISO 8601 formatted string */ - lastRefreshedAt?: Date; + last_refreshed_at?: string; /** The date and time the account will next be refreshed, an ISO 8601 formatted string */ - nextRefreshAt?: Date; + next_refresh_at?: string; } diff --git a/src/api/types/App.ts b/src/api/types/App.ts index 700c4b9..cef9032 100644 --- a/src/api/types/App.ts +++ b/src/api/types/App.ts @@ -2,8 +2,6 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Pipedream from "../index.js"; - /** * Response object for a Pipedream app's metadata */ @@ -11,18 +9,31 @@ export interface App { /** ID of the app. Only applies for OAuth apps. */ id?: string; /** The name slug of the target app (see https://pipedream.com/docs/connect/quickstart#find-your-apps-name-slug) */ - nameSlug: string; + name_slug: string; /** The human-readable name of the app */ name: string; - authType?: Pipedream.AppAuthType; + /** The authentication type used by the app */ + auth_type?: App.AuthType; /** A short description of the app */ description?: string; /** The URL to the app's logo */ - imgSrc: string; + img_src: string; /** A JSON string representing the custom fields for the app */ - customFieldsJson?: string; + custom_fields_json?: string; /** Categories associated with the app */ categories: string[]; /** A rough directional ordering of app popularity, subject to changes by Pipedream */ - featuredWeight: number; + featured_weight: number; +} + +export namespace App { + /** + * The authentication type used by the app + */ + export type AuthType = "keys" | "oauth" | "none"; + export const AuthType = { + Keys: "keys", + Oauth: "oauth", + None: "none", + } as const; } diff --git a/src/api/types/AppAuthType.ts b/src/api/types/AppAuthType.ts deleted file mode 100644 index 48318f4..0000000 --- a/src/api/types/AppAuthType.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * The authentication type used by the app - */ -export type AppAuthType = "keys" | "oauth" | "none"; -export const AppAuthType = { - Keys: "keys", - Oauth: "oauth", - None: "none", -} as const; diff --git a/src/api/types/BackendClientOpts.ts b/src/api/types/BackendClientOpts.ts index c2bdd90..d8eb046 100644 --- a/src/api/types/BackendClientOpts.ts +++ b/src/api/types/BackendClientOpts.ts @@ -7,9 +7,9 @@ */ export interface BackendClientOpts { /** The client ID for authentication */ - clientId?: string; + client_id?: string; /** The client secret for authentication */ - clientSecret?: string; + client_secret?: string; /** The API URL to use */ - apiUrl?: string; + api_url?: string; } diff --git a/src/api/types/ClientOpts.ts b/src/api/types/ClientOpts.ts index eee657c..ccaa3a9 100644 --- a/src/api/types/ClientOpts.ts +++ b/src/api/types/ClientOpts.ts @@ -7,9 +7,9 @@ */ export interface ClientOpts { /** The client ID for authentication */ - clientId?: string; + client_id?: string; /** The client secret for authentication */ - clientSecret?: string; + client_secret?: string; /** The API URL to use (defaults to https://api.pipedream.com/) */ - apiUrl?: string; + api_url?: string; } diff --git a/src/api/types/Component.ts b/src/api/types/Component.ts index 9a17048..91a6fbb 100644 --- a/src/api/types/Component.ts +++ b/src/api/types/Component.ts @@ -11,10 +11,22 @@ export interface Component { name: string; /** The latest version of the component, in SemVer format. */ version: string; - configurableProps: Pipedream.ConfigurableProp[]; + configurable_props: Pipedream.ConfigurableProp[]; /** A description of the component */ description?: string; /** The type of component (trigger or action) */ - componentType?: string; - stash?: Pipedream.ComponentStash; + component_type?: string; + /** Indicates if a File Stash ID is optional or required to run the component */ + stash?: Component.Stash; +} + +export namespace Component { + /** + * Indicates if a File Stash ID is optional or required to run the component + */ + export type Stash = "optional" | "required"; + export const Stash = { + Optional: "optional", + Required: "required", + } as const; } diff --git a/src/api/types/ComponentStash.ts b/src/api/types/ComponentStash.ts deleted file mode 100644 index 22014a2..0000000 --- a/src/api/types/ComponentStash.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * Indicates if a File Stash ID is optional or required to run the component - */ -export type ComponentStash = "optional" | "required"; -export const ComponentStash = { - Optional: "optional", - Required: "required", -} as const; diff --git a/src/api/types/ConfigurableProp.ts b/src/api/types/ConfigurableProp.ts index 40a7f1b..2a8bde5 100644 --- a/src/api/types/ConfigurableProp.ts +++ b/src/api/types/ConfigurableProp.ts @@ -7,7 +7,7 @@ */ export interface ConfigurableProp { /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; type?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; diff --git a/src/api/types/ConfigurablePropAirtableBaseId.ts b/src/api/types/ConfigurablePropAirtableBaseId.ts deleted file mode 100644 index f9bd66f..0000000 --- a/src/api/types/ConfigurablePropAirtableBaseId.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropAirtableBaseId { - type?: "$.airtable.baseId"; - /** The name of the app prop that provides Airtable authentication */ - appProp?: string; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropAirtableFieldId.ts b/src/api/types/ConfigurablePropAirtableFieldId.ts deleted file mode 100644 index ab86424..0000000 --- a/src/api/types/ConfigurablePropAirtableFieldId.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropAirtableFieldId { - type?: "$.airtable.fieldId"; - /** The name of the prop that provides the Airtable table ID */ - tableIdProp?: string; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropAirtableTableId.ts b/src/api/types/ConfigurablePropAirtableTableId.ts deleted file mode 100644 index 5dc6238..0000000 --- a/src/api/types/ConfigurablePropAirtableTableId.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropAirtableTableId { - type?: "$.airtable.tableId"; - /** The name of the prop that provides the Airtable base ID */ - baseIdProp?: string; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropAirtableViewId.ts b/src/api/types/ConfigurablePropAirtableViewId.ts deleted file mode 100644 index 28241d1..0000000 --- a/src/api/types/ConfigurablePropAirtableViewId.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropAirtableViewId { - type?: "$.airtable.viewId"; - /** The name of the prop that provides the Airtable table ID */ - tableIdProp?: string; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropAlert.ts b/src/api/types/ConfigurablePropAlert.ts index e267a59..b1d1a29 100644 --- a/src/api/types/ConfigurablePropAlert.ts +++ b/src/api/types/ConfigurablePropAlert.ts @@ -2,15 +2,14 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Pipedream from "../index.js"; - export interface ConfigurablePropAlert { type?: "alert"; - alertType?: Pipedream.ConfigurablePropAlertType; + /** The severity level of the alert. */ + alertType?: ConfigurablePropAlert.AlertType; /** The content of the alert, which can include HTML or plain text. */ content?: string; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; /** A description of the prop, shown to the user when configuring the component. */ @@ -30,3 +29,16 @@ export interface ConfigurablePropAlert { /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ withLabel?: boolean; } + +export namespace ConfigurablePropAlert { + /** + * The severity level of the alert. + */ + export type AlertType = "info" | "neutral" | "warning" | "error"; + export const AlertType = { + Info: "info", + Neutral: "neutral", + Warning: "warning", + Error: "error", + } as const; +} diff --git a/src/api/types/ConfigurablePropAlertType.ts b/src/api/types/ConfigurablePropAlertType.ts deleted file mode 100644 index fcccc00..0000000 --- a/src/api/types/ConfigurablePropAlertType.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * The severity level of the alert. - */ -export type ConfigurablePropAlertType = "info" | "neutral" | "warning" | "error"; -export const ConfigurablePropAlertType = { - Info: "info", - Neutral: "neutral", - Warning: "warning", - Error: "error", -} as const; diff --git a/src/api/types/ConfigurablePropAny.ts b/src/api/types/ConfigurablePropAny.ts index f4b9883..4d4594b 100644 --- a/src/api/types/ConfigurablePropAny.ts +++ b/src/api/types/ConfigurablePropAny.ts @@ -5,7 +5,7 @@ export interface ConfigurablePropAny { type?: "any"; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; /** A description of the prop, shown to the user when configuring the component. */ diff --git a/src/api/types/ConfigurablePropApp.ts b/src/api/types/ConfigurablePropApp.ts index a70fc40..ca522ed 100644 --- a/src/api/types/ConfigurablePropApp.ts +++ b/src/api/types/ConfigurablePropApp.ts @@ -7,7 +7,7 @@ export interface ConfigurablePropApp { /** The name slug of the app, e.g. 'github', 'slack', etc. This is used to identify the app for which the account is being configured. */ app?: string; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; /** A description of the prop, shown to the user when configuring the component. */ diff --git a/src/api/types/ConfigurablePropApphook.ts b/src/api/types/ConfigurablePropApphook.ts deleted file mode 100644 index 9bdc3e3..0000000 --- a/src/api/types/ConfigurablePropApphook.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropApphook { - type?: "$.interface.apphook"; - /** The name of the app prop that this apphook depends on */ - appProp?: string; - /** List of event names to listen for */ - eventNames?: string[]; - /** Whether this apphook is remote */ - remote?: boolean; - /** Static configuration for the apphook */ - static?: unknown[]; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropBoolean.ts b/src/api/types/ConfigurablePropBoolean.ts index 78d2985..3098a10 100644 --- a/src/api/types/ConfigurablePropBoolean.ts +++ b/src/api/types/ConfigurablePropBoolean.ts @@ -5,7 +5,7 @@ export interface ConfigurablePropBoolean { type?: "boolean"; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; /** A description of the prop, shown to the user when configuring the component. */ diff --git a/src/api/types/ConfigurablePropDb.ts b/src/api/types/ConfigurablePropDb.ts deleted file mode 100644 index 9fa7244..0000000 --- a/src/api/types/ConfigurablePropDb.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropDb { - type?: "$.service.db"; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropDiscord.ts b/src/api/types/ConfigurablePropDiscord.ts index d76ab77..89fde58 100644 --- a/src/api/types/ConfigurablePropDiscord.ts +++ b/src/api/types/ConfigurablePropDiscord.ts @@ -5,7 +5,7 @@ export interface ConfigurablePropDiscord { type?: "$.discord.channel"; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; /** A description of the prop, shown to the user when configuring the component. */ diff --git a/src/api/types/ConfigurablePropDiscordChannel.ts b/src/api/types/ConfigurablePropDiscordChannel.ts deleted file mode 100644 index 01ce96a..0000000 --- a/src/api/types/ConfigurablePropDiscordChannel.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropDiscordChannel { - type?: "$.discord.channel"; - /** The name of the app prop that provides Discord authentication */ - appProp?: string; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropDiscordChannelArray.ts b/src/api/types/ConfigurablePropDiscordChannelArray.ts deleted file mode 100644 index 4323822..0000000 --- a/src/api/types/ConfigurablePropDiscordChannelArray.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropDiscordChannelArray { - type?: "$.discord.channel[]"; - /** The name of the app prop that provides Discord authentication */ - appProp?: string; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropHttp.ts b/src/api/types/ConfigurablePropHttp.ts deleted file mode 100644 index cef50eb..0000000 --- a/src/api/types/ConfigurablePropHttp.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropHttp { - type?: "$.interface.http"; - /** Whether this HTTP interface allows custom responses */ - customResponse?: boolean; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropInteger.ts b/src/api/types/ConfigurablePropInteger.ts index 4934b5d..3c98017 100644 --- a/src/api/types/ConfigurablePropInteger.ts +++ b/src/api/types/ConfigurablePropInteger.ts @@ -8,12 +8,8 @@ export interface ConfigurablePropInteger { min?: number; /** The maximum value for this integer prop. */ max?: number; - /** Default integer value */ - default?: number; - /** Available integer options */ - options?: number[]; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; /** A description of the prop, shown to the user when configuring the component. */ diff --git a/src/api/types/ConfigurablePropIntegerArray.ts b/src/api/types/ConfigurablePropIntegerArray.ts deleted file mode 100644 index 81870a3..0000000 --- a/src/api/types/ConfigurablePropIntegerArray.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropIntegerArray { - type?: "integer[]"; - /** The minimum value for integers in this array */ - min?: number; - /** The maximum value for integers in this array */ - max?: number; - /** Default array of integers */ - default?: number[]; - /** Available options for the integer array */ - options?: number[]; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropObject.ts b/src/api/types/ConfigurablePropObject.ts index e812e77..0daf82c 100644 --- a/src/api/types/ConfigurablePropObject.ts +++ b/src/api/types/ConfigurablePropObject.ts @@ -5,7 +5,7 @@ export interface ConfigurablePropObject { type?: "object"; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; /** A description of the prop, shown to the user when configuring the component. */ diff --git a/src/api/types/ConfigurablePropSql.ts b/src/api/types/ConfigurablePropSql.ts deleted file mode 100644 index cb4d2d5..0000000 --- a/src/api/types/ConfigurablePropSql.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Pipedream from "../index.js"; - -export interface ConfigurablePropSql { - type?: "sql"; - auth?: Pipedream.ConfigurablePropSqlAuth; - /** Default SQL query */ - default?: string; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropSqlAuth.ts b/src/api/types/ConfigurablePropSqlAuth.ts deleted file mode 100644 index 7ba13bd..0000000 --- a/src/api/types/ConfigurablePropSqlAuth.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ConfigurablePropSqlAuth { - /** The app that provides SQL authentication */ - app?: string; -} diff --git a/src/api/types/ConfigurablePropString.ts b/src/api/types/ConfigurablePropString.ts index bfb8592..6e207e0 100644 --- a/src/api/types/ConfigurablePropString.ts +++ b/src/api/types/ConfigurablePropString.ts @@ -7,7 +7,7 @@ export interface ConfigurablePropString { /** If true, this prop is a secret and should not be displayed in plain text. */ secret?: boolean; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; /** A description of the prop, shown to the user when configuring the component. */ diff --git a/src/api/types/ConfigurablePropStringArray.ts b/src/api/types/ConfigurablePropStringArray.ts index 12c9039..0ad2a52 100644 --- a/src/api/types/ConfigurablePropStringArray.ts +++ b/src/api/types/ConfigurablePropStringArray.ts @@ -7,7 +7,7 @@ export interface ConfigurablePropStringArray { /** If true, this prop is a secret and should not be displayed in plain text. */ secret?: boolean; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; + name?: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ label?: string; /** A description of the prop, shown to the user when configuring the component. */ diff --git a/src/api/types/ConfigurablePropTimer.ts b/src/api/types/ConfigurablePropTimer.ts deleted file mode 100644 index 049b934..0000000 --- a/src/api/types/ConfigurablePropTimer.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Pipedream from "../index.js"; - -export interface ConfigurablePropTimer { - type?: "$.interface.timer"; - static?: Pipedream.ConfigurablePropTimerStatic; - default?: Pipedream.ConfigurablePropTimerDefault; - /** Available timer configuration options */ - options?: (Pipedream.ConfigurablePropTimerOption | undefined)[]; - /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ - name: string; - /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ - label?: string; - /** A description of the prop, shown to the user when configuring the component. */ - description?: string; - /** If true, this prop does not need to be specified. */ - optional?: boolean; - /** If true, this prop will be ignored. */ - disabled?: boolean; - /** If true, should not expose this prop to the user */ - hidden?: boolean; - /** If true, call `configureComponent` for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options */ - remoteOptions?: boolean; - /** If true, calls to `configureComponent` for this prop support receiving a `query` parameter to filter remote options */ - useQuery?: boolean; - /** If true, after setting a value for this prop, a call to `reloadComponentProps` is required as the component has dynamic configurable props dependent on this one */ - reloadProps?: boolean; - /** If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label */ - withLabel?: boolean; -} diff --git a/src/api/types/ConfigurablePropTimerDefault.ts b/src/api/types/ConfigurablePropTimerDefault.ts deleted file mode 100644 index f3a09b0..0000000 --- a/src/api/types/ConfigurablePropTimerDefault.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Pipedream from "../index.js"; - -/** - * Default timer configuration - */ -export type ConfigurablePropTimerDefault = Pipedream.TimerInterval | Pipedream.TimerCron; diff --git a/src/api/types/ConfigurablePropTimerOption.ts b/src/api/types/ConfigurablePropTimerOption.ts deleted file mode 100644 index 8ec98d8..0000000 --- a/src/api/types/ConfigurablePropTimerOption.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Pipedream from "../index.js"; - -/** - * Timer configuration options - */ -export type ConfigurablePropTimerOption = Pipedream.TimerInterval | Pipedream.TimerCron; diff --git a/src/api/types/ConfigurablePropTimerStatic.ts b/src/api/types/ConfigurablePropTimerStatic.ts deleted file mode 100644 index 6d81d70..0000000 --- a/src/api/types/ConfigurablePropTimerStatic.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Pipedream from "../index.js"; - -/** - * Static timer configuration - */ -export type ConfigurablePropTimerStatic = Pipedream.TimerInterval | Pipedream.TimerCron; diff --git a/src/api/types/ConfigurePropOpts.ts b/src/api/types/ConfigurePropOpts.ts index e9557da..bf9a265 100644 --- a/src/api/types/ConfigurePropOpts.ts +++ b/src/api/types/ConfigurePropOpts.ts @@ -9,21 +9,21 @@ export interface ConfigurePropOpts { /** The component ID */ id: string; /** The external user ID */ - externalUserId: string; + external_user_id: string; /** The name of the prop to configure */ - propName: string; + prop_name: string; /** Whether this operation should block until completion */ blocking?: boolean; /** The configured properties for the component */ - configuredProps?: Record; + configured_props?: Record; /** The ID for dynamic props */ - dynamicPropsId?: string; + dynamic_props_id?: string; /** Handle for async operations */ - asyncHandle?: string; + async_handle?: string; /** Page number for paginated results */ page?: number; /** Previous context for pagination */ - prevContext?: Record; + prev_context?: Record; /** Search query for filtering options */ query?: string; } diff --git a/src/api/types/ConfigurePropResponse.ts b/src/api/types/ConfigurePropResponse.ts index c5c2c22..8f29875 100644 --- a/src/api/types/ConfigurePropResponse.ts +++ b/src/api/types/ConfigurePropResponse.ts @@ -8,16 +8,8 @@ import * as Pipedream from "../index.js"; * Response received after configuring a component's prop */ export interface ConfigurePropResponse { - /** Available options (with labels) for the configured prop */ - options?: Pipedream.PropOption[]; /** Available options for the configured prop */ - stringOptions?: string[]; - /** Any logs produced during the configuration of the prop */ - observations?: Record; - /** Handle for async operations */ - asyncHandle?: string; - /** New context after configuring the prop */ - context?: Record; + options?: Pipedream.PropOption[]; /** Any errors that occurred during configuration */ errors?: string[]; } diff --git a/src/api/types/ConnectToken.ts b/src/api/types/ConnectToken.ts deleted file mode 100644 index 52cbc1c..0000000 --- a/src/api/types/ConnectToken.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * An authentication token with a limited lifespan - */ -export type ConnectToken = string; diff --git a/src/api/types/ConnectTokenCreateOpts.ts b/src/api/types/ConnectTokenCreateOpts.ts new file mode 100644 index 0000000..944319a --- /dev/null +++ b/src/api/types/ConnectTokenCreateOpts.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Options for creating a Connect token + */ +export interface ConnectTokenCreateOpts { + /** Your end user ID, for whom you're creating the token */ + external_user_id: string; + /** List of allowed origins for CORS */ + allowed_origins?: string[]; + /** URI to redirect to on error */ + error_redirect_uri?: string; + /** URI to redirect to on success */ + success_redirect_uri?: string; + /** Webhook URI for notifications */ + webhook_uri?: string; +} diff --git a/src/api/types/ConnectTokenResponse.ts b/src/api/types/ConnectTokenResponse.ts new file mode 100644 index 0000000..7e4c388 --- /dev/null +++ b/src/api/types/ConnectTokenResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Response received after creating a connect token + */ +export interface ConnectTokenResponse { + /** The Connect Link URL */ + connect_link_url: string; + /** The expiration time of the token in ISO 8601 format */ + expires_at: string; + /** The generated token */ + token: string; +} diff --git a/src/api/types/CreateBrowserClientOpts.ts b/src/api/types/CreateBrowserClientOpts.ts new file mode 100644 index 0000000..923a2c3 --- /dev/null +++ b/src/api/types/CreateBrowserClientOpts.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Options for creating a browser-side client + */ +export interface CreateBrowserClientOpts { + /** The API URL to use */ + api_url?: string; +} diff --git a/src/api/types/CreateOAuthTokenResponse.ts b/src/api/types/CreateOAuthTokenResponse.ts index c1584ef..4416c9d 100644 --- a/src/api/types/CreateOAuthTokenResponse.ts +++ b/src/api/types/CreateOAuthTokenResponse.ts @@ -6,7 +6,7 @@ * Response object for creating an OAuth token */ export interface CreateOAuthTokenResponse { - accessToken: string; - tokenType: string; - expiresIn: number; + access_token: string; + token_type: string; + expires_in: number; } diff --git a/src/api/types/CreateTokenResponse.ts b/src/api/types/CreateTokenResponse.ts index f99db93..d6e88fd 100644 --- a/src/api/types/CreateTokenResponse.ts +++ b/src/api/types/CreateTokenResponse.ts @@ -2,15 +2,14 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Pipedream from "../index.js"; - /** * Response received after creating a connect token */ export interface CreateTokenResponse { /** The Connect Link URL */ - connectLinkUrl: string; + connect_link_url: string; /** The expiration time of the token in ISO 8601 format */ - expiresAt: Date; - token: Pipedream.ConnectToken; + expires_at: string; + /** The generated token */ + token: string; } diff --git a/src/api/types/DeleteTriggerOpts.ts b/src/api/types/DeleteTriggerOpts.ts index 3db28d1..c979843 100644 --- a/src/api/types/DeleteTriggerOpts.ts +++ b/src/api/types/DeleteTriggerOpts.ts @@ -7,5 +7,5 @@ */ export interface DeleteTriggerOpts { /** Whether to ignore errors during deactivation hook */ - ignoreHookErrors?: boolean; + ignore_hook_errors?: boolean; } diff --git a/src/api/types/DeployedComponent.ts b/src/api/types/DeployedComponent.ts index 31589e8..478cc4b 100644 --- a/src/api/types/DeployedComponent.ts +++ b/src/api/types/DeployedComponent.ts @@ -11,22 +11,22 @@ export interface DeployedComponent { /** The unique ID of the deployed component */ id: string; /** The ID of the owner */ - ownerId: string; + owner_id: string; /** The ID of the component that was deployed */ - componentId: string; + component_id: string; /** The configurable properties of the component */ - configurableProps: Pipedream.ConfigurableProp[]; + configurable_props: Pipedream.ConfigurableProp[]; /** The configured properties of the component */ - configuredProps: Record; + configured_props: Record; /** Whether the deployed component is active */ active: boolean; /** The timestamp when the component was deployed (epoch milliseconds) */ - createdAt: number; + created_at: number; /** The timestamp when the component was last updated (epoch milliseconds) */ - updatedAt: number; + updated_at: number; /** The name of the deployed component */ name: string; /** The name slug of the deployed component */ - nameSlug: string; - callbackObservations?: unknown; + name_slug: string; + callback_observations?: unknown; } diff --git a/src/api/types/GetAccountsResponse.ts b/src/api/types/GetAccountsResponse.ts index 100c449..f3d1d85 100644 --- a/src/api/types/GetAccountsResponse.ts +++ b/src/api/types/GetAccountsResponse.ts @@ -9,5 +9,5 @@ import * as Pipedream from "../index.js"; */ export interface GetAccountsResponse { data: Pipedream.Account[]; - pageInfo: Pipedream.PageInfo; + page_info: Pipedream.PageInfo; } diff --git a/src/api/types/GetAppsResponse.ts b/src/api/types/GetAppsResponse.ts index 2edeafb..8584a3d 100644 --- a/src/api/types/GetAppsResponse.ts +++ b/src/api/types/GetAppsResponse.ts @@ -9,5 +9,5 @@ import * as Pipedream from "../index.js"; */ export interface GetAppsResponse { data: Pipedream.App[]; - pageInfo: Pipedream.PageInfo; + page_info: Pipedream.PageInfo; } diff --git a/src/api/types/GetComponentsResponse.ts b/src/api/types/GetComponentsResponse.ts index 06aeef5..848a635 100644 --- a/src/api/types/GetComponentsResponse.ts +++ b/src/api/types/GetComponentsResponse.ts @@ -9,5 +9,5 @@ import * as Pipedream from "../index.js"; */ export interface GetComponentsResponse { data: Pipedream.Component[]; - pageInfo: Pipedream.PageInfo; + page_info: Pipedream.PageInfo; } diff --git a/src/api/types/GetTriggerWebhooksResponse.ts b/src/api/types/GetTriggerWebhooksResponse.ts index fc64aea..202498c 100644 --- a/src/api/types/GetTriggerWebhooksResponse.ts +++ b/src/api/types/GetTriggerWebhooksResponse.ts @@ -6,5 +6,5 @@ * Response received when retrieving trigger webhooks */ export interface GetTriggerWebhooksResponse { - webhookUrls: string[]; + webhook_urls: string[]; } diff --git a/src/api/types/GetTriggerWorkflowsResponse.ts b/src/api/types/GetTriggerWorkflowsResponse.ts index 12c0713..b475c52 100644 --- a/src/api/types/GetTriggerWorkflowsResponse.ts +++ b/src/api/types/GetTriggerWorkflowsResponse.ts @@ -6,5 +6,5 @@ * Response received when retrieving trigger workflows */ export interface GetTriggerWorkflowsResponse { - workflowIds: string[]; + workflow_ids: string[]; } diff --git a/src/api/types/GetTriggersResponse.ts b/src/api/types/GetTriggersResponse.ts index 9f15373..6d56388 100644 --- a/src/api/types/GetTriggersResponse.ts +++ b/src/api/types/GetTriggersResponse.ts @@ -9,5 +9,5 @@ import * as Pipedream from "../index.js"; */ export interface GetTriggersResponse { data: Pipedream.DeployedComponent[]; - pageInfo: Pipedream.PageInfo; + page_info: Pipedream.PageInfo; } diff --git a/src/api/types/ListAccountsResponse.ts b/src/api/types/ListAccountsResponse.ts index 3c022bc..5c6fe31 100644 --- a/src/api/types/ListAccountsResponse.ts +++ b/src/api/types/ListAccountsResponse.ts @@ -9,5 +9,5 @@ import * as Pipedream from "../index.js"; */ export interface ListAccountsResponse { data: Pipedream.Account[]; - pageInfo: Pipedream.PageInfo; + page_info: Pipedream.PageInfo; } diff --git a/src/api/types/ListAppsResponse.ts b/src/api/types/ListAppsResponse.ts index 6e1517b..e2c9e83 100644 --- a/src/api/types/ListAppsResponse.ts +++ b/src/api/types/ListAppsResponse.ts @@ -9,5 +9,5 @@ import * as Pipedream from "../index.js"; */ export interface ListAppsResponse { data: Pipedream.App[]; - pageInfo: Pipedream.PageInfo; + page_info: Pipedream.PageInfo; } diff --git a/src/api/types/PageInfo.ts b/src/api/types/PageInfo.ts index 8d1cdac..bf54b1c 100644 --- a/src/api/types/PageInfo.ts +++ b/src/api/types/PageInfo.ts @@ -4,7 +4,7 @@ export interface PageInfo { count?: number; - totalCount?: number; - startCursor?: string; - endCursor?: string; + total_count?: number; + start_cursor?: string; + end_cursor?: string; } diff --git a/src/api/types/ProjectInfoResponse.ts b/src/api/types/ProjectInfoResponse.ts index a9a3cc1..df73472 100644 --- a/src/api/types/ProjectInfoResponse.ts +++ b/src/api/types/ProjectInfoResponse.ts @@ -2,11 +2,22 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Pipedream from "../index.js"; - /** * Response received when retrieving project info */ export interface ProjectInfoResponse { - apps: Pipedream.ProjectInfoResponseApp[]; + apps: ProjectInfoResponse.Apps.Item[]; +} + +export namespace ProjectInfoResponse { + export type Apps = Apps.Item[]; + + export namespace Apps { + export interface Item { + /** ID of the app. Only applies for OAuth apps. */ + id?: string; + /** The name slug of the target app */ + name_slug: string; + } + } } diff --git a/src/api/types/ProjectInfoResponseApp.ts b/src/api/types/ProjectInfoResponseApp.ts deleted file mode 100644 index 77a3bd5..0000000 --- a/src/api/types/ProjectInfoResponseApp.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface ProjectInfoResponseApp { - /** ID of the app. Only applies for OAuth apps. */ - id?: string; - /** The name slug of the target app */ - nameSlug?: string; -} diff --git a/src/api/types/ReloadPropsOpts.ts b/src/api/types/ReloadPropsOpts.ts index 1333e33..d562dda 100644 --- a/src/api/types/ReloadPropsOpts.ts +++ b/src/api/types/ReloadPropsOpts.ts @@ -9,13 +9,13 @@ export interface ReloadPropsOpts { /** The component ID */ id: string; /** The external user ID */ - externalUserId: string; + external_user_id: string; /** Whether this operation should block until completion */ blocking?: boolean; /** The configured properties for the component */ - configuredProps?: Record; + configured_props?: Record; /** The ID for dynamic props */ - dynamicPropsId?: string; + dynamic_props_id?: string; /** Handle for async operations */ - asyncHandle?: string; + async_handle?: string; } diff --git a/src/api/types/ReloadPropsResponse.ts b/src/api/types/ReloadPropsResponse.ts index a221764..d1978a6 100644 --- a/src/api/types/ReloadPropsResponse.ts +++ b/src/api/types/ReloadPropsResponse.ts @@ -9,5 +9,5 @@ import * as Pipedream from "../index.js"; */ export interface ReloadPropsResponse { /** The updated configurable properties */ - configurableProps?: Pipedream.ConfigurableProp[]; + configurable_props?: Pipedream.ConfigurableProp[]; } diff --git a/src/api/types/RunActionOptsStashId.ts b/src/api/types/RunActionOptsStashId.ts deleted file mode 100644 index 57ceb01..0000000 --- a/src/api/types/RunActionOptsStashId.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Pipedream from "../index.js"; - -/** - * The ID of the File Stash to use for syncing the action's /tmp directory, or either `true` or 'NEW' to create a new stash - */ -export type RunActionOptsStashId = (Pipedream.StashId | undefined) | undefined | "NEW" | boolean; diff --git a/src/api/types/RunActionResponse.ts b/src/api/types/RunActionResponse.ts index 0f0dff2..a735e57 100644 --- a/src/api/types/RunActionResponse.ts +++ b/src/api/types/RunActionResponse.ts @@ -2,8 +2,6 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Pipedream from "../index.js"; - /** * The response received after running an action. See https://pipedream.com/docs/components/api#returning-data-from-steps for more details. */ @@ -11,5 +9,6 @@ export interface RunActionResponse { exports?: unknown; os?: unknown; ret?: unknown; - stashId?: Pipedream.StashId | undefined; + /** The ID of the File Stash that was used to sync the action's /tmp directory */ + stash_id?: string; } diff --git a/src/api/types/StashId.ts b/src/api/types/StashId.ts deleted file mode 100644 index 941b2ff..0000000 --- a/src/api/types/StashId.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * The ID of the File Stash - */ -export type StashId = string | undefined; diff --git a/src/api/types/TimerCron.ts b/src/api/types/TimerCron.ts deleted file mode 100644 index 1208ce8..0000000 --- a/src/api/types/TimerCron.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * Timer configuration using cron expression - */ -export interface TimerCron { - /** Cron expression for timer execution */ - cron: string; -} diff --git a/src/api/types/TimerInterval.ts b/src/api/types/TimerInterval.ts deleted file mode 100644 index 137bad3..0000000 --- a/src/api/types/TimerInterval.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * Timer configuration using interval in seconds - */ -export interface TimerInterval { - /** Interval in seconds for timer execution */ - intervalSeconds: number; -} diff --git a/src/api/types/ValidateTokenParams.ts b/src/api/types/ValidateTokenParams.ts new file mode 100644 index 0000000..f960d8d --- /dev/null +++ b/src/api/types/ValidateTokenParams.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Parameters for token validation + */ +export interface ValidateTokenParams { + /** The app ID to validate against */ + app_id: string; + /** The OAuth app ID */ + oauth_app_id?: string; +} diff --git a/src/api/types/ValidateTokenResponse.ts b/src/api/types/ValidateTokenResponse.ts index 0d13618..ef59a97 100644 --- a/src/api/types/ValidateTokenResponse.ts +++ b/src/api/types/ValidateTokenResponse.ts @@ -12,19 +12,19 @@ export interface ValidateTokenResponse { /** Error message if validation failed */ error?: string; /** URI to redirect to on error */ - errorRedirectUri?: string; + error_redirect_uri?: string; /** OAuth app ID if applicable */ - oauthAppId?: string; + oauth_app_id?: string; /** Name of the project app */ - projectAppName?: string; + project_app_name?: string; /** Environment of the project */ - projectEnvironment?: string; + project_environment?: string; /** ID of the project */ - projectId?: string; + project_id?: string; /** Support email for the project */ - projectSupportEmail?: string; + project_support_email?: string; /** Whether the token validation was successful */ success: boolean; /** URI to redirect to on success */ - successRedirectUri?: string; + success_redirect_uri?: string; } diff --git a/src/core/auth/OAuthTokenProvider.ts b/src/core/auth/OAuthTokenProvider.ts index e8981d1..a001934 100644 --- a/src/core/auth/OAuthTokenProvider.ts +++ b/src/core/auth/OAuthTokenProvider.ts @@ -41,12 +41,12 @@ export class OAuthTokenProvider { private async refresh(): Promise { const tokenResponse = await this._authClient.create({ - clientId: await core.Supplier.get(this._clientId), - clientSecret: await core.Supplier.get(this._clientSecret), + client_id: await core.Supplier.get(this._clientId), + client_secret: await core.Supplier.get(this._clientSecret), }); - this._accessToken = tokenResponse.accessToken; - this._expiresAt = this.getExpiresAt(tokenResponse.expiresIn, this.BUFFER_IN_MINUTES); + this._accessToken = tokenResponse.access_token; + this._expiresAt = this.getExpiresAt(tokenResponse.expires_in, this.BUFFER_IN_MINUTES); return this._accessToken; } diff --git a/src/core/index.ts b/src/core/index.ts index fb08b15..c686b79 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -5,4 +5,3 @@ export * as url from "./url/index.js"; export * from "./base64.js"; export * from "./utils/index.js"; export * from "./pagination/index.js"; -export * as serialization from "./schemas/index.js"; diff --git a/src/core/schemas/Schema.ts b/src/core/schemas/Schema.ts deleted file mode 100644 index 5216437..0000000 --- a/src/core/schemas/Schema.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { SchemaUtils } from "./builders/index.js"; - -export type Schema = BaseSchema & SchemaUtils; - -export type inferRaw = S extends Schema ? Raw : never; -export type inferParsed = S extends Schema ? Parsed : never; - -export interface BaseSchema { - parse: (raw: unknown, opts?: SchemaOptions) => MaybeValid; - json: (parsed: unknown, opts?: SchemaOptions) => MaybeValid; - getType: () => SchemaType | SchemaType; -} - -export const SchemaType = { - BIGINT: "bigint", - DATE: "date", - ENUM: "enum", - LIST: "list", - STRING_LITERAL: "stringLiteral", - BOOLEAN_LITERAL: "booleanLiteral", - OBJECT: "object", - ANY: "any", - BOOLEAN: "boolean", - NUMBER: "number", - STRING: "string", - UNKNOWN: "unknown", - RECORD: "record", - SET: "set", - UNION: "union", - UNDISCRIMINATED_UNION: "undiscriminatedUnion", - NULLABLE: "nullable", - OPTIONAL: "optional", - OPTIONAL_NULLABLE: "optionalNullable", -} as const; -export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType]; - -export type MaybeValid = Valid | Invalid; - -export interface Valid { - ok: true; - value: T; -} - -export interface Invalid { - ok: false; - errors: ValidationError[]; -} - -export interface ValidationError { - path: string[]; - message: string; -} - -export interface SchemaOptions { - /** - * how to handle unrecognized keys in objects - * - * @default "fail" - */ - unrecognizedObjectKeys?: "fail" | "passthrough" | "strip"; - - /** - * whether to fail when an unrecognized discriminant value is - * encountered in a union - * - * @default false - */ - allowUnrecognizedUnionMembers?: boolean; - - /** - * whether to fail when an unrecognized enum value is encountered - * - * @default false - */ - allowUnrecognizedEnumValues?: boolean; - - /** - * whether to allow data that doesn't conform to the schema. - * invalid data is passed through without transformation. - * - * when this is enabled, .parse() and .json() will always - * return `ok: true`. `.parseOrThrow()` and `.jsonOrThrow()` - * will never fail. - * - * @default false - */ - skipValidation?: boolean; - - /** - * each validation failure contains a "path" property, which is - * the breadcrumbs to the offending node in the JSON. you can supply - * a prefix that is prepended to all the errors' paths. this can be - * helpful for zurg's internal debug logging. - */ - breadcrumbsPrefix?: string[]; - - /** - * whether to send 'null' for optional properties explicitly set to 'undefined'. - */ - omitUndefined?: boolean; -} diff --git a/src/core/schemas/builders/bigint/bigint.ts b/src/core/schemas/builders/bigint/bigint.ts deleted file mode 100644 index 098b4bf..0000000 --- a/src/core/schemas/builders/bigint/bigint.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; - -export function bigint(): Schema { - const baseSchema: BaseSchema = { - parse: (raw, { breadcrumbsPrefix = [] } = {}) => { - if (typeof raw === "bigint") { - return { - ok: true, - value: raw, - }; - } - if (typeof raw === "number") { - return { - ok: true, - value: BigInt(raw), - }; - } - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(raw, "bigint | number"), - }, - ], - }; - }, - json: (bigint, { breadcrumbsPrefix = [] } = {}) => { - if (typeof bigint !== "bigint") { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(bigint, "bigint"), - }, - ], - }; - } - return { - ok: true, - value: bigint, - }; - }, - getType: () => SchemaType.BIGINT, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} diff --git a/src/core/schemas/builders/bigint/index.ts b/src/core/schemas/builders/bigint/index.ts deleted file mode 100644 index 13cc76e..0000000 --- a/src/core/schemas/builders/bigint/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { bigint } from "./bigint.js"; diff --git a/src/core/schemas/builders/date/date.ts b/src/core/schemas/builders/date/date.ts deleted file mode 100644 index 5afaa49..0000000 --- a/src/core/schemas/builders/date/date.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; - -// https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime -const ISO_8601_REGEX = - /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; - -export function date(): Schema { - const baseSchema: BaseSchema = { - parse: (raw, { breadcrumbsPrefix = [] } = {}) => { - if (typeof raw !== "string") { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(raw, "string"), - }, - ], - }; - } - if (!ISO_8601_REGEX.test(raw)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(raw, "ISO 8601 date string"), - }, - ], - }; - } - return { - ok: true, - value: new Date(raw), - }; - }, - json: (date, { breadcrumbsPrefix = [] } = {}) => { - if (date instanceof Date) { - return { - ok: true, - value: date.toISOString(), - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(date, "Date object"), - }, - ], - }; - } - }, - getType: () => SchemaType.DATE, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} diff --git a/src/core/schemas/builders/date/index.ts b/src/core/schemas/builders/date/index.ts deleted file mode 100644 index e22a2f1..0000000 --- a/src/core/schemas/builders/date/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { date } from "./date.js"; diff --git a/src/core/schemas/builders/enum/enum.ts b/src/core/schemas/builders/enum/enum.ts deleted file mode 100644 index b892186..0000000 --- a/src/core/schemas/builders/enum/enum.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Schema, SchemaType } from "../../Schema.js"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; - -export function enum_(values: E): Schema { - const validValues = new Set(values); - - const schemaCreator = createIdentitySchemaCreator( - SchemaType.ENUM, - (value, { allowUnrecognizedEnumValues, breadcrumbsPrefix = [] } = {}) => { - if (typeof value !== "string") { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "string"), - }, - ], - }; - } - - if (!validValues.has(value) && !allowUnrecognizedEnumValues) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "enum"), - }, - ], - }; - } - - return { - ok: true, - value: value as U, - }; - }, - ); - - return schemaCreator(); -} diff --git a/src/core/schemas/builders/enum/index.ts b/src/core/schemas/builders/enum/index.ts deleted file mode 100644 index ff3bee3..0000000 --- a/src/core/schemas/builders/enum/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { enum_ } from "./enum.js"; diff --git a/src/core/schemas/builders/index.ts b/src/core/schemas/builders/index.ts deleted file mode 100644 index ddb9b3c..0000000 --- a/src/core/schemas/builders/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from "./bigint/index.js"; -export * from "./date/index.js"; -export * from "./enum/index.js"; -export * from "./lazy/index.js"; -export * from "./list/index.js"; -export * from "./literals/index.js"; -export * from "./object/index.js"; -export * from "./object-like/index.js"; -export * from "./primitives/index.js"; -export * from "./record/index.js"; -export * from "./schema-utils/index.js"; -export * from "./set/index.js"; -export * from "./undiscriminated-union/index.js"; -export * from "./union/index.js"; diff --git a/src/core/schemas/builders/lazy/index.ts b/src/core/schemas/builders/lazy/index.ts deleted file mode 100644 index e346ac9..0000000 --- a/src/core/schemas/builders/lazy/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { lazy } from "./lazy.js"; -export type { SchemaGetter } from "./lazy.js"; -export { lazyObject } from "./lazyObject.js"; diff --git a/src/core/schemas/builders/lazy/lazy.ts b/src/core/schemas/builders/lazy/lazy.ts deleted file mode 100644 index c3ec78f..0000000 --- a/src/core/schemas/builders/lazy/lazy.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BaseSchema, Schema } from "../../Schema.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; - -export type SchemaGetter> = () => SchemaType; - -export function lazy(getter: SchemaGetter>): Schema { - const baseSchema = constructLazyBaseSchema(getter); - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} - -export function constructLazyBaseSchema( - getter: SchemaGetter>, -): BaseSchema { - return { - parse: (raw, opts) => getMemoizedSchema(getter).parse(raw, opts), - json: (parsed, opts) => getMemoizedSchema(getter).json(parsed, opts), - getType: () => getMemoizedSchema(getter).getType(), - }; -} - -type MemoizedGetter> = SchemaGetter & { __zurg_memoized?: SchemaType }; - -export function getMemoizedSchema>(getter: SchemaGetter): SchemaType { - const castedGetter = getter as MemoizedGetter; - if (castedGetter.__zurg_memoized == null) { - castedGetter.__zurg_memoized = getter(); - } - return castedGetter.__zurg_memoized; -} diff --git a/src/core/schemas/builders/lazy/lazyObject.ts b/src/core/schemas/builders/lazy/lazyObject.ts deleted file mode 100644 index 0971f92..0000000 --- a/src/core/schemas/builders/lazy/lazyObject.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { getObjectUtils } from "../object/index.js"; -import { getObjectLikeUtils } from "../object-like/index.js"; -import { BaseObjectSchema, ObjectSchema } from "../object/types.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; -import { SchemaGetter, constructLazyBaseSchema, getMemoizedSchema } from "./lazy.js"; - -export function lazyObject(getter: SchemaGetter>): ObjectSchema { - const baseSchema: BaseObjectSchema = { - ...constructLazyBaseSchema(getter), - _getRawProperties: () => getMemoizedSchema(getter)._getRawProperties(), - _getParsedProperties: () => getMemoizedSchema(getter)._getParsedProperties(), - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; -} diff --git a/src/core/schemas/builders/list/index.ts b/src/core/schemas/builders/list/index.ts deleted file mode 100644 index 021f1e4..0000000 --- a/src/core/schemas/builders/list/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { list } from "./list.js"; diff --git a/src/core/schemas/builders/list/list.ts b/src/core/schemas/builders/list/list.ts deleted file mode 100644 index 4cee68e..0000000 --- a/src/core/schemas/builders/list/list.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { BaseSchema, MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; - -export function list(schema: Schema): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => - validateAndTransformArray(raw, (item, index) => - schema.parse(item, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], - }), - ), - json: (parsed, opts) => - validateAndTransformArray(parsed, (item, index) => - schema.json(item, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], - }), - ), - getType: () => SchemaType.LIST, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} - -function validateAndTransformArray( - value: unknown, - transformItem: (item: Raw, index: number) => MaybeValid, -): MaybeValid { - if (!Array.isArray(value)) { - return { - ok: false, - errors: [ - { - message: getErrorMessageForIncorrectType(value, "list"), - path: [], - }, - ], - }; - } - - const maybeValidItems = value.map((item, index) => transformItem(item, index)); - - return maybeValidItems.reduce>( - (acc, item) => { - if (acc.ok && item.ok) { - return { - ok: true, - value: [...acc.value, item.value], - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } - if (!item.ok) { - errors.push(...item.errors); - } - - return { - ok: false, - errors, - }; - }, - { ok: true, value: [] }, - ); -} diff --git a/src/core/schemas/builders/literals/booleanLiteral.ts b/src/core/schemas/builders/literals/booleanLiteral.ts deleted file mode 100644 index 0bebfb5..0000000 --- a/src/core/schemas/builders/literals/booleanLiteral.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Schema, SchemaType } from "../../Schema.js"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; - -export function booleanLiteral(literal: V): Schema { - const schemaCreator = createIdentitySchemaCreator( - SchemaType.BOOLEAN_LITERAL, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (value === literal) { - return { - ok: true, - value: literal, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, `${literal.toString()}`), - }, - ], - }; - } - }, - ); - - return schemaCreator(); -} diff --git a/src/core/schemas/builders/literals/index.ts b/src/core/schemas/builders/literals/index.ts deleted file mode 100644 index fb172c4..0000000 --- a/src/core/schemas/builders/literals/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { stringLiteral } from "./stringLiteral.js"; -export { booleanLiteral } from "./booleanLiteral.js"; diff --git a/src/core/schemas/builders/literals/stringLiteral.ts b/src/core/schemas/builders/literals/stringLiteral.ts deleted file mode 100644 index e3efa7b..0000000 --- a/src/core/schemas/builders/literals/stringLiteral.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Schema, SchemaType } from "../../Schema.js"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; - -export function stringLiteral(literal: V): Schema { - const schemaCreator = createIdentitySchemaCreator( - SchemaType.STRING_LITERAL, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (value === literal) { - return { - ok: true, - value: literal, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, `"${literal}"`), - }, - ], - }; - } - }, - ); - - return schemaCreator(); -} diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts deleted file mode 100644 index 124a082..0000000 --- a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { BaseSchema } from "../../Schema.js"; -import { filterObject } from "../../utils/filterObject.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; -import { isPlainObject } from "../../utils/isPlainObject.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; -import { ObjectLikeSchema, ObjectLikeUtils } from "./types.js"; - -export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { - return { - withParsedProperties: (properties) => withParsedProperties(schema, properties), - }; -} - -/** - * object-like utils are defined in one file to resolve issues with circular imports - */ - -export function withParsedProperties( - objectLike: BaseSchema, - properties: { [K in keyof Properties]: Properties[K] | ((parsed: ParsedObjectShape) => Properties[K]) }, -): ObjectLikeSchema { - const objectSchema: BaseSchema = { - parse: (raw, opts) => { - const parsedObject = objectLike.parse(raw, opts); - if (!parsedObject.ok) { - return parsedObject; - } - - const additionalProperties = Object.entries(properties).reduce>( - (processed, [key, value]) => { - return { - ...processed, - [key]: typeof value === "function" ? value(parsedObject.value) : value, - }; - }, - {}, - ); - - return { - ok: true, - value: { - ...parsedObject.value, - ...(additionalProperties as Properties), - }, - }; - }, - - json: (parsed, opts) => { - if (!isPlainObject(parsed)) { - return { - ok: false, - errors: [ - { - path: opts?.breadcrumbsPrefix ?? [], - message: getErrorMessageForIncorrectType(parsed, "object"), - }, - ], - }; - } - - // strip out added properties - const addedPropertyKeys = new Set(Object.keys(properties)); - const parsedWithoutAddedProperties = filterObject( - parsed, - Object.keys(parsed).filter((key) => !addedPropertyKeys.has(key)), - ); - - return objectLike.json(parsedWithoutAddedProperties as ParsedObjectShape, opts); - }, - - getType: () => objectLike.getType(), - }; - - return { - ...objectSchema, - ...getSchemaUtils(objectSchema), - ...getObjectLikeUtils(objectSchema), - }; -} diff --git a/src/core/schemas/builders/object-like/index.ts b/src/core/schemas/builders/object-like/index.ts deleted file mode 100644 index 2451ef7..0000000 --- a/src/core/schemas/builders/object-like/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { getObjectLikeUtils, withParsedProperties } from "./getObjectLikeUtils.js"; -export type { ObjectLikeSchema, ObjectLikeUtils } from "./types.js"; diff --git a/src/core/schemas/builders/object-like/types.ts b/src/core/schemas/builders/object-like/types.ts deleted file mode 100644 index 5a49242..0000000 --- a/src/core/schemas/builders/object-like/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseSchema, Schema } from "../../Schema.js"; - -export type ObjectLikeSchema = Schema & - BaseSchema & - ObjectLikeUtils; - -export interface ObjectLikeUtils { - withParsedProperties: >(properties: { - [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); - }) => ObjectLikeSchema; -} diff --git a/src/core/schemas/builders/object/index.ts b/src/core/schemas/builders/object/index.ts deleted file mode 100644 index a6337fa..0000000 --- a/src/core/schemas/builders/object/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -export { getObjectUtils, object } from "./object.js"; -export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties.js"; -export type { - inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, - inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, -} from "./objectWithoutOptionalProperties.js"; -export { isProperty, property } from "./property.js"; -export type { Property } from "./property.js"; -export type { - BaseObjectSchema, - inferObjectSchemaFromPropertySchemas, - inferParsedObject, - inferParsedObjectFromPropertySchemas, - inferParsedPropertySchema, - inferRawKey, - inferRawObject, - inferRawObjectFromPropertySchemas, - inferRawPropertySchema, - ObjectSchema, - ObjectUtils, - PropertySchemas, -} from "./types.js"; diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts deleted file mode 100644 index bdb8c89..0000000 --- a/src/core/schemas/builders/object/object.ts +++ /dev/null @@ -1,366 +0,0 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema.js"; -import { entries } from "../../utils/entries.js"; -import { filterObject } from "../../utils/filterObject.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; -import { isPlainObject } from "../../utils/isPlainObject.js"; -import { keys } from "../../utils/keys.js"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation.js"; -import { partition } from "../../utils/partition.js"; -import { getObjectLikeUtils } from "../object-like/index.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; -import { isProperty } from "./property.js"; -import { - BaseObjectSchema, - ObjectSchema, - ObjectUtils, - PropertySchemas, - inferObjectSchemaFromPropertySchemas, - inferParsedObjectFromPropertySchemas, - inferRawObjectFromPropertySchemas, -} from "./types.js"; - -interface ObjectPropertyWithRawKey { - rawKey: string; - parsedKey: string; - valueSchema: Schema; -} - -export function object>( - schemas: T, -): inferObjectSchemaFromPropertySchemas { - const baseSchema: BaseObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectFromPropertySchemas - > = { - _getRawProperties: () => - Object.entries(schemas).map(([parsedKey, propertySchema]) => - isProperty(propertySchema) ? propertySchema.rawKey : parsedKey, - ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], - _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], - - parse: (raw, opts) => { - const rawKeyToProperty: Record = {}; - const requiredKeys: string[] = []; - - for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey; - const valueSchema: Schema = isProperty(schemaOrObjectProperty) - ? schemaOrObjectProperty.valueSchema - : schemaOrObjectProperty; - - const property: ObjectPropertyWithRawKey = { - rawKey, - parsedKey: parsedKey as string, - valueSchema, - }; - - rawKeyToProperty[rawKey] = property; - - if (isSchemaRequired(valueSchema)) { - requiredKeys.push(rawKey); - } - } - - return validateAndTransformObject({ - value: raw, - requiredKeys, - getProperty: (rawKey) => { - const property = rawKeyToProperty[rawKey]; - if (property == null) { - return undefined; - } - return { - transformedKey: property.parsedKey, - transform: (propertyValue) => - property.valueSchema.parse(propertyValue, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawKey], - }), - }; - }, - unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, - skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - omitUndefined: opts?.omitUndefined, - }); - }, - - json: (parsed, opts) => { - const requiredKeys: string[] = []; - - for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const valueSchema: Schema = isProperty(schemaOrObjectProperty) - ? schemaOrObjectProperty.valueSchema - : schemaOrObjectProperty; - - if (isSchemaRequired(valueSchema)) { - requiredKeys.push(parsedKey as string); - } - } - - return validateAndTransformObject({ - value: parsed, - requiredKeys, - getProperty: ( - parsedKey, - ): { transformedKey: string; transform: (propertyValue: object) => MaybeValid } | undefined => { - const property = schemas[parsedKey as keyof T]; - - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (property == null) { - return undefined; - } - - if (isProperty(property)) { - return { - transformedKey: property.rawKey, - transform: (propertyValue) => - property.valueSchema.json(propertyValue, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), - }; - } else { - return { - transformedKey: parsedKey, - transform: (propertyValue) => - property.json(propertyValue, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), - }; - } - }, - unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, - skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - omitUndefined: opts?.omitUndefined, - }); - }, - - getType: () => SchemaType.OBJECT, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; -} - -function validateAndTransformObject({ - value, - requiredKeys, - getProperty, - unrecognizedObjectKeys = "fail", - skipValidation = false, - breadcrumbsPrefix = [], -}: { - value: unknown; - requiredKeys: string[]; - getProperty: ( - preTransformedKey: string, - ) => { transformedKey: string; transform: (propertyValue: object) => MaybeValid } | undefined; - unrecognizedObjectKeys: "fail" | "passthrough" | "strip" | undefined; - skipValidation: boolean | undefined; - breadcrumbsPrefix: string[] | undefined; - omitUndefined: boolean | undefined; -}): MaybeValid { - if (!isPlainObject(value)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "object"), - }, - ], - }; - } - - const missingRequiredKeys = new Set(requiredKeys); - const errors: ValidationError[] = []; - const transformed: Record = {}; - - for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) { - const property = getProperty(preTransformedKey); - - if (property != null) { - missingRequiredKeys.delete(preTransformedKey); - - const value = property.transform(preTransformedItemValue as object); - if (value.ok) { - transformed[property.transformedKey] = value.value; - } else { - transformed[preTransformedKey] = preTransformedItemValue; - errors.push(...value.errors); - } - } else { - switch (unrecognizedObjectKeys) { - case "fail": - errors.push({ - path: [...breadcrumbsPrefix, preTransformedKey], - message: `Unexpected key "${preTransformedKey}"`, - }); - break; - case "strip": - break; - case "passthrough": - transformed[preTransformedKey] = preTransformedItemValue; - break; - } - } - } - - errors.push( - ...requiredKeys - .filter((key) => missingRequiredKeys.has(key)) - .map((key) => ({ - path: breadcrumbsPrefix, - message: `Missing required key "${key}"`, - })), - ); - - if (errors.length === 0 || skipValidation) { - return { - ok: true, - value: transformed as Transformed, - }; - } else { - return { - ok: false, - errors, - }; - } -} - -export function getObjectUtils(schema: BaseObjectSchema): ObjectUtils { - return { - extend: (extension: ObjectSchema) => { - const baseSchema: BaseObjectSchema = { - _getParsedProperties: () => [...schema._getParsedProperties(), ...extension._getParsedProperties()], - _getRawProperties: () => [...schema._getRawProperties(), ...extension._getRawProperties()], - parse: (raw, opts) => { - return validateAndTransformExtendedObject({ - extensionKeys: extension._getRawProperties(), - value: raw as object, - transformBase: (rawBase) => schema.parse(rawBase, opts), - transformExtension: (rawExtension) => extension.parse(rawExtension, opts), - }); - }, - json: (parsed, opts) => { - return validateAndTransformExtendedObject({ - extensionKeys: extension._getParsedProperties(), - value: parsed as object, - transformBase: (parsedBase) => schema.json(parsedBase, opts), - transformExtension: (parsedExtension) => extension.json(parsedExtension, opts), - }); - }, - getType: () => SchemaType.OBJECT, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; - }, - passthrough: () => { - const baseSchema: BaseObjectSchema = - { - _getParsedProperties: () => schema._getParsedProperties(), - _getRawProperties: () => schema._getRawProperties(), - parse: (raw, opts) => { - const transformed = schema.parse(raw, { ...opts, unrecognizedObjectKeys: "passthrough" }); - if (!transformed.ok) { - return transformed; - } - return { - ok: true, - value: { - ...(raw as any), - ...transformed.value, - }, - }; - }, - json: (parsed, opts) => { - const transformed = schema.json(parsed, { ...opts, unrecognizedObjectKeys: "passthrough" }); - if (!transformed.ok) { - return transformed; - } - return { - ok: true, - value: { - ...(parsed as any), - ...transformed.value, - }, - }; - }, - getType: () => SchemaType.OBJECT, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; - }, - }; -} - -function validateAndTransformExtendedObject({ - extensionKeys, - value, - transformBase, - transformExtension, -}: { - extensionKeys: (keyof PreTransformedExtension)[]; - value: object; - transformBase: (value: object) => MaybeValid; - transformExtension: (value: object) => MaybeValid; -}): MaybeValid { - const extensionPropertiesSet = new Set(extensionKeys); - const [extensionProperties, baseProperties] = partition(keys(value), (key) => - extensionPropertiesSet.has(key as keyof PreTransformedExtension), - ); - - const transformedBase = transformBase(filterObject(value, baseProperties)); - const transformedExtension = transformExtension(filterObject(value, extensionProperties)); - - if (transformedBase.ok && transformedExtension.ok) { - return { - ok: true, - value: { - ...transformedBase.value, - ...transformedExtension.value, - }, - }; - } else { - return { - ok: false, - errors: [ - ...(transformedBase.ok ? [] : transformedBase.errors), - ...(transformedExtension.ok ? [] : transformedExtension.errors), - ], - }; - } -} - -function isSchemaRequired(schema: Schema): boolean { - return !isSchemaOptional(schema); -} - -function isSchemaOptional(schema: Schema): boolean { - switch (schema.getType()) { - case SchemaType.ANY: - case SchemaType.UNKNOWN: - case SchemaType.OPTIONAL: - case SchemaType.OPTIONAL_NULLABLE: - return true; - default: - return false; - } -} diff --git a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts deleted file mode 100644 index 5c852be..0000000 --- a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { object } from "./object.js"; -import { - ObjectSchema, - PropertySchemas, - inferParsedPropertySchema, - inferRawObjectFromPropertySchemas, -} from "./types.js"; - -export function objectWithoutOptionalProperties>( - schemas: T, -): inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas { - return object(schemas) as unknown as inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas; -} - -export type inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas> = - ObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas - >; - -export type inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas> = { - [K in keyof T]: inferParsedPropertySchema; -}; diff --git a/src/core/schemas/builders/object/property.ts b/src/core/schemas/builders/object/property.ts deleted file mode 100644 index 4c684fd..0000000 --- a/src/core/schemas/builders/object/property.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Schema } from "../../Schema.js"; - -export function property( - rawKey: RawKey, - valueSchema: Schema, -): Property { - return { - rawKey, - valueSchema, - isProperty: true, - }; -} - -export interface Property { - rawKey: RawKey; - valueSchema: Schema; - isProperty: true; -} - -export function isProperty>(maybeProperty: unknown): maybeProperty is O { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - return (maybeProperty as O).isProperty; -} diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts deleted file mode 100644 index 4c7aa68..0000000 --- a/src/core/schemas/builders/object/types.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { BaseSchema, Schema, inferParsed, inferRaw } from "../../Schema.js"; -import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties.js"; -import { ObjectLikeUtils } from "../object-like/index.js"; -import { SchemaUtils } from "../schema-utils/index.js"; -import { Property } from "./property.js"; - -export type ObjectSchema = BaseObjectSchema & - ObjectLikeUtils & - ObjectUtils & - SchemaUtils; - -export interface BaseObjectSchema extends BaseSchema { - _getRawProperties: () => (keyof Raw)[]; - _getParsedProperties: () => (keyof Parsed)[]; -} - -export interface ObjectUtils { - extend: ( - schemas: ObjectSchema, - ) => ObjectSchema; - passthrough: () => ObjectSchema; -} - -export type inferRawObject> = O extends ObjectSchema ? Raw : never; - -export type inferParsedObject> = - O extends ObjectSchema ? Parsed : never; - -export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectFromPropertySchemas ->; - -export type inferRawObjectFromPropertySchemas> = - addQuestionMarksToNullableProperties<{ - [ParsedKey in keyof T as inferRawKey]: inferRawPropertySchema; - }>; - -export type inferParsedObjectFromPropertySchemas> = - addQuestionMarksToNullableProperties<{ - [K in keyof T]: inferParsedPropertySchema; - }>; - -export type PropertySchemas = Record< - ParsedKeys, - Property | Schema ->; - -export type inferRawPropertySchema

| Schema> = - P extends Property ? Raw : P extends Schema ? inferRaw

: never; - -export type inferParsedPropertySchema

| Schema> = - P extends Property ? Parsed : P extends Schema ? inferParsed

: never; - -export type inferRawKey< - ParsedKey extends string | number | symbol, - P extends Property | Schema, -> = P extends Property ? Raw : ParsedKey; diff --git a/src/core/schemas/builders/primitives/any.ts b/src/core/schemas/builders/primitives/any.ts deleted file mode 100644 index bff7c04..0000000 --- a/src/core/schemas/builders/primitives/any.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { SchemaType } from "../../Schema.js"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator.js"; - -export const any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value })); diff --git a/src/core/schemas/builders/primitives/boolean.ts b/src/core/schemas/builders/primitives/boolean.ts deleted file mode 100644 index 6d93bec..0000000 --- a/src/core/schemas/builders/primitives/boolean.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SchemaType } from "../../Schema.js"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; - -export const boolean = createIdentitySchemaCreator( - SchemaType.BOOLEAN, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (typeof value === "boolean") { - return { - ok: true, - value, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "boolean"), - }, - ], - }; - } - }, -); diff --git a/src/core/schemas/builders/primitives/index.ts b/src/core/schemas/builders/primitives/index.ts deleted file mode 100644 index 462a6d1..0000000 --- a/src/core/schemas/builders/primitives/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { any } from "./any.js"; -export { boolean } from "./boolean.js"; -export { number } from "./number.js"; -export { string } from "./string.js"; -export { unknown } from "./unknown.js"; diff --git a/src/core/schemas/builders/primitives/number.ts b/src/core/schemas/builders/primitives/number.ts deleted file mode 100644 index a927539..0000000 --- a/src/core/schemas/builders/primitives/number.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SchemaType } from "../../Schema.js"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; - -export const number = createIdentitySchemaCreator( - SchemaType.NUMBER, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (typeof value === "number") { - return { - ok: true, - value, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "number"), - }, - ], - }; - } - }, -); diff --git a/src/core/schemas/builders/primitives/string.ts b/src/core/schemas/builders/primitives/string.ts deleted file mode 100644 index fac9cd7..0000000 --- a/src/core/schemas/builders/primitives/string.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SchemaType } from "../../Schema.js"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; - -export const string = createIdentitySchemaCreator( - SchemaType.STRING, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (typeof value === "string") { - return { - ok: true, - value, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "string"), - }, - ], - }; - } - }, -); diff --git a/src/core/schemas/builders/primitives/unknown.ts b/src/core/schemas/builders/primitives/unknown.ts deleted file mode 100644 index 4df0a6c..0000000 --- a/src/core/schemas/builders/primitives/unknown.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { SchemaType } from "../../Schema.js"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator.js"; - -export const unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value })); diff --git a/src/core/schemas/builders/record/index.ts b/src/core/schemas/builders/record/index.ts deleted file mode 100644 index b17997f..0000000 --- a/src/core/schemas/builders/record/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { record } from "./record.js"; -export type { BaseRecordSchema, RecordSchema } from "./types.js"; diff --git a/src/core/schemas/builders/record/record.ts b/src/core/schemas/builders/record/record.ts deleted file mode 100644 index de1d7e1..0000000 --- a/src/core/schemas/builders/record/record.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema.js"; -import { entries } from "../../utils/entries.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; -import { isPlainObject } from "../../utils/isPlainObject.js"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; -import { BaseRecordSchema, RecordSchema } from "./types.js"; - -export function record( - keySchema: Schema, - valueSchema: Schema, -): RecordSchema { - const baseSchema: BaseRecordSchema = { - parse: (raw, opts) => { - return validateAndTransformRecord({ - value: raw, - isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, - transformKey: (key) => - keySchema.parse(key, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], - }), - transformValue: (value, key) => - valueSchema.parse(value, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], - }), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - json: (parsed, opts) => { - return validateAndTransformRecord({ - value: parsed, - isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, - transformKey: (key) => - keySchema.json(key, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], - }), - transformValue: (value, key) => - valueSchema.json(value, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], - }), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - getType: () => SchemaType.RECORD, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} - -function validateAndTransformRecord({ - value, - isKeyNumeric, - transformKey, - transformValue, - breadcrumbsPrefix = [], -}: { - value: unknown; - isKeyNumeric: boolean; - transformKey: (key: string | number) => MaybeValid; - transformValue: (value: unknown, key: string | number) => MaybeValid; - breadcrumbsPrefix: string[] | undefined; -}): MaybeValid> { - if (!isPlainObject(value)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "object"), - }, - ], - }; - } - - return entries(value).reduce>>( - (accPromise, [stringKey, value]) => { - if (value === undefined) { - return accPromise; - } - - const acc = accPromise; - - let key: string | number = stringKey; - if (isKeyNumeric) { - const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; - if (!isNaN(numberKey)) { - key = numberKey; - } - } - const transformedKey = transformKey(key); - - const transformedValue = transformValue(value, key); - - if (acc.ok && transformedKey.ok && transformedValue.ok) { - return { - ok: true, - value: { - ...acc.value, - [transformedKey.value]: transformedValue.value, - }, - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } - if (!transformedKey.ok) { - errors.push(...transformedKey.errors); - } - if (!transformedValue.ok) { - errors.push(...transformedValue.errors); - } - - return { - ok: false, - errors, - }; - }, - { ok: true, value: {} as Record }, - ); -} diff --git a/src/core/schemas/builders/record/types.ts b/src/core/schemas/builders/record/types.ts deleted file mode 100644 index e629d5b..0000000 --- a/src/core/schemas/builders/record/types.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { BaseSchema } from "../../Schema.js"; -import { SchemaUtils } from "../schema-utils/index.js"; - -export type RecordSchema< - RawKey extends string | number, - RawValue, - ParsedKey extends string | number, - ParsedValue, -> = BaseRecordSchema & - SchemaUtils, Record>; - -export type BaseRecordSchema< - RawKey extends string | number, - RawValue, - ParsedKey extends string | number, - ParsedValue, -> = BaseSchema, Record>; diff --git a/src/core/schemas/builders/schema-utils/JsonError.ts b/src/core/schemas/builders/schema-utils/JsonError.ts deleted file mode 100644 index 14adcb7..0000000 --- a/src/core/schemas/builders/schema-utils/JsonError.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationError } from "../../Schema.js"; -import { stringifyValidationError } from "./stringifyValidationErrors.js"; - -export class JsonError extends Error { - constructor(public readonly errors: ValidationError[]) { - super(errors.map(stringifyValidationError).join("; ")); - Object.setPrototypeOf(this, JsonError.prototype); - } -} diff --git a/src/core/schemas/builders/schema-utils/ParseError.ts b/src/core/schemas/builders/schema-utils/ParseError.ts deleted file mode 100644 index 052a1d3..0000000 --- a/src/core/schemas/builders/schema-utils/ParseError.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationError } from "../../Schema.js"; -import { stringifyValidationError } from "./stringifyValidationErrors.js"; - -export class ParseError extends Error { - constructor(public readonly errors: ValidationError[]) { - super(errors.map(stringifyValidationError).join("; ")); - Object.setPrototypeOf(this, ParseError.prototype); - } -} diff --git a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts deleted file mode 100644 index 0087b66..0000000 --- a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { BaseSchema, Schema, SchemaOptions, SchemaType } from "../../Schema.js"; -import { JsonError } from "./JsonError.js"; -import { ParseError } from "./ParseError.js"; - -export interface SchemaUtils { - nullable: () => Schema; - optional: () => Schema; - optionalNullable: () => Schema; - transform: (transformer: SchemaTransformer) => Schema; - parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Parsed; - jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Raw; -} - -export interface SchemaTransformer { - transform: (parsed: Parsed) => Transformed; - untransform: (transformed: any) => Parsed; -} - -export function getSchemaUtils(schema: BaseSchema): SchemaUtils { - return { - nullable: () => nullable(schema), - optional: () => optional(schema), - optionalNullable: () => optionalNullable(schema), - transform: (transformer) => transform(schema, transformer), - parseOrThrow: (raw, opts) => { - const parsed = schema.parse(raw, opts); - if (parsed.ok) { - return parsed.value; - } - throw new ParseError(parsed.errors); - }, - jsonOrThrow: (parsed, opts) => { - const raw = schema.json(parsed, opts); - if (raw.ok) { - return raw.value; - } - throw new JsonError(raw.errors); - }, - }; -} - -/** - * schema utils are defined in one file to resolve issues with circular imports - */ - -export function nullable(schema: BaseSchema): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => { - if (raw == null) { - return { - ok: true, - value: null, - }; - } - return schema.parse(raw, opts); - }, - json: (parsed, opts) => { - if (parsed == null) { - return { - ok: true, - value: null, - }; - } - return schema.json(parsed, opts); - }, - getType: () => SchemaType.NULLABLE, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} - -export function optional( - schema: BaseSchema, -): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => { - if (raw == null) { - return { - ok: true, - value: undefined, - }; - } - return schema.parse(raw, opts); - }, - json: (parsed, opts) => { - if (opts?.omitUndefined && parsed === undefined) { - return { - ok: true, - value: undefined, - }; - } - if (parsed == null) { - return { - ok: true, - value: null, - }; - } - return schema.json(parsed, opts); - }, - getType: () => SchemaType.OPTIONAL, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} - -export function optionalNullable( - schema: BaseSchema, -): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => { - if (raw === undefined) { - return { - ok: true, - value: undefined, - }; - } - if (raw === null) { - return { - ok: true, - value: null, - }; - } - return schema.parse(raw, opts); - }, - json: (parsed, opts) => { - if (parsed === undefined) { - return { - ok: true, - value: undefined, - }; - } - if (parsed === null) { - return { - ok: true, - value: null, - }; - } - return schema.json(parsed, opts); - }, - getType: () => SchemaType.OPTIONAL_NULLABLE, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} - -export function transform( - schema: BaseSchema, - transformer: SchemaTransformer, -): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => { - const parsed = schema.parse(raw, opts); - if (!parsed.ok) { - return parsed; - } - return { - ok: true, - value: transformer.transform(parsed.value), - }; - }, - json: (transformed, opts) => { - const parsed = transformer.untransform(transformed); - return schema.json(parsed, opts); - }, - getType: () => schema.getType(), - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} diff --git a/src/core/schemas/builders/schema-utils/index.ts b/src/core/schemas/builders/schema-utils/index.ts deleted file mode 100644 index 43ea008..0000000 --- a/src/core/schemas/builders/schema-utils/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { getSchemaUtils, optional, transform } from "./getSchemaUtils.js"; -export type { SchemaUtils } from "./getSchemaUtils.js"; -export { JsonError } from "./JsonError.js"; -export { ParseError } from "./ParseError.js"; diff --git a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts deleted file mode 100644 index 4252fb2..0000000 --- a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ValidationError } from "../../Schema.js"; - -export function stringifyValidationError(error: ValidationError): string { - if (error.path.length === 0) { - return error.message; - } - return `${error.path.join(" -> ")}: ${error.message}`; -} diff --git a/src/core/schemas/builders/set/index.ts b/src/core/schemas/builders/set/index.ts deleted file mode 100644 index c72be55..0000000 --- a/src/core/schemas/builders/set/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { set } from "./set.js"; diff --git a/src/core/schemas/builders/set/set.ts b/src/core/schemas/builders/set/set.ts deleted file mode 100644 index 8cce552..0000000 --- a/src/core/schemas/builders/set/set.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation.js"; -import { list } from "../list/index.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; - -export function set(schema: Schema): Schema> { - const listSchema = list(schema); - const baseSchema: BaseSchema> = { - parse: (raw, opts) => { - const parsedList = listSchema.parse(raw, opts); - if (parsedList.ok) { - return { - ok: true, - value: new Set(parsedList.value), - }; - } else { - return parsedList; - } - }, - json: (parsed, opts) => { - if (!(parsed instanceof Set)) { - return { - ok: false, - errors: [ - { - path: opts?.breadcrumbsPrefix ?? [], - message: getErrorMessageForIncorrectType(parsed, "Set"), - }, - ], - }; - } - const jsonList = listSchema.json([...parsed], opts); - return jsonList; - }, - getType: () => SchemaType.SET, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} diff --git a/src/core/schemas/builders/undiscriminated-union/index.ts b/src/core/schemas/builders/undiscriminated-union/index.ts deleted file mode 100644 index c831822..0000000 --- a/src/core/schemas/builders/undiscriminated-union/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type { - inferParsedUnidiscriminatedUnionSchema, - inferRawUnidiscriminatedUnionSchema, - UndiscriminatedUnionSchema, -} from "./types.js"; -export { undiscriminatedUnion } from "./undiscriminatedUnion.js"; diff --git a/src/core/schemas/builders/undiscriminated-union/types.ts b/src/core/schemas/builders/undiscriminated-union/types.ts deleted file mode 100644 index ec6ad43..0000000 --- a/src/core/schemas/builders/undiscriminated-union/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Schema, inferParsed, inferRaw } from "../../Schema.js"; - -export type UndiscriminatedUnionSchema = Schema< - inferRawUnidiscriminatedUnionSchema, - inferParsedUnidiscriminatedUnionSchema ->; - -export type inferRawUnidiscriminatedUnionSchema = inferRaw; - -export type inferParsedUnidiscriminatedUnionSchema = inferParsed; diff --git a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts deleted file mode 100644 index f5fdb15..0000000 --- a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType, ValidationError } from "../../Schema.js"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; -import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types.js"; - -export function undiscriminatedUnion, ...Schema[]]>( - schemas: Schemas, -): Schema, inferParsedUnidiscriminatedUnionSchema> { - const baseSchema: BaseSchema< - inferRawUnidiscriminatedUnionSchema, - inferParsedUnidiscriminatedUnionSchema - > = { - parse: (raw, opts) => { - return validateAndTransformUndiscriminatedUnion>( - (schema, opts) => schema.parse(raw, opts), - schemas, - opts, - ); - }, - json: (parsed, opts) => { - return validateAndTransformUndiscriminatedUnion>( - (schema, opts) => schema.json(parsed, opts), - schemas, - opts, - ); - }, - getType: () => SchemaType.UNDISCRIMINATED_UNION, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} - -function validateAndTransformUndiscriminatedUnion( - transform: (schema: Schema, opts: SchemaOptions) => MaybeValid, - schemas: Schema[], - opts: SchemaOptions | undefined, -): MaybeValid { - const errors: ValidationError[] = []; - for (const [index, schema] of schemas.entries()) { - const transformed = transform(schema, { ...opts, skipValidation: false }); - if (transformed.ok) { - return transformed; - } else { - for (const error of transformed.errors) { - errors.push({ - path: error.path, - message: `[Variant ${index}] ${error.message}`, - }); - } - } - } - - return { - ok: false, - errors, - }; -} diff --git a/src/core/schemas/builders/union/discriminant.ts b/src/core/schemas/builders/union/discriminant.ts deleted file mode 100644 index 73cd62a..0000000 --- a/src/core/schemas/builders/union/discriminant.ts +++ /dev/null @@ -1,14 +0,0 @@ -export function discriminant( - parsedDiscriminant: ParsedDiscriminant, - rawDiscriminant: RawDiscriminant, -): Discriminant { - return { - parsedDiscriminant, - rawDiscriminant, - }; -} - -export interface Discriminant { - parsedDiscriminant: ParsedDiscriminant; - rawDiscriminant: RawDiscriminant; -} diff --git a/src/core/schemas/builders/union/index.ts b/src/core/schemas/builders/union/index.ts deleted file mode 100644 index 7b48775..0000000 --- a/src/core/schemas/builders/union/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export { discriminant } from "./discriminant.js"; -export type { Discriminant } from "./discriminant.js"; -export type { - inferParsedDiscriminant, - inferParsedUnion, - inferRawDiscriminant, - inferRawUnion, - UnionSubtypes, -} from "./types.js"; -export { union } from "./union.js"; diff --git a/src/core/schemas/builders/union/types.ts b/src/core/schemas/builders/union/types.ts deleted file mode 100644 index bf19fa2..0000000 --- a/src/core/schemas/builders/union/types.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ObjectSchema, inferParsedObject, inferRawObject } from "../object/index.js"; -import { Discriminant } from "./discriminant.js"; - -export type UnionSubtypes = { - [K in DiscriminantValues]: ObjectSchema; -}; - -export type inferRawUnion, U extends UnionSubtypes> = { - [K in keyof U]: Record, K> & inferRawObject; -}[keyof U]; - -export type inferParsedUnion, U extends UnionSubtypes> = { - [K in keyof U]: Record, K> & inferParsedObject; -}[keyof U]; - -export type inferRawDiscriminant> = D extends string - ? D - : D extends Discriminant - ? Raw - : never; - -export type inferParsedDiscriminant> = D extends string - ? D - : D extends Discriminant - ? Parsed - : never; diff --git a/src/core/schemas/builders/union/union.ts b/src/core/schemas/builders/union/union.ts deleted file mode 100644 index df33568..0000000 --- a/src/core/schemas/builders/union/union.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { BaseSchema, MaybeValid, SchemaType } from "../../Schema.js"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; -import { isPlainObject } from "../../utils/isPlainObject.js"; -import { keys } from "../../utils/keys.js"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation.js"; -import { enum_ } from "../enum/index.js"; -import { ObjectSchema } from "../object/index.js"; -import { ObjectLikeSchema, getObjectLikeUtils } from "../object-like/index.js"; -import { getSchemaUtils } from "../schema-utils/index.js"; -import { Discriminant } from "./discriminant.js"; -import { - UnionSubtypes, - inferParsedDiscriminant, - inferParsedUnion, - inferRawDiscriminant, - inferRawUnion, -} from "./types.js"; - -export function union, U extends UnionSubtypes>( - discriminant: D, - union: U, -): ObjectLikeSchema, inferParsedUnion> { - const rawDiscriminant = - typeof discriminant === "string" ? discriminant : (discriminant.rawDiscriminant as inferRawDiscriminant); - const parsedDiscriminant = - typeof discriminant === "string" - ? discriminant - : (discriminant.parsedDiscriminant as inferParsedDiscriminant); - - const discriminantValueSchema = enum_(keys(union) as string[]); - - const baseSchema: BaseSchema, inferParsedUnion> = { - parse: (raw, opts) => { - return transformAndValidateUnion({ - value: raw, - discriminant: rawDiscriminant, - transformedDiscriminant: parsedDiscriminant, - transformDiscriminantValue: (discriminantValue) => - discriminantValueSchema.parse(discriminantValue, { - allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawDiscriminant], - }), - getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], - allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, - transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => - additionalPropertiesSchema.parse(additionalProperties, opts), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - json: (parsed, opts) => { - return transformAndValidateUnion({ - value: parsed, - discriminant: parsedDiscriminant, - transformedDiscriminant: rawDiscriminant, - transformDiscriminantValue: (discriminantValue) => - discriminantValueSchema.json(discriminantValue, { - allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedDiscriminant], - }), - getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], - allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, - transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => - additionalPropertiesSchema.json(additionalProperties, opts), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - getType: () => SchemaType.UNION, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - }; -} - -function transformAndValidateUnion< - TransformedDiscriminant extends string, - TransformedDiscriminantValue extends string, - TransformedAdditionalProperties, ->({ - value, - discriminant, - transformedDiscriminant, - transformDiscriminantValue, - getAdditionalPropertiesSchema, - allowUnrecognizedUnionMembers = false, - transformAdditionalProperties, - breadcrumbsPrefix = [], -}: { - value: unknown; - discriminant: string; - transformedDiscriminant: TransformedDiscriminant; - transformDiscriminantValue: (discriminantValue: unknown) => MaybeValid; - getAdditionalPropertiesSchema: (discriminantValue: string) => ObjectSchema | undefined; - allowUnrecognizedUnionMembers: boolean | undefined; - transformAdditionalProperties: ( - additionalProperties: unknown, - additionalPropertiesSchema: ObjectSchema, - ) => MaybeValid; - breadcrumbsPrefix: string[] | undefined; -}): MaybeValid & TransformedAdditionalProperties> { - if (!isPlainObject(value)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "object"), - }, - ], - }; - } - - const { [discriminant]: discriminantValue, ...additionalProperties } = value; - - if (discriminantValue == null) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: `Missing discriminant ("${discriminant}")`, - }, - ], - }; - } - - const transformedDiscriminantValue = transformDiscriminantValue(discriminantValue); - if (!transformedDiscriminantValue.ok) { - return { - ok: false, - errors: transformedDiscriminantValue.errors, - }; - } - - const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value); - - if (additionalPropertiesSchema == null) { - if (allowUnrecognizedUnionMembers) { - return { - ok: true, - value: { - [transformedDiscriminant]: transformedDiscriminantValue.value, - ...additionalProperties, - } as Record & TransformedAdditionalProperties, - }; - } else { - return { - ok: false, - errors: [ - { - path: [...breadcrumbsPrefix, discriminant], - message: "Unexpected discriminant value", - }, - ], - }; - } - } - - const transformedAdditionalProperties = transformAdditionalProperties( - additionalProperties, - additionalPropertiesSchema, - ); - if (!transformedAdditionalProperties.ok) { - return transformedAdditionalProperties; - } - - return { - ok: true, - value: { - [transformedDiscriminant]: discriminantValue, - ...transformedAdditionalProperties.value, - } as Record & TransformedAdditionalProperties, - }; -} diff --git a/src/core/schemas/index.ts b/src/core/schemas/index.ts deleted file mode 100644 index befac2e..0000000 --- a/src/core/schemas/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./builders/index.js"; -export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema.js"; diff --git a/src/core/schemas/utils/MaybePromise.ts b/src/core/schemas/utils/MaybePromise.ts deleted file mode 100644 index 9cd354b..0000000 --- a/src/core/schemas/utils/MaybePromise.ts +++ /dev/null @@ -1 +0,0 @@ -export type MaybePromise = T | Promise; diff --git a/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts b/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts deleted file mode 100644 index 59f9e65..0000000 --- a/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type addQuestionMarksToNullableProperties = { - [K in OptionalKeys]?: T[K]; -} & Pick>; - -export type OptionalKeys = { - [K in keyof T]-?: undefined extends T[K] ? K : never; -}[keyof T]; - -export type RequiredKeys = Exclude>; diff --git a/src/core/schemas/utils/createIdentitySchemaCreator.ts b/src/core/schemas/utils/createIdentitySchemaCreator.ts deleted file mode 100644 index 729c51c..0000000 --- a/src/core/schemas/utils/createIdentitySchemaCreator.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema.js"; -import { getSchemaUtils } from "../builders/schema-utils/index.js"; -import { maybeSkipValidation } from "./maybeSkipValidation.js"; - -export function createIdentitySchemaCreator( - schemaType: SchemaType, - validate: (value: unknown, opts?: SchemaOptions) => MaybeValid, -): () => Schema { - return () => { - const baseSchema: BaseSchema = { - parse: validate, - json: validate, - getType: () => schemaType, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; - }; -} diff --git a/src/core/schemas/utils/entries.ts b/src/core/schemas/utils/entries.ts deleted file mode 100644 index 2d5c93d..0000000 --- a/src/core/schemas/utils/entries.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function entries(object: T): [keyof T, T[keyof T]][] { - return Object.entries(object) as [keyof T, T[keyof T]][]; -} diff --git a/src/core/schemas/utils/filterObject.ts b/src/core/schemas/utils/filterObject.ts deleted file mode 100644 index 70527d1..0000000 --- a/src/core/schemas/utils/filterObject.ts +++ /dev/null @@ -1,13 +0,0 @@ -export function filterObject(obj: T, keysToInclude: K[]): Pick { - const keysToIncludeSet = new Set(keysToInclude); - return Object.entries(obj).reduce( - (acc, [key, value]) => { - if (keysToIncludeSet.has(key as K)) { - acc[key as K] = value as T[K]; - } - return acc; - // eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter - }, - {} as Pick, - ); -} diff --git a/src/core/schemas/utils/getErrorMessageForIncorrectType.ts b/src/core/schemas/utils/getErrorMessageForIncorrectType.ts deleted file mode 100644 index 1a5c310..0000000 --- a/src/core/schemas/utils/getErrorMessageForIncorrectType.ts +++ /dev/null @@ -1,25 +0,0 @@ -export function getErrorMessageForIncorrectType(value: unknown, expectedType: string): string { - return `Expected ${expectedType}. Received ${getTypeAsString(value)}.`; -} - -function getTypeAsString(value: unknown): string { - if (Array.isArray(value)) { - return "list"; - } - if (value === null) { - return "null"; - } - if (value instanceof BigInt) { - return "BigInt"; - } - switch (typeof value) { - case "string": - return `"${value}"`; - case "bigint": - case "number": - case "boolean": - case "undefined": - return `${value}`; - } - return typeof value; -} diff --git a/src/core/schemas/utils/isPlainObject.ts b/src/core/schemas/utils/isPlainObject.ts deleted file mode 100644 index db82a72..0000000 --- a/src/core/schemas/utils/isPlainObject.ts +++ /dev/null @@ -1,17 +0,0 @@ -// borrowed from https://github.com/lodash/lodash/blob/master/isPlainObject.js -export function isPlainObject(value: unknown): value is Record { - if (typeof value !== "object" || value === null) { - return false; - } - - if (Object.getPrototypeOf(value) === null) { - return true; - } - - let proto = value; - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto); - } - - return Object.getPrototypeOf(value) === proto; -} diff --git a/src/core/schemas/utils/keys.ts b/src/core/schemas/utils/keys.ts deleted file mode 100644 index 2e0930e..0000000 --- a/src/core/schemas/utils/keys.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function keys(object: T): (keyof T)[] { - return Object.keys(object) as (keyof T)[]; -} diff --git a/src/core/schemas/utils/maybeSkipValidation.ts b/src/core/schemas/utils/maybeSkipValidation.ts deleted file mode 100644 index c7fd6d9..0000000 --- a/src/core/schemas/utils/maybeSkipValidation.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { BaseSchema, MaybeValid, SchemaOptions } from "../Schema.js"; - -export function maybeSkipValidation, Raw, Parsed>(schema: S): S { - return { - ...schema, - json: transformAndMaybeSkipValidation(schema.json), - parse: transformAndMaybeSkipValidation(schema.parse), - }; -} - -function transformAndMaybeSkipValidation( - transform: (value: unknown, opts?: SchemaOptions) => MaybeValid, -): (value: unknown, opts?: SchemaOptions) => MaybeValid { - return (value, opts): MaybeValid => { - const transformed = transform(value, opts); - const { skipValidation = false } = opts ?? {}; - if (!transformed.ok && skipValidation) { - // biome-ignore lint/suspicious/noConsole: allow console - console.warn( - [ - "Failed to validate.", - ...transformed.errors.map( - (error) => - " - " + - (error.path.length > 0 ? `${error.path.join(".")}: ${error.message}` : error.message), - ), - ].join("\n"), - ); - - return { - ok: true, - value: value as T, - }; - } else { - return transformed; - } - }; -} diff --git a/src/core/schemas/utils/partition.ts b/src/core/schemas/utils/partition.ts deleted file mode 100644 index f58d6f3..0000000 --- a/src/core/schemas/utils/partition.ts +++ /dev/null @@ -1,12 +0,0 @@ -export function partition(items: readonly T[], predicate: (item: T) => boolean): [T[], T[]] { - const trueItems: T[] = [], - falseItems: T[] = []; - for (const item of items) { - if (predicate(item)) { - trueItems.push(item); - } else { - falseItems.push(item); - } - } - return [trueItems, falseItems]; -} diff --git a/src/serialization/index.ts b/src/serialization/index.ts deleted file mode 100644 index ba75aa0..0000000 --- a/src/serialization/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./resources/index.js"; -export * from "./types/index.js"; diff --git a/src/serialization/resources/accounts/client/index.ts b/src/serialization/resources/accounts/client/index.ts deleted file mode 100644 index 195f9aa..0000000 --- a/src/serialization/resources/accounts/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/accounts/client/requests/CreateAccountOpts.ts b/src/serialization/resources/accounts/client/requests/CreateAccountOpts.ts deleted file mode 100644 index 7b57e2f..0000000 --- a/src/serialization/resources/accounts/client/requests/CreateAccountOpts.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Pipedream from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; - -export const CreateAccountOpts: core.serialization.Schema< - serializers.CreateAccountOpts.Raw, - Omit -> = core.serialization.object({ - appSlug: core.serialization.property("app_slug", core.serialization.string()), - cfmapJson: core.serialization.property("cfmap_json", core.serialization.string()), - connectToken: core.serialization.property("connect_token", core.serialization.string()), - name: core.serialization.string().optional(), -}); - -export declare namespace CreateAccountOpts { - export interface Raw { - app_slug: string; - cfmap_json: string; - connect_token: string; - name?: string | null; - } -} diff --git a/src/serialization/resources/accounts/client/requests/index.ts b/src/serialization/resources/accounts/client/requests/index.ts deleted file mode 100644 index f61732b..0000000 --- a/src/serialization/resources/accounts/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { CreateAccountOpts } from "./CreateAccountOpts.js"; diff --git a/src/serialization/resources/accounts/index.ts b/src/serialization/resources/accounts/index.ts deleted file mode 100644 index 914b8c3..0000000 --- a/src/serialization/resources/accounts/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/actions/client/index.ts b/src/serialization/resources/actions/client/index.ts deleted file mode 100644 index 195f9aa..0000000 --- a/src/serialization/resources/actions/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/actions/client/requests/RunActionOpts.ts b/src/serialization/resources/actions/client/requests/RunActionOpts.ts deleted file mode 100644 index e0eca73..0000000 --- a/src/serialization/resources/actions/client/requests/RunActionOpts.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Pipedream from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import { RunActionOptsStashId } from "../../../../types/RunActionOptsStashId.js"; - -export const RunActionOpts: core.serialization.Schema = - core.serialization.object({ - id: core.serialization.string(), - externalUserId: core.serialization.property("external_user_id", core.serialization.string()), - configuredProps: core.serialization.property( - "configured_props", - core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - ), - dynamicPropsId: core.serialization.property("dynamic_props_id", core.serialization.string().optional()), - stashId: core.serialization.property("stash_id", RunActionOptsStashId.optional()), - }); - -export declare namespace RunActionOpts { - export interface Raw { - id: string; - external_user_id: string; - configured_props?: Record | null; - dynamic_props_id?: string | null; - stash_id?: RunActionOptsStashId.Raw | null; - } -} diff --git a/src/serialization/resources/actions/client/requests/index.ts b/src/serialization/resources/actions/client/requests/index.ts deleted file mode 100644 index c408c11..0000000 --- a/src/serialization/resources/actions/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { RunActionOpts } from "./RunActionOpts.js"; diff --git a/src/serialization/resources/actions/index.ts b/src/serialization/resources/actions/index.ts deleted file mode 100644 index 914b8c3..0000000 --- a/src/serialization/resources/actions/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/apps/index.ts b/src/serialization/resources/apps/index.ts deleted file mode 100644 index 2f88e30..0000000 --- a/src/serialization/resources/apps/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./types/index.js"; diff --git a/src/serialization/resources/apps/types/AppsListRequestSortDirection.ts b/src/serialization/resources/apps/types/AppsListRequestSortDirection.ts deleted file mode 100644 index db81d9c..0000000 --- a/src/serialization/resources/apps/types/AppsListRequestSortDirection.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../index.js"; -import * as Pipedream from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; - -export const AppsListRequestSortDirection: core.serialization.Schema< - serializers.AppsListRequestSortDirection.Raw, - Pipedream.AppsListRequestSortDirection -> = core.serialization.enum_(["asc", "desc"]); - -export declare namespace AppsListRequestSortDirection { - export type Raw = "asc" | "desc"; -} diff --git a/src/serialization/resources/apps/types/AppsListRequestSortKey.ts b/src/serialization/resources/apps/types/AppsListRequestSortKey.ts deleted file mode 100644 index 7db0bb9..0000000 --- a/src/serialization/resources/apps/types/AppsListRequestSortKey.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../index.js"; -import * as Pipedream from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; - -export const AppsListRequestSortKey: core.serialization.Schema< - serializers.AppsListRequestSortKey.Raw, - Pipedream.AppsListRequestSortKey -> = core.serialization.enum_(["name", "name_slug", "featured_weight"]); - -export declare namespace AppsListRequestSortKey { - export type Raw = "name" | "name_slug" | "featured_weight"; -} diff --git a/src/serialization/resources/apps/types/index.ts b/src/serialization/resources/apps/types/index.ts deleted file mode 100644 index e1d0954..0000000 --- a/src/serialization/resources/apps/types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./AppsListRequestSortKey.js"; -export * from "./AppsListRequestSortDirection.js"; diff --git a/src/serialization/resources/deployedTriggers/client/index.ts b/src/serialization/resources/deployedTriggers/client/index.ts deleted file mode 100644 index 195f9aa..0000000 --- a/src/serialization/resources/deployedTriggers/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerOpts.ts b/src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerOpts.ts deleted file mode 100644 index 2c827fc..0000000 --- a/src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerOpts.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Pipedream from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; - -export const UpdateTriggerOpts: core.serialization.Schema< - serializers.UpdateTriggerOpts.Raw, - Omit -> = core.serialization.object({ - active: core.serialization.boolean().optional(), - configuredProps: core.serialization.property( - "configured_props", - core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - ), - name: core.serialization.string().optional(), -}); - -export declare namespace UpdateTriggerOpts { - export interface Raw { - active?: boolean | null; - configured_props?: Record | null; - name?: string | null; - } -} diff --git a/src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerWebhooksOpts.ts b/src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerWebhooksOpts.ts deleted file mode 100644 index 91a56ae..0000000 --- a/src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerWebhooksOpts.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Pipedream from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; - -export const UpdateTriggerWebhooksOpts: core.serialization.Schema< - serializers.UpdateTriggerWebhooksOpts.Raw, - Omit -> = core.serialization.object({ - webhookUrls: core.serialization.property("webhook_urls", core.serialization.list(core.serialization.string())), -}); - -export declare namespace UpdateTriggerWebhooksOpts { - export interface Raw { - webhook_urls: string[]; - } -} diff --git a/src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerWorkflowsOpts.ts b/src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerWorkflowsOpts.ts deleted file mode 100644 index 1e0d44e..0000000 --- a/src/serialization/resources/deployedTriggers/client/requests/UpdateTriggerWorkflowsOpts.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Pipedream from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; - -export const UpdateTriggerWorkflowsOpts: core.serialization.Schema< - serializers.UpdateTriggerWorkflowsOpts.Raw, - Omit -> = core.serialization.object({ - workflowIds: core.serialization.property("workflow_ids", core.serialization.list(core.serialization.string())), -}); - -export declare namespace UpdateTriggerWorkflowsOpts { - export interface Raw { - workflow_ids: string[]; - } -} diff --git a/src/serialization/resources/deployedTriggers/client/requests/index.ts b/src/serialization/resources/deployedTriggers/client/requests/index.ts deleted file mode 100644 index 8944f4a..0000000 --- a/src/serialization/resources/deployedTriggers/client/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { UpdateTriggerOpts } from "./UpdateTriggerOpts.js"; -export { UpdateTriggerWorkflowsOpts } from "./UpdateTriggerWorkflowsOpts.js"; -export { UpdateTriggerWebhooksOpts } from "./UpdateTriggerWebhooksOpts.js"; diff --git a/src/serialization/resources/deployedTriggers/index.ts b/src/serialization/resources/deployedTriggers/index.ts deleted file mode 100644 index 914b8c3..0000000 --- a/src/serialization/resources/deployedTriggers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts deleted file mode 100644 index d05b8d6..0000000 --- a/src/serialization/resources/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export * as apps from "./apps/index.js"; -export * from "./apps/types/index.js"; -export * as proxy from "./proxy/index.js"; -export * as accounts from "./accounts/index.js"; -export * from "./accounts/client/requests/index.js"; -export * as actions from "./actions/index.js"; -export * from "./actions/client/requests/index.js"; -export * as triggers from "./triggers/index.js"; -export * from "./triggers/client/requests/index.js"; -export * as deployedTriggers from "./deployedTriggers/index.js"; -export * from "./deployedTriggers/client/requests/index.js"; -export * as tokens from "./tokens/index.js"; -export * from "./tokens/client/requests/index.js"; -export * as oauthTokens from "./oauthTokens/index.js"; -export * from "./oauthTokens/client/requests/index.js"; diff --git a/src/serialization/resources/oauthTokens/client/index.ts b/src/serialization/resources/oauthTokens/client/index.ts deleted file mode 100644 index 195f9aa..0000000 --- a/src/serialization/resources/oauthTokens/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts b/src/serialization/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts deleted file mode 100644 index 8811d51..0000000 --- a/src/serialization/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Pipedream from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; - -export const CreateOAuthTokenOpts: core.serialization.Schema< - serializers.CreateOAuthTokenOpts.Raw, - Pipedream.CreateOAuthTokenOpts -> = core.serialization.object({ - clientId: core.serialization.property("client_id", core.serialization.string()), - clientSecret: core.serialization.property("client_secret", core.serialization.string()), -}); - -export declare namespace CreateOAuthTokenOpts { - export interface Raw { - client_id: string; - client_secret: string; - } -} diff --git a/src/serialization/resources/oauthTokens/client/requests/index.ts b/src/serialization/resources/oauthTokens/client/requests/index.ts deleted file mode 100644 index c478882..0000000 --- a/src/serialization/resources/oauthTokens/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { CreateOAuthTokenOpts } from "./CreateOAuthTokenOpts.js"; diff --git a/src/serialization/resources/oauthTokens/index.ts b/src/serialization/resources/oauthTokens/index.ts deleted file mode 100644 index 914b8c3..0000000 --- a/src/serialization/resources/oauthTokens/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/proxy/client/index.ts b/src/serialization/resources/proxy/client/index.ts deleted file mode 100644 index e13716c..0000000 --- a/src/serialization/resources/proxy/client/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * as post from "./post.js"; -export * as put from "./put.js"; -export * as patch from "./patch.js"; diff --git a/src/serialization/resources/proxy/client/patch.ts b/src/serialization/resources/proxy/client/patch.ts deleted file mode 100644 index f342b83..0000000 --- a/src/serialization/resources/proxy/client/patch.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../index.js"; -import * as core from "../../../../core/index.js"; - -export const Request: core.serialization.Schema< - serializers.proxy.patch.Request.Raw, - Record -> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); - -export declare namespace Request { - export type Raw = Record; -} diff --git a/src/serialization/resources/proxy/client/post.ts b/src/serialization/resources/proxy/client/post.ts deleted file mode 100644 index 9b2ab69..0000000 --- a/src/serialization/resources/proxy/client/post.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../index.js"; -import * as core from "../../../../core/index.js"; - -export const Request: core.serialization.Schema< - serializers.proxy.post.Request.Raw, - Record -> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); - -export declare namespace Request { - export type Raw = Record; -} diff --git a/src/serialization/resources/proxy/client/put.ts b/src/serialization/resources/proxy/client/put.ts deleted file mode 100644 index bf15f4c..0000000 --- a/src/serialization/resources/proxy/client/put.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../index.js"; -import * as core from "../../../../core/index.js"; - -export const Request: core.serialization.Schema< - serializers.proxy.put.Request.Raw, - Record -> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); - -export declare namespace Request { - export type Raw = Record; -} diff --git a/src/serialization/resources/proxy/index.ts b/src/serialization/resources/proxy/index.ts deleted file mode 100644 index 914b8c3..0000000 --- a/src/serialization/resources/proxy/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/tokens/client/index.ts b/src/serialization/resources/tokens/client/index.ts deleted file mode 100644 index 195f9aa..0000000 --- a/src/serialization/resources/tokens/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/tokens/client/requests/CreateTokenOpts.ts b/src/serialization/resources/tokens/client/requests/CreateTokenOpts.ts deleted file mode 100644 index ed30cf9..0000000 --- a/src/serialization/resources/tokens/client/requests/CreateTokenOpts.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Pipedream from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; - -export const CreateTokenOpts: core.serialization.Schema = - core.serialization.object({ - allowedOrigins: core.serialization.property( - "allowed_origins", - core.serialization.list(core.serialization.string()).optional(), - ), - errorRedirectUri: core.serialization.property("error_redirect_uri", core.serialization.string().optional()), - externalUserId: core.serialization.property("external_user_id", core.serialization.string()), - successRedirectUri: core.serialization.property("success_redirect_uri", core.serialization.string().optional()), - webhookUri: core.serialization.property("webhook_uri", core.serialization.string().optional()), - }); - -export declare namespace CreateTokenOpts { - export interface Raw { - allowed_origins?: string[] | null; - error_redirect_uri?: string | null; - external_user_id: string; - success_redirect_uri?: string | null; - webhook_uri?: string | null; - } -} diff --git a/src/serialization/resources/tokens/client/requests/index.ts b/src/serialization/resources/tokens/client/requests/index.ts deleted file mode 100644 index b263191..0000000 --- a/src/serialization/resources/tokens/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { CreateTokenOpts } from "./CreateTokenOpts.js"; diff --git a/src/serialization/resources/tokens/index.ts b/src/serialization/resources/tokens/index.ts deleted file mode 100644 index 914b8c3..0000000 --- a/src/serialization/resources/tokens/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/triggers/client/index.ts b/src/serialization/resources/triggers/client/index.ts deleted file mode 100644 index 195f9aa..0000000 --- a/src/serialization/resources/triggers/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/triggers/client/requests/DeployTriggerOpts.ts b/src/serialization/resources/triggers/client/requests/DeployTriggerOpts.ts deleted file mode 100644 index b60cd6d..0000000 --- a/src/serialization/resources/triggers/client/requests/DeployTriggerOpts.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Pipedream from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; - -export const DeployTriggerOpts: core.serialization.Schema< - serializers.DeployTriggerOpts.Raw, - Pipedream.DeployTriggerOpts -> = core.serialization.object({ - id: core.serialization.string(), - externalUserId: core.serialization.property("external_user_id", core.serialization.string()), - configuredProps: core.serialization.property( - "configured_props", - core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - ), - dynamicPropsId: core.serialization.property("dynamic_props_id", core.serialization.string().optional()), - webhookUrl: core.serialization.property("webhook_url", core.serialization.string().optional()), -}); - -export declare namespace DeployTriggerOpts { - export interface Raw { - id: string; - external_user_id: string; - configured_props?: Record | null; - dynamic_props_id?: string | null; - webhook_url?: string | null; - } -} diff --git a/src/serialization/resources/triggers/client/requests/index.ts b/src/serialization/resources/triggers/client/requests/index.ts deleted file mode 100644 index f149caa..0000000 --- a/src/serialization/resources/triggers/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { DeployTriggerOpts } from "./DeployTriggerOpts.js"; diff --git a/src/serialization/resources/triggers/index.ts b/src/serialization/resources/triggers/index.ts deleted file mode 100644 index 914b8c3..0000000 --- a/src/serialization/resources/triggers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/types/Account.ts b/src/serialization/types/Account.ts deleted file mode 100644 index eb79ca3..0000000 --- a/src/serialization/types/Account.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { App } from "./App.js"; - -export const Account: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string().optional(), - name: core.serialization.string().optional(), - externalId: core.serialization.property("external_id", core.serialization.string().optional()), - healthy: core.serialization.boolean().optional(), - dead: core.serialization.boolean().optional(), - app: App.optional(), - createdAt: core.serialization.property("created_at", core.serialization.date().optional()), - updatedAt: core.serialization.property("updated_at", core.serialization.date().optional()), - credentials: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - expiresAt: core.serialization.property("expires_at", core.serialization.date().optional()), - error: core.serialization.string().optional(), - lastRefreshedAt: core.serialization.property("last_refreshed_at", core.serialization.date().optional()), - nextRefreshAt: core.serialization.property("next_refresh_at", core.serialization.date().optional()), - }); - -export declare namespace Account { - export interface Raw { - id?: string | null; - name?: string | null; - external_id?: string | null; - healthy?: boolean | null; - dead?: boolean | null; - app?: App.Raw | null; - created_at?: string | null; - updated_at?: string | null; - credentials?: Record | null; - expires_at?: string | null; - error?: string | null; - last_refreshed_at?: string | null; - next_refresh_at?: string | null; - } -} diff --git a/src/serialization/types/App.ts b/src/serialization/types/App.ts deleted file mode 100644 index cbd6ea6..0000000 --- a/src/serialization/types/App.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { AppAuthType } from "./AppAuthType.js"; - -export const App: core.serialization.ObjectSchema = core.serialization.object({ - id: core.serialization.string().optional(), - nameSlug: core.serialization.property("name_slug", core.serialization.string()), - name: core.serialization.string(), - authType: core.serialization.property("auth_type", AppAuthType.optional()), - description: core.serialization.string().optional(), - imgSrc: core.serialization.property("img_src", core.serialization.string()), - customFieldsJson: core.serialization.property("custom_fields_json", core.serialization.string().optional()), - categories: core.serialization.list(core.serialization.string()), - featuredWeight: core.serialization.property("featured_weight", core.serialization.number()), -}); - -export declare namespace App { - export interface Raw { - id?: string | null; - name_slug: string; - name: string; - auth_type?: AppAuthType.Raw | null; - description?: string | null; - img_src: string; - custom_fields_json?: string | null; - categories: string[]; - featured_weight: number; - } -} diff --git a/src/serialization/types/AppAuthType.ts b/src/serialization/types/AppAuthType.ts deleted file mode 100644 index 64e544f..0000000 --- a/src/serialization/types/AppAuthType.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const AppAuthType: core.serialization.Schema = - core.serialization.enum_(["keys", "oauth", "none"]); - -export declare namespace AppAuthType { - export type Raw = "keys" | "oauth" | "none"; -} diff --git a/src/serialization/types/AppCategory.ts b/src/serialization/types/AppCategory.ts deleted file mode 100644 index 160c244..0000000 --- a/src/serialization/types/AppCategory.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const AppCategory: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string().optional(), - name: core.serialization.string().optional(), - description: core.serialization.string().optional(), - }); - -export declare namespace AppCategory { - export interface Raw { - id?: string | null; - name?: string | null; - description?: string | null; - } -} diff --git a/src/serialization/types/BackendClientOpts.ts b/src/serialization/types/BackendClientOpts.ts deleted file mode 100644 index 8427ba3..0000000 --- a/src/serialization/types/BackendClientOpts.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const BackendClientOpts: core.serialization.ObjectSchema< - serializers.BackendClientOpts.Raw, - Pipedream.BackendClientOpts -> = core.serialization.object({ - clientId: core.serialization.property("client_id", core.serialization.string().optional()), - clientSecret: core.serialization.property("client_secret", core.serialization.string().optional()), - apiUrl: core.serialization.property("api_url", core.serialization.string().optional()), -}); - -export declare namespace BackendClientOpts { - export interface Raw { - client_id?: string | null; - client_secret?: string | null; - api_url?: string | null; - } -} diff --git a/src/serialization/types/ClientOpts.ts b/src/serialization/types/ClientOpts.ts deleted file mode 100644 index 1363cd5..0000000 --- a/src/serialization/types/ClientOpts.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ClientOpts: core.serialization.ObjectSchema = - core.serialization.object({ - clientId: core.serialization.property("client_id", core.serialization.string().optional()), - clientSecret: core.serialization.property("client_secret", core.serialization.string().optional()), - apiUrl: core.serialization.property("api_url", core.serialization.string().optional()), - }); - -export declare namespace ClientOpts { - export interface Raw { - client_id?: string | null; - client_secret?: string | null; - api_url?: string | null; - } -} diff --git a/src/serialization/types/Component.ts b/src/serialization/types/Component.ts deleted file mode 100644 index 2d287e2..0000000 --- a/src/serialization/types/Component.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { ConfigurableProp } from "./ConfigurableProp.js"; -import { ComponentStash } from "./ComponentStash.js"; - -export const Component: core.serialization.ObjectSchema = - core.serialization.object({ - key: core.serialization.string(), - name: core.serialization.string(), - version: core.serialization.string(), - configurableProps: core.serialization.property("configurable_props", core.serialization.list(ConfigurableProp)), - description: core.serialization.string().optional(), - componentType: core.serialization.property("component_type", core.serialization.string().optional()), - stash: ComponentStash.optional(), - }); - -export declare namespace Component { - export interface Raw { - key: string; - name: string; - version: string; - configurable_props: ConfigurableProp.Raw[]; - description?: string | null; - component_type?: string | null; - stash?: ComponentStash.Raw | null; - } -} diff --git a/src/serialization/types/ComponentStash.ts b/src/serialization/types/ComponentStash.ts deleted file mode 100644 index 3552e8a..0000000 --- a/src/serialization/types/ComponentStash.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ComponentStash: core.serialization.Schema = - core.serialization.enum_(["optional", "required"]); - -export declare namespace ComponentStash { - export type Raw = "optional" | "required"; -} diff --git a/src/serialization/types/ConfigurableProp.ts b/src/serialization/types/ConfigurableProp.ts deleted file mode 100644 index 2f522d0..0000000 --- a/src/serialization/types/ConfigurableProp.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurableProp: core.serialization.ObjectSchema< - serializers.ConfigurableProp.Raw, - Pipedream.ConfigurableProp -> = core.serialization.object({ - name: core.serialization.string(), - type: core.serialization.string().optional(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurableProp { - export interface Raw { - name: string; - type?: string | null; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropAirtableBaseId.ts b/src/serialization/types/ConfigurablePropAirtableBaseId.ts deleted file mode 100644 index 34b6fad..0000000 --- a/src/serialization/types/ConfigurablePropAirtableBaseId.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropAirtableBaseId: core.serialization.ObjectSchema< - serializers.ConfigurablePropAirtableBaseId.Raw, - Pipedream.ConfigurablePropAirtableBaseId -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.airtable.baseId").optional(), - appProp: core.serialization.string().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropAirtableBaseId { - export interface Raw { - type?: "$.airtable.baseId" | null; - appProp?: string | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropAirtableFieldId.ts b/src/serialization/types/ConfigurablePropAirtableFieldId.ts deleted file mode 100644 index 55b121d..0000000 --- a/src/serialization/types/ConfigurablePropAirtableFieldId.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropAirtableFieldId: core.serialization.ObjectSchema< - serializers.ConfigurablePropAirtableFieldId.Raw, - Pipedream.ConfigurablePropAirtableFieldId -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.airtable.fieldId").optional(), - tableIdProp: core.serialization.string().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropAirtableFieldId { - export interface Raw { - type?: "$.airtable.fieldId" | null; - tableIdProp?: string | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropAirtableTableId.ts b/src/serialization/types/ConfigurablePropAirtableTableId.ts deleted file mode 100644 index b6f8d9c..0000000 --- a/src/serialization/types/ConfigurablePropAirtableTableId.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropAirtableTableId: core.serialization.ObjectSchema< - serializers.ConfigurablePropAirtableTableId.Raw, - Pipedream.ConfigurablePropAirtableTableId -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.airtable.tableId").optional(), - baseIdProp: core.serialization.string().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropAirtableTableId { - export interface Raw { - type?: "$.airtable.tableId" | null; - baseIdProp?: string | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropAirtableViewId.ts b/src/serialization/types/ConfigurablePropAirtableViewId.ts deleted file mode 100644 index 2afedeb..0000000 --- a/src/serialization/types/ConfigurablePropAirtableViewId.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropAirtableViewId: core.serialization.ObjectSchema< - serializers.ConfigurablePropAirtableViewId.Raw, - Pipedream.ConfigurablePropAirtableViewId -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.airtable.viewId").optional(), - tableIdProp: core.serialization.string().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropAirtableViewId { - export interface Raw { - type?: "$.airtable.viewId" | null; - tableIdProp?: string | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropAlert.ts b/src/serialization/types/ConfigurablePropAlert.ts deleted file mode 100644 index a7aa2f5..0000000 --- a/src/serialization/types/ConfigurablePropAlert.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { ConfigurablePropAlertType } from "./ConfigurablePropAlertType.js"; - -export const ConfigurablePropAlert: core.serialization.ObjectSchema< - serializers.ConfigurablePropAlert.Raw, - Pipedream.ConfigurablePropAlert -> = core.serialization.object({ - type: core.serialization.stringLiteral("alert").optional(), - alertType: ConfigurablePropAlertType.optional(), - content: core.serialization.string().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropAlert { - export interface Raw { - type?: "alert" | null; - alertType?: ConfigurablePropAlertType.Raw | null; - content?: string | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropAlertType.ts b/src/serialization/types/ConfigurablePropAlertType.ts deleted file mode 100644 index 8c097c5..0000000 --- a/src/serialization/types/ConfigurablePropAlertType.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropAlertType: core.serialization.Schema< - serializers.ConfigurablePropAlertType.Raw, - Pipedream.ConfigurablePropAlertType -> = core.serialization.enum_(["info", "neutral", "warning", "error"]); - -export declare namespace ConfigurablePropAlertType { - export type Raw = "info" | "neutral" | "warning" | "error"; -} diff --git a/src/serialization/types/ConfigurablePropAny.ts b/src/serialization/types/ConfigurablePropAny.ts deleted file mode 100644 index a7fb96d..0000000 --- a/src/serialization/types/ConfigurablePropAny.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropAny: core.serialization.ObjectSchema< - serializers.ConfigurablePropAny.Raw, - Pipedream.ConfigurablePropAny -> = core.serialization.object({ - type: core.serialization.stringLiteral("any").optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropAny { - export interface Raw { - type?: "any" | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropApp.ts b/src/serialization/types/ConfigurablePropApp.ts deleted file mode 100644 index c57b2cb..0000000 --- a/src/serialization/types/ConfigurablePropApp.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropApp: core.serialization.ObjectSchema< - serializers.ConfigurablePropApp.Raw, - Pipedream.ConfigurablePropApp -> = core.serialization.object({ - type: core.serialization.stringLiteral("app").optional(), - app: core.serialization.string().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropApp { - export interface Raw { - type?: "app" | null; - app?: string | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropApphook.ts b/src/serialization/types/ConfigurablePropApphook.ts deleted file mode 100644 index f92ec67..0000000 --- a/src/serialization/types/ConfigurablePropApphook.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropApphook: core.serialization.ObjectSchema< - serializers.ConfigurablePropApphook.Raw, - Pipedream.ConfigurablePropApphook -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.interface.apphook").optional(), - appProp: core.serialization.string().optional(), - eventNames: core.serialization.list(core.serialization.string()).optional(), - remote: core.serialization.boolean().optional(), - static: core.serialization.list(core.serialization.unknown()).optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropApphook { - export interface Raw { - type?: "$.interface.apphook" | null; - appProp?: string | null; - eventNames?: string[] | null; - remote?: boolean | null; - static?: unknown[] | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropBoolean.ts b/src/serialization/types/ConfigurablePropBoolean.ts deleted file mode 100644 index e1dbbaa..0000000 --- a/src/serialization/types/ConfigurablePropBoolean.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropBoolean: core.serialization.ObjectSchema< - serializers.ConfigurablePropBoolean.Raw, - Pipedream.ConfigurablePropBoolean -> = core.serialization.object({ - type: core.serialization.stringLiteral("boolean").optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropBoolean { - export interface Raw { - type?: "boolean" | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropDb.ts b/src/serialization/types/ConfigurablePropDb.ts deleted file mode 100644 index 296b4a9..0000000 --- a/src/serialization/types/ConfigurablePropDb.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropDb: core.serialization.ObjectSchema< - serializers.ConfigurablePropDb.Raw, - Pipedream.ConfigurablePropDb -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.service.db").optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropDb { - export interface Raw { - type?: "$.service.db" | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropDiscord.ts b/src/serialization/types/ConfigurablePropDiscord.ts deleted file mode 100644 index 059ee29..0000000 --- a/src/serialization/types/ConfigurablePropDiscord.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropDiscord: core.serialization.ObjectSchema< - serializers.ConfigurablePropDiscord.Raw, - Pipedream.ConfigurablePropDiscord -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.discord.channel").optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropDiscord { - export interface Raw { - type?: "$.discord.channel" | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropDiscordChannel.ts b/src/serialization/types/ConfigurablePropDiscordChannel.ts deleted file mode 100644 index ed020f3..0000000 --- a/src/serialization/types/ConfigurablePropDiscordChannel.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropDiscordChannel: core.serialization.ObjectSchema< - serializers.ConfigurablePropDiscordChannel.Raw, - Pipedream.ConfigurablePropDiscordChannel -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.discord.channel").optional(), - appProp: core.serialization.string().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropDiscordChannel { - export interface Raw { - type?: "$.discord.channel" | null; - appProp?: string | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropDiscordChannelArray.ts b/src/serialization/types/ConfigurablePropDiscordChannelArray.ts deleted file mode 100644 index a5f1f3e..0000000 --- a/src/serialization/types/ConfigurablePropDiscordChannelArray.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropDiscordChannelArray: core.serialization.ObjectSchema< - serializers.ConfigurablePropDiscordChannelArray.Raw, - Pipedream.ConfigurablePropDiscordChannelArray -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.discord.channel[]").optional(), - appProp: core.serialization.string().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropDiscordChannelArray { - export interface Raw { - type?: "$.discord.channel[]" | null; - appProp?: string | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropHttp.ts b/src/serialization/types/ConfigurablePropHttp.ts deleted file mode 100644 index 775e8ba..0000000 --- a/src/serialization/types/ConfigurablePropHttp.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropHttp: core.serialization.ObjectSchema< - serializers.ConfigurablePropHttp.Raw, - Pipedream.ConfigurablePropHttp -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.interface.http").optional(), - customResponse: core.serialization.boolean().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropHttp { - export interface Raw { - type?: "$.interface.http" | null; - customResponse?: boolean | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropInteger.ts b/src/serialization/types/ConfigurablePropInteger.ts deleted file mode 100644 index 779bd0b..0000000 --- a/src/serialization/types/ConfigurablePropInteger.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropInteger: core.serialization.ObjectSchema< - serializers.ConfigurablePropInteger.Raw, - Pipedream.ConfigurablePropInteger -> = core.serialization.object({ - type: core.serialization.stringLiteral("integer").optional(), - min: core.serialization.number().optional(), - max: core.serialization.number().optional(), - default: core.serialization.number().optional(), - options: core.serialization.list(core.serialization.number()).optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropInteger { - export interface Raw { - type?: "integer" | null; - min?: number | null; - max?: number | null; - default?: number | null; - options?: number[] | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropIntegerArray.ts b/src/serialization/types/ConfigurablePropIntegerArray.ts deleted file mode 100644 index 9271e00..0000000 --- a/src/serialization/types/ConfigurablePropIntegerArray.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropIntegerArray: core.serialization.ObjectSchema< - serializers.ConfigurablePropIntegerArray.Raw, - Pipedream.ConfigurablePropIntegerArray -> = core.serialization.object({ - type: core.serialization.stringLiteral("integer[]").optional(), - min: core.serialization.number().optional(), - max: core.serialization.number().optional(), - default: core.serialization.list(core.serialization.number()).optional(), - options: core.serialization.list(core.serialization.number()).optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropIntegerArray { - export interface Raw { - type?: "integer[]" | null; - min?: number | null; - max?: number | null; - default?: number[] | null; - options?: number[] | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropObject.ts b/src/serialization/types/ConfigurablePropObject.ts deleted file mode 100644 index 3681422..0000000 --- a/src/serialization/types/ConfigurablePropObject.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropObject: core.serialization.ObjectSchema< - serializers.ConfigurablePropObject.Raw, - Pipedream.ConfigurablePropObject -> = core.serialization.object({ - type: core.serialization.stringLiteral("object").optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropObject { - export interface Raw { - type?: "object" | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropSql.ts b/src/serialization/types/ConfigurablePropSql.ts deleted file mode 100644 index 5b5956f..0000000 --- a/src/serialization/types/ConfigurablePropSql.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { ConfigurablePropSqlAuth } from "./ConfigurablePropSqlAuth.js"; - -export const ConfigurablePropSql: core.serialization.ObjectSchema< - serializers.ConfigurablePropSql.Raw, - Pipedream.ConfigurablePropSql -> = core.serialization.object({ - type: core.serialization.stringLiteral("sql").optional(), - auth: ConfigurablePropSqlAuth.optional(), - default: core.serialization.string().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropSql { - export interface Raw { - type?: "sql" | null; - auth?: ConfigurablePropSqlAuth.Raw | null; - default?: string | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropSqlAuth.ts b/src/serialization/types/ConfigurablePropSqlAuth.ts deleted file mode 100644 index 34271fc..0000000 --- a/src/serialization/types/ConfigurablePropSqlAuth.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropSqlAuth: core.serialization.ObjectSchema< - serializers.ConfigurablePropSqlAuth.Raw, - Pipedream.ConfigurablePropSqlAuth -> = core.serialization.object({ - app: core.serialization.string().optional(), -}); - -export declare namespace ConfigurablePropSqlAuth { - export interface Raw { - app?: string | null; - } -} diff --git a/src/serialization/types/ConfigurablePropString.ts b/src/serialization/types/ConfigurablePropString.ts deleted file mode 100644 index ab9ffac..0000000 --- a/src/serialization/types/ConfigurablePropString.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropString: core.serialization.ObjectSchema< - serializers.ConfigurablePropString.Raw, - Pipedream.ConfigurablePropString -> = core.serialization.object({ - type: core.serialization.stringLiteral("string").optional(), - secret: core.serialization.boolean().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropString { - export interface Raw { - type?: "string" | null; - secret?: boolean | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropStringArray.ts b/src/serialization/types/ConfigurablePropStringArray.ts deleted file mode 100644 index b49f606..0000000 --- a/src/serialization/types/ConfigurablePropStringArray.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurablePropStringArray: core.serialization.ObjectSchema< - serializers.ConfigurablePropStringArray.Raw, - Pipedream.ConfigurablePropStringArray -> = core.serialization.object({ - type: core.serialization.stringLiteral("string[]").optional(), - secret: core.serialization.boolean().optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropStringArray { - export interface Raw { - type?: "string[]" | null; - secret?: boolean | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropTimer.ts b/src/serialization/types/ConfigurablePropTimer.ts deleted file mode 100644 index 5df7e20..0000000 --- a/src/serialization/types/ConfigurablePropTimer.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { ConfigurablePropTimerStatic } from "./ConfigurablePropTimerStatic.js"; -import { ConfigurablePropTimerDefault } from "./ConfigurablePropTimerDefault.js"; -import { ConfigurablePropTimerOption } from "./ConfigurablePropTimerOption.js"; - -export const ConfigurablePropTimer: core.serialization.ObjectSchema< - serializers.ConfigurablePropTimer.Raw, - Pipedream.ConfigurablePropTimer -> = core.serialization.object({ - type: core.serialization.stringLiteral("$.interface.timer").optional(), - static: ConfigurablePropTimerStatic.optional(), - default: ConfigurablePropTimerDefault.optional(), - options: core.serialization.list(ConfigurablePropTimerOption.optional()).optional(), - name: core.serialization.string(), - label: core.serialization.string().optional(), - description: core.serialization.string().optional(), - optional: core.serialization.boolean().optional(), - disabled: core.serialization.boolean().optional(), - hidden: core.serialization.boolean().optional(), - remoteOptions: core.serialization.boolean().optional(), - useQuery: core.serialization.boolean().optional(), - reloadProps: core.serialization.boolean().optional(), - withLabel: core.serialization.boolean().optional(), -}); - -export declare namespace ConfigurablePropTimer { - export interface Raw { - type?: "$.interface.timer" | null; - static?: ConfigurablePropTimerStatic.Raw | null; - default?: ConfigurablePropTimerDefault.Raw | null; - options?: (ConfigurablePropTimerOption.Raw | null | undefined)[] | null; - name: string; - label?: string | null; - description?: string | null; - optional?: boolean | null; - disabled?: boolean | null; - hidden?: boolean | null; - remoteOptions?: boolean | null; - useQuery?: boolean | null; - reloadProps?: boolean | null; - withLabel?: boolean | null; - } -} diff --git a/src/serialization/types/ConfigurablePropTimerDefault.ts b/src/serialization/types/ConfigurablePropTimerDefault.ts deleted file mode 100644 index 4b65605..0000000 --- a/src/serialization/types/ConfigurablePropTimerDefault.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { TimerInterval } from "./TimerInterval.js"; -import { TimerCron } from "./TimerCron.js"; - -export const ConfigurablePropTimerDefault: core.serialization.Schema< - serializers.ConfigurablePropTimerDefault.Raw, - Pipedream.ConfigurablePropTimerDefault -> = core.serialization.undiscriminatedUnion([TimerInterval, TimerCron]); - -export declare namespace ConfigurablePropTimerDefault { - export type Raw = TimerInterval.Raw | TimerCron.Raw; -} diff --git a/src/serialization/types/ConfigurablePropTimerOption.ts b/src/serialization/types/ConfigurablePropTimerOption.ts deleted file mode 100644 index 063a428..0000000 --- a/src/serialization/types/ConfigurablePropTimerOption.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { TimerInterval } from "./TimerInterval.js"; -import { TimerCron } from "./TimerCron.js"; - -export const ConfigurablePropTimerOption: core.serialization.Schema< - serializers.ConfigurablePropTimerOption.Raw, - Pipedream.ConfigurablePropTimerOption -> = core.serialization.undiscriminatedUnion([TimerInterval, TimerCron]); - -export declare namespace ConfigurablePropTimerOption { - export type Raw = TimerInterval.Raw | TimerCron.Raw; -} diff --git a/src/serialization/types/ConfigurablePropTimerStatic.ts b/src/serialization/types/ConfigurablePropTimerStatic.ts deleted file mode 100644 index c0ea7cb..0000000 --- a/src/serialization/types/ConfigurablePropTimerStatic.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { TimerInterval } from "./TimerInterval.js"; -import { TimerCron } from "./TimerCron.js"; - -export const ConfigurablePropTimerStatic: core.serialization.Schema< - serializers.ConfigurablePropTimerStatic.Raw, - Pipedream.ConfigurablePropTimerStatic -> = core.serialization.undiscriminatedUnion([TimerInterval, TimerCron]); - -export declare namespace ConfigurablePropTimerStatic { - export type Raw = TimerInterval.Raw | TimerCron.Raw; -} diff --git a/src/serialization/types/ConfigurePropOpts.ts b/src/serialization/types/ConfigurePropOpts.ts deleted file mode 100644 index 56abbb7..0000000 --- a/src/serialization/types/ConfigurePropOpts.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConfigurePropOpts: core.serialization.ObjectSchema< - serializers.ConfigurePropOpts.Raw, - Pipedream.ConfigurePropOpts -> = core.serialization.object({ - id: core.serialization.string(), - externalUserId: core.serialization.property("external_user_id", core.serialization.string()), - propName: core.serialization.property("prop_name", core.serialization.string()), - blocking: core.serialization.boolean().optional(), - configuredProps: core.serialization.property( - "configured_props", - core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - ), - dynamicPropsId: core.serialization.property("dynamic_props_id", core.serialization.string().optional()), - asyncHandle: core.serialization.property("async_handle", core.serialization.string().optional()), - page: core.serialization.number().optional(), - prevContext: core.serialization.property( - "prev_context", - core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - ), - query: core.serialization.string().optional(), -}); - -export declare namespace ConfigurePropOpts { - export interface Raw { - id: string; - external_user_id: string; - prop_name: string; - blocking?: boolean | null; - configured_props?: Record | null; - dynamic_props_id?: string | null; - async_handle?: string | null; - page?: number | null; - prev_context?: Record | null; - query?: string | null; - } -} diff --git a/src/serialization/types/ConfigurePropResponse.ts b/src/serialization/types/ConfigurePropResponse.ts deleted file mode 100644 index 97b1c18..0000000 --- a/src/serialization/types/ConfigurePropResponse.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { PropOption } from "./PropOption.js"; - -export const ConfigurePropResponse: core.serialization.ObjectSchema< - serializers.ConfigurePropResponse.Raw, - Pipedream.ConfigurePropResponse -> = core.serialization.object({ - options: core.serialization.list(PropOption).optional(), - stringOptions: core.serialization.property( - "string_options", - core.serialization.list(core.serialization.string()).optional(), - ), - observations: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - asyncHandle: core.serialization.property("async_handle", core.serialization.string().optional()), - context: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - errors: core.serialization.list(core.serialization.string()).optional(), -}); - -export declare namespace ConfigurePropResponse { - export interface Raw { - options?: PropOption.Raw[] | null; - string_options?: string[] | null; - observations?: Record | null; - async_handle?: string | null; - context?: Record | null; - errors?: string[] | null; - } -} diff --git a/src/serialization/types/ConnectToken.ts b/src/serialization/types/ConnectToken.ts deleted file mode 100644 index 8f9cb2d..0000000 --- a/src/serialization/types/ConnectToken.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ConnectToken: core.serialization.Schema = - core.serialization.string(); - -export declare namespace ConnectToken { - export type Raw = string; -} diff --git a/src/serialization/types/CreateOAuthTokenResponse.ts b/src/serialization/types/CreateOAuthTokenResponse.ts deleted file mode 100644 index 2f7f133..0000000 --- a/src/serialization/types/CreateOAuthTokenResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const CreateOAuthTokenResponse: core.serialization.ObjectSchema< - serializers.CreateOAuthTokenResponse.Raw, - Pipedream.CreateOAuthTokenResponse -> = core.serialization.object({ - accessToken: core.serialization.property("access_token", core.serialization.string()), - tokenType: core.serialization.property("token_type", core.serialization.string()), - expiresIn: core.serialization.property("expires_in", core.serialization.number()), -}); - -export declare namespace CreateOAuthTokenResponse { - export interface Raw { - access_token: string; - token_type: string; - expires_in: number; - } -} diff --git a/src/serialization/types/CreateTokenResponse.ts b/src/serialization/types/CreateTokenResponse.ts deleted file mode 100644 index bc65c55..0000000 --- a/src/serialization/types/CreateTokenResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { ConnectToken } from "./ConnectToken.js"; - -export const CreateTokenResponse: core.serialization.ObjectSchema< - serializers.CreateTokenResponse.Raw, - Pipedream.CreateTokenResponse -> = core.serialization.object({ - connectLinkUrl: core.serialization.property("connect_link_url", core.serialization.string()), - expiresAt: core.serialization.property("expires_at", core.serialization.date()), - token: ConnectToken, -}); - -export declare namespace CreateTokenResponse { - export interface Raw { - connect_link_url: string; - expires_at: string; - token: ConnectToken.Raw; - } -} diff --git a/src/serialization/types/DeleteTriggerOpts.ts b/src/serialization/types/DeleteTriggerOpts.ts deleted file mode 100644 index 7c381a8..0000000 --- a/src/serialization/types/DeleteTriggerOpts.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const DeleteTriggerOpts: core.serialization.ObjectSchema< - serializers.DeleteTriggerOpts.Raw, - Pipedream.DeleteTriggerOpts -> = core.serialization.object({ - ignoreHookErrors: core.serialization.property("ignore_hook_errors", core.serialization.boolean().optional()), -}); - -export declare namespace DeleteTriggerOpts { - export interface Raw { - ignore_hook_errors?: boolean | null; - } -} diff --git a/src/serialization/types/DeployTriggerResponse.ts b/src/serialization/types/DeployTriggerResponse.ts deleted file mode 100644 index cdefddb..0000000 --- a/src/serialization/types/DeployTriggerResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { DeployedComponent } from "./DeployedComponent.js"; - -export const DeployTriggerResponse: core.serialization.ObjectSchema< - serializers.DeployTriggerResponse.Raw, - Pipedream.DeployTriggerResponse -> = core.serialization.object({ - data: DeployedComponent, -}); - -export declare namespace DeployTriggerResponse { - export interface Raw { - data: DeployedComponent.Raw; - } -} diff --git a/src/serialization/types/DeployedComponent.ts b/src/serialization/types/DeployedComponent.ts deleted file mode 100644 index 9fc1b8f..0000000 --- a/src/serialization/types/DeployedComponent.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { ConfigurableProp } from "./ConfigurableProp.js"; - -export const DeployedComponent: core.serialization.ObjectSchema< - serializers.DeployedComponent.Raw, - Pipedream.DeployedComponent -> = core.serialization.object({ - id: core.serialization.string(), - ownerId: core.serialization.property("owner_id", core.serialization.string()), - componentId: core.serialization.property("component_id", core.serialization.string()), - configurableProps: core.serialization.property("configurable_props", core.serialization.list(ConfigurableProp)), - configuredProps: core.serialization.property( - "configured_props", - core.serialization.record(core.serialization.string(), core.serialization.unknown()), - ), - active: core.serialization.boolean(), - createdAt: core.serialization.property("created_at", core.serialization.number()), - updatedAt: core.serialization.property("updated_at", core.serialization.number()), - name: core.serialization.string(), - nameSlug: core.serialization.property("name_slug", core.serialization.string()), - callbackObservations: core.serialization.property("callback_observations", core.serialization.unknown().optional()), -}); - -export declare namespace DeployedComponent { - export interface Raw { - id: string; - owner_id: string; - component_id: string; - configurable_props: ConfigurableProp.Raw[]; - configured_props: Record; - active: boolean; - created_at: number; - updated_at: number; - name: string; - name_slug: string; - callback_observations?: unknown | null; - } -} diff --git a/src/serialization/types/EmittedEvent.ts b/src/serialization/types/EmittedEvent.ts deleted file mode 100644 index bc4652f..0000000 --- a/src/serialization/types/EmittedEvent.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const EmittedEvent: core.serialization.ObjectSchema = - core.serialization.object({ - e: core.serialization.record(core.serialization.string(), core.serialization.unknown()), - k: core.serialization.string(), - ts: core.serialization.number(), - id: core.serialization.string(), - }); - -export declare namespace EmittedEvent { - export interface Raw { - e: Record; - k: string; - ts: number; - id: string; - } -} diff --git a/src/serialization/types/ErrorResponse.ts b/src/serialization/types/ErrorResponse.ts deleted file mode 100644 index ef6e48e..0000000 --- a/src/serialization/types/ErrorResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ErrorResponse: core.serialization.ObjectSchema = - core.serialization.object({ - error: core.serialization.string(), - code: core.serialization.string().optional(), - details: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - }); - -export declare namespace ErrorResponse { - export interface Raw { - error: string; - code?: string | null; - details?: Record | null; - } -} diff --git a/src/serialization/types/GetAccountsResponse.ts b/src/serialization/types/GetAccountsResponse.ts deleted file mode 100644 index 0472b67..0000000 --- a/src/serialization/types/GetAccountsResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { Account } from "./Account.js"; -import { PageInfo } from "./PageInfo.js"; - -export const GetAccountsResponse: core.serialization.ObjectSchema< - serializers.GetAccountsResponse.Raw, - Pipedream.GetAccountsResponse -> = core.serialization.object({ - data: core.serialization.list(Account), - pageInfo: core.serialization.property("page_info", PageInfo), -}); - -export declare namespace GetAccountsResponse { - export interface Raw { - data: Account.Raw[]; - page_info: PageInfo.Raw; - } -} diff --git a/src/serialization/types/GetAppCategoryResponse.ts b/src/serialization/types/GetAppCategoryResponse.ts deleted file mode 100644 index 888fbc9..0000000 --- a/src/serialization/types/GetAppCategoryResponse.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { AppCategory } from "./AppCategory.js"; - -export const GetAppCategoryResponse: core.serialization.ObjectSchema< - serializers.GetAppCategoryResponse.Raw, - Pipedream.GetAppCategoryResponse -> = AppCategory; - -export declare namespace GetAppCategoryResponse { - export type Raw = AppCategory.Raw; -} diff --git a/src/serialization/types/GetAppResponse.ts b/src/serialization/types/GetAppResponse.ts deleted file mode 100644 index c2cb7d3..0000000 --- a/src/serialization/types/GetAppResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { App } from "./App.js"; - -export const GetAppResponse: core.serialization.ObjectSchema = - core.serialization.object({ - data: App, - }); - -export declare namespace GetAppResponse { - export interface Raw { - data: App.Raw; - } -} diff --git a/src/serialization/types/GetAppsResponse.ts b/src/serialization/types/GetAppsResponse.ts deleted file mode 100644 index 89a7703..0000000 --- a/src/serialization/types/GetAppsResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { App } from "./App.js"; -import { PageInfo } from "./PageInfo.js"; - -export const GetAppsResponse: core.serialization.ObjectSchema< - serializers.GetAppsResponse.Raw, - Pipedream.GetAppsResponse -> = core.serialization.object({ - data: core.serialization.list(App), - pageInfo: core.serialization.property("page_info", PageInfo), -}); - -export declare namespace GetAppsResponse { - export interface Raw { - data: App.Raw[]; - page_info: PageInfo.Raw; - } -} diff --git a/src/serialization/types/GetComponentResponse.ts b/src/serialization/types/GetComponentResponse.ts deleted file mode 100644 index c32de00..0000000 --- a/src/serialization/types/GetComponentResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { Component } from "./Component.js"; - -export const GetComponentResponse: core.serialization.ObjectSchema< - serializers.GetComponentResponse.Raw, - Pipedream.GetComponentResponse -> = core.serialization.object({ - data: Component, -}); - -export declare namespace GetComponentResponse { - export interface Raw { - data: Component.Raw; - } -} diff --git a/src/serialization/types/GetComponentsResponse.ts b/src/serialization/types/GetComponentsResponse.ts deleted file mode 100644 index 6e91eab..0000000 --- a/src/serialization/types/GetComponentsResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { Component } from "./Component.js"; -import { PageInfo } from "./PageInfo.js"; - -export const GetComponentsResponse: core.serialization.ObjectSchema< - serializers.GetComponentsResponse.Raw, - Pipedream.GetComponentsResponse -> = core.serialization.object({ - data: core.serialization.list(Component), - pageInfo: core.serialization.property("page_info", PageInfo), -}); - -export declare namespace GetComponentsResponse { - export interface Raw { - data: Component.Raw[]; - page_info: PageInfo.Raw; - } -} diff --git a/src/serialization/types/GetTriggerEventsResponse.ts b/src/serialization/types/GetTriggerEventsResponse.ts deleted file mode 100644 index 8d827fa..0000000 --- a/src/serialization/types/GetTriggerEventsResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { EmittedEvent } from "./EmittedEvent.js"; - -export const GetTriggerEventsResponse: core.serialization.ObjectSchema< - serializers.GetTriggerEventsResponse.Raw, - Pipedream.GetTriggerEventsResponse -> = core.serialization.object({ - data: core.serialization.list(EmittedEvent), -}); - -export declare namespace GetTriggerEventsResponse { - export interface Raw { - data: EmittedEvent.Raw[]; - } -} diff --git a/src/serialization/types/GetTriggerResponse.ts b/src/serialization/types/GetTriggerResponse.ts deleted file mode 100644 index 22d173a..0000000 --- a/src/serialization/types/GetTriggerResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { DeployedComponent } from "./DeployedComponent.js"; - -export const GetTriggerResponse: core.serialization.ObjectSchema< - serializers.GetTriggerResponse.Raw, - Pipedream.GetTriggerResponse -> = core.serialization.object({ - data: DeployedComponent, -}); - -export declare namespace GetTriggerResponse { - export interface Raw { - data: DeployedComponent.Raw; - } -} diff --git a/src/serialization/types/GetTriggerWebhooksResponse.ts b/src/serialization/types/GetTriggerWebhooksResponse.ts deleted file mode 100644 index 740a445..0000000 --- a/src/serialization/types/GetTriggerWebhooksResponse.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const GetTriggerWebhooksResponse: core.serialization.ObjectSchema< - serializers.GetTriggerWebhooksResponse.Raw, - Pipedream.GetTriggerWebhooksResponse -> = core.serialization.object({ - webhookUrls: core.serialization.property("webhook_urls", core.serialization.list(core.serialization.string())), -}); - -export declare namespace GetTriggerWebhooksResponse { - export interface Raw { - webhook_urls: string[]; - } -} diff --git a/src/serialization/types/GetTriggerWorkflowsResponse.ts b/src/serialization/types/GetTriggerWorkflowsResponse.ts deleted file mode 100644 index f48d324..0000000 --- a/src/serialization/types/GetTriggerWorkflowsResponse.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const GetTriggerWorkflowsResponse: core.serialization.ObjectSchema< - serializers.GetTriggerWorkflowsResponse.Raw, - Pipedream.GetTriggerWorkflowsResponse -> = core.serialization.object({ - workflowIds: core.serialization.property("workflow_ids", core.serialization.list(core.serialization.string())), -}); - -export declare namespace GetTriggerWorkflowsResponse { - export interface Raw { - workflow_ids: string[]; - } -} diff --git a/src/serialization/types/GetTriggersResponse.ts b/src/serialization/types/GetTriggersResponse.ts deleted file mode 100644 index 028b695..0000000 --- a/src/serialization/types/GetTriggersResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { DeployedComponent } from "./DeployedComponent.js"; -import { PageInfo } from "./PageInfo.js"; - -export const GetTriggersResponse: core.serialization.ObjectSchema< - serializers.GetTriggersResponse.Raw, - Pipedream.GetTriggersResponse -> = core.serialization.object({ - data: core.serialization.list(DeployedComponent), - pageInfo: core.serialization.property("page_info", PageInfo), -}); - -export declare namespace GetTriggersResponse { - export interface Raw { - data: DeployedComponent.Raw[]; - page_info: PageInfo.Raw; - } -} diff --git a/src/serialization/types/ListAccountsResponse.ts b/src/serialization/types/ListAccountsResponse.ts deleted file mode 100644 index 103281a..0000000 --- a/src/serialization/types/ListAccountsResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { Account } from "./Account.js"; -import { PageInfo } from "./PageInfo.js"; - -export const ListAccountsResponse: core.serialization.ObjectSchema< - serializers.ListAccountsResponse.Raw, - Pipedream.ListAccountsResponse -> = core.serialization.object({ - data: core.serialization.list(Account), - pageInfo: core.serialization.property("page_info", PageInfo), -}); - -export declare namespace ListAccountsResponse { - export interface Raw { - data: Account.Raw[]; - page_info: PageInfo.Raw; - } -} diff --git a/src/serialization/types/ListAppCategoriesResponse.ts b/src/serialization/types/ListAppCategoriesResponse.ts deleted file mode 100644 index a34acff..0000000 --- a/src/serialization/types/ListAppCategoriesResponse.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { AppCategory } from "./AppCategory.js"; - -export const ListAppCategoriesResponse: core.serialization.Schema< - serializers.ListAppCategoriesResponse.Raw, - Pipedream.ListAppCategoriesResponse -> = core.serialization.list(AppCategory); - -export declare namespace ListAppCategoriesResponse { - export type Raw = AppCategory.Raw[]; -} diff --git a/src/serialization/types/ListAppsResponse.ts b/src/serialization/types/ListAppsResponse.ts deleted file mode 100644 index 8c6d5da..0000000 --- a/src/serialization/types/ListAppsResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { App } from "./App.js"; -import { PageInfo } from "./PageInfo.js"; - -export const ListAppsResponse: core.serialization.ObjectSchema< - serializers.ListAppsResponse.Raw, - Pipedream.ListAppsResponse -> = core.serialization.object({ - data: core.serialization.list(App), - pageInfo: core.serialization.property("page_info", PageInfo), -}); - -export declare namespace ListAppsResponse { - export interface Raw { - data: App.Raw[]; - page_info: PageInfo.Raw; - } -} diff --git a/src/serialization/types/PageInfo.ts b/src/serialization/types/PageInfo.ts deleted file mode 100644 index e8cd859..0000000 --- a/src/serialization/types/PageInfo.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const PageInfo: core.serialization.ObjectSchema = - core.serialization.object({ - count: core.serialization.number().optional(), - totalCount: core.serialization.property("total_count", core.serialization.number().optional()), - startCursor: core.serialization.property("start_cursor", core.serialization.string().optional()), - endCursor: core.serialization.property("end_cursor", core.serialization.string().optional()), - }); - -export declare namespace PageInfo { - export interface Raw { - count?: number | null; - total_count?: number | null; - start_cursor?: string | null; - end_cursor?: string | null; - } -} diff --git a/src/serialization/types/ProjectEnvironment.ts b/src/serialization/types/ProjectEnvironment.ts deleted file mode 100644 index d30e319..0000000 --- a/src/serialization/types/ProjectEnvironment.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ProjectEnvironment: core.serialization.Schema< - serializers.ProjectEnvironment.Raw, - Pipedream.ProjectEnvironment -> = core.serialization.enum_(["development", "production"]); - -export declare namespace ProjectEnvironment { - export type Raw = "development" | "production"; -} diff --git a/src/serialization/types/ProjectInfoResponse.ts b/src/serialization/types/ProjectInfoResponse.ts deleted file mode 100644 index 4ccd655..0000000 --- a/src/serialization/types/ProjectInfoResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { ProjectInfoResponseApp } from "./ProjectInfoResponseApp.js"; - -export const ProjectInfoResponse: core.serialization.ObjectSchema< - serializers.ProjectInfoResponse.Raw, - Pipedream.ProjectInfoResponse -> = core.serialization.object({ - apps: core.serialization.list(ProjectInfoResponseApp), -}); - -export declare namespace ProjectInfoResponse { - export interface Raw { - apps: ProjectInfoResponseApp.Raw[]; - } -} diff --git a/src/serialization/types/ProjectInfoResponseApp.ts b/src/serialization/types/ProjectInfoResponseApp.ts deleted file mode 100644 index 0482ddd..0000000 --- a/src/serialization/types/ProjectInfoResponseApp.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ProjectInfoResponseApp: core.serialization.ObjectSchema< - serializers.ProjectInfoResponseApp.Raw, - Pipedream.ProjectInfoResponseApp -> = core.serialization.object({ - id: core.serialization.string().optional(), - nameSlug: core.serialization.property("name_slug", core.serialization.string().optional()), -}); - -export declare namespace ProjectInfoResponseApp { - export interface Raw { - id?: string | null; - name_slug?: string | null; - } -} diff --git a/src/serialization/types/PropOption.ts b/src/serialization/types/PropOption.ts deleted file mode 100644 index 64241d2..0000000 --- a/src/serialization/types/PropOption.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const PropOption: core.serialization.ObjectSchema = - core.serialization.object({ - label: core.serialization.string(), - value: core.serialization.unknown(), - }); - -export declare namespace PropOption { - export interface Raw { - label: string; - value?: unknown; - } -} diff --git a/src/serialization/types/ProxyResponse.ts b/src/serialization/types/ProxyResponse.ts deleted file mode 100644 index 8783e2a..0000000 --- a/src/serialization/types/ProxyResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ProxyResponse: core.serialization.Schema = - core.serialization.unknown(); - -export declare namespace ProxyResponse { - export type Raw = unknown; -} diff --git a/src/serialization/types/ReloadPropsOpts.ts b/src/serialization/types/ReloadPropsOpts.ts deleted file mode 100644 index c9c942a..0000000 --- a/src/serialization/types/ReloadPropsOpts.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ReloadPropsOpts: core.serialization.ObjectSchema< - serializers.ReloadPropsOpts.Raw, - Pipedream.ReloadPropsOpts -> = core.serialization.object({ - id: core.serialization.string(), - externalUserId: core.serialization.property("external_user_id", core.serialization.string()), - blocking: core.serialization.boolean().optional(), - configuredProps: core.serialization.property( - "configured_props", - core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - ), - dynamicPropsId: core.serialization.property("dynamic_props_id", core.serialization.string().optional()), - asyncHandle: core.serialization.property("async_handle", core.serialization.string().optional()), -}); - -export declare namespace ReloadPropsOpts { - export interface Raw { - id: string; - external_user_id: string; - blocking?: boolean | null; - configured_props?: Record | null; - dynamic_props_id?: string | null; - async_handle?: string | null; - } -} diff --git a/src/serialization/types/ReloadPropsResponse.ts b/src/serialization/types/ReloadPropsResponse.ts deleted file mode 100644 index 514d09e..0000000 --- a/src/serialization/types/ReloadPropsResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { ConfigurableProp } from "./ConfigurableProp.js"; - -export const ReloadPropsResponse: core.serialization.ObjectSchema< - serializers.ReloadPropsResponse.Raw, - Pipedream.ReloadPropsResponse -> = core.serialization.object({ - configurableProps: core.serialization.property( - "configurable_props", - core.serialization.list(ConfigurableProp).optional(), - ), -}); - -export declare namespace ReloadPropsResponse { - export interface Raw { - configurable_props?: ConfigurableProp.Raw[] | null; - } -} diff --git a/src/serialization/types/RunActionOptsStashId.ts b/src/serialization/types/RunActionOptsStashId.ts deleted file mode 100644 index 3877dfe..0000000 --- a/src/serialization/types/RunActionOptsStashId.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { StashId } from "./StashId.js"; - -export const RunActionOptsStashId: core.serialization.Schema< - serializers.RunActionOptsStashId.Raw, - Pipedream.RunActionOptsStashId -> = core.serialization.undiscriminatedUnion([ - StashId.optional(), - core.serialization.stringLiteral("NEW"), - core.serialization.boolean(), -]); - -export declare namespace RunActionOptsStashId { - export type Raw = ((StashId.Raw | undefined) | null | undefined) | "NEW" | boolean; -} diff --git a/src/serialization/types/RunActionResponse.ts b/src/serialization/types/RunActionResponse.ts deleted file mode 100644 index 96ebe48..0000000 --- a/src/serialization/types/RunActionResponse.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { StashId } from "./StashId.js"; - -export const RunActionResponse: core.serialization.ObjectSchema< - serializers.RunActionResponse.Raw, - Pipedream.RunActionResponse -> = core.serialization.object({ - exports: core.serialization.unknown().optional(), - os: core.serialization.unknown().optional(), - ret: core.serialization.unknown().optional(), - stashId: core.serialization.property("stash_id", StashId.optional()), -}); - -export declare namespace RunActionResponse { - export interface Raw { - exports?: unknown | null; - os?: unknown | null; - ret?: unknown | null; - stash_id?: (StashId.Raw | undefined) | null; - } -} diff --git a/src/serialization/types/StartConnectOpts.ts b/src/serialization/types/StartConnectOpts.ts deleted file mode 100644 index 679c0cc..0000000 --- a/src/serialization/types/StartConnectOpts.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const StartConnectOpts: core.serialization.ObjectSchema< - serializers.StartConnectOpts.Raw, - Pipedream.StartConnectOpts -> = core.serialization.object({ - iframe: core.serialization.string().optional(), -}); - -export declare namespace StartConnectOpts { - export interface Raw { - iframe?: string | null; - } -} diff --git a/src/serialization/types/StashId.ts b/src/serialization/types/StashId.ts deleted file mode 100644 index 00d9e60..0000000 --- a/src/serialization/types/StashId.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const StashId: core.serialization.Schema = core.serialization - .string() - .optional(); - -export declare namespace StashId { - export type Raw = string | null | undefined; -} diff --git a/src/serialization/types/TimerCron.ts b/src/serialization/types/TimerCron.ts deleted file mode 100644 index 162d86a..0000000 --- a/src/serialization/types/TimerCron.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const TimerCron: core.serialization.ObjectSchema = - core.serialization.object({ - cron: core.serialization.string(), - }); - -export declare namespace TimerCron { - export interface Raw { - cron: string; - } -} diff --git a/src/serialization/types/TimerInterval.ts b/src/serialization/types/TimerInterval.ts deleted file mode 100644 index c161d51..0000000 --- a/src/serialization/types/TimerInterval.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const TimerInterval: core.serialization.ObjectSchema = - core.serialization.object({ - intervalSeconds: core.serialization.number(), - }); - -export declare namespace TimerInterval { - export interface Raw { - intervalSeconds: number; - } -} diff --git a/src/serialization/types/ValidateTokenResponse.ts b/src/serialization/types/ValidateTokenResponse.ts deleted file mode 100644 index 72a8f34..0000000 --- a/src/serialization/types/ValidateTokenResponse.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { App } from "./App.js"; - -export const ValidateTokenResponse: core.serialization.ObjectSchema< - serializers.ValidateTokenResponse.Raw, - Pipedream.ValidateTokenResponse -> = core.serialization.object({ - app: App.optional(), - error: core.serialization.string().optional(), - errorRedirectUri: core.serialization.property("error_redirect_uri", core.serialization.string().optional()), - oauthAppId: core.serialization.property("oauth_app_id", core.serialization.string().optional()), - projectAppName: core.serialization.property("project_app_name", core.serialization.string().optional()), - projectEnvironment: core.serialization.property("project_environment", core.serialization.string().optional()), - projectId: core.serialization.property("project_id", core.serialization.string().optional()), - projectSupportEmail: core.serialization.property("project_support_email", core.serialization.string().optional()), - success: core.serialization.boolean(), - successRedirectUri: core.serialization.property("success_redirect_uri", core.serialization.string().optional()), -}); - -export declare namespace ValidateTokenResponse { - export interface Raw { - app?: App.Raw | null; - error?: string | null; - error_redirect_uri?: string | null; - oauth_app_id?: string | null; - project_app_name?: string | null; - project_environment?: string | null; - project_id?: string | null; - project_support_email?: string | null; - success: boolean; - success_redirect_uri?: string | null; - } -} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts deleted file mode 100644 index a00eb13..0000000 --- a/src/serialization/types/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -export * from "./Account.js"; -export * from "./App.js"; -export * from "./AppAuthType.js"; -export * from "./AppCategory.js"; -export * from "./BackendClientOpts.js"; -export * from "./ClientOpts.js"; -export * from "./Component.js"; -export * from "./ComponentStash.js"; -export * from "./TimerInterval.js"; -export * from "./TimerCron.js"; -export * from "./ConfigurableProp.js"; -export * from "./ConfigurablePropAlert.js"; -export * from "./ConfigurablePropAlertType.js"; -export * from "./ConfigurablePropAny.js"; -export * from "./ConfigurablePropApp.js"; -export * from "./ConfigurablePropBoolean.js"; -export * from "./ConfigurablePropTimer.js"; -export * from "./ConfigurablePropTimerDefault.js"; -export * from "./ConfigurablePropTimerOption.js"; -export * from "./ConfigurablePropTimerStatic.js"; -export * from "./ConfigurablePropApphook.js"; -export * from "./ConfigurablePropIntegerArray.js"; -export * from "./ConfigurablePropHttp.js"; -export * from "./ConfigurablePropDb.js"; -export * from "./ConfigurablePropSql.js"; -export * from "./ConfigurablePropSqlAuth.js"; -export * from "./ConfigurablePropAirtableBaseId.js"; -export * from "./ConfigurablePropAirtableTableId.js"; -export * from "./ConfigurablePropAirtableViewId.js"; -export * from "./ConfigurablePropAirtableFieldId.js"; -export * from "./ConfigurablePropDiscordChannel.js"; -export * from "./ConfigurablePropDiscordChannelArray.js"; -export * from "./ConfigurablePropDiscord.js"; -export * from "./ConfigurablePropInteger.js"; -export * from "./ConfigurablePropObject.js"; -export * from "./ConfigurablePropString.js"; -export * from "./ConfigurablePropStringArray.js"; -export * from "./ConfigurePropOpts.js"; -export * from "./ConfigurePropResponse.js"; -export * from "./ConnectToken.js"; -export * from "./CreateOAuthTokenResponse.js"; -export * from "./CreateTokenResponse.js"; -export * from "./DeleteTriggerOpts.js"; -export * from "./DeployedComponent.js"; -export * from "./DeployTriggerResponse.js"; -export * from "./EmittedEvent.js"; -export * from "./ErrorResponse.js"; -export * from "./GetAccountsResponse.js"; -export * from "./GetAppResponse.js"; -export * from "./GetAppCategoryResponse.js"; -export * from "./GetAppsResponse.js"; -export * from "./GetComponentResponse.js"; -export * from "./GetComponentsResponse.js"; -export * from "./GetTriggerEventsResponse.js"; -export * from "./GetTriggerResponse.js"; -export * from "./GetTriggerWebhooksResponse.js"; -export * from "./GetTriggerWorkflowsResponse.js"; -export * from "./GetTriggersResponse.js"; -export * from "./ListAccountsResponse.js"; -export * from "./ListAppsResponse.js"; -export * from "./ListAppCategoriesResponse.js"; -export * from "./PageInfo.js"; -export * from "./ProjectEnvironment.js"; -export * from "./ProjectInfoResponse.js"; -export * from "./ProjectInfoResponseApp.js"; -export * from "./PropOption.js"; -export * from "./ProxyResponse.js"; -export * from "./ReloadPropsOpts.js"; -export * from "./ReloadPropsResponse.js"; -export * from "./RunActionOptsStashId.js"; -export * from "./RunActionResponse.js"; -export * from "./StartConnectOpts.js"; -export * from "./StashId.js"; -export * from "./ValidateTokenResponse.js"; diff --git a/src/version.ts b/src/version.ts index c3baf16..478f50d 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "2.0.0-rc.8"; +export const SDK_VERSION = "2.0.0"; diff --git a/tests/unit/schemas/bigint/bigint.test.ts b/tests/unit/schemas/bigint/bigint.test.ts deleted file mode 100644 index 498f143..0000000 --- a/tests/unit/schemas/bigint/bigint.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { bigint } from "../../../../src/core/schemas/builders/bigint"; -import { itJson, itParse, itSchema } from "../utils/itSchema"; -import { itValidateJson, itValidateParse } from "../utils/itValidate"; - -describe("bigint", () => { - itSchema("converts between raw bigint and parsed bigint", bigint(), { - raw: BigInt("9007199254740992"), - parsed: BigInt("9007199254740992"), - }); - - itParse("converts between raw number and parsed bigint", bigint(), { - raw: 10, - parsed: BigInt("10"), - }); - - itParse("converts between raw number and parsed bigint", bigint(), { - raw: BigInt("10"), - parsed: BigInt("10"), - }); - - itJson("converts raw bigint to parsed bigint", bigint(), { - parsed: BigInt("10"), - raw: BigInt("10"), - }); - - itValidateParse("string", bigint(), "42", [ - { - message: 'Expected bigint | number. Received "42".', - path: [], - }, - ]); - - itValidateJson("number", bigint(), 42, [ - { - message: "Expected bigint. Received 42.", - path: [], - }, - ]); - - itValidateJson("string", bigint(), "42", [ - { - message: 'Expected bigint. Received "42".', - path: [], - }, - ]); -}); diff --git a/tests/unit/schemas/date/date.test.ts b/tests/unit/schemas/date/date.test.ts deleted file mode 100644 index 2790268..0000000 --- a/tests/unit/schemas/date/date.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { date } from "../../../../src/core/schemas/builders/date"; -import { itSchema } from "../utils/itSchema"; -import { itValidateJson, itValidateParse } from "../utils/itValidate"; - -describe("date", () => { - itSchema("converts between raw ISO string and parsed Date", date(), { - raw: "2022-09-29T05:41:21.939Z", - parsed: new Date("2022-09-29T05:41:21.939Z"), - }); - - itValidateParse("non-string", date(), 42, [ - { - message: "Expected string. Received 42.", - path: [], - }, - ]); - - itValidateParse("non-ISO", date(), "hello world", [ - { - message: 'Expected ISO 8601 date string. Received "hello world".', - path: [], - }, - ]); - - itValidateJson("non-Date", date(), "hello", [ - { - message: 'Expected Date object. Received "hello".', - path: [], - }, - ]); -}); diff --git a/tests/unit/schemas/enum/enum.test.ts b/tests/unit/schemas/enum/enum.test.ts deleted file mode 100644 index d170732..0000000 --- a/tests/unit/schemas/enum/enum.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { enum_ } from "../../../../src/core/schemas/builders/enum"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("enum", () => { - itSchemaIdentity(enum_(["A", "B", "C"]), "A"); - - itSchemaIdentity(enum_(["A", "B", "C"]), "D" as any, { - opts: { allowUnrecognizedEnumValues: true }, - }); - - itValidate("invalid enum", enum_(["A", "B", "C"]), "D", [ - { - message: 'Expected enum. Received "D".', - path: [], - }, - ]); - - itValidate( - "non-string", - enum_(["A", "B", "C"]), - [], - [ - { - message: "Expected string. Received list.", - path: [], - }, - ], - ); -}); diff --git a/tests/unit/schemas/lazy/lazy.test.ts b/tests/unit/schemas/lazy/lazy.test.ts deleted file mode 100644 index 3a5a338..0000000 --- a/tests/unit/schemas/lazy/lazy.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Schema } from "../../../../src/core/schemas/Schema"; -import { lazy, list, object, string } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; - -describe("lazy", () => { - it("doesn't run immediately", () => { - let wasRun = false; - lazy(() => { - wasRun = true; - return string(); - }); - expect(wasRun).toBe(false); - }); - - it("only runs first time", async () => { - let count = 0; - const schema = lazy(() => { - count++; - return string(); - }); - await schema.parse("hello"); - await schema.json("world"); - expect(count).toBe(1); - }); - - itSchemaIdentity( - lazy(() => object({})), - { foo: "hello" }, - { - title: "passes opts through", - opts: { unrecognizedObjectKeys: "passthrough" }, - }, - ); - - itSchemaIdentity( - lazy(() => object({ foo: string() })), - { foo: "hello" }, - ); - - // eslint-disable-next-line jest/expect-expect - it("self-referencial schema doesn't compile", () => { - () => { - // @ts-expect-error - const a = lazy(() => object({ foo: a })); - }; - }); - - // eslint-disable-next-line jest/expect-expect - it("self-referencial compiles with explicit type", () => { - () => { - interface TreeNode { - children: TreeNode[]; - } - const TreeNode: Schema = lazy(() => object({ children: list(TreeNode) })); - }; - }); -}); diff --git a/tests/unit/schemas/lazy/lazyObject.test.ts b/tests/unit/schemas/lazy/lazyObject.test.ts deleted file mode 100644 index 9b44367..0000000 --- a/tests/unit/schemas/lazy/lazyObject.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { lazyObject, number, object, string } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; - -describe("lazy", () => { - itSchemaIdentity( - lazyObject(() => object({ foo: string() })), - { foo: "hello" }, - ); - - itSchemaIdentity( - lazyObject(() => object({ foo: string() })).extend(object({ bar: number() })), - { - foo: "hello", - bar: 42, - }, - { title: "returned schema has object utils" }, - ); -}); diff --git a/tests/unit/schemas/lazy/recursive/a.ts b/tests/unit/schemas/lazy/recursive/a.ts deleted file mode 100644 index 8b7d5e4..0000000 --- a/tests/unit/schemas/lazy/recursive/a.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { object } from "../../../../../src/core/schemas/builders/object"; -import { schemaB } from "./b"; - -// @ts-expect-error -export const schemaA = object({ - b: schemaB, -}); diff --git a/tests/unit/schemas/lazy/recursive/b.ts b/tests/unit/schemas/lazy/recursive/b.ts deleted file mode 100644 index fb219d5..0000000 --- a/tests/unit/schemas/lazy/recursive/b.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { object } from "../../../../../src/core/schemas/builders/object"; -import { optional } from "../../../../../src/core/schemas/builders/schema-utils"; -import { schemaA } from "./a"; - -// @ts-expect-error -export const schemaB = object({ - a: optional(schemaA), -}); diff --git a/tests/unit/schemas/list/list.test.ts b/tests/unit/schemas/list/list.test.ts deleted file mode 100644 index 108789b..0000000 --- a/tests/unit/schemas/list/list.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { list, object, property, string } from "../../../../src/core/schemas/builders"; -import { itSchema, itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("list", () => { - itSchemaIdentity(list(string()), ["hello", "world"], { - title: "functions as identity when item type is primitive", - }); - - itSchema( - "converts objects correctly", - list( - object({ - helloWorld: property("hello_world", string()), - }), - ), - { - raw: [{ hello_world: "123" }], - parsed: [{ helloWorld: "123" }], - }, - ); - - itValidate("not a list", list(string()), 42, [ - { - path: [], - message: "Expected list. Received 42.", - }, - ]); - - itValidate( - "invalid item type", - list(string()), - [42], - [ - { - path: ["[0]"], - message: "Expected string. Received 42.", - }, - ], - ); -}); diff --git a/tests/unit/schemas/literals/stringLiteral.test.ts b/tests/unit/schemas/literals/stringLiteral.test.ts deleted file mode 100644 index fa6c888..0000000 --- a/tests/unit/schemas/literals/stringLiteral.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { stringLiteral } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("stringLiteral", () => { - itSchemaIdentity(stringLiteral("A"), "A"); - - itValidate("incorrect string", stringLiteral("A"), "B", [ - { - path: [], - message: 'Expected "A". Received "B".', - }, - ]); - - itValidate("non-string", stringLiteral("A"), 42, [ - { - path: [], - message: 'Expected "A". Received 42.', - }, - ]); -}); diff --git a/tests/unit/schemas/object-like/withParsedProperties.test.ts b/tests/unit/schemas/object-like/withParsedProperties.test.ts deleted file mode 100644 index 9f5dd0e..0000000 --- a/tests/unit/schemas/object-like/withParsedProperties.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { object, property, string, stringLiteral } from "../../../../src/core/schemas/builders"; - -describe("withParsedProperties", () => { - it("Added properties included on parsed object", async () => { - const schema = object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }).withParsedProperties({ - printFoo: (parsed) => () => parsed.foo, - printHelloWorld: () => () => "Hello world", - helloWorld: "Hello world", - }); - - const parsed = await schema.parse({ raw_foo: "value of foo", bar: "bar" }); - if (!parsed.ok) { - throw new Error("Failed to parse"); - } - expect(parsed.value.printFoo()).toBe("value of foo"); - expect(parsed.value.printHelloWorld()).toBe("Hello world"); - expect(parsed.value.helloWorld).toBe("Hello world"); - }); - - it("Added property is removed on raw object", async () => { - const schema = object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }).withParsedProperties({ - printFoo: (parsed) => () => parsed.foo, - }); - - const original = { raw_foo: "value of foo", bar: "bar" } as const; - const parsed = await schema.parse(original); - if (!parsed.ok) { - throw new Error("Failed to parse()"); - } - - const raw = await schema.json(parsed.value); - - if (!raw.ok) { - throw new Error("Failed to json()"); - } - - expect(raw.value).toEqual(original); - }); - - describe("compile", () => { - // eslint-disable-next-line jest/expect-expect - it("doesn't compile with non-object schema", () => { - () => - object({ - foo: string(), - }) - // @ts-expect-error - .withParsedProperties(42); - }); - }); -}); diff --git a/tests/unit/schemas/object/extend.test.ts b/tests/unit/schemas/object/extend.test.ts deleted file mode 100644 index 1095471..0000000 --- a/tests/unit/schemas/object/extend.test.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { boolean, object, property, string, stringLiteral } from "../../../../src/core/schemas/builders"; -import { itSchema, itSchemaIdentity } from "../utils/itSchema"; - -describe("extend", () => { - itSchemaIdentity( - object({ - foo: string(), - }).extend( - object({ - bar: stringLiteral("bar"), - }), - ), - { - foo: "", - bar: "bar", - } as const, - { - title: "extended properties are included in schema", - }, - ); - - itSchemaIdentity( - object({ - foo: string(), - }) - .extend( - object({ - bar: stringLiteral("bar"), - }), - ) - .extend( - object({ - baz: boolean(), - }), - ), - { - foo: "", - bar: "bar", - baz: true, - } as const, - { - title: "extensions can be extended", - }, - ); - - itSchema( - "converts nested object", - object({ - item: object({ - helloWorld: property("hello_world", string()), - }), - }).extend( - object({ - goodbye: property("goodbye_raw", string()), - }), - ), - { - raw: { item: { hello_world: "yo" }, goodbye_raw: "peace" }, - parsed: { item: { helloWorld: "yo" }, goodbye: "peace" }, - }, - ); - - itSchema( - "extensions work with raw/parsed property name conversions", - object({ - item: property("item_raw", string()), - }).extend( - object({ - goodbye: property("goodbye_raw", string()), - }), - ), - { - raw: { item_raw: "hi", goodbye_raw: "peace" }, - parsed: { item: "hi", goodbye: "peace" }, - }, - ); - - describe("compile", () => { - // eslint-disable-next-line jest/expect-expect - it("doesn't compile with non-object schema", () => { - () => - object({ - foo: string(), - }) - // @ts-expect-error - .extend([]); - }); - }); -}); diff --git a/tests/unit/schemas/object/object.test.ts b/tests/unit/schemas/object/object.test.ts deleted file mode 100644 index a8d9fe0..0000000 --- a/tests/unit/schemas/object/object.test.ts +++ /dev/null @@ -1,255 +0,0 @@ -import { any, number, object, property, string, stringLiteral, unknown } from "../../../../src/core/schemas/builders"; -import { itJson, itParse, itSchema, itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("object", () => { - itSchemaIdentity( - object({ - foo: string(), - bar: stringLiteral("bar"), - }), - { - foo: "", - bar: "bar", - }, - { - title: "functions as identity when values are primitives and property() isn't used", - }, - ); - - itSchema( - "uses raw key from property()", - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { raw_foo: "foo", bar: "bar" }, - parsed: { foo: "foo", bar: "bar" }, - }, - ); - - itSchema( - "keys with unknown type can be omitted", - object({ - foo: unknown(), - }), - { - raw: {}, - parsed: {}, - }, - ); - - itSchema( - "keys with any type can be omitted", - object({ - foo: any(), - }), - { - raw: {}, - parsed: {}, - }, - ); - - describe("unrecognizedObjectKeys", () => { - describe("parse", () => { - itParse( - 'includes unknown values when unrecognizedObjectKeys === "passthrough"', - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { - raw_foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - parsed: { - foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - opts: { - unrecognizedObjectKeys: "passthrough", - }, - }, - ); - - itParse( - 'strips unknown values when unrecognizedObjectKeys === "strip"', - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { - raw_foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - parsed: { - foo: "foo", - bar: "bar", - }, - opts: { - unrecognizedObjectKeys: "strip", - }, - }, - ); - }); - - describe("json", () => { - itJson( - 'includes unknown values when unrecognizedObjectKeys === "passthrough"', - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { - raw_foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - parsed: { - foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - opts: { - unrecognizedObjectKeys: "passthrough", - }, - }, - ); - - itJson( - 'strips unknown values when unrecognizedObjectKeys === "strip"', - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { - raw_foo: "foo", - bar: "bar", - }, - parsed: { - foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - opts: { - unrecognizedObjectKeys: "strip", - }, - }, - ); - }); - }); - - describe("nullish properties", () => { - itSchema("missing properties are not added", object({ foo: property("raw_foo", string().optional()) }), { - raw: {}, - parsed: {}, - }); - - itSchema("undefined properties are not dropped", object({ foo: property("raw_foo", string().optional()) }), { - raw: { raw_foo: null }, - parsed: { foo: undefined }, - }); - - itSchema("null properties are not dropped", object({ foo: property("raw_foo", string().optional()) }), { - raw: { raw_foo: null }, - parsed: { foo: undefined }, - }); - - describe("extensions", () => { - itSchema( - "undefined properties are not dropped", - object({}).extend(object({ foo: property("raw_foo", string().optional()) })), - { - raw: { raw_foo: null }, - parsed: { foo: undefined }, - }, - ); - - describe("parse()", () => { - itParse( - "null properties are not dropped", - object({}).extend(object({ foo: property("raw_foo", string().optional()) })), - { - raw: { raw_foo: null }, - parsed: { foo: undefined }, - }, - ); - }); - }); - }); - - itValidate( - "missing property", - object({ - foo: string(), - bar: stringLiteral("bar"), - }), - { foo: "hello" }, - [ - { - path: [], - message: 'Missing required key "bar"', - }, - ], - ); - - itValidate( - "extra property", - object({ - foo: string(), - bar: stringLiteral("bar"), - }), - { foo: "hello", bar: "bar", baz: 42 }, - [ - { - path: ["baz"], - message: 'Unexpected key "baz"', - }, - ], - ); - - itValidate( - "not an object", - object({ - foo: string(), - bar: stringLiteral("bar"), - }), - [], - [ - { - path: [], - message: "Expected object. Received list.", - }, - ], - ); - - itValidate( - "nested validation error", - object({ - foo: object({ - bar: number(), - }), - }), - { foo: { bar: "hello" } }, - [ - { - path: ["foo", "bar"], - message: 'Expected number. Received "hello".', - }, - ], - ); -}); diff --git a/tests/unit/schemas/object/objectWithoutOptionalProperties.test.ts b/tests/unit/schemas/object/objectWithoutOptionalProperties.test.ts deleted file mode 100644 index efcd83a..0000000 --- a/tests/unit/schemas/object/objectWithoutOptionalProperties.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { objectWithoutOptionalProperties, string, stringLiteral } from "../../../../src/core/schemas/builders"; -import { itSchema } from "../utils/itSchema"; - -describe("objectWithoutOptionalProperties", () => { - itSchema( - "all properties are required", - objectWithoutOptionalProperties({ - foo: string(), - bar: stringLiteral("bar").optional(), - }), - { - raw: { - foo: "hello", - }, - // @ts-expect-error - parsed: { - foo: "hello", - }, - }, - ); -}); diff --git a/tests/unit/schemas/object/passthrough.test.ts b/tests/unit/schemas/object/passthrough.test.ts deleted file mode 100644 index c8770fc..0000000 --- a/tests/unit/schemas/object/passthrough.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { object, string, stringLiteral } from "../../../../src/core/schemas/builders"; -import { itJson, itParse, itSchema } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("passthrough", () => { - const baseSchema = object({ - foo: string(), - bar: stringLiteral("bar"), - }); - - describe("parse", () => { - itParse("includes unknown values", baseSchema.passthrough(), { - raw: { - foo: "hello", - bar: "bar", - baz: "extra", - }, - parsed: { - foo: "hello", - bar: "bar", - baz: "extra", - }, - }); - - itValidate( - "preserves schema validation", - baseSchema.passthrough(), - { - foo: 123, - bar: "bar", - baz: "extra", - }, - [ - { - path: ["foo"], - message: "Expected string. Received 123.", - }, - ], - ); - }); - - describe("json", () => { - itJson("includes unknown values", baseSchema.passthrough(), { - raw: { - foo: "hello", - bar: "bar", - - baz: "extra", - }, - parsed: { - foo: "hello", - bar: "bar", - - baz: "extra", - }, - }); - - itValidate( - "preserves schema validation", - baseSchema.passthrough(), - { - foo: "hello", - bar: "wrong", - baz: "extra", - }, - [ - { - path: ["bar"], - message: 'Expected "bar". Received "wrong".', - }, - ], - ); - }); - - itSchema("preserves schema validation in both directions", baseSchema.passthrough(), { - raw: { - foo: "hello", - bar: "bar", - extra: 42, - }, - parsed: { - foo: "hello", - bar: "bar", - extra: 42, - }, - }); -}); diff --git a/tests/unit/schemas/primitives/any.test.ts b/tests/unit/schemas/primitives/any.test.ts deleted file mode 100644 index 1adbbe2..0000000 --- a/tests/unit/schemas/primitives/any.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { any } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; - -describe("any", () => { - itSchemaIdentity(any(), true); -}); diff --git a/tests/unit/schemas/primitives/boolean.test.ts b/tests/unit/schemas/primitives/boolean.test.ts deleted file mode 100644 index 897a829..0000000 --- a/tests/unit/schemas/primitives/boolean.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { boolean } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("boolean", () => { - itSchemaIdentity(boolean(), true); - - itValidate("non-boolean", boolean(), {}, [ - { - path: [], - message: "Expected boolean. Received object.", - }, - ]); -}); diff --git a/tests/unit/schemas/primitives/number.test.ts b/tests/unit/schemas/primitives/number.test.ts deleted file mode 100644 index 2d01415..0000000 --- a/tests/unit/schemas/primitives/number.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { number } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("number", () => { - itSchemaIdentity(number(), 42); - - itValidate("non-number", number(), "hello", [ - { - path: [], - message: 'Expected number. Received "hello".', - }, - ]); -}); diff --git a/tests/unit/schemas/primitives/string.test.ts b/tests/unit/schemas/primitives/string.test.ts deleted file mode 100644 index 57b2368..0000000 --- a/tests/unit/schemas/primitives/string.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { string } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("string", () => { - itSchemaIdentity(string(), "hello"); - - itValidate("non-string", string(), 42, [ - { - path: [], - message: "Expected string. Received 42.", - }, - ]); -}); diff --git a/tests/unit/schemas/primitives/unknown.test.ts b/tests/unit/schemas/primitives/unknown.test.ts deleted file mode 100644 index 4d17a7d..0000000 --- a/tests/unit/schemas/primitives/unknown.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { unknown } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; - -describe("unknown", () => { - itSchemaIdentity(unknown(), true); -}); diff --git a/tests/unit/schemas/record/record.test.ts b/tests/unit/schemas/record/record.test.ts deleted file mode 100644 index e07f3e7..0000000 --- a/tests/unit/schemas/record/record.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { number, record, string } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("record", () => { - itSchemaIdentity(record(string(), string()), { hello: "world" }); - itSchemaIdentity(record(number(), string()), { 42: "world" }); - - itValidate( - "non-record", - record(number(), string()), - [], - [ - { - path: [], - message: "Expected object. Received list.", - }, - ], - ); - - itValidate("invalid key type", record(number(), string()), { hello: "world" }, [ - { - path: ["hello (key)"], - message: 'Expected number. Received "hello".', - }, - ]); - - itValidate("invalid value type", record(string(), number()), { hello: "world" }, [ - { - path: ["hello"], - message: 'Expected number. Received "world".', - }, - ]); -}); diff --git a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts b/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts deleted file mode 100644 index 09d594d..0000000 --- a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { object, string } from "../../../../src/core/schemas/builders"; -import { itSchema } from "../utils/itSchema"; - -describe("getSchemaUtils", () => { - describe("optional()", () => { - itSchema("optional fields allow original schema", string().optional(), { - raw: "hello", - parsed: "hello", - }); - - itSchema("optional fields are not required", string().optional(), { - raw: null, - parsed: undefined, - }); - }); - - describe("transform()", () => { - itSchema( - "transform and untransform run correctly", - string().transform({ - transform: (x) => x + "X", - untransform: (x) => (x as string).slice(0, -1), - }), - { - raw: "hello", - parsed: "helloX", - }, - ); - }); - - describe("parseOrThrow()", () => { - it("parses valid value", async () => { - const value = string().parseOrThrow("hello"); - expect(value).toBe("hello"); - }); - - it("throws on invalid value", async () => { - const value = () => object({ a: string(), b: string() }).parseOrThrow({ a: 24 }); - expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); - }); - }); - - describe("jsonOrThrow()", () => { - it("serializes valid value", async () => { - const value = string().jsonOrThrow("hello"); - expect(value).toBe("hello"); - }); - - it("throws on invalid value", async () => { - const value = () => object({ a: string(), b: string() }).jsonOrThrow({ a: 24 }); - expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); - }); - }); - - describe("omitUndefined", () => { - it("serializes undefined as null", async () => { - const value = object({ - a: string().optional(), - b: string().optional(), - }).jsonOrThrow({ - a: "hello", - b: undefined, - }); - expect(value).toEqual({ a: "hello", b: null }); - }); - - it("omits undefined values", async () => { - const value = object({ - a: string().optional(), - b: string().optional(), - }).jsonOrThrow( - { - a: "hello", - b: undefined, - }, - { - omitUndefined: true, - }, - ); - expect(value).toEqual({ a: "hello" }); - }); - }); -}); diff --git a/tests/unit/schemas/schema.test.ts b/tests/unit/schemas/schema.test.ts deleted file mode 100644 index 13842ff..0000000 --- a/tests/unit/schemas/schema.test.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { - boolean, - discriminant, - list, - number, - object, - string, - stringLiteral, - union, -} from "../../../src/core/schemas/builders"; -import { booleanLiteral } from "../../../src/core/schemas/builders/literals/booleanLiteral"; -import { property } from "../../../src/core/schemas/builders/object/property"; -import { itSchema } from "./utils/itSchema"; - -describe("Schema", () => { - itSchema( - "large nested object", - object({ - a: string(), - b: stringLiteral("b value"), - c: property( - "raw_c", - list( - object({ - animal: union(discriminant("type", "_type"), { - dog: object({ value: boolean() }), - cat: object({ value: property("raw_cat", number()) }), - }), - }), - ), - ), - d: property("raw_d", boolean()), - e: booleanLiteral(true), - }), - { - raw: { - a: "hello", - b: "b value", - raw_c: [ - { - animal: { - _type: "dog", - value: true, - }, - }, - { - animal: { - _type: "cat", - raw_cat: 42, - }, - }, - ], - raw_d: false, - e: true, - }, - parsed: { - a: "hello", - b: "b value", - c: [ - { - animal: { - type: "dog", - value: true, - }, - }, - { - animal: { - type: "cat", - value: 42, - }, - }, - ], - d: false, - e: true, - }, - }, - ); -}); diff --git a/tests/unit/schemas/set/set.test.ts b/tests/unit/schemas/set/set.test.ts deleted file mode 100644 index 53a1652..0000000 --- a/tests/unit/schemas/set/set.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { set, string } from "../../../../src/core/schemas/builders"; -import { itSchema } from "../utils/itSchema"; -import { itValidateJson, itValidateParse } from "../utils/itValidate"; - -describe("set", () => { - itSchema("converts between raw list and parsed Set", set(string()), { - raw: ["A", "B"], - parsed: new Set(["A", "B"]), - }); - - itValidateParse("not a list", set(string()), 42, [ - { - path: [], - message: "Expected list. Received 42.", - }, - ]); - - itValidateJson( - "not a Set", - set(string()), - [], - [ - { - path: [], - message: "Expected Set. Received list.", - }, - ], - ); - - itValidateParse( - "invalid item type", - set(string()), - [42], - [ - { - path: ["[0]"], - message: "Expected string. Received 42.", - }, - ], - ); - - itValidateJson("invalid item type", set(string()), new Set([42]), [ - { - path: ["[0]"], - message: "Expected string. Received 42.", - }, - ]); -}); diff --git a/tests/unit/schemas/skipValidation.test.ts b/tests/unit/schemas/skipValidation.test.ts deleted file mode 100644 index 3283555..0000000 --- a/tests/unit/schemas/skipValidation.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* eslint-disable no-console */ -import { boolean, number, object, property, string, undiscriminatedUnion } from "../../../src/core/schemas/builders"; - -describe("skipValidation", () => { - it("allows data that doesn't conform to the schema", async () => { - const warningLogs: string[] = []; - const originalConsoleWarn = console.warn; - console.warn = (...args) => warningLogs.push(args.join(" ")); - - const schema = object({ - camelCase: property("snake_case", string()), - numberProperty: number(), - requiredProperty: boolean(), - anyPrimitive: undiscriminatedUnion([string(), number(), boolean()]), - }); - - const parsed = await schema.parse( - { - snake_case: "hello", - numberProperty: "oops", - anyPrimitive: true, - }, - { - skipValidation: true, - }, - ); - - expect(parsed).toEqual({ - ok: true, - value: { - camelCase: "hello", - numberProperty: "oops", - anyPrimitive: true, - }, - }); - - expect(warningLogs).toEqual([ - `Failed to validate. - - numberProperty: Expected number. Received "oops".`, - ]); - - console.warn = originalConsoleWarn; - }); -}); diff --git a/tests/unit/schemas/undiscriminated-union/undiscriminatedUnion.test.ts b/tests/unit/schemas/undiscriminated-union/undiscriminatedUnion.test.ts deleted file mode 100644 index e0ddb21..0000000 --- a/tests/unit/schemas/undiscriminated-union/undiscriminatedUnion.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { number, object, property, string, undiscriminatedUnion } from "../../../../src/core/schemas/builders"; -import { itSchema, itSchemaIdentity } from "../utils/itSchema"; - -describe("undiscriminatedUnion", () => { - itSchemaIdentity(undiscriminatedUnion([string(), number()]), "hello world"); - - itSchemaIdentity(undiscriminatedUnion([object({ hello: string() }), object({ goodbye: string() })]), { - goodbye: "foo", - }); - - itSchema( - "Correctly transforms", - undiscriminatedUnion([object({ hello: string() }), object({ helloWorld: property("hello_world", string()) })]), - { - raw: { hello_world: "foo " }, - parsed: { helloWorld: "foo " }, - }, - ); - - it("Returns errors for all variants", async () => { - const result = await undiscriminatedUnion([string(), number()]).parse(true); - if (result.ok) { - throw new Error("Unexpectedly passed validation"); - } - expect(result.errors).toEqual([ - { - message: "[Variant 0] Expected string. Received true.", - path: [], - }, - { - message: "[Variant 1] Expected number. Received true.", - path: [], - }, - ]); - }); - - describe("compile", () => { - // eslint-disable-next-line jest/expect-expect - it("doesn't compile with zero members", () => { - // @ts-expect-error - () => undiscriminatedUnion([]); - }); - }); -}); diff --git a/tests/unit/schemas/union/union.test.ts b/tests/unit/schemas/union/union.test.ts deleted file mode 100644 index 1f5d7a8..0000000 --- a/tests/unit/schemas/union/union.test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { boolean, discriminant, number, object, string, union } from "../../../../src/core/schemas/builders"; -import { itSchema, itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("union", () => { - itSchemaIdentity( - union("type", { - lion: object({ - meows: boolean(), - }), - giraffe: object({ - heightInInches: number(), - }), - }), - { type: "lion", meows: true }, - { title: "doesn't transform discriminant when it's a string" }, - ); - - itSchema( - "transforms discriminant when it's a discriminant()", - union(discriminant("type", "_type"), { - lion: object({ meows: boolean() }), - giraffe: object({ heightInInches: number() }), - }), - { - raw: { _type: "lion", meows: true }, - parsed: { type: "lion", meows: true }, - }, - ); - - describe("allowUnrecognizedUnionMembers", () => { - itSchema( - "transforms discriminant & passes through values when discriminant value is unrecognized", - union(discriminant("type", "_type"), { - lion: object({ meows: boolean() }), - giraffe: object({ heightInInches: number() }), - }), - { - // @ts-expect-error - raw: { _type: "moose", isAMoose: true }, - // @ts-expect-error - parsed: { type: "moose", isAMoose: true }, - opts: { - allowUnrecognizedUnionMembers: true, - }, - }, - ); - }); - - describe("withParsedProperties", () => { - it("Added property is included on parsed object", async () => { - const schema = union("type", { - lion: object({}), - tiger: object({ value: string() }), - }).withParsedProperties({ - printType: (parsed) => () => parsed.type, - }); - - const parsed = await schema.parse({ type: "lion" }); - if (!parsed.ok) { - throw new Error("Failed to parse"); - } - expect(parsed.value.printType()).toBe("lion"); - }); - }); - - itValidate( - "non-object", - union("type", { - lion: object({}), - tiger: object({ value: string() }), - }), - [], - [ - { - path: [], - message: "Expected object. Received list.", - }, - ], - ); - - itValidate( - "missing discriminant", - union("type", { - lion: object({}), - tiger: object({ value: string() }), - }), - {}, - [ - { - path: [], - message: 'Missing discriminant ("type")', - }, - ], - ); - - itValidate( - "unrecognized discriminant value", - union("type", { - lion: object({}), - tiger: object({ value: string() }), - }), - { - type: "bear", - }, - [ - { - path: ["type"], - message: 'Expected enum. Received "bear".', - }, - ], - ); -}); diff --git a/tests/unit/schemas/utils/itSchema.ts b/tests/unit/schemas/utils/itSchema.ts deleted file mode 100644 index 82a5388..0000000 --- a/tests/unit/schemas/utils/itSchema.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* eslint-disable jest/no-export */ -import { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; - -export function itSchemaIdentity( - schema: Schema, - value: T, - { title = "functions as identity", opts }: { title?: string; opts?: SchemaOptions } = {}, -): void { - itSchema(title, schema, { raw: value, parsed: value, opts }); -} - -export function itSchema( - title: string, - schema: Schema, - { - raw, - parsed, - opts, - only = false, - }: { - raw: Raw; - parsed: Parsed; - opts?: SchemaOptions; - only?: boolean; - }, -): void { - // eslint-disable-next-line jest/valid-title - (only ? describe.only : describe)(title, () => { - itParse("parse()", schema, { raw, parsed, opts }); - itJson("json()", schema, { raw, parsed, opts }); - }); -} - -export function itParse( - title: string, - schema: Schema, - { - raw, - parsed, - opts, - }: { - raw: Raw; - parsed: Parsed; - opts?: SchemaOptions; - }, -): void { - // eslint-disable-next-line jest/valid-title - it(title, () => { - const maybeValid = schema.parse(raw, opts); - if (!maybeValid.ok) { - throw new Error("Failed to parse() " + JSON.stringify(maybeValid.errors, undefined, 4)); - } - expect(maybeValid.value).toStrictEqual(parsed); - }); -} - -export function itJson( - title: string, - schema: Schema, - { - raw, - parsed, - opts, - }: { - raw: Raw; - parsed: Parsed; - opts?: SchemaOptions; - }, -): void { - // eslint-disable-next-line jest/valid-title - it(title, () => { - const maybeValid = schema.json(parsed, opts); - if (!maybeValid.ok) { - throw new Error("Failed to json() " + JSON.stringify(maybeValid.errors, undefined, 4)); - } - expect(maybeValid.value).toStrictEqual(raw); - }); -} diff --git a/tests/unit/schemas/utils/itValidate.ts b/tests/unit/schemas/utils/itValidate.ts deleted file mode 100644 index ead1ca7..0000000 --- a/tests/unit/schemas/utils/itValidate.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* eslint-disable jest/no-export */ -import { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; - -export function itValidate( - title: string, - schema: Schema, - input: unknown, - errors: ValidationError[], - opts?: SchemaOptions, -): void { - // eslint-disable-next-line jest/valid-title - describe("parse()", () => { - itValidateParse(title, schema, input, errors, opts); - }); - describe("json()", () => { - itValidateJson(title, schema, input, errors, opts); - }); -} - -export function itValidateParse( - title: string, - schema: Schema, - raw: unknown, - errors: ValidationError[], - opts?: SchemaOptions, -): void { - describe("parse", () => { - // eslint-disable-next-line jest/valid-title - it(title, async () => { - const maybeValid = await schema.parse(raw, opts); - if (maybeValid.ok) { - throw new Error("Value passed validation"); - } - expect(maybeValid.errors).toStrictEqual(errors); - }); - }); -} - -export function itValidateJson( - title: string, - schema: Schema, - parsed: unknown, - errors: ValidationError[], - opts?: SchemaOptions, -): void { - describe("json", () => { - // eslint-disable-next-line jest/valid-title - it(title, async () => { - const maybeValid = await schema.json(parsed, opts); - if (maybeValid.ok) { - throw new Error("Value passed validation"); - } - expect(maybeValid.errors).toStrictEqual(errors); - }); - }); -} diff --git a/yarn.lock b/yarn.lock index d9d023c..d91e175 100644 --- a/yarn.lock +++ b/yarn.lock @@ -575,9 +575,9 @@ "@jridgewell/sourcemap-codec" "^1.4.14" "@mswjs/interceptors@^0.39.1": - version "0.39.5" - resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.39.5.tgz#6f0571493bf76291a60b62234ed0add2c4bd970e" - integrity sha512-B9nHSJYtsv79uo7QdkZ/b/WoKm20IkVSmTc/WCKarmDtFwM0dRx2ouEniqwNkzCSLn3fydzKmnMzjtfdOWt3VQ== + version "0.39.6" + resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.39.6.tgz#44094a578f20da4749d1a0eaf3cdb7973604004b" + integrity sha512-bndDP83naYYkfayr/qhBHMhk0YGwS1iv6vaEGcr0SQbO0IZtbOPqjKjds/WcG+bJA+1T5vCx6kprKOzn5Bg+Vw== dependencies: "@open-draft/deferred-promise" "^2.2.0" "@open-draft/logger" "^0.3.0"