@fern-api/venus-api-sdk 11.7.0 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +11 -6
- package/dist/cjs/api/resources/guestSession/client/Client.d.ts +53 -0
- package/dist/cjs/api/resources/guestSession/client/Client.js +325 -0
- package/dist/cjs/api/resources/guestSession/client/claim.d.ts +25 -0
- package/dist/cjs/api/resources/guestSession/client/claim.js +66 -0
- package/dist/cjs/api/resources/guestSession/client/create.d.ts +13 -1
- package/dist/cjs/api/resources/guestSession/client/create.js +22 -0
- package/dist/cjs/api/resources/guestSession/client/delete.d.ts +25 -0
- package/dist/cjs/api/resources/guestSession/client/delete.js +66 -0
- package/dist/cjs/api/resources/guestSession/client/get.d.ts +43 -0
- package/dist/cjs/api/resources/guestSession/client/get.js +99 -0
- package/dist/cjs/api/resources/guestSession/client/index.d.ts +3 -0
- package/dist/cjs/api/resources/guestSession/client/index.js +4 -1
- package/dist/cjs/api/resources/guestSession/client/requests/ClaimGuestSessionRequest.d.ts +10 -0
- package/dist/cjs/api/resources/guestSession/client/requests/ClaimGuestSessionRequest.js +3 -0
- package/dist/cjs/api/resources/guestSession/client/requests/DeleteGuestSessionsSessionIdDeleteRequest.d.ts +9 -0
- package/dist/cjs/api/resources/guestSession/client/requests/DeleteGuestSessionsSessionIdDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/guestSession/client/requests/GetGuestSessionsSessionIdGetRequest.d.ts +11 -0
- package/dist/cjs/api/resources/guestSession/client/requests/GetGuestSessionsSessionIdGetRequest.js +3 -0
- package/dist/cjs/api/resources/guestSession/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/internalGuestSession/client/Client.d.ts +55 -0
- package/dist/cjs/api/resources/internalGuestSession/client/Client.js +314 -0
- package/dist/cjs/api/resources/internalGuestSession/client/index.d.ts +4 -0
- package/dist/cjs/api/resources/internalGuestSession/client/index.js +43 -0
- package/dist/cjs/api/resources/internalGuestSession/client/readByOrg.d.ts +25 -0
- package/dist/cjs/api/resources/internalGuestSession/client/readByOrg.js +66 -0
- package/dist/cjs/api/resources/internalGuestSession/client/requests/ReadByOrgInternalGuestSessionsByOrgOrgIdGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/internalGuestSession/client/requests/ReadByOrgInternalGuestSessionsByOrgOrgIdGetRequest.js +3 -0
- package/dist/cjs/api/resources/internalGuestSession/client/requests/ReserveRequest.d.ts +14 -0
- package/dist/cjs/api/resources/internalGuestSession/client/requests/ReserveRequest.js +3 -0
- package/dist/cjs/api/resources/internalGuestSession/client/requests/SettleRequest.d.ts +14 -0
- package/dist/cjs/api/resources/internalGuestSession/client/requests/SettleRequest.js +3 -0
- package/dist/cjs/api/resources/internalGuestSession/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/internalGuestSession/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/internalGuestSession/client/reserve.d.ts +25 -0
- package/dist/cjs/api/resources/internalGuestSession/client/reserve.js +66 -0
- package/dist/cjs/api/resources/internalGuestSession/client/settle.d.ts +25 -0
- package/dist/cjs/api/resources/internalGuestSession/client/settle.js +66 -0
- package/dist/cjs/api/resources/internalGuestSession/index.d.ts +2 -0
- package/dist/cjs/api/resources/internalGuestSession/index.js +18 -0
- package/dist/cjs/api/resources/internalGuestSession/types/ReserveRequestKind.d.ts +5 -0
- package/dist/cjs/api/resources/internalGuestSession/types/ReserveRequestKind.js +8 -0
- package/dist/cjs/api/resources/internalGuestSession/types/SettleRequestOutcome.d.ts +5 -0
- package/dist/cjs/api/resources/internalGuestSession/types/SettleRequestOutcome.js +8 -0
- package/dist/cjs/api/resources/internalGuestSession/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/internalGuestSession/types/index.js +18 -0
- package/dist/cjs/api/types/ClaimGuestSessionResponse.d.ts +10 -0
- package/dist/cjs/api/types/ClaimGuestSessionResponse.js +3 -0
- package/dist/cjs/api/types/ClaimGuestSessionResponseStatus.d.ts +9 -0
- package/dist/cjs/api/types/ClaimGuestSessionResponseStatus.js +12 -0
- package/dist/cjs/api/types/CreateGuestSessionResponse.d.ts +2 -0
- package/dist/cjs/api/types/DeleteGuestSessionResponse.d.ts +7 -0
- package/dist/cjs/api/types/DeleteGuestSessionResponse.js +3 -0
- package/dist/cjs/api/types/DeleteGuestSessionResponseStatus.d.ts +9 -0
- package/dist/cjs/api/types/DeleteGuestSessionResponseStatus.js +12 -0
- package/dist/cjs/api/types/GetGuestSessionResponse.d.ts +13 -0
- package/dist/cjs/api/types/GetGuestSessionResponse.js +3 -0
- package/dist/cjs/api/types/GetGuestSessionResponseStatus.d.ts +9 -0
- package/dist/cjs/api/types/GetGuestSessionResponseStatus.js +12 -0
- package/dist/cjs/api/types/GoneErrorBody.d.ts +5 -0
- package/dist/cjs/api/types/GoneErrorBody.js +3 -0
- package/dist/cjs/api/types/GoneErrorBodyContent.d.ts +8 -0
- package/dist/cjs/api/types/GoneErrorBodyContent.js +3 -0
- package/dist/cjs/api/types/GoneErrorBodyContentCode.d.ts +5 -0
- package/dist/cjs/api/types/GoneErrorBodyContentCode.js +8 -0
- package/dist/cjs/api/types/GuestSessionLimits.d.ts +2 -0
- package/dist/cjs/api/types/GuestSessionUsage.d.ts +4 -0
- package/dist/cjs/api/types/GuestSessionUsage.js +3 -0
- package/dist/cjs/api/types/InternalGuestSessionResponse.d.ts +22 -0
- package/dist/cjs/api/types/InternalGuestSessionResponse.js +3 -0
- package/dist/cjs/api/types/InternalGuestSessionResponseStatus.d.ts +9 -0
- package/dist/cjs/api/types/InternalGuestSessionResponseStatus.js +12 -0
- package/dist/cjs/api/types/Limit.d.ts +6 -0
- package/dist/cjs/api/types/Limit.js +3 -0
- package/dist/cjs/api/types/NotFoundErrorBody.d.ts +5 -0
- package/dist/cjs/api/types/NotFoundErrorBody.js +3 -0
- package/dist/cjs/api/types/NotFoundErrorBodyContent.d.ts +8 -0
- package/dist/cjs/api/types/NotFoundErrorBodyContent.js +3 -0
- package/dist/cjs/api/types/NotFoundErrorBodyContentCode.d.ts +4 -0
- package/dist/cjs/api/types/NotFoundErrorBodyContentCode.js +7 -0
- package/dist/cjs/api/types/ReserveResponse.d.ts +12 -0
- package/dist/cjs/api/types/ReserveResponse.js +3 -0
- package/dist/cjs/api/types/ReserveResponseKind.d.ts +5 -0
- package/dist/cjs/api/types/ReserveResponseKind.js +8 -0
- package/dist/cjs/api/types/ReserveResponseState.d.ts +6 -0
- package/dist/cjs/api/types/ReserveResponseState.js +9 -0
- package/dist/cjs/api/types/ServiceUnavailableErrorBody.d.ts +5 -0
- package/dist/cjs/api/types/ServiceUnavailableErrorBody.js +3 -0
- package/dist/cjs/api/types/ServiceUnavailableErrorBodyContent.d.ts +8 -0
- package/dist/cjs/api/types/ServiceUnavailableErrorBodyContent.js +3 -0
- package/dist/cjs/api/types/ServiceUnavailableErrorBodyContentCode.d.ts +6 -0
- package/dist/cjs/api/types/ServiceUnavailableErrorBodyContentCode.js +9 -0
- package/dist/cjs/api/types/SettleResponse.d.ts +5 -0
- package/dist/cjs/api/types/SettleResponse.js +3 -0
- package/dist/cjs/api/types/SettleResponseReason.d.ts +5 -0
- package/dist/cjs/api/types/SettleResponseReason.js +8 -0
- package/dist/cjs/api/types/TooManyRequestsErrorBody.d.ts +5 -0
- package/dist/cjs/api/types/TooManyRequestsErrorBody.js +3 -0
- package/dist/cjs/api/types/TooManyRequestsErrorBodyContent.d.ts +8 -0
- package/dist/cjs/api/types/TooManyRequestsErrorBodyContent.js +3 -0
- package/dist/cjs/api/types/TooManyRequestsErrorBodyContentCode.d.ts +4 -0
- package/dist/cjs/api/types/TooManyRequestsErrorBodyContentCode.js +7 -0
- package/dist/cjs/api/types/index.d.ts +27 -0
- package/dist/cjs/api/types/index.js +27 -0
- package/dist/cjs/serialization/resources/guestSession/client/requests/ClaimGuestSessionRequest.d.ts +9 -0
- package/dist/cjs/serialization/resources/guestSession/client/requests/ClaimGuestSessionRequest.js +41 -0
- package/dist/cjs/serialization/resources/guestSession/client/requests/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/guestSession/client/requests/index.js +3 -1
- package/dist/cjs/serialization/resources/index.d.ts +3 -0
- package/dist/cjs/serialization/resources/index.js +4 -1
- package/dist/cjs/serialization/resources/internalGuestSession/client/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/internalGuestSession/client/index.js +17 -0
- package/dist/cjs/serialization/resources/internalGuestSession/client/requests/ReserveRequest.d.ts +12 -0
- package/dist/cjs/serialization/resources/internalGuestSession/client/requests/ReserveRequest.js +44 -0
- package/dist/cjs/serialization/resources/internalGuestSession/client/requests/SettleRequest.d.ts +11 -0
- package/dist/cjs/serialization/resources/internalGuestSession/client/requests/SettleRequest.js +43 -0
- package/dist/cjs/serialization/resources/internalGuestSession/client/requests/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/internalGuestSession/client/requests/index.js +7 -0
- package/dist/cjs/serialization/resources/internalGuestSession/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/internalGuestSession/index.js +18 -0
- package/dist/cjs/serialization/resources/internalGuestSession/types/ReserveRequestKind.d.ts +7 -0
- package/dist/cjs/serialization/resources/internalGuestSession/types/ReserveRequestKind.js +39 -0
- package/dist/cjs/serialization/resources/internalGuestSession/types/SettleRequestOutcome.d.ts +7 -0
- package/dist/cjs/serialization/resources/internalGuestSession/types/SettleRequestOutcome.js +39 -0
- package/dist/cjs/serialization/resources/internalGuestSession/types/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/internalGuestSession/types/index.js +18 -0
- package/dist/cjs/serialization/types/ClaimGuestSessionResponse.d.ts +15 -0
- package/dist/cjs/serialization/types/ClaimGuestSessionResponse.js +48 -0
- package/dist/cjs/serialization/types/ClaimGuestSessionResponseStatus.d.ts +7 -0
- package/dist/cjs/serialization/types/ClaimGuestSessionResponseStatus.js +39 -0
- package/dist/cjs/serialization/types/CreateGuestSessionResponse.d.ts +2 -0
- package/dist/cjs/serialization/types/CreateGuestSessionResponse.js +2 -0
- package/dist/cjs/serialization/types/DeleteGuestSessionResponse.d.ts +12 -0
- package/dist/cjs/serialization/types/DeleteGuestSessionResponse.js +45 -0
- package/dist/cjs/serialization/types/DeleteGuestSessionResponseStatus.d.ts +7 -0
- package/dist/cjs/serialization/types/DeleteGuestSessionResponseStatus.js +39 -0
- package/dist/cjs/serialization/types/GetGuestSessionResponse.d.ts +20 -0
- package/dist/cjs/serialization/types/GetGuestSessionResponse.js +52 -0
- package/dist/cjs/serialization/types/GetGuestSessionResponseStatus.d.ts +7 -0
- package/dist/cjs/serialization/types/GetGuestSessionResponseStatus.js +39 -0
- package/dist/cjs/serialization/types/GoneErrorBody.d.ts +11 -0
- package/dist/cjs/serialization/types/GoneErrorBody.js +43 -0
- package/dist/cjs/serialization/types/GoneErrorBodyContent.d.ts +14 -0
- package/dist/cjs/serialization/types/GoneErrorBodyContent.js +46 -0
- package/dist/cjs/serialization/types/GoneErrorBodyContentCode.d.ts +7 -0
- package/dist/cjs/serialization/types/GoneErrorBodyContentCode.js +39 -0
- package/dist/cjs/serialization/types/GuestSessionLimits.d.ts +2 -0
- package/dist/cjs/serialization/types/GuestSessionLimits.js +2 -0
- package/dist/cjs/serialization/types/GuestSessionUsage.d.ts +10 -0
- package/dist/cjs/serialization/types/GuestSessionUsage.js +42 -0
- package/dist/cjs/serialization/types/InternalGuestSessionResponse.d.ts +16 -0
- package/dist/cjs/serialization/types/InternalGuestSessionResponse.js +48 -0
- package/dist/cjs/serialization/types/InternalGuestSessionResponseStatus.d.ts +7 -0
- package/dist/cjs/serialization/types/InternalGuestSessionResponseStatus.js +39 -0
- package/dist/cjs/serialization/types/Limit.d.ts +12 -0
- package/dist/cjs/serialization/types/Limit.js +44 -0
- package/dist/cjs/serialization/types/NotFoundErrorBody.d.ts +11 -0
- package/dist/cjs/serialization/types/NotFoundErrorBody.js +43 -0
- package/dist/cjs/serialization/types/NotFoundErrorBodyContent.d.ts +14 -0
- package/dist/cjs/serialization/types/NotFoundErrorBodyContent.js +46 -0
- package/dist/cjs/serialization/types/NotFoundErrorBodyContentCode.d.ts +7 -0
- package/dist/cjs/serialization/types/NotFoundErrorBodyContentCode.js +39 -0
- package/dist/cjs/serialization/types/ReserveResponse.d.ts +20 -0
- package/dist/cjs/serialization/types/ReserveResponse.js +52 -0
- package/dist/cjs/serialization/types/ReserveResponseKind.d.ts +7 -0
- package/dist/cjs/serialization/types/ReserveResponseKind.js +39 -0
- package/dist/cjs/serialization/types/ReserveResponseState.d.ts +7 -0
- package/dist/cjs/serialization/types/ReserveResponseState.js +39 -0
- package/dist/cjs/serialization/types/ServiceUnavailableErrorBody.d.ts +11 -0
- package/dist/cjs/serialization/types/ServiceUnavailableErrorBody.js +43 -0
- package/dist/cjs/serialization/types/ServiceUnavailableErrorBodyContent.d.ts +14 -0
- package/dist/cjs/serialization/types/ServiceUnavailableErrorBodyContent.js +46 -0
- package/dist/cjs/serialization/types/ServiceUnavailableErrorBodyContentCode.d.ts +7 -0
- package/dist/cjs/serialization/types/ServiceUnavailableErrorBodyContentCode.js +39 -0
- package/dist/cjs/serialization/types/SettleResponse.d.ts +11 -0
- package/dist/cjs/serialization/types/SettleResponse.js +43 -0
- package/dist/cjs/serialization/types/SettleResponseReason.d.ts +7 -0
- package/dist/cjs/serialization/types/SettleResponseReason.js +39 -0
- package/dist/cjs/serialization/types/TooManyRequestsErrorBody.d.ts +11 -0
- package/dist/cjs/serialization/types/TooManyRequestsErrorBody.js +43 -0
- package/dist/cjs/serialization/types/TooManyRequestsErrorBodyContent.d.ts +14 -0
- package/dist/cjs/serialization/types/TooManyRequestsErrorBodyContent.js +46 -0
- package/dist/cjs/serialization/types/TooManyRequestsErrorBodyContentCode.d.ts +7 -0
- package/dist/cjs/serialization/types/TooManyRequestsErrorBodyContentCode.js +39 -0
- package/dist/cjs/serialization/types/index.d.ts +27 -0
- package/dist/cjs/serialization/types/index.js +27 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/guestSession/client/Client.d.mts +53 -0
- package/dist/esm/api/resources/guestSession/client/Client.mjs +326 -1
- package/dist/esm/api/resources/guestSession/client/claim.d.mts +25 -0
- package/dist/esm/api/resources/guestSession/client/claim.mjs +30 -0
- package/dist/esm/api/resources/guestSession/client/create.d.mts +13 -1
- package/dist/esm/api/resources/guestSession/client/create.mjs +22 -0
- package/dist/esm/api/resources/guestSession/client/delete.d.mts +25 -0
- package/dist/esm/api/resources/guestSession/client/delete.mjs +30 -0
- package/dist/esm/api/resources/guestSession/client/get.d.mts +43 -0
- package/dist/esm/api/resources/guestSession/client/get.mjs +63 -0
- package/dist/esm/api/resources/guestSession/client/index.d.mts +3 -0
- package/dist/esm/api/resources/guestSession/client/index.mjs +3 -0
- package/dist/esm/api/resources/guestSession/client/requests/ClaimGuestSessionRequest.d.mts +10 -0
- package/dist/esm/api/resources/guestSession/client/requests/ClaimGuestSessionRequest.mjs +2 -0
- package/dist/esm/api/resources/guestSession/client/requests/DeleteGuestSessionsSessionIdDeleteRequest.d.mts +9 -0
- package/dist/esm/api/resources/guestSession/client/requests/DeleteGuestSessionsSessionIdDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/guestSession/client/requests/GetGuestSessionsSessionIdGetRequest.d.mts +11 -0
- package/dist/esm/api/resources/guestSession/client/requests/GetGuestSessionsSessionIdGetRequest.mjs +2 -0
- package/dist/esm/api/resources/guestSession/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/internalGuestSession/client/Client.d.mts +55 -0
- package/dist/esm/api/resources/internalGuestSession/client/Client.mjs +277 -0
- package/dist/esm/api/resources/internalGuestSession/client/index.d.mts +4 -0
- package/dist/esm/api/resources/internalGuestSession/client/index.mjs +4 -0
- package/dist/esm/api/resources/internalGuestSession/client/readByOrg.d.mts +25 -0
- package/dist/esm/api/resources/internalGuestSession/client/readByOrg.mjs +30 -0
- package/dist/esm/api/resources/internalGuestSession/client/requests/ReadByOrgInternalGuestSessionsByOrgOrgIdGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/internalGuestSession/client/requests/ReadByOrgInternalGuestSessionsByOrgOrgIdGetRequest.mjs +2 -0
- package/dist/esm/api/resources/internalGuestSession/client/requests/ReserveRequest.d.mts +14 -0
- package/dist/esm/api/resources/internalGuestSession/client/requests/ReserveRequest.mjs +2 -0
- package/dist/esm/api/resources/internalGuestSession/client/requests/SettleRequest.d.mts +14 -0
- package/dist/esm/api/resources/internalGuestSession/client/requests/SettleRequest.mjs +2 -0
- package/dist/esm/api/resources/internalGuestSession/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/internalGuestSession/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/internalGuestSession/client/reserve.d.mts +25 -0
- package/dist/esm/api/resources/internalGuestSession/client/reserve.mjs +30 -0
- package/dist/esm/api/resources/internalGuestSession/client/settle.d.mts +25 -0
- package/dist/esm/api/resources/internalGuestSession/client/settle.mjs +30 -0
- package/dist/esm/api/resources/internalGuestSession/index.d.mts +2 -0
- package/dist/esm/api/resources/internalGuestSession/index.mjs +2 -0
- package/dist/esm/api/resources/internalGuestSession/types/ReserveRequestKind.d.mts +5 -0
- package/dist/esm/api/resources/internalGuestSession/types/ReserveRequestKind.mjs +5 -0
- package/dist/esm/api/resources/internalGuestSession/types/SettleRequestOutcome.d.mts +5 -0
- package/dist/esm/api/resources/internalGuestSession/types/SettleRequestOutcome.mjs +5 -0
- package/dist/esm/api/resources/internalGuestSession/types/index.d.mts +2 -0
- package/dist/esm/api/resources/internalGuestSession/types/index.mjs +2 -0
- package/dist/esm/api/types/ClaimGuestSessionResponse.d.mts +10 -0
- package/dist/esm/api/types/ClaimGuestSessionResponse.mjs +2 -0
- package/dist/esm/api/types/ClaimGuestSessionResponseStatus.d.mts +9 -0
- package/dist/esm/api/types/ClaimGuestSessionResponseStatus.mjs +9 -0
- package/dist/esm/api/types/CreateGuestSessionResponse.d.mts +2 -0
- package/dist/esm/api/types/DeleteGuestSessionResponse.d.mts +7 -0
- package/dist/esm/api/types/DeleteGuestSessionResponse.mjs +2 -0
- package/dist/esm/api/types/DeleteGuestSessionResponseStatus.d.mts +9 -0
- package/dist/esm/api/types/DeleteGuestSessionResponseStatus.mjs +9 -0
- package/dist/esm/api/types/GetGuestSessionResponse.d.mts +13 -0
- package/dist/esm/api/types/GetGuestSessionResponse.mjs +2 -0
- package/dist/esm/api/types/GetGuestSessionResponseStatus.d.mts +9 -0
- package/dist/esm/api/types/GetGuestSessionResponseStatus.mjs +9 -0
- package/dist/esm/api/types/GoneErrorBody.d.mts +5 -0
- package/dist/esm/api/types/GoneErrorBody.mjs +2 -0
- package/dist/esm/api/types/GoneErrorBodyContent.d.mts +8 -0
- package/dist/esm/api/types/GoneErrorBodyContent.mjs +2 -0
- package/dist/esm/api/types/GoneErrorBodyContentCode.d.mts +5 -0
- package/dist/esm/api/types/GoneErrorBodyContentCode.mjs +5 -0
- package/dist/esm/api/types/GuestSessionLimits.d.mts +2 -0
- package/dist/esm/api/types/GuestSessionUsage.d.mts +4 -0
- package/dist/esm/api/types/GuestSessionUsage.mjs +2 -0
- package/dist/esm/api/types/InternalGuestSessionResponse.d.mts +22 -0
- package/dist/esm/api/types/InternalGuestSessionResponse.mjs +2 -0
- package/dist/esm/api/types/InternalGuestSessionResponseStatus.d.mts +9 -0
- package/dist/esm/api/types/InternalGuestSessionResponseStatus.mjs +9 -0
- package/dist/esm/api/types/Limit.d.mts +6 -0
- package/dist/esm/api/types/Limit.mjs +2 -0
- package/dist/esm/api/types/NotFoundErrorBody.d.mts +5 -0
- package/dist/esm/api/types/NotFoundErrorBody.mjs +2 -0
- package/dist/esm/api/types/NotFoundErrorBodyContent.d.mts +8 -0
- package/dist/esm/api/types/NotFoundErrorBodyContent.mjs +2 -0
- package/dist/esm/api/types/NotFoundErrorBodyContentCode.d.mts +4 -0
- package/dist/esm/api/types/NotFoundErrorBodyContentCode.mjs +4 -0
- package/dist/esm/api/types/ReserveResponse.d.mts +12 -0
- package/dist/esm/api/types/ReserveResponse.mjs +2 -0
- package/dist/esm/api/types/ReserveResponseKind.d.mts +5 -0
- package/dist/esm/api/types/ReserveResponseKind.mjs +5 -0
- package/dist/esm/api/types/ReserveResponseState.d.mts +6 -0
- package/dist/esm/api/types/ReserveResponseState.mjs +6 -0
- package/dist/esm/api/types/ServiceUnavailableErrorBody.d.mts +5 -0
- package/dist/esm/api/types/ServiceUnavailableErrorBody.mjs +2 -0
- package/dist/esm/api/types/ServiceUnavailableErrorBodyContent.d.mts +8 -0
- package/dist/esm/api/types/ServiceUnavailableErrorBodyContent.mjs +2 -0
- package/dist/esm/api/types/ServiceUnavailableErrorBodyContentCode.d.mts +6 -0
- package/dist/esm/api/types/ServiceUnavailableErrorBodyContentCode.mjs +6 -0
- package/dist/esm/api/types/SettleResponse.d.mts +5 -0
- package/dist/esm/api/types/SettleResponse.mjs +2 -0
- package/dist/esm/api/types/SettleResponseReason.d.mts +5 -0
- package/dist/esm/api/types/SettleResponseReason.mjs +5 -0
- package/dist/esm/api/types/TooManyRequestsErrorBody.d.mts +5 -0
- package/dist/esm/api/types/TooManyRequestsErrorBody.mjs +2 -0
- package/dist/esm/api/types/TooManyRequestsErrorBodyContent.d.mts +8 -0
- package/dist/esm/api/types/TooManyRequestsErrorBodyContent.mjs +2 -0
- package/dist/esm/api/types/TooManyRequestsErrorBodyContentCode.d.mts +4 -0
- package/dist/esm/api/types/TooManyRequestsErrorBodyContentCode.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +27 -0
- package/dist/esm/api/types/index.mjs +27 -0
- package/dist/esm/serialization/resources/guestSession/client/requests/ClaimGuestSessionRequest.d.mts +9 -0
- package/dist/esm/serialization/resources/guestSession/client/requests/ClaimGuestSessionRequest.mjs +5 -0
- package/dist/esm/serialization/resources/guestSession/client/requests/index.d.mts +1 -0
- package/dist/esm/serialization/resources/guestSession/client/requests/index.mjs +1 -0
- package/dist/esm/serialization/resources/index.d.mts +3 -0
- package/dist/esm/serialization/resources/index.mjs +3 -0
- package/dist/esm/serialization/resources/internalGuestSession/client/index.d.mts +1 -0
- package/dist/esm/serialization/resources/internalGuestSession/client/index.mjs +1 -0
- package/dist/esm/serialization/resources/internalGuestSession/client/requests/ReserveRequest.d.mts +12 -0
- package/dist/esm/serialization/resources/internalGuestSession/client/requests/ReserveRequest.mjs +8 -0
- package/dist/esm/serialization/resources/internalGuestSession/client/requests/SettleRequest.d.mts +11 -0
- package/dist/esm/serialization/resources/internalGuestSession/client/requests/SettleRequest.mjs +7 -0
- package/dist/esm/serialization/resources/internalGuestSession/client/requests/index.d.mts +2 -0
- package/dist/esm/serialization/resources/internalGuestSession/client/requests/index.mjs +2 -0
- package/dist/esm/serialization/resources/internalGuestSession/index.d.mts +2 -0
- package/dist/esm/serialization/resources/internalGuestSession/index.mjs +2 -0
- package/dist/esm/serialization/resources/internalGuestSession/types/ReserveRequestKind.d.mts +7 -0
- package/dist/esm/serialization/resources/internalGuestSession/types/ReserveRequestKind.mjs +3 -0
- package/dist/esm/serialization/resources/internalGuestSession/types/SettleRequestOutcome.d.mts +7 -0
- package/dist/esm/serialization/resources/internalGuestSession/types/SettleRequestOutcome.mjs +3 -0
- package/dist/esm/serialization/resources/internalGuestSession/types/index.d.mts +2 -0
- package/dist/esm/serialization/resources/internalGuestSession/types/index.mjs +2 -0
- package/dist/esm/serialization/types/ClaimGuestSessionResponse.d.mts +15 -0
- package/dist/esm/serialization/types/ClaimGuestSessionResponse.mjs +12 -0
- package/dist/esm/serialization/types/ClaimGuestSessionResponseStatus.d.mts +7 -0
- package/dist/esm/serialization/types/ClaimGuestSessionResponseStatus.mjs +3 -0
- package/dist/esm/serialization/types/CreateGuestSessionResponse.d.mts +2 -0
- package/dist/esm/serialization/types/CreateGuestSessionResponse.mjs +2 -0
- package/dist/esm/serialization/types/DeleteGuestSessionResponse.d.mts +12 -0
- package/dist/esm/serialization/types/DeleteGuestSessionResponse.mjs +9 -0
- package/dist/esm/serialization/types/DeleteGuestSessionResponseStatus.d.mts +7 -0
- package/dist/esm/serialization/types/DeleteGuestSessionResponseStatus.mjs +3 -0
- package/dist/esm/serialization/types/GetGuestSessionResponse.d.mts +20 -0
- package/dist/esm/serialization/types/GetGuestSessionResponse.mjs +16 -0
- package/dist/esm/serialization/types/GetGuestSessionResponseStatus.d.mts +7 -0
- package/dist/esm/serialization/types/GetGuestSessionResponseStatus.mjs +3 -0
- package/dist/esm/serialization/types/GoneErrorBody.d.mts +11 -0
- package/dist/esm/serialization/types/GoneErrorBody.mjs +7 -0
- package/dist/esm/serialization/types/GoneErrorBodyContent.d.mts +14 -0
- package/dist/esm/serialization/types/GoneErrorBodyContent.mjs +10 -0
- package/dist/esm/serialization/types/GoneErrorBodyContentCode.d.mts +7 -0
- package/dist/esm/serialization/types/GoneErrorBodyContentCode.mjs +3 -0
- package/dist/esm/serialization/types/GuestSessionLimits.d.mts +2 -0
- package/dist/esm/serialization/types/GuestSessionLimits.mjs +2 -0
- package/dist/esm/serialization/types/GuestSessionUsage.d.mts +10 -0
- package/dist/esm/serialization/types/GuestSessionUsage.mjs +6 -0
- package/dist/esm/serialization/types/InternalGuestSessionResponse.d.mts +16 -0
- package/dist/esm/serialization/types/InternalGuestSessionResponse.mjs +12 -0
- package/dist/esm/serialization/types/InternalGuestSessionResponseStatus.d.mts +7 -0
- package/dist/esm/serialization/types/InternalGuestSessionResponseStatus.mjs +3 -0
- package/dist/esm/serialization/types/Limit.d.mts +12 -0
- package/dist/esm/serialization/types/Limit.mjs +8 -0
- package/dist/esm/serialization/types/NotFoundErrorBody.d.mts +11 -0
- package/dist/esm/serialization/types/NotFoundErrorBody.mjs +7 -0
- package/dist/esm/serialization/types/NotFoundErrorBodyContent.d.mts +14 -0
- package/dist/esm/serialization/types/NotFoundErrorBodyContent.mjs +10 -0
- package/dist/esm/serialization/types/NotFoundErrorBodyContentCode.d.mts +7 -0
- package/dist/esm/serialization/types/NotFoundErrorBodyContentCode.mjs +3 -0
- package/dist/esm/serialization/types/ReserveResponse.d.mts +20 -0
- package/dist/esm/serialization/types/ReserveResponse.mjs +16 -0
- package/dist/esm/serialization/types/ReserveResponseKind.d.mts +7 -0
- package/dist/esm/serialization/types/ReserveResponseKind.mjs +3 -0
- package/dist/esm/serialization/types/ReserveResponseState.d.mts +7 -0
- package/dist/esm/serialization/types/ReserveResponseState.mjs +3 -0
- package/dist/esm/serialization/types/ServiceUnavailableErrorBody.d.mts +11 -0
- package/dist/esm/serialization/types/ServiceUnavailableErrorBody.mjs +7 -0
- package/dist/esm/serialization/types/ServiceUnavailableErrorBodyContent.d.mts +14 -0
- package/dist/esm/serialization/types/ServiceUnavailableErrorBodyContent.mjs +10 -0
- package/dist/esm/serialization/types/ServiceUnavailableErrorBodyContentCode.d.mts +7 -0
- package/dist/esm/serialization/types/ServiceUnavailableErrorBodyContentCode.mjs +3 -0
- package/dist/esm/serialization/types/SettleResponse.d.mts +11 -0
- package/dist/esm/serialization/types/SettleResponse.mjs +7 -0
- package/dist/esm/serialization/types/SettleResponseReason.d.mts +7 -0
- package/dist/esm/serialization/types/SettleResponseReason.mjs +3 -0
- package/dist/esm/serialization/types/TooManyRequestsErrorBody.d.mts +11 -0
- package/dist/esm/serialization/types/TooManyRequestsErrorBody.mjs +7 -0
- package/dist/esm/serialization/types/TooManyRequestsErrorBodyContent.d.mts +14 -0
- package/dist/esm/serialization/types/TooManyRequestsErrorBodyContent.mjs +10 -0
- package/dist/esm/serialization/types/TooManyRequestsErrorBodyContentCode.d.mts +7 -0
- package/dist/esm/serialization/types/TooManyRequestsErrorBodyContentCode.mjs +3 -0
- package/dist/esm/serialization/types/index.d.mts +27 -0
- package/dist/esm/serialization/types/index.mjs +27 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +384 -0
|
@@ -8,8 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
13
24
|
import * as core from "../../../../core/index.mjs";
|
|
14
25
|
import * as serializers from "../../../../serialization/index.mjs";
|
|
15
26
|
import * as FernVenusApi from "../../../index.mjs";
|
|
@@ -92,6 +103,30 @@ export class GuestSessionClient {
|
|
|
92
103
|
},
|
|
93
104
|
rawResponse: _response.rawResponse,
|
|
94
105
|
};
|
|
106
|
+
case 429:
|
|
107
|
+
return {
|
|
108
|
+
data: {
|
|
109
|
+
ok: false,
|
|
110
|
+
error: FernVenusApi.guestSession.create.Error.tooManyRequestsError(serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, {
|
|
111
|
+
unrecognizedObjectKeys: "passthrough",
|
|
112
|
+
allowUnrecognizedUnionMembers: true,
|
|
113
|
+
allowUnrecognizedEnumValues: true,
|
|
114
|
+
skipValidation: true,
|
|
115
|
+
breadcrumbsPrefix: ["response"],
|
|
116
|
+
})),
|
|
117
|
+
rawResponse: _response.rawResponse,
|
|
118
|
+
},
|
|
119
|
+
rawResponse: _response.rawResponse,
|
|
120
|
+
};
|
|
121
|
+
case 503:
|
|
122
|
+
return {
|
|
123
|
+
data: {
|
|
124
|
+
ok: false,
|
|
125
|
+
error: FernVenusApi.guestSession.create.Error.serviceUnavailableError(_response.error.body),
|
|
126
|
+
rawResponse: _response.rawResponse,
|
|
127
|
+
},
|
|
128
|
+
rawResponse: _response.rawResponse,
|
|
129
|
+
};
|
|
95
130
|
}
|
|
96
131
|
}
|
|
97
132
|
return {
|
|
@@ -104,4 +139,294 @@ export class GuestSessionClient {
|
|
|
104
139
|
};
|
|
105
140
|
});
|
|
106
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Read a guest session: where it is in its life, when it runs out and how much of its
|
|
144
|
+
* budget is spent.
|
|
145
|
+
* Opened by the session's own token, by the claim secret (sent as `X-Fern-Claim-Secret`,
|
|
146
|
+
* which is what the claim page holds), or by the user who claimed it. Anything else is
|
|
147
|
+
* told the session does not exist.
|
|
148
|
+
*
|
|
149
|
+
* @param {FernVenusApi.GetGuestSessionsSessionIdGetRequest} request
|
|
150
|
+
* @param {GuestSessionClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* await client.guestSession.get({
|
|
154
|
+
* sessionId: "session_id"
|
|
155
|
+
* })
|
|
156
|
+
*/
|
|
157
|
+
get(request, requestOptions) {
|
|
158
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
159
|
+
}
|
|
160
|
+
__get(request, requestOptions) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
163
|
+
const { sessionId, fernClaimSecret } = request;
|
|
164
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
165
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Fern-Claim-Secret": fernClaimSecret }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
166
|
+
const _response = yield core.fetcher({
|
|
167
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `guest-sessions/${core.url.encodePathParam(sessionId)}`),
|
|
168
|
+
method: "GET",
|
|
169
|
+
headers: _headers,
|
|
170
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
171
|
+
timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
|
|
172
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
173
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
174
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
175
|
+
logging: this._options.logging,
|
|
176
|
+
});
|
|
177
|
+
if (_response.ok) {
|
|
178
|
+
return {
|
|
179
|
+
data: {
|
|
180
|
+
ok: true,
|
|
181
|
+
body: serializers.GetGuestSessionResponse.parseOrThrow(_response.body, {
|
|
182
|
+
unrecognizedObjectKeys: "passthrough",
|
|
183
|
+
allowUnrecognizedUnionMembers: true,
|
|
184
|
+
allowUnrecognizedEnumValues: true,
|
|
185
|
+
skipValidation: true,
|
|
186
|
+
breadcrumbsPrefix: ["response"],
|
|
187
|
+
}),
|
|
188
|
+
headers: _response.headers,
|
|
189
|
+
rawResponse: _response.rawResponse,
|
|
190
|
+
},
|
|
191
|
+
rawResponse: _response.rawResponse,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
if (_response.error.reason === "status-code") {
|
|
195
|
+
switch (_response.error.statusCode) {
|
|
196
|
+
case 404:
|
|
197
|
+
return {
|
|
198
|
+
data: {
|
|
199
|
+
ok: false,
|
|
200
|
+
error: FernVenusApi.guestSession.get.Error.notFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
201
|
+
unrecognizedObjectKeys: "passthrough",
|
|
202
|
+
allowUnrecognizedUnionMembers: true,
|
|
203
|
+
allowUnrecognizedEnumValues: true,
|
|
204
|
+
skipValidation: true,
|
|
205
|
+
breadcrumbsPrefix: ["response"],
|
|
206
|
+
})),
|
|
207
|
+
rawResponse: _response.rawResponse,
|
|
208
|
+
},
|
|
209
|
+
rawResponse: _response.rawResponse,
|
|
210
|
+
};
|
|
211
|
+
case 410:
|
|
212
|
+
return {
|
|
213
|
+
data: {
|
|
214
|
+
ok: false,
|
|
215
|
+
error: FernVenusApi.guestSession.get.Error.goneError(serializers.GoneErrorBody.parseOrThrow(_response.error.body, {
|
|
216
|
+
unrecognizedObjectKeys: "passthrough",
|
|
217
|
+
allowUnrecognizedUnionMembers: true,
|
|
218
|
+
allowUnrecognizedEnumValues: true,
|
|
219
|
+
skipValidation: true,
|
|
220
|
+
breadcrumbsPrefix: ["response"],
|
|
221
|
+
})),
|
|
222
|
+
rawResponse: _response.rawResponse,
|
|
223
|
+
},
|
|
224
|
+
rawResponse: _response.rawResponse,
|
|
225
|
+
};
|
|
226
|
+
case 422:
|
|
227
|
+
return {
|
|
228
|
+
data: {
|
|
229
|
+
ok: false,
|
|
230
|
+
error: FernVenusApi.guestSession.get.Error.unprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
231
|
+
unrecognizedObjectKeys: "passthrough",
|
|
232
|
+
allowUnrecognizedUnionMembers: true,
|
|
233
|
+
allowUnrecognizedEnumValues: true,
|
|
234
|
+
skipValidation: true,
|
|
235
|
+
breadcrumbsPrefix: ["response"],
|
|
236
|
+
})),
|
|
237
|
+
rawResponse: _response.rawResponse,
|
|
238
|
+
},
|
|
239
|
+
rawResponse: _response.rawResponse,
|
|
240
|
+
};
|
|
241
|
+
case 503:
|
|
242
|
+
return {
|
|
243
|
+
data: {
|
|
244
|
+
ok: false,
|
|
245
|
+
error: FernVenusApi.guestSession.get.Error.serviceUnavailableError(_response.error.body),
|
|
246
|
+
rawResponse: _response.rawResponse,
|
|
247
|
+
},
|
|
248
|
+
rawResponse: _response.rawResponse,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
data: {
|
|
254
|
+
ok: false,
|
|
255
|
+
error: FernVenusApi.guestSession.get.Error._unknown(_response.error),
|
|
256
|
+
rawResponse: _response.rawResponse,
|
|
257
|
+
},
|
|
258
|
+
rawResponse: _response.rawResponse,
|
|
259
|
+
};
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Take a guest session down. Its token stops working at once and nothing more can be
|
|
264
|
+
* built or published with it.
|
|
265
|
+
* The session's own token or its claim secret takes it down (`deleted`); a Fern operator's
|
|
266
|
+
* service credential takes it down for abuse (`takenDown`). Anything else is told the
|
|
267
|
+
* session does not exist. Calling it again answers the same; a claimed session cannot be
|
|
268
|
+
* taken down here, its work belongs to an organization now.
|
|
269
|
+
*
|
|
270
|
+
* @param {FernVenusApi.DeleteGuestSessionsSessionIdDeleteRequest} request
|
|
271
|
+
* @param {GuestSessionClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* await client.guestSession.delete({
|
|
275
|
+
* sessionId: "session_id"
|
|
276
|
+
* })
|
|
277
|
+
*/
|
|
278
|
+
delete(request, requestOptions) {
|
|
279
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
280
|
+
}
|
|
281
|
+
__delete(request, requestOptions) {
|
|
282
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
283
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
284
|
+
const { sessionId } = request;
|
|
285
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
286
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
287
|
+
const _response = yield core.fetcher({
|
|
288
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `guest-sessions/${core.url.encodePathParam(sessionId)}`),
|
|
289
|
+
method: "DELETE",
|
|
290
|
+
headers: _headers,
|
|
291
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
292
|
+
timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
|
|
293
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
294
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
295
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
296
|
+
logging: this._options.logging,
|
|
297
|
+
});
|
|
298
|
+
if (_response.ok) {
|
|
299
|
+
return {
|
|
300
|
+
data: {
|
|
301
|
+
ok: true,
|
|
302
|
+
body: serializers.DeleteGuestSessionResponse.parseOrThrow(_response.body, {
|
|
303
|
+
unrecognizedObjectKeys: "passthrough",
|
|
304
|
+
allowUnrecognizedUnionMembers: true,
|
|
305
|
+
allowUnrecognizedEnumValues: true,
|
|
306
|
+
skipValidation: true,
|
|
307
|
+
breadcrumbsPrefix: ["response"],
|
|
308
|
+
}),
|
|
309
|
+
headers: _response.headers,
|
|
310
|
+
rawResponse: _response.rawResponse,
|
|
311
|
+
},
|
|
312
|
+
rawResponse: _response.rawResponse,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
if (_response.error.reason === "status-code") {
|
|
316
|
+
switch (_response.error.statusCode) {
|
|
317
|
+
case 422:
|
|
318
|
+
return {
|
|
319
|
+
data: {
|
|
320
|
+
ok: false,
|
|
321
|
+
error: FernVenusApi.guestSession.delete.Error.unprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
322
|
+
unrecognizedObjectKeys: "passthrough",
|
|
323
|
+
allowUnrecognizedUnionMembers: true,
|
|
324
|
+
allowUnrecognizedEnumValues: true,
|
|
325
|
+
skipValidation: true,
|
|
326
|
+
breadcrumbsPrefix: ["response"],
|
|
327
|
+
})),
|
|
328
|
+
rawResponse: _response.rawResponse,
|
|
329
|
+
},
|
|
330
|
+
rawResponse: _response.rawResponse,
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return {
|
|
335
|
+
data: {
|
|
336
|
+
ok: false,
|
|
337
|
+
error: FernVenusApi.guestSession.delete.Error._unknown(_response.error),
|
|
338
|
+
rawResponse: _response.rawResponse,
|
|
339
|
+
},
|
|
340
|
+
rawResponse: _response.rawResponse,
|
|
341
|
+
};
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Claim a guest session: make its work the caller's, for keeps.
|
|
346
|
+
* Needs two things: the claim secret (`X-Fern-Claim-Secret`, from the claim URL) and a
|
|
347
|
+
* signed-in person (`Authorization`). With `organizationId`, the caller must already be an
|
|
348
|
+
* admin of that organization and the session's work is moved into it. Without, the
|
|
349
|
+
* session's own organization becomes the caller's, with them as its first admin.
|
|
350
|
+
* Claiming revokes the guest token. Safe to retry: the claimant may call it again.
|
|
351
|
+
*
|
|
352
|
+
* @param {FernVenusApi.ClaimGuestSessionRequest} request
|
|
353
|
+
* @param {GuestSessionClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
354
|
+
*
|
|
355
|
+
* @example
|
|
356
|
+
* await client.guestSession.claim({
|
|
357
|
+
* sessionId: "session_id"
|
|
358
|
+
* })
|
|
359
|
+
*/
|
|
360
|
+
claim(request, requestOptions) {
|
|
361
|
+
return core.HttpResponsePromise.fromPromise(this.__claim(request, requestOptions));
|
|
362
|
+
}
|
|
363
|
+
__claim(request, requestOptions) {
|
|
364
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
365
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
366
|
+
const { sessionId } = request, _body = __rest(request, ["sessionId"]);
|
|
367
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
368
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
369
|
+
const _response = yield core.fetcher({
|
|
370
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `guest-sessions/${core.url.encodePathParam(sessionId)}/claim`),
|
|
371
|
+
method: "POST",
|
|
372
|
+
headers: _headers,
|
|
373
|
+
contentType: "application/json",
|
|
374
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
375
|
+
requestType: "json",
|
|
376
|
+
body: serializers.ClaimGuestSessionRequest.jsonOrThrow(_body, {
|
|
377
|
+
unrecognizedObjectKeys: "strip",
|
|
378
|
+
omitUndefined: true,
|
|
379
|
+
}),
|
|
380
|
+
timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
|
|
381
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
382
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
383
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
384
|
+
logging: this._options.logging,
|
|
385
|
+
});
|
|
386
|
+
if (_response.ok) {
|
|
387
|
+
return {
|
|
388
|
+
data: {
|
|
389
|
+
ok: true,
|
|
390
|
+
body: serializers.ClaimGuestSessionResponse.parseOrThrow(_response.body, {
|
|
391
|
+
unrecognizedObjectKeys: "passthrough",
|
|
392
|
+
allowUnrecognizedUnionMembers: true,
|
|
393
|
+
allowUnrecognizedEnumValues: true,
|
|
394
|
+
skipValidation: true,
|
|
395
|
+
breadcrumbsPrefix: ["response"],
|
|
396
|
+
}),
|
|
397
|
+
headers: _response.headers,
|
|
398
|
+
rawResponse: _response.rawResponse,
|
|
399
|
+
},
|
|
400
|
+
rawResponse: _response.rawResponse,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
if (_response.error.reason === "status-code") {
|
|
404
|
+
switch (_response.error.statusCode) {
|
|
405
|
+
case 422:
|
|
406
|
+
return {
|
|
407
|
+
data: {
|
|
408
|
+
ok: false,
|
|
409
|
+
error: FernVenusApi.guestSession.claim.Error.unprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
410
|
+
unrecognizedObjectKeys: "passthrough",
|
|
411
|
+
allowUnrecognizedUnionMembers: true,
|
|
412
|
+
allowUnrecognizedEnumValues: true,
|
|
413
|
+
skipValidation: true,
|
|
414
|
+
breadcrumbsPrefix: ["response"],
|
|
415
|
+
})),
|
|
416
|
+
rawResponse: _response.rawResponse,
|
|
417
|
+
},
|
|
418
|
+
rawResponse: _response.rawResponse,
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
return {
|
|
423
|
+
data: {
|
|
424
|
+
ok: false,
|
|
425
|
+
error: FernVenusApi.guestSession.claim.Error._unknown(_response.error),
|
|
426
|
+
rawResponse: _response.rawResponse,
|
|
427
|
+
},
|
|
428
|
+
rawResponse: _response.rawResponse,
|
|
429
|
+
};
|
|
430
|
+
});
|
|
431
|
+
}
|
|
107
432
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type * as core from "../../../../core/index.mjs";
|
|
2
|
+
import * as FernVenusApi from "../../../index.mjs";
|
|
3
|
+
export type Error = FernVenusApi.guestSession.claim.Error.UnprocessableEntityError | FernVenusApi.guestSession.claim.Error._Unknown;
|
|
4
|
+
export declare namespace Error {
|
|
5
|
+
interface UnprocessableEntityError extends _Utils {
|
|
6
|
+
statusCode: 422;
|
|
7
|
+
content: FernVenusApi.HttpValidationError;
|
|
8
|
+
}
|
|
9
|
+
interface _Unknown extends _Utils {
|
|
10
|
+
statusCode: void;
|
|
11
|
+
content: core.Fetcher.Error;
|
|
12
|
+
}
|
|
13
|
+
interface _Utils {
|
|
14
|
+
_visit: <_Result>(visitor: FernVenusApi.guestSession.claim.Error._Visitor<_Result>) => _Result;
|
|
15
|
+
}
|
|
16
|
+
interface _Visitor<_Result> {
|
|
17
|
+
unprocessableEntityError: (value: FernVenusApi.HttpValidationError) => _Result;
|
|
18
|
+
_other: (value: core.Fetcher.Error) => _Result;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export declare const Error: {
|
|
22
|
+
readonly unprocessableEntityError: (value: FernVenusApi.HttpValidationError) => FernVenusApi.guestSession.claim.Error.UnprocessableEntityError;
|
|
23
|
+
readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.guestSession.claim.Error._Unknown;
|
|
24
|
+
readonly _visit: <_Result>(value: FernVenusApi.guestSession.claim.Error, visitor: FernVenusApi.guestSession.claim.Error._Visitor<_Result>) => _Result;
|
|
25
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as FernVenusApi from "../../../index.mjs";
|
|
3
|
+
export const Error = {
|
|
4
|
+
unprocessableEntityError: (value) => {
|
|
5
|
+
return {
|
|
6
|
+
content: value,
|
|
7
|
+
statusCode: 422,
|
|
8
|
+
_visit: function (visitor) {
|
|
9
|
+
return FernVenusApi.guestSession.claim.Error._visit(this, visitor);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
_unknown: (fetcherError) => {
|
|
14
|
+
return {
|
|
15
|
+
statusCode: undefined,
|
|
16
|
+
content: fetcherError,
|
|
17
|
+
_visit: function (visitor) {
|
|
18
|
+
return FernVenusApi.guestSession.claim.Error._visit(this, visitor);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
_visit: (value, visitor) => {
|
|
23
|
+
switch (value.statusCode) {
|
|
24
|
+
case 422:
|
|
25
|
+
return visitor.unprocessableEntityError(value.content);
|
|
26
|
+
default:
|
|
27
|
+
return visitor._other(value.content);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type * as core from "../../../../core/index.mjs";
|
|
2
2
|
import * as FernVenusApi from "../../../index.mjs";
|
|
3
|
-
export type Error = FernVenusApi.guestSession.create.Error.UnprocessableEntityError | FernVenusApi.guestSession.create.Error._Unknown;
|
|
3
|
+
export type Error = FernVenusApi.guestSession.create.Error.UnprocessableEntityError | FernVenusApi.guestSession.create.Error.TooManyRequestsError | FernVenusApi.guestSession.create.Error.ServiceUnavailableError | FernVenusApi.guestSession.create.Error._Unknown;
|
|
4
4
|
export declare namespace Error {
|
|
5
5
|
interface UnprocessableEntityError extends _Utils {
|
|
6
6
|
statusCode: 422;
|
|
7
7
|
content: FernVenusApi.HttpValidationError;
|
|
8
8
|
}
|
|
9
|
+
interface TooManyRequestsError extends _Utils {
|
|
10
|
+
statusCode: 429;
|
|
11
|
+
content: FernVenusApi.TooManyRequestsErrorBody;
|
|
12
|
+
}
|
|
13
|
+
interface ServiceUnavailableError extends _Utils {
|
|
14
|
+
statusCode: 503;
|
|
15
|
+
content?: unknown;
|
|
16
|
+
}
|
|
9
17
|
interface _Unknown extends _Utils {
|
|
10
18
|
statusCode: void;
|
|
11
19
|
content: core.Fetcher.Error;
|
|
@@ -15,11 +23,15 @@ export declare namespace Error {
|
|
|
15
23
|
}
|
|
16
24
|
interface _Visitor<_Result> {
|
|
17
25
|
unprocessableEntityError: (value: FernVenusApi.HttpValidationError) => _Result;
|
|
26
|
+
tooManyRequestsError: (value: FernVenusApi.TooManyRequestsErrorBody) => _Result;
|
|
27
|
+
serviceUnavailableError: (value: unknown) => _Result;
|
|
18
28
|
_other: (value: core.Fetcher.Error) => _Result;
|
|
19
29
|
}
|
|
20
30
|
}
|
|
21
31
|
export declare const Error: {
|
|
22
32
|
readonly unprocessableEntityError: (value: FernVenusApi.HttpValidationError) => FernVenusApi.guestSession.create.Error.UnprocessableEntityError;
|
|
33
|
+
readonly tooManyRequestsError: (value: FernVenusApi.TooManyRequestsErrorBody) => FernVenusApi.guestSession.create.Error.TooManyRequestsError;
|
|
34
|
+
readonly serviceUnavailableError: (value?: unknown) => FernVenusApi.guestSession.create.Error.ServiceUnavailableError;
|
|
23
35
|
readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.guestSession.create.Error._Unknown;
|
|
24
36
|
readonly _visit: <_Result>(value: FernVenusApi.guestSession.create.Error, visitor: FernVenusApi.guestSession.create.Error._Visitor<_Result>) => _Result;
|
|
25
37
|
};
|
|
@@ -10,6 +10,24 @@ export const Error = {
|
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
},
|
|
13
|
+
tooManyRequestsError: (value) => {
|
|
14
|
+
return {
|
|
15
|
+
content: value,
|
|
16
|
+
statusCode: 429,
|
|
17
|
+
_visit: function (visitor) {
|
|
18
|
+
return FernVenusApi.guestSession.create.Error._visit(this, visitor);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
serviceUnavailableError: (value) => {
|
|
23
|
+
return {
|
|
24
|
+
content: value,
|
|
25
|
+
statusCode: 503,
|
|
26
|
+
_visit: function (visitor) {
|
|
27
|
+
return FernVenusApi.guestSession.create.Error._visit(this, visitor);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
},
|
|
13
31
|
_unknown: (fetcherError) => {
|
|
14
32
|
return {
|
|
15
33
|
statusCode: undefined,
|
|
@@ -23,6 +41,10 @@ export const Error = {
|
|
|
23
41
|
switch (value.statusCode) {
|
|
24
42
|
case 422:
|
|
25
43
|
return visitor.unprocessableEntityError(value.content);
|
|
44
|
+
case 429:
|
|
45
|
+
return visitor.tooManyRequestsError(value.content);
|
|
46
|
+
case 503:
|
|
47
|
+
return visitor.serviceUnavailableError(value.content);
|
|
26
48
|
default:
|
|
27
49
|
return visitor._other(value.content);
|
|
28
50
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type * as core from "../../../../core/index.mjs";
|
|
2
|
+
import * as FernVenusApi from "../../../index.mjs";
|
|
3
|
+
export type Error = FernVenusApi.guestSession.delete.Error.UnprocessableEntityError | FernVenusApi.guestSession.delete.Error._Unknown;
|
|
4
|
+
export declare namespace Error {
|
|
5
|
+
interface UnprocessableEntityError extends _Utils {
|
|
6
|
+
statusCode: 422;
|
|
7
|
+
content: FernVenusApi.HttpValidationError;
|
|
8
|
+
}
|
|
9
|
+
interface _Unknown extends _Utils {
|
|
10
|
+
statusCode: void;
|
|
11
|
+
content: core.Fetcher.Error;
|
|
12
|
+
}
|
|
13
|
+
interface _Utils {
|
|
14
|
+
_visit: <_Result>(visitor: FernVenusApi.guestSession.delete.Error._Visitor<_Result>) => _Result;
|
|
15
|
+
}
|
|
16
|
+
interface _Visitor<_Result> {
|
|
17
|
+
unprocessableEntityError: (value: FernVenusApi.HttpValidationError) => _Result;
|
|
18
|
+
_other: (value: core.Fetcher.Error) => _Result;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export declare const Error: {
|
|
22
|
+
readonly unprocessableEntityError: (value: FernVenusApi.HttpValidationError) => FernVenusApi.guestSession.delete.Error.UnprocessableEntityError;
|
|
23
|
+
readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.guestSession.delete.Error._Unknown;
|
|
24
|
+
readonly _visit: <_Result>(value: FernVenusApi.guestSession.delete.Error, visitor: FernVenusApi.guestSession.delete.Error._Visitor<_Result>) => _Result;
|
|
25
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as FernVenusApi from "../../../index.mjs";
|
|
3
|
+
export const Error = {
|
|
4
|
+
unprocessableEntityError: (value) => {
|
|
5
|
+
return {
|
|
6
|
+
content: value,
|
|
7
|
+
statusCode: 422,
|
|
8
|
+
_visit: function (visitor) {
|
|
9
|
+
return FernVenusApi.guestSession.delete.Error._visit(this, visitor);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
_unknown: (fetcherError) => {
|
|
14
|
+
return {
|
|
15
|
+
statusCode: undefined,
|
|
16
|
+
content: fetcherError,
|
|
17
|
+
_visit: function (visitor) {
|
|
18
|
+
return FernVenusApi.guestSession.delete.Error._visit(this, visitor);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
_visit: (value, visitor) => {
|
|
23
|
+
switch (value.statusCode) {
|
|
24
|
+
case 422:
|
|
25
|
+
return visitor.unprocessableEntityError(value.content);
|
|
26
|
+
default:
|
|
27
|
+
return visitor._other(value.content);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type * as core from "../../../../core/index.mjs";
|
|
2
|
+
import * as FernVenusApi from "../../../index.mjs";
|
|
3
|
+
export type Error = FernVenusApi.guestSession.get.Error.NotFoundError | FernVenusApi.guestSession.get.Error.GoneError | FernVenusApi.guestSession.get.Error.UnprocessableEntityError | FernVenusApi.guestSession.get.Error.ServiceUnavailableError | FernVenusApi.guestSession.get.Error._Unknown;
|
|
4
|
+
export declare namespace Error {
|
|
5
|
+
interface NotFoundError extends _Utils {
|
|
6
|
+
statusCode: 404;
|
|
7
|
+
content: FernVenusApi.NotFoundErrorBody;
|
|
8
|
+
}
|
|
9
|
+
interface GoneError extends _Utils {
|
|
10
|
+
statusCode: 410;
|
|
11
|
+
content: FernVenusApi.GoneErrorBody;
|
|
12
|
+
}
|
|
13
|
+
interface UnprocessableEntityError extends _Utils {
|
|
14
|
+
statusCode: 422;
|
|
15
|
+
content: FernVenusApi.HttpValidationError;
|
|
16
|
+
}
|
|
17
|
+
interface ServiceUnavailableError extends _Utils {
|
|
18
|
+
statusCode: 503;
|
|
19
|
+
content?: unknown;
|
|
20
|
+
}
|
|
21
|
+
interface _Unknown extends _Utils {
|
|
22
|
+
statusCode: void;
|
|
23
|
+
content: core.Fetcher.Error;
|
|
24
|
+
}
|
|
25
|
+
interface _Utils {
|
|
26
|
+
_visit: <_Result>(visitor: FernVenusApi.guestSession.get.Error._Visitor<_Result>) => _Result;
|
|
27
|
+
}
|
|
28
|
+
interface _Visitor<_Result> {
|
|
29
|
+
notFoundError: (value: FernVenusApi.NotFoundErrorBody) => _Result;
|
|
30
|
+
goneError: (value: FernVenusApi.GoneErrorBody) => _Result;
|
|
31
|
+
unprocessableEntityError: (value: FernVenusApi.HttpValidationError) => _Result;
|
|
32
|
+
serviceUnavailableError: (value: unknown) => _Result;
|
|
33
|
+
_other: (value: core.Fetcher.Error) => _Result;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export declare const Error: {
|
|
37
|
+
readonly notFoundError: (value: FernVenusApi.NotFoundErrorBody) => FernVenusApi.guestSession.get.Error.NotFoundError;
|
|
38
|
+
readonly goneError: (value: FernVenusApi.GoneErrorBody) => FernVenusApi.guestSession.get.Error.GoneError;
|
|
39
|
+
readonly unprocessableEntityError: (value: FernVenusApi.HttpValidationError) => FernVenusApi.guestSession.get.Error.UnprocessableEntityError;
|
|
40
|
+
readonly serviceUnavailableError: (value?: unknown) => FernVenusApi.guestSession.get.Error.ServiceUnavailableError;
|
|
41
|
+
readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.guestSession.get.Error._Unknown;
|
|
42
|
+
readonly _visit: <_Result>(value: FernVenusApi.guestSession.get.Error, visitor: FernVenusApi.guestSession.get.Error._Visitor<_Result>) => _Result;
|
|
43
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as FernVenusApi from "../../../index.mjs";
|
|
3
|
+
export const Error = {
|
|
4
|
+
notFoundError: (value) => {
|
|
5
|
+
return {
|
|
6
|
+
content: value,
|
|
7
|
+
statusCode: 404,
|
|
8
|
+
_visit: function (visitor) {
|
|
9
|
+
return FernVenusApi.guestSession.get.Error._visit(this, visitor);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
goneError: (value) => {
|
|
14
|
+
return {
|
|
15
|
+
content: value,
|
|
16
|
+
statusCode: 410,
|
|
17
|
+
_visit: function (visitor) {
|
|
18
|
+
return FernVenusApi.guestSession.get.Error._visit(this, visitor);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
unprocessableEntityError: (value) => {
|
|
23
|
+
return {
|
|
24
|
+
content: value,
|
|
25
|
+
statusCode: 422,
|
|
26
|
+
_visit: function (visitor) {
|
|
27
|
+
return FernVenusApi.guestSession.get.Error._visit(this, visitor);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
serviceUnavailableError: (value) => {
|
|
32
|
+
return {
|
|
33
|
+
content: value,
|
|
34
|
+
statusCode: 503,
|
|
35
|
+
_visit: function (visitor) {
|
|
36
|
+
return FernVenusApi.guestSession.get.Error._visit(this, visitor);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
_unknown: (fetcherError) => {
|
|
41
|
+
return {
|
|
42
|
+
statusCode: undefined,
|
|
43
|
+
content: fetcherError,
|
|
44
|
+
_visit: function (visitor) {
|
|
45
|
+
return FernVenusApi.guestSession.get.Error._visit(this, visitor);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
_visit: (value, visitor) => {
|
|
50
|
+
switch (value.statusCode) {
|
|
51
|
+
case 404:
|
|
52
|
+
return visitor.notFoundError(value.content);
|
|
53
|
+
case 410:
|
|
54
|
+
return visitor.goneError(value.content);
|
|
55
|
+
case 422:
|
|
56
|
+
return visitor.unprocessableEntityError(value.content);
|
|
57
|
+
case 503:
|
|
58
|
+
return visitor.serviceUnavailableError(value.content);
|
|
59
|
+
default:
|
|
60
|
+
return visitor._other(value.content);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
};
|